@verentis/sdk 0.2.5 → 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/dist/index.cjs +20 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +22 -1
- package/dist/index.d.ts +22 -1
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -422,10 +422,23 @@ interface EntryPointInfo {
|
|
|
422
422
|
matchedPattern: string;
|
|
423
423
|
priority: number;
|
|
424
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
|
+
}
|
|
425
436
|
interface TokenInfo {
|
|
426
437
|
accessToken: string;
|
|
427
438
|
expiresAt: string;
|
|
428
439
|
scopes: string[];
|
|
440
|
+
/** Brokered tokens only: the boundaries the token carries. */
|
|
441
|
+
grants?: TokenGrant[];
|
|
429
442
|
}
|
|
430
443
|
interface VerentisClientOptions {
|
|
431
444
|
/** Base URL of the Verentis API gateway (e.g. 'https://api.verentis.com') */
|
|
@@ -1137,6 +1150,7 @@ declare class ContextModule {
|
|
|
1137
1150
|
private _apiUrl;
|
|
1138
1151
|
private _application;
|
|
1139
1152
|
private _installation;
|
|
1153
|
+
private _grants;
|
|
1140
1154
|
/** The current workspace */
|
|
1141
1155
|
get workspace(): WorkspaceInfo;
|
|
1142
1156
|
/** The host surface that launched the app */
|
|
@@ -1153,6 +1167,13 @@ declare class ContextModule {
|
|
|
1153
1167
|
get hasEntryPoint(): boolean;
|
|
1154
1168
|
get application(): AppApplicationContext | null;
|
|
1155
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;
|
|
1156
1177
|
/** Update context from the host's init message */
|
|
1157
1178
|
setFromAppContext(ctx: AppContext): void;
|
|
1158
1179
|
/** Set workspace info directly (standalone mode) */
|
|
@@ -1790,4 +1811,4 @@ declare class BridgeAuth implements AuthStrategy {
|
|
|
1790
1811
|
*/
|
|
1791
1812
|
declare function createVerentisClient(options?: VerentisClientOptions): VerentisClient;
|
|
1792
1813
|
|
|
1793
|
-
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 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 };
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -422,10 +422,23 @@ interface EntryPointInfo {
|
|
|
422
422
|
matchedPattern: string;
|
|
423
423
|
priority: number;
|
|
424
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
|
+
}
|
|
425
436
|
interface TokenInfo {
|
|
426
437
|
accessToken: string;
|
|
427
438
|
expiresAt: string;
|
|
428
439
|
scopes: string[];
|
|
440
|
+
/** Brokered tokens only: the boundaries the token carries. */
|
|
441
|
+
grants?: TokenGrant[];
|
|
429
442
|
}
|
|
430
443
|
interface VerentisClientOptions {
|
|
431
444
|
/** Base URL of the Verentis API gateway (e.g. 'https://api.verentis.com') */
|
|
@@ -1137,6 +1150,7 @@ declare class ContextModule {
|
|
|
1137
1150
|
private _apiUrl;
|
|
1138
1151
|
private _application;
|
|
1139
1152
|
private _installation;
|
|
1153
|
+
private _grants;
|
|
1140
1154
|
/** The current workspace */
|
|
1141
1155
|
get workspace(): WorkspaceInfo;
|
|
1142
1156
|
/** The host surface that launched the app */
|
|
@@ -1153,6 +1167,13 @@ declare class ContextModule {
|
|
|
1153
1167
|
get hasEntryPoint(): boolean;
|
|
1154
1168
|
get application(): AppApplicationContext | null;
|
|
1155
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;
|
|
1156
1177
|
/** Update context from the host's init message */
|
|
1157
1178
|
setFromAppContext(ctx: AppContext): void;
|
|
1158
1179
|
/** Set workspace info directly (standalone mode) */
|
|
@@ -1790,4 +1811,4 @@ declare class BridgeAuth implements AuthStrategy {
|
|
|
1790
1811
|
*/
|
|
1791
1812
|
declare function createVerentisClient(options?: VerentisClientOptions): VerentisClient;
|
|
1792
1813
|
|
|
1793
|
-
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 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 };
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -169,6 +169,7 @@ var ContextModule = class {
|
|
|
169
169
|
_apiUrl = null;
|
|
170
170
|
_application = null;
|
|
171
171
|
_installation = null;
|
|
172
|
+
_grants = null;
|
|
172
173
|
/** The current workspace */
|
|
173
174
|
get workspace() {
|
|
174
175
|
if (!this._workspace) {
|
|
@@ -215,6 +216,21 @@ var ContextModule = class {
|
|
|
215
216
|
get installation() {
|
|
216
217
|
return this._installation ? { ...this._installation } : null;
|
|
217
218
|
}
|
|
219
|
+
/**
|
|
220
|
+
* The boundaries of a brokered token (canvas documents), as the host sent them with the token; `null` when the
|
|
221
|
+
* token is not boundary-confined by a broker (or in standalone mode).
|
|
222
|
+
*/
|
|
223
|
+
get grants() {
|
|
224
|
+
return this._grants ? this._grants.map((grant) => ({ ...grant })) : null;
|
|
225
|
+
}
|
|
226
|
+
/** Update the token's grants from the host's init or token refresh message */
|
|
227
|
+
setGrants(grants) {
|
|
228
|
+
if (!Array.isArray(grants)) {
|
|
229
|
+
this._grants = null;
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
this._grants = grants.filter((grant) => typeof grant === "object" && grant !== null && typeof grant.type === "string" && typeof grant.identifier === "string" && typeof grant.path === "string" && grant.path.startsWith("/") && (grant.mode === "read" || grant.mode === "write") && typeof grant.source === "string").map((grant) => ({ type: grant.type, identifier: grant.identifier, path: grant.path, mode: grant.mode, source: grant.source }));
|
|
233
|
+
}
|
|
218
234
|
/** Update context from the host's init message */
|
|
219
235
|
setFromAppContext(ctx) {
|
|
220
236
|
if (ctx.application !== void 0 && (typeof ctx.application !== "object" || ctx.application === null || typeof ctx.application.manifestPath !== "string" || !ctx.application.manifestPath.startsWith("/") || typeof ctx.application.manifestNodeId !== "string" || !ctx.application.manifestNodeId.trim() || typeof ctx.application.branch !== "string" || !ctx.application.branch || ctx.application.branch !== ctx.application.branch.trim().toLowerCase() || /[\u0000-\u001f\u007f]/.test(ctx.application.branch))) {
|
|
@@ -1742,6 +1758,10 @@ var VerentisClient = class {
|
|
|
1742
1758
|
bridgeAuth.setHostOrigin(hostOrigin);
|
|
1743
1759
|
bridgeAuth.setToken(token);
|
|
1744
1760
|
this.context.setFromAppContext(context);
|
|
1761
|
+
this.context.setGrants(token.grants);
|
|
1762
|
+
this.bridge.on("verentis:token:refreshed", (message) => {
|
|
1763
|
+
if (message.type === "verentis:token:refreshed") this.context.setGrants(message.token?.grants);
|
|
1764
|
+
});
|
|
1745
1765
|
const http = new HttpTransport(
|
|
1746
1766
|
context.apiUrl,
|
|
1747
1767
|
bridgeAuth,
|