@larc-iu/plaid-client 0.2.0-alpha.29 → 0.2.0-alpha.30
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/package.json +3 -2
- package/src/apiAnnotations.d.ts +508 -0
- package/src/apiAnnotations.js +543 -0
- package/src/apiDocuments.d.ts +569 -0
- package/src/apiDocuments.js +551 -0
- package/src/apiLayers.d.ts +369 -0
- package/src/apiLayers.js +222 -0
- package/src/apiMessages.d.ts +293 -0
- package/src/apiMessages.js +265 -0
- package/src/apiPeople.d.ts +626 -0
- package/src/apiPeople.js +698 -0
- package/src/apiProject.d.ts +761 -0
- package/src/apiProject.js +774 -0
- package/src/apiServer.d.ts +455 -0
- package/src/apiServer.js +422 -0
- package/src/apiVocab.d.ts +456 -0
- package/src/apiVocab.js +425 -0
- package/src/batch.d.ts +54 -0
- package/src/batch.js +323 -0
- package/src/client.d.ts +1321 -0
- package/src/client.js +743 -0
- package/src/constraints.d.ts +8 -0
- package/src/constraints.js +14 -0
- package/src/documentLock.d.ts +18 -4
- package/src/documentLock.js +43 -9
- package/src/entryForms.d.ts +63 -0
- package/src/entryForms.js +152 -0
- package/src/events.js +2 -1
- package/src/families.d.ts +349 -0
- package/src/families.js +396 -0
- package/src/http.d.ts +39 -18
- package/src/http.js +127 -87
- package/src/index.d.ts +90 -4557
- package/src/index.js +113 -5172
- package/src/operations.d.ts +36 -0
- package/src/operations.js +164 -0
- package/src/provenance.d.ts +47 -4
- package/src/provenance.js +168 -12
- package/src/roles.d.ts +39 -0
- package/src/roles.js +44 -0
- package/src/serviceSchema.d.ts +19 -13
- package/src/serviceSchema.js +30 -15
- package/src/services.d.ts +20 -3
- package/src/services.js +45 -8
- package/src/sse.js +10 -1
- package/src/testing.d.ts +128 -0
- package/src/testing.js +379 -0
- package/src/types.d.ts +867 -0
- package/src/types.js +663 -0
|
@@ -0,0 +1,456 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import("./types.js").TextEditOp} TextEditOp
|
|
3
|
+
* @typedef {import("./types.js").TextGap} TextGap
|
|
4
|
+
* @typedef {import("./types.js").MetadataOp} MetadataOp
|
|
5
|
+
* @typedef {import("./types.js").LayerConstraint} LayerConstraint
|
|
6
|
+
* @typedef {import("./types.js").ConstraintWriteOptions} ConstraintWriteOptions
|
|
7
|
+
* @typedef {import("./types.js").ConstraintViolation} ConstraintViolation
|
|
8
|
+
* @typedef {import("./types.js").Requester} Requester
|
|
9
|
+
* @typedef {import("./types.js").BatchRef} BatchRef
|
|
10
|
+
* @typedef {import("./types.js").ServiceParam} ServiceParam
|
|
11
|
+
* @typedef {import("./types.js").ServiceInfo} ServiceInfo
|
|
12
|
+
* @typedef {import("./types.js").DiscoveredService} DiscoveredService
|
|
13
|
+
* @typedef {import("./types.js").ResponseHelper} ResponseHelper
|
|
14
|
+
* @typedef {import("./types.js").ServiceRegistration} ServiceRegistration
|
|
15
|
+
* @typedef {import("./types.js").ServiceStatusEvent} ServiceStatusEvent
|
|
16
|
+
* @typedef {import("./types.js").OperationGroupsBundle} OperationGroupsBundle
|
|
17
|
+
* @typedef {import("./types.js").PlaidClientOptions} PlaidClientOptions
|
|
18
|
+
* @typedef {import("./types.js").OperationKind} OperationKind
|
|
19
|
+
* @typedef {import("./types.js").KeySeed} KeySeed
|
|
20
|
+
* @typedef {import("./types.js").PlaidBatch} PlaidBatch
|
|
21
|
+
* @typedef {import("./types.js").AuditPageOptions} AuditPageOptions
|
|
22
|
+
* @typedef {import("./types.js").VocabItemRestoreSummary} VocabItemRestoreSummary
|
|
23
|
+
* @typedef {import("./types.js").UserDataEntry} UserDataEntry
|
|
24
|
+
* @typedef {import("./types.js").AdminUserDataEntry} AdminUserDataEntry
|
|
25
|
+
* @typedef {import("./types.js").ActivityTallyRow} ActivityTallyRow
|
|
26
|
+
* @typedef {import("./types.js").ConstraintRepair} ConstraintRepair
|
|
27
|
+
* @typedef {import("./types.js").ValueSetRule} ValueSetRule
|
|
28
|
+
* @typedef {import("./types.js").RefusedValues} RefusedValues
|
|
29
|
+
* @typedef {import("./types.js").CommentableType} CommentableType
|
|
30
|
+
* @typedef {import("./types.js").Comment} Comment
|
|
31
|
+
* @typedef {import("./types.js").Guideline} Guideline
|
|
32
|
+
* @typedef {import("./types.js").ClientEventType} ClientEventType
|
|
33
|
+
* @typedef {import("./types.js").ClientEvent} ClientEvent
|
|
34
|
+
* @typedef {import("./types.js").Invite} Invite
|
|
35
|
+
* @typedef {import("./types.js").ServerLimits} ServerLimits
|
|
36
|
+
* @typedef {import("./types.js").ServerHealth} ServerHealth
|
|
37
|
+
* @typedef {import("./types.js").RateLimitBucket} RateLimitBucket
|
|
38
|
+
* @typedef {import("./types.js").RateLimitSnapshot} RateLimitSnapshot
|
|
39
|
+
* @typedef {import("./types.js").BackupStatus} BackupStatus
|
|
40
|
+
* @typedef {import("./types.js").ServerReport} ServerReport
|
|
41
|
+
* @typedef {import("./types.js").LiveLog} LiveLog
|
|
42
|
+
* @typedef {import("./types.js").SSEConnection} SSEConnection
|
|
43
|
+
* @typedef {import("./types.js").SSEStats} SSEStats
|
|
44
|
+
* @typedef {import("./types.js").AtomicValue} AtomicValue
|
|
45
|
+
* @typedef {import("./types.js").Created} Created
|
|
46
|
+
* @typedef {import("./types.js").Project} Project
|
|
47
|
+
* @typedef {import("./types.js").ProjectTextLayer} ProjectTextLayer
|
|
48
|
+
* @typedef {import("./types.js").ProjectTokenLayer} ProjectTokenLayer
|
|
49
|
+
* @typedef {import("./types.js").ProjectSpanLayer} ProjectSpanLayer
|
|
50
|
+
* @typedef {import("./types.js").ProjectRelationLayer} ProjectRelationLayer
|
|
51
|
+
* @typedef {import("./types.js").ProjectVocab} ProjectVocab
|
|
52
|
+
* @typedef {import("./types.js").PlaidDocument} PlaidDocument
|
|
53
|
+
* @typedef {import("./types.js").DocumentTextLayer} DocumentTextLayer
|
|
54
|
+
* @typedef {import("./types.js").DocumentTokenLayer} DocumentTokenLayer
|
|
55
|
+
* @typedef {import("./types.js").DocumentSpanLayer} DocumentSpanLayer
|
|
56
|
+
* @typedef {import("./types.js").PlaidText} PlaidText
|
|
57
|
+
* @typedef {import("./types.js").TextReshape} TextReshape
|
|
58
|
+
* @typedef {import("./types.js").Token} Token
|
|
59
|
+
* @typedef {import("./types.js").Span} Span
|
|
60
|
+
* @typedef {import("./types.js").Relation} Relation
|
|
61
|
+
* @typedef {import("./types.js").VocabItem} VocabItem
|
|
62
|
+
* @typedef {import("./types.js").VocabLink} VocabLink
|
|
63
|
+
* @typedef {import("./types.js").VocabLayer} VocabLayer
|
|
64
|
+
* @typedef {import("./types.js").TextLayer} TextLayer
|
|
65
|
+
* @typedef {import("./types.js").TokenLayer} TokenLayer
|
|
66
|
+
* @typedef {import("./types.js").SpanLayer} SpanLayer
|
|
67
|
+
* @typedef {import("./types.js").RelationLayer} RelationLayer
|
|
68
|
+
* @typedef {import("./types.js").MetadataRecords} MetadataRecords
|
|
69
|
+
* @typedef {import("./types.js").LayerRecords} LayerRecords
|
|
70
|
+
* @typedef {import("./types.js").User} User
|
|
71
|
+
* @typedef {import("./types.js").ProjectListEntry} ProjectListEntry
|
|
72
|
+
* @typedef {import("./types.js").DocumentListEntry} DocumentListEntry
|
|
73
|
+
* @typedef {import("./types.js").ApiToken} ApiToken
|
|
74
|
+
* @typedef {import("./types.js").AuditUser} AuditUser
|
|
75
|
+
* @typedef {import("./types.js").AuditTarget} AuditTarget
|
|
76
|
+
* @typedef {import("./types.js").AuditOp} AuditOp
|
|
77
|
+
* @typedef {import("./types.js").AuditEntry} AuditEntry
|
|
78
|
+
* @typedef {import("./types.js").LockGrant} LockGrant
|
|
79
|
+
* @typedef {import("./types.js").DocumentRestoreSummary} DocumentRestoreSummary
|
|
80
|
+
* @typedef {import("./types.js").RestoreCounts} RestoreCounts
|
|
81
|
+
* @typedef {import("./types.js").OperationGroup} OperationGroup
|
|
82
|
+
* @typedef {import("./types.js").QueryResult} QueryResult
|
|
83
|
+
*/
|
|
84
|
+
/**
|
|
85
|
+
* @template [T=any]
|
|
86
|
+
* @typedef {import("./types.js").Page<T>} Page
|
|
87
|
+
*/
|
|
88
|
+
/** @param {import("./client.js").PlaidClient} client */
|
|
89
|
+
export function vocabLayersApi(client: import("./client.js").PlaidClient): {
|
|
90
|
+
setConfig: (id: string, namespace: string, configKey: string, configValue: any, auditMessage?: string, options?: {
|
|
91
|
+
expected?: any;
|
|
92
|
+
}) => Promise<void>;
|
|
93
|
+
deleteConfig: (id: string, namespace: string, configKey: string, auditMessage?: string, options?: {
|
|
94
|
+
expected?: any;
|
|
95
|
+
}) => Promise<void>;
|
|
96
|
+
/**
|
|
97
|
+
* Get a vocab layer by ID. With `asOf`, the vocabulary as it was at that
|
|
98
|
+
* instant, read from its history: the same shape as the live read, its
|
|
99
|
+
* entries with `includeItems`. A vocabulary that did not exist then is a
|
|
100
|
+
* 404, a malformed or pruned time a 400.
|
|
101
|
+
* @param {string} id - The resource ID
|
|
102
|
+
* @param {boolean} [includeItems] - Include vocab items
|
|
103
|
+
* @param {string} [asOf] - The moment to read at (ISO-8601 instant)
|
|
104
|
+
* @returns {Promise<VocabLayer>}
|
|
105
|
+
*/
|
|
106
|
+
get: (id: string, includeItems?: boolean, asOf?: string) => Promise<VocabLayer>;
|
|
107
|
+
/**
|
|
108
|
+
* One entry of the vocabulary as it was at `asOf`, also when it has
|
|
109
|
+
* been deleted since. The same shape as `vocabItems.get`. A 404 when
|
|
110
|
+
* the entry was not in this vocabulary at that time.
|
|
111
|
+
* @param {string} id - The vocabulary ID
|
|
112
|
+
* @param {string} itemId - The entry ID
|
|
113
|
+
* @param {string} asOf - The moment to read at (ISO-8601 instant)
|
|
114
|
+
* @returns {Promise<VocabItem>}
|
|
115
|
+
*/
|
|
116
|
+
getItemAt: (id: string, itemId: string, asOf: string) => Promise<VocabItem>;
|
|
117
|
+
/**
|
|
118
|
+
* List all vocab layers accessible to user. Transparently follows
|
|
119
|
+
* pagination cursors and returns the full flat array.
|
|
120
|
+
* @returns {Promise<VocabLayer[]>}
|
|
121
|
+
*/
|
|
122
|
+
list: () => Promise<VocabLayer[]>;
|
|
123
|
+
/**
|
|
124
|
+
* Fetch a single page of vocab layers.
|
|
125
|
+
* @param {object} [opts]
|
|
126
|
+
* @param {number} [opts.limit] - Page size (1..1000; server default 100)
|
|
127
|
+
* @param {string} [opts.cursor] - Opaque cursor from a previous page
|
|
128
|
+
* @returns {Promise<Page<VocabLayer>>}
|
|
129
|
+
*/
|
|
130
|
+
listPage: ({ limit, cursor }?: {
|
|
131
|
+
limit?: number;
|
|
132
|
+
cursor?: string;
|
|
133
|
+
}) => Promise<Page<VocabLayer>>;
|
|
134
|
+
/**
|
|
135
|
+
* Async-iterate vocab layers page by page; yields each page's entries array.
|
|
136
|
+
* @param {object} [opts]
|
|
137
|
+
* @param {number} [opts.pageSize] - Per-request page size
|
|
138
|
+
* @returns {AsyncGenerator<VocabLayer[]>}
|
|
139
|
+
*/
|
|
140
|
+
iterPages: ({ pageSize }?: {
|
|
141
|
+
pageSize?: number;
|
|
142
|
+
}) => AsyncGenerator<VocabLayer[]>;
|
|
143
|
+
/**
|
|
144
|
+
* Create a new vocab layer. Note: this also registers the user as a maintainer.
|
|
145
|
+
* @param {string} name - The name
|
|
146
|
+
* @param {string} [auditMessage] - Audit message for this write
|
|
147
|
+
* @param {object} [opts]
|
|
148
|
+
* @param {string} [opts.id] - The new entity's id, minted by the caller (see uuidv7)
|
|
149
|
+
* @returns {Promise<Created>}
|
|
150
|
+
*/
|
|
151
|
+
create: (name: string, auditMessage?: string, { id }?: {
|
|
152
|
+
id?: string;
|
|
153
|
+
}) => Promise<Created>;
|
|
154
|
+
/**
|
|
155
|
+
* Update a vocab layer's name. A new name restates every document
|
|
156
|
+
* linking the vocabulary: their versions are bumped and taken up from
|
|
157
|
+
* X-Document-Versions.
|
|
158
|
+
* @param {string} id - The resource ID
|
|
159
|
+
* @param {string} name - The name
|
|
160
|
+
* @param {string} [auditMessage] - Audit message for this write
|
|
161
|
+
* @returns {Promise<VocabLayer>}
|
|
162
|
+
*/
|
|
163
|
+
update: (id: string, name: string, auditMessage?: string) => Promise<VocabLayer>;
|
|
164
|
+
/**
|
|
165
|
+
* Delete a vocab layer.
|
|
166
|
+
* @param {string} id - The resource ID
|
|
167
|
+
* @param {string} [auditMessage] - Audit message for this write
|
|
168
|
+
* @returns {Promise<void>}
|
|
169
|
+
*/
|
|
170
|
+
delete: (id: string, auditMessage?: string) => Promise<void>;
|
|
171
|
+
/**
|
|
172
|
+
* Get the audit log of a vocabulary: every change to it or to its
|
|
173
|
+
* entries, folded into entries as the document log is. Links are not
|
|
174
|
+
* listed, they belong to the document they annotate. Transparently
|
|
175
|
+
* follows pagination cursors and returns the full flat array.
|
|
176
|
+
* @param {string} id - The vocabulary ID
|
|
177
|
+
* @param {string} [startTime] - Start of time range
|
|
178
|
+
* @param {string} [endTime] - End of time range
|
|
179
|
+
* @param {string[]|string} [opTypes] - Only return operations of these
|
|
180
|
+
* types, spelled as in an entry's `op/type` (e.g.
|
|
181
|
+
* `['vocab-item/delete', 'vocab-item/restore']`)
|
|
182
|
+
* @param {string} [itemId] - Only the changes that wrote this one entry,
|
|
183
|
+
* each with only its operations that did
|
|
184
|
+
* @param {string[]|string} [kinds] - Only the entries of operations of
|
|
185
|
+
* these kinds (e.g. `['review', 'guess-adoption']`), each whole
|
|
186
|
+
* @returns {Promise<AuditEntry[]>}
|
|
187
|
+
*/
|
|
188
|
+
audit: (id: string, startTime?: string, endTime?: string, opTypes?: string[] | string, itemId?: string, kinds?: string[] | string) => Promise<AuditEntry[]>;
|
|
189
|
+
/**
|
|
190
|
+
* One page of the same log, newest-first with `order: "desc"`. Use this
|
|
191
|
+
* rather than audit() wherever the caller wants the recent end of a log
|
|
192
|
+
* that may be long: audit() walks every page before it resolves.
|
|
193
|
+
* @param {string} id - The vocabulary ID
|
|
194
|
+
* @param {object} [opts]
|
|
195
|
+
* @param {string} [opts.startTime] - Only entries at or after this instant
|
|
196
|
+
* @param {string} [opts.endTime] - Only entries at or before this instant
|
|
197
|
+
* @param {string[]|string} [opts.opTypes] - Only these op types
|
|
198
|
+
* @param {OperationKind[]|string} [opts.kinds] - Only the entries of operations of these kinds, each whole
|
|
199
|
+
* @param {"asc"|"desc"} [opts.order] - "desc" pages newest-first
|
|
200
|
+
* @param {number} [opts.limit] - Page size (1..1000; server default 100)
|
|
201
|
+
* @param {string} [opts.cursor] - Opaque cursor from a previous page
|
|
202
|
+
* @param {number} [opts.opsLimit] - Keep only each entry's oldest N
|
|
203
|
+
* operations in `ops` (1..1000). `opCount` on every entry says how
|
|
204
|
+
* many it has
|
|
205
|
+
* @param {string} [opts.entryId] - Read only this entry, not a page
|
|
206
|
+
* @param {string} [opts.itemId] - Only the changes that wrote this one
|
|
207
|
+
* entry, each with only its operations that did
|
|
208
|
+
* @returns {Promise<Page<AuditEntry>>}
|
|
209
|
+
*/
|
|
210
|
+
auditPage: (id: string, { startTime, endTime, opTypes, kinds, order, limit, cursor, opsLimit, entryId, itemId }?: {
|
|
211
|
+
startTime?: string;
|
|
212
|
+
endTime?: string;
|
|
213
|
+
opTypes?: string[] | string;
|
|
214
|
+
kinds?: OperationKind[] | string;
|
|
215
|
+
order?: "asc" | "desc";
|
|
216
|
+
limit?: number;
|
|
217
|
+
cursor?: string;
|
|
218
|
+
opsLimit?: number;
|
|
219
|
+
entryId?: string;
|
|
220
|
+
itemId?: string;
|
|
221
|
+
}) => Promise<Page<AuditEntry>>;
|
|
222
|
+
/**
|
|
223
|
+
* Put one entry of the vocabulary back as it was at `asOf`, as one
|
|
224
|
+
* operation. A deleted entry comes back under its original id with its
|
|
225
|
+
* form and fields, and a living one has its form and fields set back.
|
|
226
|
+
* Links are not part of an entry: a deleted entry's links come back
|
|
227
|
+
* through each document's own `documents.restore`. Resolves to
|
|
228
|
+
* `{inserted, form, metadata, total}`, `total` 0 when nothing changes.
|
|
229
|
+
* A form set back bumps every linking document, and the new versions
|
|
230
|
+
* come back in X-Document-Versions (or, past fifty documents,
|
|
231
|
+
* X-Document-Versions-Omitted), which the client takes up as on any
|
|
232
|
+
* write. A time when the entry did not exist is a 400. Maintainers of
|
|
233
|
+
* the vocabulary only.
|
|
234
|
+
* @param {string} id - The vocabulary ID
|
|
235
|
+
* @param {string} itemId - The entry ID
|
|
236
|
+
* @param {string} asOf - The moment to go back to (ISO-8601 instant),
|
|
237
|
+
* typically a history entry's `endTime`
|
|
238
|
+
* @param {{dryRun?: boolean}} [options] - `{ dryRun }`: with `dryRun` true nothing
|
|
239
|
+
* is written and the summary says what would change
|
|
240
|
+
* @param {string} [auditMessage] - Custom audit message for this operation
|
|
241
|
+
* @returns {Promise<VocabItemRestoreSummary>}
|
|
242
|
+
*/
|
|
243
|
+
restoreItem: (id: string, itemId: string, asOf: string, { dryRun }?: {
|
|
244
|
+
dryRun?: boolean;
|
|
245
|
+
}, auditMessage?: string) => Promise<VocabItemRestoreSummary>;
|
|
246
|
+
/**
|
|
247
|
+
* Assign a user as a maintainer for this vocab layer.
|
|
248
|
+
* @param {string} id - The resource ID
|
|
249
|
+
* @param {string} userId - The user ID
|
|
250
|
+
* @param {string} [auditMessage] - Audit message for this write
|
|
251
|
+
* @returns {Promise<void>}
|
|
252
|
+
*/
|
|
253
|
+
addMaintainer: (id: string, userId: string, auditMessage?: string) => Promise<void>;
|
|
254
|
+
/**
|
|
255
|
+
* Remove a user's maintainer privileges for this vocab layer.
|
|
256
|
+
* @param {string} id - The resource ID
|
|
257
|
+
* @param {string} userId - The user ID
|
|
258
|
+
* @param {string} [auditMessage] - Audit message for this write
|
|
259
|
+
* @returns {Promise<void>}
|
|
260
|
+
*/
|
|
261
|
+
removeMaintainer: (id: string, userId: string, auditMessage?: string) => Promise<void>;
|
|
262
|
+
};
|
|
263
|
+
/** @param {import("./client.js").PlaidClient} client */
|
|
264
|
+
export function vocabItemsApi(client: import("./client.js").PlaidClient): {
|
|
265
|
+
setMetadata: (id: string, body: object, auditMessage?: string) => Promise<import("./types.js").VocabItem>;
|
|
266
|
+
deleteMetadata: (id: string, auditMessage?: string) => Promise<import("./types.js").VocabItem>;
|
|
267
|
+
patchMetadata: (id: string, body: import("./families.js").MetadataOp[], auditMessage?: string) => Promise<import("./types.js").VocabItem>;
|
|
268
|
+
/**
|
|
269
|
+
* Get a vocab item by ID
|
|
270
|
+
* @param {string} id - The resource ID
|
|
271
|
+
* @returns {Promise<VocabItem>}
|
|
272
|
+
*/
|
|
273
|
+
get: (id: string) => Promise<VocabItem>;
|
|
274
|
+
/**
|
|
275
|
+
* Create a new vocab item
|
|
276
|
+
* @param {string} vocabLayerId - The vocab layer ID
|
|
277
|
+
* @param {string} form - The vocab item form
|
|
278
|
+
* @param {any} [metadata] - Metadata map. Omit to leave unset; pass null to send JSON null.
|
|
279
|
+
* @param {string} [auditMessage] - Audit message for this write
|
|
280
|
+
* @param {object} [opts]
|
|
281
|
+
* @param {string} [opts.id] - The new entity's id, minted by the caller (see uuidv7)
|
|
282
|
+
* @returns {Promise<Created>}
|
|
283
|
+
*/
|
|
284
|
+
create: (vocabLayerId: string, form: string, metadata?: any, auditMessage?: string, { id }?: {
|
|
285
|
+
id?: string;
|
|
286
|
+
}) => Promise<Created>;
|
|
287
|
+
/**
|
|
288
|
+
* Update a vocab item's form. A document read carries the entry's form on
|
|
289
|
+
* every link to it, so a rename restates those documents: each has its
|
|
290
|
+
* version bumped, and a strict-mode client picks up their new versions
|
|
291
|
+
* from the response.
|
|
292
|
+
* @param {string} id - The resource ID
|
|
293
|
+
* @param {string} form - The vocab item form
|
|
294
|
+
* @param {string} [auditMessage] - Audit message for this write
|
|
295
|
+
* @returns {Promise<VocabItem>}
|
|
296
|
+
*/
|
|
297
|
+
update: (id: string, form: string, auditMessage?: string) => Promise<VocabItem>;
|
|
298
|
+
/**
|
|
299
|
+
* Delete a vocab item, and every link to it. Every document holding one
|
|
300
|
+
* of those links has its version bumped, and a strict-mode client picks
|
|
301
|
+
* up their new versions from the response.
|
|
302
|
+
* @param {string} id - The resource ID
|
|
303
|
+
* @param {string} [auditMessage] - Audit message for this write
|
|
304
|
+
* @param {{expectedLinkCount?: number}} [options] - `expectedLinkCount`: the
|
|
305
|
+
* number of links the caller showed. The delete is refused with a 409 when
|
|
306
|
+
* the entry has any other number of links by then.
|
|
307
|
+
* @returns {Promise<void>}
|
|
308
|
+
*/
|
|
309
|
+
delete: (id: string, auditMessage?: string, { expectedLinkCount }?: {
|
|
310
|
+
expectedLinkCount?: number;
|
|
311
|
+
}) => Promise<void>;
|
|
312
|
+
/**
|
|
313
|
+
* Create multiple vocab items in a single operation. Entries may target
|
|
314
|
+
* different vocab layers; the user must have write access to each.
|
|
315
|
+
* @param {Array<{vocabLayerId: string, form: string, metadata?: any}>} body - The vocab items to create
|
|
316
|
+
* @param {string} [auditMessage] - Audit message for this write
|
|
317
|
+
* @returns {Promise<{ids: string[]}>}
|
|
318
|
+
*/
|
|
319
|
+
bulkCreate: (body: Array<{
|
|
320
|
+
vocabLayerId: string;
|
|
321
|
+
form: string;
|
|
322
|
+
metadata?: any;
|
|
323
|
+
}>, auditMessage?: string) => Promise<{
|
|
324
|
+
ids: string[];
|
|
325
|
+
}>;
|
|
326
|
+
/**
|
|
327
|
+
* Update many vocab items in a single operation: set forms and/or patch
|
|
328
|
+
* metadata.
|
|
329
|
+
* @param {Array<{id: string, form?: string, metadata?: Array<object>}>} body - `form` is set only when the key is present; `metadata` is a list of metadata ops, as for patchMetadata. The entries may lie in several vocab layers; the user must have write access to each. An unknown id refuses the whole update, and an id may appear only once. Only an entry whose form really changes restates the documents linking it, and a strict-mode client picks up their new versions from the response.
|
|
330
|
+
* @param {string} [auditMessage] - Audit message for this write
|
|
331
|
+
* @returns {Promise<{count: number}>} How many vocab items were updated.
|
|
332
|
+
*/
|
|
333
|
+
bulkUpdate: (body: Array<{
|
|
334
|
+
id: string;
|
|
335
|
+
form?: string;
|
|
336
|
+
metadata?: Array<object>;
|
|
337
|
+
}>, auditMessage?: string) => Promise<{
|
|
338
|
+
count: number;
|
|
339
|
+
}>;
|
|
340
|
+
/**
|
|
341
|
+
* Delete multiple vocab items in a single operation. Each item's
|
|
342
|
+
* descendant vocab links are deleted too. Provide an array of IDs.
|
|
343
|
+
*
|
|
344
|
+
* Every document holding one of those links has its version bumped, and
|
|
345
|
+
* a strict-mode client picks up their new versions from the response.
|
|
346
|
+
* @param {string[]} body - The vocab item IDs to delete
|
|
347
|
+
* @param {string} [auditMessage] - Audit message for this write
|
|
348
|
+
* @returns {Promise<void>}
|
|
349
|
+
*/
|
|
350
|
+
bulkDelete: (body: string[], auditMessage?: string) => Promise<void>;
|
|
351
|
+
/**
|
|
352
|
+
* Merge entries into this one, in one operation. Every link to a loser
|
|
353
|
+
* moves to the survivor (keeping its id and metadata), except a link on
|
|
354
|
+
* words the survivor is already linked to, which is deleted, and then the
|
|
355
|
+
* losers are deleted. Links are read when the merge runs, so one made
|
|
356
|
+
* after the caller looked moves too. Every loser must be in the
|
|
357
|
+
* survivor's vocabulary, and a loser that is already gone is skipped, so
|
|
358
|
+
* a repeated merge changes nothing. Metadata naming a loser by its id,
|
|
359
|
+
* in the vocabulary's other entries and in the documents of every
|
|
360
|
+
* project it is linked to, is rewritten to name the survivor. A
|
|
361
|
+
* reference to a loser in the survivor's own metadata is the caller's to
|
|
362
|
+
* rewrite, in the same batch.
|
|
363
|
+
* Needs maintainer rights on the vocabulary.
|
|
364
|
+
* @param {string} survivorId - The entry that stays
|
|
365
|
+
* @param {string[]} loserIds - The entries merged into it
|
|
366
|
+
* @param {string} [auditMessage] - Audit message for this write
|
|
367
|
+
* @returns {Promise<{moved: number, duplicates: number, removed: string[]}>}
|
|
368
|
+
*/
|
|
369
|
+
merge: (survivorId: string, loserIds: string[], auditMessage?: string) => Promise<{
|
|
370
|
+
moved: number;
|
|
371
|
+
duplicates: number;
|
|
372
|
+
removed: string[];
|
|
373
|
+
}>;
|
|
374
|
+
};
|
|
375
|
+
export type TextEditOp = import("./types.js").TextEditOp;
|
|
376
|
+
export type TextGap = import("./types.js").TextGap;
|
|
377
|
+
export type MetadataOp = import("./types.js").MetadataOp;
|
|
378
|
+
export type LayerConstraint = import("./types.js").LayerConstraint;
|
|
379
|
+
export type ConstraintWriteOptions = import("./types.js").ConstraintWriteOptions;
|
|
380
|
+
export type ConstraintViolation = import("./types.js").ConstraintViolation;
|
|
381
|
+
export type Requester = import("./types.js").Requester;
|
|
382
|
+
export type BatchRef = import("./types.js").BatchRef;
|
|
383
|
+
export type ServiceParam = import("./types.js").ServiceParam;
|
|
384
|
+
export type ServiceInfo = import("./types.js").ServiceInfo;
|
|
385
|
+
export type DiscoveredService = import("./types.js").DiscoveredService;
|
|
386
|
+
export type ResponseHelper = import("./types.js").ResponseHelper;
|
|
387
|
+
export type ServiceRegistration = import("./types.js").ServiceRegistration;
|
|
388
|
+
export type ServiceStatusEvent = import("./types.js").ServiceStatusEvent;
|
|
389
|
+
export type OperationGroupsBundle = import("./types.js").OperationGroupsBundle;
|
|
390
|
+
export type PlaidClientOptions = import("./types.js").PlaidClientOptions;
|
|
391
|
+
export type OperationKind = import("./types.js").OperationKind;
|
|
392
|
+
export type KeySeed = import("./types.js").KeySeed;
|
|
393
|
+
export type PlaidBatch = import("./types.js").PlaidBatch;
|
|
394
|
+
export type AuditPageOptions = import("./types.js").AuditPageOptions;
|
|
395
|
+
export type VocabItemRestoreSummary = import("./types.js").VocabItemRestoreSummary;
|
|
396
|
+
export type UserDataEntry = import("./types.js").UserDataEntry;
|
|
397
|
+
export type AdminUserDataEntry = import("./types.js").AdminUserDataEntry;
|
|
398
|
+
export type ActivityTallyRow = import("./types.js").ActivityTallyRow;
|
|
399
|
+
export type ConstraintRepair = import("./types.js").ConstraintRepair;
|
|
400
|
+
export type ValueSetRule = import("./types.js").ValueSetRule;
|
|
401
|
+
export type RefusedValues = import("./types.js").RefusedValues;
|
|
402
|
+
export type CommentableType = import("./types.js").CommentableType;
|
|
403
|
+
export type Comment = import("./types.js").Comment;
|
|
404
|
+
export type Guideline = import("./types.js").Guideline;
|
|
405
|
+
export type ClientEventType = import("./types.js").ClientEventType;
|
|
406
|
+
export type ClientEvent = import("./types.js").ClientEvent;
|
|
407
|
+
export type Invite = import("./types.js").Invite;
|
|
408
|
+
export type ServerLimits = import("./types.js").ServerLimits;
|
|
409
|
+
export type ServerHealth = import("./types.js").ServerHealth;
|
|
410
|
+
export type RateLimitBucket = import("./types.js").RateLimitBucket;
|
|
411
|
+
export type RateLimitSnapshot = import("./types.js").RateLimitSnapshot;
|
|
412
|
+
export type BackupStatus = import("./types.js").BackupStatus;
|
|
413
|
+
export type ServerReport = import("./types.js").ServerReport;
|
|
414
|
+
export type LiveLog = import("./types.js").LiveLog;
|
|
415
|
+
export type SSEConnection = import("./types.js").SSEConnection;
|
|
416
|
+
export type SSEStats = import("./types.js").SSEStats;
|
|
417
|
+
export type AtomicValue = import("./types.js").AtomicValue;
|
|
418
|
+
export type Created = import("./types.js").Created;
|
|
419
|
+
export type Project = import("./types.js").Project;
|
|
420
|
+
export type ProjectTextLayer = import("./types.js").ProjectTextLayer;
|
|
421
|
+
export type ProjectTokenLayer = import("./types.js").ProjectTokenLayer;
|
|
422
|
+
export type ProjectSpanLayer = import("./types.js").ProjectSpanLayer;
|
|
423
|
+
export type ProjectRelationLayer = import("./types.js").ProjectRelationLayer;
|
|
424
|
+
export type ProjectVocab = import("./types.js").ProjectVocab;
|
|
425
|
+
export type PlaidDocument = import("./types.js").PlaidDocument;
|
|
426
|
+
export type DocumentTextLayer = import("./types.js").DocumentTextLayer;
|
|
427
|
+
export type DocumentTokenLayer = import("./types.js").DocumentTokenLayer;
|
|
428
|
+
export type DocumentSpanLayer = import("./types.js").DocumentSpanLayer;
|
|
429
|
+
export type PlaidText = import("./types.js").PlaidText;
|
|
430
|
+
export type TextReshape = import("./types.js").TextReshape;
|
|
431
|
+
export type Token = import("./types.js").Token;
|
|
432
|
+
export type Span = import("./types.js").Span;
|
|
433
|
+
export type Relation = import("./types.js").Relation;
|
|
434
|
+
export type VocabItem = import("./types.js").VocabItem;
|
|
435
|
+
export type VocabLink = import("./types.js").VocabLink;
|
|
436
|
+
export type VocabLayer = import("./types.js").VocabLayer;
|
|
437
|
+
export type TextLayer = import("./types.js").TextLayer;
|
|
438
|
+
export type TokenLayer = import("./types.js").TokenLayer;
|
|
439
|
+
export type SpanLayer = import("./types.js").SpanLayer;
|
|
440
|
+
export type RelationLayer = import("./types.js").RelationLayer;
|
|
441
|
+
export type MetadataRecords = import("./types.js").MetadataRecords;
|
|
442
|
+
export type LayerRecords = import("./types.js").LayerRecords;
|
|
443
|
+
export type User = import("./types.js").User;
|
|
444
|
+
export type ProjectListEntry = import("./types.js").ProjectListEntry;
|
|
445
|
+
export type DocumentListEntry = import("./types.js").DocumentListEntry;
|
|
446
|
+
export type ApiToken = import("./types.js").ApiToken;
|
|
447
|
+
export type AuditUser = import("./types.js").AuditUser;
|
|
448
|
+
export type AuditTarget = import("./types.js").AuditTarget;
|
|
449
|
+
export type AuditOp = import("./types.js").AuditOp;
|
|
450
|
+
export type AuditEntry = import("./types.js").AuditEntry;
|
|
451
|
+
export type LockGrant = import("./types.js").LockGrant;
|
|
452
|
+
export type DocumentRestoreSummary = import("./types.js").DocumentRestoreSummary;
|
|
453
|
+
export type RestoreCounts = import("./types.js").RestoreCounts;
|
|
454
|
+
export type OperationGroup = import("./types.js").OperationGroup;
|
|
455
|
+
export type QueryResult = import("./types.js").QueryResult;
|
|
456
|
+
export type Page<T = any> = import("./types.js").Page<T>;
|