@topolo/sdk 0.10.3 → 0.10.4
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 +450 -33
- package/dist/index.d.cts +119 -1
- package/dist/index.d.ts +119 -1
- package/dist/index.js +436 -33
- package/dist/node/credential-store.cjs +254 -25
- package/dist/node/credential-store.d.cts +10 -3
- package/dist/node/credential-store.d.ts +10 -3
- package/dist/node/credential-store.js +251 -25
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -31,6 +31,12 @@ interface AgentIdentity {
|
|
|
31
31
|
agentName?: string;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
declare const TOPOLO_RUNTIME_ENVIRONMENTS: readonly ["production", "staging", "development", "local"];
|
|
35
|
+
type TopoloRuntimeEnvironment = (typeof TOPOLO_RUNTIME_ENVIRONMENTS)[number];
|
|
36
|
+
declare const TOPOLO_ENVIRONMENT_SERVICE_URLS: Record<TopoloRuntimeEnvironment, Record<string, string>>;
|
|
37
|
+
declare function assertTopoloServiceUrlEnvironment(service: string, value: string, environment: TopoloRuntimeEnvironment): string;
|
|
38
|
+
declare function topoloServiceOrigins(serviceUrls: Record<string, string> | undefined, environment: TopoloRuntimeEnvironment): Record<string, string>;
|
|
39
|
+
|
|
34
40
|
interface TopoloActionValidationIssue {
|
|
35
41
|
path: string;
|
|
36
42
|
code: string;
|
|
@@ -80,6 +86,8 @@ interface TopoloClientOptions {
|
|
|
80
86
|
agent: AgentIdentity;
|
|
81
87
|
/** Per-service URL overrides. Useful for staging/dev. */
|
|
82
88
|
serviceUrls?: Record<string, string>;
|
|
89
|
+
/** Explicit environment used to reject cross-environment service and action origins. */
|
|
90
|
+
environment?: TopoloRuntimeEnvironment;
|
|
83
91
|
/** Per-service TopoloAuth app id overrides from the owning app/deployment. */
|
|
84
92
|
appIds?: Record<string, string>;
|
|
85
93
|
/**
|
|
@@ -283,6 +291,18 @@ interface TopoloActionPlan {
|
|
|
283
291
|
rollbackActionId: string | null;
|
|
284
292
|
nextActionIds: string[];
|
|
285
293
|
}
|
|
294
|
+
interface TopoloActionPreparation {
|
|
295
|
+
action: TopoloActionCatalogEntry;
|
|
296
|
+
example: {
|
|
297
|
+
title?: string;
|
|
298
|
+
description?: string;
|
|
299
|
+
input: Record<string, unknown>;
|
|
300
|
+
} | null;
|
|
301
|
+
input: Record<string, unknown>;
|
|
302
|
+
inputSource: 'provided' | 'example' | 'empty';
|
|
303
|
+
missingFields: string[];
|
|
304
|
+
plan: TopoloActionPlan;
|
|
305
|
+
}
|
|
286
306
|
interface TopoloCatalogPage {
|
|
287
307
|
nextCursor: string | null;
|
|
288
308
|
hasMore: boolean;
|
|
@@ -309,6 +329,7 @@ declare class TopoloClient {
|
|
|
309
329
|
private credential;
|
|
310
330
|
private readonly agent;
|
|
311
331
|
private readonly serviceUrls?;
|
|
332
|
+
private readonly environment?;
|
|
312
333
|
private readonly appIds?;
|
|
313
334
|
private readonly requireConfirmForWrites;
|
|
314
335
|
private readonly timeoutMs;
|
|
@@ -340,6 +361,8 @@ declare class TopoloClient {
|
|
|
340
361
|
request<T = unknown>(opts: RequestOptions): Promise<T>;
|
|
341
362
|
private loadCurrentCredential;
|
|
342
363
|
private refreshRejectedAccessToken;
|
|
364
|
+
private validatedServiceOrigin;
|
|
365
|
+
private validatedActionEntry;
|
|
343
366
|
private resolveRequestService;
|
|
344
367
|
private resolveLiveCallableService;
|
|
345
368
|
/**
|
|
@@ -419,6 +442,14 @@ declare class TopoloClient {
|
|
|
419
442
|
resourceId: string;
|
|
420
443
|
};
|
|
421
444
|
}): Promise<TopoloActionPlan>;
|
|
445
|
+
prepareAction(action: string, input?: Record<string, unknown>, options?: {
|
|
446
|
+
confirm?: boolean;
|
|
447
|
+
resource?: {
|
|
448
|
+
resourceType: string;
|
|
449
|
+
resourceId: string;
|
|
450
|
+
};
|
|
451
|
+
}): Promise<TopoloActionPreparation>;
|
|
452
|
+
private planResolvedAction;
|
|
422
453
|
readAction<T = unknown>(action: string, input?: Record<string, unknown>, options?: {
|
|
423
454
|
resource?: {
|
|
424
455
|
resourceType: string;
|
|
@@ -743,6 +774,72 @@ declare function compactActionPlan(plan: TopoloActionPlan): {
|
|
|
743
774
|
rollbackActionId: string | null;
|
|
744
775
|
nextActionIds: string[];
|
|
745
776
|
};
|
|
777
|
+
interface TopoloAgentExecutionContext {
|
|
778
|
+
environment: TopoloRuntimeEnvironment;
|
|
779
|
+
contextKey: string | null;
|
|
780
|
+
user: {
|
|
781
|
+
id: string;
|
|
782
|
+
email: string;
|
|
783
|
+
name: string | null;
|
|
784
|
+
role: string;
|
|
785
|
+
};
|
|
786
|
+
organization: {
|
|
787
|
+
id: string;
|
|
788
|
+
slug: string;
|
|
789
|
+
name: string;
|
|
790
|
+
} | null;
|
|
791
|
+
serviceOrigins: Record<string, string>;
|
|
792
|
+
}
|
|
793
|
+
declare function createTopoloAgentExecutionContext(input: {
|
|
794
|
+
environment: TopoloRuntimeEnvironment;
|
|
795
|
+
contextKey: string | null;
|
|
796
|
+
identity: CredentialIntrospection;
|
|
797
|
+
serviceUrls?: Record<string, string>;
|
|
798
|
+
}): TopoloAgentExecutionContext;
|
|
799
|
+
declare function compactActionPreparationCore(preparation: TopoloActionPreparation): {
|
|
800
|
+
action: {
|
|
801
|
+
id: string;
|
|
802
|
+
title: string;
|
|
803
|
+
docsUrl: string | null;
|
|
804
|
+
};
|
|
805
|
+
example: {
|
|
806
|
+
title: string | null;
|
|
807
|
+
input: Record<string, unknown>;
|
|
808
|
+
} | null;
|
|
809
|
+
input: {
|
|
810
|
+
source: "example";
|
|
811
|
+
value?: undefined;
|
|
812
|
+
} | {
|
|
813
|
+
source: "provided" | "empty";
|
|
814
|
+
value: Record<string, unknown>;
|
|
815
|
+
};
|
|
816
|
+
missingFields: string[];
|
|
817
|
+
valid: boolean;
|
|
818
|
+
errors: TopoloActionValidationIssue[];
|
|
819
|
+
request: {
|
|
820
|
+
method: TopoloActionCatalogEntry["method"];
|
|
821
|
+
service: string;
|
|
822
|
+
apiBaseUrl: string | null;
|
|
823
|
+
path: string;
|
|
824
|
+
query?: Record<string, string | number | boolean>;
|
|
825
|
+
body?: unknown;
|
|
826
|
+
resource?: {
|
|
827
|
+
resourceType: string;
|
|
828
|
+
resourceId: string;
|
|
829
|
+
};
|
|
830
|
+
} | null;
|
|
831
|
+
confirmation: {
|
|
832
|
+
required: boolean;
|
|
833
|
+
provided: boolean;
|
|
834
|
+
};
|
|
835
|
+
executable: boolean;
|
|
836
|
+
verification: string[];
|
|
837
|
+
rollbackActionId: string | null;
|
|
838
|
+
};
|
|
839
|
+
declare function compactActionPreparation(preparation: TopoloActionPreparation): ReturnType<typeof compactActionPreparationCore>;
|
|
840
|
+
declare function compactActionPreparation(preparation: TopoloActionPreparation, context: TopoloAgentExecutionContext): ReturnType<typeof compactActionPreparationCore> & {
|
|
841
|
+
context: TopoloAgentExecutionContext;
|
|
842
|
+
};
|
|
746
843
|
declare function compactApplicationAudit(report: ApplicationRequirementsAuditReport): {
|
|
747
844
|
version: string;
|
|
748
845
|
applications: {
|
|
@@ -2077,6 +2174,10 @@ declare class TopoloSdkError extends Error {
|
|
|
2077
2174
|
readonly code: string;
|
|
2078
2175
|
constructor(code: string, message: string);
|
|
2079
2176
|
}
|
|
2177
|
+
declare function canonicalTopoloErrorCode(value: unknown): string | null;
|
|
2178
|
+
declare function canonicalTopoloRequestId(value: unknown): string | undefined;
|
|
2179
|
+
declare function canonicalTopoloRetryAfter(value: unknown): string | undefined;
|
|
2180
|
+
declare function canonicalTopoloRequired(value: unknown): string[];
|
|
2080
2181
|
declare class TopoloAuthError extends TopoloSdkError {
|
|
2081
2182
|
readonly status: number;
|
|
2082
2183
|
readonly body: unknown;
|
|
@@ -2084,6 +2185,7 @@ declare class TopoloAuthError extends TopoloSdkError {
|
|
|
2084
2185
|
readonly path?: string;
|
|
2085
2186
|
readonly requestId?: string;
|
|
2086
2187
|
readonly retryAfter?: string;
|
|
2188
|
+
readonly details: unknown;
|
|
2087
2189
|
constructor(message: string, code?: string, options?: HttpErrorContext);
|
|
2088
2190
|
}
|
|
2089
2191
|
declare class TopoloPermissionError extends TopoloSdkError {
|
|
@@ -2094,16 +2196,31 @@ declare class TopoloPermissionError extends TopoloSdkError {
|
|
|
2094
2196
|
readonly path?: string;
|
|
2095
2197
|
readonly requestId?: string;
|
|
2096
2198
|
readonly retryAfter?: string;
|
|
2199
|
+
readonly details: unknown;
|
|
2097
2200
|
constructor(message: string, required: string[], options?: HttpErrorContext);
|
|
2098
2201
|
}
|
|
2099
2202
|
interface HttpErrorContext {
|
|
2203
|
+
code?: string;
|
|
2100
2204
|
status?: number;
|
|
2101
2205
|
body?: unknown;
|
|
2102
2206
|
service?: string;
|
|
2103
2207
|
path?: string;
|
|
2104
2208
|
requestId?: string;
|
|
2105
2209
|
retryAfter?: string;
|
|
2210
|
+
details?: unknown;
|
|
2106
2211
|
}
|
|
2212
|
+
declare function extractTopoloServiceErrorCode(body: unknown): string | null;
|
|
2213
|
+
declare function extractTopoloServiceErrorDetails(body: unknown): unknown;
|
|
2214
|
+
declare function publicTopoloErrorMessage(error: string | {
|
|
2215
|
+
code?: string;
|
|
2216
|
+
body?: unknown;
|
|
2217
|
+
status?: number;
|
|
2218
|
+
message?: string;
|
|
2219
|
+
}): string;
|
|
2220
|
+
declare function topoloErrorHint(error: string | {
|
|
2221
|
+
code?: string;
|
|
2222
|
+
body?: unknown;
|
|
2223
|
+
}): string | undefined;
|
|
2107
2224
|
declare class TopoloConfirmationRequiredError extends TopoloSdkError {
|
|
2108
2225
|
constructor(message: string);
|
|
2109
2226
|
}
|
|
@@ -2114,6 +2231,7 @@ declare class TopoloHttpError extends TopoloSdkError {
|
|
|
2114
2231
|
readonly path: string;
|
|
2115
2232
|
readonly requestId?: string;
|
|
2116
2233
|
readonly retryAfter?: string;
|
|
2234
|
+
readonly details: unknown;
|
|
2117
2235
|
constructor(service: string, path: string, status: number, body: unknown, message?: string, options?: HttpErrorContext);
|
|
2118
2236
|
}
|
|
2119
2237
|
|
|
@@ -2661,4 +2779,4 @@ declare function createTopolo(options: TopoloClientOptions): {
|
|
|
2661
2779
|
};
|
|
2662
2780
|
type Topolo = ReturnType<typeof createTopolo>;
|
|
2663
2781
|
|
|
2664
|
-
export { ACTION_CATALOG_DIGEST_ALGORITHM, APPLICATIONS, APPLICATION_REQUIREMENTS, APPLICATION_REQUIREMENTS_VERSION, type ActionContractManifest, type ActionContractSource, type AgentIdentity, type AppApiId, type ApplicationCatalogEntry, type ApplicationDeployTarget, type ApplicationDirectory, type ApplicationDirectoryApplication, type ApplicationDirectoryClient, type ApplicationDirectorySource, type ApplicationId, type ApplicationRequirement, type ApplicationRequirementAudit, type ApplicationRequirementFinding, type ApplicationRequirementMigrationItem, type ApplicationRequirementScope, type ApplicationRequirementScore, type ApplicationRequirementStatus, type ApplicationRequirementsAuditReport, type CredentialIntrospection, type CrmContactSummary, CrmModule, DEFAULT_APP_URLS, type DeviceAuthorizationResponse, IdentityModule, type ListContactsOptions, type ListContactsResult, type OAuthHelperOptions, type P2PActionDetail, type P2PActionRequestInput, type P2PActionRequestResult, type P2PActionRow, type P2PActionRun, type P2PCapability, type P2PConnection, type P2PHold, type P2PLedgerEntry, P2PModule, type P2PPolicy, type P2PPricingModel, type P2PSettlementBatch, type P2PSettlementGroup, type PublishCapabilityInput, type RequestOptions, type ServiceCatalogUrlEntry, TOPOLO_WIDGET_ENDPOINT, TOPOLO_WIDGET_REFRESH_INTERVAL_MS, type TokenResponse, type Topolo, type TopoloActionAgentContract, type TopoloActionCatalogEntry, type TopoloActionCatalogSummary, type TopoloActionDigestInput, type TopoloActionPlan, type TopoloActionUploadOptions, type TopoloActionValidationIssue, type TopoloActionValidationResult, type TopoloApiKeyResourceMetadata, TopoloAuthError, type TopoloBindableResource, type TopoloBindableResourceCatalog, type TopoloChartWidget, TopoloClient, type TopoloClientOptions, TopoloConfirmationRequiredError, type TopoloCredential, type TopoloDebugEvent, TopoloHttpError, type TopoloInlineBase64UploadContract, type TopoloNotificationsWidget, TopoloOAuth, TopoloPermissionError, type TopoloQuickActionsWidget, type TopoloRecentActivityWidget, TopoloSdkError, type TopoloServiceCatalogEntry, type TopoloStatsWidget, type TopoloWidget, type TopoloWidgetActionItem, type TopoloWidgetActivityItem, type TopoloWidgetApiResponse, type TopoloWidgetBase, type TopoloWidgetConfig, type TopoloWidgetDraft, type TopoloWidgetMetric, type TopoloWidgetNotificationItem, type TopoloWidgetResponseOptions, type TopoloWidgetSnapshotMetadata, type TopoloWidgetSnapshotMetric, type TopoloWidgetType, type TopoloWidgetValidationResult, type TopoloWorkspace, type TopoloWorkspaceListResult, type TopoloWorkspaceMutationResult, type TopoloWorkspacePolicy, WorkspacesModule, actionContractCompleteness, applicationEntryFromCatalog, applicationRequirementScopes, auditAllApplicationRequirements, auditApplicationEntries, auditApplicationRequirements, compactActionCatalogEntry, compactActionPlan, compactActionValidation, compactApplicationAudit, createTopolo, createTopoloWidgetError, createTopoloWidgetResponse, defineTopoloChartWidget, defineTopoloNotificationsWidget, defineTopoloQuickActionsWidget, defineTopoloRecentActivityWidget, defineTopoloStatsWidget, digestTopoloActionCatalog, enrichActionContract, formatDirectoryApplicationIds, friendlyAppId, listApplicationDirectory, parseTopoloActionUploadContract, prepareTopoloActionBase64UploadInput, prepareTopoloActionUploadInput, requirementsForApplication, resolveApplicationDirectoryEntry, resolveCatalogServiceUrl, resolveServiceUrl, staticApplicationDirectory, validateTopoloActionInput, validateTopoloWidgetResponse };
|
|
2782
|
+
export { ACTION_CATALOG_DIGEST_ALGORITHM, APPLICATIONS, APPLICATION_REQUIREMENTS, APPLICATION_REQUIREMENTS_VERSION, type ActionContractManifest, type ActionContractSource, type AgentIdentity, type AppApiId, type ApplicationCatalogEntry, type ApplicationDeployTarget, type ApplicationDirectory, type ApplicationDirectoryApplication, type ApplicationDirectoryClient, type ApplicationDirectorySource, type ApplicationId, type ApplicationRequirement, type ApplicationRequirementAudit, type ApplicationRequirementFinding, type ApplicationRequirementMigrationItem, type ApplicationRequirementScope, type ApplicationRequirementScore, type ApplicationRequirementStatus, type ApplicationRequirementsAuditReport, type CredentialIntrospection, type CrmContactSummary, CrmModule, DEFAULT_APP_URLS, type DeviceAuthorizationResponse, IdentityModule, type ListContactsOptions, type ListContactsResult, type OAuthHelperOptions, type P2PActionDetail, type P2PActionRequestInput, type P2PActionRequestResult, type P2PActionRow, type P2PActionRun, type P2PCapability, type P2PConnection, type P2PHold, type P2PLedgerEntry, P2PModule, type P2PPolicy, type P2PPricingModel, type P2PSettlementBatch, type P2PSettlementGroup, type PublishCapabilityInput, type RequestOptions, type ServiceCatalogUrlEntry, TOPOLO_ENVIRONMENT_SERVICE_URLS, TOPOLO_RUNTIME_ENVIRONMENTS, TOPOLO_WIDGET_ENDPOINT, TOPOLO_WIDGET_REFRESH_INTERVAL_MS, type TokenResponse, type Topolo, type TopoloActionAgentContract, type TopoloActionCatalogEntry, type TopoloActionCatalogSummary, type TopoloActionDigestInput, type TopoloActionPlan, type TopoloActionPreparation, type TopoloActionUploadOptions, type TopoloActionValidationIssue, type TopoloActionValidationResult, type TopoloAgentExecutionContext, type TopoloApiKeyResourceMetadata, TopoloAuthError, type TopoloBindableResource, type TopoloBindableResourceCatalog, type TopoloChartWidget, TopoloClient, type TopoloClientOptions, TopoloConfirmationRequiredError, type TopoloCredential, type TopoloDebugEvent, TopoloHttpError, type TopoloInlineBase64UploadContract, type TopoloNotificationsWidget, TopoloOAuth, TopoloPermissionError, type TopoloQuickActionsWidget, type TopoloRecentActivityWidget, type TopoloRuntimeEnvironment, TopoloSdkError, type TopoloServiceCatalogEntry, type TopoloStatsWidget, type TopoloWidget, type TopoloWidgetActionItem, type TopoloWidgetActivityItem, type TopoloWidgetApiResponse, type TopoloWidgetBase, type TopoloWidgetConfig, type TopoloWidgetDraft, type TopoloWidgetMetric, type TopoloWidgetNotificationItem, type TopoloWidgetResponseOptions, type TopoloWidgetSnapshotMetadata, type TopoloWidgetSnapshotMetric, type TopoloWidgetType, type TopoloWidgetValidationResult, type TopoloWorkspace, type TopoloWorkspaceListResult, type TopoloWorkspaceMutationResult, type TopoloWorkspacePolicy, WorkspacesModule, actionContractCompleteness, applicationEntryFromCatalog, applicationRequirementScopes, assertTopoloServiceUrlEnvironment, auditAllApplicationRequirements, auditApplicationEntries, auditApplicationRequirements, canonicalTopoloErrorCode, canonicalTopoloRequestId, canonicalTopoloRequired, canonicalTopoloRetryAfter, compactActionCatalogEntry, compactActionPlan, compactActionPreparation, compactActionValidation, compactApplicationAudit, createTopolo, createTopoloAgentExecutionContext, createTopoloWidgetError, createTopoloWidgetResponse, defineTopoloChartWidget, defineTopoloNotificationsWidget, defineTopoloQuickActionsWidget, defineTopoloRecentActivityWidget, defineTopoloStatsWidget, digestTopoloActionCatalog, enrichActionContract, extractTopoloServiceErrorCode, extractTopoloServiceErrorDetails, formatDirectoryApplicationIds, friendlyAppId, listApplicationDirectory, parseTopoloActionUploadContract, prepareTopoloActionBase64UploadInput, prepareTopoloActionUploadInput, publicTopoloErrorMessage, requirementsForApplication, resolveApplicationDirectoryEntry, resolveCatalogServiceUrl, resolveServiceUrl, staticApplicationDirectory, topoloErrorHint, topoloServiceOrigins, validateTopoloActionInput, validateTopoloWidgetResponse };
|
package/dist/index.d.ts
CHANGED
|
@@ -31,6 +31,12 @@ interface AgentIdentity {
|
|
|
31
31
|
agentName?: string;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
declare const TOPOLO_RUNTIME_ENVIRONMENTS: readonly ["production", "staging", "development", "local"];
|
|
35
|
+
type TopoloRuntimeEnvironment = (typeof TOPOLO_RUNTIME_ENVIRONMENTS)[number];
|
|
36
|
+
declare const TOPOLO_ENVIRONMENT_SERVICE_URLS: Record<TopoloRuntimeEnvironment, Record<string, string>>;
|
|
37
|
+
declare function assertTopoloServiceUrlEnvironment(service: string, value: string, environment: TopoloRuntimeEnvironment): string;
|
|
38
|
+
declare function topoloServiceOrigins(serviceUrls: Record<string, string> | undefined, environment: TopoloRuntimeEnvironment): Record<string, string>;
|
|
39
|
+
|
|
34
40
|
interface TopoloActionValidationIssue {
|
|
35
41
|
path: string;
|
|
36
42
|
code: string;
|
|
@@ -80,6 +86,8 @@ interface TopoloClientOptions {
|
|
|
80
86
|
agent: AgentIdentity;
|
|
81
87
|
/** Per-service URL overrides. Useful for staging/dev. */
|
|
82
88
|
serviceUrls?: Record<string, string>;
|
|
89
|
+
/** Explicit environment used to reject cross-environment service and action origins. */
|
|
90
|
+
environment?: TopoloRuntimeEnvironment;
|
|
83
91
|
/** Per-service TopoloAuth app id overrides from the owning app/deployment. */
|
|
84
92
|
appIds?: Record<string, string>;
|
|
85
93
|
/**
|
|
@@ -283,6 +291,18 @@ interface TopoloActionPlan {
|
|
|
283
291
|
rollbackActionId: string | null;
|
|
284
292
|
nextActionIds: string[];
|
|
285
293
|
}
|
|
294
|
+
interface TopoloActionPreparation {
|
|
295
|
+
action: TopoloActionCatalogEntry;
|
|
296
|
+
example: {
|
|
297
|
+
title?: string;
|
|
298
|
+
description?: string;
|
|
299
|
+
input: Record<string, unknown>;
|
|
300
|
+
} | null;
|
|
301
|
+
input: Record<string, unknown>;
|
|
302
|
+
inputSource: 'provided' | 'example' | 'empty';
|
|
303
|
+
missingFields: string[];
|
|
304
|
+
plan: TopoloActionPlan;
|
|
305
|
+
}
|
|
286
306
|
interface TopoloCatalogPage {
|
|
287
307
|
nextCursor: string | null;
|
|
288
308
|
hasMore: boolean;
|
|
@@ -309,6 +329,7 @@ declare class TopoloClient {
|
|
|
309
329
|
private credential;
|
|
310
330
|
private readonly agent;
|
|
311
331
|
private readonly serviceUrls?;
|
|
332
|
+
private readonly environment?;
|
|
312
333
|
private readonly appIds?;
|
|
313
334
|
private readonly requireConfirmForWrites;
|
|
314
335
|
private readonly timeoutMs;
|
|
@@ -340,6 +361,8 @@ declare class TopoloClient {
|
|
|
340
361
|
request<T = unknown>(opts: RequestOptions): Promise<T>;
|
|
341
362
|
private loadCurrentCredential;
|
|
342
363
|
private refreshRejectedAccessToken;
|
|
364
|
+
private validatedServiceOrigin;
|
|
365
|
+
private validatedActionEntry;
|
|
343
366
|
private resolveRequestService;
|
|
344
367
|
private resolveLiveCallableService;
|
|
345
368
|
/**
|
|
@@ -419,6 +442,14 @@ declare class TopoloClient {
|
|
|
419
442
|
resourceId: string;
|
|
420
443
|
};
|
|
421
444
|
}): Promise<TopoloActionPlan>;
|
|
445
|
+
prepareAction(action: string, input?: Record<string, unknown>, options?: {
|
|
446
|
+
confirm?: boolean;
|
|
447
|
+
resource?: {
|
|
448
|
+
resourceType: string;
|
|
449
|
+
resourceId: string;
|
|
450
|
+
};
|
|
451
|
+
}): Promise<TopoloActionPreparation>;
|
|
452
|
+
private planResolvedAction;
|
|
422
453
|
readAction<T = unknown>(action: string, input?: Record<string, unknown>, options?: {
|
|
423
454
|
resource?: {
|
|
424
455
|
resourceType: string;
|
|
@@ -743,6 +774,72 @@ declare function compactActionPlan(plan: TopoloActionPlan): {
|
|
|
743
774
|
rollbackActionId: string | null;
|
|
744
775
|
nextActionIds: string[];
|
|
745
776
|
};
|
|
777
|
+
interface TopoloAgentExecutionContext {
|
|
778
|
+
environment: TopoloRuntimeEnvironment;
|
|
779
|
+
contextKey: string | null;
|
|
780
|
+
user: {
|
|
781
|
+
id: string;
|
|
782
|
+
email: string;
|
|
783
|
+
name: string | null;
|
|
784
|
+
role: string;
|
|
785
|
+
};
|
|
786
|
+
organization: {
|
|
787
|
+
id: string;
|
|
788
|
+
slug: string;
|
|
789
|
+
name: string;
|
|
790
|
+
} | null;
|
|
791
|
+
serviceOrigins: Record<string, string>;
|
|
792
|
+
}
|
|
793
|
+
declare function createTopoloAgentExecutionContext(input: {
|
|
794
|
+
environment: TopoloRuntimeEnvironment;
|
|
795
|
+
contextKey: string | null;
|
|
796
|
+
identity: CredentialIntrospection;
|
|
797
|
+
serviceUrls?: Record<string, string>;
|
|
798
|
+
}): TopoloAgentExecutionContext;
|
|
799
|
+
declare function compactActionPreparationCore(preparation: TopoloActionPreparation): {
|
|
800
|
+
action: {
|
|
801
|
+
id: string;
|
|
802
|
+
title: string;
|
|
803
|
+
docsUrl: string | null;
|
|
804
|
+
};
|
|
805
|
+
example: {
|
|
806
|
+
title: string | null;
|
|
807
|
+
input: Record<string, unknown>;
|
|
808
|
+
} | null;
|
|
809
|
+
input: {
|
|
810
|
+
source: "example";
|
|
811
|
+
value?: undefined;
|
|
812
|
+
} | {
|
|
813
|
+
source: "provided" | "empty";
|
|
814
|
+
value: Record<string, unknown>;
|
|
815
|
+
};
|
|
816
|
+
missingFields: string[];
|
|
817
|
+
valid: boolean;
|
|
818
|
+
errors: TopoloActionValidationIssue[];
|
|
819
|
+
request: {
|
|
820
|
+
method: TopoloActionCatalogEntry["method"];
|
|
821
|
+
service: string;
|
|
822
|
+
apiBaseUrl: string | null;
|
|
823
|
+
path: string;
|
|
824
|
+
query?: Record<string, string | number | boolean>;
|
|
825
|
+
body?: unknown;
|
|
826
|
+
resource?: {
|
|
827
|
+
resourceType: string;
|
|
828
|
+
resourceId: string;
|
|
829
|
+
};
|
|
830
|
+
} | null;
|
|
831
|
+
confirmation: {
|
|
832
|
+
required: boolean;
|
|
833
|
+
provided: boolean;
|
|
834
|
+
};
|
|
835
|
+
executable: boolean;
|
|
836
|
+
verification: string[];
|
|
837
|
+
rollbackActionId: string | null;
|
|
838
|
+
};
|
|
839
|
+
declare function compactActionPreparation(preparation: TopoloActionPreparation): ReturnType<typeof compactActionPreparationCore>;
|
|
840
|
+
declare function compactActionPreparation(preparation: TopoloActionPreparation, context: TopoloAgentExecutionContext): ReturnType<typeof compactActionPreparationCore> & {
|
|
841
|
+
context: TopoloAgentExecutionContext;
|
|
842
|
+
};
|
|
746
843
|
declare function compactApplicationAudit(report: ApplicationRequirementsAuditReport): {
|
|
747
844
|
version: string;
|
|
748
845
|
applications: {
|
|
@@ -2077,6 +2174,10 @@ declare class TopoloSdkError extends Error {
|
|
|
2077
2174
|
readonly code: string;
|
|
2078
2175
|
constructor(code: string, message: string);
|
|
2079
2176
|
}
|
|
2177
|
+
declare function canonicalTopoloErrorCode(value: unknown): string | null;
|
|
2178
|
+
declare function canonicalTopoloRequestId(value: unknown): string | undefined;
|
|
2179
|
+
declare function canonicalTopoloRetryAfter(value: unknown): string | undefined;
|
|
2180
|
+
declare function canonicalTopoloRequired(value: unknown): string[];
|
|
2080
2181
|
declare class TopoloAuthError extends TopoloSdkError {
|
|
2081
2182
|
readonly status: number;
|
|
2082
2183
|
readonly body: unknown;
|
|
@@ -2084,6 +2185,7 @@ declare class TopoloAuthError extends TopoloSdkError {
|
|
|
2084
2185
|
readonly path?: string;
|
|
2085
2186
|
readonly requestId?: string;
|
|
2086
2187
|
readonly retryAfter?: string;
|
|
2188
|
+
readonly details: unknown;
|
|
2087
2189
|
constructor(message: string, code?: string, options?: HttpErrorContext);
|
|
2088
2190
|
}
|
|
2089
2191
|
declare class TopoloPermissionError extends TopoloSdkError {
|
|
@@ -2094,16 +2196,31 @@ declare class TopoloPermissionError extends TopoloSdkError {
|
|
|
2094
2196
|
readonly path?: string;
|
|
2095
2197
|
readonly requestId?: string;
|
|
2096
2198
|
readonly retryAfter?: string;
|
|
2199
|
+
readonly details: unknown;
|
|
2097
2200
|
constructor(message: string, required: string[], options?: HttpErrorContext);
|
|
2098
2201
|
}
|
|
2099
2202
|
interface HttpErrorContext {
|
|
2203
|
+
code?: string;
|
|
2100
2204
|
status?: number;
|
|
2101
2205
|
body?: unknown;
|
|
2102
2206
|
service?: string;
|
|
2103
2207
|
path?: string;
|
|
2104
2208
|
requestId?: string;
|
|
2105
2209
|
retryAfter?: string;
|
|
2210
|
+
details?: unknown;
|
|
2106
2211
|
}
|
|
2212
|
+
declare function extractTopoloServiceErrorCode(body: unknown): string | null;
|
|
2213
|
+
declare function extractTopoloServiceErrorDetails(body: unknown): unknown;
|
|
2214
|
+
declare function publicTopoloErrorMessage(error: string | {
|
|
2215
|
+
code?: string;
|
|
2216
|
+
body?: unknown;
|
|
2217
|
+
status?: number;
|
|
2218
|
+
message?: string;
|
|
2219
|
+
}): string;
|
|
2220
|
+
declare function topoloErrorHint(error: string | {
|
|
2221
|
+
code?: string;
|
|
2222
|
+
body?: unknown;
|
|
2223
|
+
}): string | undefined;
|
|
2107
2224
|
declare class TopoloConfirmationRequiredError extends TopoloSdkError {
|
|
2108
2225
|
constructor(message: string);
|
|
2109
2226
|
}
|
|
@@ -2114,6 +2231,7 @@ declare class TopoloHttpError extends TopoloSdkError {
|
|
|
2114
2231
|
readonly path: string;
|
|
2115
2232
|
readonly requestId?: string;
|
|
2116
2233
|
readonly retryAfter?: string;
|
|
2234
|
+
readonly details: unknown;
|
|
2117
2235
|
constructor(service: string, path: string, status: number, body: unknown, message?: string, options?: HttpErrorContext);
|
|
2118
2236
|
}
|
|
2119
2237
|
|
|
@@ -2661,4 +2779,4 @@ declare function createTopolo(options: TopoloClientOptions): {
|
|
|
2661
2779
|
};
|
|
2662
2780
|
type Topolo = ReturnType<typeof createTopolo>;
|
|
2663
2781
|
|
|
2664
|
-
export { ACTION_CATALOG_DIGEST_ALGORITHM, APPLICATIONS, APPLICATION_REQUIREMENTS, APPLICATION_REQUIREMENTS_VERSION, type ActionContractManifest, type ActionContractSource, type AgentIdentity, type AppApiId, type ApplicationCatalogEntry, type ApplicationDeployTarget, type ApplicationDirectory, type ApplicationDirectoryApplication, type ApplicationDirectoryClient, type ApplicationDirectorySource, type ApplicationId, type ApplicationRequirement, type ApplicationRequirementAudit, type ApplicationRequirementFinding, type ApplicationRequirementMigrationItem, type ApplicationRequirementScope, type ApplicationRequirementScore, type ApplicationRequirementStatus, type ApplicationRequirementsAuditReport, type CredentialIntrospection, type CrmContactSummary, CrmModule, DEFAULT_APP_URLS, type DeviceAuthorizationResponse, IdentityModule, type ListContactsOptions, type ListContactsResult, type OAuthHelperOptions, type P2PActionDetail, type P2PActionRequestInput, type P2PActionRequestResult, type P2PActionRow, type P2PActionRun, type P2PCapability, type P2PConnection, type P2PHold, type P2PLedgerEntry, P2PModule, type P2PPolicy, type P2PPricingModel, type P2PSettlementBatch, type P2PSettlementGroup, type PublishCapabilityInput, type RequestOptions, type ServiceCatalogUrlEntry, TOPOLO_WIDGET_ENDPOINT, TOPOLO_WIDGET_REFRESH_INTERVAL_MS, type TokenResponse, type Topolo, type TopoloActionAgentContract, type TopoloActionCatalogEntry, type TopoloActionCatalogSummary, type TopoloActionDigestInput, type TopoloActionPlan, type TopoloActionUploadOptions, type TopoloActionValidationIssue, type TopoloActionValidationResult, type TopoloApiKeyResourceMetadata, TopoloAuthError, type TopoloBindableResource, type TopoloBindableResourceCatalog, type TopoloChartWidget, TopoloClient, type TopoloClientOptions, TopoloConfirmationRequiredError, type TopoloCredential, type TopoloDebugEvent, TopoloHttpError, type TopoloInlineBase64UploadContract, type TopoloNotificationsWidget, TopoloOAuth, TopoloPermissionError, type TopoloQuickActionsWidget, type TopoloRecentActivityWidget, TopoloSdkError, type TopoloServiceCatalogEntry, type TopoloStatsWidget, type TopoloWidget, type TopoloWidgetActionItem, type TopoloWidgetActivityItem, type TopoloWidgetApiResponse, type TopoloWidgetBase, type TopoloWidgetConfig, type TopoloWidgetDraft, type TopoloWidgetMetric, type TopoloWidgetNotificationItem, type TopoloWidgetResponseOptions, type TopoloWidgetSnapshotMetadata, type TopoloWidgetSnapshotMetric, type TopoloWidgetType, type TopoloWidgetValidationResult, type TopoloWorkspace, type TopoloWorkspaceListResult, type TopoloWorkspaceMutationResult, type TopoloWorkspacePolicy, WorkspacesModule, actionContractCompleteness, applicationEntryFromCatalog, applicationRequirementScopes, auditAllApplicationRequirements, auditApplicationEntries, auditApplicationRequirements, compactActionCatalogEntry, compactActionPlan, compactActionValidation, compactApplicationAudit, createTopolo, createTopoloWidgetError, createTopoloWidgetResponse, defineTopoloChartWidget, defineTopoloNotificationsWidget, defineTopoloQuickActionsWidget, defineTopoloRecentActivityWidget, defineTopoloStatsWidget, digestTopoloActionCatalog, enrichActionContract, formatDirectoryApplicationIds, friendlyAppId, listApplicationDirectory, parseTopoloActionUploadContract, prepareTopoloActionBase64UploadInput, prepareTopoloActionUploadInput, requirementsForApplication, resolveApplicationDirectoryEntry, resolveCatalogServiceUrl, resolveServiceUrl, staticApplicationDirectory, validateTopoloActionInput, validateTopoloWidgetResponse };
|
|
2782
|
+
export { ACTION_CATALOG_DIGEST_ALGORITHM, APPLICATIONS, APPLICATION_REQUIREMENTS, APPLICATION_REQUIREMENTS_VERSION, type ActionContractManifest, type ActionContractSource, type AgentIdentity, type AppApiId, type ApplicationCatalogEntry, type ApplicationDeployTarget, type ApplicationDirectory, type ApplicationDirectoryApplication, type ApplicationDirectoryClient, type ApplicationDirectorySource, type ApplicationId, type ApplicationRequirement, type ApplicationRequirementAudit, type ApplicationRequirementFinding, type ApplicationRequirementMigrationItem, type ApplicationRequirementScope, type ApplicationRequirementScore, type ApplicationRequirementStatus, type ApplicationRequirementsAuditReport, type CredentialIntrospection, type CrmContactSummary, CrmModule, DEFAULT_APP_URLS, type DeviceAuthorizationResponse, IdentityModule, type ListContactsOptions, type ListContactsResult, type OAuthHelperOptions, type P2PActionDetail, type P2PActionRequestInput, type P2PActionRequestResult, type P2PActionRow, type P2PActionRun, type P2PCapability, type P2PConnection, type P2PHold, type P2PLedgerEntry, P2PModule, type P2PPolicy, type P2PPricingModel, type P2PSettlementBatch, type P2PSettlementGroup, type PublishCapabilityInput, type RequestOptions, type ServiceCatalogUrlEntry, TOPOLO_ENVIRONMENT_SERVICE_URLS, TOPOLO_RUNTIME_ENVIRONMENTS, TOPOLO_WIDGET_ENDPOINT, TOPOLO_WIDGET_REFRESH_INTERVAL_MS, type TokenResponse, type Topolo, type TopoloActionAgentContract, type TopoloActionCatalogEntry, type TopoloActionCatalogSummary, type TopoloActionDigestInput, type TopoloActionPlan, type TopoloActionPreparation, type TopoloActionUploadOptions, type TopoloActionValidationIssue, type TopoloActionValidationResult, type TopoloAgentExecutionContext, type TopoloApiKeyResourceMetadata, TopoloAuthError, type TopoloBindableResource, type TopoloBindableResourceCatalog, type TopoloChartWidget, TopoloClient, type TopoloClientOptions, TopoloConfirmationRequiredError, type TopoloCredential, type TopoloDebugEvent, TopoloHttpError, type TopoloInlineBase64UploadContract, type TopoloNotificationsWidget, TopoloOAuth, TopoloPermissionError, type TopoloQuickActionsWidget, type TopoloRecentActivityWidget, type TopoloRuntimeEnvironment, TopoloSdkError, type TopoloServiceCatalogEntry, type TopoloStatsWidget, type TopoloWidget, type TopoloWidgetActionItem, type TopoloWidgetActivityItem, type TopoloWidgetApiResponse, type TopoloWidgetBase, type TopoloWidgetConfig, type TopoloWidgetDraft, type TopoloWidgetMetric, type TopoloWidgetNotificationItem, type TopoloWidgetResponseOptions, type TopoloWidgetSnapshotMetadata, type TopoloWidgetSnapshotMetric, type TopoloWidgetType, type TopoloWidgetValidationResult, type TopoloWorkspace, type TopoloWorkspaceListResult, type TopoloWorkspaceMutationResult, type TopoloWorkspacePolicy, WorkspacesModule, actionContractCompleteness, applicationEntryFromCatalog, applicationRequirementScopes, assertTopoloServiceUrlEnvironment, auditAllApplicationRequirements, auditApplicationEntries, auditApplicationRequirements, canonicalTopoloErrorCode, canonicalTopoloRequestId, canonicalTopoloRequired, canonicalTopoloRetryAfter, compactActionCatalogEntry, compactActionPlan, compactActionPreparation, compactActionValidation, compactApplicationAudit, createTopolo, createTopoloAgentExecutionContext, createTopoloWidgetError, createTopoloWidgetResponse, defineTopoloChartWidget, defineTopoloNotificationsWidget, defineTopoloQuickActionsWidget, defineTopoloRecentActivityWidget, defineTopoloStatsWidget, digestTopoloActionCatalog, enrichActionContract, extractTopoloServiceErrorCode, extractTopoloServiceErrorDetails, formatDirectoryApplicationIds, friendlyAppId, listApplicationDirectory, parseTopoloActionUploadContract, prepareTopoloActionBase64UploadInput, prepareTopoloActionUploadInput, publicTopoloErrorMessage, requirementsForApplication, resolveApplicationDirectoryEntry, resolveCatalogServiceUrl, resolveServiceUrl, staticApplicationDirectory, topoloErrorHint, topoloServiceOrigins, validateTopoloActionInput, validateTopoloWidgetResponse };
|