@arbidocs/client 0.4.49 → 0.4.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1034,7 +1034,13 @@ interface paths {
1034
1034
  path?: never;
1035
1035
  cookie?: never;
1036
1036
  };
1037
- /** Bootstrap Native */
1037
+ /**
1038
+ * Bootstrap Native
1039
+ * @description Initial content of a room: its stored state, or the source document.
1040
+ *
1041
+ * ``fresh`` ignores stored state so the collaboration service can start over from the saved document
1042
+ * when the state was written in a room format it no longer reads.
1043
+ */
1038
1044
  get: operations['bootstrap_native_v1_editor_internal_rooms__room_id__bootstrap_get'];
1039
1045
  put?: never;
1040
1046
  post?: never;
@@ -2640,6 +2646,54 @@ interface paths {
2640
2646
  patch?: never;
2641
2647
  trace?: never;
2642
2648
  };
2649
+ '/v1/notifications/attachments': {
2650
+ parameters: {
2651
+ query?: never;
2652
+ header?: never;
2653
+ path?: never;
2654
+ cookie?: never;
2655
+ };
2656
+ get?: never;
2657
+ put?: never;
2658
+ /**
2659
+ * Upload Dm Attachment
2660
+ * @description Upload one client-encrypted DM attachment (multipart ``file``, at most 15 MB).
2661
+ *
2662
+ * The body is SecretBox ciphertext the client produced with a fresh per-file key; the server stores it
2663
+ * as-is and never sees the key. Upload once, then name the returned ``external_id`` in
2664
+ * ``attachment_ext_ids`` when sending the DM — to any number of recipients. An upload that is never
2665
+ * sent is removed after 24 hours.
2666
+ */
2667
+ post: operations['upload_dm_attachment'];
2668
+ delete?: never;
2669
+ options?: never;
2670
+ head?: never;
2671
+ patch?: never;
2672
+ trace?: never;
2673
+ };
2674
+ '/v1/notifications/attachments/{external_id}': {
2675
+ parameters: {
2676
+ query?: never;
2677
+ header?: never;
2678
+ path?: never;
2679
+ cookie?: never;
2680
+ };
2681
+ /**
2682
+ * Download Dm Attachment
2683
+ * @description Download a DM attachment's ciphertext.
2684
+ *
2685
+ * Allowed for the uploader and for the sender or recipient of a DM that links it; everyone else gets
2686
+ * 404, the same as for an id that does not exist. The client decrypts with the key from its manifest.
2687
+ */
2688
+ get: operations['download_dm_attachment'];
2689
+ put?: never;
2690
+ post?: never;
2691
+ delete?: never;
2692
+ options?: never;
2693
+ head?: never;
2694
+ patch?: never;
2695
+ trace?: never;
2696
+ };
2643
2697
  '/v1/notifications/': {
2644
2698
  parameters: {
2645
2699
  query?: never;
@@ -2668,12 +2722,17 @@ interface paths {
2668
2722
  * Creates bilateral notifications visible to both sender and recipient.
2669
2723
  * If recipient is online via WebSocket, delivers in real-time.
2670
2724
  *
2725
+ * ``attachment_ext_ids`` must be the sender's own uploads (404 otherwise); each is linked to every
2726
+ * notification created here, and each recipient's ``attachments`` manifest carries the keys.
2727
+ *
2671
2728
  * Returns the created notifications.
2672
2729
  */
2673
2730
  post: operations['send_messages'];
2674
2731
  /**
2675
2732
  * Delete Notifications
2676
2733
  * @description Delete one or more notifications (bilateral - sender or recipient can delete).
2734
+ *
2735
+ * Deleting a DM drops its attachment links; an attachment no DM links any more is deleted with its blob.
2677
2736
  */
2678
2737
  delete: operations['delete_notifications'];
2679
2738
  options?: never;
@@ -2684,6 +2743,7 @@ interface paths {
2684
2743
  *
2685
2744
  * Supports:
2686
2745
  * - content: Re-encrypt content (sender OR recipient can do this)
2746
+ * - attachments: Re-encrypt the attachment manifest (sender OR recipient; blobs are untouched)
2687
2747
  * - read: Mark as read (only recipient can do this)
2688
2748
  *
2689
2749
  * Returns the updated notifications.
@@ -7325,6 +7385,16 @@ interface components {
7325
7385
  /** External Ids */
7326
7386
  external_ids: string[];
7327
7387
  };
7388
+ /**
7389
+ * DmAttachmentUploadResponse
7390
+ * @description An uploaded, client-encrypted DM attachment blob.
7391
+ */
7392
+ DmAttachmentUploadResponse: {
7393
+ /** External Id */
7394
+ external_id: string;
7395
+ /** Size Bytes */
7396
+ size_bytes: number;
7397
+ };
7328
7398
  /**
7329
7399
  * DocMetadata
7330
7400
  * @description Structured model for document metadata stored in JSONB column.
@@ -8834,6 +8904,22 @@ interface components {
8834
8904
  /** Access */
8835
8905
  access: string;
8836
8906
  };
8907
+ /** MailDeliveryRecipient */
8908
+ MailDeliveryRecipient: {
8909
+ /** Email */
8910
+ email: string;
8911
+ /**
8912
+ * Status
8913
+ * @enum {string}
8914
+ */
8915
+ status: 'accepted' | 'rejected' | 'delayed' | 'failed' | 'delivered' | 'relayed' | 'expanded';
8916
+ /** Code */
8917
+ code?: string | null;
8918
+ /** Description */
8919
+ description: string;
8920
+ /** Updated At */
8921
+ updated_at: string;
8922
+ };
8837
8923
  /** MailDraftSaved */
8838
8924
  MailDraftSaved: {
8839
8925
  /** Id */
@@ -8902,6 +8988,10 @@ interface components {
8902
8988
  attachments?: components['schemas']['MailAttachment'][];
8903
8989
  /** Drafted By */
8904
8990
  drafted_by?: string | null;
8991
+ /** Delivery Status */
8992
+ delivery_status?: ('sent' | 'delivered' | 'delayed' | 'partially_bounced' | 'bounced') | null;
8993
+ /** Delivery */
8994
+ delivery?: components['schemas']['MailDeliveryRecipient'][];
8905
8995
  };
8906
8996
  /** MailMessagePage */
8907
8997
  MailMessagePage: {
@@ -9356,6 +9446,8 @@ interface components {
9356
9446
  recipient_ext_id: string;
9357
9447
  /** Content */
9358
9448
  content: string;
9449
+ /** Attachments */
9450
+ attachments?: string | null;
9359
9451
  };
9360
9452
  /**
9361
9453
  * MessageResponse
@@ -9662,6 +9754,8 @@ interface components {
9662
9754
  dm_context_only: boolean;
9663
9755
  /** Content */
9664
9756
  content?: string | null;
9757
+ /** Attachments */
9758
+ attachments?: string | null;
9665
9759
  /** Conversation Ext Id */
9666
9760
  conversation_ext_id?: string | null;
9667
9761
  /** Message Ext Id */
@@ -9689,13 +9783,14 @@ interface components {
9689
9783
  * Type is self-descriptive, no need to parse content field.
9690
9784
  * @enum {string}
9691
9785
  */
9692
- NotificationType: 'user_message' | 'workspaceuser_added_owner' | 'workspaceuser_added_collaborator' | 'workspaceuser_added_guest' | 'workspaceuser_removed' | 'workspaceuser_updated_owner' | 'workspaceuser_updated_collaborator' | 'workspaceuser_updated_guest' | 'contact_accepted' | 'signup_reward' | 'referral_reward' | 'native_mail_received' | 'mail_draft_ready' | 'email_reply' | 'quota_threshold_50' | 'quota_threshold_90' | 'quota_threshold_100' | 'doc_shared' | 'docx_mention' | 'workspace_access_request' | 'conversation_ready_for_review' | 'conversation_done' | 'conversation_approval_request' | 'conversation_notified' | 'workflow_failed' | 'agent_input_requested' | 'workflow_completed' | 'mailbox_sync_complete' | 'drive_sync_complete' | 'activity' | 'mention';
9786
+ NotificationType: 'user_message' | 'workspaceuser_added_owner' | 'workspaceuser_added_collaborator' | 'workspaceuser_added_guest' | 'workspaceuser_removed' | 'workspaceuser_updated_owner' | 'workspaceuser_updated_collaborator' | 'workspaceuser_updated_guest' | 'contact_accepted' | 'signup_reward' | 'referral_reward' | 'native_mail_received' | 'mail_draft_ready' | 'email_reply' | 'quota_threshold_50' | 'quota_threshold_90' | 'quota_threshold_100' | 'doc_shared' | 'docx_mention' | 'workspace_access_request' | 'conversation_ready_for_review' | 'conversation_done' | 'conversation_approval_request' | 'conversation_notified' | 'workflow_failed' | 'agent_input_requested' | 'workflow_completed' | 'task_started' | 'task_completed' | 'mailbox_sync_complete' | 'drive_sync_complete' | 'activity' | 'mention';
9693
9787
  /**
9694
9788
  * NotificationUpdate
9695
9789
  * @description Single notification update for bulk PATCH.
9696
9790
  *
9697
- * Supports two operations:
9791
+ * Supports three operations:
9698
9792
  * - content: Re-encrypt content (key rotation)
9793
+ * - attachments: Re-encrypt the attachment manifest (key rotation; the blobs are never touched)
9699
9794
  * - read: Mark as read (only recipient can do this)
9700
9795
  */
9701
9796
  NotificationUpdate: {
@@ -9703,6 +9798,8 @@ interface components {
9703
9798
  external_id: string;
9704
9799
  /** Content */
9705
9800
  content?: string | null;
9801
+ /** Attachments */
9802
+ attachments?: string | null;
9706
9803
  /** Read */
9707
9804
  read?: boolean | null;
9708
9805
  };
@@ -11900,8 +11997,6 @@ interface components {
11900
11997
  request_id: string;
11901
11998
  /** Draft Id */
11902
11999
  draft_id?: string | null;
11903
- /** Conversation Ext Id */
11904
- conversation_ext_id?: string | null;
11905
12000
  /** Recipients */
11906
12001
  recipients: components['schemas']['SecureMailRecipient'][];
11907
12002
  /** Ciphertext */
@@ -11919,6 +12014,11 @@ interface components {
11919
12014
  *
11920
12015
  * Each recipient gets the same logical message, encrypted with their
11921
12016
  * individual shared key (derived from X25519 DH).
12017
+ *
12018
+ * ``attachment_ext_ids`` names ciphertext blobs the sender uploaded through
12019
+ * ``POST /v1/notifications/attachments``; each is linked to every notification
12020
+ * this request creates. The keys that open them travel in each recipient's
12021
+ * encrypted ``attachments`` manifest.
11922
12022
  */
11923
12023
  SendMessageRequest: {
11924
12024
  /** Workspace Ext Id */
@@ -11930,6 +12030,8 @@ interface components {
11930
12030
  context_only: boolean;
11931
12031
  /** Messages */
11932
12032
  messages: components['schemas']['MessageRecipient'][];
12033
+ /** Attachment Ext Ids */
12034
+ attachment_ext_ids?: string[];
11933
12035
  };
11934
12036
  /** ServiceStatus */
11935
12037
  ServiceStatus: {
@@ -13343,7 +13445,7 @@ interface components {
13343
13445
  show_connector_sharepoint: boolean;
13344
13446
  /**
13345
13447
  * Show Connector Google
13346
- * @default false
13448
+ * @default true
13347
13449
  */
13348
13450
  show_connector_google: boolean;
13349
13451
  /**
@@ -15527,7 +15629,9 @@ interface operations {
15527
15629
  };
15528
15630
  bootstrap_native_v1_editor_internal_rooms__room_id__bootstrap_get: {
15529
15631
  parameters: {
15530
- query?: never;
15632
+ query?: {
15633
+ fresh?: boolean;
15634
+ };
15531
15635
  header?: never;
15532
15636
  path: {
15533
15637
  room_id: string;
@@ -17931,6 +18035,81 @@ interface operations {
17931
18035
  };
17932
18036
  };
17933
18037
  };
18038
+ upload_dm_attachment: {
18039
+ parameters: {
18040
+ query?: never;
18041
+ header?: never;
18042
+ path?: never;
18043
+ cookie?: never;
18044
+ };
18045
+ requestBody: {
18046
+ content: {
18047
+ 'multipart/form-data': {
18048
+ /**
18049
+ * Format: binary
18050
+ * @description The client-encrypted attachment (SecretBox ciphertext, nonce-prefixed)
18051
+ */
18052
+ file: string;
18053
+ };
18054
+ };
18055
+ };
18056
+ responses: {
18057
+ /** @description Successful Response */
18058
+ 201: {
18059
+ headers: {
18060
+ [name: string]: unknown;
18061
+ };
18062
+ content: {
18063
+ 'application/json': components['schemas']['DmAttachmentUploadResponse'];
18064
+ };
18065
+ };
18066
+ /** @description Attachment exceeds the 15 MB limit */
18067
+ 413: {
18068
+ headers: {
18069
+ [name: string]: unknown;
18070
+ };
18071
+ content?: never;
18072
+ };
18073
+ };
18074
+ };
18075
+ download_dm_attachment: {
18076
+ parameters: {
18077
+ query?: never;
18078
+ header?: never;
18079
+ path: {
18080
+ external_id: string;
18081
+ };
18082
+ cookie?: never;
18083
+ };
18084
+ requestBody?: never;
18085
+ responses: {
18086
+ /** @description The attachment ciphertext */
18087
+ 200: {
18088
+ headers: {
18089
+ [name: string]: unknown;
18090
+ };
18091
+ content: {
18092
+ 'application/octet-stream': string;
18093
+ };
18094
+ };
18095
+ /** @description No such attachment, or not visible to the caller */
18096
+ 404: {
18097
+ headers: {
18098
+ [name: string]: unknown;
18099
+ };
18100
+ content?: never;
18101
+ };
18102
+ /** @description Validation Error */
18103
+ 422: {
18104
+ headers: {
18105
+ [name: string]: unknown;
18106
+ };
18107
+ content: {
18108
+ 'application/json': components['schemas']['HTTPValidationError'];
18109
+ };
18110
+ };
18111
+ };
18112
+ };
17934
18113
  get_notifications: {
17935
18114
  parameters: {
17936
18115
  query?: {
package/dist/index.d.ts CHANGED
@@ -1034,7 +1034,13 @@ interface paths {
1034
1034
  path?: never;
1035
1035
  cookie?: never;
1036
1036
  };
1037
- /** Bootstrap Native */
1037
+ /**
1038
+ * Bootstrap Native
1039
+ * @description Initial content of a room: its stored state, or the source document.
1040
+ *
1041
+ * ``fresh`` ignores stored state so the collaboration service can start over from the saved document
1042
+ * when the state was written in a room format it no longer reads.
1043
+ */
1038
1044
  get: operations['bootstrap_native_v1_editor_internal_rooms__room_id__bootstrap_get'];
1039
1045
  put?: never;
1040
1046
  post?: never;
@@ -2640,6 +2646,54 @@ interface paths {
2640
2646
  patch?: never;
2641
2647
  trace?: never;
2642
2648
  };
2649
+ '/v1/notifications/attachments': {
2650
+ parameters: {
2651
+ query?: never;
2652
+ header?: never;
2653
+ path?: never;
2654
+ cookie?: never;
2655
+ };
2656
+ get?: never;
2657
+ put?: never;
2658
+ /**
2659
+ * Upload Dm Attachment
2660
+ * @description Upload one client-encrypted DM attachment (multipart ``file``, at most 15 MB).
2661
+ *
2662
+ * The body is SecretBox ciphertext the client produced with a fresh per-file key; the server stores it
2663
+ * as-is and never sees the key. Upload once, then name the returned ``external_id`` in
2664
+ * ``attachment_ext_ids`` when sending the DM — to any number of recipients. An upload that is never
2665
+ * sent is removed after 24 hours.
2666
+ */
2667
+ post: operations['upload_dm_attachment'];
2668
+ delete?: never;
2669
+ options?: never;
2670
+ head?: never;
2671
+ patch?: never;
2672
+ trace?: never;
2673
+ };
2674
+ '/v1/notifications/attachments/{external_id}': {
2675
+ parameters: {
2676
+ query?: never;
2677
+ header?: never;
2678
+ path?: never;
2679
+ cookie?: never;
2680
+ };
2681
+ /**
2682
+ * Download Dm Attachment
2683
+ * @description Download a DM attachment's ciphertext.
2684
+ *
2685
+ * Allowed for the uploader and for the sender or recipient of a DM that links it; everyone else gets
2686
+ * 404, the same as for an id that does not exist. The client decrypts with the key from its manifest.
2687
+ */
2688
+ get: operations['download_dm_attachment'];
2689
+ put?: never;
2690
+ post?: never;
2691
+ delete?: never;
2692
+ options?: never;
2693
+ head?: never;
2694
+ patch?: never;
2695
+ trace?: never;
2696
+ };
2643
2697
  '/v1/notifications/': {
2644
2698
  parameters: {
2645
2699
  query?: never;
@@ -2668,12 +2722,17 @@ interface paths {
2668
2722
  * Creates bilateral notifications visible to both sender and recipient.
2669
2723
  * If recipient is online via WebSocket, delivers in real-time.
2670
2724
  *
2725
+ * ``attachment_ext_ids`` must be the sender's own uploads (404 otherwise); each is linked to every
2726
+ * notification created here, and each recipient's ``attachments`` manifest carries the keys.
2727
+ *
2671
2728
  * Returns the created notifications.
2672
2729
  */
2673
2730
  post: operations['send_messages'];
2674
2731
  /**
2675
2732
  * Delete Notifications
2676
2733
  * @description Delete one or more notifications (bilateral - sender or recipient can delete).
2734
+ *
2735
+ * Deleting a DM drops its attachment links; an attachment no DM links any more is deleted with its blob.
2677
2736
  */
2678
2737
  delete: operations['delete_notifications'];
2679
2738
  options?: never;
@@ -2684,6 +2743,7 @@ interface paths {
2684
2743
  *
2685
2744
  * Supports:
2686
2745
  * - content: Re-encrypt content (sender OR recipient can do this)
2746
+ * - attachments: Re-encrypt the attachment manifest (sender OR recipient; blobs are untouched)
2687
2747
  * - read: Mark as read (only recipient can do this)
2688
2748
  *
2689
2749
  * Returns the updated notifications.
@@ -7325,6 +7385,16 @@ interface components {
7325
7385
  /** External Ids */
7326
7386
  external_ids: string[];
7327
7387
  };
7388
+ /**
7389
+ * DmAttachmentUploadResponse
7390
+ * @description An uploaded, client-encrypted DM attachment blob.
7391
+ */
7392
+ DmAttachmentUploadResponse: {
7393
+ /** External Id */
7394
+ external_id: string;
7395
+ /** Size Bytes */
7396
+ size_bytes: number;
7397
+ };
7328
7398
  /**
7329
7399
  * DocMetadata
7330
7400
  * @description Structured model for document metadata stored in JSONB column.
@@ -8834,6 +8904,22 @@ interface components {
8834
8904
  /** Access */
8835
8905
  access: string;
8836
8906
  };
8907
+ /** MailDeliveryRecipient */
8908
+ MailDeliveryRecipient: {
8909
+ /** Email */
8910
+ email: string;
8911
+ /**
8912
+ * Status
8913
+ * @enum {string}
8914
+ */
8915
+ status: 'accepted' | 'rejected' | 'delayed' | 'failed' | 'delivered' | 'relayed' | 'expanded';
8916
+ /** Code */
8917
+ code?: string | null;
8918
+ /** Description */
8919
+ description: string;
8920
+ /** Updated At */
8921
+ updated_at: string;
8922
+ };
8837
8923
  /** MailDraftSaved */
8838
8924
  MailDraftSaved: {
8839
8925
  /** Id */
@@ -8902,6 +8988,10 @@ interface components {
8902
8988
  attachments?: components['schemas']['MailAttachment'][];
8903
8989
  /** Drafted By */
8904
8990
  drafted_by?: string | null;
8991
+ /** Delivery Status */
8992
+ delivery_status?: ('sent' | 'delivered' | 'delayed' | 'partially_bounced' | 'bounced') | null;
8993
+ /** Delivery */
8994
+ delivery?: components['schemas']['MailDeliveryRecipient'][];
8905
8995
  };
8906
8996
  /** MailMessagePage */
8907
8997
  MailMessagePage: {
@@ -9356,6 +9446,8 @@ interface components {
9356
9446
  recipient_ext_id: string;
9357
9447
  /** Content */
9358
9448
  content: string;
9449
+ /** Attachments */
9450
+ attachments?: string | null;
9359
9451
  };
9360
9452
  /**
9361
9453
  * MessageResponse
@@ -9662,6 +9754,8 @@ interface components {
9662
9754
  dm_context_only: boolean;
9663
9755
  /** Content */
9664
9756
  content?: string | null;
9757
+ /** Attachments */
9758
+ attachments?: string | null;
9665
9759
  /** Conversation Ext Id */
9666
9760
  conversation_ext_id?: string | null;
9667
9761
  /** Message Ext Id */
@@ -9689,13 +9783,14 @@ interface components {
9689
9783
  * Type is self-descriptive, no need to parse content field.
9690
9784
  * @enum {string}
9691
9785
  */
9692
- NotificationType: 'user_message' | 'workspaceuser_added_owner' | 'workspaceuser_added_collaborator' | 'workspaceuser_added_guest' | 'workspaceuser_removed' | 'workspaceuser_updated_owner' | 'workspaceuser_updated_collaborator' | 'workspaceuser_updated_guest' | 'contact_accepted' | 'signup_reward' | 'referral_reward' | 'native_mail_received' | 'mail_draft_ready' | 'email_reply' | 'quota_threshold_50' | 'quota_threshold_90' | 'quota_threshold_100' | 'doc_shared' | 'docx_mention' | 'workspace_access_request' | 'conversation_ready_for_review' | 'conversation_done' | 'conversation_approval_request' | 'conversation_notified' | 'workflow_failed' | 'agent_input_requested' | 'workflow_completed' | 'mailbox_sync_complete' | 'drive_sync_complete' | 'activity' | 'mention';
9786
+ NotificationType: 'user_message' | 'workspaceuser_added_owner' | 'workspaceuser_added_collaborator' | 'workspaceuser_added_guest' | 'workspaceuser_removed' | 'workspaceuser_updated_owner' | 'workspaceuser_updated_collaborator' | 'workspaceuser_updated_guest' | 'contact_accepted' | 'signup_reward' | 'referral_reward' | 'native_mail_received' | 'mail_draft_ready' | 'email_reply' | 'quota_threshold_50' | 'quota_threshold_90' | 'quota_threshold_100' | 'doc_shared' | 'docx_mention' | 'workspace_access_request' | 'conversation_ready_for_review' | 'conversation_done' | 'conversation_approval_request' | 'conversation_notified' | 'workflow_failed' | 'agent_input_requested' | 'workflow_completed' | 'task_started' | 'task_completed' | 'mailbox_sync_complete' | 'drive_sync_complete' | 'activity' | 'mention';
9693
9787
  /**
9694
9788
  * NotificationUpdate
9695
9789
  * @description Single notification update for bulk PATCH.
9696
9790
  *
9697
- * Supports two operations:
9791
+ * Supports three operations:
9698
9792
  * - content: Re-encrypt content (key rotation)
9793
+ * - attachments: Re-encrypt the attachment manifest (key rotation; the blobs are never touched)
9699
9794
  * - read: Mark as read (only recipient can do this)
9700
9795
  */
9701
9796
  NotificationUpdate: {
@@ -9703,6 +9798,8 @@ interface components {
9703
9798
  external_id: string;
9704
9799
  /** Content */
9705
9800
  content?: string | null;
9801
+ /** Attachments */
9802
+ attachments?: string | null;
9706
9803
  /** Read */
9707
9804
  read?: boolean | null;
9708
9805
  };
@@ -11900,8 +11997,6 @@ interface components {
11900
11997
  request_id: string;
11901
11998
  /** Draft Id */
11902
11999
  draft_id?: string | null;
11903
- /** Conversation Ext Id */
11904
- conversation_ext_id?: string | null;
11905
12000
  /** Recipients */
11906
12001
  recipients: components['schemas']['SecureMailRecipient'][];
11907
12002
  /** Ciphertext */
@@ -11919,6 +12014,11 @@ interface components {
11919
12014
  *
11920
12015
  * Each recipient gets the same logical message, encrypted with their
11921
12016
  * individual shared key (derived from X25519 DH).
12017
+ *
12018
+ * ``attachment_ext_ids`` names ciphertext blobs the sender uploaded through
12019
+ * ``POST /v1/notifications/attachments``; each is linked to every notification
12020
+ * this request creates. The keys that open them travel in each recipient's
12021
+ * encrypted ``attachments`` manifest.
11922
12022
  */
11923
12023
  SendMessageRequest: {
11924
12024
  /** Workspace Ext Id */
@@ -11930,6 +12030,8 @@ interface components {
11930
12030
  context_only: boolean;
11931
12031
  /** Messages */
11932
12032
  messages: components['schemas']['MessageRecipient'][];
12033
+ /** Attachment Ext Ids */
12034
+ attachment_ext_ids?: string[];
11933
12035
  };
11934
12036
  /** ServiceStatus */
11935
12037
  ServiceStatus: {
@@ -13343,7 +13445,7 @@ interface components {
13343
13445
  show_connector_sharepoint: boolean;
13344
13446
  /**
13345
13447
  * Show Connector Google
13346
- * @default false
13448
+ * @default true
13347
13449
  */
13348
13450
  show_connector_google: boolean;
13349
13451
  /**
@@ -15527,7 +15629,9 @@ interface operations {
15527
15629
  };
15528
15630
  bootstrap_native_v1_editor_internal_rooms__room_id__bootstrap_get: {
15529
15631
  parameters: {
15530
- query?: never;
15632
+ query?: {
15633
+ fresh?: boolean;
15634
+ };
15531
15635
  header?: never;
15532
15636
  path: {
15533
15637
  room_id: string;
@@ -17931,6 +18035,81 @@ interface operations {
17931
18035
  };
17932
18036
  };
17933
18037
  };
18038
+ upload_dm_attachment: {
18039
+ parameters: {
18040
+ query?: never;
18041
+ header?: never;
18042
+ path?: never;
18043
+ cookie?: never;
18044
+ };
18045
+ requestBody: {
18046
+ content: {
18047
+ 'multipart/form-data': {
18048
+ /**
18049
+ * Format: binary
18050
+ * @description The client-encrypted attachment (SecretBox ciphertext, nonce-prefixed)
18051
+ */
18052
+ file: string;
18053
+ };
18054
+ };
18055
+ };
18056
+ responses: {
18057
+ /** @description Successful Response */
18058
+ 201: {
18059
+ headers: {
18060
+ [name: string]: unknown;
18061
+ };
18062
+ content: {
18063
+ 'application/json': components['schemas']['DmAttachmentUploadResponse'];
18064
+ };
18065
+ };
18066
+ /** @description Attachment exceeds the 15 MB limit */
18067
+ 413: {
18068
+ headers: {
18069
+ [name: string]: unknown;
18070
+ };
18071
+ content?: never;
18072
+ };
18073
+ };
18074
+ };
18075
+ download_dm_attachment: {
18076
+ parameters: {
18077
+ query?: never;
18078
+ header?: never;
18079
+ path: {
18080
+ external_id: string;
18081
+ };
18082
+ cookie?: never;
18083
+ };
18084
+ requestBody?: never;
18085
+ responses: {
18086
+ /** @description The attachment ciphertext */
18087
+ 200: {
18088
+ headers: {
18089
+ [name: string]: unknown;
18090
+ };
18091
+ content: {
18092
+ 'application/octet-stream': string;
18093
+ };
18094
+ };
18095
+ /** @description No such attachment, or not visible to the caller */
18096
+ 404: {
18097
+ headers: {
18098
+ [name: string]: unknown;
18099
+ };
18100
+ content?: never;
18101
+ };
18102
+ /** @description Validation Error */
18103
+ 422: {
18104
+ headers: {
18105
+ [name: string]: unknown;
18106
+ };
18107
+ content: {
18108
+ 'application/json': components['schemas']['HTTPValidationError'];
18109
+ };
18110
+ };
18111
+ };
18112
+ };
17934
18113
  get_notifications: {
17935
18114
  parameters: {
17936
18115
  query?: {
package/dist/index.js CHANGED
@@ -1078,7 +1078,9 @@ function passwordChangeErrorMessage(err) {
1078
1078
  }
1079
1079
  async function reEncryptDirectMessages(fetchClient, userExtId, oldSecretKey, newSecretKey) {
1080
1080
  const { data } = await fetchClient.GET("/v1/notifications/");
1081
- const messages = (data ?? []).filter((n) => n.type === "user_message" && n.content);
1081
+ const messages = (data ?? []).filter(
1082
+ (n) => n.type === "user_message" && (n.content || n.attachments)
1083
+ );
1082
1084
  const oldSecrets = {};
1083
1085
  const newSecrets = {};
1084
1086
  const updates = [];
@@ -1088,10 +1090,16 @@ async function reEncryptDirectMessages(fetchClient, userExtId, oldSecretKey, new
1088
1090
  const id = other.external_id;
1089
1091
  oldSecrets[id] ??= await computeSharedSecret(other.encryption_public_key, oldSecretKey);
1090
1092
  newSecrets[id] ??= await computeSharedSecret(other.encryption_public_key, newSecretKey);
1091
- const plain = await decryptMessageWithSharedSecret(n.content, oldSecrets[id]);
1093
+ const reEncrypt = async (ciphertext) => encryptMessageWithSharedSecret(
1094
+ await decryptMessageWithSharedSecret(ciphertext, oldSecrets[id]),
1095
+ newSecrets[id]
1096
+ );
1097
+ const content = n.content ? await reEncrypt(n.content) : void 0;
1098
+ const attachments = n.attachments ? await reEncrypt(n.attachments) : void 0;
1092
1099
  updates.push({
1093
1100
  external_id: n.external_id,
1094
- content: await encryptMessageWithSharedSecret(plain, newSecrets[id])
1101
+ ...content !== void 0 ? { content } : {},
1102
+ ...attachments !== void 0 ? { attachments } : {}
1095
1103
  });
1096
1104
  } catch {
1097
1105
  }