@verentis/sdk 0.2.4 → 0.2.6
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 +138 -11
- package/dist/index.cjs +614 -65
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +642 -88
- package/dist/index.d.ts +642 -88
- package/dist/index.js +602 -66
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -26,6 +26,195 @@ interface HeaderActionRegistration {
|
|
|
26
26
|
type HeaderActionHandler = () => void | HeaderActionResult | Promise<void | HeaderActionResult>;
|
|
27
27
|
declare function isHeaderAction(value: unknown): value is HeaderAction;
|
|
28
28
|
|
|
29
|
+
type BridgeEventType = HostToAppMessage['type'];
|
|
30
|
+
/** Handles a host message; the resolved value (structured-cloneable, ideally JSON) is the reply. */
|
|
31
|
+
type HostMessageHandler = (payload: unknown) => unknown | Promise<unknown>;
|
|
32
|
+
/** Channel names declared in the manifest `spec.messages`. */
|
|
33
|
+
declare const HOST_MESSAGE_CHANNEL_PATTERN: RegExp;
|
|
34
|
+
type BridgeListener = (data: HostToAppMessage) => void;
|
|
35
|
+
/**
|
|
36
|
+
* PostMessage bridge for communication between an app (iframe) and the
|
|
37
|
+
* workspace host. Handles the initialization handshake, token lifecycle,
|
|
38
|
+
* and app-to-host events (navigate, resize, dirty, etc.).
|
|
39
|
+
*/
|
|
40
|
+
declare class Bridge {
|
|
41
|
+
private readonly expectedHostOrigin?;
|
|
42
|
+
private listeners;
|
|
43
|
+
private _initResolve;
|
|
44
|
+
private _initReject;
|
|
45
|
+
private _initTimer;
|
|
46
|
+
private _initPromise;
|
|
47
|
+
private _hostOrigin;
|
|
48
|
+
private _messageHandler;
|
|
49
|
+
private _destroyed;
|
|
50
|
+
private sessionId;
|
|
51
|
+
private actions;
|
|
52
|
+
private requests;
|
|
53
|
+
private hostMessageHandlers;
|
|
54
|
+
private hostMessageRequests;
|
|
55
|
+
private wopiRequests;
|
|
56
|
+
private collaborationRequests;
|
|
57
|
+
constructor(expectedHostOrigin?: string | undefined);
|
|
58
|
+
/** Post `verentis:ready` to the host to start the handshake */
|
|
59
|
+
sendReady(capabilities?: string[]): void;
|
|
60
|
+
/** Wait for the host to send `verentis:init` with context and token */
|
|
61
|
+
waitForInit(): Promise<{
|
|
62
|
+
context: AppContext;
|
|
63
|
+
token: TokenInfo;
|
|
64
|
+
}>;
|
|
65
|
+
/** Get the host origin (available after init) */
|
|
66
|
+
get hostOrigin(): string | null;
|
|
67
|
+
/** Send a message to the host */
|
|
68
|
+
postToHost(message: AppToHostMessage): void;
|
|
69
|
+
/**
|
|
70
|
+
* Navigate to another location in the workspace.
|
|
71
|
+
*
|
|
72
|
+
* @param path A workspace file path (e.g. `/reports/q1.json`) or an absolute
|
|
73
|
+
* http(s) URL. External URLs require the app to declare the
|
|
74
|
+
* `navigation:external` capability in its manifest.
|
|
75
|
+
* @param options Navigation options. Set `newTab: true` to open the target in
|
|
76
|
+
* a new browser tab instead of the current one.
|
|
77
|
+
*/
|
|
78
|
+
navigate(path: string, options?: NavigateOptions): void;
|
|
79
|
+
/** Request iframe resize */
|
|
80
|
+
resize(height: number): void;
|
|
81
|
+
/** Update the title displayed by the host */
|
|
82
|
+
setTitle(title: string): void;
|
|
83
|
+
/** Signal unsaved changes to the host */
|
|
84
|
+
setDirty(isDirty: boolean): void;
|
|
85
|
+
/** The trusted parent selects the approved installation, document and action. */
|
|
86
|
+
requestWopiLaunch(): Promise<WopiLaunch>;
|
|
87
|
+
/** Recover only the target selected by a completed server-owned derived operation. */
|
|
88
|
+
requestWopiContinuation(): Promise<WopiContinuation>;
|
|
89
|
+
getWopiStatus(): Promise<WopiSaveStatus>;
|
|
90
|
+
requestWopiSave(generation: number): Promise<WopiSaveCheckpoint>;
|
|
91
|
+
closeWopiSession(): Promise<void>;
|
|
92
|
+
private requestWopi;
|
|
93
|
+
requestNativeCollaboration(command: NativeCollaborationCommand): Promise<unknown>;
|
|
94
|
+
registerAction(descriptor: HeaderAction, handler: HeaderActionHandler): HeaderActionRegistration;
|
|
95
|
+
private publishActions;
|
|
96
|
+
private invokeAction;
|
|
97
|
+
/**
|
|
98
|
+
* Handle messages the workspace sends on a channel declared in the manifest `spec.messages` — for
|
|
99
|
+
* example an agent asking the open app to select a record. The handler's return value is the reply;
|
|
100
|
+
* a thrown error is reported back as the failure. May be called before the init handshake.
|
|
101
|
+
*/
|
|
102
|
+
onHostMessage(channel: string, handler: HostMessageHandler): () => void;
|
|
103
|
+
private receiveHostMessage;
|
|
104
|
+
/** Subscribe to a specific message type from the host */
|
|
105
|
+
on(type: BridgeEventType, listener: BridgeListener): () => void;
|
|
106
|
+
/** Clean up event listeners */
|
|
107
|
+
destroy(): void;
|
|
108
|
+
private handleMessage;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
interface NativeElement {
|
|
112
|
+
id: string;
|
|
113
|
+
version: number;
|
|
114
|
+
versionNonce?: number;
|
|
115
|
+
isDeleted?: boolean;
|
|
116
|
+
[key: string]: unknown;
|
|
117
|
+
}
|
|
118
|
+
interface NativeFile {
|
|
119
|
+
id: string;
|
|
120
|
+
dataURL: string;
|
|
121
|
+
mimeType: string;
|
|
122
|
+
created: number;
|
|
123
|
+
lastRetrieved?: number;
|
|
124
|
+
}
|
|
125
|
+
interface NativeScene {
|
|
126
|
+
elements: NativeElement[];
|
|
127
|
+
files: Record<string, NativeFile>;
|
|
128
|
+
appState: Record<string, unknown>;
|
|
129
|
+
}
|
|
130
|
+
interface NativePointer {
|
|
131
|
+
x: number;
|
|
132
|
+
y: number;
|
|
133
|
+
}
|
|
134
|
+
interface NativeParticipant {
|
|
135
|
+
id: string;
|
|
136
|
+
name: string;
|
|
137
|
+
readOnly: boolean;
|
|
138
|
+
pointer: NativePointer | null;
|
|
139
|
+
/** `agent` marks an agent acting on behalf of a user (same principal, separate connection). */
|
|
140
|
+
kind?: 'user' | 'agent';
|
|
141
|
+
}
|
|
142
|
+
interface NativeSnapshot {
|
|
143
|
+
sequence: number;
|
|
144
|
+
savedSequence: number;
|
|
145
|
+
revision: string;
|
|
146
|
+
readOnly: boolean;
|
|
147
|
+
scene: NativeScene;
|
|
148
|
+
participants: NativeParticipant[];
|
|
149
|
+
}
|
|
150
|
+
interface NativeSaveReceipt {
|
|
151
|
+
generation: number;
|
|
152
|
+
correlation: string;
|
|
153
|
+
revision: string;
|
|
154
|
+
}
|
|
155
|
+
interface NativeSaveResult extends NativeSnapshot {
|
|
156
|
+
receipt: NativeSaveReceipt;
|
|
157
|
+
}
|
|
158
|
+
interface NativeChangeSet {
|
|
159
|
+
operationId: string;
|
|
160
|
+
changes: Array<{
|
|
161
|
+
id: string;
|
|
162
|
+
expectedVersion: number | null;
|
|
163
|
+
element: NativeElement | null;
|
|
164
|
+
}>;
|
|
165
|
+
files?: Record<string, NativeFile>;
|
|
166
|
+
appState?: Record<string, unknown>;
|
|
167
|
+
appStateExpectedSequence?: number;
|
|
168
|
+
}
|
|
169
|
+
type NativeCollaborationCommand = {
|
|
170
|
+
operation: 'join' | 'snapshot' | 'close';
|
|
171
|
+
} | {
|
|
172
|
+
operation: 'apply';
|
|
173
|
+
changes: NativeChangeSet;
|
|
174
|
+
} | {
|
|
175
|
+
operation: 'presence';
|
|
176
|
+
pointer: NativePointer | null;
|
|
177
|
+
} | {
|
|
178
|
+
operation: 'save';
|
|
179
|
+
generation: number;
|
|
180
|
+
correlation: string;
|
|
181
|
+
};
|
|
182
|
+
interface NativeCollaborationRequest {
|
|
183
|
+
type: 'verentis:collaboration:request';
|
|
184
|
+
version: 1;
|
|
185
|
+
sessionId: string;
|
|
186
|
+
requestId: string;
|
|
187
|
+
command: NativeCollaborationCommand;
|
|
188
|
+
}
|
|
189
|
+
interface NativeCollaborationResponse {
|
|
190
|
+
type: 'verentis:collaboration:response';
|
|
191
|
+
version: 1;
|
|
192
|
+
sessionId: string;
|
|
193
|
+
requestId: string;
|
|
194
|
+
result?: NativeSnapshot | NativeSaveResult | null;
|
|
195
|
+
error?: string;
|
|
196
|
+
code?: string;
|
|
197
|
+
}
|
|
198
|
+
declare class NativeCollaborationError extends Error {
|
|
199
|
+
readonly code: string;
|
|
200
|
+
constructor(message: string, code: string);
|
|
201
|
+
}
|
|
202
|
+
declare function isNativeSnapshot(value: unknown): value is NativeSnapshot;
|
|
203
|
+
declare function isNativeSaveResult(value: unknown): value is NativeSaveResult;
|
|
204
|
+
declare function validateNativeCommand(command: NativeCollaborationCommand): void;
|
|
205
|
+
/** Native authority is always selected by the installed workspace host, never by the iframe. */
|
|
206
|
+
declare class NativeCollaborationClient {
|
|
207
|
+
private readonly bridge;
|
|
208
|
+
constructor(bridge: Bridge | null);
|
|
209
|
+
private snapshotRequest;
|
|
210
|
+
join(): Promise<NativeSnapshot>;
|
|
211
|
+
snapshot(): Promise<NativeSnapshot>;
|
|
212
|
+
apply(changes: NativeChangeSet): Promise<NativeSnapshot>;
|
|
213
|
+
presence(value: NativePointer | null): Promise<NativeSnapshot>;
|
|
214
|
+
save(generation: number, correlation: string): Promise<NativeSaveResult>;
|
|
215
|
+
close(): Promise<void>;
|
|
216
|
+
}
|
|
217
|
+
|
|
29
218
|
interface VerentisMessage {
|
|
30
219
|
type: `verentis:${string}`;
|
|
31
220
|
version: 1;
|
|
@@ -57,30 +246,30 @@ interface VerentisActionResultMessage extends VerentisMessage {
|
|
|
57
246
|
result?: HeaderActionResult;
|
|
58
247
|
error?: string;
|
|
59
248
|
}
|
|
60
|
-
|
|
61
|
-
|
|
249
|
+
/**
|
|
250
|
+
* A message from the workspace (typically an agent acting for the user) on a channel the app declares in
|
|
251
|
+
* its manifest `spec.messages`. Handled with `bridge.onHostMessage(channel, handler)`.
|
|
252
|
+
*/
|
|
253
|
+
interface VerentisHostMessage extends VerentisMessage {
|
|
254
|
+
type: 'verentis:host:message';
|
|
255
|
+
sessionId: string;
|
|
62
256
|
requestId: string;
|
|
63
|
-
|
|
257
|
+
channel: string;
|
|
258
|
+
payload?: unknown;
|
|
64
259
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
delegationId: string;
|
|
68
|
-
backendClientId: string;
|
|
69
|
-
launchCredential: string;
|
|
70
|
-
expiresAt: string;
|
|
71
|
-
}
|
|
72
|
-
interface VerentisBackendCredentialRequest extends VerentisMessage {
|
|
73
|
-
type: 'verentis:backend:request';
|
|
74
|
-
requestId: string;
|
|
260
|
+
interface VerentisHostReplyMessage extends VerentisMessage {
|
|
261
|
+
type: 'verentis:host:reply';
|
|
75
262
|
sessionId: string;
|
|
76
|
-
}
|
|
77
|
-
interface VerentisBackendCredentialResponse extends VerentisMessage {
|
|
78
|
-
type: 'verentis:backend:response';
|
|
79
263
|
requestId: string;
|
|
80
|
-
|
|
81
|
-
|
|
264
|
+
channel: string;
|
|
265
|
+
result?: unknown;
|
|
82
266
|
error?: string;
|
|
83
267
|
}
|
|
268
|
+
interface VerentisTokenRefreshedMessage extends VerentisMessage {
|
|
269
|
+
type: 'verentis:token:refreshed';
|
|
270
|
+
requestId: string;
|
|
271
|
+
token: TokenInfo;
|
|
272
|
+
}
|
|
84
273
|
/** Nonsecret active-document metadata. CODE already holds its own scoped credential. */
|
|
85
274
|
interface WopiContinuation {
|
|
86
275
|
sessionId: string;
|
|
@@ -163,10 +352,11 @@ interface VerentisDirtyMessage extends VerentisMessage {
|
|
|
163
352
|
type: 'verentis:dirty';
|
|
164
353
|
isDirty: boolean;
|
|
165
354
|
}
|
|
166
|
-
type HostToAppMessage = VerentisInitMessage | VerentisActionInvokeMessage | VerentisTokenRefreshedMessage | VerentisFileChangedMessage | VerentisThemeMessage |
|
|
167
|
-
type AppToHostMessage = VerentisReadyMessage | VerentisActionsSetMessage | VerentisActionResultMessage | VerentisTokenRefreshMessage | VerentisNavigateMessage | VerentisResizeMessage | VerentisTitleMessage | VerentisDirtyMessage |
|
|
355
|
+
type HostToAppMessage = VerentisInitMessage | VerentisActionInvokeMessage | VerentisHostMessage | VerentisTokenRefreshedMessage | VerentisFileChangedMessage | VerentisThemeMessage | VerentisWopiResponse | NativeCollaborationResponse;
|
|
356
|
+
type AppToHostMessage = VerentisReadyMessage | VerentisActionsSetMessage | VerentisActionResultMessage | VerentisHostReplyMessage | VerentisTokenRefreshMessage | VerentisNavigateMessage | VerentisResizeMessage | VerentisTitleMessage | VerentisDirtyMessage | VerentisWopiRequest | NativeCollaborationRequest;
|
|
168
357
|
type AppSurface = 'file' | 'workspace';
|
|
169
358
|
interface AppContextBase {
|
|
359
|
+
application?: AppApplicationContext;
|
|
170
360
|
workspace: WorkspaceInfo;
|
|
171
361
|
entryPoint?: EntryPointInfo;
|
|
172
362
|
apiUrl: string;
|
|
@@ -177,6 +367,11 @@ interface AppContextBase {
|
|
|
177
367
|
wopiEnabled?: boolean;
|
|
178
368
|
};
|
|
179
369
|
}
|
|
370
|
+
interface AppApplicationContext {
|
|
371
|
+
manifestPath: string;
|
|
372
|
+
manifestNodeId: string;
|
|
373
|
+
branch: string;
|
|
374
|
+
}
|
|
180
375
|
/** Context for an application opened against a workspace file. */
|
|
181
376
|
interface FileAppContext extends AppContextBase {
|
|
182
377
|
surface: 'file';
|
|
@@ -227,10 +422,23 @@ interface EntryPointInfo {
|
|
|
227
422
|
matchedPattern: string;
|
|
228
423
|
priority: number;
|
|
229
424
|
}
|
|
425
|
+
/**
|
|
426
|
+
* One boundary of a brokered token (canvas documents): the platform-normalized workspace `path` it confines to and
|
|
427
|
+
* the `mode` granted there. Informational for client-side UX; the platform enforces the token itself.
|
|
428
|
+
*/
|
|
429
|
+
interface TokenGrant {
|
|
430
|
+
type: string;
|
|
431
|
+
identifier: string;
|
|
432
|
+
path: string;
|
|
433
|
+
mode: 'read' | 'write';
|
|
434
|
+
source: 'bound' | 'document' | 'declared';
|
|
435
|
+
}
|
|
230
436
|
interface TokenInfo {
|
|
231
437
|
accessToken: string;
|
|
232
438
|
expiresAt: string;
|
|
233
439
|
scopes: string[];
|
|
440
|
+
/** Brokered tokens only: the boundaries the token carries. */
|
|
441
|
+
grants?: TokenGrant[];
|
|
234
442
|
}
|
|
235
443
|
interface VerentisClientOptions {
|
|
236
444
|
/** Base URL of the Verentis API gateway (e.g. 'https://api.verentis.com') */
|
|
@@ -271,6 +479,33 @@ interface FileEntry {
|
|
|
271
479
|
version?: string;
|
|
272
480
|
etag?: string;
|
|
273
481
|
children?: FileEntry[];
|
|
482
|
+
/** Stable node identity, when supplied by the path metadata API. */
|
|
483
|
+
nodeId?: string;
|
|
484
|
+
}
|
|
485
|
+
interface NodeFileMetadata {
|
|
486
|
+
nodeId: string;
|
|
487
|
+
path: string;
|
|
488
|
+
name: string;
|
|
489
|
+
mimeType: string;
|
|
490
|
+
size?: number | null;
|
|
491
|
+
/** Unquoted opaque content revision; distinct from a path delete head stamp. */
|
|
492
|
+
etag: string;
|
|
493
|
+
version: string;
|
|
494
|
+
children?: PagedResult<FileEntry>;
|
|
495
|
+
}
|
|
496
|
+
interface NodeFileOptions {
|
|
497
|
+
branch: string;
|
|
498
|
+
}
|
|
499
|
+
interface NodeFileContent {
|
|
500
|
+
content: Blob;
|
|
501
|
+
/** Strong quoted ETag returned by the node-content API. */
|
|
502
|
+
revision: string;
|
|
503
|
+
}
|
|
504
|
+
interface WriteNodeFileOptions extends NodeFileOptions {
|
|
505
|
+
content: Blob | string | ArrayBuffer;
|
|
506
|
+
/** Strong quoted revision, or the unquoted etag returned by getNode. */
|
|
507
|
+
revision: string;
|
|
508
|
+
idempotencyKey: string;
|
|
274
509
|
}
|
|
275
510
|
interface GetFileOptions {
|
|
276
511
|
branch?: string;
|
|
@@ -283,6 +518,8 @@ interface WriteFileOptions {
|
|
|
283
518
|
contentType?: string;
|
|
284
519
|
filename?: string;
|
|
285
520
|
branch?: string;
|
|
521
|
+
/** Atomically require no live file at this path; conflicts return HTTP 412. */
|
|
522
|
+
createOnly?: boolean;
|
|
286
523
|
}
|
|
287
524
|
interface MoveFileOptions {
|
|
288
525
|
from: string;
|
|
@@ -292,6 +529,10 @@ interface MoveFileOptions {
|
|
|
292
529
|
interface DeleteFileOptions {
|
|
293
530
|
path: string;
|
|
294
531
|
branch?: string;
|
|
532
|
+
/** Path-binding head stamp, not a node-content revision. */
|
|
533
|
+
headStamp?: string;
|
|
534
|
+
idempotencyKey?: string;
|
|
535
|
+
mode?: 'shallow' | 'deep';
|
|
295
536
|
}
|
|
296
537
|
type ArchiveFormat = 'zip' | 'tgz';
|
|
297
538
|
interface ReadArchiveOptions {
|
|
@@ -326,6 +567,64 @@ interface InstalledPackageDescriptor {
|
|
|
326
567
|
payloads: InstalledPackagePayload[];
|
|
327
568
|
}
|
|
328
569
|
type InstallationMode = 'Extracted' | 'Sealed';
|
|
570
|
+
/** Required dependencies use immutable exact SemVer pins; optional packages are never implicit installs. */
|
|
571
|
+
interface PackageDependency {
|
|
572
|
+
package: string;
|
|
573
|
+
version: string;
|
|
574
|
+
installPath?: string | null;
|
|
575
|
+
optional?: boolean;
|
|
576
|
+
}
|
|
577
|
+
interface InstallationGraphPackage {
|
|
578
|
+
packageId: string;
|
|
579
|
+
packageVersionId: string;
|
|
580
|
+
publisherId: string;
|
|
581
|
+
identity: string;
|
|
582
|
+
publisher: string;
|
|
583
|
+
version: string;
|
|
584
|
+
treeDigest: string;
|
|
585
|
+
artifactFingerprint: string;
|
|
586
|
+
manifestYaml: string;
|
|
587
|
+
verifiedSigningKeyKid?: string | null;
|
|
588
|
+
branch: string;
|
|
589
|
+
installPath: string;
|
|
590
|
+
installMode: InstallationMode;
|
|
591
|
+
reuseInstallationId?: string | null;
|
|
592
|
+
/** Only a previously Failed exact target can be recovered, after a fresh explicit preview. */
|
|
593
|
+
retryInstallationId?: string | null;
|
|
594
|
+
permissions: string[];
|
|
595
|
+
dependencies: PackageDependency[];
|
|
596
|
+
/** Conservative destination reservations, including external install-map/seed roots. */
|
|
597
|
+
installPaths: string[];
|
|
598
|
+
}
|
|
599
|
+
interface InstallationGraphPreview {
|
|
600
|
+
operationId: string;
|
|
601
|
+
workspaceId: string;
|
|
602
|
+
expiresAt: string;
|
|
603
|
+
fingerprint: string;
|
|
604
|
+
/** Topological installation order: required dependencies before their dependents. */
|
|
605
|
+
packages: InstallationGraphPackage[];
|
|
606
|
+
}
|
|
607
|
+
type InstallationGraphOutcomeStatus = 'Pending' | 'Installing' | 'Reused' | 'Installed' | 'InstalledWithError' | 'Failed' | 'NotAttempted';
|
|
608
|
+
interface InstallationGraphResult {
|
|
609
|
+
operationId: string;
|
|
610
|
+
status: 'Preview' | 'Accepted' | 'Completed' | 'Rejected' | 'Failed';
|
|
611
|
+
succeeded: boolean;
|
|
612
|
+
/** The exact durable preview baseline, also available after a lost preview/install response. */
|
|
613
|
+
packages: InstallationGraphPackage[];
|
|
614
|
+
outcomes: {
|
|
615
|
+
identity: string;
|
|
616
|
+
status: InstallationGraphOutcomeStatus;
|
|
617
|
+
installationId?: string | null;
|
|
618
|
+
error?: string | null;
|
|
619
|
+
}[];
|
|
620
|
+
error?: string | null;
|
|
621
|
+
}
|
|
622
|
+
interface PreviewInstallationOptions extends InstallationScopedOptions {
|
|
623
|
+
packageVersion?: string;
|
|
624
|
+
installPath?: string;
|
|
625
|
+
branch?: string;
|
|
626
|
+
installMode?: InstallationMode;
|
|
627
|
+
}
|
|
329
628
|
type InstallationStatus = 'Pending' | 'Installing' | 'Installed' | 'Updating' | 'Uninstalling' | 'Failed' | 'Uninstalled';
|
|
330
629
|
interface Installation {
|
|
331
630
|
id: string;
|
|
@@ -505,6 +804,9 @@ interface ApplicationEntryPoint {
|
|
|
505
804
|
display?: ApplicationDisplayOptions;
|
|
506
805
|
}
|
|
507
806
|
interface ApplicationSpec {
|
|
807
|
+
dependencies?: PackageDependency[];
|
|
808
|
+
/** Publisher-qualified required engine dependency for script-bearing packages. */
|
|
809
|
+
engine?: string;
|
|
508
810
|
/** Optional iframe UI surface URL. Omit for a headless / file-collection app. */
|
|
509
811
|
entry?: string;
|
|
510
812
|
/** Optional application splash URL. Relative values resolve against the selected iframe entry URL. */
|
|
@@ -831,7 +1133,8 @@ declare class ApiError extends Error {
|
|
|
831
1133
|
readonly status: number;
|
|
832
1134
|
readonly detail: string;
|
|
833
1135
|
readonly title?: string | undefined;
|
|
834
|
-
|
|
1136
|
+
readonly code?: string | undefined;
|
|
1137
|
+
constructor(status: number, detail: string, title?: string | undefined, code?: string | undefined);
|
|
835
1138
|
}
|
|
836
1139
|
|
|
837
1140
|
/**
|
|
@@ -845,6 +1148,9 @@ declare class ContextModule {
|
|
|
845
1148
|
private _file;
|
|
846
1149
|
private _entryPoint;
|
|
847
1150
|
private _apiUrl;
|
|
1151
|
+
private _application;
|
|
1152
|
+
private _installation;
|
|
1153
|
+
private _grants;
|
|
848
1154
|
/** The current workspace */
|
|
849
1155
|
get workspace(): WorkspaceInfo;
|
|
850
1156
|
/** The host surface that launched the app */
|
|
@@ -859,6 +1165,15 @@ declare class ContextModule {
|
|
|
859
1165
|
get entryPoint(): EntryPointInfo | null;
|
|
860
1166
|
/** Whether an entry point context is available */
|
|
861
1167
|
get hasEntryPoint(): boolean;
|
|
1168
|
+
get application(): AppApplicationContext | null;
|
|
1169
|
+
get installation(): AppContext['installation'] | null;
|
|
1170
|
+
/**
|
|
1171
|
+
* The boundaries of a brokered token (canvas documents), as the host sent them with the token; `null` when the
|
|
1172
|
+
* token is not boundary-confined by a broker (or in standalone mode).
|
|
1173
|
+
*/
|
|
1174
|
+
get grants(): TokenGrant[] | null;
|
|
1175
|
+
/** Update the token's grants from the host's init or token refresh message */
|
|
1176
|
+
setGrants(grants: unknown): void;
|
|
862
1177
|
/** Update context from the host's init message */
|
|
863
1178
|
setFromAppContext(ctx: AppContext): void;
|
|
864
1179
|
/** Set workspace info directly (standalone mode) */
|
|
@@ -881,6 +1196,7 @@ declare class HttpTransport {
|
|
|
881
1196
|
constructor(baseUrl: string, auth: AuthStrategy, apiVersion?: string);
|
|
882
1197
|
request<T>(method: string, path: string, options?: RequestOptions): Promise<T>;
|
|
883
1198
|
requestRaw(method: string, path: string, options?: RequestOptions): Promise<Response>;
|
|
1199
|
+
ensureSuccess(response: Response): Promise<void>;
|
|
884
1200
|
private buildUrl;
|
|
885
1201
|
}
|
|
886
1202
|
|
|
@@ -950,6 +1266,12 @@ declare class FilesModule {
|
|
|
950
1266
|
* For directories: returns metadata with children array populated.
|
|
951
1267
|
*/
|
|
952
1268
|
get(path: string, options?: GetFileOptions): Promise<FileEntry>;
|
|
1269
|
+
/** Read metadata by stable node identity on an explicit branch. */
|
|
1270
|
+
getNode(nodeId: string, options: NodeFileOptions): Promise<NodeFileMetadata>;
|
|
1271
|
+
/** Read bytes and their matching content revision in the same response. */
|
|
1272
|
+
readNodeContent(nodeId: string, options: NodeFileOptions): Promise<NodeFileContent>;
|
|
1273
|
+
/** Replace existing node bytes conditionally; never creates or changes path/MIME. */
|
|
1274
|
+
writeNodeContent(nodeId: string, options: WriteNodeFileOptions): Promise<NodeFileMetadata>;
|
|
953
1275
|
/**
|
|
954
1276
|
* Read the raw content of a file as a Blob.
|
|
955
1277
|
*/
|
|
@@ -973,6 +1295,8 @@ declare class FilesModule {
|
|
|
973
1295
|
* Upload or create a file.
|
|
974
1296
|
*/
|
|
975
1297
|
write(path: string, options: WriteFileOptions): Promise<void>;
|
|
1298
|
+
/** Create without a read-before-write race or overwrite of an existing live file. */
|
|
1299
|
+
create(path: string, options: WriteFileOptions): Promise<void>;
|
|
976
1300
|
/**
|
|
977
1301
|
* Move or rename a file.
|
|
978
1302
|
*/
|
|
@@ -989,6 +1313,14 @@ declare class InstallationsModule {
|
|
|
989
1313
|
private readonly http;
|
|
990
1314
|
private readonly workspaceId?;
|
|
991
1315
|
constructor(http: HttpTransport, workspaceId?: string | undefined);
|
|
1316
|
+
/** Resolve canonical publisher/package identity, never the installation's runtime display name. */
|
|
1317
|
+
resolvePackageId(identity: string, options?: InstallationScopedOptions): Promise<string>;
|
|
1318
|
+
/** Resolves the complete required graph without installing anything or granting capabilities. */
|
|
1319
|
+
preview(packageId: string, options?: PreviewInstallationOptions): Promise<InstallationGraphPreview>;
|
|
1320
|
+
/** Explicit, single-use consent to a displayed preview. Never automatically retries accepted installs. */
|
|
1321
|
+
install(preview: InstallationGraphPreview, consent: true): Promise<InstallationGraphResult>;
|
|
1322
|
+
/** Inspect durable outcomes after a failure or lost response instead of resubmitting consent. */
|
|
1323
|
+
graphResult(operationId: string, options?: InstallationScopedOptions): Promise<InstallationGraphResult>;
|
|
992
1324
|
list(options?: InstallationListOptions): Promise<PagedResult<Installation>>;
|
|
993
1325
|
resolve(installPath: string, options?: ResolveInstallationOptions): Promise<InstallationDetail>;
|
|
994
1326
|
update(id: string, options?: UpdateInstallationOptions): Promise<InstallationLifecycleResult>;
|
|
@@ -1058,74 +1390,257 @@ interface NamespacedSettings {
|
|
|
1058
1390
|
reset(key: string, options?: SettingsScopedOptions): Promise<void>;
|
|
1059
1391
|
}
|
|
1060
1392
|
|
|
1061
|
-
|
|
1062
|
-
|
|
1393
|
+
interface EmailScopedOptions {
|
|
1394
|
+
workspaceId?: string;
|
|
1395
|
+
branch?: 'main';
|
|
1396
|
+
}
|
|
1397
|
+
interface EmailHistoryOptions extends EmailScopedOptions {
|
|
1398
|
+
recordId?: string;
|
|
1399
|
+
installationId?: string;
|
|
1400
|
+
}
|
|
1401
|
+
interface EmailPurpose {
|
|
1402
|
+
name: string;
|
|
1403
|
+
templateId: string;
|
|
1404
|
+
maximumRecipients: number;
|
|
1405
|
+
maximumAttachmentBytes: number;
|
|
1406
|
+
allowsOpenTracking: boolean;
|
|
1407
|
+
allowsClickTracking: boolean;
|
|
1408
|
+
senderRequirement: 'workspace-owned' | 'managed-or-workspace';
|
|
1409
|
+
}
|
|
1410
|
+
interface EmailSenderGrant {
|
|
1411
|
+
purpose: string;
|
|
1412
|
+
senderId: string;
|
|
1413
|
+
senderIdentityDigest?: string;
|
|
1414
|
+
}
|
|
1415
|
+
interface EmailConsentPreview {
|
|
1416
|
+
installationId: string;
|
|
1417
|
+
workspaceId: string;
|
|
1418
|
+
accountId: string;
|
|
1419
|
+
packageId: string;
|
|
1420
|
+
packageVersionId: string;
|
|
1421
|
+
publisherId: string;
|
|
1422
|
+
publisherName: string;
|
|
1423
|
+
version: string;
|
|
1424
|
+
treeDigest: string;
|
|
1425
|
+
signingKeyId: string;
|
|
1426
|
+
installPath: string;
|
|
1427
|
+
branch: string;
|
|
1428
|
+
candidateDigest: string;
|
|
1429
|
+
declaration: {
|
|
1430
|
+
purposes: EmailPurpose[];
|
|
1431
|
+
maximumMessagesPerHour: number;
|
|
1432
|
+
permissions: string[];
|
|
1433
|
+
scopes: string[];
|
|
1434
|
+
manifestDigest: string;
|
|
1435
|
+
};
|
|
1436
|
+
}
|
|
1437
|
+
interface EmailConsent {
|
|
1438
|
+
installationId: string;
|
|
1439
|
+
candidateDigest: string;
|
|
1440
|
+
enabled: boolean;
|
|
1441
|
+
allowOpenTracking: boolean;
|
|
1442
|
+
allowClickTracking: boolean;
|
|
1443
|
+
approvedBy: string;
|
|
1444
|
+
updatedAt: string;
|
|
1445
|
+
senderGrants: EmailSenderGrant[] | null;
|
|
1446
|
+
}
|
|
1447
|
+
interface EmailConsentOptions {
|
|
1448
|
+
senderGrants: EmailSenderGrant[];
|
|
1449
|
+
allowOpenTracking?: boolean;
|
|
1450
|
+
allowClickTracking?: boolean;
|
|
1451
|
+
}
|
|
1452
|
+
interface EmailSenderIdentity {
|
|
1453
|
+
id: string;
|
|
1454
|
+
mode: 'managed' | 'custom';
|
|
1455
|
+
displayName: string;
|
|
1456
|
+
address: string;
|
|
1457
|
+
}
|
|
1458
|
+
interface EmailArtifactOutcome {
|
|
1459
|
+
artifactId: string;
|
|
1460
|
+
sha256: string;
|
|
1461
|
+
byteLength: number;
|
|
1462
|
+
fileName: string;
|
|
1463
|
+
}
|
|
1464
|
+
interface EmailDispatchOptions extends EmailScopedOptions {
|
|
1465
|
+
installationId: string;
|
|
1466
|
+
recordId: string;
|
|
1467
|
+
purpose: string;
|
|
1468
|
+
templateId: string;
|
|
1469
|
+
senderId: string;
|
|
1470
|
+
recipients: string[];
|
|
1471
|
+
artifactIds: string[];
|
|
1472
|
+
idempotencyKey: string;
|
|
1473
|
+
replyTo?: string;
|
|
1474
|
+
}
|
|
1475
|
+
interface EmailDispatchOutcome {
|
|
1476
|
+
id: string;
|
|
1477
|
+
status: 'accepted' | 'delivered' | 'failed' | 'unknown';
|
|
1478
|
+
createdAt: string;
|
|
1479
|
+
failureCode?: string | null;
|
|
1480
|
+
recordId: string;
|
|
1481
|
+
installationId: string;
|
|
1482
|
+
branch: 'main';
|
|
1483
|
+
purpose: string;
|
|
1484
|
+
templateId: string;
|
|
1485
|
+
events: EmailDeliveryEvidence[];
|
|
1486
|
+
}
|
|
1487
|
+
interface EmailDeliveryEvidence {
|
|
1488
|
+
type: 'processed' | 'deferred' | 'delivered' | 'failed' | 'complaint' | 'unsubscribe' | 'open' | 'click';
|
|
1489
|
+
occurredAt: string;
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
/** Signed-package transactional email. Dispatch never accepts HTML, From or a browser invoice snapshot. */
|
|
1493
|
+
declare class EmailModule {
|
|
1494
|
+
private readonly http;
|
|
1495
|
+
private readonly workspaceId?;
|
|
1496
|
+
constructor(http: HttpTransport, workspaceId?: string | undefined);
|
|
1497
|
+
preview(installationId: string, options?: EmailScopedOptions): Promise<EmailConsentPreview>;
|
|
1498
|
+
consents(options?: EmailScopedOptions): Promise<EmailConsent[]>;
|
|
1499
|
+
/** Approve exactly the reviewed signed candidate; tracking stays off unless explicitly opted in. */
|
|
1500
|
+
consent(preview: EmailConsentPreview, approval: true, options: EmailConsentOptions): Promise<EmailConsent>;
|
|
1501
|
+
revoke(consent: EmailConsent, options?: EmailScopedOptions): Promise<EmailConsent>;
|
|
1502
|
+
senders(options?: EmailScopedOptions): Promise<EmailSenderIdentity[]>;
|
|
1503
|
+
invoicePdf(recordId: string, installationId: string, options?: EmailScopedOptions): Promise<EmailArtifactOutcome>;
|
|
1504
|
+
/** Authenticated immutable bytes; no public URL. The caller owns any local object URL it creates. */
|
|
1505
|
+
artifactContent(artifactId: string, options?: EmailScopedOptions): Promise<Blob>;
|
|
1506
|
+
/** A stable key binds this exact request. After a lost response inspect status; never automatically resend. */
|
|
1507
|
+
dispatch(options: EmailDispatchOptions): Promise<EmailDispatchOutcome>;
|
|
1508
|
+
outcome(id: string, options?: EmailScopedOptions): Promise<EmailDispatchOutcome>;
|
|
1509
|
+
history(options?: EmailHistoryOptions): Promise<EmailDispatchOutcome[]>;
|
|
1510
|
+
status(id: string, options?: EmailScopedOptions): Promise<EmailDispatchOutcome>;
|
|
1511
|
+
private workspace;
|
|
1512
|
+
private mainBranch;
|
|
1513
|
+
}
|
|
1514
|
+
|
|
1515
|
+
type BusinessOperation = 'save-record' | 'archive-record' | 'delete-record' | 'restore-record' | 'close-period' | 'issue-invoice' | 'credit-invoice' | 'post-payment' | 'reverse-payment' | 'post-journal' | 'reverse-journal' | 'post-expense' | 'reverse-expense';
|
|
1516
|
+
interface BusinessParameters {
|
|
1517
|
+
periodId?: string;
|
|
1518
|
+
receivableAccountId?: string;
|
|
1519
|
+
incomeAccountId?: string;
|
|
1520
|
+
taxAccountId?: string;
|
|
1521
|
+
date?: string;
|
|
1522
|
+
reason?: string;
|
|
1523
|
+
}
|
|
1524
|
+
interface BusinessCommand {
|
|
1525
|
+
operation: BusinessOperation;
|
|
1526
|
+
idempotencyKey: string;
|
|
1527
|
+
/** Omit only when creating; the server derives a stable ID from this operation key. */
|
|
1528
|
+
recordId?: string;
|
|
1529
|
+
/** Canonical kind, e.g. crm/company. Required for metadata-free creation. */
|
|
1530
|
+
kind?: string;
|
|
1531
|
+
expectedCatalogueRevision?: string;
|
|
1532
|
+
/** Exact strong, quoted canonical revision; omit only for a new record. */
|
|
1533
|
+
expectedRevision?: string;
|
|
1534
|
+
record?: Record<string, unknown>;
|
|
1535
|
+
parameters?: BusinessParameters;
|
|
1536
|
+
}
|
|
1537
|
+
interface BusinessSnapshot {
|
|
1538
|
+
id: string;
|
|
1539
|
+
kind: string;
|
|
1540
|
+
json: string;
|
|
1541
|
+
revision: string;
|
|
1542
|
+
}
|
|
1543
|
+
interface BusinessContext {
|
|
1544
|
+
workspaceId: string;
|
|
1545
|
+
branch: string;
|
|
1546
|
+
catalogueRevision: string | null;
|
|
1547
|
+
settings: BusinessSnapshot[];
|
|
1548
|
+
}
|
|
1549
|
+
interface BusinessCommitResult {
|
|
1550
|
+
operationId: string;
|
|
1551
|
+
committedAt: string;
|
|
1552
|
+
records: BusinessSnapshot[];
|
|
1553
|
+
}
|
|
1554
|
+
interface BusinessOutcomeRequest {
|
|
1555
|
+
operation: BusinessOperation;
|
|
1556
|
+
idempotencyKey: string;
|
|
1557
|
+
requestHash?: string;
|
|
1558
|
+
command?: BusinessCommand;
|
|
1559
|
+
}
|
|
1560
|
+
type BusinessReportName = 'trial-balance' | 'general-ledger' | 'profit-and-loss' | 'balance-sheet' | 'receivables';
|
|
1561
|
+
interface BusinessReportLine {
|
|
1562
|
+
accountId: string;
|
|
1563
|
+
code: string;
|
|
1564
|
+
name: string;
|
|
1565
|
+
accountType: 'asset' | 'liability' | 'equity' | 'income' | 'expense';
|
|
1566
|
+
debitMinor: string;
|
|
1567
|
+
creditMinor: string;
|
|
1568
|
+
balanceMinor: string;
|
|
1569
|
+
}
|
|
1570
|
+
interface BusinessReport {
|
|
1571
|
+
report: BusinessReportName;
|
|
1572
|
+
from: string | null;
|
|
1573
|
+
to: string | null;
|
|
1574
|
+
lines: BusinessReportLine[];
|
|
1575
|
+
entries: BusinessLedgerEntry[];
|
|
1576
|
+
/** Coherent catalogue revision and overdue evaluation date for receivables. */
|
|
1577
|
+
revision?: string;
|
|
1578
|
+
asOf?: string;
|
|
1579
|
+
currency?: string;
|
|
1580
|
+
minorDigits?: number;
|
|
1581
|
+
receivables?: BusinessReceivable[];
|
|
1582
|
+
totals?: BusinessReceivableTotals;
|
|
1583
|
+
}
|
|
1584
|
+
interface BusinessReceivable {
|
|
1585
|
+
invoiceId: string;
|
|
1586
|
+
revision: string;
|
|
1587
|
+
invoiceNumber: string;
|
|
1588
|
+
issueDate: string;
|
|
1589
|
+
dueDate: string;
|
|
1590
|
+
currency: string;
|
|
1591
|
+
minorDigits: number;
|
|
1592
|
+
customer: Record<string, unknown>;
|
|
1593
|
+
customerReference?: Record<string, unknown>;
|
|
1594
|
+
grossAmountMinor: string;
|
|
1595
|
+
creditedAmountMinor: string;
|
|
1596
|
+
paidAmountMinor: string;
|
|
1597
|
+
outstandingAmountMinor: string;
|
|
1598
|
+
overdueAmountMinor: string;
|
|
1599
|
+
isOverdue: boolean;
|
|
1600
|
+
daysOverdue: number;
|
|
1601
|
+
}
|
|
1602
|
+
interface BusinessReceivableTotals {
|
|
1603
|
+
grossAmountMinor: string;
|
|
1604
|
+
creditedAmountMinor: string;
|
|
1605
|
+
paidAmountMinor: string;
|
|
1606
|
+
outstandingAmountMinor: string;
|
|
1607
|
+
overdueAmountMinor: string;
|
|
1608
|
+
}
|
|
1609
|
+
interface BusinessLedgerEntry {
|
|
1610
|
+
journalId: string;
|
|
1611
|
+
date: string;
|
|
1612
|
+
description: string;
|
|
1613
|
+
accountId: string;
|
|
1614
|
+
direction: 'debit' | 'credit';
|
|
1615
|
+
amountMinor: string;
|
|
1616
|
+
runningBalanceMinor: string;
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1063
1619
|
/**
|
|
1064
|
-
*
|
|
1065
|
-
*
|
|
1066
|
-
*
|
|
1620
|
+
* Trusted workspace business records, independent of app scripts or generic file writes.
|
|
1621
|
+
* Never automatically retries a command: resolve a lost response with outcome() or
|
|
1622
|
+
* resubmit the exact same command/key to obtain the original durable result.
|
|
1067
1623
|
*/
|
|
1068
|
-
declare class
|
|
1069
|
-
private readonly
|
|
1070
|
-
private
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
context: AppContext;
|
|
1089
|
-
token: TokenInfo;
|
|
1090
|
-
}>;
|
|
1091
|
-
/** Get the host origin (available after init) */
|
|
1092
|
-
get hostOrigin(): string | null;
|
|
1093
|
-
/** Send a message to the host */
|
|
1094
|
-
postToHost(message: AppToHostMessage): void;
|
|
1095
|
-
/**
|
|
1096
|
-
* Navigate to another location in the workspace.
|
|
1097
|
-
*
|
|
1098
|
-
* @param path A workspace file path (e.g. `/reports/q1.json`) or an absolute
|
|
1099
|
-
* http(s) URL. External URLs require the app to declare the
|
|
1100
|
-
* `navigation:external` capability in its manifest.
|
|
1101
|
-
* @param options Navigation options. Set `newTab: true` to open the target in
|
|
1102
|
-
* a new browser tab instead of the current one.
|
|
1103
|
-
*/
|
|
1104
|
-
navigate(path: string, options?: NavigateOptions): void;
|
|
1105
|
-
/** Request iframe resize */
|
|
1106
|
-
resize(height: number): void;
|
|
1107
|
-
/** Update the title displayed by the host */
|
|
1108
|
-
setTitle(title: string): void;
|
|
1109
|
-
/** Signal unsaved changes to the host */
|
|
1110
|
-
setDirty(isDirty: boolean): void;
|
|
1111
|
-
/** The host, not the app, selects the installation, file, branch and permission ceiling. */
|
|
1112
|
-
requestBackendCredential(): Promise<AppBackendCredential>;
|
|
1113
|
-
/** The trusted parent selects the approved installation, document and action. */
|
|
1114
|
-
requestWopiLaunch(): Promise<WopiLaunch>;
|
|
1115
|
-
/** Recover only the target selected by a completed server-owned derived operation. */
|
|
1116
|
-
requestWopiContinuation(): Promise<WopiContinuation>;
|
|
1117
|
-
getWopiStatus(): Promise<WopiSaveStatus>;
|
|
1118
|
-
requestWopiSave(generation: number): Promise<WopiSaveCheckpoint>;
|
|
1119
|
-
closeWopiSession(): Promise<void>;
|
|
1120
|
-
private requestWopi;
|
|
1121
|
-
registerAction(descriptor: HeaderAction, handler: HeaderActionHandler): HeaderActionRegistration;
|
|
1122
|
-
private publishActions;
|
|
1123
|
-
private invokeAction;
|
|
1124
|
-
/** Subscribe to a specific message type from the host */
|
|
1125
|
-
on(type: BridgeEventType, listener: BridgeListener): () => void;
|
|
1126
|
-
/** Clean up event listeners */
|
|
1127
|
-
destroy(): void;
|
|
1128
|
-
private handleMessage;
|
|
1624
|
+
declare class BusinessModule {
|
|
1625
|
+
private readonly http;
|
|
1626
|
+
private readonly branch;
|
|
1627
|
+
constructor(http: HttpTransport, branch?: string);
|
|
1628
|
+
withBranch(branch: string): BusinessModule;
|
|
1629
|
+
context(): Promise<BusinessContext>;
|
|
1630
|
+
command(command: BusinessCommand): Promise<BusinessCommitResult>;
|
|
1631
|
+
read(id: string): Promise<BusinessSnapshot | null>;
|
|
1632
|
+
list(kind?: string): Promise<BusinessSnapshot[]>;
|
|
1633
|
+
/** null means unresolved, not success; do not invent a new operation key. */
|
|
1634
|
+
outcome(request: BusinessOutcomeRequest): Promise<BusinessCommitResult | null>;
|
|
1635
|
+
/** Recover using the exact original command, without reproducing server fingerprint encoding. */
|
|
1636
|
+
outcomeFor(command: BusinessCommand): Promise<BusinessCommitResult | null>;
|
|
1637
|
+
report(report: BusinessReportName, range?: {
|
|
1638
|
+
from?: string;
|
|
1639
|
+
to?: string;
|
|
1640
|
+
}): Promise<BusinessReport>;
|
|
1641
|
+
/** Retained historical expense receipt bytes, even after the original native file is removed. */
|
|
1642
|
+
receipt(nodeId: string, revision: string): Promise<Blob>;
|
|
1643
|
+
private headers;
|
|
1129
1644
|
}
|
|
1130
1645
|
|
|
1131
1646
|
/**
|
|
@@ -1140,8 +1655,11 @@ declare class VerentisClient {
|
|
|
1140
1655
|
installations: InstallationsModule;
|
|
1141
1656
|
resources: ResourcesModule;
|
|
1142
1657
|
settings: SettingsModule;
|
|
1658
|
+
email: EmailModule;
|
|
1659
|
+
business: BusinessModule;
|
|
1143
1660
|
readonly context: ContextModule;
|
|
1144
1661
|
readonly bridge: Bridge | null;
|
|
1662
|
+
readonly collaboration: NativeCollaborationClient;
|
|
1145
1663
|
private readonly _auth;
|
|
1146
1664
|
private _http;
|
|
1147
1665
|
private _ready;
|
|
@@ -1152,6 +1670,12 @@ declare class VerentisClient {
|
|
|
1152
1670
|
* In iframe mode this resolves after the host sends `verentis:init`.
|
|
1153
1671
|
*/
|
|
1154
1672
|
whenReady(): Promise<void>;
|
|
1673
|
+
/**
|
|
1674
|
+
* The current `Authorization` header value, refreshed when near expiry.
|
|
1675
|
+
* Forward it to the app's own backend, which exchanges it at Security's
|
|
1676
|
+
* `/connect/token` (RFC 8693) as the installation's confidential client.
|
|
1677
|
+
*/
|
|
1678
|
+
getAuthorizationHeader(): Promise<string | null>;
|
|
1155
1679
|
/** Clean up resources (timers, event listeners) */
|
|
1156
1680
|
destroy(): void;
|
|
1157
1681
|
private initFromBridge;
|
|
@@ -1170,6 +1694,36 @@ declare function matchMimeType(pattern: string, mimeType: string): boolean;
|
|
|
1170
1694
|
*/
|
|
1171
1695
|
declare function findBestMatch(mimeType: string, bindings: MimeTypeBinding[]): MimeTypeBinding | null;
|
|
1172
1696
|
|
|
1697
|
+
interface CollaborationDocumentContext {
|
|
1698
|
+
workspace?: {
|
|
1699
|
+
id?: string;
|
|
1700
|
+
};
|
|
1701
|
+
file?: {
|
|
1702
|
+
nodeId?: string;
|
|
1703
|
+
branch?: string;
|
|
1704
|
+
};
|
|
1705
|
+
}
|
|
1706
|
+
interface CollaborationDocument {
|
|
1707
|
+
sessionId: string;
|
|
1708
|
+
workspaceId: string;
|
|
1709
|
+
branch: string;
|
|
1710
|
+
nodeId: string;
|
|
1711
|
+
fileId: string;
|
|
1712
|
+
name: string;
|
|
1713
|
+
readOnly: boolean;
|
|
1714
|
+
accessTokenTtl: number;
|
|
1715
|
+
}
|
|
1716
|
+
/** An exact origin, not a URL pattern or an authority grant. */
|
|
1717
|
+
declare function exactHttpsOrigin(value: unknown): string;
|
|
1718
|
+
declare function isTrustedMessage(event: {
|
|
1719
|
+
source: unknown;
|
|
1720
|
+
origin: string;
|
|
1721
|
+
}, source: unknown, origin: string): boolean;
|
|
1722
|
+
/** Checks nonsecret launch metadata against the document selected by the trusted host. */
|
|
1723
|
+
declare function validateCollaborationDocument(value: unknown, context: CollaborationDocumentContext, now?: number): CollaborationDocument;
|
|
1724
|
+
/** An editor acknowledgement alone never proves a document was durably saved. */
|
|
1725
|
+
declare function isDurableSaveConfirmed(result: unknown, request: unknown, currentGeneration: number, editorModified: boolean): boolean;
|
|
1726
|
+
|
|
1173
1727
|
/**
|
|
1174
1728
|
* Authenticates with a Verentis API key (`vrt_` prefix).
|
|
1175
1729
|
* The backend detects the `vrt_` prefix in the Bearer token and resolves it
|
|
@@ -1257,4 +1811,4 @@ declare class BridgeAuth implements AuthStrategy {
|
|
|
1257
1811
|
*/
|
|
1258
1812
|
declare function createVerentisClient(options?: VerentisClientOptions): VerentisClient;
|
|
1259
1813
|
|
|
1260
|
-
export { ApiError, ApiKeyAuth, type
|
|
1814
|
+
export { ApiError, ApiKeyAuth, type AppApplicationContext, type AppContext, type AppSurface, type AppToHostMessage, type ApplicationDisplayOptions, type ApplicationEntryPoint, type ApplicationFileType, type ApplicationLaunchConfig, type ApplicationManifest, type ApplicationSpec, type ArchiveFormat, type AuthOptions, type AuthStrategy, Bridge, BridgeAuth, type BusinessCommand, type BusinessCommitResult, type BusinessContext, type BusinessLedgerEntry, BusinessModule, type BusinessOperation, type BusinessOutcomeRequest, type BusinessParameters, type BusinessReceivable, type BusinessReceivableTotals, type BusinessReport, type BusinessReportLine, type BusinessReportName, type BusinessSnapshot, type CatalogImage, type CollaborationDocument, type CollaborationDocumentContext, ContextModule, type DeleteFileOptions, type EmailArtifactOutcome, type EmailConsent, type EmailConsentOptions, type EmailConsentPreview, type EmailDeliveryEvidence, type EmailDispatchOptions, type EmailDispatchOutcome, type EmailHistoryOptions, EmailModule, type EmailPurpose, type EmailScopedOptions, type EmailSenderGrant, type EmailSenderIdentity, type EngineFileType, type EngineRuntime, type EngineTool, EnginesModule, type EntryPointInfo, type ExecuteEngineOptions, type Execution, type ExecutionEngine, type ExecutionEngineListOptions, type ExecutionListOptions, type ExecutionLogs, type ExecutionMode, type ExecutionResult, type ExecutionScopedOptions, type ExecutionStatus, type ExecutionTrigger, ExecutionsModule, type ExtractUploadOptions, type FileAppContext, type FileEntry, type FileInfo, FilesModule, type GetFileOptions, HOST_MESSAGE_CHANNEL_PATTERN, type HeaderAction, type HeaderActionHandler, type HeaderActionRegistration, type HeaderActionResult, type HostMessageHandler, type HostToAppMessage, HttpTransport, type Installation, type InstallationDetail, type InstallationGraphOutcomeStatus, type InstallationGraphPackage, type InstallationGraphPreview, type InstallationGraphResult, type InstallationLifecycleResult, type InstallationListOptions, type InstallationMode, type InstallationScopedOptions, type InstallationStatus, InstallationsModule, type InstalledPackageDescriptor, type InstalledPackagePayload, type ManifestMetadata, type MimeTypeBinding, type MoveFileOptions, type NamespacedSettings, type NativeChangeSet, NativeCollaborationClient, type NativeCollaborationCommand, NativeCollaborationError, type NativeCollaborationRequest, type NativeCollaborationResponse, type NativeElement, type NativeFile, type NativeParticipant, type NativePointer, type NativeSaveReceipt, type NativeSaveResult, type NativeScene, type NativeSnapshot, type NavigateOptions, type NodeFileContent, type NodeFileMetadata, type NodeFileOptions, type OAuthConfig, type PackageDependency, type PagedResult, type PreviewInstallationOptions, type ReadArchiveOptions, type RequestOptions, type ResolveInstallationOptions, type ResourceMimeTypeBinding, type ResourceRegistration, type ResourceScopedOptions, ResourcesModule, type RunFileOptions, type SandboxOptions, type SettingDeclaration, type SettingDeclarationType, type SettingGroup, type SettingItem, type SettingOption, type SettingPresence, SettingsModule, type SettingsScopedOptions, TokenAuth, type TokenGrant, type TokenInfo, type UpdateInstallationOptions, type VerentisActionInvokeMessage, type VerentisActionResultMessage, type VerentisActionsSetMessage, VerentisClient, type VerentisClientOptions, type VerentisDirtyMessage, type VerentisFileChangedMessage, type VerentisHostMessage, type VerentisHostReplyMessage, type VerentisInitMessage, type VerentisMessage, type VerentisNavigateMessage, type VerentisReadyMessage, type VerentisResizeMessage, type VerentisThemeMessage, type VerentisTitleMessage, type VerentisTokenRefreshMessage, type VerentisTokenRefreshedMessage, type VerentisWopiRequest, type VerentisWopiResponse, type WaitOptions, type WopiContinuation, type WopiLaunch, type WopiSaveCheckpoint, type WopiSaveStatus, type WorkspaceAppContext, type WorkspaceInfo, type WriteFileOptions, type WriteNodeFileOptions, createVerentisClient, exactHttpsOrigin, findBestMatch, isDurableSaveConfirmed, isHeaderAction, isNativeSaveResult, isNativeSnapshot, isTerminalStatus, isTrustedMessage, matchMimeType, validateCollaborationDocument, validateNativeCommand };
|