@oxy.so/contracts 4.13.0 → 4.14.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/.tsbuildinfo +1 -1
- package/dist/cjs/accountGraph.js +23 -4
- package/dist/cjs/index.js +18 -15
- package/dist/cjs/organizations.js +210 -0
- package/dist/cjs/safety.js +15 -0
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/accountGraph.js +21 -2
- package/dist/esm/index.js +3 -1
- package/dist/esm/organizations.js +207 -0
- package/dist/esm/safety.js +12 -0
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/accountGraph.d.ts +42 -10
- package/dist/types/accountSubject.d.ts +4 -4
- package/dist/types/agency.d.ts +44 -44
- package/dist/types/deviceDirectory.d.ts +180 -180
- package/dist/types/email/messages.d.ts +22 -22
- package/dist/types/externalIdentity.d.ts +51 -51
- package/dist/types/index.d.ts +3 -1
- package/dist/types/organizations.d.ts +1088 -0
- package/dist/types/recommendations.d.ts +28 -28
- package/dist/types/safety.d.ts +24 -0
- package/dist/types/userResponse.d.ts +100 -100
- package/package.json +1 -1
package/dist/cjs/accountGraph.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* {@link ACCOUNT_CATEGORY_IDS} for the four rules that govern it.
|
|
9
9
|
*/
|
|
10
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.createAccountRequestSchema = exports.ACCOUNT_CATEGORY_KINDS = exports.accountCategoriesSchema = exports.MAX_ACCOUNT_CATEGORIES = exports.SELECTABLE_ACCOUNT_CATEGORY_IDS = exports.RETIRED_ACCOUNT_CATEGORY_IDS = exports.accountCategoryIdSchema = exports.ACCOUNT_CATEGORY_IDS = exports.childAccountKindSchema = exports.CHILD_ACCOUNT_KINDS = exports.accountKindSchema = exports.ACCOUNT_KINDS = void 0;
|
|
11
|
+
exports.createAccountRequestSchema = exports.accountNameSchema = exports.ACCOUNT_CATEGORY_KINDS = exports.accountCategoriesSchema = exports.MAX_ACCOUNT_CATEGORIES = exports.SELECTABLE_ACCOUNT_CATEGORY_IDS = exports.RETIRED_ACCOUNT_CATEGORY_IDS = exports.accountCategoryIdSchema = exports.ACCOUNT_CATEGORY_IDS = exports.childAccountKindSchema = exports.CHILD_ACCOUNT_KINDS = exports.accountKindSchema = exports.ACCOUNT_KINDS = void 0;
|
|
12
12
|
exports.isDelegatedActAsEligibleKind = isDelegatedActAsEligibleKind;
|
|
13
13
|
exports.isOperatorSwitchTargetKind = isOperatorSwitchTargetKind;
|
|
14
14
|
exports.isAccountKind = isAccountKind;
|
|
@@ -17,6 +17,7 @@ exports.newlyAddedRetiredCategories = newlyAddedRetiredCategories;
|
|
|
17
17
|
exports.kindAcceptsAccountCategories = kindAcceptsAccountCategories;
|
|
18
18
|
const zod_1 = require("zod");
|
|
19
19
|
const avatarCharacter_1 = require("./avatarCharacter");
|
|
20
|
+
const organizations_1 = require("./organizations");
|
|
20
21
|
const username_1 = require("./username");
|
|
21
22
|
/**
|
|
22
23
|
* The union is spelled out above and the array proves coverage BOTH ways
|
|
@@ -378,11 +379,11 @@ function kindAcceptsAccountCategories(kind) {
|
|
|
378
379
|
* `composeDisplayName`, which already preferred an explicit value — only the
|
|
379
380
|
* storage for one was missing).
|
|
380
381
|
*/
|
|
381
|
-
|
|
382
|
+
exports.accountNameSchema = zod_1.z
|
|
382
383
|
.object({
|
|
383
384
|
first: zod_1.z.string().trim().max(100).optional(),
|
|
384
385
|
last: zod_1.z.string().trim().max(100).optional(),
|
|
385
|
-
displayName: zod_1.z.string().trim().max(
|
|
386
|
+
displayName: zod_1.z.string().trim().max(organizations_1.ORGANIZATION_NAME_MAX_LENGTH).optional(),
|
|
386
387
|
})
|
|
387
388
|
.optional();
|
|
388
389
|
/**
|
|
@@ -412,7 +413,7 @@ exports.createAccountRequestSchema = zod_1.z
|
|
|
412
413
|
* `superRefine` below, which reports its issue against this path.
|
|
413
414
|
*/
|
|
414
415
|
username: username_1.usernameSchema,
|
|
415
|
-
name: accountNameSchema,
|
|
416
|
+
name: exports.accountNameSchema,
|
|
416
417
|
bio: zod_1.z.string().trim().max(500).optional(),
|
|
417
418
|
avatar: zod_1.z.string().optional(),
|
|
418
419
|
description: zod_1.z.string().trim().max(1000).optional(),
|
|
@@ -435,6 +436,7 @@ exports.createAccountRequestSchema = zod_1.z
|
|
|
435
436
|
color: zod_1.z.string().trim().max(32).optional(),
|
|
436
437
|
/** Ordered, PRIMARY FIRST — see rule 2 above {@link ACCOUNT_CATEGORY_IDS}. */
|
|
437
438
|
accountCategories: exports.accountCategoriesSchema.optional(),
|
|
439
|
+
organizationType: zod_1.z.enum(organizations_1.ORGANIZATION_TYPES).optional(),
|
|
438
440
|
/**
|
|
439
441
|
* Create the account already opted OUT of discovery.
|
|
440
442
|
*
|
|
@@ -492,6 +494,23 @@ exports.createAccountRequestSchema = zod_1.z
|
|
|
492
494
|
message: 'Only a bot account carries an avatar character',
|
|
493
495
|
});
|
|
494
496
|
}
|
|
497
|
+
const displayName = request.name?.displayName;
|
|
498
|
+
if (displayName) {
|
|
499
|
+
const parsedName = request.kind === 'organization'
|
|
500
|
+
? organizations_1.organizationNameSchema.safeParse(displayName)
|
|
501
|
+
: zod_1.z.string().max(100).safeParse(displayName);
|
|
502
|
+
if (!parsedName.success) {
|
|
503
|
+
for (const issue of parsedName.error.issues) {
|
|
504
|
+
ctx.addIssue({ ...issue, path: ['name', 'displayName', ...issue.path] });
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
if (request.organizationType !== undefined && request.kind !== 'organization')
|
|
509
|
+
ctx.addIssue({
|
|
510
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
511
|
+
path: ['organizationType'],
|
|
512
|
+
message: 'Organization type requires an organization account',
|
|
513
|
+
});
|
|
495
514
|
// The ONE place `kind` and `username` arrive in the same object, so it is the
|
|
496
515
|
// only place a wire schema CAN apply the per-kind half of the policy: a bot's
|
|
497
516
|
// handle must end in `bot`. Not a second rule — it asks
|
package/dist/cjs/index.js
CHANGED
|
@@ -25,21 +25,21 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
25
25
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
26
26
|
};
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
exports.
|
|
29
|
-
exports.
|
|
30
|
-
exports.
|
|
31
|
-
exports.
|
|
32
|
-
exports.
|
|
33
|
-
exports.
|
|
34
|
-
exports.
|
|
35
|
-
exports.
|
|
36
|
-
exports.
|
|
37
|
-
exports.
|
|
38
|
-
exports.
|
|
39
|
-
exports.
|
|
40
|
-
exports.
|
|
41
|
-
exports.
|
|
42
|
-
exports.personalPlanCatalogueSchema = exports.personalPlanDisplayPriceSchema = void 0;
|
|
28
|
+
exports.themePreferenceSchema = exports.userRelationshipSchema = exports.userNameSchema = exports.NUMERIC_USERNAME_MESSAGE = exports.RESERVED_USERNAME_MESSAGE = exports.BOT_USERNAME_INVALID_MESSAGE = exports.USERNAME_INVALID_MESSAGE = exports.USERNAME_MAX_LENGTH = exports.USERNAME_MIN_LENGTH = exports.applyBotUsernameSuffix = exports.stripDisallowedUsernameCharacters = exports.isValidUsername = exports.usernameSchemaForAccountKind = exports.usernameSchema = exports.financialEffectAttributionSchema = exports.attributeFinancialEffect = exports.accountKindActsAsItself = exports.accountKindActorNature = exports.accountActorNatureSchema = exports.accountActorChainSchema = exports.accountActorChainFromSession = exports.KIND_INDEPENDENT_ACCOUNT_DIMENSIONS = exports.FINANCIAL_EFFECT_DIRECTIONS = exports.ACCOUNT_SUBJECT_CONTRACT_VERSION = exports.ACCOUNT_ACTOR_NATURES = exports.parseAvatarCharacter = exports.avatarCharacterSchema = exports.avatarCharacterFor = exports.AVATAR_PICKABLE_SHAPES = exports.AVATAR_PICKABLE_COLORS = exports.AVATAR_EYE_SPACING = exports.accountNameSchema = exports.createAccountRequestSchema = exports.SELECTABLE_ACCOUNT_CATEGORY_IDS = exports.RETIRED_ACCOUNT_CATEGORY_IDS = exports.newlyAddedRetiredCategories = exports.MAX_ACCOUNT_CATEGORIES = exports.kindAcceptsAccountCategories = exports.isSelectableAccountCategoryId = exports.accountCategoryIdSchema = exports.accountCategoriesSchema = exports.ACCOUNT_CATEGORY_KINDS = exports.ACCOUNT_CATEGORY_IDS = exports.isOperatorSwitchTargetKind = exports.isDelegatedActAsEligibleKind = exports.isAccountKind = exports.childAccountKindSchema = exports.CHILD_ACCOUNT_KINDS = exports.accountKindSchema = exports.ACCOUNT_KINDS = void 0;
|
|
29
|
+
exports.exportLedgerEntrySchema = exports.exportUsageReceiptSchema = exports.exportAttestationSchema = exports.authMethodsResponseSchema = exports.authMethodEntrySchema = exports.domainVerificationInstructionsSchema = exports.resourceDomainOwnershipResponseSchema = exports.resourceDomainOwnershipRequestSchema = exports.domainVerificationRequestSchema = exports.verifiedDomainSchema = exports.signedRecordEnvelopeSchema = exports.didDocumentSchema = exports.didServiceSchema = exports.verificationMethodSchema = exports.appAffinityEventsIngestSchema = exports.appAffinityEventSchema = exports.appAffinityEventTypeSchema = exports.appUserSignalIngestSchema = exports.appInterestInputSchema = exports.appEndorsementInputSchema = exports.recommendationResponseSchema = exports.recommendationItemSchema = exports.recommendationCountSchema = exports.recommendationRequestSchema = exports.recommendationSignalWeightsSchema = exports.recommendationBoostSchema = exports.recommendationExcludeTypeSchema = exports.oxyUserInvalidationEventSchema = exports.isPublishedOxyUserChangeReason = exports.OXY_PUBLISHED_USER_CHANGE_REASONS = exports.OXY_USER_CHANGE_REASONS = exports.OXY_USER_INVALIDATION_CHANNEL = exports.inboxEmailPushDataSchema = exports.INBOX_EMAIL_PUSH_TYPE = exports.INBOX_EMAIL_PUSH_CHANNEL = exports.IDENTITY_APPROVAL_PUSH_CHANNEL = exports.commonsDenyReasonSchema = exports.COMMONS_DENY_REASONS = exports.sessionStatusSchema = exports.publicApplicationSchema = exports.applicationTypeSchema = exports.safeParseContract = exports.resolveUserId = exports.deviceLinkedSessionsResponseSchema = exports.deviceLinkedSessionSchema = exports.currentUserResponseSchema = exports.userProfileUpdateSchema = exports.userResponseSchema = exports.dateOfBirthSchema = exports.USER_PROFILE_COLOR_PRESETS = void 0;
|
|
30
|
+
exports.MODERATION_ATTRIBUTIONS = exports.MODERATION_FINDING_SCOPES = exports.MODERATION_SEVERITIES = exports.isFullReputationBalance = exports.awardReputationSchema = exports.reputationInfluenceResultSchema = exports.reputationLeaderboardEntrySchema = exports.reputationLeaderboardUserSchema = exports.reputationRulesResponseSchema = exports.reputationRuleSchema = exports.reputationBalanceSchema = exports.reputationBalanceSummarySchema = exports.reputationReliabilitySchema = exports.reputationInfluenceSchema = exports.reputationBalanceBreakdownSchema = exports.reputationTransactionSchema = exports.reputationInfluenceContextSchema = exports.reputationTargetEntityTypeSchema = exports.trustTierSchema = exports.reputationTransactionStatusSchema = exports.reputationCategorySchema = exports.REPUTATION_INFLUENCE_CONTEXTS = exports.REPUTATION_TARGET_ENTITY_TYPES = exports.TRUST_TIERS = exports.REPUTATION_TRANSACTION_STATUSES = exports.REPUTATION_CATEGORIES = exports.credentialVerifyResultSchema = exports.credentialListResultSchema = exports.credentialIssueResultSchema = exports.verifiableCredentialResponseSchema = exports.credentialRecordSchema = exports.vouchResultSchema = exports.personhoodStatusResultSchema = exports.personhoodBreakdownSchema = exports.personhoodVouchRecordSchema = exports.validationVoteResultSchema = exports.validationRequestSummarySchema = exports.validationOpenResultSchema = exports.validationOpenRequestSchema = exports.validationVerdictRecordSchema = exports.realLifeAttestationResultSchema = exports.realLifeAttestationRecordSchema = exports.signedPublicCardSchema = exports.publicCardSchema = exports.logPageResponseSchema = exports.chainHeadResponseSchema = exports.oxySignedRecordTypeSchema = exports.exportBundleSchema = exports.exportFinancialSectionSchema = exports.exportUsageReservationSchema = void 0;
|
|
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
|
+
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
|
+
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.inferenceHttpsUrlSchema = exports.inferenceDateSchema = exports.inferenceTimestampSchema = exports.inferenceEnvironmentSchema = exports.idempotencyKeySchema = exports.generationIdSchema = exports.requestIdSchema = exports.oxyCredentialIdSchema = 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.passwordSetRequestSchema = exports.reauthEmailStartRequestSchema = exports.REAUTH_ACTIONS = exports.emailReauthProofSchema = exports.reauthProofSchema = exports.isSecondFactorRequired = exports.signUpRequestSchema = exports.secondFactorRequiredSchema = exports.secondFactorSignInRequestSchema = exports.passwordSignInRequestSchema = 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.realtimeSessionKindSchema = exports.inferenceApiFormatSchema = exports.modelPowerClassSchema = exports.powerLevelSchema = exports.reasoningEffortSchema = exports.inferenceOutputModalitySchema = exports.inferenceModalitySchema = exports.priceSnapshotSchema = 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 = void 0;
|
|
36
|
+
exports.toolDefinitionSchema = exports.inferenceReasoningSchema = exports.samplingParametersSchema = exports.inferenceInputSchema = exports.inferenceMessageSchema = exports.inferenceMessageRoleSchema = exports.inferenceToolCallSchema = exports.inferenceContentPartSchema = 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 = void 0;
|
|
37
|
+
exports.realtimeSessionResumeCommandSchema = exports.realtimeResponseCancelCommandSchema = exports.realtimeResponseCreateCommandSchema = exports.realtimeInputAudioClearCommandSchema = exports.realtimeInputAudioCommitCommandSchema = exports.realtimeInputAudioAppendCommandSchema = exports.realtimeItemTruncateCommandSchema = exports.realtimeItemDeleteCommandSchema = 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 = void 0;
|
|
38
|
+
exports.kaanaCredentialOutcomeRequestSchema = exports.kaanaCredentialRevokeOutcomeRequestSchema = exports.kaanaCredentialRotateOutcomeRequestSchema = exports.kaanaCredentialCreateOutcomeRequestSchema = exports.kaanaCredentialMutationSchema = exports.kaanaCredentialRevokeMutationSchema = exports.kaanaCredentialRotateMutationSchema = exports.kaanaCredentialCreateMutationSchema = 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 = void 0;
|
|
39
|
+
exports.INFERENCE_ECONOMIC_TREATMENTS = exports.productEntitlementSchema = exports.costCenterSpendSchema = exports.costCenterSchema = exports.costCenterStatusSchema = exports.COST_CENTER_STATUSES = exports.payAsYouGoEntitlementSchema = exports.productPlanSchema = 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 = void 0;
|
|
40
|
+
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 = exports.catalogRegistrationSchema = exports.appCapabilityCatalogSchema = exports.catalogEventSchema = exports.catalogToolSchema = exports.auditEventSchema = exports.auditResultSchema = exports.policyDecisionSchema = exports.invocationPrincipalSchema = exports.capabilityTicketClaimsSchema = exports.automationDefinitionSchema = exports.automationDataFlowSchema = exports.automationActorSelectionSchema = exports.automationTriggerSchema = 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 = void 0;
|
|
41
|
+
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.privateAutoInferenceRequestSchema = exports.privateAutoOperationId = exports.privateAutoInputSchema = exports.privateAutoExecutionSchema = exports.privateAutoSourceApprovalSchema = exports.privateAutoPrincipalSchema = exports.PRIVATE_AUTO_QUESTION = exports.PRIVATE_AUTO_INSTRUCTIONS = exports.PRIVATE_AUTO_LIMITS = exports.PRIVATE_AUTO_REQUEST_ENVELOPE_VERSION = exports.PRIVATE_AUTO_EXECUTION_CONTRACT_VERSION = exports.scopedInferenceRequestSchema = exports.canonicalScopedExecutionJson = exports.scopedExecutionSchema = exports.scopedExecutionAudienceSchema = exports.SCOPED_REQUEST_ENVELOPE_VERSION = exports.SCOPED_EXECUTION_CONTRACT_VERSION = exports.decisionAnswersMatch = exports.decisionFitsGateway = exports.decisionInputBudget = exports.decisionFailureSchema = exports.decisionSuccessSchema = exports.decisionResultSchema = exports.decisionAnswerSchema = exports.decisionRequestSchema = exports.decisionInputSchema = exports.decisionQuestionSchema = exports.decisionEffortSchema = exports.inboxInferenceStreamEventSchema = exports.inboxThreadSummaryResponseSchema = exports.inboxSmartRepliesResponseSchema = exports.inboxNaturalSearchResponseSchema = void 0;
|
|
42
|
+
exports.personalPlanCatalogueSchema = exports.personalPlanDisplayPriceSchema = exports.productSubscriptionCancellationResultSchema = void 0;
|
|
43
43
|
var accountGraph_1 = require("./accountGraph");
|
|
44
44
|
Object.defineProperty(exports, "ACCOUNT_KINDS", { enumerable: true, get: function () { return accountGraph_1.ACCOUNT_KINDS; } });
|
|
45
45
|
Object.defineProperty(exports, "accountKindSchema", { enumerable: true, get: function () { return accountGraph_1.accountKindSchema; } });
|
|
@@ -59,6 +59,7 @@ Object.defineProperty(exports, "newlyAddedRetiredCategories", { enumerable: true
|
|
|
59
59
|
Object.defineProperty(exports, "RETIRED_ACCOUNT_CATEGORY_IDS", { enumerable: true, get: function () { return accountGraph_1.RETIRED_ACCOUNT_CATEGORY_IDS; } });
|
|
60
60
|
Object.defineProperty(exports, "SELECTABLE_ACCOUNT_CATEGORY_IDS", { enumerable: true, get: function () { return accountGraph_1.SELECTABLE_ACCOUNT_CATEGORY_IDS; } });
|
|
61
61
|
Object.defineProperty(exports, "createAccountRequestSchema", { enumerable: true, get: function () { return accountGraph_1.createAccountRequestSchema; } });
|
|
62
|
+
Object.defineProperty(exports, "accountNameSchema", { enumerable: true, get: function () { return accountGraph_1.accountNameSchema; } });
|
|
62
63
|
var avatarCharacter_1 = require("./avatarCharacter");
|
|
63
64
|
Object.defineProperty(exports, "AVATAR_EYE_SPACING", { enumerable: true, get: function () { return avatarCharacter_1.AVATAR_EYE_SPACING; } });
|
|
64
65
|
Object.defineProperty(exports, "AVATAR_PICKABLE_COLORS", { enumerable: true, get: function () { return avatarCharacter_1.AVATAR_PICKABLE_COLORS; } });
|
|
@@ -880,3 +881,5 @@ var plans_1 = require("./products/plans");
|
|
|
880
881
|
Object.defineProperty(exports, "personalPlanDisplayPriceSchema", { enumerable: true, get: function () { return plans_1.personalPlanDisplayPriceSchema; } });
|
|
881
882
|
Object.defineProperty(exports, "personalPlanCatalogueSchema", { enumerable: true, get: function () { return plans_1.personalPlanCatalogueSchema; } });
|
|
882
883
|
__exportStar(require("./products/checkout"), exports);
|
|
884
|
+
__exportStar(require("./organizations"), exports);
|
|
885
|
+
__exportStar(require("./safety"), exports);
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.organizationCurationResultSchema = exports.organizationCurationSchema = exports.organizationErrorSchema = exports.ORGANIZATION_ERROR_CODES = exports.organizationMergeSchema = exports.organizationExternalResolutionSchema = exports.organizationExternalSchema = exports.organizationImportBatchResultSchema = exports.organizationImportBatchSchema = exports.organizationExternalInputSchema = exports.organizationClaimReviewSchema = exports.organizationClaimListSchema = exports.organizationClaimListQuerySchema = exports.organizationClaimDetailSchema = exports.organizationClaimSchema = exports.organizationClaimInputSchema = exports.organizationBatchSchema = exports.organizationBatchInputSchema = exports.organizationListSchema = exports.organizationSearchSchema = exports.organizationSchema = exports.updateOrganizationSchema = exports.createOrganizationSchema = exports.organizationNameSchema = exports.ORGANIZATION_NAME_MAX_LENGTH = exports.organizationAliasSchema = exports.ORGANIZATION_CLAIM_DECISIONS = exports.ORGANIZATION_ALIAS_KINDS = exports.ORGANIZATION_CLAIM_STATUSES = exports.ORGANIZATION_STATUSES = exports.ORGANIZATION_TYPES = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/** Real-world identity classification, independent of account topics and permissions. */
|
|
6
|
+
exports.ORGANIZATION_TYPES = [
|
|
7
|
+
'business',
|
|
8
|
+
'nonprofit',
|
|
9
|
+
'public_body',
|
|
10
|
+
'community',
|
|
11
|
+
'other',
|
|
12
|
+
];
|
|
13
|
+
exports.ORGANIZATION_STATUSES = ['active', 'inactive', 'merged', 'suppressed'];
|
|
14
|
+
exports.ORGANIZATION_CLAIM_STATUSES = ['unclaimed', 'claimed'];
|
|
15
|
+
exports.ORGANIZATION_ALIAS_KINDS = [
|
|
16
|
+
'name_variant',
|
|
17
|
+
'former_name',
|
|
18
|
+
'localized_name',
|
|
19
|
+
'marketing_name',
|
|
20
|
+
'misspelling',
|
|
21
|
+
];
|
|
22
|
+
exports.ORGANIZATION_CLAIM_DECISIONS = ['pending', 'approved', 'rejected'];
|
|
23
|
+
const id = zod_1.z.string().min(1).max(128);
|
|
24
|
+
const optionalText = (max) => zod_1.z.string().trim().min(1).max(max).nullable().optional();
|
|
25
|
+
exports.organizationAliasSchema = zod_1.z
|
|
26
|
+
.object({
|
|
27
|
+
alias: zod_1.z.string().trim().min(1).max(300),
|
|
28
|
+
kind: zod_1.z.enum(exports.ORGANIZATION_ALIAS_KINDS),
|
|
29
|
+
language: zod_1.z.string().min(2).max(35).optional(),
|
|
30
|
+
})
|
|
31
|
+
.strict();
|
|
32
|
+
exports.ORGANIZATION_NAME_MAX_LENGTH = 300;
|
|
33
|
+
exports.organizationNameSchema = zod_1.z
|
|
34
|
+
.string()
|
|
35
|
+
.trim()
|
|
36
|
+
.min(1)
|
|
37
|
+
.max(exports.ORGANIZATION_NAME_MAX_LENGTH)
|
|
38
|
+
.refine((value) => !/[<>]/.test(value) &&
|
|
39
|
+
Array.from(value).every((character) => character.charCodeAt(0) >= 32 && character.charCodeAt(0) !== 127), 'Organization name must be plain text');
|
|
40
|
+
exports.createOrganizationSchema = zod_1.z
|
|
41
|
+
.object({
|
|
42
|
+
name: exports.organizationNameSchema,
|
|
43
|
+
organizationType: zod_1.z.enum(exports.ORGANIZATION_TYPES),
|
|
44
|
+
legalName: optionalText(300),
|
|
45
|
+
websiteUrl: zod_1.z
|
|
46
|
+
.string()
|
|
47
|
+
.url()
|
|
48
|
+
.max(2048)
|
|
49
|
+
.refine((value) => /^https?:\/\//.test(value), 'Use HTTP or HTTPS')
|
|
50
|
+
.nullable()
|
|
51
|
+
.optional(),
|
|
52
|
+
countryCode: zod_1.z
|
|
53
|
+
.string()
|
|
54
|
+
.regex(/^[A-Z]{2}$/)
|
|
55
|
+
.nullable()
|
|
56
|
+
.optional(),
|
|
57
|
+
aliases: zod_1.z.array(exports.organizationAliasSchema).max(100).optional(),
|
|
58
|
+
})
|
|
59
|
+
.strict();
|
|
60
|
+
exports.updateOrganizationSchema = exports.createOrganizationSchema.partial();
|
|
61
|
+
exports.organizationSchema = exports.createOrganizationSchema
|
|
62
|
+
.extend({
|
|
63
|
+
accountId: id,
|
|
64
|
+
username: zod_1.z.string().nullable(),
|
|
65
|
+
avatar: zod_1.z.string().nullable(),
|
|
66
|
+
legalName: zod_1.z.string().nullable(),
|
|
67
|
+
websiteUrl: zod_1.z.string().nullable(),
|
|
68
|
+
countryCode: zod_1.z.string().nullable(),
|
|
69
|
+
aliases: zod_1.z.array(exports.organizationAliasSchema),
|
|
70
|
+
verifiedDomains: zod_1.z.array(zod_1.z.string()),
|
|
71
|
+
claimStatus: zod_1.z.enum(exports.ORGANIZATION_CLAIM_STATUSES),
|
|
72
|
+
status: zod_1.z.enum(exports.ORGANIZATION_STATUSES),
|
|
73
|
+
mergedIntoAccountId: id.nullable(),
|
|
74
|
+
createdAt: zod_1.z.string().datetime(),
|
|
75
|
+
updatedAt: zod_1.z.string().datetime(),
|
|
76
|
+
})
|
|
77
|
+
.strict();
|
|
78
|
+
exports.organizationSearchSchema = zod_1.z
|
|
79
|
+
.object({
|
|
80
|
+
query: zod_1.z.string().trim().max(200).default(''),
|
|
81
|
+
organizationType: zod_1.z.enum(exports.ORGANIZATION_TYPES).optional(),
|
|
82
|
+
limit: zod_1.z.coerce.number().int().min(1).max(50).default(20),
|
|
83
|
+
cursor: zod_1.z.string().min(1).max(2048).optional(),
|
|
84
|
+
})
|
|
85
|
+
.strict();
|
|
86
|
+
exports.organizationListSchema = zod_1.z
|
|
87
|
+
.object({ items: zod_1.z.array(exports.organizationSchema), nextCursor: zod_1.z.string().nullable() })
|
|
88
|
+
.strict();
|
|
89
|
+
exports.organizationBatchInputSchema = zod_1.z.object({ ids: zod_1.z.array(id).min(1).max(100) }).strict();
|
|
90
|
+
exports.organizationBatchSchema = zod_1.z
|
|
91
|
+
.object({
|
|
92
|
+
items: zod_1.z.array(zod_1.z.object({ requestedAccountId: id, organization: exports.organizationSchema }).strict()),
|
|
93
|
+
missingIds: zod_1.z.array(id),
|
|
94
|
+
})
|
|
95
|
+
.strict();
|
|
96
|
+
exports.organizationClaimInputSchema = zod_1.z
|
|
97
|
+
.object({
|
|
98
|
+
evidenceReference: zod_1.z.string().trim().min(1).max(1000),
|
|
99
|
+
})
|
|
100
|
+
.strict();
|
|
101
|
+
exports.organizationClaimSchema = zod_1.z
|
|
102
|
+
.object({
|
|
103
|
+
id,
|
|
104
|
+
accountId: id,
|
|
105
|
+
claimantUserId: id,
|
|
106
|
+
status: zod_1.z.enum(exports.ORGANIZATION_CLAIM_DECISIONS),
|
|
107
|
+
createdAt: zod_1.z.string().datetime(),
|
|
108
|
+
})
|
|
109
|
+
.strict();
|
|
110
|
+
exports.organizationClaimDetailSchema = exports.organizationClaimSchema
|
|
111
|
+
.extend({
|
|
112
|
+
evidenceReference: zod_1.z.string(),
|
|
113
|
+
reviewEvidenceReference: zod_1.z.string().nullable(),
|
|
114
|
+
reviewedAt: zod_1.z.string().datetime().nullable(),
|
|
115
|
+
})
|
|
116
|
+
.strict();
|
|
117
|
+
exports.organizationClaimListQuerySchema = zod_1.z
|
|
118
|
+
.object({
|
|
119
|
+
status: zod_1.z.enum(exports.ORGANIZATION_CLAIM_DECISIONS).optional(),
|
|
120
|
+
limit: zod_1.z.coerce.number().int().min(1).max(50).default(20),
|
|
121
|
+
cursor: zod_1.z.string().min(1).max(2048).optional(),
|
|
122
|
+
})
|
|
123
|
+
.strict();
|
|
124
|
+
exports.organizationClaimListSchema = zod_1.z
|
|
125
|
+
.object({ items: zod_1.z.array(exports.organizationClaimDetailSchema), nextCursor: zod_1.z.string().nullable() })
|
|
126
|
+
.strict();
|
|
127
|
+
exports.organizationClaimReviewSchema = zod_1.z
|
|
128
|
+
.object({
|
|
129
|
+
decision: zod_1.z.enum(['approved', 'rejected']),
|
|
130
|
+
evidenceReference: zod_1.z.string().trim().min(1).max(1000),
|
|
131
|
+
})
|
|
132
|
+
.strict();
|
|
133
|
+
exports.organizationExternalInputSchema = zod_1.z
|
|
134
|
+
.object({
|
|
135
|
+
namespace: zod_1.z.string().regex(/^[a-z][a-z0-9_-]{0,63}$/),
|
|
136
|
+
externalId: zod_1.z.string().min(1).max(256),
|
|
137
|
+
accountId: id.optional(),
|
|
138
|
+
organization: exports.createOrganizationSchema,
|
|
139
|
+
evidenceReference: zod_1.z.string().trim().min(1).max(1000),
|
|
140
|
+
avatarFileId: id.optional(),
|
|
141
|
+
})
|
|
142
|
+
.strict();
|
|
143
|
+
/** Automated ingestion can create neutral identities in its granted namespace only. */
|
|
144
|
+
exports.organizationImportBatchSchema = zod_1.z
|
|
145
|
+
.object({
|
|
146
|
+
namespace: exports.organizationExternalInputSchema.shape.namespace,
|
|
147
|
+
items: zod_1.z
|
|
148
|
+
.array(exports.organizationExternalInputSchema.pick({
|
|
149
|
+
externalId: true,
|
|
150
|
+
organization: true,
|
|
151
|
+
evidenceReference: true,
|
|
152
|
+
avatarFileId: true,
|
|
153
|
+
}))
|
|
154
|
+
.min(1)
|
|
155
|
+
.max(100),
|
|
156
|
+
})
|
|
157
|
+
.strict()
|
|
158
|
+
.refine((input) => new Set(input.items.map((item) => item.externalId)).size === input.items.length, 'External IDs must be unique within the batch');
|
|
159
|
+
exports.organizationImportBatchResultSchema = zod_1.z
|
|
160
|
+
.object({
|
|
161
|
+
items: zod_1.z.array(zod_1.z.object({ externalId: zod_1.z.string(), accountId: id, created: zod_1.z.boolean() }).strict()),
|
|
162
|
+
})
|
|
163
|
+
.strict();
|
|
164
|
+
exports.organizationExternalSchema = zod_1.z
|
|
165
|
+
.object({ accountId: id, created: zod_1.z.boolean() })
|
|
166
|
+
.strict();
|
|
167
|
+
exports.organizationExternalResolutionSchema = zod_1.z.object({ accountId: id }).strict();
|
|
168
|
+
exports.organizationMergeSchema = zod_1.z
|
|
169
|
+
.object({
|
|
170
|
+
targetAccountId: id,
|
|
171
|
+
evidenceReference: zod_1.z.string().trim().min(1).max(1000),
|
|
172
|
+
})
|
|
173
|
+
.strict();
|
|
174
|
+
exports.ORGANIZATION_ERROR_CODES = [
|
|
175
|
+
'bad_request',
|
|
176
|
+
'unauthorized',
|
|
177
|
+
'forbidden',
|
|
178
|
+
'not_found',
|
|
179
|
+
'unknown_route',
|
|
180
|
+
'conflict',
|
|
181
|
+
'validation_failed',
|
|
182
|
+
'rate_limited',
|
|
183
|
+
'internal_error',
|
|
184
|
+
'service_unavailable',
|
|
185
|
+
];
|
|
186
|
+
exports.organizationErrorSchema = zod_1.z
|
|
187
|
+
.object({
|
|
188
|
+
error: zod_1.z
|
|
189
|
+
.object({
|
|
190
|
+
code: zod_1.z.enum(exports.ORGANIZATION_ERROR_CODES),
|
|
191
|
+
message: zod_1.z.string(),
|
|
192
|
+
details: zod_1.z
|
|
193
|
+
.record(zod_1.z.string(), zod_1.z.union([zod_1.z.string(), zod_1.z.number(), zod_1.z.boolean(), zod_1.z.null()]))
|
|
194
|
+
.optional(),
|
|
195
|
+
})
|
|
196
|
+
.strict(),
|
|
197
|
+
})
|
|
198
|
+
.strict();
|
|
199
|
+
/** Staff curation corrects neutral facts or moderates visibility without claiming ownership. */
|
|
200
|
+
exports.organizationCurationSchema = zod_1.z
|
|
201
|
+
.object({
|
|
202
|
+
changes: exports.updateOrganizationSchema.optional(),
|
|
203
|
+
status: zod_1.z.enum(['active', 'inactive', 'suppressed']).optional(),
|
|
204
|
+
evidenceReference: zod_1.z.string().trim().min(1).max(1000),
|
|
205
|
+
})
|
|
206
|
+
.strict()
|
|
207
|
+
.refine((input) => input.changes !== undefined || input.status !== undefined, 'At least one change is required');
|
|
208
|
+
exports.organizationCurationResultSchema = zod_1.z
|
|
209
|
+
.object({ accountId: id, status: zod_1.z.enum(['active', 'inactive', 'suppressed']) })
|
|
210
|
+
.strict();
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.profileAccessDecisionSchema = exports.profileAccessInputSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/** The requester is authenticated by the bearer; applications cannot submit viewer IDs. */
|
|
6
|
+
exports.profileAccessInputSchema = zod_1.z
|
|
7
|
+
.object({ subjectAccountId: zod_1.z.string().min(1).max(128) })
|
|
8
|
+
.strict();
|
|
9
|
+
exports.profileAccessDecisionSchema = zod_1.z
|
|
10
|
+
.object({
|
|
11
|
+
allowed: zod_1.z.boolean(),
|
|
12
|
+
reason: zod_1.z.enum(['public', 'owner', 'private', 'blocked', 'unavailable']),
|
|
13
|
+
policyVersion: zod_1.z.literal('1'),
|
|
14
|
+
})
|
|
15
|
+
.strict();
|