@arbidocs/sdk 0.4.63 → 0.4.65

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.
@@ -857,11 +857,14 @@ interface UploadOptions {
857
857
  * backend's ``SkillManager`` recognises them. */
858
858
  wpType?: 'source' | 'skill' | 'artifact' | 'webpage';
859
859
  /**
860
- * Save the upload (a single file) as the next version of this document — any of its versions'
861
- * ids. It becomes the current version and takes the document's sharing, folder and labels.
860
+ * Save the upload (a single file) as the next version of this document. The document keeps its
861
+ * id, sharing, folder and labels; the result's `version` is the new version's number.
862
862
  */
863
863
  versionOf?: string;
864
- /** Record that the upload is a NEW document made from this one (provenance only), e.g. a crop. */
864
+ /**
865
+ * Record that the upload is a NEW document made from this one (provenance only), e.g. a crop.
866
+ * `docId` may name a version (`doc-…@v2`); a plain id means its current version.
867
+ */
865
868
  derivedFrom?: {
866
869
  docId: string;
867
870
  role: 'crop' | 'redline_base' | 'redline_revised';
@@ -873,6 +876,8 @@ interface SkippedFile {
873
876
  }
874
877
  interface UploadResult {
875
878
  doc_ext_ids?: string[];
879
+ /** For an upload saved as a new version (`versionOf`): its number (the id is unchanged). */
880
+ version?: number | null;
876
881
  batch_id?: string | null;
877
882
  skipped?: SkippedFile[];
878
883
  }
@@ -904,13 +909,29 @@ declare function listDocuments(arbi: ArbiClient): Promise<{
904
909
  re_ocred?: boolean | null | undefined;
905
910
  config_ext_id?: string | null | undefined;
906
911
  parent_ext_id?: string | null | undefined;
907
- lineage_id?: string | null | undefined;
908
- version_number: number;
909
- is_current: boolean;
912
+ current_version: number;
913
+ versions: {
914
+ n: number;
915
+ created_at?: string | null | undefined;
916
+ created_by_ext_id?: string | null | undefined;
917
+ reason: "upload" | "edit" | "signed" | "sync";
918
+ file_name?: string | null | undefined;
919
+ file_type?: string | null | undefined;
920
+ file_size?: number | null | undefined;
921
+ content_hash?: string | null | undefined;
922
+ status?: string | null | undefined;
923
+ n_pages?: number | null | undefined;
924
+ n_chunks?: number | null | undefined;
925
+ made_from?: number | null | undefined;
926
+ is_current: boolean;
927
+ markup_revision: number;
928
+ markup_count: number;
929
+ }[];
910
930
  thread_id?: string | null | undefined;
911
931
  derived_from: {
912
932
  doc_ext_id: string;
913
933
  role: components["schemas"]["DocRelationRole"];
934
+ version?: number | null | undefined;
914
935
  }[];
915
936
  source_message_ext_id?: string | null | undefined;
916
937
  conversation_ext_id?: string | null | undefined;
@@ -925,6 +946,7 @@ declare function listDocuments(arbi: ArbiClient): Promise<{
925
946
  note?: string | null | undefined;
926
947
  citations?: {
927
948
  doc_ext_id: string;
949
+ version?: number | null | undefined;
928
950
  chunks?: {
929
951
  chunk_id: string;
930
952
  page?: number | null | undefined;
@@ -1012,13 +1034,29 @@ declare function getDocuments(arbi: ArbiClient, externalIds: string[]): Promise<
1012
1034
  re_ocred?: boolean | null | undefined;
1013
1035
  config_ext_id?: string | null | undefined;
1014
1036
  parent_ext_id?: string | null | undefined;
1015
- lineage_id?: string | null | undefined;
1016
- version_number: number;
1017
- is_current: boolean;
1037
+ current_version: number;
1038
+ versions: {
1039
+ n: number;
1040
+ created_at?: string | null | undefined;
1041
+ created_by_ext_id?: string | null | undefined;
1042
+ reason: "upload" | "edit" | "signed" | "sync";
1043
+ file_name?: string | null | undefined;
1044
+ file_type?: string | null | undefined;
1045
+ file_size?: number | null | undefined;
1046
+ content_hash?: string | null | undefined;
1047
+ status?: string | null | undefined;
1048
+ n_pages?: number | null | undefined;
1049
+ n_chunks?: number | null | undefined;
1050
+ made_from?: number | null | undefined;
1051
+ is_current: boolean;
1052
+ markup_revision: number;
1053
+ markup_count: number;
1054
+ }[];
1018
1055
  thread_id?: string | null | undefined;
1019
1056
  derived_from: {
1020
1057
  doc_ext_id: string;
1021
1058
  role: components["schemas"]["DocRelationRole"];
1059
+ version?: number | null | undefined;
1022
1060
  }[];
1023
1061
  source_message_ext_id?: string | null | undefined;
1024
1062
  conversation_ext_id?: string | null | undefined;
@@ -1033,6 +1071,7 @@ declare function getDocuments(arbi: ArbiClient, externalIds: string[]): Promise<
1033
1071
  note?: string | null | undefined;
1034
1072
  citations?: {
1035
1073
  doc_ext_id: string;
1074
+ version?: number | null | undefined;
1036
1075
  chunks?: {
1037
1076
  chunk_id: string;
1038
1077
  page?: number | null | undefined;
@@ -1055,69 +1094,26 @@ declare function getDocuments(arbi: ArbiClient, externalIds: string[]): Promise<
1055
1094
  } | null | undefined;
1056
1095
  }[]>;
1057
1096
  /**
1058
- * Every version of the document `docId` belongs to (any version's id), oldest first; `is_current`
1059
- * marks the current one. Lists and search only show current versions.
1097
+ * Every version of the document `docId`, oldest first; `is_current` marks the current one. A
1098
+ * document keeps one id: older versions are read with a `version` (see `downloadDocument`,
1099
+ * `getParsedContent`) and asked about as `doc-…@v{n}`.
1060
1100
  */
1061
1101
  declare function listVersions(arbi: ArbiClient, docId: string): Promise<{
1062
- external_id: string;
1063
- workspace_ext_id: string;
1102
+ n: number;
1103
+ created_at?: string | null | undefined;
1104
+ created_by_ext_id?: string | null | undefined;
1105
+ reason: "upload" | "edit" | "signed" | "sync";
1064
1106
  file_name?: string | null | undefined;
1065
- status?: string | null | undefined;
1066
- error_message?: string | null | undefined;
1067
- failed_stage?: string | null | undefined;
1068
- n_pages?: number | null | undefined;
1069
- n_chunks?: number | null | undefined;
1070
- tokens?: number | null | undefined;
1071
1107
  file_type?: string | null | undefined;
1072
1108
  file_size?: number | null | undefined;
1073
- storage_type?: string | null | undefined;
1074
- storage_uri?: string | null | undefined;
1075
1109
  content_hash?: string | null | undefined;
1076
- shared?: boolean | null | undefined;
1077
- re_ocred?: boolean | null | undefined;
1078
- config_ext_id?: string | null | undefined;
1079
- parent_ext_id?: string | null | undefined;
1080
- lineage_id?: string | null | undefined;
1081
- version_number: number;
1110
+ status?: string | null | undefined;
1111
+ n_pages?: number | null | undefined;
1112
+ n_chunks?: number | null | undefined;
1113
+ made_from?: number | null | undefined;
1082
1114
  is_current: boolean;
1083
- thread_id?: string | null | undefined;
1084
- derived_from: {
1085
- doc_ext_id: string;
1086
- role: components["schemas"]["DocRelationRole"];
1087
- }[];
1088
- source_message_ext_id?: string | null | undefined;
1089
- conversation_ext_id?: string | null | undefined;
1090
- created_by_ext_id: string;
1091
- updated_by_ext_id?: string | null | undefined;
1092
- created_at: string;
1093
- updated_at: string;
1094
- wp_type?: string | null | undefined;
1095
- folder?: string | null | undefined;
1096
- sender?: string | null | undefined;
1097
- doctags: {
1098
- note?: string | null | undefined;
1099
- citations?: {
1100
- doc_ext_id: string;
1101
- chunks?: {
1102
- chunk_id: string;
1103
- page?: number | null | undefined;
1104
- }[] | undefined;
1105
- }[] | null | undefined;
1106
- external_id: string;
1107
- doc_ext_id: string;
1108
- tag_ext_id: string;
1109
- created_by_ext_id: string;
1110
- updated_by_ext_id?: string | null | undefined;
1111
- created_at: string;
1112
- updated_at: string;
1113
- }[];
1114
- doc_metadata?: {
1115
- doc_nature?: string | null | undefined;
1116
- doc_author?: string | null | undefined;
1117
- doc_subject?: string | null | undefined;
1118
- doc_date?: string | null | undefined;
1119
- title?: string | null | undefined;
1120
- } | null | undefined;
1115
+ markup_revision: number;
1116
+ markup_count: number;
1121
1117
  }[]>;
1122
1118
  /** Delete documents. A document goes with all its versions, and an email with its attachments. */
1123
1119
  declare function deleteDocuments(arbi: ArbiClient, externalIds: string[]): Promise<void>;
@@ -1140,13 +1136,29 @@ declare function updateDocuments(arbi: ArbiClient, documents: DocUpdateRequest$1
1140
1136
  re_ocred?: boolean | null | undefined;
1141
1137
  config_ext_id?: string | null | undefined;
1142
1138
  parent_ext_id?: string | null | undefined;
1143
- lineage_id?: string | null | undefined;
1144
- version_number: number;
1145
- is_current: boolean;
1139
+ current_version: number;
1140
+ versions: {
1141
+ n: number;
1142
+ created_at?: string | null | undefined;
1143
+ created_by_ext_id?: string | null | undefined;
1144
+ reason: "upload" | "edit" | "signed" | "sync";
1145
+ file_name?: string | null | undefined;
1146
+ file_type?: string | null | undefined;
1147
+ file_size?: number | null | undefined;
1148
+ content_hash?: string | null | undefined;
1149
+ status?: string | null | undefined;
1150
+ n_pages?: number | null | undefined;
1151
+ n_chunks?: number | null | undefined;
1152
+ made_from?: number | null | undefined;
1153
+ is_current: boolean;
1154
+ markup_revision: number;
1155
+ markup_count: number;
1156
+ }[];
1146
1157
  thread_id?: string | null | undefined;
1147
1158
  derived_from: {
1148
1159
  doc_ext_id: string;
1149
1160
  role: components["schemas"]["DocRelationRole"];
1161
+ version?: number | null | undefined;
1150
1162
  }[];
1151
1163
  source_message_ext_id?: string | null | undefined;
1152
1164
  conversation_ext_id?: string | null | undefined;
@@ -1161,6 +1173,7 @@ declare function updateDocuments(arbi: ArbiClient, documents: DocUpdateRequest$1
1161
1173
  note?: string | null | undefined;
1162
1174
  citations?: {
1163
1175
  doc_ext_id: string;
1176
+ version?: number | null | undefined;
1164
1177
  chunks?: {
1165
1178
  chunk_id: string;
1166
1179
  page?: number | null | undefined;
@@ -1189,6 +1202,7 @@ declare function updateDocuments(arbi: ArbiClient, documents: DocUpdateRequest$1
1189
1202
  */
1190
1203
  declare function uploadUrl(arbi: ArbiClient, urls: string[], shared?: boolean): Promise<{
1191
1204
  doc_ext_ids?: string[] | undefined;
1205
+ version?: number | null | undefined;
1192
1206
  batch_id?: string | null | undefined;
1193
1207
  skipped?: {
1194
1208
  file_name: string;
@@ -1198,7 +1212,7 @@ declare function uploadUrl(arbi: ArbiClient, urls: string[], shared?: boolean):
1198
1212
  /**
1199
1213
  * Get parsed document content.
1200
1214
  */
1201
- declare function getParsedContent(auth: AuthHeaders, docId: string, stage: string): Promise<Record<string, unknown>>;
1215
+ declare function getParsedContent(auth: AuthHeaders, docId: string, stage: string, version?: number): Promise<Record<string, unknown>>;
1202
1216
  /**
1203
1217
  * Batch-fetch first-page thumbnails for many documents in one request.
1204
1218
  *
@@ -1222,9 +1236,9 @@ declare function uploadFiles(auth: AuthHeaders, files: Array<{
1222
1236
  name: string;
1223
1237
  }>, options?: UploadOptions): Promise<UploadResult>;
1224
1238
  /**
1225
- * Download a document. Returns the response for the caller to handle.
1239
+ * Download a document (its current version, or `version`). Returns the response for the caller.
1226
1240
  */
1227
- declare function downloadDocument(auth: AuthHeaders, docId: string): Promise<Response>;
1241
+ declare function downloadDocument(auth: AuthHeaders, docId: string, version?: number): Promise<Response>;
1228
1242
  /**
1229
1243
  * One file prepared for the direct upload flow. The caller supplies raw,
1230
1244
  * pre-encryption bytes and a basename; the helper handles hashing + SecretBox
@@ -1265,8 +1279,13 @@ interface DirectUploadProgress {
1265
1279
  total: number;
1266
1280
  }
1267
1281
  interface UploadDirectResult {
1268
- /** Doc ext IDs that were committed and will process through the parse pipeline. */
1282
+ /**
1283
+ * Doc ext IDs that were committed and will process through the parse pipeline. For a
1284
+ * `versionOf` upload this is the document's own id (not the provisional init id).
1285
+ */
1269
1286
  doc_ext_ids: string[];
1287
+ /** For a `versionOf` upload: the new version's number. */
1288
+ version?: number | null;
1270
1289
  /**
1271
1290
  * Files that were not uploaded — either rejected at init (unsupported,
1272
1291
  * empty, duplicate, quota_exceeded) or reported back by the commit step
@@ -1453,6 +1472,7 @@ declare function getConversationThreads(arbi: ArbiClient, conversationId: string
1453
1472
  metadata: {
1454
1473
  workspace_ext_id?: string | null | undefined;
1455
1474
  doc_ext_id?: string | null | undefined;
1475
+ doc_version?: number | null | undefined;
1456
1476
  doc_title?: string | null | undefined;
1457
1477
  chunk_id?: string | null | undefined;
1458
1478
  chunk_ext_id: string;
@@ -1484,6 +1504,7 @@ declare function getConversationThreads(arbi: ArbiClient, conversationId: string
1484
1504
  metadata: {
1485
1505
  workspace_ext_id?: string | null | undefined;
1486
1506
  doc_ext_id?: string | null | undefined;
1507
+ doc_version?: number | null | undefined;
1487
1508
  doc_title?: string | null | undefined;
1488
1509
  chunk_id?: string | null | undefined;
1489
1510
  chunk_ext_id: string;
@@ -1630,6 +1651,7 @@ declare function getMessage$1(arbi: ArbiClient, messageId: string): Promise<{
1630
1651
  metadata: {
1631
1652
  workspace_ext_id?: string | null | undefined;
1632
1653
  doc_ext_id?: string | null | undefined;
1654
+ doc_version?: number | null | undefined;
1633
1655
  doc_title?: string | null | undefined;
1634
1656
  chunk_id?: string | null | undefined;
1635
1657
  chunk_ext_id: string;
@@ -1661,6 +1683,7 @@ declare function getMessage$1(arbi: ArbiClient, messageId: string): Promise<{
1661
1683
  metadata: {
1662
1684
  workspace_ext_id?: string | null | undefined;
1663
1685
  doc_ext_id?: string | null | undefined;
1686
+ doc_version?: number | null | undefined;
1664
1687
  doc_title?: string | null | undefined;
1665
1688
  chunk_id?: string | null | undefined;
1666
1689
  chunk_ext_id: string;
@@ -1814,6 +1837,7 @@ declare function postConversationMessage(arbi: ArbiClient, body: PostMessageRequ
1814
1837
  metadata: {
1815
1838
  workspace_ext_id?: string | null | undefined;
1816
1839
  doc_ext_id?: string | null | undefined;
1840
+ doc_version?: number | null | undefined;
1817
1841
  doc_title?: string | null | undefined;
1818
1842
  chunk_id?: string | null | undefined;
1819
1843
  chunk_ext_id: string;
@@ -1845,6 +1869,7 @@ declare function postConversationMessage(arbi: ArbiClient, body: PostMessageRequ
1845
1869
  metadata: {
1846
1870
  workspace_ext_id?: string | null | undefined;
1847
1871
  doc_ext_id?: string | null | undefined;
1872
+ doc_version?: number | null | undefined;
1848
1873
  doc_title?: string | null | undefined;
1849
1874
  chunk_id?: string | null | undefined;
1850
1875
  chunk_ext_id: string;
@@ -3995,13 +4020,29 @@ declare class Arbi {
3995
4020
  re_ocred?: boolean | null | undefined;
3996
4021
  config_ext_id?: string | null | undefined;
3997
4022
  parent_ext_id?: string | null | undefined;
3998
- lineage_id?: string | null | undefined;
3999
- version_number: number;
4000
- is_current: boolean;
4023
+ current_version: number;
4024
+ versions: {
4025
+ n: number;
4026
+ created_at?: string | null | undefined;
4027
+ created_by_ext_id?: string | null | undefined;
4028
+ reason: "upload" | "edit" | "signed" | "sync";
4029
+ file_name?: string | null | undefined;
4030
+ file_type?: string | null | undefined;
4031
+ file_size?: number | null | undefined;
4032
+ content_hash?: string | null | undefined;
4033
+ status?: string | null | undefined;
4034
+ n_pages?: number | null | undefined;
4035
+ n_chunks?: number | null | undefined;
4036
+ made_from?: number | null | undefined;
4037
+ is_current: boolean;
4038
+ markup_revision: number;
4039
+ markup_count: number;
4040
+ }[];
4001
4041
  thread_id?: string | null | undefined;
4002
4042
  derived_from: {
4003
4043
  doc_ext_id: string;
4004
4044
  role: components["schemas"]["DocRelationRole"];
4045
+ version?: number | null | undefined;
4005
4046
  }[];
4006
4047
  source_message_ext_id?: string | null | undefined;
4007
4048
  conversation_ext_id?: string | null | undefined;
@@ -4016,6 +4057,7 @@ declare class Arbi {
4016
4057
  note?: string | null | undefined;
4017
4058
  citations?: {
4018
4059
  doc_ext_id: string;
4060
+ version?: number | null | undefined;
4019
4061
  chunks?: {
4020
4062
  chunk_id: string;
4021
4063
  page?: number | null | undefined;
@@ -4067,9 +4109,8 @@ declare class Arbi {
4067
4109
  re_ocred?: boolean | null;
4068
4110
  config_ext_id?: string | null;
4069
4111
  parent_ext_id?: string | null;
4070
- lineage_id?: string | null;
4071
- version_number: number;
4072
- is_current: boolean;
4112
+ current_version: number;
4113
+ versions: components["schemas"]["DocVersion"][];
4073
4114
  thread_id?: string | null;
4074
4115
  derived_from: components["schemas"]["DerivedFrom"][];
4075
4116
  source_message_ext_id?: string | null;
@@ -4110,9 +4151,8 @@ declare class Arbi {
4110
4151
  re_ocred?: boolean | null;
4111
4152
  config_ext_id?: string | null;
4112
4153
  parent_ext_id?: string | null;
4113
- lineage_id?: string | null;
4114
- version_number: number;
4115
- is_current: boolean;
4154
+ current_version: number;
4155
+ versions: components["schemas"]["DocVersion"][];
4116
4156
  thread_id?: string | null;
4117
4157
  derived_from: components["schemas"]["DerivedFrom"][];
4118
4158
  source_message_ext_id?: string | null;
@@ -4146,13 +4186,29 @@ declare class Arbi {
4146
4186
  re_ocred?: boolean | null | undefined;
4147
4187
  config_ext_id?: string | null | undefined;
4148
4188
  parent_ext_id?: string | null | undefined;
4149
- lineage_id?: string | null | undefined;
4150
- version_number: number;
4151
- is_current: boolean;
4189
+ current_version: number;
4190
+ versions: {
4191
+ n: number;
4192
+ created_at?: string | null | undefined;
4193
+ created_by_ext_id?: string | null | undefined;
4194
+ reason: "upload" | "edit" | "signed" | "sync";
4195
+ file_name?: string | null | undefined;
4196
+ file_type?: string | null | undefined;
4197
+ file_size?: number | null | undefined;
4198
+ content_hash?: string | null | undefined;
4199
+ status?: string | null | undefined;
4200
+ n_pages?: number | null | undefined;
4201
+ n_chunks?: number | null | undefined;
4202
+ made_from?: number | null | undefined;
4203
+ is_current: boolean;
4204
+ markup_revision: number;
4205
+ markup_count: number;
4206
+ }[];
4152
4207
  thread_id?: string | null | undefined;
4153
4208
  derived_from: {
4154
4209
  doc_ext_id: string;
4155
4210
  role: components["schemas"]["DocRelationRole"];
4211
+ version?: number | null | undefined;
4156
4212
  }[];
4157
4213
  source_message_ext_id?: string | null | undefined;
4158
4214
  conversation_ext_id?: string | null | undefined;
@@ -4167,6 +4223,7 @@ declare class Arbi {
4167
4223
  note?: string | null | undefined;
4168
4224
  citations?: {
4169
4225
  doc_ext_id: string;
4226
+ version?: number | null | undefined;
4170
4227
  chunks?: {
4171
4228
  chunk_id: string;
4172
4229
  page?: number | null | undefined;
@@ -4188,67 +4245,23 @@ declare class Arbi {
4188
4245
  title?: string | null | undefined;
4189
4246
  } | null | undefined;
4190
4247
  }[]>;
4191
- /** Every version of a document (any version's id), oldest first; `is_current` marks the current one. */
4248
+ /** Every version of a document, oldest first; `is_current` marks the current one. */
4192
4249
  versions: (docId: string) => Promise<{
4193
- external_id: string;
4194
- workspace_ext_id: string;
4250
+ n: number;
4251
+ created_at?: string | null | undefined;
4252
+ created_by_ext_id?: string | null | undefined;
4253
+ reason: "upload" | "edit" | "signed" | "sync";
4195
4254
  file_name?: string | null | undefined;
4196
- status?: string | null | undefined;
4197
- error_message?: string | null | undefined;
4198
- failed_stage?: string | null | undefined;
4199
- n_pages?: number | null | undefined;
4200
- n_chunks?: number | null | undefined;
4201
- tokens?: number | null | undefined;
4202
4255
  file_type?: string | null | undefined;
4203
4256
  file_size?: number | null | undefined;
4204
- storage_type?: string | null | undefined;
4205
- storage_uri?: string | null | undefined;
4206
4257
  content_hash?: string | null | undefined;
4207
- shared?: boolean | null | undefined;
4208
- re_ocred?: boolean | null | undefined;
4209
- config_ext_id?: string | null | undefined;
4210
- parent_ext_id?: string | null | undefined;
4211
- lineage_id?: string | null | undefined;
4212
- version_number: number;
4258
+ status?: string | null | undefined;
4259
+ n_pages?: number | null | undefined;
4260
+ n_chunks?: number | null | undefined;
4261
+ made_from?: number | null | undefined;
4213
4262
  is_current: boolean;
4214
- thread_id?: string | null | undefined;
4215
- derived_from: {
4216
- doc_ext_id: string;
4217
- role: components["schemas"]["DocRelationRole"];
4218
- }[];
4219
- source_message_ext_id?: string | null | undefined;
4220
- conversation_ext_id?: string | null | undefined;
4221
- created_by_ext_id: string;
4222
- updated_by_ext_id?: string | null | undefined;
4223
- created_at: string;
4224
- updated_at: string;
4225
- wp_type?: string | null | undefined;
4226
- folder?: string | null | undefined;
4227
- sender?: string | null | undefined;
4228
- doctags: {
4229
- note?: string | null | undefined;
4230
- citations?: {
4231
- doc_ext_id: string;
4232
- chunks?: {
4233
- chunk_id: string;
4234
- page?: number | null | undefined;
4235
- }[] | undefined;
4236
- }[] | null | undefined;
4237
- external_id: string;
4238
- doc_ext_id: string;
4239
- tag_ext_id: string;
4240
- created_by_ext_id: string;
4241
- updated_by_ext_id?: string | null | undefined;
4242
- created_at: string;
4243
- updated_at: string;
4244
- }[];
4245
- doc_metadata?: {
4246
- doc_nature?: string | null | undefined;
4247
- doc_author?: string | null | undefined;
4248
- doc_subject?: string | null | undefined;
4249
- doc_date?: string | null | undefined;
4250
- title?: string | null | undefined;
4251
- } | null | undefined;
4263
+ markup_revision: number;
4264
+ markup_count: number;
4252
4265
  }[]>;
4253
4266
  delete: (externalIds: string[]) => Promise<void>;
4254
4267
  update: (documents: DocUpdateRequest[]) => Promise<{
@@ -4270,13 +4283,29 @@ declare class Arbi {
4270
4283
  re_ocred?: boolean | null | undefined;
4271
4284
  config_ext_id?: string | null | undefined;
4272
4285
  parent_ext_id?: string | null | undefined;
4273
- lineage_id?: string | null | undefined;
4274
- version_number: number;
4275
- is_current: boolean;
4286
+ current_version: number;
4287
+ versions: {
4288
+ n: number;
4289
+ created_at?: string | null | undefined;
4290
+ created_by_ext_id?: string | null | undefined;
4291
+ reason: "upload" | "edit" | "signed" | "sync";
4292
+ file_name?: string | null | undefined;
4293
+ file_type?: string | null | undefined;
4294
+ file_size?: number | null | undefined;
4295
+ content_hash?: string | null | undefined;
4296
+ status?: string | null | undefined;
4297
+ n_pages?: number | null | undefined;
4298
+ n_chunks?: number | null | undefined;
4299
+ made_from?: number | null | undefined;
4300
+ is_current: boolean;
4301
+ markup_revision: number;
4302
+ markup_count: number;
4303
+ }[];
4276
4304
  thread_id?: string | null | undefined;
4277
4305
  derived_from: {
4278
4306
  doc_ext_id: string;
4279
4307
  role: components["schemas"]["DocRelationRole"];
4308
+ version?: number | null | undefined;
4280
4309
  }[];
4281
4310
  source_message_ext_id?: string | null | undefined;
4282
4311
  conversation_ext_id?: string | null | undefined;
@@ -4291,6 +4320,7 @@ declare class Arbi {
4291
4320
  note?: string | null | undefined;
4292
4321
  citations?: {
4293
4322
  doc_ext_id: string;
4323
+ version?: number | null | undefined;
4294
4324
  chunks?: {
4295
4325
  chunk_id: string;
4296
4326
  page?: number | null | undefined;
@@ -4314,6 +4344,7 @@ declare class Arbi {
4314
4344
  }[]>;
4315
4345
  uploadUrl: (urls: string[], shared?: boolean) => Promise<{
4316
4346
  doc_ext_ids?: string[] | undefined;
4347
+ version?: number | null | undefined;
4317
4348
  batch_id?: string | null | undefined;
4318
4349
  skipped?: {
4319
4350
  file_name: string;
@@ -4321,8 +4352,9 @@ declare class Arbi {
4321
4352
  }[] | undefined;
4322
4353
  }>;
4323
4354
  uploadFile: (fileData: Blob, fileName: string, options?: UploadOptions) => Promise<UploadResult>;
4324
- download: (docId: string) => Promise<Response>;
4325
- getParsedContent: (docId: string, stage: string) => Promise<Record<string, unknown>>;
4355
+ /** Download a document's original file — its current version, or `version`. */
4356
+ download: (docId: string, version?: number) => Promise<Response>;
4357
+ getParsedContent: (docId: string, stage: string, version?: number) => Promise<Record<string, unknown>>;
4326
4358
  getThumbnails: (docIds: string[]) => Promise<Record<string, string | null>>;
4327
4359
  };
4328
4360
  readonly conversations: {
@@ -4411,6 +4443,7 @@ declare class Arbi {
4411
4443
  metadata: {
4412
4444
  workspace_ext_id?: string | null | undefined;
4413
4445
  doc_ext_id?: string | null | undefined;
4446
+ doc_version?: number | null | undefined;
4414
4447
  doc_title?: string | null | undefined;
4415
4448
  chunk_id?: string | null | undefined;
4416
4449
  chunk_ext_id: string;
@@ -4442,6 +4475,7 @@ declare class Arbi {
4442
4475
  metadata: {
4443
4476
  workspace_ext_id?: string | null | undefined;
4444
4477
  doc_ext_id?: string | null | undefined;
4478
+ doc_version?: number | null | undefined;
4445
4479
  doc_title?: string | null | undefined;
4446
4480
  chunk_id?: string | null | undefined;
4447
4481
  chunk_ext_id: string;
@@ -4780,6 +4814,7 @@ declare class Arbi {
4780
4814
  metadata: {
4781
4815
  workspace_ext_id?: string | null | undefined;
4782
4816
  doc_ext_id?: string | null | undefined;
4817
+ doc_version?: number | null | undefined;
4783
4818
  doc_title?: string | null | undefined;
4784
4819
  chunk_id?: string | null | undefined;
4785
4820
  chunk_ext_id: string;
@@ -4811,6 +4846,7 @@ declare class Arbi {
4811
4846
  metadata: {
4812
4847
  workspace_ext_id?: string | null | undefined;
4813
4848
  doc_ext_id?: string | null | undefined;
4849
+ doc_version?: number | null | undefined;
4814
4850
  doc_title?: string | null | undefined;
4815
4851
  chunk_id?: string | null | undefined;
4816
4852
  chunk_ext_id: string;
@@ -4955,6 +4991,7 @@ declare class Arbi {
4955
4991
  metadata: {
4956
4992
  workspace_ext_id?: string | null | undefined;
4957
4993
  doc_ext_id?: string | null | undefined;
4994
+ doc_version?: number | null | undefined;
4958
4995
  doc_title?: string | null | undefined;
4959
4996
  chunk_id?: string | null | undefined;
4960
4997
  chunk_ext_id: string;
@@ -4986,6 +5023,7 @@ declare class Arbi {
4986
5023
  metadata: {
4987
5024
  workspace_ext_id?: string | null | undefined;
4988
5025
  doc_ext_id?: string | null | undefined;
5026
+ doc_version?: number | null | undefined;
4989
5027
  doc_title?: string | null | undefined;
4990
5028
  chunk_id?: string | null | undefined;
4991
5029
  chunk_ext_id: string;
@@ -5285,6 +5323,7 @@ declare class Arbi {
5285
5323
  note?: string | null | undefined;
5286
5324
  citations?: {
5287
5325
  doc_ext_id: string;
5326
+ version?: number | null | undefined;
5288
5327
  chunks?: {
5289
5328
  chunk_id: string;
5290
5329
  page?: number | null | undefined;
@@ -5306,6 +5345,7 @@ declare class Arbi {
5306
5345
  note?: string | null | undefined;
5307
5346
  citations?: {
5308
5347
  doc_ext_id: string;
5348
+ version?: number | null | undefined;
5309
5349
  chunks?: {
5310
5350
  chunk_id: string;
5311
5351
  page?: number | null | undefined;
@@ -6908,6 +6948,7 @@ declare function assignDocTags(arbi: ArbiClient, tagId: string, docIds: string[]
6908
6948
  note?: string | null | undefined;
6909
6949
  citations?: {
6910
6950
  doc_ext_id: string;
6951
+ version?: number | null | undefined;
6911
6952
  chunks?: {
6912
6953
  chunk_id: string;
6913
6954
  page?: number | null | undefined;
@@ -6929,6 +6970,7 @@ declare function updateDocTag(arbi: ArbiClient, tagId: string, docId: string, up
6929
6970
  note?: string | null | undefined;
6930
6971
  citations?: {
6931
6972
  doc_ext_id: string;
6973
+ version?: number | null | undefined;
6932
6974
  chunks?: {
6933
6975
  chunk_id: string;
6934
6976
  page?: number | null | undefined;