@constal/sdk 3.1.0 → 3.2.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/package.json +1 -1
- package/publish/api.json +3 -1
- package/publish/index.d.ts +24 -2
- package/publish/index.js +165 -63
package/package.json
CHANGED
package/publish/api.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"package": "@constal/sdk",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"exports": [
|
|
5
5
|
"Action",
|
|
6
6
|
"ActionPattern",
|
|
@@ -296,6 +296,7 @@
|
|
|
296
296
|
"SetupAction",
|
|
297
297
|
"SetupCredentialCandidate",
|
|
298
298
|
"SetupCredentialInteractionPanel",
|
|
299
|
+
"SetupCredentialReceipt",
|
|
299
300
|
"SetupFormPanel",
|
|
300
301
|
"SetupPanel",
|
|
301
302
|
"SetupProgressPanel",
|
|
@@ -463,6 +464,7 @@
|
|
|
463
464
|
"scorerName",
|
|
464
465
|
"selectableResourceLabels",
|
|
465
466
|
"setupAwait",
|
|
467
|
+
"setupCredentialReceipt",
|
|
466
468
|
"setupScreen",
|
|
467
469
|
"setupScreenView",
|
|
468
470
|
"setupSubmission",
|
package/publish/index.d.ts
CHANGED
|
@@ -2495,6 +2495,26 @@ interface SetupCredentialInteractionPanel extends SetupPanelBase {
|
|
|
2495
2495
|
provider: string;
|
|
2496
2496
|
credentialId: string;
|
|
2497
2497
|
operation: "connect" | "reauthorize" | "manage";
|
|
2498
|
+
/** Opt into the generic completion contract; omission preserves existing screens. */
|
|
2499
|
+
receipt?: "reference" | "evidence";
|
|
2500
|
+
/** Reuse/save a choice through the ordinary scoped Credential binding API. */
|
|
2501
|
+
selection?: Pick<AgentCredentialSetupRequirement, "selector" | "binding">;
|
|
2502
|
+
/** Non-secret creation configuration, validated by the Credential Provider. */
|
|
2503
|
+
configuration?: Record<string, unknown>;
|
|
2504
|
+
}
|
|
2505
|
+
interface SetupCredentialReceipt {
|
|
2506
|
+
object: "constal.setup.credential";
|
|
2507
|
+
version: 1;
|
|
2508
|
+
credential: {
|
|
2509
|
+
crn: string;
|
|
2510
|
+
hash: string;
|
|
2511
|
+
};
|
|
2512
|
+
evidence: CredentialEvidence | null;
|
|
2513
|
+
binding: {
|
|
2514
|
+
crn: string;
|
|
2515
|
+
headSeq: number;
|
|
2516
|
+
revisionHash: string;
|
|
2517
|
+
} | null;
|
|
2498
2518
|
}
|
|
2499
2519
|
interface SetupReviewPanel extends SetupPanelBase {
|
|
2500
2520
|
kind: "review";
|
|
@@ -2555,6 +2575,8 @@ interface SetupSubmission {
|
|
|
2555
2575
|
declare function setupScreen(value: unknown): SetupScreen;
|
|
2556
2576
|
/** Validates one response against the exact open screen revision and form schema. */
|
|
2557
2577
|
declare function setupSubmission(value: unknown, screen: SetupScreen): SetupSubmission;
|
|
2578
|
+
/** Validate non-secret completion data. It is a snapshot, never a grant of authority. */
|
|
2579
|
+
declare function setupCredentialReceipt(value: unknown, panel: SetupCredentialInteractionPanel): SetupCredentialReceipt;
|
|
2558
2580
|
/** Await options for the exact screen. Runtime wait resolution remains the authority and replay fence. */
|
|
2559
2581
|
declare function setupAwait(screen: SetupScreen): AwaitOpts<SetupSubmission>;
|
|
2560
2582
|
/** A deterministic latest-screen projection for Console discovery and reload. */
|
|
@@ -3848,5 +3870,5 @@ declare class SessionDeleted extends Error {
|
|
|
3848
3870
|
constructor(session: string);
|
|
3849
3871
|
}
|
|
3850
3872
|
|
|
3851
|
-
export { AfterYield, ApiError, CONSTAL_API_CAPABILITY, CONSTAL_API_GET_KINDS, CONSTAL_API_MODEL_TOOL_DESCRIPTIONS, CONSTAL_API_OPERATIONS, CONSTAL_API_OPERATION_SCHEMAS, CONSTAL_API_QUERY_KINDS, CONSTAL_API_VERSION, CommitConflict, CommitGateRejected, CredentialRevoked, CredentialUnavailable, DirectNetworkDenied, EffectCeilingExceeded, GateExhausted, IntegrationRequestNotSent, LeaseLost, MCP_CLIENT_CAPABILITY, MEMORY_OPERATION_DECLARATIONS, MODEL_CHECKPOINT_IMPORT_CAPABILITY, MODEL_COMPLETION_CAPABILITY, NondeterministicReplay, OutcomeUnknown, PolicyConstraintFailed, PolicyDecisionFailed, RESOURCE_KINDS, ResourceDisabled, ResourceInvalid, ResourceUnbound, RollbackTargetInvalid, SessionDeleted, SpawnCardinality, SwallowedYield, TRAINING_PROVIDER_CAPABILITY, TerminalIntegrationFailure, ToolUnavailable, UI_BUNDLE_BOUNDS, UnknownTool, WEB_FETCH_ARGUMENT_SCHEMA, WEB_SEARCH_ARGUMENT_SCHEMA, action, actionPattern, agent, agentResourceBinding, agentSetupMetadata, agentSetupRequirements, analyticsEvent, approximateTokens, authProvider, authProviderName, bindingName, bucketFor, canonicalJson, capabilityContractRef, casTool, channel, channelIngressRequest, channelIngressSource, channelSourceEvidence, channelSubscriptionRequest, channelTarget, checkpointArtifactRef, checkpointDeploymentRequest, checkpointImportMetadata, checkpointImportRequest, codeScorerIR, credentialEvidence, credentialInteractionAction, credentialInteractionEvent, credentialInteractionResult, credentialName, credentialProvider, credentialProviderConfigSchema, credentialProviderName, credentialProviderSetupMetadata, credentialRotationDefaults, credentialSetupState, customerTenantName, cutBatches, cutPartitions, datasetName, evaluateCodeScorer, evaluatePolicyDefinition, gateway, gatewayModelOffer, gatewayPackageMetadata, hash, hashValue, integrationEgressPolicy, labelSelector, matchesAction, matchesLabelSelector, matchesResource, memoryStoreBinding, modelAdvertisedPricing, modelControls, modelGatewayBinding, modelGatewayEndpoint, modelLimit, modelPrompt, modelProtocolRequest, modelProtocolResult, murmur3_32, normalizeModelGatewayConfig, normalizeSandboxNetworkPolicy, opTool, opTools, parseResourceName, policy, policyName, renderTrainingCompletion, resolveBindingOwner, resolveGatewayEgress, resolveResourceDependencyRef, resourceContractRef, resourceCredentialBinding, resourceDependencyRef, resourceLabelMap, resourceName, resourceNeed, resourcePattern, resourceSelector, sandboxControls, sandboxLimit, scopedBindingKey, scopedCredentialRef, scopedResourceRef, scorerName, selectableResourceLabels, setupAwait, setupScreen, setupScreenView, setupSubmission, sha256Hex, stageOutput, startTrainingRequest, subtask, tableDescribe, tableQuery, trainingProvider, trainingProviderMetadata, trainingRecipe, uiBundle, uiBundleManifest, uiLimit, uiName, validateBatchSpec, validateFoldFn, validateJsonSchema, validateJsonSchemaDefinition, validatePartitionFn, validatePartitionSpec, validateStageOutputSpec, validateTool, validateView, webFetch, webSearch };
|
|
3852
|
-
export type { Action, ActionPattern, Actor, AdmissionLimitConstraint, AdmissionLimitInput, AdmissionLimitScope, AdmissionLimitWindow, Agent, AgentCredentialSetupRequirement, AgentDef, AgentDeployPolicy, AgentSetupMetadata, AgentSetupRequirement, AgentSetupWorkflow, AnalyticsClient, AnalyticsDimensionValue, AnalyticsEventDefinition, AnalyticsIntent, AnalyticsValues, AuthProvider, AuthProviderCRN, AuthProviderContext, AuthProviderRequest, AuthProviderResult, AwaitOpts, AwaitPresentation, BatchSpec, BindingCRN, BindingOwnerContext, BindingOwnerScope, BranchRef, CRN, CRNKind, CanonicalEvent, CanonicalEventDraft, CapabilityContractRef, CapabilityGrant, CapabilityRef, CaptureCaseRequest, CaseRow, CatalogTool, Channel, ChannelAlarm, ChannelAlarmResult, ChannelContext, ChannelIngressEvent, ChannelIngressSource, ChannelMessage, ChannelProtocol, ChannelReceiveResult, ChannelRequest, ChannelResponse, ChannelSourceEvidence, ChannelSubscriptionRequest, ChannelTarget, CheckpointDeploymentRequest, CheckpointImportMetadata, CheckpointImportRequest, CodeScoreResult, CodeScorerIR, CodeScorerRule, CommitOpts, CompareSuitesRequest, Compensation, ConnectionCancelRequest, ConnectionIdentity, ConnectionOperation, ConnectionRecoveryRequest, ConnectionRecoveryResult, ConnectionRequest, ConnectionUsageReport, ConstalApiApplyRequest, ConstalApiChangePlan, ConstalApiChangePlanRef, ConstalApiChangePlanRequest, ConstalApiChangeReceipt, ConstalApiOperationReceipt, ControlEvent, Cost, CreateSandboxImageOptions, CreateSandboxOptions, CredentialCRN, CredentialDestroyResult, CredentialEvidence, CredentialInteractionAction, CredentialInteractionAdvanceRequest, CredentialInteractionEvent, CredentialInteractionPrimaryAction, CredentialInteractionProof, CredentialInteractionResult, CredentialInteractionStartRequest, CredentialMaterialRequest, CredentialMintRequest, CredentialMintResult, CredentialProviderCRN, CredentialProviderContext, CredentialProviderCredentialSlotSetup, CredentialProviderDefinition, CredentialProviderPackage, CredentialProviderPackageMetadata, CredentialProviderSecretInput, CredentialProviderSetupMetadata, CredentialSetupState, CredentialVerifyResult, Ctx, CustomerTenantCRN, DataManifest, DatasetCRN, DatasetDraft, DatasetRef, DelegatedGrant, DelegationCeiling, DeliveryMode, DeliveryReceipt, DispatchResult, EffectClass, EvalComparison, EvalDivergence, EvalMode, EvalSubject, EvalSubjectSource, EventBase, Fact, FactRef, FileEntry, FixedMemoryStoreRef, FixedModelGatewayRef, FoldFn, GateEvidence, GateResult, GateVerdict, GatewayCancelRequest, GatewayConfigEgressBinding, GatewayContext, GatewayCredentialSlotSetup, GatewayDefinition, GatewayDiscoverySetup, GatewayModelOffer, GatewayOperation, GatewayPackage, GatewayPackageMetadata, GatewayRecoveryRequest, GatewayRecoveryResult, GatewayRequest, GovernanceContractRef, Handle, HandleOutcome, Hash, HistoryView, IgnoredChannelEvent, IngressRequest, IngressTarget, IntegrationArtifactEgressRequest, IntegrationArtifactEgressResponse, IntegrationContext, IntegrationEgressPolicy, IntegrationEgressRequest, IntegrationEgressResponse, IntegrationEgressRule, IntegrationSecret, IntegrationState, InvokableKind, InvokeOpts, JsonScalar, JsonValue, LabelRequest, LabelSelector, LabelSelectorOperator, LabelSelectorRequirement, LedgerAddress, LedgerEvent, LocalResourceRef, ManifestIndexPage, MapFact, MapOpts, MemoryDeleteArgs, MemoryGetArgs, MemoryRecord, MemoryRememberArgs, MemorySearchArgs, MemorySearchHit, MemoryStoreBinding, Mode, ModelAdvertisedPricing, ModelCredentialHeader, ModelGatewayBinding, ModelGatewayConfig, ModelGatewayProtocol, ModelGovernanceControls, ModelGovernanceMeter, ModelInvocationArgs, ModelInvocationResult, ModelTechnicalCapabilities, ModelTool, NormalizedModelGatewayConfig, Out, Over, PartitionFn, PartitionSpec, Partitioning, PolicyCRN, PolicyConstraint, PolicyContextValue, PolicyDefinition, PolicyInput, PolicyInvocationOrigin, PolicyOutcome, Principal, PrincipalKind, Provenance, RawModelProtocol, Recovery, ReduceFact, ReduceOpts, Ref, RequestLabelRequest, ResourceContractRef, ResourceControlsConstraint, ResourceCredentialBinding, ResourceDependencyRef, ResourceKind, ResourceName, ResourceNameParts, ResourceNeed, ResourcePattern, ResourceSelector, RollbackReport, RunIdentityView, RunInfo, RunStatusDetail, RunSuiteRequest, Sandbox, SandboxCommandResult, SandboxExecInput, SandboxFileResult, SandboxGovernanceControls, SandboxGovernanceMeter, SandboxImage, SandboxMutationResult, SandboxNetworkMode, SandboxNetworkPolicy, SandboxPool, SandboxReadFileOptions, SandboxReadFileResult, SandboxWriteFileResult, ScopedBindingKey, ScopedCredentialRef, ScopedMemoryStoreRef, ScopedModelGatewayRef, ScopedResourceRef, ScoreRequest, ScorerApplies, ScorerCRN, ScorerDef, ScorerEvaluation, ScorerKind, ScorerRef, ScorerVerdictIntent, SetEvalBaselineRequest, SetupAction, SetupCredentialCandidate, SetupCredentialInteractionPanel, SetupFormPanel, SetupPanel, SetupProgressPanel, SetupReviewPanel, SetupScreen, SetupStepStatus, SetupStepSummary, SetupSubmission, SetupTerminalPanel, SetupWorkflowStatus, SortField, SpawnAttenuation, SpawnBudget, SpawnOpts, SqlFold, StageInfo, StageOutputSpec, StartTrainingRequest, SteerEvent, SuiteFact, TableAggregate, TableDescribeArgs, TableFilter, TableFilterOperation, TableOrder, TableQueryArgs, TableQueryPlan, TableQueryResult, TableScalar, TableSnapshotDescription, Task, Tier, Tool, ToolCallRecord, TrainingJobFact, TrainingJobReference, TrainingJobState, TrainingJobStatus, TrainingMethod, TrainingModelOffer, TrainingProviderDefinition, TrainingProviderMetadata, TrainingProviderPin, TrainingRecipe, TrainingResumePoint, TrainingUsageUnits, TurnDraft, TurnGate, TurnRecord, TurnSpec, UiAccess, UiBundle, UiBundleManifest, UiCRN, UiCapability, UiExecution, UiGovernanceMeter, UiHandler, UiResource, UiRuntimeContext, UiSource, UiSqlResult, UiState, UpstreamPayer, Verdict, VerdictSamplingMode, ViewDef, WaitResolvedEvent };
|
|
3873
|
+
export { AfterYield, ApiError, CONSTAL_API_CAPABILITY, CONSTAL_API_GET_KINDS, CONSTAL_API_MODEL_TOOL_DESCRIPTIONS, CONSTAL_API_OPERATIONS, CONSTAL_API_OPERATION_SCHEMAS, CONSTAL_API_QUERY_KINDS, CONSTAL_API_VERSION, CommitConflict, CommitGateRejected, CredentialRevoked, CredentialUnavailable, DirectNetworkDenied, EffectCeilingExceeded, GateExhausted, IntegrationRequestNotSent, LeaseLost, MCP_CLIENT_CAPABILITY, MEMORY_OPERATION_DECLARATIONS, MODEL_CHECKPOINT_IMPORT_CAPABILITY, MODEL_COMPLETION_CAPABILITY, NondeterministicReplay, OutcomeUnknown, PolicyConstraintFailed, PolicyDecisionFailed, RESOURCE_KINDS, ResourceDisabled, ResourceInvalid, ResourceUnbound, RollbackTargetInvalid, SessionDeleted, SpawnCardinality, SwallowedYield, TRAINING_PROVIDER_CAPABILITY, TerminalIntegrationFailure, ToolUnavailable, UI_BUNDLE_BOUNDS, UnknownTool, WEB_FETCH_ARGUMENT_SCHEMA, WEB_SEARCH_ARGUMENT_SCHEMA, action, actionPattern, agent, agentResourceBinding, agentSetupMetadata, agentSetupRequirements, analyticsEvent, approximateTokens, authProvider, authProviderName, bindingName, bucketFor, canonicalJson, capabilityContractRef, casTool, channel, channelIngressRequest, channelIngressSource, channelSourceEvidence, channelSubscriptionRequest, channelTarget, checkpointArtifactRef, checkpointDeploymentRequest, checkpointImportMetadata, checkpointImportRequest, codeScorerIR, credentialEvidence, credentialInteractionAction, credentialInteractionEvent, credentialInteractionResult, credentialName, credentialProvider, credentialProviderConfigSchema, credentialProviderName, credentialProviderSetupMetadata, credentialRotationDefaults, credentialSetupState, customerTenantName, cutBatches, cutPartitions, datasetName, evaluateCodeScorer, evaluatePolicyDefinition, gateway, gatewayModelOffer, gatewayPackageMetadata, hash, hashValue, integrationEgressPolicy, labelSelector, matchesAction, matchesLabelSelector, matchesResource, memoryStoreBinding, modelAdvertisedPricing, modelControls, modelGatewayBinding, modelGatewayEndpoint, modelLimit, modelPrompt, modelProtocolRequest, modelProtocolResult, murmur3_32, normalizeModelGatewayConfig, normalizeSandboxNetworkPolicy, opTool, opTools, parseResourceName, policy, policyName, renderTrainingCompletion, resolveBindingOwner, resolveGatewayEgress, resolveResourceDependencyRef, resourceContractRef, resourceCredentialBinding, resourceDependencyRef, resourceLabelMap, resourceName, resourceNeed, resourcePattern, resourceSelector, sandboxControls, sandboxLimit, scopedBindingKey, scopedCredentialRef, scopedResourceRef, scorerName, selectableResourceLabels, setupAwait, setupCredentialReceipt, setupScreen, setupScreenView, setupSubmission, sha256Hex, stageOutput, startTrainingRequest, subtask, tableDescribe, tableQuery, trainingProvider, trainingProviderMetadata, trainingRecipe, uiBundle, uiBundleManifest, uiLimit, uiName, validateBatchSpec, validateFoldFn, validateJsonSchema, validateJsonSchemaDefinition, validatePartitionFn, validatePartitionSpec, validateStageOutputSpec, validateTool, validateView, webFetch, webSearch };
|
|
3874
|
+
export type { Action, ActionPattern, Actor, AdmissionLimitConstraint, AdmissionLimitInput, AdmissionLimitScope, AdmissionLimitWindow, Agent, AgentCredentialSetupRequirement, AgentDef, AgentDeployPolicy, AgentSetupMetadata, AgentSetupRequirement, AgentSetupWorkflow, AnalyticsClient, AnalyticsDimensionValue, AnalyticsEventDefinition, AnalyticsIntent, AnalyticsValues, AuthProvider, AuthProviderCRN, AuthProviderContext, AuthProviderRequest, AuthProviderResult, AwaitOpts, AwaitPresentation, BatchSpec, BindingCRN, BindingOwnerContext, BindingOwnerScope, BranchRef, CRN, CRNKind, CanonicalEvent, CanonicalEventDraft, CapabilityContractRef, CapabilityGrant, CapabilityRef, CaptureCaseRequest, CaseRow, CatalogTool, Channel, ChannelAlarm, ChannelAlarmResult, ChannelContext, ChannelIngressEvent, ChannelIngressSource, ChannelMessage, ChannelProtocol, ChannelReceiveResult, ChannelRequest, ChannelResponse, ChannelSourceEvidence, ChannelSubscriptionRequest, ChannelTarget, CheckpointDeploymentRequest, CheckpointImportMetadata, CheckpointImportRequest, CodeScoreResult, CodeScorerIR, CodeScorerRule, CommitOpts, CompareSuitesRequest, Compensation, ConnectionCancelRequest, ConnectionIdentity, ConnectionOperation, ConnectionRecoveryRequest, ConnectionRecoveryResult, ConnectionRequest, ConnectionUsageReport, ConstalApiApplyRequest, ConstalApiChangePlan, ConstalApiChangePlanRef, ConstalApiChangePlanRequest, ConstalApiChangeReceipt, ConstalApiOperationReceipt, ControlEvent, Cost, CreateSandboxImageOptions, CreateSandboxOptions, CredentialCRN, CredentialDestroyResult, CredentialEvidence, CredentialInteractionAction, CredentialInteractionAdvanceRequest, CredentialInteractionEvent, CredentialInteractionPrimaryAction, CredentialInteractionProof, CredentialInteractionResult, CredentialInteractionStartRequest, CredentialMaterialRequest, CredentialMintRequest, CredentialMintResult, CredentialProviderCRN, CredentialProviderContext, CredentialProviderCredentialSlotSetup, CredentialProviderDefinition, CredentialProviderPackage, CredentialProviderPackageMetadata, CredentialProviderSecretInput, CredentialProviderSetupMetadata, CredentialSetupState, CredentialVerifyResult, Ctx, CustomerTenantCRN, DataManifest, DatasetCRN, DatasetDraft, DatasetRef, DelegatedGrant, DelegationCeiling, DeliveryMode, DeliveryReceipt, DispatchResult, EffectClass, EvalComparison, EvalDivergence, EvalMode, EvalSubject, EvalSubjectSource, EventBase, Fact, FactRef, FileEntry, FixedMemoryStoreRef, FixedModelGatewayRef, FoldFn, GateEvidence, GateResult, GateVerdict, GatewayCancelRequest, GatewayConfigEgressBinding, GatewayContext, GatewayCredentialSlotSetup, GatewayDefinition, GatewayDiscoverySetup, GatewayModelOffer, GatewayOperation, GatewayPackage, GatewayPackageMetadata, GatewayRecoveryRequest, GatewayRecoveryResult, GatewayRequest, GovernanceContractRef, Handle, HandleOutcome, Hash, HistoryView, IgnoredChannelEvent, IngressRequest, IngressTarget, IntegrationArtifactEgressRequest, IntegrationArtifactEgressResponse, IntegrationContext, IntegrationEgressPolicy, IntegrationEgressRequest, IntegrationEgressResponse, IntegrationEgressRule, IntegrationSecret, IntegrationState, InvokableKind, InvokeOpts, JsonScalar, JsonValue, LabelRequest, LabelSelector, LabelSelectorOperator, LabelSelectorRequirement, LedgerAddress, LedgerEvent, LocalResourceRef, ManifestIndexPage, MapFact, MapOpts, MemoryDeleteArgs, MemoryGetArgs, MemoryRecord, MemoryRememberArgs, MemorySearchArgs, MemorySearchHit, MemoryStoreBinding, Mode, ModelAdvertisedPricing, ModelCredentialHeader, ModelGatewayBinding, ModelGatewayConfig, ModelGatewayProtocol, ModelGovernanceControls, ModelGovernanceMeter, ModelInvocationArgs, ModelInvocationResult, ModelTechnicalCapabilities, ModelTool, NormalizedModelGatewayConfig, Out, Over, PartitionFn, PartitionSpec, Partitioning, PolicyCRN, PolicyConstraint, PolicyContextValue, PolicyDefinition, PolicyInput, PolicyInvocationOrigin, PolicyOutcome, Principal, PrincipalKind, Provenance, RawModelProtocol, Recovery, ReduceFact, ReduceOpts, Ref, RequestLabelRequest, ResourceContractRef, ResourceControlsConstraint, ResourceCredentialBinding, ResourceDependencyRef, ResourceKind, ResourceName, ResourceNameParts, ResourceNeed, ResourcePattern, ResourceSelector, RollbackReport, RunIdentityView, RunInfo, RunStatusDetail, RunSuiteRequest, Sandbox, SandboxCommandResult, SandboxExecInput, SandboxFileResult, SandboxGovernanceControls, SandboxGovernanceMeter, SandboxImage, SandboxMutationResult, SandboxNetworkMode, SandboxNetworkPolicy, SandboxPool, SandboxReadFileOptions, SandboxReadFileResult, SandboxWriteFileResult, ScopedBindingKey, ScopedCredentialRef, ScopedMemoryStoreRef, ScopedModelGatewayRef, ScopedResourceRef, ScoreRequest, ScorerApplies, ScorerCRN, ScorerDef, ScorerEvaluation, ScorerKind, ScorerRef, ScorerVerdictIntent, SetEvalBaselineRequest, SetupAction, SetupCredentialCandidate, SetupCredentialInteractionPanel, SetupCredentialReceipt, SetupFormPanel, SetupPanel, SetupProgressPanel, SetupReviewPanel, SetupScreen, SetupStepStatus, SetupStepSummary, SetupSubmission, SetupTerminalPanel, SetupWorkflowStatus, SortField, SpawnAttenuation, SpawnBudget, SpawnOpts, SqlFold, StageInfo, StageOutputSpec, StartTrainingRequest, SteerEvent, SuiteFact, TableAggregate, TableDescribeArgs, TableFilter, TableFilterOperation, TableOrder, TableQueryArgs, TableQueryPlan, TableQueryResult, TableScalar, TableSnapshotDescription, Task, Tier, Tool, ToolCallRecord, TrainingJobFact, TrainingJobReference, TrainingJobState, TrainingJobStatus, TrainingMethod, TrainingModelOffer, TrainingProviderDefinition, TrainingProviderMetadata, TrainingProviderPin, TrainingRecipe, TrainingResumePoint, TrainingUsageUnits, TurnDraft, TurnGate, TurnRecord, TurnSpec, UiAccess, UiBundle, UiBundleManifest, UiCRN, UiCapability, UiExecution, UiGovernanceMeter, UiHandler, UiResource, UiRuntimeContext, UiSource, UiSqlResult, UiState, UpstreamPayer, Verdict, VerdictSamplingMode, ViewDef, WaitResolvedEvent };
|
package/publish/index.js
CHANGED
|
@@ -1118,9 +1118,67 @@ function uiBundle(value, execution) {
|
|
|
1118
1118
|
return { manifest, modules: normalizedModules, assets: normalizedAssets };
|
|
1119
1119
|
}
|
|
1120
1120
|
|
|
1121
|
+
// src/ingress.ts
|
|
1122
|
+
var encoder3 = new TextEncoder();
|
|
1123
|
+
function object2(value) {
|
|
1124
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
1125
|
+
}
|
|
1126
|
+
function channelSourceEvidence(value) {
|
|
1127
|
+
const input = object2(value), channel2 = object2(input?.channel), authProvider2 = object2(input?.authProvider);
|
|
1128
|
+
if (!input || !channel2 || !authProvider2 || typeof authProvider2.crn !== "string" || typeof authProvider2.hash !== "string" || !/^[a-f0-9]{64}$/u.test(authProvider2.hash) || typeof channel2.crn !== "string" || typeof channel2.hash !== "string" || !/^[a-f0-9]{64}$/u.test(channel2.hash) || typeof input.id !== "string" || !/^[A-Za-z0-9][A-Za-z0-9._:-]{0,255}$/u.test(input.id) || typeof input.requestHash !== "string" || !/^[a-f0-9]{64}$/u.test(input.requestHash)) throw new TypeError("Channel source evidence is invalid");
|
|
1129
|
+
const source = channelIngressSource(input.source), name = parseResourceName(channel2.crn), authentication = parseResourceName(authProvider2.crn);
|
|
1130
|
+
if (name.kind !== "channel" || name.tenant !== "platform" || name.namespace !== "ingress" || name.path !== source.provider || authentication.kind !== "auth-provider" || authentication.environment !== name.environment || authentication.tenant !== name.tenant || authentication.namespace !== name.namespace) {
|
|
1131
|
+
throw new TypeError("Channel source evidence is outside its source");
|
|
1132
|
+
}
|
|
1133
|
+
return { channel: { crn: channel2.crn, hash: channel2.hash }, authProvider: { crn: authProvider2.crn, hash: authProvider2.hash }, source, id: input.id, requestHash: input.requestHash };
|
|
1134
|
+
}
|
|
1135
|
+
function credentialEvidence(value) {
|
|
1136
|
+
const input = object2(value), provider = object2(input?.provider), claims = object2(input?.claims);
|
|
1137
|
+
if (!input || typeof input.credential !== "string" || !provider || typeof provider.crn !== "string" || typeof provider.hash !== "string" || !/^[a-f0-9]{64}$/u.test(provider.hash) || !Number.isSafeInteger(input.version) || Number(input.version) < 1 || input.expiresAt !== null && (!Number.isSafeInteger(input.expiresAt) || Number(input.expiresAt) < 1) || !claims || Object.keys(claims).length > 32 || encoder3.encode(JSON.stringify(claims)).byteLength > 65536 || Object.entries(claims).some(([key, value2]) => !/^[A-Za-z0-9._-]{1,128}$/u.test(key) || !(typeof value2 === "string" && value2.length <= 2048 || typeof value2 === "boolean" || typeof value2 === "number" && Number.isFinite(value2) || Array.isArray(value2) && value2.length <= 500 && value2.every((item) => typeof item === "string" && item.length <= 256)))) {
|
|
1138
|
+
throw new TypeError("Credential evidence is invalid");
|
|
1139
|
+
}
|
|
1140
|
+
if (parseResourceName(input.credential).kind !== "credential" || parseResourceName(provider.crn).kind !== "credential-provider") {
|
|
1141
|
+
throw new TypeError("Credential evidence identity is invalid");
|
|
1142
|
+
}
|
|
1143
|
+
return {
|
|
1144
|
+
credential: input.credential,
|
|
1145
|
+
provider: { crn: provider.crn, hash: provider.hash },
|
|
1146
|
+
version: Number(input.version),
|
|
1147
|
+
expiresAt: input.expiresAt,
|
|
1148
|
+
claims
|
|
1149
|
+
};
|
|
1150
|
+
}
|
|
1151
|
+
function channelIngressSource(value) {
|
|
1152
|
+
const source = object2(value);
|
|
1153
|
+
if (!source || typeof source.provider !== "string" || !/^[a-z0-9][a-z0-9._-]{0,63}$/u.test(source.provider) || typeof source.key !== "string" || !/^[A-Za-z0-9._:-]{1,256}$/u.test(source.key)) throw new TypeError("Channel ingress source is invalid");
|
|
1154
|
+
return { provider: source.provider, key: source.key };
|
|
1155
|
+
}
|
|
1156
|
+
function channelSubscriptionRequest(value) {
|
|
1157
|
+
const input = object2(value), configuration = object2(input?.configuration);
|
|
1158
|
+
if (!input || !configuration || typeof input.channel !== "string" || typeof input.principal !== "string") throw new TypeError("Channel subscription is invalid");
|
|
1159
|
+
const channel2 = parseResourceName(input.channel), principal = parseResourceName(input.principal);
|
|
1160
|
+
if (channel2.kind !== "channel" || principal.kind !== "principal" || channel2.environment !== principal.environment || channel2.tenant !== principal.tenant) {
|
|
1161
|
+
throw new TypeError("Channel subscription crosses the authenticated tenant");
|
|
1162
|
+
}
|
|
1163
|
+
const credentials = input.credentials ?? [];
|
|
1164
|
+
if (!Array.isArray(credentials) || credentials.length > 32) throw new TypeError("Channel subscription Credentials are invalid");
|
|
1165
|
+
const proofs = credentials.map(credentialEvidence);
|
|
1166
|
+
for (const proof of proofs) {
|
|
1167
|
+
const owner = parseResourceName(proof.credential), provider = parseResourceName(proof.provider.crn);
|
|
1168
|
+
if (owner.tenant !== channel2.tenant || owner.environment !== channel2.environment || provider.environment !== channel2.environment) {
|
|
1169
|
+
throw new TypeError("Channel subscription Credential crosses the authenticated tenant");
|
|
1170
|
+
}
|
|
1171
|
+
}
|
|
1172
|
+
return { source: channelIngressSource(input.source), channel: input.channel, principal: input.principal, configuration, credentials: proofs };
|
|
1173
|
+
}
|
|
1174
|
+
function channelIngressRequest(value) {
|
|
1175
|
+
const input = object2(value), headers = object2(input?.headers);
|
|
1176
|
+
if (!input || !["GET", "POST", "PUT", "PATCH", "DELETE"].includes(String(input.method)) || typeof input.url !== "string" || !input.url || input.url.length > 2048 || !headers || Object.keys(headers).length > 128 || Object.entries(headers).some(([key, value2]) => !/^[a-z0-9-]{1,128}$/u.test(key) || typeof value2 !== "string" || value2.length > 8192) || input.bodyBase64 !== null && (typeof input.bodyBase64 !== "string" || input.bodyBase64.length > 5592408) || encoder3.encode(JSON.stringify(input)).byteLength > 6 * 1024 * 1024) throw new TypeError("Channel ingress request is invalid");
|
|
1177
|
+
return { method: input.method, url: input.url, headers, bodyBase64: input.bodyBase64 };
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1121
1180
|
// src/setup-workflow.ts
|
|
1122
1181
|
var ID = /^[a-z0-9][a-z0-9-]{0,62}$/u;
|
|
1123
|
-
var CRN = /^crn:constal:[a-z0-9-]+:[a-z0-9-]+:[a-z0-9-]+:credential-provider\/[A-Za-z0-9._~/%-]{1,512}$/u;
|
|
1124
1182
|
var MAX_SCREEN_BYTES = 262144;
|
|
1125
1183
|
function record3(value) {
|
|
1126
1184
|
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
@@ -1165,13 +1223,38 @@ function panel(value) {
|
|
|
1165
1223
|
if (source.kind === "credential-interaction") {
|
|
1166
1224
|
const provider = text(source.provider, 1024);
|
|
1167
1225
|
const credentialId = text(source.credentialId, 63);
|
|
1168
|
-
if (!provider || !
|
|
1226
|
+
if (!provider || !credentialId || !ID.test(credentialId) || !["connect", "reauthorize", "manage"].includes(String(source.operation)) || source.receipt !== void 0 && !["reference", "evidence"].includes(String(source.receipt)) || source.receipt !== void 0 && base.actions.filter((action3) => action3.intent === "primary").length !== 1 || (source.selection !== void 0 || source.configuration !== void 0) && source.receipt === void 0 || source.configuration !== void 0 && !record3(source.configuration) || !exact(source, ["kind", "id", "title", "description", "actions", "provider", "credentialId", "operation", "receipt", "selection", "configuration"])) return null;
|
|
1227
|
+
try {
|
|
1228
|
+
if (parseResourceName(provider).kind !== "credential-provider") return null;
|
|
1229
|
+
} catch {
|
|
1230
|
+
return null;
|
|
1231
|
+
}
|
|
1232
|
+
let selection;
|
|
1233
|
+
if (source.selection !== void 0) {
|
|
1234
|
+
const input = record3(source.selection);
|
|
1235
|
+
if (!input || !exact(input, ["selector", "binding"]) || !record3(input.selector)) return null;
|
|
1236
|
+
try {
|
|
1237
|
+
const requirement = agentSetupRequirements([{
|
|
1238
|
+
id: base.id,
|
|
1239
|
+
title: base.title,
|
|
1240
|
+
resourceKind: "credential",
|
|
1241
|
+
selector: input.selector,
|
|
1242
|
+
binding: input.binding
|
|
1243
|
+
}])[0];
|
|
1244
|
+
selection = { selector: requirement.selector, binding: requirement.binding };
|
|
1245
|
+
} catch {
|
|
1246
|
+
return null;
|
|
1247
|
+
}
|
|
1248
|
+
}
|
|
1169
1249
|
return {
|
|
1170
1250
|
...base,
|
|
1171
1251
|
kind: "credential-interaction",
|
|
1172
1252
|
provider,
|
|
1173
1253
|
credentialId,
|
|
1174
|
-
operation: source.operation
|
|
1254
|
+
operation: source.operation,
|
|
1255
|
+
...source.receipt === void 0 ? {} : { receipt: source.receipt },
|
|
1256
|
+
...selection ? { selection } : {},
|
|
1257
|
+
...source.configuration === void 0 ? {} : { configuration: source.configuration }
|
|
1175
1258
|
};
|
|
1176
1259
|
}
|
|
1177
1260
|
if (source.kind === "review") {
|
|
@@ -1264,6 +1347,9 @@ function setupSubmission(value, screen) {
|
|
|
1264
1347
|
const error = validateJsonSchema(values ?? {}, screen.current.schema, "$setup.submission.values");
|
|
1265
1348
|
if (error) throw new TypeError(error);
|
|
1266
1349
|
}
|
|
1350
|
+
if (screen.current.kind === "credential-interaction" && screen.current.receipt !== void 0 && source.action === screen.current.actions.find(({ intent }) => intent === "primary")?.id) {
|
|
1351
|
+
setupCredentialReceipt(values, screen.current);
|
|
1352
|
+
}
|
|
1267
1353
|
return {
|
|
1268
1354
|
object: "constal.setup.submission",
|
|
1269
1355
|
version: 1,
|
|
@@ -1274,8 +1360,78 @@ function setupSubmission(value, screen) {
|
|
|
1274
1360
|
...values ? { values } : {}
|
|
1275
1361
|
};
|
|
1276
1362
|
}
|
|
1363
|
+
function setupCredentialReceipt(value, panel2) {
|
|
1364
|
+
const source = record3(value), credential = record3(source?.credential), binding = record3(source?.binding);
|
|
1365
|
+
const hash3 = (value2) => typeof value2 === "string" && /^[a-f0-9]{64}$/u.test(value2);
|
|
1366
|
+
if (!panel2.receipt || !source || source.object !== "constal.setup.credential" || source.version !== 1 || !exact(source, ["object", "version", "credential", "evidence", "binding"]) || !credential || !exact(credential, ["crn", "hash"]) || typeof credential.crn !== "string" || !hash3(credential.hash)) {
|
|
1367
|
+
throw new TypeError("Setup Credential receipt is invalid");
|
|
1368
|
+
}
|
|
1369
|
+
const target = parseResourceName(credential.crn), provider = parseResourceName(panel2.provider);
|
|
1370
|
+
if (target.kind !== "credential" || target.environment !== provider.environment || provider.tenant !== "platform" && provider.tenant !== target.tenant) throw new TypeError("Setup Credential receipt identity is invalid");
|
|
1371
|
+
const evidence = source.evidence === null ? null : credentialEvidence(source.evidence);
|
|
1372
|
+
if (panel2.receipt === "evidence" && !evidence || panel2.receipt === "reference" && evidence || evidence && (evidence.credential !== credential.crn || evidence.provider.crn !== panel2.provider)) {
|
|
1373
|
+
throw new TypeError("Setup Credential evidence does not match its step");
|
|
1374
|
+
}
|
|
1375
|
+
if (panel2.selection) {
|
|
1376
|
+
if (!binding || !exact(binding, ["crn", "headSeq", "revisionHash"]) || typeof binding.crn !== "string" || !Number.isSafeInteger(binding.headSeq) || Number(binding.headSeq) < 1 || !hash3(binding.revisionHash)) {
|
|
1377
|
+
throw new TypeError("Setup Credential binding receipt is invalid");
|
|
1378
|
+
}
|
|
1379
|
+
const owner = parseResourceName(binding.crn);
|
|
1380
|
+
if (owner.kind !== "binding" || owner.tenant !== target.tenant || owner.environment !== target.environment) {
|
|
1381
|
+
throw new TypeError("Setup Credential binding receipt is outside its tenant");
|
|
1382
|
+
}
|
|
1383
|
+
} else if (source.binding !== null) throw new TypeError("Setup Credential step did not declare a binding");
|
|
1384
|
+
return {
|
|
1385
|
+
object: "constal.setup.credential",
|
|
1386
|
+
version: 1,
|
|
1387
|
+
credential: { crn: credential.crn, hash: credential.hash },
|
|
1388
|
+
evidence,
|
|
1389
|
+
binding: binding ? { crn: binding.crn, headSeq: Number(binding.headSeq), revisionHash: binding.revisionHash } : null
|
|
1390
|
+
};
|
|
1391
|
+
}
|
|
1277
1392
|
function setupAwait(screen) {
|
|
1278
1393
|
if (screen.status !== "active" || !screen.waitLabel) throw new TypeError("Only an active Setup screen can open a wait");
|
|
1394
|
+
const current = screen.current;
|
|
1395
|
+
const hash3 = { type: "string", pattern: "^[a-f0-9]{64}$" };
|
|
1396
|
+
const reference = {
|
|
1397
|
+
type: "object",
|
|
1398
|
+
additionalProperties: false,
|
|
1399
|
+
required: ["crn", "hash"],
|
|
1400
|
+
properties: { crn: { type: "string", maxLength: 1024 }, hash: hash3 }
|
|
1401
|
+
};
|
|
1402
|
+
const receipt = current.kind === "credential-interaction" && current.receipt !== void 0 ? {
|
|
1403
|
+
type: "object",
|
|
1404
|
+
additionalProperties: false,
|
|
1405
|
+
required: ["object", "version", "credential", "evidence", "binding"],
|
|
1406
|
+
properties: {
|
|
1407
|
+
object: { const: "constal.setup.credential" },
|
|
1408
|
+
version: { const: 1 },
|
|
1409
|
+
credential: reference,
|
|
1410
|
+
evidence: current.receipt === "reference" ? { type: "null" } : {
|
|
1411
|
+
type: "object",
|
|
1412
|
+
additionalProperties: false,
|
|
1413
|
+
required: ["credential", "provider", "version", "expiresAt", "claims"],
|
|
1414
|
+
properties: {
|
|
1415
|
+
credential: { type: "string", maxLength: 1024 },
|
|
1416
|
+
provider: {
|
|
1417
|
+
...reference,
|
|
1418
|
+
properties: { crn: { const: current.provider }, hash: hash3 }
|
|
1419
|
+
},
|
|
1420
|
+
version: { type: "integer", minimum: 1 },
|
|
1421
|
+
expiresAt: { type: ["integer", "null"], minimum: 1 },
|
|
1422
|
+
claims: { type: "object", maxProperties: 32 }
|
|
1423
|
+
}
|
|
1424
|
+
},
|
|
1425
|
+
binding: current.selection ? {
|
|
1426
|
+
type: "object",
|
|
1427
|
+
additionalProperties: false,
|
|
1428
|
+
required: ["crn", "headSeq", "revisionHash"],
|
|
1429
|
+
properties: { crn: { type: "string", maxLength: 1024 }, headSeq: { type: "integer", minimum: 1 }, revisionHash: hash3 }
|
|
1430
|
+
} : { type: "null" }
|
|
1431
|
+
}
|
|
1432
|
+
} : null;
|
|
1433
|
+
const primary = current.actions.find((action3) => action3.intent === "primary");
|
|
1434
|
+
const secondary = current.actions.filter((action3) => action3.id !== primary?.id).map((action3) => action3.id);
|
|
1279
1435
|
return { maxBytes: 262144, schema: {
|
|
1280
1436
|
type: "object",
|
|
1281
1437
|
additionalProperties: false,
|
|
@@ -1288,7 +1444,11 @@ function setupAwait(screen) {
|
|
|
1288
1444
|
step: { const: screen.current.id },
|
|
1289
1445
|
action: { enum: screen.current.actions.map(({ id: id2 }) => id2) },
|
|
1290
1446
|
values: { type: "object", additionalProperties: true }
|
|
1291
|
-
}
|
|
1447
|
+
},
|
|
1448
|
+
...receipt && primary ? { anyOf: [
|
|
1449
|
+
{ required: ["values"], properties: { action: { const: primary.id }, values: receipt } },
|
|
1450
|
+
...secondary.length ? [{ properties: { action: { enum: secondary } } }] : []
|
|
1451
|
+
] } : {}
|
|
1292
1452
|
} };
|
|
1293
1453
|
}
|
|
1294
1454
|
function setupScreenView(id2 = "setup-screen") {
|
|
@@ -1349,65 +1509,6 @@ function credentialSetupState(requirement, scope2, inventory, binding) {
|
|
|
1349
1509
|
};
|
|
1350
1510
|
}
|
|
1351
1511
|
|
|
1352
|
-
// src/ingress.ts
|
|
1353
|
-
var encoder3 = new TextEncoder();
|
|
1354
|
-
function object2(value) {
|
|
1355
|
-
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
1356
|
-
}
|
|
1357
|
-
function channelSourceEvidence(value) {
|
|
1358
|
-
const input = object2(value), channel2 = object2(input?.channel), authProvider2 = object2(input?.authProvider);
|
|
1359
|
-
if (!input || !channel2 || !authProvider2 || typeof authProvider2.crn !== "string" || typeof authProvider2.hash !== "string" || !/^[a-f0-9]{64}$/u.test(authProvider2.hash) || typeof channel2.crn !== "string" || typeof channel2.hash !== "string" || !/^[a-f0-9]{64}$/u.test(channel2.hash) || typeof input.id !== "string" || !/^[A-Za-z0-9][A-Za-z0-9._:-]{0,255}$/u.test(input.id) || typeof input.requestHash !== "string" || !/^[a-f0-9]{64}$/u.test(input.requestHash)) throw new TypeError("Channel source evidence is invalid");
|
|
1360
|
-
const source = channelIngressSource(input.source), name = parseResourceName(channel2.crn), authentication = parseResourceName(authProvider2.crn);
|
|
1361
|
-
if (name.kind !== "channel" || name.tenant !== "platform" || name.namespace !== "ingress" || name.path !== source.provider || authentication.kind !== "auth-provider" || authentication.environment !== name.environment || authentication.tenant !== name.tenant || authentication.namespace !== name.namespace) {
|
|
1362
|
-
throw new TypeError("Channel source evidence is outside its source");
|
|
1363
|
-
}
|
|
1364
|
-
return { channel: { crn: channel2.crn, hash: channel2.hash }, authProvider: { crn: authProvider2.crn, hash: authProvider2.hash }, source, id: input.id, requestHash: input.requestHash };
|
|
1365
|
-
}
|
|
1366
|
-
function credentialEvidence(value) {
|
|
1367
|
-
const input = object2(value), provider = object2(input?.provider), claims = object2(input?.claims);
|
|
1368
|
-
if (!input || typeof input.credential !== "string" || !provider || typeof provider.crn !== "string" || typeof provider.hash !== "string" || !/^[a-f0-9]{64}$/u.test(provider.hash) || !Number.isSafeInteger(input.version) || Number(input.version) < 1 || input.expiresAt !== null && (!Number.isSafeInteger(input.expiresAt) || Number(input.expiresAt) < 1) || !claims || Object.keys(claims).length > 32 || encoder3.encode(JSON.stringify(claims)).byteLength > 65536 || Object.entries(claims).some(([key, value2]) => !/^[A-Za-z0-9._-]{1,128}$/u.test(key) || !(typeof value2 === "string" && value2.length <= 2048 || typeof value2 === "boolean" || typeof value2 === "number" && Number.isFinite(value2) || Array.isArray(value2) && value2.length <= 500 && value2.every((item) => typeof item === "string" && item.length <= 256)))) {
|
|
1369
|
-
throw new TypeError("Credential evidence is invalid");
|
|
1370
|
-
}
|
|
1371
|
-
if (parseResourceName(input.credential).kind !== "credential" || parseResourceName(provider.crn).kind !== "credential-provider") {
|
|
1372
|
-
throw new TypeError("Credential evidence identity is invalid");
|
|
1373
|
-
}
|
|
1374
|
-
return {
|
|
1375
|
-
credential: input.credential,
|
|
1376
|
-
provider: { crn: provider.crn, hash: provider.hash },
|
|
1377
|
-
version: Number(input.version),
|
|
1378
|
-
expiresAt: input.expiresAt,
|
|
1379
|
-
claims
|
|
1380
|
-
};
|
|
1381
|
-
}
|
|
1382
|
-
function channelIngressSource(value) {
|
|
1383
|
-
const source = object2(value);
|
|
1384
|
-
if (!source || typeof source.provider !== "string" || !/^[a-z0-9][a-z0-9._-]{0,63}$/u.test(source.provider) || typeof source.key !== "string" || !/^[A-Za-z0-9._:-]{1,256}$/u.test(source.key)) throw new TypeError("Channel ingress source is invalid");
|
|
1385
|
-
return { provider: source.provider, key: source.key };
|
|
1386
|
-
}
|
|
1387
|
-
function channelSubscriptionRequest(value) {
|
|
1388
|
-
const input = object2(value), configuration = object2(input?.configuration);
|
|
1389
|
-
if (!input || !configuration || typeof input.channel !== "string" || typeof input.principal !== "string") throw new TypeError("Channel subscription is invalid");
|
|
1390
|
-
const channel2 = parseResourceName(input.channel), principal = parseResourceName(input.principal);
|
|
1391
|
-
if (channel2.kind !== "channel" || principal.kind !== "principal" || channel2.environment !== principal.environment || channel2.tenant !== principal.tenant) {
|
|
1392
|
-
throw new TypeError("Channel subscription crosses the authenticated tenant");
|
|
1393
|
-
}
|
|
1394
|
-
const credentials = input.credentials ?? [];
|
|
1395
|
-
if (!Array.isArray(credentials) || credentials.length > 32) throw new TypeError("Channel subscription Credentials are invalid");
|
|
1396
|
-
const proofs = credentials.map(credentialEvidence);
|
|
1397
|
-
for (const proof of proofs) {
|
|
1398
|
-
const owner = parseResourceName(proof.credential), provider = parseResourceName(proof.provider.crn);
|
|
1399
|
-
if (owner.tenant !== channel2.tenant || owner.environment !== channel2.environment || provider.environment !== channel2.environment) {
|
|
1400
|
-
throw new TypeError("Channel subscription Credential crosses the authenticated tenant");
|
|
1401
|
-
}
|
|
1402
|
-
}
|
|
1403
|
-
return { source: channelIngressSource(input.source), channel: input.channel, principal: input.principal, configuration, credentials: proofs };
|
|
1404
|
-
}
|
|
1405
|
-
function channelIngressRequest(value) {
|
|
1406
|
-
const input = object2(value), headers = object2(input?.headers);
|
|
1407
|
-
if (!input || !["GET", "POST", "PUT", "PATCH", "DELETE"].includes(String(input.method)) || typeof input.url !== "string" || !input.url || input.url.length > 2048 || !headers || Object.keys(headers).length > 128 || Object.entries(headers).some(([key, value2]) => !/^[a-z0-9-]{1,128}$/u.test(key) || typeof value2 !== "string" || value2.length > 8192) || input.bodyBase64 !== null && (typeof input.bodyBase64 !== "string" || input.bodyBase64.length > 5592408) || encoder3.encode(JSON.stringify(input)).byteLength > 6 * 1024 * 1024) throw new TypeError("Channel ingress request is invalid");
|
|
1408
|
-
return { method: input.method, url: input.url, headers, bodyBase64: input.bodyBase64 };
|
|
1409
|
-
}
|
|
1410
|
-
|
|
1411
1512
|
// src/constal-api.ts
|
|
1412
1513
|
var CONSTAL_API_CAPABILITY = "constal.api";
|
|
1413
1514
|
var CONSTAL_API_VERSION = "1";
|
|
@@ -3533,6 +3634,7 @@ export {
|
|
|
3533
3634
|
scorerName,
|
|
3534
3635
|
selectableResourceLabels,
|
|
3535
3636
|
setupAwait,
|
|
3637
|
+
setupCredentialReceipt,
|
|
3536
3638
|
setupScreen,
|
|
3537
3639
|
setupScreenView,
|
|
3538
3640
|
setupSubmission,
|