@oxy.so/contracts 4.25.0 → 5.1.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/dist/cjs/client/accountEmail.js +3 -1
- package/dist/cjs/client/signIn.js +7 -0
- package/dist/cjs/identityLink.js +3 -5
- package/dist/cjs/index.js +11 -43
- package/dist/cjs/inference/catalogue.js +2 -5
- package/dist/cjs/inference/request.js +5 -79
- package/dist/cjs/inference/version.js +1 -1
- package/dist/cjs/signIn.js +22 -13
- package/dist/esm/client/accountEmail.js +3 -1
- package/dist/esm/client/signIn.js +7 -0
- package/dist/esm/identityLink.js +4 -6
- package/dist/esm/index.js +1 -6
- package/dist/esm/inference/catalogue.js +0 -3
- package/dist/esm/inference/request.js +4 -78
- package/dist/esm/inference/version.js +1 -1
- package/dist/esm/signIn.js +21 -12
- package/dist/types/client/accountEmail.d.ts +3 -1
- package/dist/types/client/signIn.d.ts +7 -1
- package/dist/types/identityLink.d.ts +32 -13
- package/dist/types/index.d.ts +2 -12
- package/dist/types/inference/catalogue.d.ts +4 -194
- package/dist/types/inference/economics.d.ts +2 -2
- package/dist/types/inference/realtime.d.ts +88 -88
- package/dist/types/inference/request.d.ts +28 -5055
- package/dist/types/inference/routingPolicy.d.ts +16 -16
- package/dist/types/inference/streamEvents.d.ts +8 -8
- package/dist/types/inference/usage.d.ts +4 -4
- package/dist/types/inference/version.d.ts +1 -1
- package/dist/types/safety.d.ts +10 -10
- package/dist/types/signIn.d.ts +159 -30
- package/package.json +1 -1
- package/dist/cjs/inference/decisions.js +0 -305
- package/dist/cjs/inference/privateAutoExecution.js +0 -153
- package/dist/cjs/inference/scopedExecution.js +0 -87
- package/dist/esm/inference/decisions.js +0 -299
- package/dist/esm/inference/privateAutoExecution.js +0 -149
- package/dist/esm/inference/scopedExecution.js +0 -83
- package/dist/types/inference/decisions.d.ts +0 -1853
- package/dist/types/inference/privateAutoExecution.d.ts +0 -694
- package/dist/types/inference/scopedExecution.d.ts +0 -202
|
@@ -13,8 +13,10 @@ const check_1 = require("./check");
|
|
|
13
13
|
* - `reauth`: a signed-in person proving it is them before a sensitive step
|
|
14
14
|
* (`POST /users/me/reauth/email`): a password, an authenticator, deleting the
|
|
15
15
|
* account, linking Commons.
|
|
16
|
+
* - `email_change`: a signed-in account proving the NEW address it moves to
|
|
17
|
+
* (`POST /users/me/email/verify/start`); bound to the account and that address.
|
|
16
18
|
*/
|
|
17
|
-
exports.EMAIL_VERIFICATION_PURPOSES = ['signup', 'signin', 'reauth'];
|
|
19
|
+
exports.EMAIL_VERIFICATION_PURPOSES = ['signup', 'signin', 'reauth', 'email_change'];
|
|
18
20
|
/** Digits in a code. */
|
|
19
21
|
exports.EMAIL_CODE_LENGTH = 6;
|
|
20
22
|
/** How long a code can be confirmed. */
|
|
@@ -66,6 +66,7 @@ function isEmailSignInChooseAccount(result) {
|
|
|
66
66
|
*/
|
|
67
67
|
exports.REAUTH_ACTIONS = [
|
|
68
68
|
'change_password',
|
|
69
|
+
'change_email',
|
|
69
70
|
'totp',
|
|
70
71
|
'link_commons',
|
|
71
72
|
'delete_account',
|
|
@@ -108,6 +109,12 @@ exports.SIGN_IN_ERROR_CODES = {
|
|
|
108
109
|
usernameTaken: 'USERNAME_TAKEN',
|
|
109
110
|
/** The email already holds `EMAIL_ACCOUNTS_MAX` accounts: no sign-up adds another. */
|
|
110
111
|
emailAccountsFull: 'EMAIL_ACCOUNTS_FULL',
|
|
112
|
+
/** Removing the one way in left (the email when there is no password, or the reverse). */
|
|
113
|
+
lastSignInMethod: 'LAST_SIGN_IN_METHOD',
|
|
114
|
+
/** Removing the email needs a password set, and is confirmed with it. */
|
|
115
|
+
passwordRequired: 'PASSWORD_REQUIRED',
|
|
116
|
+
/** The new email is the one the account already has. */
|
|
117
|
+
emailUnchanged: 'EMAIL_UNCHANGED',
|
|
111
118
|
};
|
|
112
119
|
/* -------------------------------------------------------------------------- */
|
|
113
120
|
/* Checks */
|
package/dist/cjs/identityLink.js
CHANGED
|
@@ -68,9 +68,7 @@ exports.identityLinkProofRequestSchema = zod_1.z
|
|
|
68
68
|
.strict();
|
|
69
69
|
/**
|
|
70
70
|
* `POST /identity/link/:linkId/complete` — the account's own confirmation: a
|
|
71
|
-
* code just sent to its email for this link
|
|
72
|
-
* code when it has one).
|
|
71
|
+
* code just sent to its email for this link, or its password when it has no
|
|
72
|
+
* email (`reauth`, plus its authenticator code when it has one).
|
|
73
73
|
*/
|
|
74
|
-
exports.identityLinkCompleteRequestSchema = zod_1.z
|
|
75
|
-
.object({ reauth: signIn_1.emailReauthProofSchema })
|
|
76
|
-
.strict();
|
|
74
|
+
exports.identityLinkCompleteRequestSchema = zod_1.z.object({ reauth: signIn_1.reauthProofSchema }).strict();
|
package/dist/cjs/index.js
CHANGED
|
@@ -31,15 +31,14 @@ exports.MODERATION_ATTRIBUTIONS = exports.MODERATION_FINDING_SCOPES = exports.MO
|
|
|
31
31
|
exports.deviceBackgroundCredentialResponseSchema = exports.deviceTokenMintResponseSchema = exports.deviceTokenMintRequestSchema = exports.deviceSessionSyncSchema = exports.activeTokenSchema = exports.deviceSessionStateSchema = exports.sessionAccountSchema = exports.applicationModerationTrustSchema = exports.reputationContextualInfluenceSchema = exports.reputationReviewingSchema = exports.reputationReportingSchema = exports.reputationConductSchema = exports.reputationContributionSchema = exports.reputationPersonhoodSchema = exports.identityBindingSchema = exports.registerIdentityBindingSchema = exports.reverseModerationEffectResultSchema = exports.applyModerationDecisionResultSchema = exports.moderationEffectSchema = exports.reverseModerationEffectSchema = exports.finalizeModerationDecisionSchema = exports.moderationDecisionEventSchema = exports.moderationPolicyVersionsSchema = exports.moderationDecisionEventSubjectSchema = exports.moderationFindingSchema = exports.applicationModerationStandingSchema = exports.identityBindingStatusSchema = exports.identityBindingTypeSchema = exports.personhoodStatusSchema = exports.contributionTierSchema = exports.conductStandingSchema = exports.conductStrikeStatusSchema = exports.moderationEffectSkipReasonSchema = exports.moderationEffectStatusSchema = exports.moderationEffectTypeSchema = exports.moderationDecisionStatusSchema = exports.moderationAttributionSchema = exports.moderationFindingScopeSchema = exports.moderationSeveritySchema = exports.APPLICATION_MODERATION_STANDINGS = exports.IDENTITY_BINDING_STATUSES = exports.IDENTITY_BINDING_TYPES = exports.PERSONHOOD_STATUSES = exports.CONTRIBUTION_TIERS = exports.CONDUCT_STANDINGS = exports.CONDUCT_STRIKE_STATUSES = exports.MODERATION_EFFECT_SKIP_REASONS = exports.MODERATION_EFFECT_STATUSES = exports.MODERATION_EFFECT_TYPES = exports.MODERATION_DECISION_STATUSES = void 0;
|
|
32
32
|
exports.updateAssetStatusSchema = exports.updateStatusSchema = exports.updatePlatformSchema = exports.identityRootStatusSchema = exports.identityProofChallengeResponseSchema = exports.identityProofChallengeRequestSchema = exports.identityProofSchema = exports.buildIdentityProofMessage = exports.canonicalJson = exports.IDENTITY_ERROR_CODES = exports.IDENTITY_PROOF_ACTION_VALUES = exports.IDENTITY_PROOF_ACTIONS = exports.IDENTITY_PROOF_CHALLENGE_TTL_MS = exports.IDENTITY_PROOF_AUDIENCE = exports.IDENTITY_PROOF_DOMAIN = exports.IDENTITY_PROOF_VERSION = exports.backupStatusResponseSchema = exports.backupUploadRequestSchema = exports.encryptedBackupEnvelopeSchema = exports.backupLookupIdSchema = exports.rotateKeyCompleteResponseSchema = exports.rotateKeyCompleteRequestSchema = exports.rotateKeyChallengeResponseSchema = exports.loginResultSchema = exports.mcpOAuthConsentResponseSchema = exports.mcpOAuthClientInfoResponseSchema = exports.mcpOAuthConsentContextSchema = exports.mcpOAuthWriteActionSchema = exports.mcpOAuthClientApplicationSchema = exports.oauthAuthorizeCodeResponseSchema = exports.oauthConsentDecisionSchema = exports.deviceDirectorySyncSchema = exports.deviceActivateResponseSchema = exports.deviceActivateRequestSchema = exports.deviceDirectorySchema = exports.devicePrincipalSchema = exports.deviceAccountContextSchema = exports.deviceDirectoryProfileSchema = exports.deviceContextRelationshipSchema = exports.sessionAccountsChangedEventSchema = exports.sessionAccountsChangedReasonSchema = exports.SESSION_ACCOUNTS_CHANGED_EVENT = exports.deviceJoinResponseSchema = exports.deviceJoinRequestSchema = exports.deviceJoinCodeResponseSchema = exports.deviceJoinCodeRequestSchema = exports.deviceRegisterResponseSchema = exports.deviceProofSchema = exports.deviceBackgroundTokenResponseSchema = exports.deviceBackgroundTokenRequestSchema = void 0;
|
|
33
33
|
exports.emailSignInStartResponseSchema = exports.emailSignInStartRequestSchema = exports.secondFactorCodeSchema = exports.newPasswordSchema = exports.passwordInputSchema = exports.signInIdentifierSchema = exports.SIGN_IN_ERROR_CODES = exports.TOTP_BACKUP_CODE_COUNT = exports.TOTP_PERIOD_SECONDS = exports.TOTP_DIGITS = exports.PASSWORD_MAX_LENGTH = exports.PASSWORD_MIN_LENGTH = exports.SIGNIN_SECOND_FACTOR_MAX_ATTEMPTS = exports.SIGNIN_SECOND_FACTOR_TTL_MS = exports.EMAIL_SIGNIN_LINK_TTL_MS = exports.emailVerificationConfirmResponseSchema = exports.emailVerificationConfirmRequestSchema = exports.emailVerificationStartResponseSchema = exports.emailVerificationStartRequestSchema = exports.emailTicketSchema = exports.emailAddressSchema = exports.EMAIL_VERIFICATION_ERROR_CODES = exports.EMAIL_TICKET_TTL_MS = exports.EMAIL_CODE_MAX_ATTEMPTS = exports.EMAIL_CODE_TTL_MS = exports.EMAIL_CODE_LENGTH = exports.EMAIL_VERIFICATION_PURPOSES = exports.updateRolloutPatchSchema = exports.promoteRequestSchema = exports.rollbackToEmbeddedRequestSchema = exports.rollbackRequestSchema = exports.updateListResponseSchema = exports.channelListResponseSchema = exports.channelSchema = exports.rollbackToEmbeddedEntrySchema = exports.createUpdateResponseSchema = exports.updateSchema = exports.createUpdateRequestSchema = exports.updateAssetRefSchema = exports.assetCompleteResponseSchema = exports.assetCompleteResultItemSchema = exports.assetCompleteRequestSchema = exports.assetInitResponseSchema = exports.assetUploadTicketSchema = exports.assetInitRequestSchema = exports.assetInitItemSchema = exports.rolloutPercentSchema = exports.runtimeVersionSchema = exports.channelNameSchema = exports.sha256HexSchema = void 0;
|
|
34
|
-
exports.
|
|
35
|
-
exports.
|
|
36
|
-
exports.
|
|
37
|
-
exports.
|
|
38
|
-
exports.
|
|
39
|
-
exports.
|
|
40
|
-
exports.
|
|
41
|
-
exports.
|
|
42
|
-
exports.serviceTokenOptionsSchema = exports.serviceTokenScopesSchema = exports.productPlanCatalogueSchema = exports.personalPlanCatalogueSchema = exports.personalPlanDisplayPriceSchema = exports.productSubscriptionCancellationResultSchema = exports.cancelProductSubscriptionSchema = exports.subscriptionCreditGrantsResponseSchema = exports.subscriptionCreditGrantSchema = exports.productSubscriptionsResponseSchema = exports.productSubscriptionSummarySchema = exports.isLoopbackOrigin = exports.inputSatisfiesCapabilityLimits = exports.canonicalCapabilityJson = exports.meteredGenerationSchema = exports.subjectProductAccessSchema = exports.productOfferSegmentSchema = exports.subjectProductGrantSnapshotSchema = exports.productAccessGrantSchema = exports.productSubscriptionSourceSchema = exports.productOfferSchema = exports.productBenefitSchema = void 0;
|
|
34
|
+
exports.oxyApplicationIdSchema = exports.delegatedUserIdSchema = exports.oxyAccountIdSchema = exports.INFERENCE_CONTRACT_VERSION = exports.transparencyCheckpointListSchema = exports.transparencyInclusionProofSchema = exports.transparencyCheckpointSchema = exports.transparencyAnchorSchema = exports.transparencyCheckpointSignatureSchema = exports.identityLinkCompleteRequestSchema = exports.identityLinkProofRequestSchema = exports.identityLinkStateSchema = exports.identityLinkCreateResponseSchema = exports.parseIdentityLinkQrPayload = exports.buildIdentityLinkQrPayload = exports.identityLinkIdSchema = exports.IDENTITY_LINK_QR_PREFIX = exports.IDENTITY_LINK_STATUSES = exports.totpBackupCodesResponseSchema = exports.totpReauthRequestSchema = exports.totpConfirmRequestSchema = exports.totpEnrollResponseSchema = exports.signInMethodsSchema = exports.emailSetRequestSchema = exports.emailChangeStartRequestSchema = exports.signInMethodRemoveRequestSchema = exports.passwordSetRequestSchema = exports.reauthEmailStartRequestSchema = exports.REAUTH_ACTIONS = exports.reauthProofSchema = exports.isSecondFactorRequired = exports.signUpRequestSchema = exports.secondFactorRequiredSchema = exports.secondFactorSignInRequestSchema = exports.passwordSignInRequestSchema = exports.isEmailSignInChooseAccount = exports.emailSignInChooseRequestSchema = exports.emailSignInChooseAccountSchema = exports.emailSignInAccountOptionSchema = exports.EMAIL_ACCOUNTS_MAX = exports.EMAIL_SIGNIN_CHOICE_TTL_MS = exports.emailSignInPendingSchema = exports.emailSignInLinkResponseSchema = exports.emailSignInLinkRequestSchema = exports.emailSignInCollectRequestSchema = exports.EMAIL_SIGNIN_LONG_CODE_LENGTH = exports.EMAIL_SIGNIN_LONG_CODE_ALPHABET = exports.normalizeEmailSignInCode = exports.emailSignInCodeSchema = exports.emailSignInConfirmRequestSchema = void 0;
|
|
35
|
+
exports.priceVersionSchema = exports.priceVersionStatusSchema = exports.embeddingResponseSchema = exports.embeddingFailureSchema = exports.embeddingSuccessSchema = exports.embeddingUsageSchema = exports.embeddingVectorSchema = exports.inferenceErrorSchema = exports.providerErrorPassthroughSchema = exports.safeErrorTextSchema = exports.upstreamErrorCategorySchema = exports.inferenceErrorCodeSchema = exports.NON_RETRYABLE_INFERENCE_ERROR_CODES = exports.INFERENCE_ERROR_CODES = exports.inferenceAttributionSchema = exports.authenticatedPrincipalSchema = exports.billingPrincipalSchema = exports.inferenceScopeSchema = exports.INFERENCE_SCOPES = exports.unitPriceSchema = exports.usageQuantitySchema = exports.usageSourceSchema = exports.USAGE_SOURCES = exports.usageUnitSchema = exports.USAGE_UNITS = exports.moneySchema = exports.exactDecimalSchema = exports.INFERENCE_MONEY_SCALE = exports.currencyCodeSchema = exports.RESERVED_ALIA_PUBLISHER = exports.inferenceFundingTierSchema = exports.inferenceRegionSchema = exports.deploymentIdSchema = exports.inferenceProviderSlugSchema = exports.routingProfileSlugSchema = exports.routingProfileIdSchema = exports.modelReferenceSchema = exports.modelRevisionLabelSchema = exports.modelIdSchema = exports.modelSlugSchema = exports.publisherSlugSchema = exports.sha256DigestSchema = exports.inferenceHttpsUrlSchema = exports.inferenceDateSchema = exports.inferenceTimestampSchema = exports.inferenceEnvironmentSchema = exports.idempotencyKeySchema = exports.generationIdSchema = exports.requestIdSchema = exports.oxyCredentialIdSchema = void 0;
|
|
36
|
+
exports.inferenceContentSourceSchema = exports.modelDocumentationSchema = exports.modelReleaseIngestionResultSchema = exports.modelReleaseIngestionRequestSchema = exports.modelLineDeclarationSchema = exports.modelGpaiDocumentationSchema = exports.modelDownstreamDocumentationSchema = exports.SYSTEMIC_RISK_COMPUTE_THRESHOLD_FLOPS = exports.trainingComputeFlopsSchema = exports.modelSystemicRiskTierSchema = exports.modelDistributionMethodSchema = exports.aliaModelReleaseManifestSchema = exports.aliaReleaseSignatureSchema = exports.aliaReleaseArtifactSchema = exports.authorizedRouteSchema = exports.effectiveSameModelDeployment = exports.routingPolicyReferenceSchema = exports.routingPolicySchema = exports.routingFallbackPolicySchema = exports.routingPolicyScopeSchema = exports.routingTargetSchema = exports.modelCatalogueEntrySchema = exports.catalogueServingProviderSummarySchema = exports.cataloguePublisherSummarySchema = exports.routingProfileSchema = exports.routingProfileCandidateSchema = exports.modelDeploymentSchema = exports.inferenceProviderSchema = exports.modelRevisionSchema = exports.catalogueModelSchema = exports.modelPublisherSchema = exports.modelSafetyMetadataSchema = exports.modelEvaluationResultSchema = exports.modelDeprecationSchema = exports.commercialPermissionSchema = exports.availabilityScopeSchema = exports.inferenceDataPolicySchema = exports.modelProvenanceSchema = exports.modelLicenseSchema = exports.modelCapabilitiesSchema = exports.modelRealtimeCapabilitiesSchema = exports.realtimeSessionTransportSchema = exports.realtimeSessionKindSchema = exports.inferenceApiFormatSchema = exports.modelPowerClassSchema = exports.powerLevelSchema = exports.reasoningEffortSchema = exports.inferenceOutputModalitySchema = exports.inferenceModalitySchema = exports.priceSnapshotSchema = void 0;
|
|
37
|
+
exports.realtimeItemCreateCommandSchema = exports.realtimeSessionUpdateCommandSchema = exports.realtimeResponseParametersSchema = exports.realtimeConversationItemSchema = exports.realtimeContentPartSchema = exports.realtimeSessionRequestSchema = exports.realtimeClientMetadataSchema = exports.realtimeSessionLimitsSchema = exports.realtimeSessionConfigUpdateSchema = exports.realtimeSessionConfigSchema = exports.realtimeTranslationSchema = exports.realtimeInputTranscriptionSchema = exports.realtimeTurnDetectionSchema = exports.realtimeOutputModalitySchema = exports.realtimeAudioFormatSchema = exports.realtimeResponseIdSchema = exports.realtimeItemIdSchema = exports.realtimeCommandIdSchema = exports.MAX_REALTIME_RESUME_WINDOW_MS = exports.MAX_REALTIME_SESSION_AUDIO_BYTES = exports.MAX_REALTIME_SESSION_DURATION_MS = exports.MAX_REALTIME_AUDIO_FRAME_BASE64_LENGTH = exports.inferenceStreamEventSchema = exports.inferenceStreamDoneEventSchema = exports.inferenceFinishReasonSchema = exports.inferenceStreamErrorEventSchema = exports.inferenceStreamRouteSwitchEventSchema = exports.inferenceRouteSwitchReasonSchema = exports.inferenceRouteSwitchDetailSchema = exports.inferenceStreamUsageEventSchema = exports.inferenceStreamToolCallEventSchema = exports.inferenceStreamAudioEventSchema = exports.MAX_INFERENCE_AUDIO_BYTES = exports.inferenceAudioMediaTypeSchema = exports.inferenceStreamDeltaEventSchema = exports.inferenceStreamStartEventSchema = exports.inferenceAudioOutputParametersSchema = exports.inferenceSpeechParametersSchema = exports.inferenceRequestSchema = exports.clientRequestMetadataSchema = exports.responseFormatSchema = exports.toolChoiceSchema = exports.toolDefinitionSchema = exports.inferenceReasoningSchema = exports.samplingParametersSchema = exports.inferenceInputSchema = exports.inferenceMessageSchema = exports.inferenceMessageRoleSchema = exports.inferenceToolCallSchema = exports.inferenceContentPartSchema = void 0;
|
|
38
|
+
exports.kaanaCredentialIdentitySchema = exports.kaanaCredentialOperationActionSchema = exports.kaanaCredentialOperationIdSchema = exports.kaanaCredentialHandleSchema = exports.providerConnectionScopeSchema = exports.usageRefundSchema = exports.usageRefundReasonSchema = exports.usageRefundSubjectSchema = exports.usageReceiptSchema = exports.normalizedUsageReportSchema = exports.inferenceRequestOutcomeSchema = exports.usageReservationSchema = exports.usageReservationStatusSchema = exports.usageReservationRequestSchema = exports.realtimeServerEventSchema = exports.realtimeSessionClosedEventSchema = exports.realtimeSessionCloseReasonSchema = exports.realtimeErrorEventSchema = exports.realtimeResponseDoneEventSchema = exports.realtimeResponseStatusSchema = exports.realtimeToolCallEventSchema = exports.realtimeTextDeltaEventSchema = exports.realtimeTranscriptDoneEventSchema = exports.realtimeTranscriptDeltaEventSchema = exports.realtimeTranscriptSourceSchema = exports.realtimeOutputAudioDoneEventSchema = exports.realtimeOutputAudioDeltaEventSchema = exports.realtimeResponseCreatedEventSchema = exports.realtimeInputAudioClearedEventSchema = exports.realtimeInputAudioCommittedEventSchema = exports.realtimeSpeechStoppedEventSchema = exports.realtimeSpeechStartedEventSchema = exports.realtimeItemTruncatedEventSchema = exports.realtimeItemDeletedEventSchema = exports.realtimeItemDoneEventSchema = exports.realtimeItemAddedEventSchema = exports.realtimeCommandAcceptedEventSchema = exports.realtimeSessionResumedEventSchema = exports.realtimeSessionUpdatedEventSchema = exports.realtimeSessionCreatedEventSchema = exports.realtimeClientCommandSchema = exports.realtimeSessionCloseCommandSchema = exports.realtimeSessionResumeCommandSchema = exports.realtimeResponseCancelCommandSchema = exports.realtimeResponseCreateCommandSchema = exports.realtimeInputAudioClearCommandSchema = exports.realtimeInputAudioCommitCommandSchema = exports.realtimeInputAudioAppendCommandSchema = exports.realtimeItemTruncateCommandSchema = exports.realtimeItemDeleteCommandSchema = void 0;
|
|
39
|
+
exports.planAllowanceSchema = exports.LIVE_PRODUCT_PLAN_STATUSES = exports.productPlanStatusSchema = exports.PRODUCT_PLAN_STATUSES = exports.reconciliationReportSchema = exports.reconciliationRunSchema = exports.reconciliationDiscrepancySchema = exports.reconciliationRunStatusSchema = exports.RECONCILIATION_RUN_STATUSES = exports.reconciliationDiscrepancyKindSchema = exports.RECONCILIATION_DISCREPANCY_KINDS = exports.autoRechargeAttemptSchema = exports.autoRechargeStatusSchema = exports.AUTO_RECHARGE_STATUSES = exports.externalPaymentSchema = exports.externalPaymentKindSchema = exports.EXTERNAL_PAYMENT_KINDS = exports.externalPaymentProviderSchema = exports.EXTERNAL_PAYMENT_PROVIDERS = exports.billingInvoiceSchema = exports.billingInvoiceStatusSchema = exports.BILLING_INVOICE_STATUSES = exports.accountBillingStateSchema = exports.billingProfileSchema = exports.autoRechargeSchema = exports.billingProfileStatusSchema = exports.BILLING_PROFILE_STATUSES = exports.billingModeSchema = exports.BILLING_MODES = exports.providerConnectionSchema = exports.providerConnectionStatusSchema = exports.providerConnectionValidationSchema = exports.providerCredentialCustodyStateSchema = exports.providerCredentialValidationDeploymentSchema = exports.providerCredentialValidationOperationSchema = exports.kaanaCredentialValidationOutcomeSchema = exports.kaanaCredentialValidationFailureCodeSchema = exports.kaanaCredentialValidationOutcomeStateSchema = exports.kaanaCredentialValidationTaskSchema = exports.kaanaCredentialOutcomeSchema = exports.kaanaCredentialConflictOutcomeSchema = exports.kaanaCredentialAppliedOutcomeSchema = exports.kaanaCredentialOutcomeRequestSchema = exports.kaanaCredentialRevokeOutcomeRequestSchema = exports.kaanaCredentialRotateOutcomeRequestSchema = exports.kaanaCredentialCreateOutcomeRequestSchema = exports.kaanaCredentialMutationSchema = exports.kaanaCredentialRevokeMutationSchema = exports.kaanaCredentialRotateMutationSchema = exports.kaanaCredentialCreateMutationSchema = void 0;
|
|
40
|
+
exports.catalogRegistrationSchema = exports.appCapabilityCatalogSchema = exports.CATALOG_INTERNAL_TRANSPORTS = exports.catalogFeatureSchema = exports.catalogEventSchema = exports.catalogToolSchema = exports.auditEventSchema = exports.auditResultSchema = exports.policyDecisionSchema = exports.invocationPrincipalSchema = exports.capabilityTicketClaimsSchema = exports.automationDefinitionSchema = exports.automationDataFlowSchema = exports.automationActorSelectionSchema = exports.automationTriggerSchema = exports.agentAvailabilitySchema = exports.applicationAgentSchema = exports.applicationAgentWriteSchema = exports.applicationAgentAvailabilitySchema = exports.APPLICATION_AGENT_AVAILABILITIES = exports.agentRequesterCeilingSchema = exports.agentRequesterCeilingWriteSchema = exports.AGENT_REQUESTER_CEILING_AUTONOMY = exports.delegationGrantSchema = exports.capabilityTicketRequestSchema = exports.capabilityCoordinatorSchema = exports.executionAuthorizationRefSchema = exports.capabilityCatalogBindingSchema = exports.grantLimitSchema = exports.toolGrantOverrideSchema = exports.resourceRefSchema = exports.foregroundExecutionAuthorizationInputSchema = exports.executionActorRefSchema = exports.actorRefSchema = exports.capabilityPackageSchema = exports.autonomyLevelSchema = exports.CAPABILITY_PACKAGES = exports.AUTONOMY_LEVELS = exports.costCenterUsageSchema = exports.providerCostSourceSchema = exports.PROVIDER_COST_SOURCES = exports.inferenceEconomicTreatmentSchema = exports.INFERENCE_ECONOMIC_TREATMENTS = exports.productEntitlementSchema = exports.costCenterSpendSchema = exports.costCenterSchema = exports.costCenterStatusSchema = exports.COST_CENTER_STATUSES = exports.payAsYouGoEntitlementSchema = exports.productPlanSchema = void 0;
|
|
41
|
+
exports.serviceTokenOptionsSchema = exports.serviceTokenScopesSchema = exports.productPlanCatalogueSchema = exports.personalPlanCatalogueSchema = exports.personalPlanDisplayPriceSchema = exports.productSubscriptionCancellationResultSchema = exports.cancelProductSubscriptionSchema = exports.subscriptionCreditGrantsResponseSchema = exports.subscriptionCreditGrantSchema = exports.productSubscriptionsResponseSchema = exports.productSubscriptionSummarySchema = exports.isLoopbackOrigin = exports.inputSatisfiesCapabilityLimits = exports.canonicalCapabilityJson = exports.meteredGenerationSchema = exports.subjectProductAccessSchema = exports.productOfferSegmentSchema = exports.subjectProductGrantSnapshotSchema = exports.productAccessGrantSchema = exports.productSubscriptionSourceSchema = exports.productOfferSchema = exports.productBenefitSchema = exports.subjectProductAccessQuerySchema = exports.productDefinitionSchema = exports.inboxInferenceStreamEventSchema = exports.inboxThreadSummaryResponseSchema = exports.inboxSmartRepliesResponseSchema = exports.inboxNaturalSearchResponseSchema = exports.inboxInferenceTextResponseSchema = exports.inboxMessageInferenceParamsSchema = exports.inboxNaturalSearchRequestSchema = exports.INBOX_DAILY_BRIEF_SECTIONS = exports.inboxDailyBriefResponseSchema = exports.inboxDailyBriefRequestSchema = exports.inboxComposeRequestSchema = exports.emailAgentContextSchema = exports.emailContextMessageSchema = exports.emailContextMailboxSchema = exports.emailContextAddressSchema = exports.resolveCatalogInvocation = exports.matchCatalogInvocation = exports.findOverlappingCatalogInvocations = exports.catalogInvocationTemplatesEquivalent = exports.catalogInvocationsOverlap = exports.catalogInvocationPathParameters = exports.normalizedAppEventSchema = void 0;
|
|
43
42
|
var accountGraph_1 = require("./accountGraph");
|
|
44
43
|
Object.defineProperty(exports, "ACCOUNT_KINDS", { enumerable: true, get: function () { return accountGraph_1.ACCOUNT_KINDS; } });
|
|
45
44
|
Object.defineProperty(exports, "accountKindSchema", { enumerable: true, get: function () { return accountGraph_1.accountKindSchema; } });
|
|
@@ -422,10 +421,12 @@ Object.defineProperty(exports, "secondFactorRequiredSchema", { enumerable: true,
|
|
|
422
421
|
Object.defineProperty(exports, "signUpRequestSchema", { enumerable: true, get: function () { return signIn_1.signUpRequestSchema; } });
|
|
423
422
|
Object.defineProperty(exports, "isSecondFactorRequired", { enumerable: true, get: function () { return signIn_1.isSecondFactorRequired; } });
|
|
424
423
|
Object.defineProperty(exports, "reauthProofSchema", { enumerable: true, get: function () { return signIn_1.reauthProofSchema; } });
|
|
425
|
-
Object.defineProperty(exports, "emailReauthProofSchema", { enumerable: true, get: function () { return signIn_1.emailReauthProofSchema; } });
|
|
426
424
|
Object.defineProperty(exports, "REAUTH_ACTIONS", { enumerable: true, get: function () { return signIn_1.REAUTH_ACTIONS; } });
|
|
427
425
|
Object.defineProperty(exports, "reauthEmailStartRequestSchema", { enumerable: true, get: function () { return signIn_1.reauthEmailStartRequestSchema; } });
|
|
428
426
|
Object.defineProperty(exports, "passwordSetRequestSchema", { enumerable: true, get: function () { return signIn_1.passwordSetRequestSchema; } });
|
|
427
|
+
Object.defineProperty(exports, "signInMethodRemoveRequestSchema", { enumerable: true, get: function () { return signIn_1.signInMethodRemoveRequestSchema; } });
|
|
428
|
+
Object.defineProperty(exports, "emailChangeStartRequestSchema", { enumerable: true, get: function () { return signIn_1.emailChangeStartRequestSchema; } });
|
|
429
|
+
Object.defineProperty(exports, "emailSetRequestSchema", { enumerable: true, get: function () { return signIn_1.emailSetRequestSchema; } });
|
|
429
430
|
Object.defineProperty(exports, "signInMethodsSchema", { enumerable: true, get: function () { return signIn_1.signInMethodsSchema; } });
|
|
430
431
|
Object.defineProperty(exports, "totpEnrollResponseSchema", { enumerable: true, get: function () { return signIn_1.totpEnrollResponseSchema; } });
|
|
431
432
|
Object.defineProperty(exports, "totpConfirmRequestSchema", { enumerable: true, get: function () { return signIn_1.totpConfirmRequestSchema; } });
|
|
@@ -837,39 +838,6 @@ __exportStar(require("./accountAccess"), exports);
|
|
|
837
838
|
__exportStar(require("./notifications"), exports);
|
|
838
839
|
__exportStar(require("./email/messages"), exports);
|
|
839
840
|
__exportStar(require("./stickers"), exports);
|
|
840
|
-
var decisions_1 = require("./inference/decisions");
|
|
841
|
-
Object.defineProperty(exports, "decisionEffortSchema", { enumerable: true, get: function () { return decisions_1.decisionEffortSchema; } });
|
|
842
|
-
Object.defineProperty(exports, "decisionQuestionSchema", { enumerable: true, get: function () { return decisions_1.decisionQuestionSchema; } });
|
|
843
|
-
Object.defineProperty(exports, "decisionInputSchema", { enumerable: true, get: function () { return decisions_1.decisionInputSchema; } });
|
|
844
|
-
Object.defineProperty(exports, "decisionRequestSchema", { enumerable: true, get: function () { return decisions_1.decisionRequestSchema; } });
|
|
845
|
-
Object.defineProperty(exports, "decisionAnswerSchema", { enumerable: true, get: function () { return decisions_1.decisionAnswerSchema; } });
|
|
846
|
-
Object.defineProperty(exports, "decisionResultSchema", { enumerable: true, get: function () { return decisions_1.decisionResultSchema; } });
|
|
847
|
-
Object.defineProperty(exports, "decisionSuccessSchema", { enumerable: true, get: function () { return decisions_1.decisionSuccessSchema; } });
|
|
848
|
-
Object.defineProperty(exports, "decisionFailureSchema", { enumerable: true, get: function () { return decisions_1.decisionFailureSchema; } });
|
|
849
|
-
Object.defineProperty(exports, "decisionInputBudget", { enumerable: true, get: function () { return decisions_1.decisionInputBudget; } });
|
|
850
|
-
Object.defineProperty(exports, "decisionFitsGateway", { enumerable: true, get: function () { return decisions_1.decisionFitsGateway; } });
|
|
851
|
-
Object.defineProperty(exports, "decisionAnswersMatch", { enumerable: true, get: function () { return decisions_1.decisionAnswersMatch; } });
|
|
852
|
-
var scopedExecution_1 = require("./inference/scopedExecution");
|
|
853
|
-
Object.defineProperty(exports, "SCOPED_EXECUTION_CONTRACT_VERSION", { enumerable: true, get: function () { return scopedExecution_1.SCOPED_EXECUTION_CONTRACT_VERSION; } });
|
|
854
|
-
Object.defineProperty(exports, "SCOPED_REQUEST_ENVELOPE_VERSION", { enumerable: true, get: function () { return scopedExecution_1.SCOPED_REQUEST_ENVELOPE_VERSION; } });
|
|
855
|
-
Object.defineProperty(exports, "scopedExecutionAudienceSchema", { enumerable: true, get: function () { return scopedExecution_1.scopedExecutionAudienceSchema; } });
|
|
856
|
-
Object.defineProperty(exports, "scopedExecutionSchema", { enumerable: true, get: function () { return scopedExecution_1.scopedExecutionSchema; } });
|
|
857
|
-
Object.defineProperty(exports, "canonicalScopedExecutionJson", { enumerable: true, get: function () { return scopedExecution_1.canonicalScopedExecutionJson; } });
|
|
858
|
-
var request_2 = require("./inference/request");
|
|
859
|
-
Object.defineProperty(exports, "scopedInferenceRequestSchema", { enumerable: true, get: function () { return request_2.scopedInferenceRequestSchema; } });
|
|
860
|
-
var privateAutoExecution_1 = require("./inference/privateAutoExecution");
|
|
861
|
-
Object.defineProperty(exports, "PRIVATE_AUTO_EXECUTION_CONTRACT_VERSION", { enumerable: true, get: function () { return privateAutoExecution_1.PRIVATE_AUTO_EXECUTION_CONTRACT_VERSION; } });
|
|
862
|
-
Object.defineProperty(exports, "PRIVATE_AUTO_REQUEST_ENVELOPE_VERSION", { enumerable: true, get: function () { return privateAutoExecution_1.PRIVATE_AUTO_REQUEST_ENVELOPE_VERSION; } });
|
|
863
|
-
Object.defineProperty(exports, "PRIVATE_AUTO_LIMITS", { enumerable: true, get: function () { return privateAutoExecution_1.PRIVATE_AUTO_LIMITS; } });
|
|
864
|
-
Object.defineProperty(exports, "PRIVATE_AUTO_INSTRUCTIONS", { enumerable: true, get: function () { return privateAutoExecution_1.PRIVATE_AUTO_INSTRUCTIONS; } });
|
|
865
|
-
Object.defineProperty(exports, "PRIVATE_AUTO_QUESTION", { enumerable: true, get: function () { return privateAutoExecution_1.PRIVATE_AUTO_QUESTION; } });
|
|
866
|
-
Object.defineProperty(exports, "privateAutoPrincipalSchema", { enumerable: true, get: function () { return privateAutoExecution_1.privateAutoPrincipalSchema; } });
|
|
867
|
-
Object.defineProperty(exports, "privateAutoSourceApprovalSchema", { enumerable: true, get: function () { return privateAutoExecution_1.privateAutoSourceApprovalSchema; } });
|
|
868
|
-
Object.defineProperty(exports, "privateAutoExecutionSchema", { enumerable: true, get: function () { return privateAutoExecution_1.privateAutoExecutionSchema; } });
|
|
869
|
-
Object.defineProperty(exports, "privateAutoInputSchema", { enumerable: true, get: function () { return privateAutoExecution_1.privateAutoInputSchema; } });
|
|
870
|
-
Object.defineProperty(exports, "privateAutoOperationId", { enumerable: true, get: function () { return privateAutoExecution_1.privateAutoOperationId; } });
|
|
871
|
-
var request_3 = require("./inference/request");
|
|
872
|
-
Object.defineProperty(exports, "privateAutoInferenceRequestSchema", { enumerable: true, get: function () { return request_3.privateAutoInferenceRequestSchema; } });
|
|
873
841
|
var access_1 = require("./products/access");
|
|
874
842
|
Object.defineProperty(exports, "productDefinitionSchema", { enumerable: true, get: function () { return access_1.productDefinitionSchema; } });
|
|
875
843
|
Object.defineProperty(exports, "subjectProductAccessQuerySchema", { enumerable: true, get: function () { return access_1.subjectProductAccessQuerySchema; } });
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.modelCatalogueEntrySchema = exports.catalogueServingProviderSummarySchema = exports.cataloguePublisherSummarySchema = exports.routingProfileSchema = exports.routingProfileCandidateSchema = exports.modelDeploymentSchema = exports.inferenceProviderSchema = exports.modelRevisionSchema = exports.catalogueModelSchema = exports.modelPublisherSchema = exports.modelSafetyMetadataSchema = exports.modelEvaluationResultSchema = exports.modelDeprecationSchema = exports.commercialPermissionSchema = exports.availabilityScopeSchema = exports.inferenceDataPolicySchema = exports.modelProvenanceSchema = exports.modelLicenseSchema = exports.modelCapabilitiesSchema = exports.modelRealtimeCapabilitiesSchema = exports.realtimeSessionTransportSchema = exports.realtimeSessionKindSchema = exports.inferenceApiFormatSchema = exports.modelPowerClassSchema = exports.powerLevelSchema = exports.reasoningEffortSchema = exports.inferenceOutputModalitySchema = exports.inferenceModalitySchema = void 0;
|
|
4
|
-
const scopedExecution_1 = require("./scopedExecution");
|
|
5
2
|
/**
|
|
6
3
|
* The canonical model catalogue.
|
|
7
4
|
*
|
|
@@ -30,6 +27,8 @@ const scopedExecution_1 = require("./scopedExecution");
|
|
|
30
27
|
*
|
|
31
28
|
* Decided in: docs/adr/0008-catalogue-concept-separation.md.
|
|
32
29
|
*/
|
|
30
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
+
exports.modelCatalogueEntrySchema = exports.catalogueServingProviderSummarySchema = exports.cataloguePublisherSummarySchema = exports.routingProfileSchema = exports.routingProfileCandidateSchema = exports.modelDeploymentSchema = exports.inferenceProviderSchema = exports.modelRevisionSchema = exports.catalogueModelSchema = exports.modelPublisherSchema = exports.modelSafetyMetadataSchema = exports.modelEvaluationResultSchema = exports.modelDeprecationSchema = exports.commercialPermissionSchema = exports.availabilityScopeSchema = exports.inferenceDataPolicySchema = exports.modelProvenanceSchema = exports.modelLicenseSchema = exports.modelCapabilitiesSchema = exports.modelRealtimeCapabilitiesSchema = exports.realtimeSessionTransportSchema = exports.realtimeSessionKindSchema = exports.inferenceApiFormatSchema = exports.modelPowerClassSchema = exports.powerLevelSchema = exports.reasoningEffortSchema = exports.inferenceOutputModalitySchema = exports.inferenceModalitySchema = void 0;
|
|
33
32
|
const zod_1 = require("zod");
|
|
34
33
|
const identifiers_1 = require("./identifiers");
|
|
35
34
|
const priceVersion_1 = require("./priceVersion");
|
|
@@ -487,8 +486,6 @@ exports.modelDeploymentSchema = zod_1.z
|
|
|
487
486
|
/** See `version.ts`: exchanged with the data plane on its own. */
|
|
488
487
|
schemaVersion: zod_1.z.literal(2),
|
|
489
488
|
deploymentId: identifiers_1.deploymentIdSchema,
|
|
490
|
-
/** Restrictive audience; never an eligibility approval. */
|
|
491
|
-
scopedExecution: scopedExecution_1.scopedExecutionAudienceSchema.optional(),
|
|
492
489
|
provider: identifiers_1.inferenceProviderSlugSchema,
|
|
493
490
|
/** Always revision-pinned: a deployment serves specific weights. */
|
|
494
491
|
modelReference: identifiers_1.modelReferenceSchema,
|
|
@@ -25,11 +25,8 @@
|
|
|
25
25
|
* docs/adr/0017-authorized-routes-in-the-envelope.md.
|
|
26
26
|
*/
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
exports.
|
|
29
|
-
const decisions_1 = require("./decisions");
|
|
28
|
+
exports.inferenceRequestSchema = exports.inferenceAudioOutputParametersSchema = exports.inferenceSpeechParametersSchema = exports.clientRequestMetadataSchema = exports.inferenceReasoningSchema = exports.responseFormatSchema = exports.toolChoiceSchema = exports.toolDefinitionSchema = exports.samplingParametersSchema = exports.inferenceInputSchema = exports.inferenceMessageSchema = exports.inferenceMessageRoleSchema = exports.inferenceToolCallSchema = exports.inferenceContentPartSchema = exports.inferenceContentSourceSchema = void 0;
|
|
30
29
|
const zod_1 = require("zod");
|
|
31
|
-
const scopedExecution_1 = require("./scopedExecution");
|
|
32
|
-
const privateAutoExecution_1 = require("./privateAutoExecution");
|
|
33
30
|
const attribution_1 = require("./attribution");
|
|
34
31
|
const catalogue_1 = require("./catalogue");
|
|
35
32
|
const identifiers_1 = require("./identifiers");
|
|
@@ -201,7 +198,6 @@ exports.inferenceMessageSchema = zod_1.z
|
|
|
201
198
|
* that both metering and provider translation depend on.
|
|
202
199
|
*/
|
|
203
200
|
exports.inferenceInputSchema = zod_1.z.discriminatedUnion("format", [
|
|
204
|
-
zod_1.z.object({ format: zod_1.z.literal("decisions"), decisions: decisions_1.decisionInputSchema }).strict(),
|
|
205
201
|
zod_1.z
|
|
206
202
|
.object({
|
|
207
203
|
format: zod_1.z.literal("messages"),
|
|
@@ -356,8 +352,6 @@ exports.inferenceRequestSchema = zod_1.z
|
|
|
356
352
|
.object({
|
|
357
353
|
/** See `version.ts`: this is the Oxy→data-plane request envelope. */
|
|
358
354
|
schemaVersion: zod_1.z.literal(2),
|
|
359
|
-
/** Recognized so v2 refuses rather than silently stripping a restriction. */
|
|
360
|
-
scopedExecution: scopedExecution_1.scopedExecutionSchema.optional(),
|
|
361
355
|
attribution: attribution_1.inferenceAttributionSchema,
|
|
362
356
|
target: routingPolicy_1.routingTargetSchema,
|
|
363
357
|
modality: catalogue_1.inferenceModalitySchema,
|
|
@@ -412,18 +406,10 @@ exports.inferenceRequestSchema = zod_1.z
|
|
|
412
406
|
authorizedRoutes: zod_1.z.array(routingPolicy_1.authorizedRouteSchema).min(1).optional(),
|
|
413
407
|
})
|
|
414
408
|
.superRefine((request, ctx) => {
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
if (request.
|
|
418
|
-
|
|
419
|
-
const foreignRoute = request.authorizedRoutes?.some((route) => request.target.kind !== "model" || route.modelReference !== request.target.modelReference || route.substitution !== "same_model");
|
|
420
|
-
if (request.input.format !== "decisions" || request.client.apiFormat !== "decisions" ||
|
|
421
|
-
request.modality !== "text" || request.stream || !exactModel || foreignRoute ||
|
|
422
|
-
request.maxOutputTokens !== undefined || Object.keys(request.sampling).length > 0 ||
|
|
423
|
-
request.tools.length > 0 || request.toolChoice !== undefined || request.responseFormat !== undefined ||
|
|
424
|
-
request.reasoning !== undefined || request.speech !== undefined || request.audioOutput !== undefined) {
|
|
425
|
-
ctx.addIssue({ code: zod_1.z.ZodIssueCode.custom, path: ["input"], message: "Decisions require exact-model typed nonstreaming input without generation controls or model substitution." });
|
|
426
|
-
}
|
|
409
|
+
// Decisions are a grant operation of `kaana.ai/v1` (Kaana ADR 0002) and
|
|
410
|
+
// never ride this envelope.
|
|
411
|
+
if (request.client.apiFormat === "decisions") {
|
|
412
|
+
ctx.addIssue({ code: zod_1.z.ZodIssueCode.custom, path: ["client", "apiFormat"], message: "Decisions are served by https://kaana.ai/v1/decisions, never on this envelope." });
|
|
427
413
|
}
|
|
428
414
|
const isSpeech = request.client.apiFormat === "audio_speech";
|
|
429
415
|
if (isSpeech && request.speech !== undefined && (request.modality !== "audio" || request.input.format !== "text" || request.stream)) {
|
|
@@ -543,63 +529,3 @@ exports.inferenceRequestSchema = zod_1.z
|
|
|
543
529
|
});
|
|
544
530
|
}
|
|
545
531
|
});
|
|
546
|
-
/** Explicit restrictive generation: old v2 receivers reject this version whole. */
|
|
547
|
-
exports.scopedInferenceRequestSchema = exports.inferenceRequestSchema.innerType()
|
|
548
|
-
.extend({ schemaVersion: zod_1.z.literal(scopedExecution_1.SCOPED_REQUEST_ENVELOPE_VERSION), scopedExecution: scopedExecution_1.scopedExecutionSchema })
|
|
549
|
-
.superRefine((request, ctx) => {
|
|
550
|
-
const { scopedExecution: scope, ...base } = request;
|
|
551
|
-
const legacy = exports.inferenceRequestSchema.safeParse({ ...base, schemaVersion: 2 });
|
|
552
|
-
if (!legacy.success)
|
|
553
|
-
for (const issue of legacy.error.issues)
|
|
554
|
-
ctx.addIssue(issue);
|
|
555
|
-
const principal = request.attribution.principal;
|
|
556
|
-
const route = request.authorizedRoutes?.[0];
|
|
557
|
-
if (request.input.format !== "decisions" || request.client.apiFormat !== "decisions" ||
|
|
558
|
-
scope.requestId !== request.attribution.requestId ||
|
|
559
|
-
scope.idempotencyKey !== request.idempotencyKey ||
|
|
560
|
-
scope.principal.accountId !== principal.billing.accountId ||
|
|
561
|
-
scope.principal.applicationId !== principal.applicationId ||
|
|
562
|
-
scope.principal.credentialId !== principal.credentialId ||
|
|
563
|
-
scope.principal.environment !== principal.environment ||
|
|
564
|
-
scope.policy.routingPolicyId !== request.routingPolicy.routingPolicyId ||
|
|
565
|
-
scope.policy.policyVersion !== request.routingPolicy.policyVersion ||
|
|
566
|
-
request.authorizedRoutes?.length !== 1 || route?.customerProviderCredential !== undefined ||
|
|
567
|
-
route?.deploymentId !== scope.deploymentId || route?.provider !== scope.provider ||
|
|
568
|
-
route?.modelReference !== scope.modelReference ||
|
|
569
|
-
request.target.kind !== "model" || request.target.modelReference !== scope.modelReference) {
|
|
570
|
-
ctx.addIssue({ code: zod_1.z.ZodIssueCode.custom, path: ["scopedExecution"], message: "Scoped execution must restrict the exact attributed decisions request and one platform route." });
|
|
571
|
-
}
|
|
572
|
-
});
|
|
573
|
-
/** Private repeated Auto is independently negotiated, never a v3 fixture renewal. */
|
|
574
|
-
exports.privateAutoInferenceRequestSchema = exports.inferenceRequestSchema.innerType()
|
|
575
|
-
.omit({ scopedExecution: true })
|
|
576
|
-
.extend({ schemaVersion: zod_1.z.literal(privateAutoExecution_1.PRIVATE_AUTO_REQUEST_ENVELOPE_VERSION), privateAutoExecution: privateAutoExecution_1.privateAutoExecutionSchema })
|
|
577
|
-
.strict()
|
|
578
|
-
.superRefine((request, ctx) => {
|
|
579
|
-
const { privateAutoExecution: permit, ...base } = request;
|
|
580
|
-
const legacy = exports.inferenceRequestSchema.safeParse({ ...base, schemaVersion: 2 });
|
|
581
|
-
if (!legacy.success)
|
|
582
|
-
for (const issue of legacy.error.issues)
|
|
583
|
-
ctx.addIssue(issue);
|
|
584
|
-
const input = privateAutoExecution_1.privateAutoInputSchema.safeParse(request.input);
|
|
585
|
-
if (!input.success)
|
|
586
|
-
for (const issue of input.error.issues)
|
|
587
|
-
ctx.addIssue({ ...issue, path: ['input', ...issue.path] });
|
|
588
|
-
const principal = request.attribution.principal;
|
|
589
|
-
const route = request.authorizedRoutes?.[0];
|
|
590
|
-
if (request.attribution.userId !== undefined || request.client.apiFormat !== 'decisions' || permit.requestId !== request.attribution.requestId ||
|
|
591
|
-
permit.operationId !== request.idempotencyKey ||
|
|
592
|
-
permit.principal.accountId !== principal.billing.accountId ||
|
|
593
|
-
permit.principal.applicationId !== principal.applicationId ||
|
|
594
|
-
permit.principal.credentialId !== principal.credentialId || permit.principal.environment !== principal.environment ||
|
|
595
|
-
!principal.inferenceScopes.includes('inference:invoke') || request.client.endpoint !== '/internal/auto-classification' ||
|
|
596
|
-
permit.policy.routingPolicyId !== request.routingPolicy.routingPolicyId || permit.policy.policyVersion !== request.routingPolicy.policyVersion ||
|
|
597
|
-
request.authorizedRoutes?.length !== 1 || route?.customerProviderCredential !== undefined ||
|
|
598
|
-
route?.deploymentId !== permit.deploymentId || route?.provider !== permit.provider || route?.modelReference !== permit.modelReference ||
|
|
599
|
-
request.target.kind !== 'model' || request.target.modelReference !== permit.modelReference ||
|
|
600
|
-
route.regions.length !== permit.regions.length || route.regions.some((region) => !permit.regions.includes(region)) ||
|
|
601
|
-
Date.parse(permit.runtimeExpiresAt) <= Date.parse(request.client.receivedAt) ||
|
|
602
|
-
Date.parse(permit.runtimeExpiresAt) > Date.parse(request.client.receivedAt) + 1000) {
|
|
603
|
-
ctx.addIssue({ code: zod_1.z.ZodIssueCode.custom, path: ['privateAutoExecution'], message: 'Private Auto must bind one exact attributed decisions child and platform route.' });
|
|
604
|
-
}
|
|
605
|
-
});
|
|
@@ -102,4 +102,4 @@ exports.INFERENCE_CONTRACT_VERSION = void 0;
|
|
|
102
102
|
* change to, say, the catalogue reject every in-flight inference request; the
|
|
103
103
|
* per-shape `schemaVersion` is what a message is validated against.
|
|
104
104
|
*/
|
|
105
|
-
exports.INFERENCE_CONTRACT_VERSION = '
|
|
105
|
+
exports.INFERENCE_CONTRACT_VERSION = '4.0.0';
|
package/dist/cjs/signIn.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.totpBackupCodesResponseSchema = exports.totpReauthRequestSchema = exports.totpConfirmRequestSchema = exports.totpEnrollResponseSchema = exports.signInMethodsSchema = exports.
|
|
3
|
+
exports.totpBackupCodesResponseSchema = exports.totpReauthRequestSchema = exports.totpConfirmRequestSchema = exports.totpEnrollResponseSchema = exports.signInMethodsSchema = exports.emailSetRequestSchema = exports.emailChangeStartRequestSchema = exports.signInMethodRemoveRequestSchema = exports.passwordSetRequestSchema = exports.reauthProofSchema = exports.reauthEmailStartRequestSchema = exports.emailSignInChooseRequestSchema = exports.emailSignInChooseAccountSchema = exports.emailSignInAccountOptionSchema = exports.emailSignInPendingSchema = exports.secondFactorRequiredSchema = exports.signUpRequestSchema = exports.secondFactorSignInRequestSchema = exports.passwordSignInRequestSchema = exports.emailSignInLinkResponseSchema = exports.emailSignInLinkRequestSchema = exports.emailSignInCollectRequestSchema = exports.emailSignInConfirmRequestSchema = exports.emailSignInCodeSchema = exports.emailSignInStartResponseSchema = exports.emailSignInStartRequestSchema = exports.secondFactorCodeSchema = exports.newPasswordSchema = exports.passwordInputSchema = exports.signInIdentifierSchema = exports.SIGN_IN_ERROR_CODES = exports.REAUTH_ACTIONS = exports.isEmailSignInChooseAccount = exports.isSecondFactorRequired = exports.EMAIL_ACCOUNTS_MAX = exports.EMAIL_SIGNIN_CHOICE_TTL_MS = exports.normalizeEmailSignInCode = exports.EMAIL_SIGNIN_LONG_CODE_LENGTH = exports.EMAIL_SIGNIN_LONG_CODE_ALPHABET = exports.TOTP_BACKUP_CODE_COUNT = exports.TOTP_PERIOD_SECONDS = exports.TOTP_DIGITS = exports.PASSWORD_MAX_LENGTH = exports.PASSWORD_MIN_LENGTH = exports.SIGNIN_SECOND_FACTOR_MAX_ATTEMPTS = exports.SIGNIN_SECOND_FACTOR_TTL_MS = exports.EMAIL_SIGNIN_LINK_TTL_MS = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Signing in: an email code or link, an optional password,
|
|
6
6
|
* and an optional authenticator app (TOTP) as a second factor.
|
|
@@ -228,18 +228,6 @@ exports.reauthProofSchema = zod_1.z
|
|
|
228
228
|
.refine((proof) => proof.password !== undefined || proof.emailCode !== undefined, {
|
|
229
229
|
message: 'password or emailCode is required',
|
|
230
230
|
});
|
|
231
|
-
/** A proof by email code only (+ TOTP): deleting an account, linking Commons. */
|
|
232
|
-
exports.emailReauthProofSchema = zod_1.z
|
|
233
|
-
.object({
|
|
234
|
-
emailCode: zod_1.z
|
|
235
|
-
.object({
|
|
236
|
-
verificationId: zod_1.z.string().trim().min(1).max(64),
|
|
237
|
-
code: sixDigits,
|
|
238
|
-
})
|
|
239
|
-
.strict(),
|
|
240
|
-
totpCode: exports.secondFactorCodeSchema.optional(),
|
|
241
|
-
})
|
|
242
|
-
.strict();
|
|
243
231
|
/** `PUT /users/me/password` — set or change the password. */
|
|
244
232
|
exports.passwordSetRequestSchema = zod_1.z
|
|
245
233
|
.object({
|
|
@@ -249,6 +237,27 @@ exports.passwordSetRequestSchema = zod_1.z
|
|
|
249
237
|
revokeOtherSessions: zod_1.z.boolean().optional(),
|
|
250
238
|
})
|
|
251
239
|
.strict();
|
|
240
|
+
/**
|
|
241
|
+
* `DELETE /users/me/password` — only while the account has an email to sign
|
|
242
|
+
* in with; `DELETE /users/me/email` — only while it has a password, and
|
|
243
|
+
* confirmed with that password.
|
|
244
|
+
*/
|
|
245
|
+
exports.signInMethodRemoveRequestSchema = zod_1.z.object({ reauth: exports.reauthProofSchema }).strict();
|
|
246
|
+
/** `POST /users/me/email/verify/start` — a code to the address the account moves to. */
|
|
247
|
+
exports.emailChangeStartRequestSchema = zod_1.z.object({ email: accountEmail_1.emailAddressSchema }).strict();
|
|
248
|
+
/**
|
|
249
|
+
* `PUT /users/me/email` — add or change the email: the NEW address and the
|
|
250
|
+
* code it got (`verificationId`, `code`), and the proof it is the person (the
|
|
251
|
+
* password, or a code to the current email; plus the authenticator's).
|
|
252
|
+
*/
|
|
253
|
+
exports.emailSetRequestSchema = zod_1.z
|
|
254
|
+
.object({
|
|
255
|
+
email: accountEmail_1.emailAddressSchema,
|
|
256
|
+
verificationId: zod_1.z.string().trim().min(1).max(64),
|
|
257
|
+
code: sixDigits,
|
|
258
|
+
reauth: exports.reauthProofSchema,
|
|
259
|
+
})
|
|
260
|
+
.strict();
|
|
252
261
|
exports.signInMethodsSchema = zod_1.z.object({
|
|
253
262
|
hasEmail: zod_1.z.boolean(),
|
|
254
263
|
hasPassword: zod_1.z.boolean(),
|
|
@@ -10,8 +10,10 @@ import { email, exact, int, maxLength, minLength, number, object, pattern, posit
|
|
|
10
10
|
* - `reauth`: a signed-in person proving it is them before a sensitive step
|
|
11
11
|
* (`POST /users/me/reauth/email`): a password, an authenticator, deleting the
|
|
12
12
|
* account, linking Commons.
|
|
13
|
+
* - `email_change`: a signed-in account proving the NEW address it moves to
|
|
14
|
+
* (`POST /users/me/email/verify/start`); bound to the account and that address.
|
|
13
15
|
*/
|
|
14
|
-
export const EMAIL_VERIFICATION_PURPOSES = ['signup', 'signin', 'reauth'];
|
|
16
|
+
export const EMAIL_VERIFICATION_PURPOSES = ['signup', 'signin', 'reauth', 'email_change'];
|
|
15
17
|
/** Digits in a code. */
|
|
16
18
|
export const EMAIL_CODE_LENGTH = 6;
|
|
17
19
|
/** How long a code can be confirmed. */
|
|
@@ -60,6 +60,7 @@ export function isEmailSignInChooseAccount(result) {
|
|
|
60
60
|
*/
|
|
61
61
|
export const REAUTH_ACTIONS = [
|
|
62
62
|
'change_password',
|
|
63
|
+
'change_email',
|
|
63
64
|
'totp',
|
|
64
65
|
'link_commons',
|
|
65
66
|
'delete_account',
|
|
@@ -102,6 +103,12 @@ export const SIGN_IN_ERROR_CODES = {
|
|
|
102
103
|
usernameTaken: 'USERNAME_TAKEN',
|
|
103
104
|
/** The email already holds `EMAIL_ACCOUNTS_MAX` accounts: no sign-up adds another. */
|
|
104
105
|
emailAccountsFull: 'EMAIL_ACCOUNTS_FULL',
|
|
106
|
+
/** Removing the one way in left (the email when there is no password, or the reverse). */
|
|
107
|
+
lastSignInMethod: 'LAST_SIGN_IN_METHOD',
|
|
108
|
+
/** Removing the email needs a password set, and is confirmed with it. */
|
|
109
|
+
passwordRequired: 'PASSWORD_REQUIRED',
|
|
110
|
+
/** The new email is the one the account already has. */
|
|
111
|
+
emailUnchanged: 'EMAIL_UNCHANGED',
|
|
105
112
|
};
|
|
106
113
|
/* -------------------------------------------------------------------------- */
|
|
107
114
|
/* Checks */
|
package/dist/esm/identityLink.js
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
*/
|
|
26
26
|
import { z } from 'zod';
|
|
27
27
|
import { identityProofSchema } from './identityProof.js';
|
|
28
|
-
import {
|
|
28
|
+
import { reauthProofSchema } from './signIn.js';
|
|
29
29
|
// The Zod-free half of this contract lives in `./client/` (`@oxy.so/contracts/client`);
|
|
30
30
|
// it is re-exported here so the root entry is unchanged.
|
|
31
31
|
import { IDENTITY_LINK_STATUSES, IDENTITY_LINK_QR_PREFIX, LINK_ID, CHALLENGE, } from './client/identityLink.js';
|
|
@@ -61,9 +61,7 @@ export const identityLinkProofRequestSchema = z
|
|
|
61
61
|
.strict();
|
|
62
62
|
/**
|
|
63
63
|
* `POST /identity/link/:linkId/complete` — the account's own confirmation: a
|
|
64
|
-
* code just sent to its email for this link
|
|
65
|
-
* code when it has one).
|
|
64
|
+
* code just sent to its email for this link, or its password when it has no
|
|
65
|
+
* email (`reauth`, plus its authenticator code when it has one).
|
|
66
66
|
*/
|
|
67
|
-
export const identityLinkCompleteRequestSchema = z
|
|
68
|
-
.object({ reauth: emailReauthProofSchema })
|
|
69
|
-
.strict();
|
|
67
|
+
export const identityLinkCompleteRequestSchema = z.object({ reauth: reauthProofSchema }).strict();
|
package/dist/esm/index.js
CHANGED
|
@@ -100,7 +100,7 @@ export {
|
|
|
100
100
|
EMAIL_VERIFICATION_PURPOSES, EMAIL_CODE_LENGTH, EMAIL_CODE_TTL_MS, EMAIL_CODE_MAX_ATTEMPTS, EMAIL_TICKET_TTL_MS, EMAIL_VERIFICATION_ERROR_CODES, emailAddressSchema, emailTicketSchema, emailVerificationStartRequestSchema, emailVerificationStartResponseSchema, emailVerificationConfirmRequestSchema, emailVerificationConfirmResponseSchema, } from './accountEmail.js';
|
|
101
101
|
export {
|
|
102
102
|
// Email code/link, password and authenticator sign-in
|
|
103
|
-
EMAIL_SIGNIN_LINK_TTL_MS, SIGNIN_SECOND_FACTOR_TTL_MS, SIGNIN_SECOND_FACTOR_MAX_ATTEMPTS, PASSWORD_MIN_LENGTH, PASSWORD_MAX_LENGTH, TOTP_DIGITS, TOTP_PERIOD_SECONDS, TOTP_BACKUP_CODE_COUNT, SIGN_IN_ERROR_CODES, signInIdentifierSchema, passwordInputSchema, newPasswordSchema, secondFactorCodeSchema, emailSignInStartRequestSchema, emailSignInStartResponseSchema, emailSignInConfirmRequestSchema, emailSignInCodeSchema, normalizeEmailSignInCode, EMAIL_SIGNIN_LONG_CODE_ALPHABET, EMAIL_SIGNIN_LONG_CODE_LENGTH, emailSignInCollectRequestSchema, emailSignInLinkRequestSchema, emailSignInLinkResponseSchema, emailSignInPendingSchema, EMAIL_SIGNIN_CHOICE_TTL_MS, EMAIL_ACCOUNTS_MAX, emailSignInAccountOptionSchema, emailSignInChooseAccountSchema, emailSignInChooseRequestSchema, isEmailSignInChooseAccount, passwordSignInRequestSchema, secondFactorSignInRequestSchema, secondFactorRequiredSchema, signUpRequestSchema, isSecondFactorRequired, reauthProofSchema,
|
|
103
|
+
EMAIL_SIGNIN_LINK_TTL_MS, SIGNIN_SECOND_FACTOR_TTL_MS, SIGNIN_SECOND_FACTOR_MAX_ATTEMPTS, PASSWORD_MIN_LENGTH, PASSWORD_MAX_LENGTH, TOTP_DIGITS, TOTP_PERIOD_SECONDS, TOTP_BACKUP_CODE_COUNT, SIGN_IN_ERROR_CODES, signInIdentifierSchema, passwordInputSchema, newPasswordSchema, secondFactorCodeSchema, emailSignInStartRequestSchema, emailSignInStartResponseSchema, emailSignInConfirmRequestSchema, emailSignInCodeSchema, normalizeEmailSignInCode, EMAIL_SIGNIN_LONG_CODE_ALPHABET, EMAIL_SIGNIN_LONG_CODE_LENGTH, emailSignInCollectRequestSchema, emailSignInLinkRequestSchema, emailSignInLinkResponseSchema, emailSignInPendingSchema, EMAIL_SIGNIN_CHOICE_TTL_MS, EMAIL_ACCOUNTS_MAX, emailSignInAccountOptionSchema, emailSignInChooseAccountSchema, emailSignInChooseRequestSchema, isEmailSignInChooseAccount, passwordSignInRequestSchema, secondFactorSignInRequestSchema, secondFactorRequiredSchema, signUpRequestSchema, isSecondFactorRequired, reauthProofSchema, REAUTH_ACTIONS, reauthEmailStartRequestSchema, passwordSetRequestSchema, signInMethodRemoveRequestSchema, emailChangeStartRequestSchema, emailSetRequestSchema, signInMethodsSchema, totpEnrollResponseSchema, totpConfirmRequestSchema, totpReauthRequestSchema, totpBackupCodesResponseSchema, } from './signIn.js';
|
|
104
104
|
export {
|
|
105
105
|
// Linking Commons to an account without a key (ADR 0029 D3)
|
|
106
106
|
IDENTITY_LINK_STATUSES, IDENTITY_LINK_QR_PREFIX, identityLinkIdSchema, buildIdentityLinkQrPayload, parseIdentityLinkQrPayload, identityLinkCreateResponseSchema, identityLinkStateSchema, identityLinkProofRequestSchema, identityLinkCompleteRequestSchema, } from './identityLink.js';
|
|
@@ -191,11 +191,6 @@ export * from './accountAccess.js';
|
|
|
191
191
|
export * from './notifications.js';
|
|
192
192
|
export * from './email/messages.js';
|
|
193
193
|
export * from './stickers.js';
|
|
194
|
-
export { decisionEffortSchema, decisionQuestionSchema, decisionInputSchema, decisionRequestSchema, decisionAnswerSchema, decisionResultSchema, decisionSuccessSchema, decisionFailureSchema, decisionInputBudget, decisionFitsGateway, decisionAnswersMatch, } from './inference/decisions.js';
|
|
195
|
-
export { SCOPED_EXECUTION_CONTRACT_VERSION, SCOPED_REQUEST_ENVELOPE_VERSION, scopedExecutionAudienceSchema, scopedExecutionSchema, canonicalScopedExecutionJson, } from './inference/scopedExecution.js';
|
|
196
|
-
export { scopedInferenceRequestSchema } from './inference/request.js';
|
|
197
|
-
export { PRIVATE_AUTO_EXECUTION_CONTRACT_VERSION, PRIVATE_AUTO_REQUEST_ENVELOPE_VERSION, PRIVATE_AUTO_LIMITS, PRIVATE_AUTO_INSTRUCTIONS, PRIVATE_AUTO_QUESTION, privateAutoPrincipalSchema, privateAutoSourceApprovalSchema, privateAutoExecutionSchema, privateAutoInputSchema, privateAutoOperationId, } from './inference/privateAutoExecution.js';
|
|
198
|
-
export { privateAutoInferenceRequestSchema } from './inference/request.js';
|
|
199
194
|
export { productDefinitionSchema, subjectProductAccessQuerySchema, productBenefitSchema, productOfferSchema, productSubscriptionSourceSchema, productAccessGrantSchema, subjectProductGrantSnapshotSchema, productOfferSegmentSchema, subjectProductAccessSchema, } from './products/access.js';
|
|
200
195
|
export { meteredGenerationSchema } from './inference/economics.js';
|
|
201
196
|
export { canonicalCapabilityJson, inputSatisfiesCapabilityLimits, isLoopbackOrigin, } from './capabilityBindings.js';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { scopedExecutionAudienceSchema } from './scopedExecution.js';
|
|
2
1
|
/**
|
|
3
2
|
* The canonical model catalogue.
|
|
4
3
|
*
|
|
@@ -484,8 +483,6 @@ export const modelDeploymentSchema = z
|
|
|
484
483
|
/** See `version.ts`: exchanged with the data plane on its own. */
|
|
485
484
|
schemaVersion: z.literal(2),
|
|
486
485
|
deploymentId: deploymentIdSchema,
|
|
487
|
-
/** Restrictive audience; never an eligibility approval. */
|
|
488
|
-
scopedExecution: scopedExecutionAudienceSchema.optional(),
|
|
489
486
|
provider: inferenceProviderSlugSchema,
|
|
490
487
|
/** Always revision-pinned: a deployment serves specific weights. */
|
|
491
488
|
modelReference: modelReferenceSchema,
|