@oxy.so/contracts 5.2.0 → 5.4.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/accountGraph.js +8 -5
- package/dist/cjs/accountName.js +20 -0
- package/dist/cjs/accountSubject.js +4 -2
- package/dist/cjs/client/accountGraph.js +2 -0
- package/dist/cjs/client/accountName.js +56 -0
- package/dist/cjs/client/index.js +12 -4
- package/dist/cjs/client/organizations.js +5 -4
- package/dist/cjs/index.js +31 -15
- package/dist/cjs/organizations.js +3 -7
- package/dist/cjs/sessionRevocation.js +89 -0
- package/dist/esm/accountGraph.js +9 -6
- package/dist/esm/accountName.js +12 -0
- package/dist/esm/accountSubject.js +4 -2
- package/dist/esm/client/accountGraph.js +2 -0
- package/dist/esm/client/accountName.js +51 -0
- package/dist/esm/client/index.js +1 -0
- package/dist/esm/client/organizations.js +5 -4
- package/dist/esm/index.js +2 -0
- package/dist/esm/organizations.js +4 -8
- package/dist/esm/sessionRevocation.js +86 -0
- package/dist/types/accountAccess.d.ts +5 -5
- package/dist/types/accountGraph.d.ts +12 -12
- package/dist/types/accountName.d.ts +5 -0
- package/dist/types/accountSubject.d.ts +3 -2
- package/dist/types/agency.d.ts +28 -28
- package/dist/types/client/accountGraph.d.ts +12 -6
- package/dist/types/client/accountName.d.ts +48 -0
- package/dist/types/client/deviceDirectory.d.ts +3 -3
- package/dist/types/client/index.d.ts +1 -0
- package/dist/types/client/organizations.d.ts +8 -7
- package/dist/types/client/safety.d.ts +2 -2
- package/dist/types/deviceDirectory.d.ts +33 -33
- package/dist/types/externalIdentity.d.ts +14 -14
- package/dist/types/index.d.ts +4 -0
- package/dist/types/inference/economics.d.ts +2 -2
- package/dist/types/inference/providerConnection.d.ts +4 -4
- package/dist/types/notifications.d.ts +4 -4
- package/dist/types/organizations.d.ts +41 -40
- package/dist/types/safety.d.ts +22 -22
- package/dist/types/sessionRevocation.d.ts +100 -0
- package/dist/types/stickers.d.ts +9 -9
- package/dist/types/userResponse.d.ts +42 -42
- package/package.json +1 -1
package/dist/cjs/accountGraph.js
CHANGED
|
@@ -11,6 +11,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
11
11
|
exports.createAccountRequestSchema = exports.accountNameSchema = exports.accountCategoriesSchema = exports.accountCategoryIdSchema = exports.childAccountKindSchema = exports.accountKindSchema = exports.kindAcceptsAccountCategories = exports.ACCOUNT_CATEGORY_KINDS = exports.MAX_ACCOUNT_CATEGORIES = exports.newlyAddedRetiredCategories = exports.SELECTABLE_ACCOUNT_CATEGORY_IDS = exports.isSelectableAccountCategoryId = exports.RETIRED_ACCOUNT_CATEGORY_IDS = exports.ACCOUNT_CATEGORY_IDS = exports.isAccountKind = exports.isOperatorSwitchTargetKind = exports.isDelegatedActAsEligibleKind = exports.CHILD_ACCOUNT_KINDS = exports.ACCOUNT_KINDS = void 0;
|
|
12
12
|
const zod_1 = require("zod");
|
|
13
13
|
const avatarCharacter_1 = require("./avatarCharacter");
|
|
14
|
+
const accountName_1 = require("./accountName");
|
|
15
|
+
const accountName_2 = require("./client/accountName");
|
|
14
16
|
const organizations_1 = require("./organizations");
|
|
15
17
|
const username_1 = require("./username");
|
|
16
18
|
// The Zod-free half of this contract lives in `./client/` (`@oxy.so/contracts/client`);
|
|
@@ -85,7 +87,7 @@ exports.accountNameSchema = zod_1.z
|
|
|
85
87
|
.object({
|
|
86
88
|
first: zod_1.z.string().trim().max(100).optional(),
|
|
87
89
|
last: zod_1.z.string().trim().max(100).optional(),
|
|
88
|
-
displayName: zod_1.z.string().trim().max(
|
|
90
|
+
displayName: zod_1.z.string().trim().max(accountName_2.ACCOUNT_TITLE_MAX_LENGTH).optional(),
|
|
89
91
|
})
|
|
90
92
|
.optional();
|
|
91
93
|
/**
|
|
@@ -97,7 +99,7 @@ exports.accountNameSchema = zod_1.z
|
|
|
97
99
|
* this route. The refinement the single-valued predecessor needed disappeared
|
|
98
100
|
* along with the restriction that made it necessary. A child kind that does NOT
|
|
99
101
|
* accept categories would break that reasoning silently, so
|
|
100
|
-
* `__tests__/accountGraph.test.ts` asserts
|
|
102
|
+
* `__tests__/accountGraph.test.ts` asserts every child kind is a category kind.
|
|
101
103
|
*/
|
|
102
104
|
exports.createAccountRequestSchema = zod_1.z
|
|
103
105
|
.object({
|
|
@@ -198,9 +200,10 @@ exports.createAccountRequestSchema = zod_1.z
|
|
|
198
200
|
}
|
|
199
201
|
const displayName = request.name?.displayName;
|
|
200
202
|
if (displayName) {
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
203
|
+
// A child kind is never `personal`, so every child is named by the
|
|
204
|
+
// title policy; the person policy's character classes live in
|
|
205
|
+
// `@oxy.so/core`, which this package cannot import.
|
|
206
|
+
const parsedName = accountName_1.accountTitleSchema.safeParse(displayName);
|
|
204
207
|
if (!parsedName.success) {
|
|
205
208
|
for (const issue of parsedName.error.issues) {
|
|
206
209
|
ctx.addIssue({ ...issue, path: ['name', 'displayName', ...issue.path] });
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.accountTitleSchema = exports.isPlainTextTitle = exports.accountNamePolicyForKind = exports.ACCOUNT_TITLE_MAX_LENGTH = exports.ACCOUNT_TITLE_DISALLOWED_SOURCE = exports.ACCOUNT_NAME_POLICY_BY_KIND = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
// The Zod-free half of this contract lives in `./client/` (`@oxy.so/contracts/client`);
|
|
6
|
+
// it is re-exported here so the root entry carries the whole policy.
|
|
7
|
+
const accountName_1 = require("./client/accountName");
|
|
8
|
+
var accountName_2 = require("./client/accountName");
|
|
9
|
+
Object.defineProperty(exports, "ACCOUNT_NAME_POLICY_BY_KIND", { enumerable: true, get: function () { return accountName_2.ACCOUNT_NAME_POLICY_BY_KIND; } });
|
|
10
|
+
Object.defineProperty(exports, "ACCOUNT_TITLE_DISALLOWED_SOURCE", { enumerable: true, get: function () { return accountName_2.ACCOUNT_TITLE_DISALLOWED_SOURCE; } });
|
|
11
|
+
Object.defineProperty(exports, "ACCOUNT_TITLE_MAX_LENGTH", { enumerable: true, get: function () { return accountName_2.ACCOUNT_TITLE_MAX_LENGTH; } });
|
|
12
|
+
Object.defineProperty(exports, "accountNamePolicyForKind", { enumerable: true, get: function () { return accountName_2.accountNamePolicyForKind; } });
|
|
13
|
+
Object.defineProperty(exports, "isPlainTextTitle", { enumerable: true, get: function () { return accountName_2.isPlainTextTitle; } });
|
|
14
|
+
/** A non-personal account's title — see `./client/accountName.ts` for the policy. */
|
|
15
|
+
exports.accountTitleSchema = zod_1.z
|
|
16
|
+
.string()
|
|
17
|
+
.trim()
|
|
18
|
+
.min(1)
|
|
19
|
+
.max(accountName_1.ACCOUNT_TITLE_MAX_LENGTH)
|
|
20
|
+
.refine(accountName_1.isPlainTextTitle, 'Name must be plain text');
|
|
@@ -51,8 +51,9 @@ exports.ACCOUNT_SUBJECT_CONTRACT_VERSION = 1;
|
|
|
51
51
|
* - `person` — a human; a personal account is its own actor.
|
|
52
52
|
* - `agent` — an AI agent; a bot is its own actor (ADR 0018 `ActorRef`
|
|
53
53
|
* `{type:'agent'}`), and audit records the bot, never the human who owns it.
|
|
54
|
-
* - `operated` — never its own actor. An organization, project
|
|
55
|
-
* acts through a member, and that
|
|
54
|
+
* - `operated` — never its own actor. An organization, project, channel or
|
|
55
|
+
* community only acts through a member (a community's moderators), and that
|
|
56
|
+
* member is the actor.
|
|
56
57
|
*/
|
|
57
58
|
exports.ACCOUNT_ACTOR_NATURES = ['person', 'agent', 'operated'];
|
|
58
59
|
exports.accountActorNatureSchema = zod_1.z.enum(exports.ACCOUNT_ACTOR_NATURES);
|
|
@@ -66,6 +67,7 @@ const ACTOR_NATURE_BY_KIND = {
|
|
|
66
67
|
organization: 'operated',
|
|
67
68
|
project: 'operated',
|
|
68
69
|
channel: 'operated',
|
|
70
|
+
community: 'operated',
|
|
69
71
|
};
|
|
70
72
|
/** `null` for a value that is not an account kind. Never a guess. */
|
|
71
73
|
function accountKindActorNature(kind) {
|
|
@@ -30,6 +30,7 @@ exports.ACCOUNT_KINDS = [
|
|
|
30
30
|
'project',
|
|
31
31
|
'bot',
|
|
32
32
|
'channel',
|
|
33
|
+
'community',
|
|
33
34
|
];
|
|
34
35
|
exports.CHILD_ACCOUNT_KINDS = [
|
|
35
36
|
'organization',
|
|
@@ -310,6 +311,7 @@ exports.ACCOUNT_CATEGORY_KINDS = [
|
|
|
310
311
|
'project',
|
|
311
312
|
'bot',
|
|
312
313
|
'channel',
|
|
314
|
+
'community',
|
|
313
315
|
];
|
|
314
316
|
/**
|
|
315
317
|
* Whether an account of this kind may carry categories.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* The account-name policy, without Zod. Schema: `../accountName.ts`.
|
|
4
|
+
*
|
|
5
|
+
* Part of `@oxy.so/contracts/client`: never import `zod` here (see `./check.ts`).
|
|
6
|
+
*
|
|
7
|
+
* An account's name follows ONE of two policies, chosen by its `kind` and by
|
|
8
|
+
* nothing else — not by which route wrote it, nor by whether it is native or
|
|
9
|
+
* federated:
|
|
10
|
+
*
|
|
11
|
+
* - `person`: a human name. Letters of the allowlisted scripts, combining
|
|
12
|
+
* marks, spaces, the apostrophe and letter-flanked name separators; no
|
|
13
|
+
* digits. The character classes are generated data and live in
|
|
14
|
+
* `@oxy.so/core` (`isValidDisplayName`), which applies this table through
|
|
15
|
+
* `isValidAccountName`.
|
|
16
|
+
* - `title`: what an organization, project, bot, channel or community is called. Plain
|
|
17
|
+
* text — digits and punctuation are part of real titles ("Studio 54",
|
|
18
|
+
* "Blink-182") — without markup or control characters. Defined here, once.
|
|
19
|
+
*/
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.accountTitleCheck = exports.ACCOUNT_TITLE_DISALLOWED_SOURCE = exports.ACCOUNT_TITLE_MAX_LENGTH = exports.ACCOUNT_NAME_POLICY_BY_KIND = void 0;
|
|
22
|
+
exports.accountNamePolicyForKind = accountNamePolicyForKind;
|
|
23
|
+
exports.isPlainTextTitle = isPlainTextTitle;
|
|
24
|
+
const check_1 = require("./check");
|
|
25
|
+
/**
|
|
26
|
+
* The policy for each kind. A `Record` over the whole union, so adding a kind
|
|
27
|
+
* fails this file's typecheck until someone decides how it is named.
|
|
28
|
+
*/
|
|
29
|
+
exports.ACCOUNT_NAME_POLICY_BY_KIND = {
|
|
30
|
+
personal: 'person',
|
|
31
|
+
organization: 'title',
|
|
32
|
+
project: 'title',
|
|
33
|
+
bot: 'title',
|
|
34
|
+
channel: 'title',
|
|
35
|
+
community: 'title',
|
|
36
|
+
};
|
|
37
|
+
/** A missing kind is `personal`, the `users.kind` column default. */
|
|
38
|
+
function accountNamePolicyForKind(kind) {
|
|
39
|
+
return exports.ACCOUNT_NAME_POLICY_BY_KIND[kind ?? 'personal'];
|
|
40
|
+
}
|
|
41
|
+
/** Longest title, in UTF-16 code units after trimming. */
|
|
42
|
+
exports.ACCOUNT_TITLE_MAX_LENGTH = 300;
|
|
43
|
+
/**
|
|
44
|
+
* Source of the characters a title may not contain: `<`, `>`, the C0 controls
|
|
45
|
+
* and DEL. A class of literal code points — no property escapes — so it
|
|
46
|
+
* compiles on Hermes. The probe below rejects with it; the API compiles it with
|
|
47
|
+
* `g` to strip untrusted titles, so the gate and the strip cannot disagree.
|
|
48
|
+
*/
|
|
49
|
+
exports.ACCOUNT_TITLE_DISALLOWED_SOURCE = '[<>\\u0000-\\u001F\\u007F]';
|
|
50
|
+
const TITLE_DISALLOWED_PROBE = new RegExp(exports.ACCOUNT_TITLE_DISALLOWED_SOURCE, 'u');
|
|
51
|
+
/** Whether `value` holds no character the title policy disallows. */
|
|
52
|
+
function isPlainTextTitle(value) {
|
|
53
|
+
return !TITLE_DISALLOWED_PROBE.test(value);
|
|
54
|
+
}
|
|
55
|
+
/** The twin of `accountTitleSchema`. */
|
|
56
|
+
exports.accountTitleCheck = (0, check_1.refine)((0, check_1.string)(check_1.trim, (0, check_1.minLength)(1), (0, check_1.maxLength)(exports.ACCOUNT_TITLE_MAX_LENGTH)), isPlainTextTitle, 'Name must be plain text');
|
package/dist/cjs/client/index.js
CHANGED
|
@@ -30,10 +30,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
30
30
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
31
31
|
};
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.
|
|
34
|
-
exports.
|
|
35
|
-
exports.
|
|
36
|
-
exports.
|
|
33
|
+
exports.deviceActivateResponseCheck = exports.signedRecordEnvelopeCheck = exports.externalIdentityReferenceCheck = exports.loginResultCheck = exports.isLoopbackOrigin = 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.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
|
+
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 = 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.sessionAccountsChangedEventCheck = exports.deviceTokenMintResponseCheck = exports.deviceSessionSyncCheck = exports.deviceSessionStateCheck = exports.deviceRegisterResponseCheck = exports.deviceJoinResponseCheck = exports.deviceJoinCodeResponseCheck = exports.deviceBackgroundCredentialResponseCheck = exports.activeTokenCheck = exports.SESSION_ACCOUNTS_CHANGED_EVENT = exports.deviceDirectorySyncCheck = exports.deviceDirectoryCheck = void 0;
|
|
35
|
+
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.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.publicApplicationCheck = exports.supervisionStateCheck = exports.supervisionReviewInputCheck = exports.supervisionInviteInputCheck = exports.supervisionInvitationCheck = exports.supervisionContactsResponseCheck = exports.supervisionContactInputCheck = exports.supervisionAcceptInputCheck = 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.SUPERVISED_ACTIONS = exports.SAFETY_POLICY_VERSION = exports.PURCHASE_APPROVAL_STATUSES = exports.isFullReputationBalance = exports.recommendationRequestCheck = exports.subscriptionCreditGrantsResponseCheck = exports.subjectProductAccessQueryCheck = exports.subjectProductAccessCheck = exports.productSubscriptionsResponseCheck = exports.productSubscriptionRenewalRequestCheck = exports.productSubscriptionCancellationResultCheck = exports.productPlanCheckoutRequestCheck = exports.productPlanCatalogueCheck = exports.personalPlanCheckoutResultCheck = exports.personalPlanCheckoutRequestCheck = exports.personalPlanCatalogueCheck = void 0;
|
|
36
|
+
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.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.userNameCheck = exports.usernameCheckForAccountKind = exports.usernameCheck = exports.stripDisallowedUsernameCharacters = 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 = void 0;
|
|
37
|
+
exports.appAttestKeyResponseCheck = void 0;
|
|
37
38
|
var check_1 = require("./check");
|
|
38
39
|
Object.defineProperty(exports, "ContractCheckError", { enumerable: true, get: function () { return check_1.ContractCheckError; } });
|
|
39
40
|
Object.defineProperty(exports, "checkContract", { enumerable: true, get: function () { return check_1.checkContract; } });
|
|
@@ -53,6 +54,13 @@ Object.defineProperty(exports, "isOperatorSwitchTargetKind", { enumerable: true,
|
|
|
53
54
|
Object.defineProperty(exports, "isSelectableAccountCategoryId", { enumerable: true, get: function () { return accountGraph_1.isSelectableAccountCategoryId; } });
|
|
54
55
|
Object.defineProperty(exports, "kindAcceptsAccountCategories", { enumerable: true, get: function () { return accountGraph_1.kindAcceptsAccountCategories; } });
|
|
55
56
|
Object.defineProperty(exports, "newlyAddedRetiredCategories", { enumerable: true, get: function () { return accountGraph_1.newlyAddedRetiredCategories; } });
|
|
57
|
+
var accountName_1 = require("./accountName");
|
|
58
|
+
Object.defineProperty(exports, "ACCOUNT_NAME_POLICY_BY_KIND", { enumerable: true, get: function () { return accountName_1.ACCOUNT_NAME_POLICY_BY_KIND; } });
|
|
59
|
+
Object.defineProperty(exports, "ACCOUNT_TITLE_DISALLOWED_SOURCE", { enumerable: true, get: function () { return accountName_1.ACCOUNT_TITLE_DISALLOWED_SOURCE; } });
|
|
60
|
+
Object.defineProperty(exports, "ACCOUNT_TITLE_MAX_LENGTH", { enumerable: true, get: function () { return accountName_1.ACCOUNT_TITLE_MAX_LENGTH; } });
|
|
61
|
+
Object.defineProperty(exports, "accountNamePolicyForKind", { enumerable: true, get: function () { return accountName_1.accountNamePolicyForKind; } });
|
|
62
|
+
Object.defineProperty(exports, "accountTitleCheck", { enumerable: true, get: function () { return accountName_1.accountTitleCheck; } });
|
|
63
|
+
Object.defineProperty(exports, "isPlainTextTitle", { enumerable: true, get: function () { return accountName_1.isPlainTextTitle; } });
|
|
56
64
|
var accountEmail_1 = require("./accountEmail");
|
|
57
65
|
Object.defineProperty(exports, "EMAIL_CODE_LENGTH", { enumerable: true, get: function () { return accountEmail_1.EMAIL_CODE_LENGTH; } });
|
|
58
66
|
Object.defineProperty(exports, "EMAIL_CODE_MAX_ATTEMPTS", { enumerable: true, get: function () { return accountEmail_1.EMAIL_CODE_MAX_ATTEMPTS; } });
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.organizationCurationResultCheck = exports.organizationExternalResolutionCheck = exports.organizationExternalCheck = exports.organizationImportBatchResultCheck = exports.organizationClaimReviewCheck = exports.organizationClaimListCheck = exports.organizationClaimDetailCheck = exports.organizationClaimCheck = exports.organizationClaimInputCheck = exports.organizationBatchCheck = exports.organizationListCheck = exports.organizationCheck = exports.updateOrganizationCheck = exports.createOrganizationCheck = exports.organizationNameCheck = exports.ORGANIZATION_ERROR_CODES = exports.ORGANIZATION_NAME_MAX_LENGTH = exports.ORGANIZATION_CLAIM_DECISIONS = exports.ORGANIZATION_ALIAS_KINDS = exports.ORGANIZATION_CLAIM_STATUSES = exports.ORGANIZATION_STATUSES = exports.ORGANIZATION_TYPES = void 0;
|
|
9
|
+
const accountName_1 = require("./accountName");
|
|
9
10
|
const check_1 = require("./check");
|
|
10
11
|
/** Real-world identity classification, independent of account topics and permissions. */
|
|
11
12
|
exports.ORGANIZATION_TYPES = [
|
|
@@ -25,7 +26,8 @@ exports.ORGANIZATION_ALIAS_KINDS = [
|
|
|
25
26
|
'misspelling',
|
|
26
27
|
];
|
|
27
28
|
exports.ORGANIZATION_CLAIM_DECISIONS = ['pending', 'approved', 'rejected'];
|
|
28
|
-
|
|
29
|
+
/** An organization's name is a title; the cap is the title policy's. */
|
|
30
|
+
exports.ORGANIZATION_NAME_MAX_LENGTH = accountName_1.ACCOUNT_TITLE_MAX_LENGTH;
|
|
29
31
|
exports.ORGANIZATION_ERROR_CODES = [
|
|
30
32
|
'bad_request',
|
|
31
33
|
'unauthorized',
|
|
@@ -50,9 +52,8 @@ const organizationAlias = (0, check_1.strictObject)({
|
|
|
50
52
|
kind: (0, check_1.oneOf)(exports.ORGANIZATION_ALIAS_KINDS),
|
|
51
53
|
language: (0, check_1.optional)((0, check_1.string)((0, check_1.minLength)(2), (0, check_1.maxLength)(35))),
|
|
52
54
|
});
|
|
53
|
-
/** The twin of `organizationNameSchema
|
|
54
|
-
exports.organizationNameCheck =
|
|
55
|
-
Array.from(value).every((character) => character.charCodeAt(0) >= 32 && character.charCodeAt(0) !== 127), 'Organization name must be plain text');
|
|
55
|
+
/** The twin of `organizationNameSchema`: the title policy (`./accountName.ts`). */
|
|
56
|
+
exports.organizationNameCheck = accountName_1.accountTitleCheck;
|
|
56
57
|
const organizationFields = {
|
|
57
58
|
name: exports.organizationNameCheck,
|
|
58
59
|
organizationType: (0, check_1.oneOf)(exports.ORGANIZATION_TYPES),
|
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.FREE_USER_PROFILE_COLOR_PRESETS = exports.USER_PROFILE_COLOR_PRESETS = exports.USER_PROFILE_COLORS = void 0;
|
|
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_PICKABLE_COLORS = 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.isOperatorSwitchTargetKind = exports.isDelegatedActAsEligibleKind = exports.isAccountKind = exports.childAccountKindSchema = exports.CHILD_ACCOUNT_KINDS = exports.accountKindSchema = exports.ACCOUNT_KINDS = void 0;
|
|
29
|
+
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.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.NUMERIC_USERNAME_MESSAGE = exports.RESERVED_USERNAME_MESSAGE = exports.BOT_USERNAME_INVALID_MESSAGE = void 0;
|
|
30
|
+
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 = 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 = void 0;
|
|
31
|
+
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 = 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 = void 0;
|
|
32
|
+
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 = 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 = void 0;
|
|
33
|
+
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 = 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 = void 0;
|
|
34
|
+
exports.parseIdentityLinkQrPayload = exports.buildIdentityLinkQrPayload = exports.identityLinkIdSchema = exports.IDENTITY_LINK_QR_PREFIX = exports.IDENTITY_LINK_STATUSES = exports.totpBackupCodesResponseSchema = exports.totpReauthRequestSchema = exports.totpConfirmRequestSchema = exports.totpEnrollResponseSchema = exports.signInMethodsSchema = exports.emailSetRequestSchema = exports.emailChangeStartRequestSchema = exports.signInMethodRemoveRequestSchema = exports.passwordSetRequestSchema = exports.reauthEmailStartRequestSchema = exports.REAUTH_ACTIONS = exports.reauthProofSchema = exports.isSecondFactorRequired = exports.signUpRequestSchema = exports.secondFactorRequiredSchema = exports.secondFactorSignInRequestSchema = exports.passwordSignInRequestSchema = exports.isEmailSignInChooseAccount = exports.emailSignInChooseRequestSchema = exports.emailSignInChooseAccountSchema = exports.emailSignInAccountOptionSchema = exports.EMAIL_ACCOUNTS_MAX = exports.EMAIL_SIGNIN_CHOICE_TTL_MS = exports.emailSignInPendingSchema = exports.emailSignInLinkResponseSchema = exports.emailSignInLinkRequestSchema = exports.emailSignInCollectRequestSchema = exports.EMAIL_SIGNIN_LONG_CODE_LENGTH = exports.EMAIL_SIGNIN_LONG_CODE_ALPHABET = exports.normalizeEmailSignInCode = exports.emailSignInCodeSchema = exports.emailSignInConfirmRequestSchema = 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 = void 0;
|
|
35
|
+
exports.INFERENCE_ERROR_CODES = exports.inferenceAttributionSchema = exports.authenticatedPrincipalSchema = exports.billingPrincipalSchema = exports.inferenceScopeSchema = exports.INFERENCE_SCOPES = exports.unitPriceSchema = exports.usageQuantitySchema = exports.usageSourceSchema = exports.USAGE_SOURCES = exports.usageUnitSchema = exports.USAGE_UNITS = exports.moneySchema = exports.exactDecimalSchema = exports.INFERENCE_MONEY_SCALE = exports.currencyCodeSchema = exports.RESERVED_ALIA_PUBLISHER = exports.inferenceFundingTierSchema = exports.inferenceRegionSchema = exports.deploymentIdSchema = exports.inferenceProviderSlugSchema = exports.routingProfileSlugSchema = exports.routingProfileIdSchema = exports.modelReferenceSchema = exports.modelRevisionLabelSchema = exports.modelIdSchema = exports.modelSlugSchema = exports.publisherSlugSchema = exports.sha256DigestSchema = exports.inferenceHttpsUrlSchema = exports.inferenceDateSchema = exports.inferenceTimestampSchema = exports.inferenceEnvironmentSchema = exports.idempotencyKeySchema = exports.generationIdSchema = exports.requestIdSchema = exports.oxyCredentialIdSchema = 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 = void 0;
|
|
36
|
+
exports.aliaReleaseArtifactSchema = exports.authorizedRouteSchema = exports.effectiveSameModelDeployment = exports.routingPolicyReferenceSchema = exports.routingPolicySchema = exports.routingFallbackPolicySchema = exports.routingPolicyScopeSchema = exports.routingTargetSchema = exports.modelCatalogueEntrySchema = exports.catalogueServingProviderSummarySchema = exports.cataloguePublisherSummarySchema = exports.routingProfileSchema = exports.routingProfileCandidateSchema = exports.modelDeploymentSchema = exports.inferenceProviderSchema = exports.modelRevisionSchema = exports.catalogueModelSchema = exports.modelPublisherSchema = exports.modelSafetyMetadataSchema = exports.modelEvaluationResultSchema = exports.modelDeprecationSchema = exports.commercialPermissionSchema = exports.availabilityScopeSchema = exports.inferenceDataPolicySchema = exports.modelProvenanceSchema = exports.modelLicenseSchema = exports.modelCapabilitiesSchema = exports.modelRealtimeCapabilitiesSchema = exports.realtimeSessionTransportSchema = exports.realtimeSessionKindSchema = exports.inferenceApiFormatSchema = exports.modelPowerClassSchema = exports.powerLevelSchema = exports.reasoningEffortSchema = exports.inferenceOutputModalitySchema = exports.inferenceModalitySchema = exports.priceSnapshotSchema = 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 = void 0;
|
|
37
|
+
exports.realtimeOutputModalitySchema = exports.realtimeAudioFormatSchema = exports.realtimeResponseIdSchema = exports.realtimeItemIdSchema = exports.realtimeCommandIdSchema = exports.MAX_REALTIME_RESUME_WINDOW_MS = exports.MAX_REALTIME_SESSION_AUDIO_BYTES = exports.MAX_REALTIME_SESSION_DURATION_MS = exports.MAX_REALTIME_AUDIO_FRAME_BASE64_LENGTH = exports.inferenceStreamEventSchema = exports.inferenceStreamDoneEventSchema = exports.inferenceFinishReasonSchema = exports.inferenceStreamErrorEventSchema = exports.inferenceStreamRouteSwitchEventSchema = exports.inferenceRouteSwitchReasonSchema = exports.inferenceRouteSwitchDetailSchema = exports.inferenceStreamUsageEventSchema = exports.inferenceStreamToolCallEventSchema = exports.inferenceStreamAudioEventSchema = exports.MAX_INFERENCE_AUDIO_BYTES = exports.inferenceAudioMediaTypeSchema = exports.inferenceStreamDeltaEventSchema = exports.inferenceStreamStartEventSchema = exports.inferenceAudioOutputParametersSchema = exports.inferenceSpeechParametersSchema = exports.inferenceRequestSchema = exports.clientRequestMetadataSchema = exports.responseFormatSchema = exports.toolChoiceSchema = exports.toolDefinitionSchema = exports.inferenceReasoningSchema = exports.samplingParametersSchema = exports.inferenceInputSchema = exports.inferenceMessageSchema = exports.inferenceMessageRoleSchema = exports.inferenceToolCallSchema = exports.inferenceContentPartSchema = 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 = void 0;
|
|
38
|
+
exports.usageReservationRequestSchema = exports.realtimeServerEventSchema = exports.realtimeSessionClosedEventSchema = exports.realtimeSessionCloseReasonSchema = exports.realtimeErrorEventSchema = exports.realtimeResponseDoneEventSchema = exports.realtimeResponseStatusSchema = exports.realtimeToolCallEventSchema = exports.realtimeTextDeltaEventSchema = exports.realtimeTranscriptDoneEventSchema = exports.realtimeTranscriptDeltaEventSchema = exports.realtimeTranscriptSourceSchema = exports.realtimeOutputAudioDoneEventSchema = exports.realtimeOutputAudioDeltaEventSchema = exports.realtimeResponseCreatedEventSchema = exports.realtimeInputAudioClearedEventSchema = exports.realtimeInputAudioCommittedEventSchema = exports.realtimeSpeechStoppedEventSchema = exports.realtimeSpeechStartedEventSchema = exports.realtimeItemTruncatedEventSchema = exports.realtimeItemDeletedEventSchema = exports.realtimeItemDoneEventSchema = exports.realtimeItemAddedEventSchema = exports.realtimeCommandAcceptedEventSchema = exports.realtimeSessionResumedEventSchema = exports.realtimeSessionUpdatedEventSchema = exports.realtimeSessionCreatedEventSchema = exports.realtimeClientCommandSchema = exports.realtimeSessionCloseCommandSchema = exports.realtimeSessionResumeCommandSchema = exports.realtimeResponseCancelCommandSchema = exports.realtimeResponseCreateCommandSchema = exports.realtimeInputAudioClearCommandSchema = exports.realtimeInputAudioCommitCommandSchema = exports.realtimeInputAudioAppendCommandSchema = exports.realtimeItemTruncateCommandSchema = exports.realtimeItemDeleteCommandSchema = 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 = void 0;
|
|
39
|
+
exports.AUTO_RECHARGE_STATUSES = exports.externalPaymentSchema = exports.externalPaymentKindSchema = exports.EXTERNAL_PAYMENT_KINDS = exports.externalPaymentProviderSchema = exports.EXTERNAL_PAYMENT_PROVIDERS = exports.billingInvoiceSchema = exports.billingInvoiceStatusSchema = exports.BILLING_INVOICE_STATUSES = exports.accountBillingStateSchema = exports.billingProfileSchema = exports.autoRechargeSchema = exports.billingProfileStatusSchema = exports.BILLING_PROFILE_STATUSES = exports.billingModeSchema = exports.BILLING_MODES = exports.providerConnectionSchema = exports.providerConnectionStatusSchema = exports.providerConnectionValidationSchema = exports.providerCredentialCustodyStateSchema = exports.providerCredentialValidationDeploymentSchema = exports.providerCredentialValidationOperationSchema = exports.kaanaCredentialValidationOutcomeSchema = exports.kaanaCredentialValidationFailureCodeSchema = exports.kaanaCredentialValidationOutcomeStateSchema = exports.kaanaCredentialValidationTaskSchema = exports.kaanaCredentialOutcomeSchema = exports.kaanaCredentialConflictOutcomeSchema = exports.kaanaCredentialAppliedOutcomeSchema = exports.kaanaCredentialOutcomeRequestSchema = exports.kaanaCredentialRevokeOutcomeRequestSchema = exports.kaanaCredentialRotateOutcomeRequestSchema = exports.kaanaCredentialCreateOutcomeRequestSchema = exports.kaanaCredentialMutationSchema = exports.kaanaCredentialRevokeMutationSchema = exports.kaanaCredentialRotateMutationSchema = exports.kaanaCredentialCreateMutationSchema = 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 = void 0;
|
|
40
|
+
exports.automationActorSelectionSchema = exports.automationTriggerSchema = exports.agentAvailabilitySchema = exports.applicationAgentSchema = exports.applicationAgentWriteSchema = exports.applicationAgentAvailabilitySchema = exports.APPLICATION_AGENT_AVAILABILITIES = exports.agentRequesterCeilingSchema = exports.agentRequesterCeilingWriteSchema = exports.AGENT_REQUESTER_CEILING_AUTONOMY = exports.delegationGrantSchema = exports.capabilityTicketRequestSchema = exports.capabilityCoordinatorSchema = exports.executionAuthorizationRefSchema = exports.capabilityCatalogBindingSchema = exports.grantLimitSchema = exports.toolGrantOverrideSchema = exports.resourceRefSchema = exports.foregroundExecutionAuthorizationInputSchema = exports.executionActorRefSchema = exports.actorRefSchema = exports.capabilityPackageSchema = exports.autonomyLevelSchema = exports.CAPABILITY_PACKAGES = exports.AUTONOMY_LEVELS = exports.costCenterUsageSchema = exports.providerCostSourceSchema = exports.PROVIDER_COST_SOURCES = exports.inferenceEconomicTreatmentSchema = exports.INFERENCE_ECONOMIC_TREATMENTS = exports.productEntitlementSchema = exports.costCenterSpendSchema = exports.costCenterSchema = exports.costCenterStatusSchema = exports.COST_CENTER_STATUSES = exports.payAsYouGoEntitlementSchema = exports.productPlanSchema = 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 = void 0;
|
|
41
|
+
exports.meteredGenerationSchema = exports.subjectProductAccessSchema = exports.productOfferSegmentSchema = exports.subjectProductGrantSnapshotSchema = exports.productAccessGrantSchema = exports.productSubscriptionSourceSchema = exports.productOfferSchema = exports.productBenefitSchema = exports.subjectProductAccessQuerySchema = exports.productDefinitionSchema = exports.inboxInferenceStreamEventSchema = exports.inboxThreadSummaryResponseSchema = exports.inboxSmartRepliesResponseSchema = exports.inboxNaturalSearchResponseSchema = exports.inboxInferenceTextResponseSchema = exports.inboxMessageInferenceParamsSchema = exports.inboxNaturalSearchRequestSchema = exports.INBOX_DAILY_BRIEF_SECTIONS = exports.inboxDailyBriefResponseSchema = exports.inboxDailyBriefRequestSchema = exports.inboxComposeRequestSchema = exports.emailAgentContextSchema = exports.emailContextMessageSchema = exports.emailContextMailboxSchema = exports.emailContextAddressSchema = exports.resolveCatalogInvocation = exports.matchCatalogInvocation = exports.findOverlappingCatalogInvocations = exports.catalogInvocationTemplatesEquivalent = exports.catalogInvocationsOverlap = exports.catalogInvocationPathParameters = exports.normalizedAppEventSchema = 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 = void 0;
|
|
42
|
+
exports.FREE_USER_PROFILE_COLOR_PRESETS = exports.USER_PROFILE_COLOR_PRESETS = exports.USER_PROFILE_COLORS = exports.serviceTokenOptionsSchema = exports.serviceTokenScopesSchema = exports.productPlanCatalogueSchema = exports.personalPlanCatalogueSchema = exports.personalPlanDisplayPriceSchema = exports.productSubscriptionCancellationResultSchema = exports.cancelProductSubscriptionSchema = exports.subscriptionCreditGrantsResponseSchema = exports.subscriptionCreditGrantSchema = exports.productSubscriptionsResponseSchema = exports.productSubscriptionSummarySchema = exports.isLoopbackOrigin = exports.inputSatisfiesCapabilityLimits = exports.canonicalCapabilityJson = 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; } });
|
|
@@ -60,6 +60,13 @@ Object.defineProperty(exports, "RETIRED_ACCOUNT_CATEGORY_IDS", { enumerable: tru
|
|
|
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
62
|
Object.defineProperty(exports, "accountNameSchema", { enumerable: true, get: function () { return accountGraph_1.accountNameSchema; } });
|
|
63
|
+
var accountName_1 = require("./accountName");
|
|
64
|
+
Object.defineProperty(exports, "ACCOUNT_NAME_POLICY_BY_KIND", { enumerable: true, get: function () { return accountName_1.ACCOUNT_NAME_POLICY_BY_KIND; } });
|
|
65
|
+
Object.defineProperty(exports, "ACCOUNT_TITLE_DISALLOWED_SOURCE", { enumerable: true, get: function () { return accountName_1.ACCOUNT_TITLE_DISALLOWED_SOURCE; } });
|
|
66
|
+
Object.defineProperty(exports, "ACCOUNT_TITLE_MAX_LENGTH", { enumerable: true, get: function () { return accountName_1.ACCOUNT_TITLE_MAX_LENGTH; } });
|
|
67
|
+
Object.defineProperty(exports, "accountNamePolicyForKind", { enumerable: true, get: function () { return accountName_1.accountNamePolicyForKind; } });
|
|
68
|
+
Object.defineProperty(exports, "accountTitleSchema", { enumerable: true, get: function () { return accountName_1.accountTitleSchema; } });
|
|
69
|
+
Object.defineProperty(exports, "isPlainTextTitle", { enumerable: true, get: function () { return accountName_1.isPlainTextTitle; } });
|
|
63
70
|
var avatarCharacter_1 = require("./avatarCharacter");
|
|
64
71
|
Object.defineProperty(exports, "AVATAR_EYE_SPACING", { enumerable: true, get: function () { return avatarCharacter_1.AVATAR_EYE_SPACING; } });
|
|
65
72
|
Object.defineProperty(exports, "AVATAR_PICKABLE_COLORS", { enumerable: true, get: function () { return avatarCharacter_1.AVATAR_PICKABLE_COLORS; } });
|
|
@@ -127,6 +134,15 @@ Object.defineProperty(exports, "OXY_USER_CHANGE_REASONS", { enumerable: true, ge
|
|
|
127
134
|
Object.defineProperty(exports, "OXY_PUBLISHED_USER_CHANGE_REASONS", { enumerable: true, get: function () { return userInvalidation_1.OXY_PUBLISHED_USER_CHANGE_REASONS; } });
|
|
128
135
|
Object.defineProperty(exports, "isPublishedOxyUserChangeReason", { enumerable: true, get: function () { return userInvalidation_1.isPublishedOxyUserChangeReason; } });
|
|
129
136
|
Object.defineProperty(exports, "oxyUserInvalidationEventSchema", { enumerable: true, get: function () { return userInvalidation_1.oxyUserInvalidationEventSchema; } });
|
|
137
|
+
var sessionRevocation_1 = require("./sessionRevocation");
|
|
138
|
+
Object.defineProperty(exports, "OXY_SERVICE_EVENTS_NAMESPACE", { enumerable: true, get: function () { return sessionRevocation_1.OXY_SERVICE_EVENTS_NAMESPACE; } });
|
|
139
|
+
Object.defineProperty(exports, "OXY_SESSION_REVOKED_EVENT", { enumerable: true, get: function () { return sessionRevocation_1.OXY_SESSION_REVOKED_EVENT; } });
|
|
140
|
+
Object.defineProperty(exports, "OXY_SERVICE_EVENTS_HEARTBEAT_EVENT", { enumerable: true, get: function () { return sessionRevocation_1.OXY_SERVICE_EVENTS_HEARTBEAT_EVENT; } });
|
|
141
|
+
Object.defineProperty(exports, "OXY_SERVICE_EVENTS_HEARTBEAT_MS", { enumerable: true, get: function () { return sessionRevocation_1.OXY_SERVICE_EVENTS_HEARTBEAT_MS; } });
|
|
142
|
+
Object.defineProperty(exports, "OXY_SERVICE_EVENTS_STALE_AFTER_MS", { enumerable: true, get: function () { return sessionRevocation_1.OXY_SERVICE_EVENTS_STALE_AFTER_MS; } });
|
|
143
|
+
Object.defineProperty(exports, "OXY_SERVICE_EVENTS_FORBIDDEN", { enumerable: true, get: function () { return sessionRevocation_1.OXY_SERVICE_EVENTS_FORBIDDEN; } });
|
|
144
|
+
Object.defineProperty(exports, "oxySessionRevocationEventSchema", { enumerable: true, get: function () { return sessionRevocation_1.oxySessionRevocationEventSchema; } });
|
|
145
|
+
Object.defineProperty(exports, "oxyServiceEventsHeartbeatSchema", { enumerable: true, get: function () { return sessionRevocation_1.oxyServiceEventsHeartbeatSchema; } });
|
|
130
146
|
var recommendations_1 = require("./recommendations");
|
|
131
147
|
// Schemas
|
|
132
148
|
Object.defineProperty(exports, "recommendationExcludeTypeSchema", { enumerable: true, get: function () { return recommendations_1.recommendationExcludeTypeSchema; } });
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.organizationCurationResultSchema = exports.organizationCurationSchema = exports.organizationErrorSchema = 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.organizationAliasSchema = exports.ORGANIZATION_ERROR_CODES = exports.ORGANIZATION_NAME_MAX_LENGTH = exports.ORGANIZATION_CLAIM_DECISIONS = exports.ORGANIZATION_ALIAS_KINDS = exports.ORGANIZATION_CLAIM_STATUSES = exports.ORGANIZATION_STATUSES = exports.ORGANIZATION_TYPES = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
const accountName_1 = require("./accountName");
|
|
5
6
|
// The Zod-free half of this contract lives in `./client/` (`@oxy.so/contracts/client`);
|
|
6
7
|
// it is re-exported here so the root entry is unchanged.
|
|
7
8
|
const organizations_1 = require("./client/organizations");
|
|
@@ -22,13 +23,8 @@ exports.organizationAliasSchema = zod_1.z
|
|
|
22
23
|
language: zod_1.z.string().min(2).max(35).optional(),
|
|
23
24
|
})
|
|
24
25
|
.strict();
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
.trim()
|
|
28
|
-
.min(1)
|
|
29
|
-
.max(organizations_1.ORGANIZATION_NAME_MAX_LENGTH)
|
|
30
|
-
.refine((value) => !/[<>]/.test(value) &&
|
|
31
|
-
Array.from(value).every((character) => character.charCodeAt(0) >= 32 && character.charCodeAt(0) !== 127), 'Organization name must be plain text');
|
|
26
|
+
/** An organization is named by the title policy every non-personal account uses. */
|
|
27
|
+
exports.organizationNameSchema = accountName_1.accountTitleSchema;
|
|
32
28
|
exports.createOrganizationSchema = zod_1.z
|
|
33
29
|
.object({
|
|
34
30
|
name: exports.organizationNameSchema,
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Canonical contract for the session-revocation feed: oxy-api telling every
|
|
4
|
+
* connected Oxy backend that a session stopped being valid.
|
|
5
|
+
*
|
|
6
|
+
* WHY IT EXISTS. `@oxy.so/core/server` reuses a successful bearer validation on
|
|
7
|
+
* a backend for a short TTL, because an app backend cannot verify a user access
|
|
8
|
+
* token itself (HS256 under a secret only oxy-api holds) and asking Oxy on every
|
|
9
|
+
* request put ~300 ms on every authenticated route. A cache like that is only
|
|
10
|
+
* safe if it hears about revocations the moment they happen. This feed is how it
|
|
11
|
+
* hears: oxy-api announces every session it ends — logout, sign-out-all, device
|
|
12
|
+
* removal, an account switched away from, an admin or operator revocation, a
|
|
13
|
+
* credential change that ends sessions, account deletion or archive — and the
|
|
14
|
+
* SDK drops what it cached for that session or user.
|
|
15
|
+
*
|
|
16
|
+
* THE TRANSPORT IS THE SDK's. A backend opens no Redis client and wires nothing:
|
|
17
|
+
* `OxyServer` connects to the {@link OXY_SERVICE_EVENTS_NAMESPACE} Socket.IO
|
|
18
|
+
* namespace on oxy-api with its own service token, and uses its validation cache
|
|
19
|
+
* ONLY while that connection is live (connected, and a
|
|
20
|
+
* {@link OXY_SERVICE_EVENTS_HEARTBEAT_EVENT} seen within
|
|
21
|
+
* {@link OXY_SERVICE_EVENTS_STALE_AFTER_MS}). Disconnected, stale or never
|
|
22
|
+
* connected, it validates every request against Oxy. So a lost connection costs
|
|
23
|
+
* latency, never correctness.
|
|
24
|
+
*
|
|
25
|
+
* DELIVERY. A revocation is announced after the write that ended the session
|
|
26
|
+
* committed. Between oxy-api tasks it rides Valkey pub/sub, which is
|
|
27
|
+
* at-most-once; the heartbeat is what makes a silent loss of the path visible —
|
|
28
|
+
* a task emits it only while its own Valkey round trip works — so a consumer
|
|
29
|
+
* stops trusting its cache when the path stops working, instead of trusting it
|
|
30
|
+
* forever.
|
|
31
|
+
*
|
|
32
|
+
* PRIVACY — the payload carries ids and a timestamp only. Only Oxy's own
|
|
33
|
+
* (internal-tier) services may join the namespace, and even so nothing a
|
|
34
|
+
* consumer could render is ever placed on it.
|
|
35
|
+
*
|
|
36
|
+
* Platform-agnostic — zod only, no react/react-native/expo.
|
|
37
|
+
*/
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
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 = void 0;
|
|
40
|
+
const zod_1 = require("zod");
|
|
41
|
+
/** The Socket.IO namespace on oxy-api that carries service events. */
|
|
42
|
+
exports.OXY_SERVICE_EVENTS_NAMESPACE = '/service-events';
|
|
43
|
+
/** One session (or every session of one user) stopped being valid. */
|
|
44
|
+
exports.OXY_SESSION_REVOKED_EVENT = 'session:revoked';
|
|
45
|
+
/**
|
|
46
|
+
* Emitted on connect and then every {@link OXY_SERVICE_EVENTS_HEARTBEAT_MS}
|
|
47
|
+
* while the emitting oxy-api task can still hear revocations (its Valkey
|
|
48
|
+
* subscription round-trips). Carries `{ at }`, the task's epoch-ms clock.
|
|
49
|
+
*/
|
|
50
|
+
exports.OXY_SERVICE_EVENTS_HEARTBEAT_EVENT = 'heartbeat';
|
|
51
|
+
/** How often a live oxy-api task sends {@link OXY_SERVICE_EVENTS_HEARTBEAT_EVENT}. */
|
|
52
|
+
exports.OXY_SERVICE_EVENTS_HEARTBEAT_MS = 5000;
|
|
53
|
+
/**
|
|
54
|
+
* How long a consumer keeps trusting the feed after the last heartbeat. Past
|
|
55
|
+
* this the feed counts as down: every cached validation is dropped and nothing
|
|
56
|
+
* is cached until heartbeats resume.
|
|
57
|
+
*/
|
|
58
|
+
exports.OXY_SERVICE_EVENTS_STALE_AFTER_MS = 12000;
|
|
59
|
+
/**
|
|
60
|
+
* The `connect_error` message oxy-api answers a caller that may never join the
|
|
61
|
+
* namespace (not a service token, or not an internal-tier application). A
|
|
62
|
+
* consumer stops retrying quickly on it; any other refusal is retried.
|
|
63
|
+
*/
|
|
64
|
+
exports.OXY_SERVICE_EVENTS_FORBIDDEN = 'service_events_forbidden';
|
|
65
|
+
/**
|
|
66
|
+
* A session revocation.
|
|
67
|
+
*
|
|
68
|
+
* - With `sessionId`: that one session ended. `userId` is the account it spoke
|
|
69
|
+
* as.
|
|
70
|
+
* - Without `sessionId`: every session of `userId` ended, or may have — the
|
|
71
|
+
* account was deleted or archived, or signed out everywhere. A consumer drops
|
|
72
|
+
* everything it holds for that account, including sessions it operated as a
|
|
73
|
+
* delegate.
|
|
74
|
+
*
|
|
75
|
+
* `at` is the publisher's epoch-ms clock: diagnostic only (propagation delay),
|
|
76
|
+
* never used for ordering — the event says "ask Oxy again", which is idempotent.
|
|
77
|
+
*/
|
|
78
|
+
exports.oxySessionRevocationEventSchema = zod_1.z.object({
|
|
79
|
+
/** The session that ended; absent for a revocation of every session of `userId`. */
|
|
80
|
+
sessionId: zod_1.z.string().min(1).max(256).optional(),
|
|
81
|
+
/** The account the session (or sessions) spoke as. */
|
|
82
|
+
userId: zod_1.z.string().min(1).max(256),
|
|
83
|
+
/** Publisher's epoch-ms timestamp. Diagnostic only. */
|
|
84
|
+
at: zod_1.z.number().int().nonnegative(),
|
|
85
|
+
});
|
|
86
|
+
/** The heartbeat payload. */
|
|
87
|
+
exports.oxyServiceEventsHeartbeatSchema = zod_1.z.object({
|
|
88
|
+
at: zod_1.z.number().int().nonnegative(),
|
|
89
|
+
});
|