diff --git a/base_operations.yaml b/base_operations.yaml index f8738fb..f519887 100644 --- a/base_operations.yaml +++ b/base_operations.yaml @@ -2472,6 +2472,7 @@ paths: name: Jasmin Tee contact_email: jasmintee@example.com avatar_url: https://cloud.seatable.io/media/avatars/default.png + app_user_list: [] # Rows /api-gateway/api/v2/dtables/{base_uuid}/sql/: @@ -4531,6 +4532,7 @@ paths: example: notification_list: - id: 200 + dtable_uuid: 12345678-7e27-46a8-8b18-6cc6f3db2057 username: 123456786569491ba42905bf1647fd3f@auth.local msg_type: row_comment created_at: "2021-02-25T10:38:14.000Z" @@ -4686,19 +4688,25 @@ paths: type: object example: operations: - - author: 12345678d1754bb4afa2c2cb7369d244@auth.local + - id: 245 + dtable_uuid: 12345678-7e27-46a8-8b18-6cc6f3db2057 + author: 12345678d1754bb4afa2c2cb7369d244@auth.local app: null op_time: 1610981745927 operation: >- {"op_type":"delete_column","table_id":"0000","column_key":"iJB4","old_column":{"rowType":"header","key":"iJB4","type":null,"name":null,"editable":true,"width":200,"resizable":true,"draggable":true,"data":null,"permission_type":"","permitted_users":[],"editor":{"key":null,"ref":null,"props":{},"_owner":null},"formatter":null,"left":1058,"idx":5},"upper_column_key":"LfGJ"} op_id: 118 - - author: 12345678d1754bb4afa2c2cb7369d244@auth.local + - id: 244 + dtable_uuid: 12345678-7e27-46a8-8b18-6cc6f3db2057 + author: 12345678d1754bb4afa2c2cb7369d244@auth.local app: null op_time: 1610981742518 operation: >- {"op_type":"delete_column","table_id":"0000","column_key":"J2mq","old_column":{"rowType":"header","key":"J2mq","type":null,"name":null,"editable":true,"width":200,"resizable":true,"draggable":true,"data":null,"permission_type":"","permitted_users":[],"editor":{"key":null,"ref":null,"props":{},"_owner":null},"formatter":null,"left":280,"idx":2},"upper_column_key":"0000"} op_id: 117 - - author: 12345678d1754bb4afa2c2cb7369d244@auth.local + - id: 243 + dtable_uuid: 12345678-7e27-46a8-8b18-6cc6f3db2057 + author: 12345678d1754bb4afa2c2cb7369d244@auth.local app: null op_time: 1610981739830 operation: >- @@ -4729,8 +4737,10 @@ paths: activities: - id: 6782 dtable_uuid: a57b56d3-1cc5-4ebd-8a6c-a1b28ac3dbdf + row_count: 1 row_id: YMIviMeERQCUiQhPPqo6Gw op_user: 0ef256cb715841dd81b147b2530c2904@auth.local + op_app: "" op_type: modify_row op_time: "2021-01-14T09:01:57.000Z" detail: @@ -4747,8 +4757,10 @@ paths: old_value: "2020-08-16" - id: 6778 dtable_uuid: a57b56d3-1cc5-4ebd-8a6c-a1b28ac3dbdf + row_count: 1 row_id: YMIviMeERQCUiQhPPqo6Gw op_user: 0ef256cb715841dd81b147b2530c2904@auth.local + op_app: "" op_type: modify_row op_time: "2021-01-14T08:56:53.000Z" detail: @@ -4771,8 +4783,10 @@ paths: old_value: "" - id: 5960 dtable_uuid: a57b56d3-1cc5-4ebd-8a6c-a1b28ac3dbdf + row_count: 1 row_id: YMIviMeERQCUiQhPPqo6Gw op_user: 0ef256cb715841dd81b147b2530c2904@auth.local + op_app: "" op_type: insert_row op_time: "2020-11-18T12:42:14.000Z" detail: diff --git a/tests/__snapshots__/test_activities/test_getBaseActivityLog.json b/tests/__snapshots__/test_activities/test_getBaseActivityLog.json index 20b655b..c50a839 100644 --- a/tests/__snapshots__/test_activities/test_getBaseActivityLog.json +++ b/tests/__snapshots__/test_activities/test_getBaseActivityLog.json @@ -3,6 +3,8 @@ { "app": "", "author": "str", + "dtable_uuid": "str", + "id": "int", "op_id": "int", "op_time": "int", "operation": "str" @@ -10,6 +12,8 @@ { "app": null, "author": "str", + "dtable_uuid": "str", + "id": "int", "op_id": "int", "op_time": "int", "operation": "str" diff --git a/tests/__snapshots__/test_activities/test_listRowActivities.json b/tests/__snapshots__/test_activities/test_listRowActivities.json index 3818fca..9dc8512 100644 --- a/tests/__snapshots__/test_activities/test_listRowActivities.json +++ b/tests/__snapshots__/test_activities/test_listRowActivities.json @@ -10,9 +10,11 @@ }, "dtable_uuid": "str", "id": "int", + "op_app": "", "op_time": "str", "op_type": "insert_row", "op_user": "str", + "row_count": 1, "row_id": "str" } ], diff --git a/tests/__snapshots__/test_metadata/test_listCollaborators.json b/tests/__snapshots__/test_metadata/test_listCollaborators.json index c9230fb..5937ed3 100644 --- a/tests/__snapshots__/test_metadata/test_listCollaborators.json +++ b/tests/__snapshots__/test_metadata/test_listCollaborators.json @@ -1,4 +1,5 @@ { + "app_user_list": [], "user_list": [ { "avatar_url": "str", diff --git a/tests/__snapshots__/test_notifications/test_listBaseNotifications_selected_collaborator.json b/tests/__snapshots__/test_notifications/test_listBaseNotifications_selected_collaborator.json index 92ad909..f487785 100644 --- a/tests/__snapshots__/test_notifications/test_listBaseNotifications_selected_collaborator.json +++ b/tests/__snapshots__/test_notifications/test_listBaseNotifications_selected_collaborator.json @@ -7,6 +7,7 @@ "row_id": "str", "table_id": "str" }, + "dtable_uuid": "str", "id": "int", "msg_type": "selected_collaborator", "seen": 0, diff --git a/tests/__snapshots__/test_notifications/test_markBaseNotificationAsSeen.1.json b/tests/__snapshots__/test_notifications/test_markBaseNotificationAsSeen.1.json index b82d567..e6271c9 100644 --- a/tests/__snapshots__/test_notifications/test_markBaseNotificationAsSeen.1.json +++ b/tests/__snapshots__/test_notifications/test_markBaseNotificationAsSeen.1.json @@ -7,6 +7,7 @@ "row_id": "str", "table_id": "str" }, + "dtable_uuid": "str", "id": "int", "msg_type": "selected_collaborator", "seen": 1, diff --git a/tests/__snapshots__/test_notifications/test_markBaseNotificationsAsSeen.1.json b/tests/__snapshots__/test_notifications/test_markBaseNotificationsAsSeen.1.json index b82d567..e6271c9 100644 --- a/tests/__snapshots__/test_notifications/test_markBaseNotificationsAsSeen.1.json +++ b/tests/__snapshots__/test_notifications/test_markBaseNotificationsAsSeen.1.json @@ -7,6 +7,7 @@ "row_id": "str", "table_id": "str" }, + "dtable_uuid": "str", "id": "int", "msg_type": "selected_collaborator", "seen": 1, diff --git a/tests/test_activities.py b/tests/test_activities.py index bf3c74b..e24f70e 100644 --- a/tests/test_activities.py +++ b/tests/test_activities.py @@ -43,8 +43,11 @@ def test_getBaseActivityLog(base: Base, snapshot_json: SnapshotAssertion): if table_id in (operation.get('table_id'), operation.get('table_data', {}).get('_id')) ] + # dtable_uuid is masked in the snapshot, so check its format (with dashes) here + assert all(op['dtable_uuid'] == base.uuid for op in data['operations']) + matcher = path_type({ - r'operations\.\d+\.(author|op_id|op_time|operation)': (str, int), + r'operations\.\d+\.(author|dtable_uuid|id|op_id|op_time|operation)': (str, int), }, regex=True) assert snapshot_json(matcher=matcher) == data diff --git a/tests/test_notifications.py b/tests/test_notifications.py index 0c1082e..2435c4f 100644 --- a/tests/test_notifications.py +++ b/tests/test_notifications.py @@ -116,6 +116,8 @@ def _create_selected_collaborator_notification(base: Base, admin_base: Base, adm assert response.status_code == 200 data = response.json() if data['notification_list'] or time.monotonic() > deadline: + # dtable_uuid is masked in the snapshot, so check its format (with dashes) here + assert all(n['dtable_uuid'] == base.uuid for n in data['notification_list']) return data time.sleep(0.5) @@ -130,6 +132,7 @@ def _list_notifications(base: Base) -> dict: NOTIFICATION_MATCHER = path_type({ r'notification_list\..*\.id': (int,), + r'notification_list\..*\.dtable_uuid': (str,), r'notification_list\..*\.username': (str,), r'notification_list\..*\.created_at': (str,), r'notification_list\..*\.detail\.author': (str,),