@oxy.so/contracts 7.2.0 → 7.3.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/age.js +126 -0
- package/dist/cjs/client/index.js +15 -3
- package/dist/cjs/client/safety.js +10 -1
- package/dist/cjs/index.js +26 -14
- package/dist/cjs/safety.js +14 -1
- package/dist/cjs/signIn.js +9 -0
- package/dist/cjs/userResponse.js +15 -31
- package/dist/esm/client/age.js +117 -0
- package/dist/esm/client/index.js +2 -1
- package/dist/esm/client/safety.js +9 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/safety.js +14 -1
- package/dist/esm/signIn.js +9 -0
- package/dist/esm/userResponse.js +15 -31
- package/dist/types/client/age.d.ts +94 -0
- package/dist/types/client/index.d.ts +3 -1
- package/dist/types/client/safety.d.ts +13 -0
- package/dist/types/externalIdentity.d.ts +5 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/inference/embeddings.d.ts +2 -2
- package/dist/types/inference/errors.d.ts +2 -2
- package/dist/types/inference/inbox.d.ts +1 -1
- package/dist/types/inference/realtime.d.ts +2 -2
- package/dist/types/inference/streamEvents.d.ts +2 -2
- package/dist/types/oxyRecordTypes.d.ts +1 -1
- package/dist/types/safety.d.ts +24 -0
- package/dist/types/signIn.d.ts +1 -0
- package/dist/types/userResponse.d.ts +21 -1
- package/package.json +2 -2
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DATE_OF_BIRTH_REFUSALS = exports.ADULT_AGE_YEARS = exports.MINIMUM_UNSUPERVISED_AGE_YEARS = exports.DATE_OF_BIRTH_MESSAGES = exports.DATE_OF_BIRTH_PATTERN = exports.MIN_BIRTH_YEAR = exports.AGE_BANDS = void 0;
|
|
4
|
+
exports.isRealCalendarDate = isRealCalendarDate;
|
|
5
|
+
exports.isBirthYearInRange = isBirthYearInRange;
|
|
6
|
+
exports.isNotAfterToday = isNotAfterToday;
|
|
7
|
+
exports.ageInYears = ageInYears;
|
|
8
|
+
exports.ageBandOf = ageBandOf;
|
|
9
|
+
exports.isSelfServiceBandChange = isSelfServiceBandChange;
|
|
10
|
+
/**
|
|
11
|
+
* Age bands (ADR 0067): the one answer every Oxy app gets to "how old is this
|
|
12
|
+
* person, as far as protection goes".
|
|
13
|
+
*
|
|
14
|
+
* A band is DERIVED from the account's date of birth on every read and never
|
|
15
|
+
* stored: it changes on a birthday without any write touching the row. An
|
|
16
|
+
* application never receives the date itself, only the band.
|
|
17
|
+
*
|
|
18
|
+
* - `under13`: below {@link MINIMUM_UNSUPERVISED_AGE_YEARS}. Such an account
|
|
19
|
+
* exists only under supervision (ADR 0041); sign-up creates it awaiting a
|
|
20
|
+
* guardian.
|
|
21
|
+
* - `teen`: old enough for an account of their own, not yet an adult. Apps
|
|
22
|
+
* apply their protective defaults.
|
|
23
|
+
* - `adult`: at least {@link ADULT_AGE_YEARS}.
|
|
24
|
+
*
|
|
25
|
+
* An account with no date of birth has NO band (`undefined`), which is distinct
|
|
26
|
+
* from every value here: "unknown" is never read as "adult" or as "minor".
|
|
27
|
+
*/
|
|
28
|
+
exports.AGE_BANDS = ['under13', 'teen', 'adult'];
|
|
29
|
+
/**
|
|
30
|
+
* The earliest calendar year a date of birth may name.
|
|
31
|
+
*
|
|
32
|
+
* Not a biological bound: it catches an obviously transposed year (`1027` for
|
|
33
|
+
* `2027`) with a clear message instead of a 150-year-old account. No living
|
|
34
|
+
* person's real date is refused by it. The server's schema and every picker
|
|
35
|
+
* read this one value, so a picker cannot offer a date the API refuses.
|
|
36
|
+
*/
|
|
37
|
+
exports.MIN_BIRTH_YEAR = 1900;
|
|
38
|
+
/** The wire format of a date of birth: `YYYY-MM-DD`, nothing looser. */
|
|
39
|
+
exports.DATE_OF_BIRTH_PATTERN = /^\d{4}-\d{2}-\d{2}$/;
|
|
40
|
+
/**
|
|
41
|
+
* Whether a `YYYY-MM-DD` string names a day that exists on the Gregorian
|
|
42
|
+
* calendar. The pattern only constrains digit count and would pass `2024-02-30`.
|
|
43
|
+
*/
|
|
44
|
+
function isRealCalendarDate(value) {
|
|
45
|
+
const [year, month, day] = value.split('-').map(Number);
|
|
46
|
+
const isLeapYear = (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
|
|
47
|
+
const daysInMonth = [31, isLeapYear ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
48
|
+
return month >= 1 && month <= 12 && day >= 1 && day <= daysInMonth[month - 1];
|
|
49
|
+
}
|
|
50
|
+
/** Whether a `YYYY-MM-DD` string is not before {@link MIN_BIRTH_YEAR}. */
|
|
51
|
+
function isBirthYearInRange(value) {
|
|
52
|
+
return Number(value.slice(0, 4)) >= exports.MIN_BIRTH_YEAR;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Whether a `YYYY-MM-DD` string is today (UTC) or earlier. Two zero-padded ISO
|
|
56
|
+
* dates of equal length sort exactly as their dates do.
|
|
57
|
+
*/
|
|
58
|
+
function isNotAfterToday(value, today = new Date()) {
|
|
59
|
+
return value <= today.toISOString().slice(0, 10);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* What each date-of-birth rule says when it fails. The server's schema and the
|
|
63
|
+
* client's check word a refusal identically because both read these.
|
|
64
|
+
*/
|
|
65
|
+
exports.DATE_OF_BIRTH_MESSAGES = {
|
|
66
|
+
format: 'dateOfBirth must be an ISO 8601 calendar date (YYYY-MM-DD)',
|
|
67
|
+
calendar: 'dateOfBirth is not a real calendar date',
|
|
68
|
+
tooEarly: `dateOfBirth must not be before ${exports.MIN_BIRTH_YEAR}`,
|
|
69
|
+
future: 'dateOfBirth must not be in the future',
|
|
70
|
+
};
|
|
71
|
+
/** Below this age an account exists only under supervision. */
|
|
72
|
+
exports.MINIMUM_UNSUPERVISED_AGE_YEARS = 13;
|
|
73
|
+
/** From this age an account is an adult's. */
|
|
74
|
+
exports.ADULT_AGE_YEARS = 18;
|
|
75
|
+
/**
|
|
76
|
+
* Whole years between an ISO calendar date (`YYYY-MM-DD`) and `today`, both
|
|
77
|
+
* read in UTC.
|
|
78
|
+
*
|
|
79
|
+
* UTC because a date of birth has no time of day and no zone of its own, so
|
|
80
|
+
* there is no authoritative zone to evaluate it in; UTC is the one every server
|
|
81
|
+
* and every client agrees on without configuration. The effect is a band that
|
|
82
|
+
* can change up to a day before or after the person's own local midnight.
|
|
83
|
+
*
|
|
84
|
+
* A birthday on 29 February counts on 1 March in a year that has none, which is
|
|
85
|
+
* what `Date.UTC` yields for the 29th of a 28-day February.
|
|
86
|
+
*/
|
|
87
|
+
function ageInYears(dateOfBirth, today = new Date()) {
|
|
88
|
+
const [year, month, day] = dateOfBirth.split('-').map(Number);
|
|
89
|
+
const todayUtc = Date.UTC(today.getUTCFullYear(), today.getUTCMonth(), today.getUTCDate());
|
|
90
|
+
let age = today.getUTCFullYear() - year;
|
|
91
|
+
if (Date.UTC(year + age, month - 1, day) > todayUtc)
|
|
92
|
+
age -= 1;
|
|
93
|
+
return age;
|
|
94
|
+
}
|
|
95
|
+
/** The band of a validated ISO calendar date of birth. */
|
|
96
|
+
function ageBandOf(dateOfBirth, today = new Date()) {
|
|
97
|
+
const age = ageInYears(dateOfBirth, today);
|
|
98
|
+
if (age < exports.MINIMUM_UNSUPERVISED_AGE_YEARS)
|
|
99
|
+
return 'under13';
|
|
100
|
+
return age < exports.ADULT_AGE_YEARS ? 'teen' : 'adult';
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Whether a person may move their own date of birth from one band to another.
|
|
104
|
+
*
|
|
105
|
+
* A first date (no band yet) is always theirs to give. After that the band may
|
|
106
|
+
* stay or get YOUNGER, never older: growing older on paper is how a protection
|
|
107
|
+
* would be removed, and that takes a reviewed correction, not a profile edit.
|
|
108
|
+
*/
|
|
109
|
+
function isSelfServiceBandChange(from, to) {
|
|
110
|
+
if (from === undefined)
|
|
111
|
+
return true;
|
|
112
|
+
return exports.AGE_BANDS.indexOf(to) <= exports.AGE_BANDS.indexOf(from);
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Why a profile edit to the date of birth was refused: the error's `code`,
|
|
116
|
+
* which a client maps to its own copy.
|
|
117
|
+
*
|
|
118
|
+
* - `locked`: the date is set and this edit would remove it or move the
|
|
119
|
+
* account to an older band.
|
|
120
|
+
* - `supervisionRequired`: the date would put an existing account below the
|
|
121
|
+
* minimum unsupervised age; that account enrols through supervision.
|
|
122
|
+
*/
|
|
123
|
+
exports.DATE_OF_BIRTH_REFUSALS = {
|
|
124
|
+
locked: 'DATE_OF_BIRTH_LOCKED',
|
|
125
|
+
supervisionRequired: 'DATE_OF_BIRTH_SUPERVISION_REQUIRED',
|
|
126
|
+
};
|
package/dist/cjs/client/index.js
CHANGED
|
@@ -33,9 +33,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
33
33
|
exports.ORGANIZATION_KEY_PROOF_ACTION_VALUES = exports.ORGANIZATION_KEY_PROOF_ACTIONS = exports.ORGANIZATION_KEY_OPERATIONS = exports.ORGANIZATION_KEY_ERROR_CODES = exports.executeAgentKeyOperationCheck = exports.agentVerifyRequestCheck = exports.agentProofClaimsCheck = exports.agentKeyOperationResultCheck = exports.agentKeyOperationCheck = exports.agentKeyOperationChallengeCheck = exports.agentKeyListResponseCheck = exports.agentChallengeRequestCheck = exports.AGENT_PROOF_TTL_MS = exports.AGENT_PROOF_AUDIENCE = exports.AGENT_PROOF_ACTIONS = exports.ACCOUNT_AUTH_METHODS = exports.emailVerificationStartResponseCheck = exports.emailVerificationConfirmResponseCheck = exports.emailTicketCheck = exports.emailAddressCheck = exports.EMAIL_VERIFICATION_PURPOSES = exports.EMAIL_VERIFICATION_ERROR_CODES = exports.EMAIL_TICKET_TTL_MS = exports.EMAIL_CODE_TTL_MS = exports.EMAIL_CODE_MAX_ATTEMPTS = exports.EMAIL_CODE_LENGTH = exports.isPlainTextTitle = exports.accountTitleCheck = exports.accountNamePolicyForKind = exports.ACCOUNT_TITLE_MAX_LENGTH = exports.ACCOUNT_TITLE_DISALLOWED_SOURCE = exports.ACCOUNT_NAME_POLICY_BY_KIND = exports.newlyAddedRetiredCategories = exports.kindAcceptsAccountCategories = exports.isSelectableAccountCategoryId = exports.isOperatorSwitchTargetKind = exports.isMemberOperatedKind = exports.isDelegatedActAsEligibleKind = exports.isAccountKind = exports.SELECTABLE_ACCOUNT_CATEGORY_IDS = exports.RETIRED_ACCOUNT_CATEGORY_IDS = exports.MAX_ACCOUNT_CATEGORIES = exports.CHILD_ACCOUNT_KINDS = exports.ACCOUNT_KINDS = exports.ACCOUNT_CATEGORY_KINDS = exports.ACCOUNT_CATEGORY_IDS = exports.parseContract = exports.formatCheckPath = exports.checkContract = exports.ContractCheckError = void 0;
|
|
34
34
|
exports.ORGANIZATION_ERROR_CODES = exports.ORGANIZATION_CLAIM_STATUSES = exports.ORGANIZATION_CLAIM_DECISIONS = exports.ORGANIZATION_ALIAS_KINDS = exports.canonicalJson = exports.buildIdentityProofMessage = exports.IDENTITY_PROOF_VERSION = exports.IDENTITY_PROOF_DOMAIN = exports.IDENTITY_PROOF_CHALLENGE_TTL_MS = exports.IDENTITY_PROOF_AUDIENCE = exports.IDENTITY_PROOF_ACTION_VALUES = exports.IDENTITY_PROOF_ACTIONS = exports.IDENTITY_ERROR_CODES = exports.parseIdentityLinkQrPayload = exports.identityLinkStateCheck = exports.identityLinkCreateResponseCheck = exports.buildIdentityLinkQrPayload = exports.IDENTITY_LINK_STATUSES = exports.IDENTITY_LINK_QR_PREFIX = exports.identityKeyHistoryCheck = exports.IDENTITY_KEY_HISTORY_CLAIM_ACTION = exports.sessionAccountsChangedEventCheck = exports.deviceTokenMintResponseCheck = exports.deviceSessionSyncCheck = exports.deviceSessionStateCheck = exports.deviceRegisterResponseCheck = exports.deviceJoinResponseCheck = exports.deviceJoinCodeResponseCheck = exports.holderContextEvidenceV1ResponseCheck = exports.holderContextEvidenceV1RequestCheck = exports.deviceContextTokenV1ResponseCheck = exports.deviceContextTokenV1RequestCheck = exports.deviceBackgroundCredentialResponseCheck = exports.activeTokenCheck = exports.SESSION_ACCOUNTS_CHANGED_EVENT = exports.deviceDirectorySyncCheck = exports.deviceDirectoryCheck = exports.deviceActivateResponseCheck = exports.normalizeDomainName = exports.DOMAIN_NAME_MAX_LENGTH = exports.signedRecordEnvelopeCheck = exports.externalIdentityReferenceCheck = exports.loginResultCheck = exports.isLoopbackOrigin = exports.organizationKeyProofClaims = exports.organizationKeyPayload = exports.organizationKeyChallengeRequestCheck = exports.organizationKeyChallengeCheck = exports.organizationKeyApplyRequestCheck = exports.organizationIdentityKeyStateCheck = void 0;
|
|
35
35
|
exports.safetyPeopleResponseCheck = exports.safetyPeopleInputCheck = exports.safetyOrganizationsResponseCheck = exports.safetyOrganizationsInputCheck = exports.purchaseReviewInputCheck = exports.purchaseApprovalListCheck = exports.purchaseApprovalCheck = exports.profileAccessInputCheck = exports.profileAccessDecisionCheck = exports.SUPERVISION_STATUSES = exports.SUPERVISION_INVITATION_STATUSES = exports.SUPERVISION_CONSENT_VERSION = exports.SUPERVISION_CHANGED_EVENT = exports.SUPERVISED_ACTIONS = exports.SAFETY_POLICY_VERSION = exports.PURCHASE_APPROVAL_STATUSES = exports.isFullReputationBalance = exports.recommendationRequestCheck = exports.subscriptionCreditGrantsResponseCheck = exports.subjectProductAccessQueryCheck = exports.subjectProductAccessCheck = exports.productSubscriptionsResponseCheck = exports.productSubscriptionPortalResponseCheck = exports.productSubscriptionPortalRequestCheck = exports.productSubscriptionCancellationResultCheck = exports.productPlanCheckoutRequestCheck = exports.productPlanCatalogueCheck = exports.personalPlanCheckoutResultCheck = exports.personalPlanCheckoutRequestCheck = exports.personalPlanCatalogueCheck = exports.oxyAccountIdCheck = exports.cancelProductSubscriptionCheck = exports.updateOrganizationCheck = exports.organizationNameCheck = exports.organizationListCheck = exports.organizationImportBatchResultCheck = exports.organizationExternalResolutionCheck = exports.organizationExternalCheck = exports.organizationCurationResultCheck = exports.organizationClaimReviewCheck = exports.organizationClaimListCheck = exports.organizationClaimInputCheck = exports.organizationClaimDetailCheck = exports.organizationClaimCheck = exports.organizationCheck = exports.organizationBatchCheck = exports.createOrganizationCheck = exports.ORGANIZATION_TYPES = exports.ORGANIZATION_STATUSES = exports.ORGANIZATION_NAME_MAX_LENGTH = void 0;
|
|
36
|
-
exports.
|
|
37
|
-
exports.
|
|
38
|
-
exports.keychainItemsResponseCheck = exports.keychainItemResponseCheck = exports.keychainEnrollmentsResponseCheck = exports.keychainEnrollmentResponseCheck = exports.keychainWrapResponseCheck = exports.keychainStateResponseCheck = exports.KEYCHAIN_TIMESTAMP_PATTERN = exports.KEYCHAIN_HASH_PATTERN = exports.KEYCHAIN_BASE64URL_PATTERN = exports.KEYCHAIN_SIGNATURE_PATTERN = exports.KEYCHAIN_NONCE_PATTERN = exports.KEYCHAIN_BYTES32_PATTERN = exports.KEYCHAIN_ID_PATTERN = void 0;
|
|
36
|
+
exports.botUsernameCheck = exports.applyBotUsernameSuffix = exports.USERNAME_PATTERN_SOURCE = exports.USERNAME_MIN_LENGTH = exports.USERNAME_MAX_LENGTH = exports.USERNAME_INVALID_MESSAGE = exports.RESERVED_USERNAME_MESSAGE = exports.RESERVED_USERNAMES = exports.NUMERIC_USERNAME_MESSAGE = exports.BOT_USERNAME_SUFFIX = exports.BOT_USERNAME_INVALID_MESSAGE = exports.totpEnrollResponseCheck = exports.totpBackupCodesResponseCheck = exports.signInMethodsCheck = exports.secondFactorRequiredCheck = exports.reauthProofCheck = exports.normalizeEmailSignInCode = exports.isSecondFactorRequired = exports.isEmailSignInChooseAccount = exports.emailSignInStartResponseCheck = exports.emailSignInPendingCheck = exports.emailSignInLinkResponseCheck = exports.emailSignInChooseAccountCheck = exports.TOTP_PERIOD_SECONDS = exports.TOTP_DIGITS = exports.TOTP_BACKUP_CODE_COUNT = exports.SIGN_IN_ERROR_CODES = exports.SIGNIN_SECOND_FACTOR_TTL_MS = exports.SIGNIN_SECOND_FACTOR_MAX_ATTEMPTS = exports.SIGN_IN_IDENTIFIER_MAX_LENGTH = exports.SECOND_FACTOR_CODE_MAX_LENGTH = exports.REAUTH_ACTIONS = exports.PASSWORD_MIN_LENGTH = exports.PASSWORD_MAX_LENGTH = exports.EMAIL_SIGNIN_LONG_CODE_LENGTH = exports.EMAIL_SIGNIN_LONG_CODE_ALPHABET = exports.EMAIL_SIGNIN_LINK_TTL_MS = exports.EMAIL_SIGNIN_CHOICE_TTL_MS = exports.EMAIL_ACCOUNTS_MAX = exports.CONSOLE_USE_CASES = exports.CONSOLE_TERMS_VERSION = exports.publicApplicationCheck = exports.supervisionStateCheck = exports.supervisionReviewInputCheck = exports.dateOfBirthCorrectionInputCheck = exports.supervisionInviteInputCheck = exports.supervisionInvitationCheck = exports.supervisionContactsResponseCheck = exports.supervisionContactInputCheck = exports.supervisionAcceptInputCheck = void 0;
|
|
37
|
+
exports.FREE_USER_PROFILE_COLOR_PRESETS = exports.USER_PROFILE_COLOR_PRESETS = exports.USER_PROFILE_COLORS = exports.deviceAppTokenResponseCheck = exports.PLATFORM_HOSTS = exports.OXYOS_DESKTOP_ENTRY_ID_PATTERN = exports.DEVICE_APP_TOKEN_TTL_SECONDS = exports.DEVICE_APP_TOKEN_ERROR_CODES = exports.APP_TOKEN_DEVICE_ACCESS_DENIED = exports.appAttestKeyResponseCheck = exports.appAssertionResponseCheck = exports.appAssertionChallengeResponseCheck = exports.OXY_APP_ASSERTION_TYPE = exports.OXY_APP_ASSERTION_TTL_SECONDS = exports.OXY_APP_ASSERTION_HEADER = exports.OXY_APP_ASSERTION_AUDIENCE = exports.APP_ASSERTION_PLATFORMS = exports.APP_ASSERTION_ERROR_CODES = exports.APP_ASSERTION_CHALLENGE_PURPOSES = exports.isSelfServiceBandChange = exports.ageInYears = exports.ageBandOf = exports.MIN_BIRTH_YEAR = exports.MINIMUM_UNSUPERVISED_AGE_YEARS = exports.DATE_OF_BIRTH_REFUSALS = exports.DATE_OF_BIRTH_PATTERN = exports.DATE_OF_BIRTH_MESSAGES = exports.AGE_BANDS = exports.ADULT_AGE_YEARS = exports.isRightsClaim = exports.isErasureRequest = exports.OPEN_CONTENT_CLAIM_STATES = exports.ERASURE_REQUEST_DEADLINE_DAYS = exports.COUNTER_NOTICE_STATEMENTS = exports.COUNTER_NOTICE_STATEMENT_VERSION = exports.CONTENT_CLAIM_STATES = exports.CONTENT_CLAIM_REFERENCE_PATTERN = exports.CONTENT_CLAIM_LIMITS = exports.CONTENT_CLAIM_KINDS = exports.CONTENT_CLAIM_ERROR_CODES = exports.CONTENT_CLAIM_COUNTER_NOTICE_LIMITS = exports.CLOSED_CONTENT_CLAIM_STATES = exports.CLAIMANT_RELATIONSHIPS = exports.PRONOUNS = exports.PROFILE_LINK_TITLE_MAX = exports.PROFILE_LINKS_MAX = exports.userNameCheck = exports.usernameCheckForAccountKind = exports.usernameCheck = exports.stripDisallowedUsernameCharacters = void 0;
|
|
38
|
+
exports.keychainItemsResponseCheck = exports.keychainItemResponseCheck = exports.keychainEnrollmentsResponseCheck = exports.keychainEnrollmentResponseCheck = exports.keychainWrapResponseCheck = exports.keychainStateResponseCheck = exports.KEYCHAIN_TIMESTAMP_PATTERN = exports.KEYCHAIN_HASH_PATTERN = exports.KEYCHAIN_BASE64URL_PATTERN = exports.KEYCHAIN_SIGNATURE_PATTERN = exports.KEYCHAIN_NONCE_PATTERN = exports.KEYCHAIN_BYTES32_PATTERN = exports.KEYCHAIN_ID_PATTERN = exports.KEYCHAIN_ERROR_CODES = exports.KEYCHAIN_LIMITS = exports.KEYCHAIN_DOMAINS = exports.KEYCHAIN_RECOVERY = exports.KEYCHAIN_ENROLLMENT_STATUSES = exports.KEYCHAIN_ROSTER_OPS = exports.KEYCHAIN_PLATFORMS = exports.isLanguageTag = exports.hasCampaignControlCharacters = exports.CAMPAIGN_CLICK_ID_MAX_LENGTH = exports.CAMPAIGN_LABEL_MAX_LENGTH = void 0;
|
|
39
39
|
var check_1 = require("./check");
|
|
40
40
|
Object.defineProperty(exports, "ContractCheckError", { enumerable: true, get: function () { return check_1.ContractCheckError; } });
|
|
41
41
|
Object.defineProperty(exports, "checkContract", { enumerable: true, get: function () { return check_1.checkContract; } });
|
|
@@ -212,6 +212,7 @@ Object.defineProperty(exports, "supervisionContactInputCheck", { enumerable: tru
|
|
|
212
212
|
Object.defineProperty(exports, "supervisionContactsResponseCheck", { enumerable: true, get: function () { return safety_1.supervisionContactsResponseCheck; } });
|
|
213
213
|
Object.defineProperty(exports, "supervisionInvitationCheck", { enumerable: true, get: function () { return safety_1.supervisionInvitationCheck; } });
|
|
214
214
|
Object.defineProperty(exports, "supervisionInviteInputCheck", { enumerable: true, get: function () { return safety_1.supervisionInviteInputCheck; } });
|
|
215
|
+
Object.defineProperty(exports, "dateOfBirthCorrectionInputCheck", { enumerable: true, get: function () { return safety_1.dateOfBirthCorrectionInputCheck; } });
|
|
215
216
|
Object.defineProperty(exports, "supervisionReviewInputCheck", { enumerable: true, get: function () { return safety_1.supervisionReviewInputCheck; } });
|
|
216
217
|
Object.defineProperty(exports, "supervisionStateCheck", { enumerable: true, get: function () { return safety_1.supervisionStateCheck; } });
|
|
217
218
|
var sessionStatus_1 = require("./sessionStatus");
|
|
@@ -284,6 +285,17 @@ Object.defineProperty(exports, "ERASURE_REQUEST_DEADLINE_DAYS", { enumerable: tr
|
|
|
284
285
|
Object.defineProperty(exports, "OPEN_CONTENT_CLAIM_STATES", { enumerable: true, get: function () { return contentClaims_1.OPEN_CONTENT_CLAIM_STATES; } });
|
|
285
286
|
Object.defineProperty(exports, "isErasureRequest", { enumerable: true, get: function () { return contentClaims_1.isErasureRequest; } });
|
|
286
287
|
Object.defineProperty(exports, "isRightsClaim", { enumerable: true, get: function () { return contentClaims_1.isRightsClaim; } });
|
|
288
|
+
var age_1 = require("./age");
|
|
289
|
+
Object.defineProperty(exports, "ADULT_AGE_YEARS", { enumerable: true, get: function () { return age_1.ADULT_AGE_YEARS; } });
|
|
290
|
+
Object.defineProperty(exports, "AGE_BANDS", { enumerable: true, get: function () { return age_1.AGE_BANDS; } });
|
|
291
|
+
Object.defineProperty(exports, "DATE_OF_BIRTH_MESSAGES", { enumerable: true, get: function () { return age_1.DATE_OF_BIRTH_MESSAGES; } });
|
|
292
|
+
Object.defineProperty(exports, "DATE_OF_BIRTH_PATTERN", { enumerable: true, get: function () { return age_1.DATE_OF_BIRTH_PATTERN; } });
|
|
293
|
+
Object.defineProperty(exports, "DATE_OF_BIRTH_REFUSALS", { enumerable: true, get: function () { return age_1.DATE_OF_BIRTH_REFUSALS; } });
|
|
294
|
+
Object.defineProperty(exports, "MINIMUM_UNSUPERVISED_AGE_YEARS", { enumerable: true, get: function () { return age_1.MINIMUM_UNSUPERVISED_AGE_YEARS; } });
|
|
295
|
+
Object.defineProperty(exports, "MIN_BIRTH_YEAR", { enumerable: true, get: function () { return age_1.MIN_BIRTH_YEAR; } });
|
|
296
|
+
Object.defineProperty(exports, "ageBandOf", { enumerable: true, get: function () { return age_1.ageBandOf; } });
|
|
297
|
+
Object.defineProperty(exports, "ageInYears", { enumerable: true, get: function () { return age_1.ageInYears; } });
|
|
298
|
+
Object.defineProperty(exports, "isSelfServiceBandChange", { enumerable: true, get: function () { return age_1.isSelfServiceBandChange; } });
|
|
287
299
|
var appAssertions_1 = require("./appAssertions");
|
|
288
300
|
Object.defineProperty(exports, "APP_ASSERTION_CHALLENGE_PURPOSES", { enumerable: true, get: function () { return appAssertions_1.APP_ASSERTION_CHALLENGE_PURPOSES; } });
|
|
289
301
|
Object.defineProperty(exports, "APP_ASSERTION_ERROR_CODES", { enumerable: true, get: function () { return appAssertions_1.APP_ASSERTION_ERROR_CODES; } });
|
|
@@ -10,9 +10,10 @@
|
|
|
10
10
|
* Part of `@oxy.so/contracts/client`: never import `zod` here (see `./check.ts`).
|
|
11
11
|
*/
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.purchaseReviewInputCheck = exports.purchaseApprovalListCheck = exports.purchaseApprovalCheck = exports.safetyOrganizationsResponseCheck = exports.safetyOrganizationsInputCheck = exports.safetyPeopleResponseCheck = exports.safetyPeopleInputCheck = exports.supervisionReviewInputCheck = exports.supervisionContactInputCheck = exports.supervisionAcceptInputCheck = exports.supervisionInviteInputCheck = exports.supervisionContactsResponseCheck = exports.supervisionStateCheck = exports.supervisionInvitationCheck = exports.profileAccessDecisionCheck = exports.profileAccessInputCheck = exports.PURCHASE_APPROVAL_STATUSES = exports.SUPERVISION_CHANGED_EVENT = exports.SUPERVISION_INVITATION_STATUSES = exports.SUPERVISION_STATUSES = exports.SUPERVISION_CONSENT_VERSION = exports.SAFETY_POLICY_VERSION = exports.SUPERVISED_ACTIONS = void 0;
|
|
13
|
+
exports.purchaseReviewInputCheck = exports.purchaseApprovalListCheck = exports.purchaseApprovalCheck = exports.safetyOrganizationsResponseCheck = exports.safetyOrganizationsInputCheck = exports.safetyPeopleResponseCheck = exports.safetyPeopleInputCheck = exports.dateOfBirthCorrectionInputCheck = exports.supervisionReviewInputCheck = exports.supervisionContactInputCheck = exports.supervisionAcceptInputCheck = exports.supervisionInviteInputCheck = exports.supervisionContactsResponseCheck = exports.supervisionStateCheck = exports.supervisionInvitationCheck = exports.profileAccessDecisionCheck = exports.profileAccessInputCheck = exports.PURCHASE_APPROVAL_STATUSES = exports.SUPERVISION_CHANGED_EVENT = exports.SUPERVISION_INVITATION_STATUSES = exports.SUPERVISION_STATUSES = exports.SUPERVISION_CONSENT_VERSION = exports.SAFETY_POLICY_VERSION = exports.SUPERVISED_ACTIONS = void 0;
|
|
14
14
|
const check_1 = require("./check");
|
|
15
15
|
const organizations_1 = require("./organizations");
|
|
16
|
+
const age_1 = require("./age");
|
|
16
17
|
const signIn_1 = require("./signIn");
|
|
17
18
|
/** Supervision is a personal-account safety policy, never a new login/account kind. */
|
|
18
19
|
exports.SUPERVISED_ACTIONS = ['profile', 'messaging', 'content', 'purchases'];
|
|
@@ -95,6 +96,14 @@ exports.supervisionReviewInputCheck = (0, check_1.exact)()((0, check_1.strictObj
|
|
|
95
96
|
evidenceReference: (0, check_1.string)(check_1.trim, (0, check_1.minLength)(1), (0, check_1.maxLength)(2048)),
|
|
96
97
|
reauth: signIn_1.reauthProofCheck,
|
|
97
98
|
}));
|
|
99
|
+
/** `dateOfBirthSchema`, rule for rule and message for message. */
|
|
100
|
+
const dateOfBirthCheck = (0, check_1.refine)((0, check_1.refine)((0, check_1.refine)((0, check_1.string)((0, check_1.pattern)(age_1.DATE_OF_BIRTH_PATTERN, age_1.DATE_OF_BIRTH_MESSAGES.format)), age_1.isRealCalendarDate, age_1.DATE_OF_BIRTH_MESSAGES.calendar), age_1.isBirthYearInRange, age_1.DATE_OF_BIRTH_MESSAGES.tooEarly), (value) => (0, age_1.isNotAfterToday)(value), age_1.DATE_OF_BIRTH_MESSAGES.future);
|
|
101
|
+
exports.dateOfBirthCorrectionInputCheck = (0, check_1.exact)()((0, check_1.strictObject)({
|
|
102
|
+
accountId,
|
|
103
|
+
dateOfBirth: dateOfBirthCheck,
|
|
104
|
+
evidenceReference: (0, check_1.string)(check_1.trim, (0, check_1.minLength)(1), (0, check_1.maxLength)(2048)),
|
|
105
|
+
reauth: signIn_1.reauthProofCheck,
|
|
106
|
+
}));
|
|
98
107
|
/* -------------------------------------------------------------------------- */
|
|
99
108
|
/* Minimal identities for the management screens */
|
|
100
109
|
/* -------------------------------------------------------------------------- */
|
package/dist/cjs/index.js
CHANGED
|
@@ -26,20 +26,21 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
26
26
|
};
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
28
|
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_EYE_SPACING = exports.isPlainTextTitle = exports.accountTitleSchema = exports.accountNamePolicyForKind = exports.ACCOUNT_TITLE_MAX_LENGTH = exports.ACCOUNT_TITLE_DISALLOWED_SOURCE = exports.ACCOUNT_NAME_POLICY_BY_KIND = 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.isMemberOperatedKind = exports.isOperatorSwitchTargetKind = exports.isDelegatedActAsEligibleKind = exports.isAccountKind = exports.childAccountKindSchema = exports.CHILD_ACCOUNT_KINDS = exports.accountKindSchema = exports.ACCOUNT_KINDS = void 0;
|
|
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.
|
|
29
|
+
exports.recommendationExcludeTypeSchema = exports.oxyServiceEventsHeartbeatSchema = exports.oxySessionRevocationEventSchema = exports.OXY_SERVICE_EVENTS_FORBIDDEN = exports.OXY_SERVICE_EVENTS_STALE_AFTER_MS = exports.OXY_SERVICE_EVENTS_HEARTBEAT_MS = exports.OXY_SERVICE_EVENTS_HEARTBEAT_EVENT = exports.OXY_SESSION_REVOKED_EVENT = exports.OXY_SERVICE_EVENTS_NAMESPACE = 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.themePreferenceSchema = exports.userRelationshipSchema = exports.userNameSchema = exports.isSelfServiceBandChange = exports.ageInYears = exports.ageBandOf = exports.MIN_BIRTH_YEAR = exports.MINIMUM_UNSUPERVISED_AGE_YEARS = exports.DATE_OF_BIRTH_REFUSALS = exports.DATE_OF_BIRTH_PATTERN = exports.DATE_OF_BIRTH_MESSAGES = exports.AGE_BANDS = exports.ADULT_AGE_YEARS = exports.PROFILE_LINK_TITLE_MAX = exports.PROFILE_LINKS_MAX = exports.PRONOUNS = exports.NUMERIC_USERNAME_MESSAGE = exports.RESERVED_USERNAME_MESSAGE = exports.BOT_USERNAME_INVALID_MESSAGE = void 0;
|
|
30
|
+
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 = 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 = void 0;
|
|
31
|
+
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 = 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 = void 0;
|
|
32
|
+
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 = exports.deviceBackgroundCredentialResponseSchema = exports.holderContextEvidenceV1ResponseSchema = exports.holderContextEvidenceV1RequestSchema = exports.deviceContextTokenV1ResponseSchema = exports.deviceContextTokenV1RequestSchema = 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 = void 0;
|
|
33
|
+
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 = 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.IDENTITY_BACKUP_MAX_VERSION = exports.identityKeyHistorySchema = exports.identityKeyHistoryClaimRequestSchema = exports.IDENTITY_KEY_HISTORY_CLAIM_ACTION = exports.rotateKeyCompleteResponseSchema = exports.rotateKeyCompleteRequestSchema = exports.rotateKeyChallengeResponseSchema = exports.loginResultSchema = exports.mcpOAuthConsentResponseSchema = exports.mcpOAuthClientInfoResponseSchema = exports.mcpOAuthConsentContextSchema = exports.mcpOAuthWriteActionSchema = exports.mcpOAuthClientApplicationSchema = exports.oauthAuthorizeCodeResponseSchema = void 0;
|
|
34
|
+
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 = 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.SIGN_IN_IDENTIFIER_MAX_LENGTH = exports.SECOND_FACTOR_CODE_MAX_LENGTH = 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 = void 0;
|
|
35
|
+
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 = 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 = void 0;
|
|
36
|
+
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 = 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 = void 0;
|
|
37
|
+
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 = 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 = void 0;
|
|
38
|
+
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 = 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 = void 0;
|
|
39
|
+
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 = 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 = void 0;
|
|
40
|
+
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 = 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 = void 0;
|
|
41
|
+
exports.resolveCatalogInvocation = exports.matchCatalogInvocation = exports.findOverlappingCatalogInvocations = exports.catalogInvocationTemplatesEquivalent = exports.catalogInvocationsOverlap = exports.catalogInvocationPathParameters = exports.normalizedAppEventSchema = exports.catalogRegistrationSchema = exports.appCapabilityCatalogSchema = exports.CATALOG_INTERNAL_TRANSPORTS = exports.catalogFeatureSchema = exports.catalogEventSchema = exports.catalogToolSchema = exports.catalogToolAllowsActor = exports.catalogToolActors = exports.catalogToolActorTypeSchema = exports.CATALOG_TOOL_DEFAULT_ACTORS = exports.CATALOG_TOOL_ACTOR_TYPES = 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.firstPartyTaskInputSchema = exports.firstPartyExecutionAuthorizationInputSchema = exports.foregroundExecutionAuthorizationInputSchema = exports.executionActorRefSchema = exports.actorRefSchema = exports.capabilityPackageSchema = exports.autonomyLevelSchema = void 0;
|
|
42
|
+
exports.APPLICATION_ACCOUNT_TOTAL_MAX_AGE_SECONDS = exports.APPLICATION_ACCOUNT_REGISTRATION_BATCH_MAX = exports.campaignAttributionSchema = exports.safeNumberCheck = exports.integerCheck = exports.urlCheck = exports.isoDateTime = exports.utf16Length = exports.utf16MaxLength = exports.utf16MinLength = exports.FREE_USER_PROFILE_COLOR_PRESETS = exports.USER_PROFILE_COLOR_PRESETS = exports.USER_PROFILE_COLORS = 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 = void 0;
|
|
43
|
+
exports.applicationAccountTotalSchema = exports.applicationAccountRegistrationResponseSchema = exports.applicationAccountRegistrationRequestSchema = void 0;
|
|
43
44
|
var accountGraph_1 = require("./accountGraph");
|
|
44
45
|
Object.defineProperty(exports, "ACCOUNT_KINDS", { enumerable: true, get: function () { return accountGraph_1.ACCOUNT_KINDS; } });
|
|
45
46
|
Object.defineProperty(exports, "accountKindSchema", { enumerable: true, get: function () { return accountGraph_1.accountKindSchema; } });
|
|
@@ -102,6 +103,17 @@ var userResponse_1 = require("./client/userResponse");
|
|
|
102
103
|
Object.defineProperty(exports, "PRONOUNS", { enumerable: true, get: function () { return userResponse_1.PRONOUNS; } });
|
|
103
104
|
Object.defineProperty(exports, "PROFILE_LINKS_MAX", { enumerable: true, get: function () { return userResponse_1.PROFILE_LINKS_MAX; } });
|
|
104
105
|
Object.defineProperty(exports, "PROFILE_LINK_TITLE_MAX", { enumerable: true, get: function () { return userResponse_1.PROFILE_LINK_TITLE_MAX; } });
|
|
106
|
+
var age_1 = require("./client/age");
|
|
107
|
+
Object.defineProperty(exports, "ADULT_AGE_YEARS", { enumerable: true, get: function () { return age_1.ADULT_AGE_YEARS; } });
|
|
108
|
+
Object.defineProperty(exports, "AGE_BANDS", { enumerable: true, get: function () { return age_1.AGE_BANDS; } });
|
|
109
|
+
Object.defineProperty(exports, "DATE_OF_BIRTH_MESSAGES", { enumerable: true, get: function () { return age_1.DATE_OF_BIRTH_MESSAGES; } });
|
|
110
|
+
Object.defineProperty(exports, "DATE_OF_BIRTH_PATTERN", { enumerable: true, get: function () { return age_1.DATE_OF_BIRTH_PATTERN; } });
|
|
111
|
+
Object.defineProperty(exports, "DATE_OF_BIRTH_REFUSALS", { enumerable: true, get: function () { return age_1.DATE_OF_BIRTH_REFUSALS; } });
|
|
112
|
+
Object.defineProperty(exports, "MINIMUM_UNSUPERVISED_AGE_YEARS", { enumerable: true, get: function () { return age_1.MINIMUM_UNSUPERVISED_AGE_YEARS; } });
|
|
113
|
+
Object.defineProperty(exports, "MIN_BIRTH_YEAR", { enumerable: true, get: function () { return age_1.MIN_BIRTH_YEAR; } });
|
|
114
|
+
Object.defineProperty(exports, "ageBandOf", { enumerable: true, get: function () { return age_1.ageBandOf; } });
|
|
115
|
+
Object.defineProperty(exports, "ageInYears", { enumerable: true, get: function () { return age_1.ageInYears; } });
|
|
116
|
+
Object.defineProperty(exports, "isSelfServiceBandChange", { enumerable: true, get: function () { return age_1.isSelfServiceBandChange; } });
|
|
105
117
|
var userResponse_2 = require("./userResponse");
|
|
106
118
|
// Schemas
|
|
107
119
|
Object.defineProperty(exports, "userNameSchema", { enumerable: true, get: function () { return userResponse_2.userNameSchema; } });
|
package/dist/cjs/safety.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.confirmPurchaseSchema = exports.reservePurchaseSchema = exports.purchaseApprovalListSchema = exports.purchaseApprovalSummarySchema = exports.purchaseApprovalSchema = exports.purchaseEffectsSchema = exports.purchaseApprovalLineSchema = exports.supervisionContactsResponseSchema = exports.supervisionStateSchema = exports.supervisionContactSchema = exports.supervisionInvitationSchema = exports.supervisionSchema = exports.safetyRequesterSchema = exports.messagingSessionsResponseSchema = exports.messagingSessionsInputSchema = exports.notificationAccessBatchResponseSchema = exports.notificationAccessBatchInputSchema = exports.notificationAccessInputSchema = exports.messageAccessBatchResponseSchema = exports.deliveryAccessBatchInputSchema = exports.messageAccessBatchInputSchema = exports.deliveryAccessInputSchema = exports.contentAccessBatchResponseSchema = exports.contentAccessBatchInputSchema = exports.publicationPoliciesResponseSchema = exports.publicationPoliciesInputSchema = exports.publicationPolicySchema = exports.contentAccessInputSchema = exports.CONTENT_CLASSIFICATIONS = exports.contactAccessResponseSchema = exports.contactAccessInputSchema = exports.messageAccessInputSchema = exports.MESSAGE_ACCESS_MAX_INPUT_BYTES = exports.MESSAGE_ACCESS_MAX_PARTICIPANT_SLOTS = exports.MESSAGE_ACCESS_MAX_SUPERVISED_PARTICIPANTS = exports.MESSAGE_ACCESS_MAX_PARTICIPANTS = exports.MESSAGE_ACCESS_MAX_RESOURCES = exports.profileAccessBatchResponseSchema = exports.profileAccessBatchInputSchema = exports.safetyDecisionSchema = exports.SAFETY_DECISION_REASONS = exports.profileAccessDecisionSchema = exports.profileAccessInputSchema = exports.SUPERVISION_STATUSES = exports.SUPERVISION_INVITATION_STATUSES = exports.SUPERVISION_CONSENT_VERSION = exports.SUPERVISION_CHANGED_EVENT = exports.SUPERVISED_ACTIONS = exports.SAFETY_POLICY_VERSION = exports.PURCHASE_APPROVAL_STATUSES = void 0;
|
|
4
|
-
exports.safetyOrganizationsResponseSchema = exports.safetyOrganizationsInputSchema = exports.safetyOrganizationIdentitySchema = exports.safetyPeopleResponseSchema = exports.safetyPeopleInputSchema = exports.safetyPersonSchema = exports.safetySessionValidationSchema = exports.safetySessionInputSchema = exports.purchaseReviewInputSchema = exports.supervisionReviewInputSchema = exports.supervisionContactInputSchema = exports.supervisionAcceptInputSchema = exports.supervisionInviteInputSchema = exports.safetyErrorSchema = exports.SAFETY_ERROR_CODES = exports.cancelPurchaseSchema = void 0;
|
|
4
|
+
exports.safetyOrganizationsResponseSchema = exports.safetyOrganizationsInputSchema = exports.safetyOrganizationIdentitySchema = exports.safetyPeopleResponseSchema = exports.safetyPeopleInputSchema = exports.safetyPersonSchema = exports.safetySessionValidationSchema = exports.safetySessionInputSchema = exports.purchaseReviewInputSchema = exports.dateOfBirthCorrectionInputSchema = exports.supervisionReviewInputSchema = exports.supervisionContactInputSchema = exports.supervisionAcceptInputSchema = exports.supervisionInviteInputSchema = exports.safetyErrorSchema = exports.SAFETY_ERROR_CODES = exports.cancelPurchaseSchema = void 0;
|
|
5
5
|
const numberChecks_1 = require("./numberChecks");
|
|
6
6
|
const stringChecks_1 = require("./stringChecks");
|
|
7
7
|
const zod_1 = require("zod");
|
|
@@ -426,6 +426,19 @@ exports.supervisionReviewInputSchema = zod_1.z
|
|
|
426
426
|
reauth: signIn_1.reauthProofSchema,
|
|
427
427
|
})
|
|
428
428
|
.strict();
|
|
429
|
+
/**
|
|
430
|
+
* `POST /safety/supervision/date-of-birth`: a staff member corrects an
|
|
431
|
+
* account's date of birth on reviewed evidence (ADR 0067). It is the only way
|
|
432
|
+
* a date moves to an OLDER age band; the person's own edits cannot.
|
|
433
|
+
*/
|
|
434
|
+
exports.dateOfBirthCorrectionInputSchema = zod_1.z
|
|
435
|
+
.object({
|
|
436
|
+
accountId,
|
|
437
|
+
dateOfBirth: userResponse_1.dateOfBirthSchema,
|
|
438
|
+
evidenceReference: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(2048)),
|
|
439
|
+
reauth: signIn_1.reauthProofSchema,
|
|
440
|
+
})
|
|
441
|
+
.strict();
|
|
429
442
|
exports.purchaseReviewInputSchema = zod_1.z
|
|
430
443
|
.object({ decision: zod_1.z.enum(['approved', 'rejected']), reauth: signIn_1.reauthProofSchema })
|
|
431
444
|
.strict();
|
package/dist/cjs/signIn.js
CHANGED
|
@@ -5,6 +5,7 @@ const language_1 = require("./client/language");
|
|
|
5
5
|
const campaignAttribution_1 = require("./campaignAttribution");
|
|
6
6
|
const numberChecks_1 = require("./numberChecks");
|
|
7
7
|
const stringChecks_1 = require("./stringChecks");
|
|
8
|
+
const userResponse_1 = require("./userResponse");
|
|
8
9
|
/**
|
|
9
10
|
* Signing in: an email code or link, an optional password,
|
|
10
11
|
* and an optional authenticator app (TOTP) as a second factor.
|
|
@@ -209,6 +210,14 @@ exports.signUpRequestSchema = zod_1.z
|
|
|
209
210
|
.max(10)
|
|
210
211
|
.optional(),
|
|
211
212
|
campaignAttribution: campaignAttribution_1.campaignAttributionSchema.optional(),
|
|
213
|
+
/**
|
|
214
|
+
* The person's date of birth (ADR 0067). The sign-up panel always asks for
|
|
215
|
+
* it; it is optional on the wire only while clients published before it
|
|
216
|
+
* are still in use, and an account created without one has no age band.
|
|
217
|
+
* A date below the minimum unsupervised age creates the account under
|
|
218
|
+
* supervision, awaiting a guardian.
|
|
219
|
+
*/
|
|
220
|
+
dateOfBirth: userResponse_1.dateOfBirthSchema.optional(),
|
|
212
221
|
...sessionEnvelope,
|
|
213
222
|
})
|
|
214
223
|
.strict();
|
package/dist/cjs/userResponse.js
CHANGED
|
@@ -35,6 +35,7 @@ const stringChecks_1 = require("./stringChecks");
|
|
|
35
35
|
* `require()`).
|
|
36
36
|
*/
|
|
37
37
|
const zod_1 = require("zod");
|
|
38
|
+
const age_1 = require("./client/age");
|
|
38
39
|
const userResponse_1 = require("./client/userResponse");
|
|
39
40
|
const identity_1 = require("./identity");
|
|
40
41
|
const accountGraph_1 = require("./accountGraph");
|
|
@@ -55,25 +56,6 @@ exports.themePreferenceSchema = zod_1.z.object({
|
|
|
55
56
|
mode: zod_1.z.enum(['light', 'dark', 'system']),
|
|
56
57
|
colorPreset: zod_1.z.string(),
|
|
57
58
|
});
|
|
58
|
-
/**
|
|
59
|
-
* The earliest calendar year `dateOfBirthSchema` accepts.
|
|
60
|
-
*
|
|
61
|
-
* Not a real biological bound — it exists to catch an obviously-transposed
|
|
62
|
-
* year (`1027` for `2027`, a stray OCR/typo digit) with a clear message
|
|
63
|
-
* instead of the value quietly becoming a 150-year-old account. 1900 is
|
|
64
|
-
* generous enough that no living person's real birthdate is rejected by it.
|
|
65
|
-
*/
|
|
66
|
-
const MIN_BIRTH_YEAR = 1900;
|
|
67
|
-
/**
|
|
68
|
-
* `true` when `year`/`month`/`day` name a date that actually exists on the
|
|
69
|
-
* Gregorian calendar — the check `z.string().regex(...)` alone cannot make,
|
|
70
|
-
* since the regex only constrains digit COUNT and would pass `2024-02-30`.
|
|
71
|
-
*/
|
|
72
|
-
function isRealCalendarDate(year, month, day) {
|
|
73
|
-
const isLeapYear = (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
|
|
74
|
-
const daysInMonth = [31, isLeapYear ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
75
|
-
return month >= 1 && month <= 12 && day >= 1 && day <= daysInMonth[month - 1];
|
|
76
|
-
}
|
|
77
59
|
/**
|
|
78
60
|
* A date of birth, `YYYY-MM-DD`, the sole structured representation this
|
|
79
61
|
* platform stores going forward (`users.date_of_birth` — see
|
|
@@ -92,23 +74,16 @@ function isRealCalendarDate(year, month, day) {
|
|
|
92
74
|
* and not after today (comparing the zero-padded ISO strings directly is
|
|
93
75
|
* a valid, simpler stand-in for a numeric comparison here, since two
|
|
94
76
|
* `YYYY-MM-DD` strings of equal length sort exactly the way their dates
|
|
95
|
-
* do). "Today" is UTC — see `
|
|
77
|
+
* do). "Today" is UTC — see `ageInYears` in `client/age.ts` for why
|
|
96
78
|
* a date with no timezone of its own is evaluated in UTC rather than any
|
|
97
79
|
* particular caller's local zone.
|
|
98
80
|
*/
|
|
99
81
|
exports.dateOfBirthSchema = zod_1.z
|
|
100
82
|
.string()
|
|
101
|
-
.regex(
|
|
102
|
-
.refine(
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}, { message: 'dateOfBirth is not a real calendar date' })
|
|
106
|
-
.refine((value) => Number(value.slice(0, 4)) >= MIN_BIRTH_YEAR, {
|
|
107
|
-
message: `dateOfBirth must not be before ${MIN_BIRTH_YEAR}`,
|
|
108
|
-
})
|
|
109
|
-
.refine((value) => value <= new Date().toISOString().slice(0, 10), {
|
|
110
|
-
message: 'dateOfBirth must not be in the future',
|
|
111
|
-
});
|
|
83
|
+
.regex(age_1.DATE_OF_BIRTH_PATTERN, age_1.DATE_OF_BIRTH_MESSAGES.format)
|
|
84
|
+
.refine(age_1.isRealCalendarDate, { message: age_1.DATE_OF_BIRTH_MESSAGES.calendar })
|
|
85
|
+
.refine(age_1.isBirthYearInRange, { message: age_1.DATE_OF_BIRTH_MESSAGES.tooEarly })
|
|
86
|
+
.refine((value) => (0, age_1.isNotAfterToday)(value), { message: age_1.DATE_OF_BIRTH_MESSAGES.future });
|
|
112
87
|
/**
|
|
113
88
|
* The canonical user object emitted by `formatUserResponse`.
|
|
114
89
|
*
|
|
@@ -158,6 +133,15 @@ exports.userResponseSchema = zod_1.z
|
|
|
158
133
|
* not decided here.
|
|
159
134
|
*/
|
|
160
135
|
isAdult: zod_1.z.boolean().optional(),
|
|
136
|
+
/**
|
|
137
|
+
* The account's age band (ADR 0067), derived from `dateOfBirth` on every
|
|
138
|
+
* read and never stored. Absent when there is no date of birth: "unknown"
|
|
139
|
+
* is neither an adult nor a minor. The owner reads it on their own
|
|
140
|
+
* profile, and an Oxy service reads it on the session it validates
|
|
141
|
+
* (`POST /safety/service/session`); it never rides a public profile, and
|
|
142
|
+
* the date itself never leaves the owner's view.
|
|
143
|
+
*/
|
|
144
|
+
ageBand: zod_1.z.enum(age_1.AGE_BANDS).optional(),
|
|
161
145
|
/** Avatar file id (string) or null. */
|
|
162
146
|
avatar: zod_1.z.string().nullable().optional(),
|
|
163
147
|
/** Named Bloom color preset (e.g. `"blue"`) or null. */
|