@larc-iu/plaid-client 0.2.0-alpha.3 → 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/README.md +39 -0
- package/package.json +13 -6
- 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/batchRef.d.ts +30 -0
- package/src/batchRef.js +128 -0
- package/src/client.d.ts +1321 -0
- package/src/client.js +743 -0
- package/src/codepoint.d.ts +94 -0
- package/src/codepoint.js +131 -1
- package/src/constraints.d.ts +85 -0
- package/src/constraints.js +112 -0
- package/src/created.d.ts +2 -0
- package/src/created.js +29 -0
- package/src/documentLock.d.ts +172 -0
- package/src/documentLock.js +384 -0
- package/src/entryForms.d.ts +63 -0
- package/src/entryForms.js +152 -0
- package/src/events.d.ts +60 -0
- package/src/events.js +271 -0
- package/src/families.d.ts +349 -0
- package/src/families.js +396 -0
- package/src/http.d.ts +233 -0
- package/src/http.js +809 -93
- package/src/ids.d.ts +26 -0
- package/src/ids.js +96 -0
- package/src/index.d.ts +101 -0
- package/src/index.js +183 -2105
- package/src/metadataOps.d.ts +15 -0
- package/src/metadataOps.js +124 -0
- package/src/operations.d.ts +36 -0
- package/src/operations.js +164 -0
- package/src/pagination.d.ts +49 -0
- package/src/pagination.js +20 -53
- package/src/provenance.d.ts +243 -0
- package/src/provenance.js +458 -36
- package/src/replayed.d.ts +3 -0
- package/src/replayed.js +31 -0
- package/src/requester.d.ts +60 -0
- package/src/requester.js +74 -0
- package/src/roles.d.ts +104 -0
- package/src/roles.js +64 -2
- package/src/serviceSchema.d.ts +337 -0
- package/src/serviceSchema.js +177 -60
- package/src/services.d.ts +319 -0
- package/src/services.js +742 -58
- package/src/sse.d.ts +30 -0
- package/src/sse.js +80 -3
- package/src/testing.d.ts +128 -0
- package/src/testing.js +379 -0
- package/src/textEdits.d.ts +59 -0
- package/src/textEdits.js +234 -0
- package/src/transforms.d.ts +25 -0
- package/src/transforms.js +11 -1
- package/src/types.d.ts +867 -0
- package/src/types.js +663 -0
- package/index.d.ts +0 -532
package/index.d.ts
DELETED
|
@@ -1,532 +0,0 @@
|
|
|
1
|
-
/** A single page of a cursor-paginated collection. */
|
|
2
|
-
interface Page<T = any> {
|
|
3
|
-
entries: T[];
|
|
4
|
-
nextCursor: string | null;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
/** One choice for an `enum` / `multiselect` service parameter. */
|
|
8
|
-
interface ServiceParamOption {
|
|
9
|
-
value: string;
|
|
10
|
-
label: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/** A single user-controllable argument a service advertises. */
|
|
14
|
-
interface ServiceParam {
|
|
15
|
-
/** Key the value is sent under in the request payload. */
|
|
16
|
-
key: string;
|
|
17
|
-
label: string;
|
|
18
|
-
type: 'string' | 'number' | 'boolean' | 'enum' | 'multiselect';
|
|
19
|
-
description?: string;
|
|
20
|
-
default?: any;
|
|
21
|
-
required?: boolean;
|
|
22
|
-
/** Required for `enum` / `multiselect`. */
|
|
23
|
-
options?: ServiceParamOption[];
|
|
24
|
-
/** `number` only. */
|
|
25
|
-
min?: number;
|
|
26
|
-
max?: number;
|
|
27
|
-
step?: number;
|
|
28
|
-
/** `string` only. */
|
|
29
|
-
placeholder?: string;
|
|
30
|
-
multiline?: boolean;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/** A service's standardized self-description (lives in `extras`). */
|
|
34
|
-
interface ServiceExtras {
|
|
35
|
-
schemaVersion?: number;
|
|
36
|
-
/** Tasks this service serves; from the TASKS vocabulary. */
|
|
37
|
-
tasks?: string[];
|
|
38
|
-
/** Rich human description (markdown), beyond the short `description`. */
|
|
39
|
-
summary?: string;
|
|
40
|
-
/** Ordered parameter schema, rendered into a form by the UI. */
|
|
41
|
-
parameters?: ServiceParam[];
|
|
42
|
-
[key: string]: any;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
interface ServiceInfo {
|
|
46
|
-
serviceId: string;
|
|
47
|
-
serviceName: string;
|
|
48
|
-
description: string;
|
|
49
|
-
extras?: ServiceExtras;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
interface DiscoveredService {
|
|
53
|
-
serviceId: string;
|
|
54
|
-
serviceName: string;
|
|
55
|
-
description: string;
|
|
56
|
-
extras: ServiceExtras;
|
|
57
|
-
/** true while the service holds an open request channel; false for previously-seen offline services. */
|
|
58
|
-
online: boolean;
|
|
59
|
-
/** ISO-8601 stamp of when the service was last seen alive, or null/undefined if never persisted. */
|
|
60
|
-
lastSeenAt?: string | null;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
interface ServiceRegistration {
|
|
64
|
-
stop(): void;
|
|
65
|
-
isRunning(): boolean;
|
|
66
|
-
serviceInfo: ServiceInfo & { extras: any };
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
interface ResponseHelper {
|
|
70
|
-
progress(percent: number, message: string): void;
|
|
71
|
-
complete(data: any): void;
|
|
72
|
-
error(error: string | Error): void;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
interface SSEConnection {
|
|
76
|
-
close(): void;
|
|
77
|
-
getStats(): any;
|
|
78
|
-
readyState: number;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
interface VocabLinksBundle {
|
|
82
|
-
create(vocabItem: string, tokens: any[], metadata?: any, auditMessage?: string): Promise<any>;
|
|
83
|
-
bulkCreate(body: any[], auditMessage?: string): Promise<{ ids: string[] }>;
|
|
84
|
-
bulkDelete(body: any[], auditMessage?: string): Promise<void>;
|
|
85
|
-
setMetadata(id: string, body: any, auditMessage?: string): Promise<any>;
|
|
86
|
-
deleteMetadata(id: string, auditMessage?: string): Promise<any>;
|
|
87
|
-
patchMetadata(id: string, body: any, auditMessage?: string): Promise<any>;
|
|
88
|
-
get(id: string, asOf?: string): Promise<any>;
|
|
89
|
-
delete(id: string, auditMessage?: string): Promise<any>;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
interface VocabLayersBundle {
|
|
93
|
-
get(id: string, includeItems?: boolean, asOf?: string): Promise<any>;
|
|
94
|
-
delete(id: string, auditMessage?: string): Promise<any>;
|
|
95
|
-
update(id: string, name: string, auditMessage?: string): Promise<any>;
|
|
96
|
-
setConfig(id: string, namespace: string, configKey: string, configValue: any, auditMessage?: string): Promise<any>;
|
|
97
|
-
deleteConfig(id: string, namespace: string, configKey: string, auditMessage?: string): Promise<any>;
|
|
98
|
-
list(asOf?: string): Promise<any[]>;
|
|
99
|
-
listPage(opts?: { limit?: number; cursor?: string; asOf?: string }): Promise<Page>;
|
|
100
|
-
iterPages(opts?: { pageSize?: number; asOf?: string }): AsyncGenerator<any[]>;
|
|
101
|
-
create(name: string, auditMessage?: string): Promise<any>;
|
|
102
|
-
addMaintainer(id: string, userId: string, auditMessage?: string): Promise<any>;
|
|
103
|
-
removeMaintainer(id: string, userId: string, auditMessage?: string): Promise<any>;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
interface RelationsBundle {
|
|
107
|
-
setMetadata(relationId: string, body: any, auditMessage?: string): Promise<any>;
|
|
108
|
-
deleteMetadata(relationId: string, auditMessage?: string): Promise<any>;
|
|
109
|
-
patchMetadata(relationId: string, body: any, auditMessage?: string): Promise<any>;
|
|
110
|
-
setTarget(relationId: string, spanId: string, auditMessage?: string): Promise<any>;
|
|
111
|
-
get(relationId: string, asOf?: string): Promise<any>;
|
|
112
|
-
delete(relationId: string, auditMessage?: string): Promise<any>;
|
|
113
|
-
update(relationId: string, value: any, auditMessage?: string): Promise<any>;
|
|
114
|
-
setSource(relationId: string, spanId: string, auditMessage?: string): Promise<any>;
|
|
115
|
-
create(layerId: string, sourceId: string, targetId: string, value: any, metadata?: any, auditMessage?: string): Promise<any>;
|
|
116
|
-
bulkCreate(body: any[], auditMessage?: string): Promise<{ ids: string[] }>;
|
|
117
|
-
bulkDelete(body: any[], auditMessage?: string): Promise<void>;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
interface SpanLayersBundle {
|
|
121
|
-
setConfig(spanLayerId: string, namespace: string, configKey: string, configValue: any, auditMessage?: string): Promise<any>;
|
|
122
|
-
deleteConfig(spanLayerId: string, namespace: string, configKey: string, auditMessage?: string): Promise<any>;
|
|
123
|
-
get(spanLayerId: string, asOf?: string): Promise<any>;
|
|
124
|
-
delete(spanLayerId: string, auditMessage?: string): Promise<any>;
|
|
125
|
-
update(spanLayerId: string, name: string, auditMessage?: string): Promise<any>;
|
|
126
|
-
create(tokenLayerId: string, name: string, auditMessage?: string): Promise<any>;
|
|
127
|
-
shift(spanLayerId: string, direction: string, auditMessage?: string): Promise<any>;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
interface SpansBundle {
|
|
131
|
-
setTokens(spanId: string, tokens: any[], auditMessage?: string): Promise<any>;
|
|
132
|
-
create(spanLayerId: string, tokens: any[], value: any, metadata?: any, auditMessage?: string): Promise<any>;
|
|
133
|
-
get(spanId: string, asOf?: string): Promise<any>;
|
|
134
|
-
delete(spanId: string, auditMessage?: string): Promise<any>;
|
|
135
|
-
update(spanId: string, value: any, auditMessage?: string): Promise<any>;
|
|
136
|
-
bulkCreate(body: any[], auditMessage?: string): Promise<{ ids: string[] }>;
|
|
137
|
-
bulkDelete(body: any[], auditMessage?: string): Promise<void>;
|
|
138
|
-
setMetadata(spanId: string, body: any, auditMessage?: string): Promise<any>;
|
|
139
|
-
deleteMetadata(spanId: string, auditMessage?: string): Promise<any>;
|
|
140
|
-
patchMetadata(spanId: string, body: any, auditMessage?: string): Promise<any>;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
interface BatchBundle {
|
|
144
|
-
submit(body: any[], auditMessage?: string): Promise<any>;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
interface TextsBundle {
|
|
148
|
-
setMetadata(textId: string, body: any, auditMessage?: string): Promise<any>;
|
|
149
|
-
deleteMetadata(textId: string, auditMessage?: string): Promise<any>;
|
|
150
|
-
patchMetadata(textId: string, body: any, auditMessage?: string): Promise<any>;
|
|
151
|
-
create(textLayerId: string, documentId: string, body: string, metadata?: any, auditMessage?: string): Promise<any>;
|
|
152
|
-
get(textId: string, asOf?: string): Promise<any>;
|
|
153
|
-
delete(textId: string, auditMessage?: string): Promise<any>;
|
|
154
|
-
update(textId: string, body: any, auditMessage?: string): Promise<any>;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
interface UsersBundle {
|
|
158
|
-
list(asOf?: string): Promise<any[]>;
|
|
159
|
-
listPage(opts?: { limit?: number; cursor?: string; asOf?: string }): Promise<Page>;
|
|
160
|
-
iterPages(opts?: { pageSize?: number; asOf?: string }): AsyncGenerator<any[]>;
|
|
161
|
-
create(username: string, password: string, isAdmin: boolean, auditMessage?: string): Promise<any>;
|
|
162
|
-
audit(userId: string, startTime?: string, endTime?: string, asOf?: string): Promise<any[]>;
|
|
163
|
-
get(id: string, asOf?: string): Promise<any>;
|
|
164
|
-
delete(id: string, auditMessage?: string): Promise<any>;
|
|
165
|
-
activate(id: string, auditMessage?: string): Promise<any>;
|
|
166
|
-
update(id: string, password?: string, username?: string, isAdmin?: boolean, auditMessage?: string): Promise<any>;
|
|
167
|
-
/** URL for a user's profile picture, usable as an <img> src. Null when avatarHash is explicitly null. */
|
|
168
|
-
avatarUrl(id: string, avatarHash?: string | null): string | null;
|
|
169
|
-
getAvatar(id: string): Promise<any>;
|
|
170
|
-
setAvatar(id: string, file: File | Blob, auditMessage?: string): Promise<any>;
|
|
171
|
-
deleteAvatar(id: string, auditMessage?: string): Promise<any>;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
interface ApiTokensBundle {
|
|
175
|
-
list(userId: string): Promise<any[]>;
|
|
176
|
-
listPage(userId: string, opts?: { limit?: number; cursor?: string }): Promise<Page>;
|
|
177
|
-
iterPages(userId: string, opts?: { pageSize?: number }): AsyncGenerator<any[]>;
|
|
178
|
-
create(userId: string, name: string, auditMessage?: string): Promise<{ id: string; name: string; token: string }>;
|
|
179
|
-
revoke(userId: string, tokenId: string, auditMessage?: string): Promise<any>;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
interface Invite {
|
|
183
|
-
id: string;
|
|
184
|
-
/** "signup" | "password-reset" */
|
|
185
|
-
kind: string;
|
|
186
|
-
/** "active" | "used" | "expired" | "revoked" */
|
|
187
|
-
status: string;
|
|
188
|
-
createdBy: string;
|
|
189
|
-
createdAt: string;
|
|
190
|
-
expiresAt: string;
|
|
191
|
-
maxUses: number;
|
|
192
|
-
uses: number;
|
|
193
|
-
revokedAt: string | null;
|
|
194
|
-
note: string | null;
|
|
195
|
-
targetUserId: string | null;
|
|
196
|
-
grantAdmin: boolean;
|
|
197
|
-
projectId: string | null;
|
|
198
|
-
projectRole: string | null;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
interface InvitePreview {
|
|
202
|
-
/** "signup" | "password-reset" */
|
|
203
|
-
kind: string;
|
|
204
|
-
/** "active" | "used" | "expired" | "revoked" */
|
|
205
|
-
status: string;
|
|
206
|
-
expiresAt: string;
|
|
207
|
-
grantAdmin: boolean;
|
|
208
|
-
projectName?: string;
|
|
209
|
-
projectRole?: string;
|
|
210
|
-
/** Present only for a password reset: whose account the link belongs to. */
|
|
211
|
-
username?: string;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
interface CreateInviteOptions {
|
|
215
|
-
projectId?: string;
|
|
216
|
-
/** "reader" | "writer" | "maintainer" */
|
|
217
|
-
projectRole?: string;
|
|
218
|
-
grantAdmin?: boolean;
|
|
219
|
-
/** Makes this a password reset for that user (admin only). */
|
|
220
|
-
targetUserId?: string;
|
|
221
|
-
maxUses?: number;
|
|
222
|
-
ttlDays?: number;
|
|
223
|
-
note?: string;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
interface InvitesBundle {
|
|
227
|
-
list(opts?: { projectId?: string }): Promise<Invite[]>;
|
|
228
|
-
listPage(opts?: { projectId?: string; limit?: number; cursor?: string }): Promise<Page>;
|
|
229
|
-
iterPages(opts?: { projectId?: string; pageSize?: number }): AsyncGenerator<Invite[]>;
|
|
230
|
-
/** The `code` is returned ONCE and is not recoverable afterward. */
|
|
231
|
-
create(opts?: CreateInviteOptions, auditMessage?: string): Promise<Invite & { code: string }>;
|
|
232
|
-
revoke(id: string, auditMessage?: string): Promise<any>;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
interface TokenLayersBundle {
|
|
236
|
-
shift(tokenLayerId: string, direction: string, auditMessage?: string): Promise<any>;
|
|
237
|
-
create(textLayerId: string, name: string, overlapMode?: string, parentTokenLayerId?: string, auditMessage?: string): Promise<any>;
|
|
238
|
-
setConfig(tokenLayerId: string, namespace: string, configKey: string, configValue: any, auditMessage?: string): Promise<any>;
|
|
239
|
-
deleteConfig(tokenLayerId: string, namespace: string, configKey: string, auditMessage?: string): Promise<any>;
|
|
240
|
-
get(tokenLayerId: string, asOf?: string): Promise<any>;
|
|
241
|
-
delete(tokenLayerId: string, auditMessage?: string): Promise<any>;
|
|
242
|
-
update(tokenLayerId: string, name: string, auditMessage?: string): Promise<any>;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
interface DocumentsBundle {
|
|
246
|
-
checkLock(documentId: string, asOf?: string): Promise<any>;
|
|
247
|
-
acquireLock(documentId: string, auditMessage?: string): Promise<any>;
|
|
248
|
-
releaseLock(documentId: string, auditMessage?: string): Promise<any>;
|
|
249
|
-
getMedia(documentId: string, asOf?: string): Promise<ArrayBuffer>;
|
|
250
|
-
uploadMedia(documentId: string, file: File, auditMessage?: string): Promise<any>;
|
|
251
|
-
deleteMedia(documentId: string, auditMessage?: string): Promise<any>;
|
|
252
|
-
setMetadata(documentId: string, body: any, auditMessage?: string): Promise<any>;
|
|
253
|
-
deleteMetadata(documentId: string, auditMessage?: string): Promise<any>;
|
|
254
|
-
patchMetadata(documentId: string, body: any, auditMessage?: string): Promise<any>;
|
|
255
|
-
audit(documentId: string, startTime?: string, endTime?: string, asOf?: string): Promise<any[]>;
|
|
256
|
-
get(documentId: string, includeBody?: boolean, asOf?: string): Promise<any>;
|
|
257
|
-
delete(documentId: string, auditMessage?: string): Promise<any>;
|
|
258
|
-
update(documentId: string, name: string, auditMessage?: string): Promise<any>;
|
|
259
|
-
create(projectId: string, name: string, metadata?: any, auditMessage?: string): Promise<any>;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
interface MessagesBundle {
|
|
263
|
-
sendMessage(projectId: string, data: any, auditMessage?: string): Promise<any>;
|
|
264
|
-
listen(projectId: string, onEvent: (eventType: string, data: any) => void | boolean, path?: string): SSEConnection;
|
|
265
|
-
/** Discover the services seen on a project: online ones plus previously-seen offline ones (check `online`). */
|
|
266
|
-
discoverServices(projectId: string): Promise<DiscoveredService[]>;
|
|
267
|
-
/** Forget a previously-seen (offline) service. Maintainer-only; 409 if currently connected. */
|
|
268
|
-
discardService(projectId: string, serviceId: string): Promise<void>;
|
|
269
|
-
serve(projectId: string, serviceInfo: ServiceInfo, onServiceRequest: (data: any, responseHelper: ResponseHelper) => void, extras?: any): ServiceRegistration;
|
|
270
|
-
/** Submit work to a service; streams progress to `onProgress`, resolves with the result. */
|
|
271
|
-
requestService(projectId: string, serviceId: string, data: any, timeout?: number, onProgress?: (progress: any) => void): Promise<any>;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
interface ProjectsBundle {
|
|
275
|
-
addWriter(id: string, userId: string, auditMessage?: string): Promise<any>;
|
|
276
|
-
removeWriter(id: string, userId: string, auditMessage?: string): Promise<any>;
|
|
277
|
-
addReader(id: string, userId: string, auditMessage?: string): Promise<any>;
|
|
278
|
-
removeReader(id: string, userId: string, auditMessage?: string): Promise<any>;
|
|
279
|
-
setConfig(id: string, namespace: string, configKey: string, configValue: any, auditMessage?: string): Promise<any>;
|
|
280
|
-
deleteConfig(id: string, namespace: string, configKey: string, auditMessage?: string): Promise<any>;
|
|
281
|
-
addMaintainer(id: string, userId: string, auditMessage?: string): Promise<any>;
|
|
282
|
-
removeMaintainer(id: string, userId: string, auditMessage?: string): Promise<any>;
|
|
283
|
-
audit(projectId: string, startTime?: string, endTime?: string, asOf?: string): Promise<any[]>;
|
|
284
|
-
linkVocab(id: string, vocabId: string, auditMessage?: string): Promise<any>;
|
|
285
|
-
unlinkVocab(id: string, vocabId: string, auditMessage?: string): Promise<any>;
|
|
286
|
-
get(id: string, asOf?: string): Promise<any>;
|
|
287
|
-
listDocuments(id: string): Promise<any[]>;
|
|
288
|
-
listDocumentsPage(id: string, opts?: { limit?: number; cursor?: string }): Promise<Page>;
|
|
289
|
-
iterDocuments(id: string, opts?: { pageSize?: number }): AsyncGenerator<any[]>;
|
|
290
|
-
delete(id: string, auditMessage?: string): Promise<any>;
|
|
291
|
-
update(id: string, name: string, auditMessage?: string): Promise<any>;
|
|
292
|
-
list(asOf?: string): Promise<any[]>;
|
|
293
|
-
listPage(opts?: { limit?: number; cursor?: string; asOf?: string }): Promise<Page>;
|
|
294
|
-
iterPages(opts?: { pageSize?: number; asOf?: string }): AsyncGenerator<any[]>;
|
|
295
|
-
create(name: string, auditMessage?: string): Promise<any>;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
interface TextLayersBundle {
|
|
299
|
-
setConfig(textLayerId: string, namespace: string, configKey: string, configValue: any, auditMessage?: string): Promise<any>;
|
|
300
|
-
deleteConfig(textLayerId: string, namespace: string, configKey: string, auditMessage?: string): Promise<any>;
|
|
301
|
-
get(textLayerId: string, asOf?: string): Promise<any>;
|
|
302
|
-
delete(textLayerId: string, auditMessage?: string): Promise<any>;
|
|
303
|
-
update(textLayerId: string, name: string, auditMessage?: string): Promise<any>;
|
|
304
|
-
shift(textLayerId: string, direction: string, auditMessage?: string): Promise<any>;
|
|
305
|
-
create(projectId: string, name: string, auditMessage?: string): Promise<any>;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
interface VocabItemsBundle {
|
|
309
|
-
setMetadata(id: string, body: any, auditMessage?: string): Promise<any>;
|
|
310
|
-
deleteMetadata(id: string, auditMessage?: string): Promise<any>;
|
|
311
|
-
patchMetadata(id: string, body: any, auditMessage?: string): Promise<any>;
|
|
312
|
-
create(vocabLayerId: string, form: string, metadata?: any, auditMessage?: string): Promise<any>;
|
|
313
|
-
bulkCreate(body: any[], auditMessage?: string): Promise<{ ids: string[] }>;
|
|
314
|
-
bulkDelete(body: any[], auditMessage?: string): Promise<void>;
|
|
315
|
-
get(id: string, asOf?: string): Promise<any>;
|
|
316
|
-
delete(id: string, auditMessage?: string): Promise<any>;
|
|
317
|
-
update(id: string, form: string, auditMessage?: string): Promise<any>;
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
interface RelationLayersBundle {
|
|
321
|
-
shift(relationLayerId: string, direction: string, auditMessage?: string): Promise<any>;
|
|
322
|
-
create(spanLayerId: string, name: string, auditMessage?: string): Promise<any>;
|
|
323
|
-
setConfig(relationLayerId: string, namespace: string, configKey: string, configValue: any, auditMessage?: string): Promise<any>;
|
|
324
|
-
deleteConfig(relationLayerId: string, namespace: string, configKey: string, auditMessage?: string): Promise<any>;
|
|
325
|
-
get(relationLayerId: string, asOf?: string): Promise<any>;
|
|
326
|
-
delete(relationLayerId: string, auditMessage?: string): Promise<any>;
|
|
327
|
-
update(relationLayerId: string, name: string, auditMessage?: string): Promise<any>;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
interface TokensBundle {
|
|
331
|
-
create(tokenLayerId: string, text: string, begin: number, end: number, precedence?: number | null, metadata?: any, auditMessage?: string): Promise<any>;
|
|
332
|
-
get(tokenId: string, asOf?: string): Promise<any>;
|
|
333
|
-
delete(tokenId: string, auditMessage?: string): Promise<any>;
|
|
334
|
-
update(tokenId: string, begin?: number, end?: number, precedence?: number | null, auditMessage?: string): Promise<any>;
|
|
335
|
-
bulkCreate(body: any[], auditMessage?: string): Promise<{ ids: string[] }>;
|
|
336
|
-
bulkDelete(body: any[], auditMessage?: string): Promise<void>;
|
|
337
|
-
split(tokenId: string, position: number, auditMessage?: string): Promise<any>;
|
|
338
|
-
merge(tokenId: string, otherTokenId: string, auditMessage?: string): Promise<any>;
|
|
339
|
-
shift(tokenId: string, begin?: number, end?: number, auditMessage?: string): Promise<any>;
|
|
340
|
-
setMetadata(tokenId: string, body: any, auditMessage?: string): Promise<any>;
|
|
341
|
-
deleteMetadata(tokenId: string, auditMessage?: string): Promise<any>;
|
|
342
|
-
patchMetadata(tokenId: string, body: any, auditMessage?: string): Promise<any>;
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
interface PlaidClientOptions {
|
|
346
|
-
/** Per-request timeout in ms (default 30000; 0 or null disables it). */
|
|
347
|
-
timeout?: number | null;
|
|
348
|
-
/**
|
|
349
|
-
* Fired once when a request returns HTTP 401 (missing/expired/invalid token).
|
|
350
|
-
* Use it to discard the stored token and route back to login. 403 (forbidden)
|
|
351
|
-
* does NOT trigger it.
|
|
352
|
-
*/
|
|
353
|
-
onAuthError?: ((error: Error) => void) | null;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
export interface OperationGroupsBundle {
|
|
357
|
-
get(id: string): Promise<any>;
|
|
358
|
-
update(id: string, message: string | null): Promise<any>;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
export declare class PlaidClient {
|
|
362
|
-
constructor(baseUrl: string, token: string, options?: PlaidClientOptions);
|
|
363
|
-
static login(baseUrl: string, userId: string, password: string, options?: PlaidClientOptions): Promise<PlaidClient>;
|
|
364
|
-
/** Build the link to hand someone for an invite code. */
|
|
365
|
-
static inviteUrl(appUrl: string, code: string): string;
|
|
366
|
-
/** Describe an invite code with no authentication (for a signup page). */
|
|
367
|
-
static lookupInvite(baseUrl: string, code: string, options?: PlaidClientOptions): Promise<InvitePreview>;
|
|
368
|
-
/** Redeem an invite code with no authentication; resolves to a logged-in client. */
|
|
369
|
-
static redeemInvite(
|
|
370
|
-
baseUrl: string,
|
|
371
|
-
code: string,
|
|
372
|
-
credentials: { username?: string; password: string },
|
|
373
|
-
options?: PlaidClientOptions,
|
|
374
|
-
): Promise<{ client: PlaidClient; userId: string; kind: string }>;
|
|
375
|
-
timeout: number | null;
|
|
376
|
-
/** Fired once on HTTP 401 (see PlaidClientOptions.onAuthError). */
|
|
377
|
-
onAuthError: ((error: Error) => void) | null;
|
|
378
|
-
|
|
379
|
-
// Batch control methods
|
|
380
|
-
beginBatch(): void;
|
|
381
|
-
submitBatch(): Promise<any[]>;
|
|
382
|
-
abortBatch(): void;
|
|
383
|
-
isBatchMode(): boolean;
|
|
384
|
-
/** Run `fn` with a batch open, then submit atomically (or abort if `fn` throws). Resolves to the results array. */
|
|
385
|
-
batched(fn: () => void | Promise<void>): Promise<any[]>;
|
|
386
|
-
|
|
387
|
-
// Strict mode methods
|
|
388
|
-
enterStrictMode(documentId: string): void;
|
|
389
|
-
exitStrictMode(): void;
|
|
390
|
-
|
|
391
|
-
// Logical operations (audit-log grouping). While one is open every write is
|
|
392
|
-
// stamped with its group id so the audit log folds them into one entry.
|
|
393
|
-
// Not atomic; nesting flattens into the outer operation.
|
|
394
|
-
operationGroup: { id: string; message: string | null } | null;
|
|
395
|
-
beginOperation(message: string, opts?: { id?: string }): string;
|
|
396
|
-
endOperation(message?: string): Promise<void>;
|
|
397
|
-
withOperation<T>(message: string, fn: (setMessage: (msg: string) => void) => Promise<T> | T): Promise<T>;
|
|
398
|
-
operationGroups: OperationGroupsBundle;
|
|
399
|
-
|
|
400
|
-
// Query
|
|
401
|
-
query(body: any, auditMessage?: string): Promise<any>;
|
|
402
|
-
|
|
403
|
-
vocabLinks: VocabLinksBundle;
|
|
404
|
-
vocabLayers: VocabLayersBundle;
|
|
405
|
-
relations: RelationsBundle;
|
|
406
|
-
spanLayers: SpanLayersBundle;
|
|
407
|
-
spans: SpansBundle;
|
|
408
|
-
batch: BatchBundle;
|
|
409
|
-
texts: TextsBundle;
|
|
410
|
-
users: UsersBundle;
|
|
411
|
-
apiTokens: ApiTokensBundle;
|
|
412
|
-
invites: InvitesBundle;
|
|
413
|
-
tokenLayers: TokenLayersBundle;
|
|
414
|
-
documents: DocumentsBundle;
|
|
415
|
-
messages: MessagesBundle;
|
|
416
|
-
projects: ProjectsBundle;
|
|
417
|
-
textLayers: TextLayersBundle;
|
|
418
|
-
vocabItems: VocabItemsBundle;
|
|
419
|
-
relationLayers: RelationLayersBundle;
|
|
420
|
-
tokens: TokensBundle;
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
export default PlaidClient;
|
|
424
|
-
|
|
425
|
-
// --- Unicode code-point helpers for text offsets ---------------------------
|
|
426
|
-
// Token begin/end offsets are 0-based Unicode code-point indices (not UTF-16).
|
|
427
|
-
/** Number of Unicode code points in `s` (not `s.length`). */
|
|
428
|
-
export function cpLength(s: string): number;
|
|
429
|
-
/** Substring of `s` by code-point indices [begin, end) (end optional). */
|
|
430
|
-
export function cpSlice(s: string, begin: number, end?: number): string;
|
|
431
|
-
/** Prebuilt slicer for many code-point slices of one string (spreads once). */
|
|
432
|
-
export function cpSlicer(s: string): (begin: number, end?: number) => string;
|
|
433
|
-
/** UTF-16 index -> code-point index in `s`. */
|
|
434
|
-
export function utf16ToCp(s: string, u: number): number;
|
|
435
|
-
/** Code-point index -> UTF-16 index in `s` (clamps past the end). */
|
|
436
|
-
export function cpToUtf16(s: string, cp: number): number;
|
|
437
|
-
/** Like indexOf, but the result and `fromCp` are code-point indices; -1 if absent. */
|
|
438
|
-
export function cpIndexOf(s: string, sub: string, fromCp?: number): number;
|
|
439
|
-
|
|
440
|
-
// --- Shared layer-role vocabulary (cross-app interoperability) --------------
|
|
441
|
-
// Substrate layers are tagged with a role at `config.plaid.role` (a scalar) so
|
|
442
|
-
// that different apps can share a project. See the manual, "Layer Interoperability".
|
|
443
|
-
/** The reserved config namespace for cross-app conventions. */
|
|
444
|
-
export const PLAID_NAMESPACE: 'plaid';
|
|
445
|
-
/** The config key, under `plaid`, holding a layer's role. */
|
|
446
|
-
export const ROLE_KEY: 'role';
|
|
447
|
-
/** The fixed role inventory; only these values are interoperable across apps. */
|
|
448
|
-
export const ROLES: {
|
|
449
|
-
readonly BASELINE: 'baseline';
|
|
450
|
-
readonly SENTENCE: 'sentence';
|
|
451
|
-
readonly WORD: 'word';
|
|
452
|
-
readonly SYNTACTIC_WORD: 'syntactic-word';
|
|
453
|
-
readonly MORPHEME: 'morpheme';
|
|
454
|
-
readonly TIME_ALIGNMENT: 'time-alignment';
|
|
455
|
-
};
|
|
456
|
-
/** The role recorded on a layer's `config`, or null if none. */
|
|
457
|
-
export function readRole(config?: object): string | null;
|
|
458
|
-
/** The first layer in `layers` carrying the given role, or null. */
|
|
459
|
-
export function findByRole<T extends { config?: object }>(layers: T[] | undefined, role: string): T | null;
|
|
460
|
-
|
|
461
|
-
// --- Service self-description helpers ----------------------------------------
|
|
462
|
-
// Standardize how a service advertises (in `extras`) the tasks it serves, a
|
|
463
|
-
// summary, and a parameter schema — so a UI can offer service selection, an
|
|
464
|
-
// argument form, and a summary at a fixed integration point. See the manual,
|
|
465
|
-
// "Describing a service".
|
|
466
|
-
/** The controlled task vocabulary — the fixed integration-point goals. */
|
|
467
|
-
export const TASKS: {
|
|
468
|
-
readonly TOKENIZE: 'tokenize';
|
|
469
|
-
readonly PARSE: 'parse';
|
|
470
|
-
readonly TRANSCRIBE: 'transcribe';
|
|
471
|
-
readonly LINK_VOCAB: 'link-vocab';
|
|
472
|
-
readonly ANALYZE: 'analyze';
|
|
473
|
-
};
|
|
474
|
-
/** Whether a service serves a task (declared `extras.tasks`, legacy id-prefix fallback). */
|
|
475
|
-
export function servesTask(service: DiscoveredService, task: string): boolean;
|
|
476
|
-
/** The discovered services that serve `task`. */
|
|
477
|
-
export function filterServicesByTask(services: DiscoveredService[] | undefined, task: string): DiscoveredService[];
|
|
478
|
-
/** The parameter schema a service declares (ordered), or []. */
|
|
479
|
-
export function getParamSchema(service: DiscoveredService): ServiceParam[];
|
|
480
|
-
/** A service's human summary: `extras.summary`, else `description`, else ''. */
|
|
481
|
-
export function getServiceSummary(service: DiscoveredService): string;
|
|
482
|
-
/** Default form values keyed by param key. */
|
|
483
|
-
export function buildDefaultValues(schema: ServiceParam[]): Record<string, any>;
|
|
484
|
-
/** Coerce/validate raw form values against the schema. */
|
|
485
|
-
export function coerceParamValues(schema: ServiceParam[], raw: Record<string, any>): { values: Record<string, any>; errors: Record<string, string> };
|
|
486
|
-
|
|
487
|
-
// --- Provenance ---------------------------------------------------------------
|
|
488
|
-
// Cross-app convention for machine-provided vs human-labeled information,
|
|
489
|
-
// expressed as flat metadata keys on annotation entities. Absent keys = human;
|
|
490
|
-
// { prov: 'inferred', provSource } = machine-made, unverified;
|
|
491
|
-
// + { provConfirmed: true } = machine-made, human-verified. Machine writers may
|
|
492
|
-
// replace unverified machine material but must never touch human/verified
|
|
493
|
-
// material without an explicit overwrite opt-in; any human edit verifies.
|
|
494
|
-
// See the manual, "Provenance".
|
|
495
|
-
type ProvState = 'human' | 'machine' | 'verified';
|
|
496
|
-
export const PROV: {
|
|
497
|
-
readonly key: 'prov';
|
|
498
|
-
readonly sourceKey: 'provSource';
|
|
499
|
-
readonly confirmedKey: 'provConfirmed';
|
|
500
|
-
readonly probKey: 'provProb';
|
|
501
|
-
readonly detailKey: 'provDetail';
|
|
502
|
-
readonly INFERRED: 'inferred';
|
|
503
|
-
};
|
|
504
|
-
export const PROV_STATES: {
|
|
505
|
-
readonly HUMAN: 'human';
|
|
506
|
-
readonly MACHINE: 'machine';
|
|
507
|
-
readonly VERIFIED: 'verified';
|
|
508
|
-
};
|
|
509
|
-
/** Optional prediction extras: prob = a probability in [0,1] for the chosen value
|
|
510
|
-
* (flat + queryable; omit unless it honestly is one); detail = an open map of
|
|
511
|
-
* producer extras (top-k alternatives, model version, raw scores; keep it small).
|
|
512
|
-
* Both describe the ORIGINAL prediction — check provConfirmed before presenting
|
|
513
|
-
* provProb as confidence in the current value. */
|
|
514
|
-
interface ProvExtras { prob?: number; detail?: Record<string, any> }
|
|
515
|
-
/** The metadata fragment a machine writer merges into everything it creates. */
|
|
516
|
-
export function stampInferred(source: string, extras?: ProvExtras):
|
|
517
|
-
{ prov: 'inferred'; provSource: string; provProb?: number; provDetail?: Record<string, any> };
|
|
518
|
-
/** stampInferred + provConfirmed — for machine material born verified (e.g. imports with upstream approval). */
|
|
519
|
-
export function confirmedInferred(source: string, extras?: ProvExtras):
|
|
520
|
-
{ prov: 'inferred'; provSource: string; provConfirmed: true; provProb?: number; provDetail?: Record<string, any> };
|
|
521
|
-
/** Classify an entity's metadata into one of the three provenance states. */
|
|
522
|
-
export function provState(metadata: object | null | undefined): ProvState;
|
|
523
|
-
/** The verifying fragment, { provConfirmed: true }: PATCH it over existing metadata. */
|
|
524
|
-
export const PROV_CONFIRMED: { readonly provConfirmed: true };
|
|
525
|
-
/** Machine-made and not yet human-verified (needs review, replaceable, confirmable). */
|
|
526
|
-
export function isMachine(metadata: object | null | undefined): boolean;
|
|
527
|
-
/** Whether a machine writer must leave this entity alone (human or verified). !isMachine. */
|
|
528
|
-
export function isProtected(metadata: object | null | undefined): boolean;
|
|
529
|
-
/** The fragment a HUMAN edit should merge in: PROV_CONFIRMED iff machine-unverified, else null. */
|
|
530
|
-
export function verifyOnEdit(metadata: object | null | undefined): { readonly provConfirmed: true } | null;
|
|
531
|
-
/** Canonical provSource for a service: 'service:<serviceId>'. */
|
|
532
|
-
export function serviceSource(serviceId: string): string;
|