@topolo/sdk 0.17.1 → 0.18.0
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 +13 -0
- package/dist/index.cjs +41 -0
- package/dist/index.d.cts +19 -1
- package/dist/index.d.ts +19 -1
- package/dist/index.js +39 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -160,6 +160,19 @@ input and resource before sending its canonical base64url representation in
|
|
|
160
160
|
`X-Topolo-Actor-Envelope`; the envelope request ID also becomes the transport
|
|
161
161
|
request ID.
|
|
162
162
|
|
|
163
|
+
Use `projectActorAuditEvent` when persisting or rendering immutable audit
|
|
164
|
+
events. The role remains explicit and the friendly label is derived without
|
|
165
|
+
rewriting either identity:
|
|
166
|
+
|
|
167
|
+
```ts
|
|
168
|
+
const executedBy = projectActorAuditEvent(actorEnvelope, 'executed_by');
|
|
169
|
+
// executedBy.label === 'Ashley Lane via codex'
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
The frozen projection retains the accountable subject, actual performer,
|
|
173
|
+
delegation, channel, assurance, resource, request, action and canonical input
|
|
174
|
+
hash for consistent application queries and exports.
|
|
175
|
+
|
|
163
176
|
## Modules
|
|
164
177
|
|
|
165
178
|
| Surface | Methods |
|
package/dist/index.cjs
CHANGED
|
@@ -21,6 +21,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
23
|
ACTION_CATALOG_DIGEST_ALGORITHM: () => ACTION_CATALOG_DIGEST_ALGORITHM,
|
|
24
|
+
ACTOR_AUDIT_PROJECTION_VERSION: () => ACTOR_AUDIT_PROJECTION_VERSION,
|
|
24
25
|
ACTOR_ENVELOPE_VERSION: () => ACTOR_ENVELOPE_VERSION,
|
|
25
26
|
ActorEnvelopeValidationError: () => ActorEnvelopeValidationError,
|
|
26
27
|
CrmModule: () => CrmModule,
|
|
@@ -81,6 +82,7 @@ __export(index_exports, {
|
|
|
81
82
|
preferExactActionMatches: () => preferExactActionMatches,
|
|
82
83
|
prepareTopoloActionBase64UploadInput: () => prepareTopoloActionBase64UploadInput,
|
|
83
84
|
prepareTopoloActionUploadInput: () => prepareTopoloActionUploadInput,
|
|
85
|
+
projectActorAuditEvent: () => projectActorAuditEvent,
|
|
84
86
|
publicTopoloErrorMessage: () => publicTopoloErrorMessage,
|
|
85
87
|
resolveApplicationDirectoryEntry: () => resolveApplicationDirectoryEntry,
|
|
86
88
|
resolveCatalogServiceUrl: () => resolveCatalogServiceUrl,
|
|
@@ -3344,6 +3346,43 @@ var IdentityModule = class {
|
|
|
3344
3346
|
}
|
|
3345
3347
|
};
|
|
3346
3348
|
|
|
3349
|
+
// src/actor-audit.ts
|
|
3350
|
+
var ACTOR_AUDIT_PROJECTION_VERSION = 1;
|
|
3351
|
+
var EVENT_ROLES = /* @__PURE__ */ new Set([
|
|
3352
|
+
"requested_by",
|
|
3353
|
+
"acting_on_behalf_of",
|
|
3354
|
+
"approved_by",
|
|
3355
|
+
"executed_by"
|
|
3356
|
+
]);
|
|
3357
|
+
function projectActorAuditEvent(value, role) {
|
|
3358
|
+
if (!EVENT_ROLES.has(role)) throw new TypeError("Unsupported actor audit event role");
|
|
3359
|
+
const envelope = parseActorEnvelope(value);
|
|
3360
|
+
const subjectLabel = envelope.accountableSubject.displayName || envelope.accountableSubject.principalId;
|
|
3361
|
+
const performerLabel = envelope.performer.displayName || envelope.performer.model || envelope.performer.provider || envelope.performer.principalId;
|
|
3362
|
+
const direct = envelope.performer.principalType === envelope.accountableSubject.principalType && envelope.performer.principalId === envelope.accountableSubject.principalId;
|
|
3363
|
+
return deepFreeze({
|
|
3364
|
+
schemaVersion: ACTOR_AUDIT_PROJECTION_VERSION,
|
|
3365
|
+
role,
|
|
3366
|
+
label: direct ? subjectLabel : `${subjectLabel} via ${performerLabel}`,
|
|
3367
|
+
organizationId: envelope.organizationId,
|
|
3368
|
+
accountableSubject: envelope.accountableSubject,
|
|
3369
|
+
performer: envelope.performer,
|
|
3370
|
+
delegation: envelope.delegation,
|
|
3371
|
+
channel: envelope.channel,
|
|
3372
|
+
assurance: envelope.assurance,
|
|
3373
|
+
action: envelope.action,
|
|
3374
|
+
issuedAt: envelope.issuedAt,
|
|
3375
|
+
...envelope.expiresAt ? { expiresAt: envelope.expiresAt } : {}
|
|
3376
|
+
});
|
|
3377
|
+
}
|
|
3378
|
+
function deepFreeze(value) {
|
|
3379
|
+
if (value && typeof value === "object" && !Object.isFrozen(value)) {
|
|
3380
|
+
Object.freeze(value);
|
|
3381
|
+
for (const nested of Object.values(value)) deepFreeze(nested);
|
|
3382
|
+
}
|
|
3383
|
+
return value;
|
|
3384
|
+
}
|
|
3385
|
+
|
|
3347
3386
|
// src/modules/workspaces.ts
|
|
3348
3387
|
var ACTIONS = {
|
|
3349
3388
|
list: "app_topolo_auth.workspaces.list",
|
|
@@ -4835,6 +4874,7 @@ function createTopolo(options) {
|
|
|
4835
4874
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4836
4875
|
0 && (module.exports = {
|
|
4837
4876
|
ACTION_CATALOG_DIGEST_ALGORITHM,
|
|
4877
|
+
ACTOR_AUDIT_PROJECTION_VERSION,
|
|
4838
4878
|
ACTOR_ENVELOPE_VERSION,
|
|
4839
4879
|
ActorEnvelopeValidationError,
|
|
4840
4880
|
CrmModule,
|
|
@@ -4895,6 +4935,7 @@ function createTopolo(options) {
|
|
|
4895
4935
|
preferExactActionMatches,
|
|
4896
4936
|
prepareTopoloActionBase64UploadInput,
|
|
4897
4937
|
prepareTopoloActionUploadInput,
|
|
4938
|
+
projectActorAuditEvent,
|
|
4898
4939
|
publicTopoloErrorMessage,
|
|
4899
4940
|
resolveApplicationDirectoryEntry,
|
|
4900
4941
|
resolveCatalogServiceUrl,
|
package/dist/index.d.cts
CHANGED
|
@@ -984,6 +984,24 @@ declare class IdentityModule {
|
|
|
984
984
|
whoami(): Promise<CredentialIntrospection>;
|
|
985
985
|
}
|
|
986
986
|
|
|
987
|
+
declare const ACTOR_AUDIT_PROJECTION_VERSION: 1;
|
|
988
|
+
type ActorAuditEventRole = 'requested_by' | 'acting_on_behalf_of' | 'approved_by' | 'executed_by';
|
|
989
|
+
interface ActorAuditProjection {
|
|
990
|
+
readonly schemaVersion: typeof ACTOR_AUDIT_PROJECTION_VERSION;
|
|
991
|
+
readonly role: ActorAuditEventRole;
|
|
992
|
+
readonly label: string;
|
|
993
|
+
readonly organizationId: string;
|
|
994
|
+
readonly accountableSubject: Readonly<AccountableSubject>;
|
|
995
|
+
readonly performer: Readonly<ActorIdentity>;
|
|
996
|
+
readonly delegation: Readonly<NonNullable<ActorEnvelope['delegation']>> | null;
|
|
997
|
+
readonly channel: ActorEnvelope['channel'];
|
|
998
|
+
readonly assurance: Readonly<ActorEnvelope['assurance']>;
|
|
999
|
+
readonly action: Readonly<ActorEnvelope['action']>;
|
|
1000
|
+
readonly issuedAt: string;
|
|
1001
|
+
readonly expiresAt?: string;
|
|
1002
|
+
}
|
|
1003
|
+
declare function projectActorAuditEvent(value: unknown, role: ActorAuditEventRole): ActorAuditProjection;
|
|
1004
|
+
|
|
987
1005
|
interface TopoloWorkspace {
|
|
988
1006
|
id: string;
|
|
989
1007
|
appId: string;
|
|
@@ -1676,4 +1694,4 @@ declare function createTopolo(options: TopoloClientOptions): {
|
|
|
1676
1694
|
};
|
|
1677
1695
|
type Topolo = ReturnType<typeof createTopolo>;
|
|
1678
1696
|
|
|
1679
|
-
export { ACTION_CATALOG_DIGEST_ALGORITHM, ACTOR_ENVELOPE_VERSION, type AccountableSubject, type AccountableSubjectType, type ActionContractManifest, type ActionContractSource, type ActorAssurance, type ActorChannel, type ActorDelegationHop, type ActorEnvelope, ActorEnvelopeValidationError, type ActorIdentity, type ActorPrincipalType, type AgentIdentity, type AppApiId, type ApplicationCatalogEntry, type ApplicationDeployTarget, type ApplicationDirectory, type ApplicationDirectoryApplication, type ApplicationDirectoryClient, type ApplicationDirectorySource, type ApplicationId, 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_ACTOR_ENVELOPE_HEADER, TOPOLO_ENVIRONMENT_SERVICE_URLS, TOPOLO_RUNTIME_ENVIRONMENTS, TOPOLO_WIDGET_CONTRACT_VERSION, TOPOLO_WIDGET_ENDPOINT, TOPOLO_WIDGET_OUTPUT_SCHEMA, 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 TopoloActionsWidget, type TopoloActivityWidget, type TopoloAgentExecutionContext, type TopoloApiKeyResourceMetadata, TopoloAuthError, type TopoloBinaryResponse, type TopoloBindableResource, type TopoloBindableResourceCatalog, type TopoloChartWidget, TopoloClient, type TopoloClientOptions, TopoloConfirmationRequiredError, type TopoloCredential, type TopoloDebugEvent, TopoloHttpError, type TopoloInlineBase64UploadContract, type TopoloJsonSchema, type TopoloNotificationsWidget, TopoloOAuth, TopoloPermissionError, type TopoloRuntimeEnvironment, TopoloSdkError, type TopoloServiceCatalogEntry, type TopoloStatsWidget, type TopoloWidget, type TopoloWidgetAccessibility, type TopoloWidgetActionBinding, type TopoloWidgetActionRecovery, type TopoloWidgetActivityItem, type TopoloWidgetApiError, type TopoloWidgetApiErrorResponse, type TopoloWidgetApiResponse, type TopoloWidgetApiSuccessResponse, type TopoloWidgetBase, type TopoloWidgetConfig, type TopoloWidgetConfiguration, type TopoloWidgetConfigurationField, type TopoloWidgetConfigurationOption, type TopoloWidgetContext, type TopoloWidgetContribution, type TopoloWidgetDatasetDefinition, type TopoloWidgetDimension, type TopoloWidgetDimensionDefinition, type TopoloWidgetDraft, type TopoloWidgetDrilldown, type TopoloWidgetErrorResponseOptions, type TopoloWidgetEventDefinition, type TopoloWidgetLifecycleStage, type TopoloWidgetLocalization, type TopoloWidgetMetric, type TopoloWidgetMetricAggregation, type TopoloWidgetMetricComparison, type TopoloWidgetMetricDefinition, type TopoloWidgetMetricSemantic, type TopoloWidgetNotificationItem, type TopoloWidgetPeriod, type TopoloWidgetPresentation, type TopoloWidgetRefreshPolicy, type TopoloWidgetResourceBinding, type TopoloWidgetResponseOptions, type TopoloWidgetSeries, type TopoloWidgetSeriesDefinition, type TopoloWidgetSeriesPoint, type TopoloWidgetSize, type TopoloWidgetState, type TopoloWidgetStatus, type TopoloWidgetType, type TopoloWidgetValidationResult, type TopoloWidgetVisualizationFamily, type TopoloWidgetWorkspaceSelector, type TopoloWorkspace, type TopoloWorkspaceListResult, type TopoloWorkspaceMutationResult, type TopoloWorkspacePolicy, WorkspacesModule, actionContractCompleteness, applicationEntryFromCatalog, assertTopoloServiceUrlEnvironment, canonicalJson, canonicalTopoloErrorCode, canonicalTopoloRequestId, canonicalTopoloRequired, canonicalTopoloRetryAfter, canonicalizeActorEnvelope, compactActionCatalogEntry, compactActionPlan, compactActionPreparation, compactActionResult, compactActionValidation, createTopolo, createTopoloAgentExecutionContext, createTopoloWidgetError, createTopoloWidgetResponse, decodeActorEnvelopeHeader, defineTopoloActionsWidget, defineTopoloActivityWidget, defineTopoloChartWidget, defineTopoloNotificationsWidget, defineTopoloStatsWidget, digestTopoloActionCatalog, encodeActorEnvelopeHeader, encodeTopoloActionBase64, enrichActionContract, extractTopoloServiceErrorCode, extractTopoloServiceErrorDetails, formatDirectoryApplicationIds, friendlyAppId, isTopoloWidgetOutputSchema, listApplicationDirectory, parseActorEnvelope, parseTopoloActionUploadContract, preferExactActionMatches, prepareTopoloActionBase64UploadInput, prepareTopoloActionUploadInput, publicTopoloErrorMessage, resolveApplicationDirectoryEntry, resolveCatalogServiceUrl, resolveServiceUrl, sha256CanonicalValue, topoloErrorHint, topoloServiceOrigins, validateTopoloActionInput, validateTopoloWidgetResponse };
|
|
1697
|
+
export { ACTION_CATALOG_DIGEST_ALGORITHM, ACTOR_AUDIT_PROJECTION_VERSION, ACTOR_ENVELOPE_VERSION, type AccountableSubject, type AccountableSubjectType, type ActionContractManifest, type ActionContractSource, type ActorAssurance, type ActorAuditEventRole, type ActorAuditProjection, type ActorChannel, type ActorDelegationHop, type ActorEnvelope, ActorEnvelopeValidationError, type ActorIdentity, type ActorPrincipalType, type AgentIdentity, type AppApiId, type ApplicationCatalogEntry, type ApplicationDeployTarget, type ApplicationDirectory, type ApplicationDirectoryApplication, type ApplicationDirectoryClient, type ApplicationDirectorySource, type ApplicationId, 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_ACTOR_ENVELOPE_HEADER, TOPOLO_ENVIRONMENT_SERVICE_URLS, TOPOLO_RUNTIME_ENVIRONMENTS, TOPOLO_WIDGET_CONTRACT_VERSION, TOPOLO_WIDGET_ENDPOINT, TOPOLO_WIDGET_OUTPUT_SCHEMA, 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 TopoloActionsWidget, type TopoloActivityWidget, type TopoloAgentExecutionContext, type TopoloApiKeyResourceMetadata, TopoloAuthError, type TopoloBinaryResponse, type TopoloBindableResource, type TopoloBindableResourceCatalog, type TopoloChartWidget, TopoloClient, type TopoloClientOptions, TopoloConfirmationRequiredError, type TopoloCredential, type TopoloDebugEvent, TopoloHttpError, type TopoloInlineBase64UploadContract, type TopoloJsonSchema, type TopoloNotificationsWidget, TopoloOAuth, TopoloPermissionError, type TopoloRuntimeEnvironment, TopoloSdkError, type TopoloServiceCatalogEntry, type TopoloStatsWidget, type TopoloWidget, type TopoloWidgetAccessibility, type TopoloWidgetActionBinding, type TopoloWidgetActionRecovery, type TopoloWidgetActivityItem, type TopoloWidgetApiError, type TopoloWidgetApiErrorResponse, type TopoloWidgetApiResponse, type TopoloWidgetApiSuccessResponse, type TopoloWidgetBase, type TopoloWidgetConfig, type TopoloWidgetConfiguration, type TopoloWidgetConfigurationField, type TopoloWidgetConfigurationOption, type TopoloWidgetContext, type TopoloWidgetContribution, type TopoloWidgetDatasetDefinition, type TopoloWidgetDimension, type TopoloWidgetDimensionDefinition, type TopoloWidgetDraft, type TopoloWidgetDrilldown, type TopoloWidgetErrorResponseOptions, type TopoloWidgetEventDefinition, type TopoloWidgetLifecycleStage, type TopoloWidgetLocalization, type TopoloWidgetMetric, type TopoloWidgetMetricAggregation, type TopoloWidgetMetricComparison, type TopoloWidgetMetricDefinition, type TopoloWidgetMetricSemantic, type TopoloWidgetNotificationItem, type TopoloWidgetPeriod, type TopoloWidgetPresentation, type TopoloWidgetRefreshPolicy, type TopoloWidgetResourceBinding, type TopoloWidgetResponseOptions, type TopoloWidgetSeries, type TopoloWidgetSeriesDefinition, type TopoloWidgetSeriesPoint, type TopoloWidgetSize, type TopoloWidgetState, type TopoloWidgetStatus, type TopoloWidgetType, type TopoloWidgetValidationResult, type TopoloWidgetVisualizationFamily, type TopoloWidgetWorkspaceSelector, type TopoloWorkspace, type TopoloWorkspaceListResult, type TopoloWorkspaceMutationResult, type TopoloWorkspacePolicy, WorkspacesModule, actionContractCompleteness, applicationEntryFromCatalog, assertTopoloServiceUrlEnvironment, canonicalJson, canonicalTopoloErrorCode, canonicalTopoloRequestId, canonicalTopoloRequired, canonicalTopoloRetryAfter, canonicalizeActorEnvelope, compactActionCatalogEntry, compactActionPlan, compactActionPreparation, compactActionResult, compactActionValidation, createTopolo, createTopoloAgentExecutionContext, createTopoloWidgetError, createTopoloWidgetResponse, decodeActorEnvelopeHeader, defineTopoloActionsWidget, defineTopoloActivityWidget, defineTopoloChartWidget, defineTopoloNotificationsWidget, defineTopoloStatsWidget, digestTopoloActionCatalog, encodeActorEnvelopeHeader, encodeTopoloActionBase64, enrichActionContract, extractTopoloServiceErrorCode, extractTopoloServiceErrorDetails, formatDirectoryApplicationIds, friendlyAppId, isTopoloWidgetOutputSchema, listApplicationDirectory, parseActorEnvelope, parseTopoloActionUploadContract, preferExactActionMatches, prepareTopoloActionBase64UploadInput, prepareTopoloActionUploadInput, projectActorAuditEvent, publicTopoloErrorMessage, resolveApplicationDirectoryEntry, resolveCatalogServiceUrl, resolveServiceUrl, sha256CanonicalValue, topoloErrorHint, topoloServiceOrigins, validateTopoloActionInput, validateTopoloWidgetResponse };
|
package/dist/index.d.ts
CHANGED
|
@@ -984,6 +984,24 @@ declare class IdentityModule {
|
|
|
984
984
|
whoami(): Promise<CredentialIntrospection>;
|
|
985
985
|
}
|
|
986
986
|
|
|
987
|
+
declare const ACTOR_AUDIT_PROJECTION_VERSION: 1;
|
|
988
|
+
type ActorAuditEventRole = 'requested_by' | 'acting_on_behalf_of' | 'approved_by' | 'executed_by';
|
|
989
|
+
interface ActorAuditProjection {
|
|
990
|
+
readonly schemaVersion: typeof ACTOR_AUDIT_PROJECTION_VERSION;
|
|
991
|
+
readonly role: ActorAuditEventRole;
|
|
992
|
+
readonly label: string;
|
|
993
|
+
readonly organizationId: string;
|
|
994
|
+
readonly accountableSubject: Readonly<AccountableSubject>;
|
|
995
|
+
readonly performer: Readonly<ActorIdentity>;
|
|
996
|
+
readonly delegation: Readonly<NonNullable<ActorEnvelope['delegation']>> | null;
|
|
997
|
+
readonly channel: ActorEnvelope['channel'];
|
|
998
|
+
readonly assurance: Readonly<ActorEnvelope['assurance']>;
|
|
999
|
+
readonly action: Readonly<ActorEnvelope['action']>;
|
|
1000
|
+
readonly issuedAt: string;
|
|
1001
|
+
readonly expiresAt?: string;
|
|
1002
|
+
}
|
|
1003
|
+
declare function projectActorAuditEvent(value: unknown, role: ActorAuditEventRole): ActorAuditProjection;
|
|
1004
|
+
|
|
987
1005
|
interface TopoloWorkspace {
|
|
988
1006
|
id: string;
|
|
989
1007
|
appId: string;
|
|
@@ -1676,4 +1694,4 @@ declare function createTopolo(options: TopoloClientOptions): {
|
|
|
1676
1694
|
};
|
|
1677
1695
|
type Topolo = ReturnType<typeof createTopolo>;
|
|
1678
1696
|
|
|
1679
|
-
export { ACTION_CATALOG_DIGEST_ALGORITHM, ACTOR_ENVELOPE_VERSION, type AccountableSubject, type AccountableSubjectType, type ActionContractManifest, type ActionContractSource, type ActorAssurance, type ActorChannel, type ActorDelegationHop, type ActorEnvelope, ActorEnvelopeValidationError, type ActorIdentity, type ActorPrincipalType, type AgentIdentity, type AppApiId, type ApplicationCatalogEntry, type ApplicationDeployTarget, type ApplicationDirectory, type ApplicationDirectoryApplication, type ApplicationDirectoryClient, type ApplicationDirectorySource, type ApplicationId, 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_ACTOR_ENVELOPE_HEADER, TOPOLO_ENVIRONMENT_SERVICE_URLS, TOPOLO_RUNTIME_ENVIRONMENTS, TOPOLO_WIDGET_CONTRACT_VERSION, TOPOLO_WIDGET_ENDPOINT, TOPOLO_WIDGET_OUTPUT_SCHEMA, 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 TopoloActionsWidget, type TopoloActivityWidget, type TopoloAgentExecutionContext, type TopoloApiKeyResourceMetadata, TopoloAuthError, type TopoloBinaryResponse, type TopoloBindableResource, type TopoloBindableResourceCatalog, type TopoloChartWidget, TopoloClient, type TopoloClientOptions, TopoloConfirmationRequiredError, type TopoloCredential, type TopoloDebugEvent, TopoloHttpError, type TopoloInlineBase64UploadContract, type TopoloJsonSchema, type TopoloNotificationsWidget, TopoloOAuth, TopoloPermissionError, type TopoloRuntimeEnvironment, TopoloSdkError, type TopoloServiceCatalogEntry, type TopoloStatsWidget, type TopoloWidget, type TopoloWidgetAccessibility, type TopoloWidgetActionBinding, type TopoloWidgetActionRecovery, type TopoloWidgetActivityItem, type TopoloWidgetApiError, type TopoloWidgetApiErrorResponse, type TopoloWidgetApiResponse, type TopoloWidgetApiSuccessResponse, type TopoloWidgetBase, type TopoloWidgetConfig, type TopoloWidgetConfiguration, type TopoloWidgetConfigurationField, type TopoloWidgetConfigurationOption, type TopoloWidgetContext, type TopoloWidgetContribution, type TopoloWidgetDatasetDefinition, type TopoloWidgetDimension, type TopoloWidgetDimensionDefinition, type TopoloWidgetDraft, type TopoloWidgetDrilldown, type TopoloWidgetErrorResponseOptions, type TopoloWidgetEventDefinition, type TopoloWidgetLifecycleStage, type TopoloWidgetLocalization, type TopoloWidgetMetric, type TopoloWidgetMetricAggregation, type TopoloWidgetMetricComparison, type TopoloWidgetMetricDefinition, type TopoloWidgetMetricSemantic, type TopoloWidgetNotificationItem, type TopoloWidgetPeriod, type TopoloWidgetPresentation, type TopoloWidgetRefreshPolicy, type TopoloWidgetResourceBinding, type TopoloWidgetResponseOptions, type TopoloWidgetSeries, type TopoloWidgetSeriesDefinition, type TopoloWidgetSeriesPoint, type TopoloWidgetSize, type TopoloWidgetState, type TopoloWidgetStatus, type TopoloWidgetType, type TopoloWidgetValidationResult, type TopoloWidgetVisualizationFamily, type TopoloWidgetWorkspaceSelector, type TopoloWorkspace, type TopoloWorkspaceListResult, type TopoloWorkspaceMutationResult, type TopoloWorkspacePolicy, WorkspacesModule, actionContractCompleteness, applicationEntryFromCatalog, assertTopoloServiceUrlEnvironment, canonicalJson, canonicalTopoloErrorCode, canonicalTopoloRequestId, canonicalTopoloRequired, canonicalTopoloRetryAfter, canonicalizeActorEnvelope, compactActionCatalogEntry, compactActionPlan, compactActionPreparation, compactActionResult, compactActionValidation, createTopolo, createTopoloAgentExecutionContext, createTopoloWidgetError, createTopoloWidgetResponse, decodeActorEnvelopeHeader, defineTopoloActionsWidget, defineTopoloActivityWidget, defineTopoloChartWidget, defineTopoloNotificationsWidget, defineTopoloStatsWidget, digestTopoloActionCatalog, encodeActorEnvelopeHeader, encodeTopoloActionBase64, enrichActionContract, extractTopoloServiceErrorCode, extractTopoloServiceErrorDetails, formatDirectoryApplicationIds, friendlyAppId, isTopoloWidgetOutputSchema, listApplicationDirectory, parseActorEnvelope, parseTopoloActionUploadContract, preferExactActionMatches, prepareTopoloActionBase64UploadInput, prepareTopoloActionUploadInput, publicTopoloErrorMessage, resolveApplicationDirectoryEntry, resolveCatalogServiceUrl, resolveServiceUrl, sha256CanonicalValue, topoloErrorHint, topoloServiceOrigins, validateTopoloActionInput, validateTopoloWidgetResponse };
|
|
1697
|
+
export { ACTION_CATALOG_DIGEST_ALGORITHM, ACTOR_AUDIT_PROJECTION_VERSION, ACTOR_ENVELOPE_VERSION, type AccountableSubject, type AccountableSubjectType, type ActionContractManifest, type ActionContractSource, type ActorAssurance, type ActorAuditEventRole, type ActorAuditProjection, type ActorChannel, type ActorDelegationHop, type ActorEnvelope, ActorEnvelopeValidationError, type ActorIdentity, type ActorPrincipalType, type AgentIdentity, type AppApiId, type ApplicationCatalogEntry, type ApplicationDeployTarget, type ApplicationDirectory, type ApplicationDirectoryApplication, type ApplicationDirectoryClient, type ApplicationDirectorySource, type ApplicationId, 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_ACTOR_ENVELOPE_HEADER, TOPOLO_ENVIRONMENT_SERVICE_URLS, TOPOLO_RUNTIME_ENVIRONMENTS, TOPOLO_WIDGET_CONTRACT_VERSION, TOPOLO_WIDGET_ENDPOINT, TOPOLO_WIDGET_OUTPUT_SCHEMA, 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 TopoloActionsWidget, type TopoloActivityWidget, type TopoloAgentExecutionContext, type TopoloApiKeyResourceMetadata, TopoloAuthError, type TopoloBinaryResponse, type TopoloBindableResource, type TopoloBindableResourceCatalog, type TopoloChartWidget, TopoloClient, type TopoloClientOptions, TopoloConfirmationRequiredError, type TopoloCredential, type TopoloDebugEvent, TopoloHttpError, type TopoloInlineBase64UploadContract, type TopoloJsonSchema, type TopoloNotificationsWidget, TopoloOAuth, TopoloPermissionError, type TopoloRuntimeEnvironment, TopoloSdkError, type TopoloServiceCatalogEntry, type TopoloStatsWidget, type TopoloWidget, type TopoloWidgetAccessibility, type TopoloWidgetActionBinding, type TopoloWidgetActionRecovery, type TopoloWidgetActivityItem, type TopoloWidgetApiError, type TopoloWidgetApiErrorResponse, type TopoloWidgetApiResponse, type TopoloWidgetApiSuccessResponse, type TopoloWidgetBase, type TopoloWidgetConfig, type TopoloWidgetConfiguration, type TopoloWidgetConfigurationField, type TopoloWidgetConfigurationOption, type TopoloWidgetContext, type TopoloWidgetContribution, type TopoloWidgetDatasetDefinition, type TopoloWidgetDimension, type TopoloWidgetDimensionDefinition, type TopoloWidgetDraft, type TopoloWidgetDrilldown, type TopoloWidgetErrorResponseOptions, type TopoloWidgetEventDefinition, type TopoloWidgetLifecycleStage, type TopoloWidgetLocalization, type TopoloWidgetMetric, type TopoloWidgetMetricAggregation, type TopoloWidgetMetricComparison, type TopoloWidgetMetricDefinition, type TopoloWidgetMetricSemantic, type TopoloWidgetNotificationItem, type TopoloWidgetPeriod, type TopoloWidgetPresentation, type TopoloWidgetRefreshPolicy, type TopoloWidgetResourceBinding, type TopoloWidgetResponseOptions, type TopoloWidgetSeries, type TopoloWidgetSeriesDefinition, type TopoloWidgetSeriesPoint, type TopoloWidgetSize, type TopoloWidgetState, type TopoloWidgetStatus, type TopoloWidgetType, type TopoloWidgetValidationResult, type TopoloWidgetVisualizationFamily, type TopoloWidgetWorkspaceSelector, type TopoloWorkspace, type TopoloWorkspaceListResult, type TopoloWorkspaceMutationResult, type TopoloWorkspacePolicy, WorkspacesModule, actionContractCompleteness, applicationEntryFromCatalog, assertTopoloServiceUrlEnvironment, canonicalJson, canonicalTopoloErrorCode, canonicalTopoloRequestId, canonicalTopoloRequired, canonicalTopoloRetryAfter, canonicalizeActorEnvelope, compactActionCatalogEntry, compactActionPlan, compactActionPreparation, compactActionResult, compactActionValidation, createTopolo, createTopoloAgentExecutionContext, createTopoloWidgetError, createTopoloWidgetResponse, decodeActorEnvelopeHeader, defineTopoloActionsWidget, defineTopoloActivityWidget, defineTopoloChartWidget, defineTopoloNotificationsWidget, defineTopoloStatsWidget, digestTopoloActionCatalog, encodeActorEnvelopeHeader, encodeTopoloActionBase64, enrichActionContract, extractTopoloServiceErrorCode, extractTopoloServiceErrorDetails, formatDirectoryApplicationIds, friendlyAppId, isTopoloWidgetOutputSchema, listApplicationDirectory, parseActorEnvelope, parseTopoloActionUploadContract, preferExactActionMatches, prepareTopoloActionBase64UploadInput, prepareTopoloActionUploadInput, projectActorAuditEvent, publicTopoloErrorMessage, resolveApplicationDirectoryEntry, resolveCatalogServiceUrl, resolveServiceUrl, sha256CanonicalValue, topoloErrorHint, topoloServiceOrigins, validateTopoloActionInput, validateTopoloWidgetResponse };
|
package/dist/index.js
CHANGED
|
@@ -3249,6 +3249,43 @@ var IdentityModule = class {
|
|
|
3249
3249
|
}
|
|
3250
3250
|
};
|
|
3251
3251
|
|
|
3252
|
+
// src/actor-audit.ts
|
|
3253
|
+
var ACTOR_AUDIT_PROJECTION_VERSION = 1;
|
|
3254
|
+
var EVENT_ROLES = /* @__PURE__ */ new Set([
|
|
3255
|
+
"requested_by",
|
|
3256
|
+
"acting_on_behalf_of",
|
|
3257
|
+
"approved_by",
|
|
3258
|
+
"executed_by"
|
|
3259
|
+
]);
|
|
3260
|
+
function projectActorAuditEvent(value, role) {
|
|
3261
|
+
if (!EVENT_ROLES.has(role)) throw new TypeError("Unsupported actor audit event role");
|
|
3262
|
+
const envelope = parseActorEnvelope(value);
|
|
3263
|
+
const subjectLabel = envelope.accountableSubject.displayName || envelope.accountableSubject.principalId;
|
|
3264
|
+
const performerLabel = envelope.performer.displayName || envelope.performer.model || envelope.performer.provider || envelope.performer.principalId;
|
|
3265
|
+
const direct = envelope.performer.principalType === envelope.accountableSubject.principalType && envelope.performer.principalId === envelope.accountableSubject.principalId;
|
|
3266
|
+
return deepFreeze({
|
|
3267
|
+
schemaVersion: ACTOR_AUDIT_PROJECTION_VERSION,
|
|
3268
|
+
role,
|
|
3269
|
+
label: direct ? subjectLabel : `${subjectLabel} via ${performerLabel}`,
|
|
3270
|
+
organizationId: envelope.organizationId,
|
|
3271
|
+
accountableSubject: envelope.accountableSubject,
|
|
3272
|
+
performer: envelope.performer,
|
|
3273
|
+
delegation: envelope.delegation,
|
|
3274
|
+
channel: envelope.channel,
|
|
3275
|
+
assurance: envelope.assurance,
|
|
3276
|
+
action: envelope.action,
|
|
3277
|
+
issuedAt: envelope.issuedAt,
|
|
3278
|
+
...envelope.expiresAt ? { expiresAt: envelope.expiresAt } : {}
|
|
3279
|
+
});
|
|
3280
|
+
}
|
|
3281
|
+
function deepFreeze(value) {
|
|
3282
|
+
if (value && typeof value === "object" && !Object.isFrozen(value)) {
|
|
3283
|
+
Object.freeze(value);
|
|
3284
|
+
for (const nested of Object.values(value)) deepFreeze(nested);
|
|
3285
|
+
}
|
|
3286
|
+
return value;
|
|
3287
|
+
}
|
|
3288
|
+
|
|
3252
3289
|
// src/modules/workspaces.ts
|
|
3253
3290
|
var ACTIONS = {
|
|
3254
3291
|
list: "app_topolo_auth.workspaces.list",
|
|
@@ -4739,6 +4776,7 @@ function createTopolo(options) {
|
|
|
4739
4776
|
}
|
|
4740
4777
|
export {
|
|
4741
4778
|
ACTION_CATALOG_DIGEST_ALGORITHM,
|
|
4779
|
+
ACTOR_AUDIT_PROJECTION_VERSION,
|
|
4742
4780
|
ACTOR_ENVELOPE_VERSION,
|
|
4743
4781
|
ActorEnvelopeValidationError,
|
|
4744
4782
|
CrmModule,
|
|
@@ -4799,6 +4837,7 @@ export {
|
|
|
4799
4837
|
preferExactActionMatches,
|
|
4800
4838
|
prepareTopoloActionBase64UploadInput,
|
|
4801
4839
|
prepareTopoloActionUploadInput,
|
|
4840
|
+
projectActorAuditEvent,
|
|
4802
4841
|
publicTopoloErrorMessage,
|
|
4803
4842
|
resolveApplicationDirectoryEntry,
|
|
4804
4843
|
resolveCatalogServiceUrl,
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@topolo/sdk",
|
|
3
3
|
"packageManager": "pnpm@10.17.1",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"topoloPublishedVersion": "0.
|
|
4
|
+
"version": "0.18.0",
|
|
5
|
+
"topoloPublishedVersion": "0.18.0",
|
|
6
6
|
"description": "Typed client SDK for the Topolo platform. Used by TopoloCli, TopoloMCP, and third-party agents.",
|
|
7
7
|
"license": "UNLICENSED",
|
|
8
8
|
"author": "Topolo",
|