@talonic/docs 0.21.96 → 0.21.98

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/content.js CHANGED
@@ -151,6 +151,10 @@ var generated_nav_default = {
151
151
  id: "ref-contract-check",
152
152
  label: "Contract Check"
153
153
  },
154
+ {
155
+ id: "ref-collections",
156
+ label: "Collections"
157
+ },
154
158
  {
155
159
  id: "ref-catalog",
156
160
  label: "Catalog"
@@ -2141,6 +2145,18 @@ var openapi_default = {
2141
2145
  ],
2142
2146
  default: "extract",
2143
2147
  description: "`extract`: text only, for a following `POST /v1/extract`. `ingest`: full processing into workspace data."
2148
+ },
2149
+ parties: {
2150
+ type: "array",
2151
+ maxItems: 500,
2152
+ description: "The document's parties as your system has them, the same as `PUT /v1/documents/{id}/parties`. They decide the document's labels and so its place in the Collections tree.",
2153
+ items: {
2154
+ $ref: "#/components/schemas/DocumentParty"
2155
+ }
2156
+ },
2157
+ parties_complete: {
2158
+ type: "boolean",
2159
+ description: "`parties` names every party of the document."
2144
2160
  }
2145
2161
  }
2146
2162
  }
@@ -57510,6 +57526,108 @@ var openapi_default = {
57510
57526
  }
57511
57527
  }
57512
57528
  },
57529
+ "/v1/sources/{id}/record-roles": {
57530
+ get: {
57531
+ operationId: "getSourceRecordRoles",
57532
+ "x-audience": "public",
57533
+ "x-required-scopes": [
57534
+ "read"
57535
+ ],
57536
+ summary: "Who reads the records of a connection",
57537
+ description: "For a source whose records each belong to a person inside it (a CRM's deals, contacts and companies have an owner): whether the connection tells its readers apart, who its admins are, and the owners the source names with who each is in the workspace. An owner without a `member` is nobody in this workspace; their records, and records that name no owner (`unowned`), are read by the admins only. Allowed to the person who connected it or a member with the Integrations permission.\n\n**Scope:** `read`.\n",
57538
+ tags: [
57539
+ "Sources"
57540
+ ],
57541
+ parameters: [
57542
+ {
57543
+ $ref: "#/components/parameters/ResourceId"
57544
+ }
57545
+ ],
57546
+ responses: {
57547
+ "200": {
57548
+ description: "The roles of the connection.",
57549
+ content: {
57550
+ "application/json": {
57551
+ schema: {
57552
+ $ref: "#/components/schemas/SourceRecordRoles"
57553
+ }
57554
+ }
57555
+ }
57556
+ },
57557
+ "403": {
57558
+ $ref: "#/components/responses/Forbidden"
57559
+ },
57560
+ "404": {
57561
+ $ref: "#/components/responses/NotFound"
57562
+ }
57563
+ }
57564
+ },
57565
+ put: {
57566
+ operationId: "setSourceRecordRoles",
57567
+ "x-audience": "public",
57568
+ "x-required-scopes": [
57569
+ "sources:write"
57570
+ ],
57571
+ summary: "Set who reads the records of a connection",
57572
+ description: "With `enabled: true` the `admins` read every record of the source and everyone else reads only the records they own in it: a record is a person's when the source names their mail address as an owner and they are an active member with that address. With `enabled: false` everyone who reads the source reads all of its records. Switching it on needs at least one admin, each an active member, and a source that says whose its records are (`available`). What is built from the source's records follows within minutes; until then it reads as before the change. Allowed to the person who connected it or a member with the Integrations permission.\n\n**Scope:** `sources:write`. A key holding only the legacy `write` scope does not satisfy it.\n",
57573
+ tags: [
57574
+ "Sources"
57575
+ ],
57576
+ parameters: [
57577
+ {
57578
+ $ref: "#/components/parameters/ResourceId"
57579
+ }
57580
+ ],
57581
+ requestBody: {
57582
+ required: true,
57583
+ content: {
57584
+ "application/json": {
57585
+ schema: {
57586
+ type: "object",
57587
+ required: [
57588
+ "enabled"
57589
+ ],
57590
+ properties: {
57591
+ enabled: {
57592
+ type: "boolean"
57593
+ },
57594
+ admins: {
57595
+ type: "array",
57596
+ maxItems: 200,
57597
+ items: {
57598
+ type: "string",
57599
+ format: "uuid"
57600
+ },
57601
+ description: "User ids of the admins. At least one when `enabled`."
57602
+ }
57603
+ }
57604
+ }
57605
+ }
57606
+ }
57607
+ },
57608
+ responses: {
57609
+ "200": {
57610
+ description: "The roles as they stand.",
57611
+ content: {
57612
+ "application/json": {
57613
+ schema: {
57614
+ $ref: "#/components/schemas/SourceRecordRoles"
57615
+ }
57616
+ }
57617
+ }
57618
+ },
57619
+ "400": {
57620
+ $ref: "#/components/responses/BadRequest"
57621
+ },
57622
+ "403": {
57623
+ $ref: "#/components/responses/Forbidden"
57624
+ },
57625
+ "404": {
57626
+ $ref: "#/components/responses/NotFound"
57627
+ }
57628
+ }
57629
+ }
57630
+ },
57513
57631
  "/v1/sources/{id}/make-private": {
57514
57632
  post: {
57515
57633
  operationId: "makeSourceConnectionPrivate",
@@ -66088,61 +66206,42 @@ var openapi_default = {
66088
66206
  }
66089
66207
  }
66090
66208
  },
66091
- "/v1/documents/batch-metadata/import": {
66092
- post: {
66093
- operationId: "importDocumentBatchMetadata",
66209
+ "/v1/documents/{id}/collections": {
66210
+ get: {
66211
+ operationId: "explainDocumentCollections",
66094
66212
  "x-audience": "public",
66095
66213
  tags: [
66096
- "Documents"
66214
+ "Collections"
66097
66215
  ],
66098
- summary: "Import source batch ids from a CSV",
66099
- description: "Sets the source batch id on existing documents from a CSV upload (`file`, up to 20 MB). Answers how many documents were updated and which named ones were not found. 403 for a person whose document visibility a rule narrows, because the import matches against every document of the workspace. Requires the `documents:write` scope. The key's person must be an Admin of the workspace, as in the web app; in a workspace whose model configuration Talonic manages this answers 403 `insufficient_role`.",
66216
+ summary: "Explain a document's collections",
66217
+ description: "Why the document sits where it does: each of its labels, whether it was derived or set by a person, with the evidence you may see behind it, and each collection it is in, with why (`rule`, `hand` or `held` by a limit). `pending` and `unresolved` say whether its labels are still settling. 404 when the key's person may not read the document. Requires the `read` scope (or `documents:read`). Any member of the workspace may call it.",
66100
66218
  security: [
66101
66219
  {
66102
66220
  BearerAuth: []
66103
66221
  }
66104
66222
  ],
66105
66223
  "x-required-scopes": [
66106
- "documents:write"
66224
+ "read"
66107
66225
  ],
66108
- requestBody: {
66109
- required: true,
66110
- content: {
66111
- "multipart/form-data": {
66112
- schema: {
66113
- type: "object",
66114
- properties: {
66115
- file: {
66116
- type: "string",
66117
- format: "binary",
66118
- description: "CSV with a header row."
66119
- }
66120
- },
66121
- required: [
66122
- "file"
66123
- ]
66124
- }
66226
+ parameters: [
66227
+ {
66228
+ name: "id",
66229
+ in: "path",
66230
+ required: true,
66231
+ schema: {
66232
+ type: "string",
66233
+ format: "uuid"
66125
66234
  }
66126
66235
  }
66127
- },
66236
+ ],
66128
66237
  responses: {
66129
- "201": {
66238
+ "200": {
66130
66239
  description: "OK",
66131
66240
  content: {
66132
66241
  "application/json": {
66133
66242
  schema: {
66134
66243
  type: "object",
66135
- properties: {
66136
- updated: {
66137
- type: "integer"
66138
- },
66139
- not_found: {
66140
- type: "array",
66141
- items: {
66142
- type: "string"
66143
- }
66144
- }
66145
- }
66244
+ additionalProperties: true
66146
66245
  }
66147
66246
  }
66148
66247
  }
@@ -66156,68 +66255,43 @@ var openapi_default = {
66156
66255
  "403": {
66157
66256
  $ref: "#/components/responses/Forbidden"
66158
66257
  },
66258
+ "404": {
66259
+ $ref: "#/components/responses/NotFound"
66260
+ },
66159
66261
  "429": {
66160
66262
  $ref: "#/components/responses/RateLimitExceeded"
66161
66263
  }
66162
66264
  }
66163
66265
  }
66164
66266
  },
66165
- "/v1/documents/display-name-rule": {
66166
- get: {
66167
- operationId: "getDisplayNameRule",
66267
+ "/v1/documents/{id}/traits": {
66268
+ patch: {
66269
+ operationId: "setDocumentLabels",
66168
66270
  "x-audience": "public",
66169
66271
  tags: [
66170
- "Documents"
66272
+ "Collections"
66171
66273
  ],
66172
- summary: "Get the readable-name rule",
66173
- description: "The workspace's rule for deriving a readable name from each filename, its check state, and a sample of current filename \u2192 name pairs. Requires the `read` scope (or `documents:read`). Any member of the workspace may call it. The sample lists only documents the key's person can see.",
66274
+ summary: "Change a document's labels by hand",
66275
+ description: "Adds and removes labels on one document (`add`, `remove`, each at most 50 labels such as `relationship:client`). A person's labels are kept whenever the document's labels are derived again. Refused (403) when the change would move the document into or out of a limited collection the key's person may not manage. Requires the `documents:write` scope. The key's person must be allowed to edit in the workspace, as in the web app.",
66174
66276
  security: [
66175
66277
  {
66176
66278
  BearerAuth: []
66177
66279
  }
66178
66280
  ],
66179
66281
  "x-required-scopes": [
66180
- "read"
66181
- ],
66182
- responses: {
66183
- "200": {
66184
- description: "OK",
66185
- content: {
66186
- "application/json": {
66187
- schema: {
66188
- type: "object",
66189
- additionalProperties: true
66190
- }
66191
- }
66192
- }
66193
- },
66194
- "401": {
66195
- $ref: "#/components/responses/Unauthorized"
66196
- },
66197
- "403": {
66198
- $ref: "#/components/responses/Forbidden"
66199
- },
66200
- "429": {
66201
- $ref: "#/components/responses/RateLimitExceeded"
66202
- }
66203
- }
66204
- },
66205
- patch: {
66206
- operationId: "setDisplayNameRule",
66207
- "x-audience": "public",
66208
- tags: [
66209
- "Documents"
66282
+ "documents:write"
66210
66283
  ],
66211
- summary: "Set the readable-name rule",
66212
- description: "`off` derives nothing and clears stored names, `default` tidies each filename, `lua` runs your `script` (reads `record.filename`, calls `record:set('display_name', value)`). Takes effect for new documents; apply it to existing ones with the backfill. Requires the `documents:write` scope. The key's person must be an Admin of the workspace (the `workspace` permission), as in the web app.",
66213
- security: [
66284
+ parameters: [
66214
66285
  {
66215
- BearerAuth: []
66286
+ name: "id",
66287
+ in: "path",
66288
+ required: true,
66289
+ schema: {
66290
+ type: "string",
66291
+ format: "uuid"
66292
+ }
66216
66293
  }
66217
66294
  ],
66218
- "x-required-scopes": [
66219
- "documents:write"
66220
- ],
66221
66295
  requestBody: {
66222
66296
  required: true,
66223
66297
  content: {
@@ -66225,22 +66299,23 @@ var openapi_default = {
66225
66299
  schema: {
66226
66300
  type: "object",
66227
66301
  properties: {
66228
- mode: {
66229
- type: "string",
66230
- enum: [
66231
- "off",
66232
- "default",
66233
- "lua"
66234
- ]
66302
+ add: {
66303
+ type: "array",
66304
+ maxItems: 50,
66305
+ items: {
66306
+ type: "string",
66307
+ maxLength: 200
66308
+ }
66235
66309
  },
66236
- script: {
66237
- type: "string",
66238
- maxLength: 2e4
66310
+ remove: {
66311
+ type: "array",
66312
+ maxItems: 50,
66313
+ items: {
66314
+ type: "string",
66315
+ maxLength: 200
66316
+ }
66239
66317
  }
66240
- },
66241
- required: [
66242
- "mode"
66243
- ]
66318
+ }
66244
66319
  }
66245
66320
  }
66246
66321
  }
@@ -66266,21 +66341,24 @@ var openapi_default = {
66266
66341
  "403": {
66267
66342
  $ref: "#/components/responses/Forbidden"
66268
66343
  },
66344
+ "404": {
66345
+ $ref: "#/components/responses/NotFound"
66346
+ },
66269
66347
  "429": {
66270
66348
  $ref: "#/components/responses/RateLimitExceeded"
66271
66349
  }
66272
66350
  }
66273
66351
  }
66274
66352
  },
66275
- "/v1/documents/display-name-rule/preview": {
66353
+ "/v1/documents/{id}/move": {
66276
66354
  post: {
66277
- operationId: "previewDisplayNameRule",
66355
+ operationId: "moveDocumentBetweenCollections",
66278
66356
  "x-audience": "public",
66279
66357
  tags: [
66280
- "Documents"
66358
+ "Collections"
66281
66359
  ],
66282
- summary: "Try a readable-name script",
66283
- description: "Runs a candidate `lua_script` over a sample of real filenames (default 50, at most 200) without saving it. Requires the `documents:write` scope. The key's person must be an Admin of the workspace (the `workspace` permission), as in the web app. The sample is drawn only from documents the key's person can see.",
66360
+ summary: "Move a document between collections",
66361
+ description: "Takes the document out of `from`, puts it into `to`, or both. A collection that sorts by labels keeps the document out once it is moved out. Any member moves between plain collections; a limited collection needs a person its limit admits or an owner; an enforced collection or an account needs an owner (403 otherwise). 404 when the key's person may not read the document. Requires the `documents:write` scope. The key's person must be allowed to edit in the workspace, as in the web app.",
66284
66362
  security: [
66285
66363
  {
66286
66364
  BearerAuth: []
@@ -66289,6 +66367,17 @@ var openapi_default = {
66289
66367
  "x-required-scopes": [
66290
66368
  "documents:write"
66291
66369
  ],
66370
+ parameters: [
66371
+ {
66372
+ name: "id",
66373
+ in: "path",
66374
+ required: true,
66375
+ schema: {
66376
+ type: "string",
66377
+ format: "uuid"
66378
+ }
66379
+ }
66380
+ ],
66292
66381
  requestBody: {
66293
66382
  required: true,
66294
66383
  content: {
@@ -66296,19 +66385,358 @@ var openapi_default = {
66296
66385
  schema: {
66297
66386
  type: "object",
66298
66387
  properties: {
66299
- lua_script: {
66388
+ from: {
66300
66389
  type: "string",
66301
- maxLength: 2e4
66390
+ format: "uuid",
66391
+ nullable: true
66302
66392
  },
66303
- sample_size: {
66304
- type: "integer",
66305
- minimum: 1,
66306
- maximum: 200
66393
+ to: {
66394
+ type: "string",
66395
+ format: "uuid",
66396
+ nullable: true
66307
66397
  }
66308
- },
66309
- required: [
66310
- "lua_script"
66311
- ]
66398
+ }
66399
+ }
66400
+ }
66401
+ }
66402
+ },
66403
+ responses: {
66404
+ "200": {
66405
+ description: "OK",
66406
+ content: {
66407
+ "application/json": {
66408
+ schema: {
66409
+ type: "object",
66410
+ additionalProperties: true
66411
+ }
66412
+ }
66413
+ }
66414
+ },
66415
+ "400": {
66416
+ $ref: "#/components/responses/BadRequest"
66417
+ },
66418
+ "401": {
66419
+ $ref: "#/components/responses/Unauthorized"
66420
+ },
66421
+ "403": {
66422
+ $ref: "#/components/responses/Forbidden"
66423
+ },
66424
+ "404": {
66425
+ $ref: "#/components/responses/NotFound"
66426
+ },
66427
+ "409": {
66428
+ $ref: "#/components/responses/Conflict"
66429
+ },
66430
+ "429": {
66431
+ $ref: "#/components/responses/RateLimitExceeded"
66432
+ }
66433
+ }
66434
+ }
66435
+ },
66436
+ "/v1/documents/{id}/parties": {
66437
+ put: {
66438
+ operationId: "setDocumentParties",
66439
+ "x-audience": "public",
66440
+ tags: [
66441
+ "Collections"
66442
+ ],
66443
+ summary: "Set a document's parties",
66444
+ description: "Hands over the document's parties as your system has them, the way a connected mailbox does at import: typed identifiers with an optional role, and whether the list is `complete` (only a complete list whose every party is your own makes a document internal). The document's labels are derived again at once; a party nobody in the directory knows yet may leave the document `pending` for a short while, during which it stays under every limit. Requires the `documents:write` scope. The key's person must be allowed to edit in the workspace, as in the web app.",
66445
+ security: [
66446
+ {
66447
+ BearerAuth: []
66448
+ }
66449
+ ],
66450
+ "x-required-scopes": [
66451
+ "documents:write"
66452
+ ],
66453
+ parameters: [
66454
+ {
66455
+ name: "id",
66456
+ in: "path",
66457
+ required: true,
66458
+ schema: {
66459
+ type: "string",
66460
+ format: "uuid"
66461
+ }
66462
+ }
66463
+ ],
66464
+ requestBody: {
66465
+ required: true,
66466
+ content: {
66467
+ "application/json": {
66468
+ schema: {
66469
+ type: "object",
66470
+ required: [
66471
+ "parties"
66472
+ ],
66473
+ properties: {
66474
+ parties: {
66475
+ type: "array",
66476
+ maxItems: 500,
66477
+ items: {
66478
+ $ref: "#/components/schemas/DocumentParty"
66479
+ }
66480
+ },
66481
+ complete: {
66482
+ type: "boolean"
66483
+ }
66484
+ }
66485
+ }
66486
+ }
66487
+ }
66488
+ },
66489
+ responses: {
66490
+ "200": {
66491
+ description: "OK",
66492
+ content: {
66493
+ "application/json": {
66494
+ schema: {
66495
+ type: "object",
66496
+ additionalProperties: true
66497
+ }
66498
+ }
66499
+ }
66500
+ },
66501
+ "400": {
66502
+ $ref: "#/components/responses/BadRequest"
66503
+ },
66504
+ "401": {
66505
+ $ref: "#/components/responses/Unauthorized"
66506
+ },
66507
+ "403": {
66508
+ $ref: "#/components/responses/Forbidden"
66509
+ },
66510
+ "404": {
66511
+ $ref: "#/components/responses/NotFound"
66512
+ },
66513
+ "429": {
66514
+ $ref: "#/components/responses/RateLimitExceeded"
66515
+ }
66516
+ }
66517
+ }
66518
+ },
66519
+ "/v1/documents/batch-metadata/import": {
66520
+ post: {
66521
+ operationId: "importDocumentBatchMetadata",
66522
+ "x-audience": "public",
66523
+ tags: [
66524
+ "Documents"
66525
+ ],
66526
+ summary: "Import source batch ids from a CSV",
66527
+ description: "Sets the source batch id on existing documents from a CSV upload (`file`, up to 20 MB). Answers how many documents were updated and which named ones were not found. 403 for a person whose document visibility a rule narrows, because the import matches against every document of the workspace. Requires the `documents:write` scope. The key's person must be an Admin of the workspace, as in the web app; in a workspace whose model configuration Talonic manages this answers 403 `insufficient_role`.",
66528
+ security: [
66529
+ {
66530
+ BearerAuth: []
66531
+ }
66532
+ ],
66533
+ "x-required-scopes": [
66534
+ "documents:write"
66535
+ ],
66536
+ requestBody: {
66537
+ required: true,
66538
+ content: {
66539
+ "multipart/form-data": {
66540
+ schema: {
66541
+ type: "object",
66542
+ properties: {
66543
+ file: {
66544
+ type: "string",
66545
+ format: "binary",
66546
+ description: "CSV with a header row."
66547
+ }
66548
+ },
66549
+ required: [
66550
+ "file"
66551
+ ]
66552
+ }
66553
+ }
66554
+ }
66555
+ },
66556
+ responses: {
66557
+ "201": {
66558
+ description: "OK",
66559
+ content: {
66560
+ "application/json": {
66561
+ schema: {
66562
+ type: "object",
66563
+ properties: {
66564
+ updated: {
66565
+ type: "integer"
66566
+ },
66567
+ not_found: {
66568
+ type: "array",
66569
+ items: {
66570
+ type: "string"
66571
+ }
66572
+ }
66573
+ }
66574
+ }
66575
+ }
66576
+ }
66577
+ },
66578
+ "400": {
66579
+ $ref: "#/components/responses/BadRequest"
66580
+ },
66581
+ "401": {
66582
+ $ref: "#/components/responses/Unauthorized"
66583
+ },
66584
+ "403": {
66585
+ $ref: "#/components/responses/Forbidden"
66586
+ },
66587
+ "429": {
66588
+ $ref: "#/components/responses/RateLimitExceeded"
66589
+ }
66590
+ }
66591
+ }
66592
+ },
66593
+ "/v1/documents/display-name-rule": {
66594
+ get: {
66595
+ operationId: "getDisplayNameRule",
66596
+ "x-audience": "public",
66597
+ tags: [
66598
+ "Documents"
66599
+ ],
66600
+ summary: "Get the readable-name rule",
66601
+ description: "The workspace's rule for deriving a readable name from each filename, its check state, and a sample of current filename \u2192 name pairs. Requires the `read` scope (or `documents:read`). Any member of the workspace may call it. The sample lists only documents the key's person can see.",
66602
+ security: [
66603
+ {
66604
+ BearerAuth: []
66605
+ }
66606
+ ],
66607
+ "x-required-scopes": [
66608
+ "read"
66609
+ ],
66610
+ responses: {
66611
+ "200": {
66612
+ description: "OK",
66613
+ content: {
66614
+ "application/json": {
66615
+ schema: {
66616
+ type: "object",
66617
+ additionalProperties: true
66618
+ }
66619
+ }
66620
+ }
66621
+ },
66622
+ "401": {
66623
+ $ref: "#/components/responses/Unauthorized"
66624
+ },
66625
+ "403": {
66626
+ $ref: "#/components/responses/Forbidden"
66627
+ },
66628
+ "429": {
66629
+ $ref: "#/components/responses/RateLimitExceeded"
66630
+ }
66631
+ }
66632
+ },
66633
+ patch: {
66634
+ operationId: "setDisplayNameRule",
66635
+ "x-audience": "public",
66636
+ tags: [
66637
+ "Documents"
66638
+ ],
66639
+ summary: "Set the readable-name rule",
66640
+ description: "`off` derives nothing and clears stored names, `default` tidies each filename, `lua` runs your `script` (reads `record.filename`, calls `record:set('display_name', value)`). Takes effect for new documents; apply it to existing ones with the backfill. Requires the `documents:write` scope. The key's person must be an Admin of the workspace (the `workspace` permission), as in the web app.",
66641
+ security: [
66642
+ {
66643
+ BearerAuth: []
66644
+ }
66645
+ ],
66646
+ "x-required-scopes": [
66647
+ "documents:write"
66648
+ ],
66649
+ requestBody: {
66650
+ required: true,
66651
+ content: {
66652
+ "application/json": {
66653
+ schema: {
66654
+ type: "object",
66655
+ properties: {
66656
+ mode: {
66657
+ type: "string",
66658
+ enum: [
66659
+ "off",
66660
+ "default",
66661
+ "lua"
66662
+ ]
66663
+ },
66664
+ script: {
66665
+ type: "string",
66666
+ maxLength: 2e4
66667
+ }
66668
+ },
66669
+ required: [
66670
+ "mode"
66671
+ ]
66672
+ }
66673
+ }
66674
+ }
66675
+ },
66676
+ responses: {
66677
+ "200": {
66678
+ description: "OK",
66679
+ content: {
66680
+ "application/json": {
66681
+ schema: {
66682
+ type: "object",
66683
+ additionalProperties: true
66684
+ }
66685
+ }
66686
+ }
66687
+ },
66688
+ "400": {
66689
+ $ref: "#/components/responses/BadRequest"
66690
+ },
66691
+ "401": {
66692
+ $ref: "#/components/responses/Unauthorized"
66693
+ },
66694
+ "403": {
66695
+ $ref: "#/components/responses/Forbidden"
66696
+ },
66697
+ "429": {
66698
+ $ref: "#/components/responses/RateLimitExceeded"
66699
+ }
66700
+ }
66701
+ }
66702
+ },
66703
+ "/v1/documents/display-name-rule/preview": {
66704
+ post: {
66705
+ operationId: "previewDisplayNameRule",
66706
+ "x-audience": "public",
66707
+ tags: [
66708
+ "Documents"
66709
+ ],
66710
+ summary: "Try a readable-name script",
66711
+ description: "Runs a candidate `lua_script` over a sample of real filenames (default 50, at most 200) without saving it. Requires the `documents:write` scope. The key's person must be an Admin of the workspace (the `workspace` permission), as in the web app. The sample is drawn only from documents the key's person can see.",
66712
+ security: [
66713
+ {
66714
+ BearerAuth: []
66715
+ }
66716
+ ],
66717
+ "x-required-scopes": [
66718
+ "documents:write"
66719
+ ],
66720
+ requestBody: {
66721
+ required: true,
66722
+ content: {
66723
+ "application/json": {
66724
+ schema: {
66725
+ type: "object",
66726
+ properties: {
66727
+ lua_script: {
66728
+ type: "string",
66729
+ maxLength: 2e4
66730
+ },
66731
+ sample_size: {
66732
+ type: "integer",
66733
+ minimum: 1,
66734
+ maximum: 200
66735
+ }
66736
+ },
66737
+ required: [
66738
+ "lua_script"
66739
+ ]
66312
66740
  }
66313
66741
  }
66314
66742
  }
@@ -66548,14 +66976,240 @@ var openapi_default = {
66548
66976
  }
66549
66977
  }
66550
66978
  },
66551
- post: {
66552
- operationId: "createCollection",
66979
+ post: {
66980
+ operationId: "createCollection",
66981
+ "x-audience": "public",
66982
+ tags: [
66983
+ "Collections"
66984
+ ],
66985
+ summary: "Create a collection",
66986
+ description: "`kind: account` makes it an account (one account per document). 409 when the name exists. Requires the `documents:write` scope. The key's person must be an Admin of the workspace (the `workspace` permission), as in the web app.",
66987
+ security: [
66988
+ {
66989
+ BearerAuth: []
66990
+ }
66991
+ ],
66992
+ "x-required-scopes": [
66993
+ "documents:write"
66994
+ ],
66995
+ requestBody: {
66996
+ required: true,
66997
+ content: {
66998
+ "application/json": {
66999
+ schema: {
67000
+ type: "object",
67001
+ properties: {
67002
+ name: {
67003
+ type: "string",
67004
+ minLength: 1,
67005
+ maxLength: 200
67006
+ },
67007
+ description: {
67008
+ type: "string",
67009
+ maxLength: 2e3
67010
+ },
67011
+ kind: {
67012
+ type: "string",
67013
+ enum: [
67014
+ "collection",
67015
+ "account"
67016
+ ]
67017
+ },
67018
+ aliases: {
67019
+ type: "array",
67020
+ maxItems: 50,
67021
+ items: {
67022
+ type: "string",
67023
+ maxLength: 200
67024
+ }
67025
+ }
67026
+ },
67027
+ required: [
67028
+ "name"
67029
+ ]
67030
+ }
67031
+ }
67032
+ }
67033
+ },
67034
+ responses: {
67035
+ "201": {
67036
+ description: "OK",
67037
+ content: {
67038
+ "application/json": {
67039
+ schema: {
67040
+ type: "object",
67041
+ additionalProperties: true
67042
+ }
67043
+ }
67044
+ }
67045
+ },
67046
+ "400": {
67047
+ $ref: "#/components/responses/BadRequest"
67048
+ },
67049
+ "401": {
67050
+ $ref: "#/components/responses/Unauthorized"
67051
+ },
67052
+ "403": {
67053
+ $ref: "#/components/responses/Forbidden"
67054
+ },
67055
+ "429": {
67056
+ $ref: "#/components/responses/RateLimitExceeded"
67057
+ }
67058
+ }
67059
+ }
67060
+ },
67061
+ "/v1/collections/mine": {
67062
+ get: {
67063
+ operationId: "listMyCollections",
67064
+ "x-audience": "public",
67065
+ tags: [
67066
+ "Collections"
67067
+ ],
67068
+ summary: "List the collections assigned to me",
67069
+ description: "The collections assigned to the key's person, and whether that limits what they see. Requires the `read` scope (or `documents:read`). Any member of the workspace may call it.",
67070
+ security: [
67071
+ {
67072
+ BearerAuth: []
67073
+ }
67074
+ ],
67075
+ "x-required-scopes": [
67076
+ "read"
67077
+ ],
67078
+ responses: {
67079
+ "200": {
67080
+ description: "OK",
67081
+ content: {
67082
+ "application/json": {
67083
+ schema: {
67084
+ type: "object",
67085
+ properties: {
67086
+ collections: {
67087
+ type: "array",
67088
+ items: {
67089
+ type: "object",
67090
+ additionalProperties: true
67091
+ }
67092
+ },
67093
+ restricted: {
67094
+ type: "boolean"
67095
+ }
67096
+ }
67097
+ }
67098
+ }
67099
+ }
67100
+ },
67101
+ "401": {
67102
+ $ref: "#/components/responses/Unauthorized"
67103
+ },
67104
+ "403": {
67105
+ $ref: "#/components/responses/Forbidden"
67106
+ },
67107
+ "429": {
67108
+ $ref: "#/components/responses/RateLimitExceeded"
67109
+ }
67110
+ }
67111
+ }
67112
+ },
67113
+ "/v1/collections/counts": {
67114
+ get: {
67115
+ operationId: "getCollectionCounts",
67116
+ "x-audience": "public",
67117
+ tags: [
67118
+ "Collections"
67119
+ ],
67120
+ summary: "Count documents per collection",
67121
+ description: "Visible-document counts per collection. Requires the `read` scope (or `documents:read`). Any member of the workspace may call it.",
67122
+ security: [
67123
+ {
67124
+ BearerAuth: []
67125
+ }
67126
+ ],
67127
+ "x-required-scopes": [
67128
+ "read"
67129
+ ],
67130
+ responses: {
67131
+ "200": {
67132
+ description: "OK",
67133
+ content: {
67134
+ "application/json": {
67135
+ schema: {
67136
+ type: "object",
67137
+ properties: {
67138
+ collections: {
67139
+ type: "array",
67140
+ items: {
67141
+ type: "object",
67142
+ additionalProperties: true
67143
+ }
67144
+ }
67145
+ }
67146
+ }
67147
+ }
67148
+ }
67149
+ },
67150
+ "401": {
67151
+ $ref: "#/components/responses/Unauthorized"
67152
+ },
67153
+ "403": {
67154
+ $ref: "#/components/responses/Forbidden"
67155
+ },
67156
+ "429": {
67157
+ $ref: "#/components/responses/RateLimitExceeded"
67158
+ }
67159
+ }
67160
+ }
67161
+ },
67162
+ "/v1/collections/config": {
67163
+ get: {
67164
+ operationId: "getCollectionsConfig",
67165
+ "x-audience": "public",
67166
+ tags: [
67167
+ "Collections"
67168
+ ],
67169
+ summary: "Get the collections configuration",
67170
+ description: "The workspace's collections as one configuration document: each collection that has a `key` with its name, the labels it sorts by (`match`, or `any` for several label sets) and its children, plus the workspace's relationship kinds, own domains and whether relationships may be inferred. Who may read a limited collection (`only`), the directory's configured entries and the default views appear for a workspace owner only. Requires the `read` scope (or `documents:read`). Any member of the workspace may call it.",
67171
+ security: [
67172
+ {
67173
+ BearerAuth: []
67174
+ }
67175
+ ],
67176
+ "x-required-scopes": [
67177
+ "read"
67178
+ ],
67179
+ responses: {
67180
+ "200": {
67181
+ description: "OK",
67182
+ content: {
67183
+ "application/json": {
67184
+ schema: {
67185
+ type: "object",
67186
+ additionalProperties: true
67187
+ }
67188
+ }
67189
+ }
67190
+ },
67191
+ "400": {
67192
+ $ref: "#/components/responses/BadRequest"
67193
+ },
67194
+ "401": {
67195
+ $ref: "#/components/responses/Unauthorized"
67196
+ },
67197
+ "403": {
67198
+ $ref: "#/components/responses/Forbidden"
67199
+ },
67200
+ "429": {
67201
+ $ref: "#/components/responses/RateLimitExceeded"
67202
+ }
67203
+ }
67204
+ },
67205
+ put: {
67206
+ operationId: "applyCollectionsConfig",
66553
67207
  "x-audience": "public",
66554
67208
  tags: [
66555
67209
  "Collections"
66556
67210
  ],
66557
- summary: "Create a collection",
66558
- description: "`kind: account` makes it an account (one account per document). 409 when the name exists. Requires the `documents:write` scope. The key's person must be an Admin of the workspace (the `workspace` permission), as in the web app.",
67211
+ summary: "Apply a collections configuration",
67212
+ description: "Applies a configuration document: every problem is reported at once (400 with `details.problems`) before anything changes, then everything is saved together. Collections are matched by their path of keys, so applying the same document twice changes nothing. With `dry_run=true` nothing is saved and the answer lists what would be created, changed and removed, how many documents each collection would hold for you, and for each limit how many documents it hides from how many people. `prune=true` removes keyed collections the document does not name, and refuses (409) one that still has a limit or documents placed by hand. A key with no person cannot change `only` (403). Requires the `documents:write` scope. The key's person must be an Admin of the workspace (the `workspace` permission), as in the web app.",
66559
67213
  security: [
66560
67214
  {
66561
67215
  BearerAuth: []
@@ -66564,6 +67218,28 @@ var openapi_default = {
66564
67218
  "x-required-scopes": [
66565
67219
  "documents:write"
66566
67220
  ],
67221
+ parameters: [
67222
+ {
67223
+ name: "dry_run",
67224
+ in: "query",
67225
+ required: false,
67226
+ schema: {
67227
+ type: "boolean",
67228
+ default: false
67229
+ },
67230
+ description: "Check and preview the change; nothing is saved."
67231
+ },
67232
+ {
67233
+ name: "prune",
67234
+ in: "query",
67235
+ required: false,
67236
+ schema: {
67237
+ type: "boolean",
67238
+ default: false
67239
+ },
67240
+ description: "Remove keyed collections the document does not name."
67241
+ }
67242
+ ],
66567
67243
  requestBody: {
66568
67244
  required: true,
66569
67245
  content: {
@@ -66571,40 +67247,23 @@ var openapi_default = {
66571
67247
  schema: {
66572
67248
  type: "object",
66573
67249
  properties: {
66574
- name: {
66575
- type: "string",
66576
- minLength: 1,
66577
- maxLength: 200
66578
- },
66579
- description: {
66580
- type: "string",
66581
- maxLength: 2e3
67250
+ document: {
67251
+ type: "object",
67252
+ additionalProperties: true,
67253
+ description: "The configuration document."
66582
67254
  },
66583
- kind: {
67255
+ yaml: {
66584
67256
  type: "string",
66585
- enum: [
66586
- "collection",
66587
- "account"
66588
- ]
66589
- },
66590
- aliases: {
66591
- type: "array",
66592
- maxItems: 50,
66593
- items: {
66594
- type: "string",
66595
- maxLength: 200
66596
- }
67257
+ maxLength: 1e6,
67258
+ description: "The configuration document as YAML or JSON text."
66597
67259
  }
66598
- },
66599
- required: [
66600
- "name"
66601
- ]
67260
+ }
66602
67261
  }
66603
67262
  }
66604
67263
  }
66605
67264
  },
66606
67265
  responses: {
66607
- "201": {
67266
+ "200": {
66608
67267
  description: "OK",
66609
67268
  content: {
66610
67269
  "application/json": {
@@ -66624,21 +67283,24 @@ var openapi_default = {
66624
67283
  "403": {
66625
67284
  $ref: "#/components/responses/Forbidden"
66626
67285
  },
67286
+ "409": {
67287
+ $ref: "#/components/responses/Conflict"
67288
+ },
66627
67289
  "429": {
66628
67290
  $ref: "#/components/responses/RateLimitExceeded"
66629
67291
  }
66630
67292
  }
66631
67293
  }
66632
67294
  },
66633
- "/v1/collections/mine": {
66634
- get: {
66635
- operationId: "listMyCollections",
67295
+ "/v1/collections/proposal": {
67296
+ post: {
67297
+ operationId: "proposeCollectionsConfig",
66636
67298
  "x-audience": "public",
66637
67299
  tags: [
66638
67300
  "Collections"
66639
67301
  ],
66640
- summary: "List the collections assigned to me",
66641
- description: "The collections assigned to the key's person, and whether that limits what they see. Requires the `read` scope (or `documents:read`). Any member of the workspace may call it.",
67302
+ summary: "Propose a collections configuration",
67303
+ description: "A configuration document built from the workspace's own documents, as far as the key's person may read them: one top-level collection per channel with documents, children for the labels common enough to be worth one, and, when the workspace has conversations and fewer than two relationship kinds, kinds suggested from its most frequent outside organisations (only when relationships may be inferred). Nothing is saved, and no limit is ever proposed: edit it and apply it with `PUT /v1/collections/config`. Requires the `read` scope (or `documents:read`). The key's person must be an Admin of the workspace (the `workspace` permission), as in the web app.",
66642
67304
  security: [
66643
67305
  {
66644
67306
  BearerAuth: []
@@ -66654,22 +67316,14 @@ var openapi_default = {
66654
67316
  "application/json": {
66655
67317
  schema: {
66656
67318
  type: "object",
66657
- properties: {
66658
- collections: {
66659
- type: "array",
66660
- items: {
66661
- type: "object",
66662
- additionalProperties: true
66663
- }
66664
- },
66665
- restricted: {
66666
- type: "boolean"
66667
- }
66668
- }
67319
+ additionalProperties: true
66669
67320
  }
66670
67321
  }
66671
67322
  }
66672
67323
  },
67324
+ "400": {
67325
+ $ref: "#/components/responses/BadRequest"
67326
+ },
66673
67327
  "401": {
66674
67328
  $ref: "#/components/responses/Unauthorized"
66675
67329
  },
@@ -66682,15 +67336,15 @@ var openapi_default = {
66682
67336
  }
66683
67337
  }
66684
67338
  },
66685
- "/v1/collections/counts": {
67339
+ "/v1/collections/directory": {
66686
67340
  get: {
66687
- operationId: "getCollectionCounts",
67341
+ operationId: "listCollectionsDirectory",
66688
67342
  "x-audience": "public",
66689
67343
  tags: [
66690
67344
  "Collections"
66691
67345
  ],
66692
- summary: "Count documents per collection",
66693
- description: "Visible-document counts per collection. Requires the `read` scope (or `documents:read`). Any member of the workspace may call it.",
67346
+ summary: "List the relationship directory",
67347
+ description: "Who is who: each identifier (an address, a domain, a phone number, a handle) with what that party is to the workspace and where that came from (`person`, `config`, `record` or `read`). Each entry is shown only where the key's person may see its evidence: configured and corrected entries for an owner, an entry from a record when the person may read that record, an entry from a conversation when the person may read that conversation. Requires the `read` scope (or `documents:read`). Any member of the workspace may call it.",
66694
67348
  security: [
66695
67349
  {
66696
67350
  BearerAuth: []
@@ -66706,18 +67360,100 @@ var openapi_default = {
66706
67360
  "application/json": {
66707
67361
  schema: {
66708
67362
  type: "object",
66709
- properties: {
66710
- collections: {
66711
- type: "array",
66712
- items: {
66713
- type: "object",
66714
- additionalProperties: true
67363
+ additionalProperties: true
67364
+ }
67365
+ }
67366
+ }
67367
+ },
67368
+ "400": {
67369
+ $ref: "#/components/responses/BadRequest"
67370
+ },
67371
+ "401": {
67372
+ $ref: "#/components/responses/Unauthorized"
67373
+ },
67374
+ "403": {
67375
+ $ref: "#/components/responses/Forbidden"
67376
+ },
67377
+ "429": {
67378
+ $ref: "#/components/responses/RateLimitExceeded"
67379
+ }
67380
+ }
67381
+ },
67382
+ put: {
67383
+ operationId: "saveCollectionsDirectory",
67384
+ "x-audience": "public",
67385
+ tags: [
67386
+ "Collections"
67387
+ ],
67388
+ summary: "Correct the relationship directory",
67389
+ description: "Sets entries as a person's correction (they outrank configuration, records and conversations for their identifier) and removes entries by id. The documents of every identifier touched are relabelled; `wait` waits up to 60 seconds and `pending` counts what is still to follow. Requires the `documents:write` scope. The key's person must be an Admin of the workspace (the `workspace` permission), as in the web app.",
67390
+ security: [
67391
+ {
67392
+ BearerAuth: []
67393
+ }
67394
+ ],
67395
+ "x-required-scopes": [
67396
+ "documents:write"
67397
+ ],
67398
+ requestBody: {
67399
+ required: true,
67400
+ content: {
67401
+ "application/json": {
67402
+ schema: {
67403
+ type: "object",
67404
+ properties: {
67405
+ entries: {
67406
+ type: "array",
67407
+ maxItems: 200,
67408
+ items: {
67409
+ type: "object",
67410
+ required: [
67411
+ "match_value",
67412
+ "relationship"
67413
+ ],
67414
+ properties: {
67415
+ match_value: {
67416
+ type: "string",
67417
+ description: "A typed identifier: `domain:acme.com`, `email:jane@acme.com`, `phone:\u2026`, `handle:\u2026` or `entity:\u2026`."
67418
+ },
67419
+ relationship: {
67420
+ type: "string",
67421
+ description: "A relationship kind of the workspace (its slug), or `own` / `other`."
67422
+ }
66715
67423
  }
66716
67424
  }
67425
+ },
67426
+ remove: {
67427
+ type: "array",
67428
+ maxItems: 200,
67429
+ items: {
67430
+ type: "string",
67431
+ format: "uuid"
67432
+ }
67433
+ },
67434
+ wait: {
67435
+ type: "boolean",
67436
+ description: "Wait up to 60 seconds for the documents to be relabelled."
66717
67437
  }
66718
67438
  }
66719
67439
  }
66720
67440
  }
67441
+ }
67442
+ },
67443
+ responses: {
67444
+ "200": {
67445
+ description: "OK",
67446
+ content: {
67447
+ "application/json": {
67448
+ schema: {
67449
+ type: "object",
67450
+ additionalProperties: true
67451
+ }
67452
+ }
67453
+ }
67454
+ },
67455
+ "400": {
67456
+ $ref: "#/components/responses/BadRequest"
66721
67457
  },
66722
67458
  "401": {
66723
67459
  $ref: "#/components/responses/Unauthorized"
@@ -66725,6 +67461,9 @@ var openapi_default = {
66725
67461
  "403": {
66726
67462
  $ref: "#/components/responses/Forbidden"
66727
67463
  },
67464
+ "404": {
67465
+ $ref: "#/components/responses/NotFound"
67466
+ },
66728
67467
  "429": {
66729
67468
  $ref: "#/components/responses/RateLimitExceeded"
66730
67469
  }
@@ -84956,6 +85695,31 @@ var openapi_default = {
84956
85695
  }
84957
85696
  },
84958
85697
  schemas: {
85698
+ DocumentParty: {
85699
+ type: "object",
85700
+ required: [
85701
+ "id"
85702
+ ],
85703
+ description: "One party of a document: a typed identifier and, optionally, its role. An address also stands for its domain unless it is a public mail provider's.",
85704
+ properties: {
85705
+ id: {
85706
+ type: "string",
85707
+ maxLength: 320,
85708
+ description: "`email:jane@acme.com`, `domain:acme.com`, `phone:+4930123456`, `handle:<scope>:<id>` or `entity:<id>` (a bare address reads as `email:`).",
85709
+ example: "email:jane@acme.com"
85710
+ },
85711
+ role: {
85712
+ type: "string",
85713
+ enum: [
85714
+ "from",
85715
+ "to",
85716
+ "cc",
85717
+ "attendee",
85718
+ "author"
85719
+ ]
85720
+ }
85721
+ }
85722
+ },
84959
85723
  Account: {
84960
85724
  type: "object",
84961
85725
  required: [
@@ -118423,6 +119187,84 @@ var openapi_default = {
118423
119187
  }
118424
119188
  }
118425
119189
  },
119190
+ SourceRecordRoles: {
119191
+ type: "object",
119192
+ required: [
119193
+ "available",
119194
+ "enabled",
119195
+ "admins",
119196
+ "owners",
119197
+ "unowned"
119198
+ ],
119199
+ properties: {
119200
+ available: {
119201
+ type: "boolean",
119202
+ description: "Whether the source says whose each record is. Without that the roles cannot be switched on."
119203
+ },
119204
+ enabled: {
119205
+ type: "boolean",
119206
+ description: "Whether admins read every record and everyone else their own."
119207
+ },
119208
+ admins: {
119209
+ type: "array",
119210
+ items: {
119211
+ $ref: "#/components/schemas/SourceRecordRolePerson"
119212
+ }
119213
+ },
119214
+ owners: {
119215
+ type: "array",
119216
+ description: "The owners the source names, most records first (at most 200).",
119217
+ items: {
119218
+ type: "object",
119219
+ required: [
119220
+ "email",
119221
+ "member",
119222
+ "records"
119223
+ ],
119224
+ properties: {
119225
+ email: {
119226
+ type: "string"
119227
+ },
119228
+ member: {
119229
+ nullable: true,
119230
+ allOf: [
119231
+ {
119232
+ $ref: "#/components/schemas/SourceRecordRolePerson"
119233
+ }
119234
+ ]
119235
+ },
119236
+ records: {
119237
+ type: "integer"
119238
+ }
119239
+ }
119240
+ }
119241
+ },
119242
+ unowned: {
119243
+ type: "integer",
119244
+ description: "Records that name no owner."
119245
+ }
119246
+ }
119247
+ },
119248
+ SourceRecordRolePerson: {
119249
+ type: "object",
119250
+ required: [
119251
+ "id"
119252
+ ],
119253
+ properties: {
119254
+ id: {
119255
+ type: "string",
119256
+ format: "uuid"
119257
+ },
119258
+ name: {
119259
+ type: "string",
119260
+ nullable: true
119261
+ },
119262
+ email: {
119263
+ type: "string",
119264
+ nullable: true
119265
+ }
119266
+ }
119267
+ },
118426
119268
  ThreadState: {
118427
119269
  type: "object",
118428
119270
  properties: {
@@ -125244,6 +126086,8 @@ curl https://api.talonic.com/v1/integrations/authorizations/3b1f0c2e-8d4a-4f6b-9
125244
126086
  ep("GET", "/v1/sources/:id/imports", "List what was brought in.", "A personal connection's history is its author's only. Scope: `read` or `sources:read`."),
125245
126087
  ep("POST", "/v1/sources/:id/imports/:importId/resync", "Read one Teams transcript period again.", "Unchanged content is not processed again. Scope: `documents:write`."),
125246
126088
  ep("POST", "/v1/sources/:id/make-private", "Make a connection private.", "Only its author (and the people they name) see what it holds. Its author or an owner may do it. Idempotent: `created: false` when a rule already restricts it. Scope: `sources:write`."),
126089
+ ep("GET", "/v1/sources/:id/record-roles", "Who reads the records of a connection.", "For a source whose records have an owner inside it (a CRM): whether it tells its readers apart, its admins, and the owners the source names with who each is in the workspace. Its author or a member with the Integrations permission. Scope: `read`."),
126090
+ ep("PUT", "/v1/sources/:id/record-roles", "Set who reads the records of a connection.", 'Body `{ "enabled": true, "admins": ["<user id>"] }`: the admins read every record, everyone else only the records the source names them as owner of (matched by mail address). `{ "enabled": false }` gives everyone all of it again. Scope: `sources:write`.'),
125247
126091
  ep("DELETE", "/v1/sources/:id", "Disconnect.", "For a connected account, its author or a member with the Integrations permission (a personal account: its author or an owner); the stored provider access is revoked at once. Scope: `write` or `sources:write`."),
125248
126092
  ep("GET", "/v1/sources/sql/:connectionId/tables", "Read a SQL database.", "Also `/overview`, `/tables/:table/columns`, `/tables/:table/rows` (`page`, `limit`, `q`) and `/saved-queries[/:queryId]`. Scope: `read` or `sources:read`."),
125249
126093
  ep("POST", "/v1/sources/sql/:connectionId/saved-queries", "Save a read-only query.", "Body: `name`, `sql_text`, optional `description`. Also `PATCH` and `DELETE /saved-queries/:queryId`, and `POST /test-query` (at most 100 rows). Scope: `sources:write`."),