@oxy.so/contracts 4.16.0 → 4.21.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/accountAccess.js +72 -0
- package/dist/cjs/accountEmail.js +12 -34
- package/dist/cjs/accountGraph.js +22 -320
- package/dist/cjs/agency.js +112 -1
- package/dist/cjs/agentKeys.js +11 -13
- package/dist/cjs/applicationRoles.js +211 -0
- package/dist/cjs/client/accountEmail.js +48 -0
- package/dist/cjs/client/accountGraph.js +323 -0
- package/dist/cjs/client/agentKeys.js +77 -0
- package/dist/cjs/client/check.js +475 -0
- package/dist/cjs/client/deviceBoot.js +22 -0
- package/dist/cjs/client/deviceDirectory.js +51 -0
- package/dist/cjs/client/deviceSession.js +63 -0
- package/dist/cjs/client/externalIdentity.js +19 -0
- package/dist/cjs/client/identity.js +45 -0
- package/dist/cjs/client/identityLink.js +55 -0
- package/dist/cjs/client/identityProof.js +109 -0
- package/dist/cjs/client/index.js +211 -0
- package/dist/cjs/client/organizations.js +114 -0
- package/dist/cjs/client/products.js +153 -0
- package/dist/cjs/client/recommendations.js +33 -0
- package/dist/cjs/client/reputation.js +41 -0
- package/dist/cjs/client/safety.js +196 -0
- package/dist/cjs/client/sessionStatus.js +23 -0
- package/dist/cjs/client/signIn.js +159 -0
- package/dist/cjs/client/userResponse.js +15 -0
- package/dist/cjs/client/username.js +173 -0
- package/dist/cjs/deviceSession.js +3 -16
- package/dist/cjs/identityLink.js +13 -34
- package/dist/cjs/identityProof.js +18 -106
- package/dist/cjs/index.js +13 -3
- package/dist/cjs/organizations.js +21 -41
- package/dist/cjs/reputation.js +3 -34
- package/dist/cjs/safety.js +430 -1
- package/dist/cjs/serviceToken.js +14 -0
- package/dist/cjs/signIn.js +33 -111
- package/dist/cjs/username.js +23 -158
- package/dist/esm/accountAccess.js +69 -0
- package/dist/esm/accountEmail.js +4 -32
- package/dist/esm/accountGraph.js +4 -309
- package/dist/esm/agency.js +111 -0
- package/dist/esm/agentKeys.js +4 -10
- package/dist/esm/applicationRoles.js +207 -0
- package/dist/esm/client/accountEmail.js +45 -0
- package/dist/esm/client/accountGraph.js +314 -0
- package/dist/esm/client/agentKeys.js +74 -0
- package/dist/esm/client/check.js +436 -0
- package/dist/esm/client/deviceBoot.js +19 -0
- package/dist/esm/client/deviceDirectory.js +48 -0
- package/dist/esm/client/deviceSession.js +60 -0
- package/dist/esm/client/externalIdentity.js +16 -0
- package/dist/esm/client/identity.js +42 -0
- package/dist/esm/client/identityLink.js +50 -0
- package/dist/esm/client/identityProof.js +104 -0
- package/dist/esm/client/index.js +37 -0
- package/dist/esm/client/organizations.js +111 -0
- package/dist/esm/client/products.js +150 -0
- package/dist/esm/client/recommendations.js +30 -0
- package/dist/esm/client/reputation.js +37 -0
- package/dist/esm/client/safety.js +193 -0
- package/dist/esm/client/sessionStatus.js +20 -0
- package/dist/esm/client/signIn.js +153 -0
- package/dist/esm/client/userResponse.js +12 -0
- package/dist/esm/client/username.js +167 -0
- package/dist/esm/deviceSession.js +1 -15
- package/dist/esm/identityLink.js +4 -27
- package/dist/esm/identityProof.js +4 -99
- package/dist/esm/index.js +4 -1
- package/dist/esm/organizations.js +4 -31
- package/dist/esm/reputation.js +1 -32
- package/dist/esm/safety.js +423 -0
- package/dist/esm/serviceToken.js +11 -0
- package/dist/esm/signIn.js +4 -96
- package/dist/esm/username.js +4 -148
- package/dist/types/accountAccess.d.ts +128 -0
- package/dist/types/accountEmail.d.ts +4 -36
- package/dist/types/accountGraph.d.ts +12 -208
- package/dist/types/agency.d.ts +351 -26
- package/dist/types/agentKeys.d.ts +14 -12
- package/dist/types/applicationRoles.d.ts +438 -0
- package/dist/types/client/accountEmail.d.ts +44 -0
- package/dist/types/client/accountGraph.d.ts +203 -0
- package/dist/types/client/agentKeys.d.ts +113 -0
- package/dist/types/client/check.d.ts +187 -0
- package/dist/types/client/deviceBoot.d.ts +6 -0
- package/dist/types/client/deviceDirectory.d.ts +134 -0
- package/dist/types/client/deviceSession.d.ts +91 -0
- package/dist/types/client/externalIdentity.d.ts +14 -0
- package/dist/types/client/identity.d.ts +8 -0
- package/dist/types/client/identityLink.d.ts +21 -0
- package/dist/types/client/identityProof.d.ts +73 -0
- package/dist/types/client/index.d.ts +37 -0
- package/dist/types/client/organizations.d.ts +167 -0
- package/dist/types/client/products.d.ts +145 -0
- package/dist/types/client/recommendations.d.ts +27 -0
- package/dist/types/client/reputation.d.ts +28 -0
- package/dist/types/client/safety.d.ts +213 -0
- package/dist/types/client/sessionStatus.d.ts +19 -0
- package/dist/types/client/signIn.d.ts +107 -0
- package/dist/types/client/userResponse.d.ts +7 -0
- package/dist/types/client/username.d.ts +126 -0
- package/dist/types/deviceDirectory.d.ts +28 -28
- package/dist/types/deviceSession.d.ts +5 -16
- package/dist/types/email/messages.d.ts +2 -2
- package/dist/types/externalIdentity.d.ts +15 -15
- package/dist/types/identityLink.d.ts +3 -11
- package/dist/types/identityProof.d.ts +2 -65
- package/dist/types/index.d.ts +5 -2
- package/dist/types/inference/accountBilling.d.ts +2 -2
- package/dist/types/inference/catalogue.d.ts +22 -22
- package/dist/types/inference/decisions.d.ts +10 -10
- package/dist/types/inference/embeddings.d.ts +16 -16
- package/dist/types/inference/errors.d.ts +8 -8
- package/dist/types/inference/inbox.d.ts +8 -8
- package/dist/types/inference/privateAutoExecution.d.ts +6 -6
- package/dist/types/inference/providerConnection.d.ts +4 -4
- package/dist/types/inference/realtime.d.ts +92 -92
- package/dist/types/inference/request.d.ts +48 -48
- package/dist/types/inference/streamEvents.d.ts +16 -16
- package/dist/types/inference/usage.d.ts +4 -4
- package/dist/types/oauth.d.ts +2 -2
- package/dist/types/organizations.d.ts +8 -10
- package/dist/types/products/access.d.ts +4 -4
- package/dist/types/products/billing.d.ts +3 -0
- package/dist/types/reputation.d.ts +1 -11
- package/dist/types/safety.d.ts +2374 -2
- package/dist/types/serviceToken.d.ts +11 -0
- package/dist/types/sessionStatus.d.ts +2 -2
- package/dist/types/signIn.d.ts +11 -94
- package/dist/types/userResponse.d.ts +22 -22
- package/dist/types/username.d.ts +1 -96
- package/package.json +24 -20
- package/dist/cjs/.tsbuildinfo +0 -1
- package/dist/esm/.tsbuildinfo +0 -1
- package/dist/types/.tsbuildinfo +0 -1
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Identity-link constants, QR payload and response checks, without Zod. Schemas: `../identityLink.ts`.
|
|
4
|
+
*
|
|
5
|
+
* Part of `@oxy.so/contracts/client`: never import `zod` here (see `./check.ts`).
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.identityLinkStateCheck = exports.identityLinkCreateResponseCheck = exports.CHALLENGE = exports.LINK_ID = exports.IDENTITY_LINK_QR_PREFIX = exports.IDENTITY_LINK_STATUSES = void 0;
|
|
9
|
+
exports.buildIdentityLinkQrPayload = buildIdentityLinkQrPayload;
|
|
10
|
+
exports.parseIdentityLinkQrPayload = parseIdentityLinkQrPayload;
|
|
11
|
+
const check_1 = require("./check");
|
|
12
|
+
exports.IDENTITY_LINK_STATUSES = ['pending', 'signed', 'completed', 'cancelled'];
|
|
13
|
+
/** The scheme and host Commons routes a link QR to. */
|
|
14
|
+
exports.IDENTITY_LINK_QR_PREFIX = 'oxycommons://link';
|
|
15
|
+
exports.LINK_ID = /^[0-9a-f]{32}$/;
|
|
16
|
+
exports.CHALLENGE = /^[0-9a-f]{64}$/;
|
|
17
|
+
/** The QR auth.oxy.so shows: the request's id and the challenge Commons signs. */
|
|
18
|
+
function buildIdentityLinkQrPayload(linkId, challenge) {
|
|
19
|
+
return `${exports.IDENTITY_LINK_QR_PREFIX}?id=${linkId}&c=${challenge}`;
|
|
20
|
+
}
|
|
21
|
+
/** The request a scanned code names, or `null` for anything that is not a link QR. */
|
|
22
|
+
function parseIdentityLinkQrPayload(raw) {
|
|
23
|
+
const value = raw.trim();
|
|
24
|
+
if (!value.startsWith(`${exports.IDENTITY_LINK_QR_PREFIX}?`))
|
|
25
|
+
return null;
|
|
26
|
+
// Parsed by hand: React Native's `URLSearchParams` does not implement `get`.
|
|
27
|
+
const params = new Map();
|
|
28
|
+
for (const pair of value.slice(exports.IDENTITY_LINK_QR_PREFIX.length + 1).split('&')) {
|
|
29
|
+
const separator = pair.indexOf('=');
|
|
30
|
+
if (separator > 0)
|
|
31
|
+
params.set(pair.slice(0, separator), pair.slice(separator + 1));
|
|
32
|
+
}
|
|
33
|
+
const linkId = params.get('id') ?? '';
|
|
34
|
+
const challenge = params.get('c') ?? '';
|
|
35
|
+
if (!exports.LINK_ID.test(linkId) || !exports.CHALLENGE.test(challenge))
|
|
36
|
+
return null;
|
|
37
|
+
return { linkId, challenge };
|
|
38
|
+
}
|
|
39
|
+
/* -------------------------------------------------------------------------- */
|
|
40
|
+
/* Checks */
|
|
41
|
+
/* -------------------------------------------------------------------------- */
|
|
42
|
+
exports.identityLinkCreateResponseCheck = (0, check_1.exact)()((0, check_1.object)({
|
|
43
|
+
linkId: (0, check_1.string)(check_1.trim, (0, check_1.pattern)(exports.LINK_ID, 'linkId must be 32 lowercase hex characters')),
|
|
44
|
+
challenge: (0, check_1.string)((0, check_1.pattern)(exports.CHALLENGE)),
|
|
45
|
+
expiresAt: (0, check_1.number)(check_1.int, check_1.positive),
|
|
46
|
+
qrPayload: (0, check_1.string)((0, check_1.startsWith)(exports.IDENTITY_LINK_QR_PREFIX)),
|
|
47
|
+
}));
|
|
48
|
+
exports.identityLinkStateCheck = (0, check_1.exact)()((0, check_1.object)({
|
|
49
|
+
status: (0, check_1.oneOf)(exports.IDENTITY_LINK_STATUSES),
|
|
50
|
+
userId: (0, check_1.string)((0, check_1.minLength)(1)),
|
|
51
|
+
username: (0, check_1.nullable)((0, check_1.string)()),
|
|
52
|
+
publicKey: (0, check_1.nullable)((0, check_1.string)()),
|
|
53
|
+
audience: (0, check_1.string)((0, check_1.minLength)(1)),
|
|
54
|
+
expiresAt: (0, check_1.number)(check_1.int, check_1.positive),
|
|
55
|
+
}));
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* The identity-proof message format, without Zod. Schemas: `../identityProof.ts`.
|
|
4
|
+
*
|
|
5
|
+
* Part of `@oxy.so/contracts/client`: never import `zod` here (see `./check.ts`).
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.IDENTITY_ERROR_CODES = exports.CHALLENGE = exports.ROOT_KEY = exports.HEX_DIGEST = 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 = void 0;
|
|
9
|
+
exports.canonicalJson = canonicalJson;
|
|
10
|
+
exports.buildIdentityProofMessage = buildIdentityProofMessage;
|
|
11
|
+
exports.IDENTITY_PROOF_VERSION = 2;
|
|
12
|
+
exports.IDENTITY_PROOF_DOMAIN = 'oxy-identity-proof';
|
|
13
|
+
/** The audience every API-verified identity proof names. */
|
|
14
|
+
exports.IDENTITY_PROOF_AUDIENCE = 'oxy-api/identity';
|
|
15
|
+
/** How long a proof challenge lives: one interactive ceremony. */
|
|
16
|
+
exports.IDENTITY_PROOF_CHALLENGE_TTL_MS = 5 * 60 * 1000;
|
|
17
|
+
/**
|
|
18
|
+
* Everything a root proof may authorize. A challenge is minted for exactly one
|
|
19
|
+
* action and spent only by a proof for that action.
|
|
20
|
+
*/
|
|
21
|
+
exports.IDENTITY_PROOF_ACTIONS = {
|
|
22
|
+
/**
|
|
23
|
+
* Link Commons' root to an account that has none (`POST /auth/link`).
|
|
24
|
+
* The account becomes self-custodied and its email is deleted
|
|
25
|
+
* (ADR 0029 D3).
|
|
26
|
+
*/
|
|
27
|
+
link: 'link_identity',
|
|
28
|
+
};
|
|
29
|
+
exports.IDENTITY_PROOF_ACTION_VALUES = Object.values(exports.IDENTITY_PROOF_ACTIONS);
|
|
30
|
+
exports.HEX_DIGEST = /^[0-9a-f]{64}$/;
|
|
31
|
+
exports.ROOT_KEY = /^04[0-9a-f]{128}$/;
|
|
32
|
+
exports.CHALLENGE = /^[0-9a-f]{64}$/;
|
|
33
|
+
/**
|
|
34
|
+
* Canonical JSON: object keys sorted by UTF-16 code unit, no whitespace,
|
|
35
|
+
* `undefined` members omitted, arrays in order. Numbers must be finite. This is
|
|
36
|
+
* the ONLY serializer for anything digested into a proof.
|
|
37
|
+
*/
|
|
38
|
+
function canonicalJson(value) {
|
|
39
|
+
if (value === null)
|
|
40
|
+
return 'null';
|
|
41
|
+
switch (typeof value) {
|
|
42
|
+
case 'string':
|
|
43
|
+
case 'boolean':
|
|
44
|
+
return JSON.stringify(value);
|
|
45
|
+
case 'number':
|
|
46
|
+
if (!Number.isFinite(value))
|
|
47
|
+
throw new Error('canonicalJson: non-finite number');
|
|
48
|
+
return JSON.stringify(value);
|
|
49
|
+
case 'object': {
|
|
50
|
+
if (Array.isArray(value)) {
|
|
51
|
+
return `[${value.map((entry) => (entry === undefined ? 'null' : canonicalJson(entry))).join(',')}]`;
|
|
52
|
+
}
|
|
53
|
+
const record = value;
|
|
54
|
+
const keys = Object.keys(record)
|
|
55
|
+
.filter((key) => record[key] !== undefined)
|
|
56
|
+
.sort();
|
|
57
|
+
return `{${keys.map((key) => `${JSON.stringify(key)}:${canonicalJson(record[key])}`).join(',')}}`;
|
|
58
|
+
}
|
|
59
|
+
default:
|
|
60
|
+
throw new Error(`canonicalJson: unsupported ${typeof value}`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The exact bytes a root signs. Throws on a malformed claim rather than signing
|
|
65
|
+
* (or verifying) something ambiguous.
|
|
66
|
+
*/
|
|
67
|
+
function buildIdentityProofMessage(claims) {
|
|
68
|
+
if (!exports.IDENTITY_PROOF_ACTION_VALUES.includes(claims.action))
|
|
69
|
+
throw new Error('identity proof: unknown action');
|
|
70
|
+
if (!claims.subject || !claims.actor)
|
|
71
|
+
throw new Error('identity proof: subject and actor are required');
|
|
72
|
+
if (!exports.ROOT_KEY.test(claims.rootPublicKey))
|
|
73
|
+
throw new Error('identity proof: rootPublicKey must be canonical');
|
|
74
|
+
if (claims.payloadDigest !== null && !exports.HEX_DIGEST.test(claims.payloadDigest)) {
|
|
75
|
+
throw new Error('identity proof: payloadDigest must be a lowercase SHA-256 hex digest');
|
|
76
|
+
}
|
|
77
|
+
if (claims.expectedRevision !== null &&
|
|
78
|
+
(!Number.isSafeInteger(claims.expectedRevision) || claims.expectedRevision < 0)) {
|
|
79
|
+
throw new Error('identity proof: expectedRevision must be a non-negative integer');
|
|
80
|
+
}
|
|
81
|
+
if (!exports.CHALLENGE.test(claims.challenge))
|
|
82
|
+
throw new Error('identity proof: challenge must be 64 lowercase hex characters');
|
|
83
|
+
if (!Number.isSafeInteger(claims.expiresAt) || claims.expiresAt <= 0)
|
|
84
|
+
throw new Error('identity proof: expiresAt must be unix milliseconds');
|
|
85
|
+
return canonicalJson({
|
|
86
|
+
v: exports.IDENTITY_PROOF_VERSION,
|
|
87
|
+
domain: exports.IDENTITY_PROOF_DOMAIN,
|
|
88
|
+
action: claims.action,
|
|
89
|
+
subject: claims.subject,
|
|
90
|
+
actor: claims.actor,
|
|
91
|
+
rootPublicKey: claims.rootPublicKey,
|
|
92
|
+
payloadDigest: claims.payloadDigest,
|
|
93
|
+
expectedRevision: claims.expectedRevision,
|
|
94
|
+
audience: claims.audience,
|
|
95
|
+
challenge: claims.challenge,
|
|
96
|
+
expiresAt: claims.expiresAt,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Stable error codes the root routes answer with (`error.code` in the API error
|
|
101
|
+
* body). Clients map these through their localization, never the English message.
|
|
102
|
+
*/
|
|
103
|
+
exports.IDENTITY_ERROR_CODES = {
|
|
104
|
+
proofInvalid: 'IDENTITY_PROOF_INVALID',
|
|
105
|
+
rootAlreadyLinked: 'IDENTITY_ROOT_ALREADY_LINKED',
|
|
106
|
+
rootLinkedElsewhere: 'IDENTITY_ROOT_LINKED_ELSEWHERE',
|
|
107
|
+
freshFactorRequired: 'IDENTITY_FRESH_FACTOR_REQUIRED',
|
|
108
|
+
notPersonal: 'IDENTITY_NOT_PERSONAL_ACCOUNT',
|
|
109
|
+
};
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* `@oxy.so/contracts/client` — the contracts without Zod, for client bundles.
|
|
4
|
+
*
|
|
5
|
+
* The root entry is the contract: Zod schemas the API parses with, and the
|
|
6
|
+
* types inferred from them. Zod's runtime is ~120 KB of JavaScript, evaluated
|
|
7
|
+
* at startup, that a client only needed to answer "does this response have
|
|
8
|
+
* the shape its type promises". This entry answers that with small structural
|
|
9
|
+
* checks (`*Check`, used through {@link checkContract} / {@link parseContract}),
|
|
10
|
+
* and carries the constants and pure helpers clients use, so an app or SDK
|
|
11
|
+
* that imports only from here ships no Zod at all.
|
|
12
|
+
*
|
|
13
|
+
* Every check is the twin of one schema in the root entry: it is tied to the
|
|
14
|
+
* schema's type at compile time (`exact` in `./check.ts`) and to its runtime
|
|
15
|
+
* behaviour by `__tests__/clientChecks.parity.test.ts`. Types are not repeated
|
|
16
|
+
* here; import them from `@oxy.so/contracts` with `import type`.
|
|
17
|
+
*/
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.deviceJoinCodeResponseCheck = exports.deviceBackgroundCredentialResponseCheck = exports.activeTokenCheck = exports.SESSION_ACCOUNTS_CHANGED_EVENT = exports.deviceDirectorySyncCheck = exports.deviceDirectoryCheck = 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.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;
|
|
20
|
+
exports.subjectProductAccessCheck = exports.productSubscriptionsResponseCheck = exports.productSubscriptionCancellationResultCheck = exports.personalPlanCheckoutResultCheck = exports.personalPlanCheckoutRequestCheck = exports.personalPlanCatalogueCheck = 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 = void 0;
|
|
21
|
+
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.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 = void 0;
|
|
22
|
+
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 = void 0;
|
|
23
|
+
var check_1 = require("./check");
|
|
24
|
+
Object.defineProperty(exports, "ContractCheckError", { enumerable: true, get: function () { return check_1.ContractCheckError; } });
|
|
25
|
+
Object.defineProperty(exports, "checkContract", { enumerable: true, get: function () { return check_1.checkContract; } });
|
|
26
|
+
Object.defineProperty(exports, "formatCheckPath", { enumerable: true, get: function () { return check_1.formatCheckPath; } });
|
|
27
|
+
Object.defineProperty(exports, "parseContract", { enumerable: true, get: function () { return check_1.parseContract; } });
|
|
28
|
+
var accountGraph_1 = require("./accountGraph");
|
|
29
|
+
Object.defineProperty(exports, "ACCOUNT_CATEGORY_IDS", { enumerable: true, get: function () { return accountGraph_1.ACCOUNT_CATEGORY_IDS; } });
|
|
30
|
+
Object.defineProperty(exports, "ACCOUNT_CATEGORY_KINDS", { enumerable: true, get: function () { return accountGraph_1.ACCOUNT_CATEGORY_KINDS; } });
|
|
31
|
+
Object.defineProperty(exports, "ACCOUNT_KINDS", { enumerable: true, get: function () { return accountGraph_1.ACCOUNT_KINDS; } });
|
|
32
|
+
Object.defineProperty(exports, "CHILD_ACCOUNT_KINDS", { enumerable: true, get: function () { return accountGraph_1.CHILD_ACCOUNT_KINDS; } });
|
|
33
|
+
Object.defineProperty(exports, "MAX_ACCOUNT_CATEGORIES", { enumerable: true, get: function () { return accountGraph_1.MAX_ACCOUNT_CATEGORIES; } });
|
|
34
|
+
Object.defineProperty(exports, "RETIRED_ACCOUNT_CATEGORY_IDS", { enumerable: true, get: function () { return accountGraph_1.RETIRED_ACCOUNT_CATEGORY_IDS; } });
|
|
35
|
+
Object.defineProperty(exports, "SELECTABLE_ACCOUNT_CATEGORY_IDS", { enumerable: true, get: function () { return accountGraph_1.SELECTABLE_ACCOUNT_CATEGORY_IDS; } });
|
|
36
|
+
Object.defineProperty(exports, "isAccountKind", { enumerable: true, get: function () { return accountGraph_1.isAccountKind; } });
|
|
37
|
+
Object.defineProperty(exports, "isDelegatedActAsEligibleKind", { enumerable: true, get: function () { return accountGraph_1.isDelegatedActAsEligibleKind; } });
|
|
38
|
+
Object.defineProperty(exports, "isOperatorSwitchTargetKind", { enumerable: true, get: function () { return accountGraph_1.isOperatorSwitchTargetKind; } });
|
|
39
|
+
Object.defineProperty(exports, "isSelectableAccountCategoryId", { enumerable: true, get: function () { return accountGraph_1.isSelectableAccountCategoryId; } });
|
|
40
|
+
Object.defineProperty(exports, "kindAcceptsAccountCategories", { enumerable: true, get: function () { return accountGraph_1.kindAcceptsAccountCategories; } });
|
|
41
|
+
Object.defineProperty(exports, "newlyAddedRetiredCategories", { enumerable: true, get: function () { return accountGraph_1.newlyAddedRetiredCategories; } });
|
|
42
|
+
var accountEmail_1 = require("./accountEmail");
|
|
43
|
+
Object.defineProperty(exports, "EMAIL_CODE_LENGTH", { enumerable: true, get: function () { return accountEmail_1.EMAIL_CODE_LENGTH; } });
|
|
44
|
+
Object.defineProperty(exports, "EMAIL_CODE_MAX_ATTEMPTS", { enumerable: true, get: function () { return accountEmail_1.EMAIL_CODE_MAX_ATTEMPTS; } });
|
|
45
|
+
Object.defineProperty(exports, "EMAIL_CODE_TTL_MS", { enumerable: true, get: function () { return accountEmail_1.EMAIL_CODE_TTL_MS; } });
|
|
46
|
+
Object.defineProperty(exports, "EMAIL_TICKET_TTL_MS", { enumerable: true, get: function () { return accountEmail_1.EMAIL_TICKET_TTL_MS; } });
|
|
47
|
+
Object.defineProperty(exports, "EMAIL_VERIFICATION_ERROR_CODES", { enumerable: true, get: function () { return accountEmail_1.EMAIL_VERIFICATION_ERROR_CODES; } });
|
|
48
|
+
Object.defineProperty(exports, "EMAIL_VERIFICATION_PURPOSES", { enumerable: true, get: function () { return accountEmail_1.EMAIL_VERIFICATION_PURPOSES; } });
|
|
49
|
+
Object.defineProperty(exports, "emailAddressCheck", { enumerable: true, get: function () { return accountEmail_1.emailAddressCheck; } });
|
|
50
|
+
Object.defineProperty(exports, "emailTicketCheck", { enumerable: true, get: function () { return accountEmail_1.emailTicketCheck; } });
|
|
51
|
+
Object.defineProperty(exports, "emailVerificationConfirmResponseCheck", { enumerable: true, get: function () { return accountEmail_1.emailVerificationConfirmResponseCheck; } });
|
|
52
|
+
Object.defineProperty(exports, "emailVerificationStartResponseCheck", { enumerable: true, get: function () { return accountEmail_1.emailVerificationStartResponseCheck; } });
|
|
53
|
+
var agentKeys_1 = require("./agentKeys");
|
|
54
|
+
Object.defineProperty(exports, "ACCOUNT_AUTH_METHODS", { enumerable: true, get: function () { return agentKeys_1.ACCOUNT_AUTH_METHODS; } });
|
|
55
|
+
Object.defineProperty(exports, "AGENT_PROOF_ACTIONS", { enumerable: true, get: function () { return agentKeys_1.AGENT_PROOF_ACTIONS; } });
|
|
56
|
+
Object.defineProperty(exports, "AGENT_PROOF_AUDIENCE", { enumerable: true, get: function () { return agentKeys_1.AGENT_PROOF_AUDIENCE; } });
|
|
57
|
+
Object.defineProperty(exports, "AGENT_PROOF_TTL_MS", { enumerable: true, get: function () { return agentKeys_1.AGENT_PROOF_TTL_MS; } });
|
|
58
|
+
Object.defineProperty(exports, "agentChallengeRequestCheck", { enumerable: true, get: function () { return agentKeys_1.agentChallengeRequestCheck; } });
|
|
59
|
+
Object.defineProperty(exports, "agentKeyListResponseCheck", { enumerable: true, get: function () { return agentKeys_1.agentKeyListResponseCheck; } });
|
|
60
|
+
Object.defineProperty(exports, "agentKeyOperationChallengeCheck", { enumerable: true, get: function () { return agentKeys_1.agentKeyOperationChallengeCheck; } });
|
|
61
|
+
Object.defineProperty(exports, "agentKeyOperationCheck", { enumerable: true, get: function () { return agentKeys_1.agentKeyOperationCheck; } });
|
|
62
|
+
Object.defineProperty(exports, "agentKeyOperationResultCheck", { enumerable: true, get: function () { return agentKeys_1.agentKeyOperationResultCheck; } });
|
|
63
|
+
Object.defineProperty(exports, "agentProofClaimsCheck", { enumerable: true, get: function () { return agentKeys_1.agentProofClaimsCheck; } });
|
|
64
|
+
Object.defineProperty(exports, "agentVerifyRequestCheck", { enumerable: true, get: function () { return agentKeys_1.agentVerifyRequestCheck; } });
|
|
65
|
+
Object.defineProperty(exports, "executeAgentKeyOperationCheck", { enumerable: true, get: function () { return agentKeys_1.executeAgentKeyOperationCheck; } });
|
|
66
|
+
var capabilityBindings_1 = require("../capabilityBindings");
|
|
67
|
+
Object.defineProperty(exports, "isLoopbackOrigin", { enumerable: true, get: function () { return capabilityBindings_1.isLoopbackOrigin; } });
|
|
68
|
+
var deviceBoot_1 = require("./deviceBoot");
|
|
69
|
+
Object.defineProperty(exports, "loginResultCheck", { enumerable: true, get: function () { return deviceBoot_1.loginResultCheck; } });
|
|
70
|
+
var externalIdentity_1 = require("./externalIdentity");
|
|
71
|
+
Object.defineProperty(exports, "externalIdentityReferenceCheck", { enumerable: true, get: function () { return externalIdentity_1.externalIdentityReferenceCheck; } });
|
|
72
|
+
var identity_1 = require("./identity");
|
|
73
|
+
Object.defineProperty(exports, "signedRecordEnvelopeCheck", { enumerable: true, get: function () { return identity_1.signedRecordEnvelopeCheck; } });
|
|
74
|
+
var deviceDirectory_1 = require("./deviceDirectory");
|
|
75
|
+
Object.defineProperty(exports, "deviceActivateResponseCheck", { enumerable: true, get: function () { return deviceDirectory_1.deviceActivateResponseCheck; } });
|
|
76
|
+
Object.defineProperty(exports, "deviceDirectoryCheck", { enumerable: true, get: function () { return deviceDirectory_1.deviceDirectoryCheck; } });
|
|
77
|
+
Object.defineProperty(exports, "deviceDirectorySyncCheck", { enumerable: true, get: function () { return deviceDirectory_1.deviceDirectorySyncCheck; } });
|
|
78
|
+
var deviceSession_1 = require("./deviceSession");
|
|
79
|
+
Object.defineProperty(exports, "SESSION_ACCOUNTS_CHANGED_EVENT", { enumerable: true, get: function () { return deviceSession_1.SESSION_ACCOUNTS_CHANGED_EVENT; } });
|
|
80
|
+
Object.defineProperty(exports, "activeTokenCheck", { enumerable: true, get: function () { return deviceSession_1.activeTokenCheck; } });
|
|
81
|
+
Object.defineProperty(exports, "deviceBackgroundCredentialResponseCheck", { enumerable: true, get: function () { return deviceSession_1.deviceBackgroundCredentialResponseCheck; } });
|
|
82
|
+
Object.defineProperty(exports, "deviceJoinCodeResponseCheck", { enumerable: true, get: function () { return deviceSession_1.deviceJoinCodeResponseCheck; } });
|
|
83
|
+
Object.defineProperty(exports, "deviceJoinResponseCheck", { enumerable: true, get: function () { return deviceSession_1.deviceJoinResponseCheck; } });
|
|
84
|
+
Object.defineProperty(exports, "deviceRegisterResponseCheck", { enumerable: true, get: function () { return deviceSession_1.deviceRegisterResponseCheck; } });
|
|
85
|
+
Object.defineProperty(exports, "deviceSessionStateCheck", { enumerable: true, get: function () { return deviceSession_1.deviceSessionStateCheck; } });
|
|
86
|
+
Object.defineProperty(exports, "deviceSessionSyncCheck", { enumerable: true, get: function () { return deviceSession_1.deviceSessionSyncCheck; } });
|
|
87
|
+
Object.defineProperty(exports, "deviceTokenMintResponseCheck", { enumerable: true, get: function () { return deviceSession_1.deviceTokenMintResponseCheck; } });
|
|
88
|
+
Object.defineProperty(exports, "sessionAccountsChangedEventCheck", { enumerable: true, get: function () { return deviceSession_1.sessionAccountsChangedEventCheck; } });
|
|
89
|
+
var identityLink_1 = require("./identityLink");
|
|
90
|
+
Object.defineProperty(exports, "IDENTITY_LINK_QR_PREFIX", { enumerable: true, get: function () { return identityLink_1.IDENTITY_LINK_QR_PREFIX; } });
|
|
91
|
+
Object.defineProperty(exports, "IDENTITY_LINK_STATUSES", { enumerable: true, get: function () { return identityLink_1.IDENTITY_LINK_STATUSES; } });
|
|
92
|
+
Object.defineProperty(exports, "buildIdentityLinkQrPayload", { enumerable: true, get: function () { return identityLink_1.buildIdentityLinkQrPayload; } });
|
|
93
|
+
Object.defineProperty(exports, "identityLinkCreateResponseCheck", { enumerable: true, get: function () { return identityLink_1.identityLinkCreateResponseCheck; } });
|
|
94
|
+
Object.defineProperty(exports, "identityLinkStateCheck", { enumerable: true, get: function () { return identityLink_1.identityLinkStateCheck; } });
|
|
95
|
+
Object.defineProperty(exports, "parseIdentityLinkQrPayload", { enumerable: true, get: function () { return identityLink_1.parseIdentityLinkQrPayload; } });
|
|
96
|
+
var identityProof_1 = require("./identityProof");
|
|
97
|
+
Object.defineProperty(exports, "IDENTITY_ERROR_CODES", { enumerable: true, get: function () { return identityProof_1.IDENTITY_ERROR_CODES; } });
|
|
98
|
+
Object.defineProperty(exports, "IDENTITY_PROOF_ACTIONS", { enumerable: true, get: function () { return identityProof_1.IDENTITY_PROOF_ACTIONS; } });
|
|
99
|
+
Object.defineProperty(exports, "IDENTITY_PROOF_ACTION_VALUES", { enumerable: true, get: function () { return identityProof_1.IDENTITY_PROOF_ACTION_VALUES; } });
|
|
100
|
+
Object.defineProperty(exports, "IDENTITY_PROOF_AUDIENCE", { enumerable: true, get: function () { return identityProof_1.IDENTITY_PROOF_AUDIENCE; } });
|
|
101
|
+
Object.defineProperty(exports, "IDENTITY_PROOF_CHALLENGE_TTL_MS", { enumerable: true, get: function () { return identityProof_1.IDENTITY_PROOF_CHALLENGE_TTL_MS; } });
|
|
102
|
+
Object.defineProperty(exports, "IDENTITY_PROOF_DOMAIN", { enumerable: true, get: function () { return identityProof_1.IDENTITY_PROOF_DOMAIN; } });
|
|
103
|
+
Object.defineProperty(exports, "IDENTITY_PROOF_VERSION", { enumerable: true, get: function () { return identityProof_1.IDENTITY_PROOF_VERSION; } });
|
|
104
|
+
Object.defineProperty(exports, "buildIdentityProofMessage", { enumerable: true, get: function () { return identityProof_1.buildIdentityProofMessage; } });
|
|
105
|
+
Object.defineProperty(exports, "canonicalJson", { enumerable: true, get: function () { return identityProof_1.canonicalJson; } });
|
|
106
|
+
var organizations_1 = require("./organizations");
|
|
107
|
+
Object.defineProperty(exports, "ORGANIZATION_ALIAS_KINDS", { enumerable: true, get: function () { return organizations_1.ORGANIZATION_ALIAS_KINDS; } });
|
|
108
|
+
Object.defineProperty(exports, "ORGANIZATION_CLAIM_DECISIONS", { enumerable: true, get: function () { return organizations_1.ORGANIZATION_CLAIM_DECISIONS; } });
|
|
109
|
+
Object.defineProperty(exports, "ORGANIZATION_CLAIM_STATUSES", { enumerable: true, get: function () { return organizations_1.ORGANIZATION_CLAIM_STATUSES; } });
|
|
110
|
+
Object.defineProperty(exports, "ORGANIZATION_ERROR_CODES", { enumerable: true, get: function () { return organizations_1.ORGANIZATION_ERROR_CODES; } });
|
|
111
|
+
Object.defineProperty(exports, "ORGANIZATION_NAME_MAX_LENGTH", { enumerable: true, get: function () { return organizations_1.ORGANIZATION_NAME_MAX_LENGTH; } });
|
|
112
|
+
Object.defineProperty(exports, "ORGANIZATION_STATUSES", { enumerable: true, get: function () { return organizations_1.ORGANIZATION_STATUSES; } });
|
|
113
|
+
Object.defineProperty(exports, "ORGANIZATION_TYPES", { enumerable: true, get: function () { return organizations_1.ORGANIZATION_TYPES; } });
|
|
114
|
+
Object.defineProperty(exports, "createOrganizationCheck", { enumerable: true, get: function () { return organizations_1.createOrganizationCheck; } });
|
|
115
|
+
Object.defineProperty(exports, "organizationBatchCheck", { enumerable: true, get: function () { return organizations_1.organizationBatchCheck; } });
|
|
116
|
+
Object.defineProperty(exports, "organizationCheck", { enumerable: true, get: function () { return organizations_1.organizationCheck; } });
|
|
117
|
+
Object.defineProperty(exports, "organizationClaimCheck", { enumerable: true, get: function () { return organizations_1.organizationClaimCheck; } });
|
|
118
|
+
Object.defineProperty(exports, "organizationClaimDetailCheck", { enumerable: true, get: function () { return organizations_1.organizationClaimDetailCheck; } });
|
|
119
|
+
Object.defineProperty(exports, "organizationClaimInputCheck", { enumerable: true, get: function () { return organizations_1.organizationClaimInputCheck; } });
|
|
120
|
+
Object.defineProperty(exports, "organizationClaimListCheck", { enumerable: true, get: function () { return organizations_1.organizationClaimListCheck; } });
|
|
121
|
+
Object.defineProperty(exports, "organizationClaimReviewCheck", { enumerable: true, get: function () { return organizations_1.organizationClaimReviewCheck; } });
|
|
122
|
+
Object.defineProperty(exports, "organizationCurationResultCheck", { enumerable: true, get: function () { return organizations_1.organizationCurationResultCheck; } });
|
|
123
|
+
Object.defineProperty(exports, "organizationExternalCheck", { enumerable: true, get: function () { return organizations_1.organizationExternalCheck; } });
|
|
124
|
+
Object.defineProperty(exports, "organizationExternalResolutionCheck", { enumerable: true, get: function () { return organizations_1.organizationExternalResolutionCheck; } });
|
|
125
|
+
Object.defineProperty(exports, "organizationImportBatchResultCheck", { enumerable: true, get: function () { return organizations_1.organizationImportBatchResultCheck; } });
|
|
126
|
+
Object.defineProperty(exports, "organizationListCheck", { enumerable: true, get: function () { return organizations_1.organizationListCheck; } });
|
|
127
|
+
Object.defineProperty(exports, "organizationNameCheck", { enumerable: true, get: function () { return organizations_1.organizationNameCheck; } });
|
|
128
|
+
Object.defineProperty(exports, "updateOrganizationCheck", { enumerable: true, get: function () { return organizations_1.updateOrganizationCheck; } });
|
|
129
|
+
var products_1 = require("./products");
|
|
130
|
+
Object.defineProperty(exports, "cancelProductSubscriptionCheck", { enumerable: true, get: function () { return products_1.cancelProductSubscriptionCheck; } });
|
|
131
|
+
Object.defineProperty(exports, "personalPlanCatalogueCheck", { enumerable: true, get: function () { return products_1.personalPlanCatalogueCheck; } });
|
|
132
|
+
Object.defineProperty(exports, "personalPlanCheckoutRequestCheck", { enumerable: true, get: function () { return products_1.personalPlanCheckoutRequestCheck; } });
|
|
133
|
+
Object.defineProperty(exports, "personalPlanCheckoutResultCheck", { enumerable: true, get: function () { return products_1.personalPlanCheckoutResultCheck; } });
|
|
134
|
+
Object.defineProperty(exports, "productSubscriptionCancellationResultCheck", { enumerable: true, get: function () { return products_1.productSubscriptionCancellationResultCheck; } });
|
|
135
|
+
Object.defineProperty(exports, "productSubscriptionsResponseCheck", { enumerable: true, get: function () { return products_1.productSubscriptionsResponseCheck; } });
|
|
136
|
+
Object.defineProperty(exports, "subjectProductAccessCheck", { enumerable: true, get: function () { return products_1.subjectProductAccessCheck; } });
|
|
137
|
+
Object.defineProperty(exports, "subjectProductAccessQueryCheck", { enumerable: true, get: function () { return products_1.subjectProductAccessQueryCheck; } });
|
|
138
|
+
Object.defineProperty(exports, "subscriptionCreditGrantsResponseCheck", { enumerable: true, get: function () { return products_1.subscriptionCreditGrantsResponseCheck; } });
|
|
139
|
+
var recommendations_1 = require("./recommendations");
|
|
140
|
+
Object.defineProperty(exports, "recommendationRequestCheck", { enumerable: true, get: function () { return recommendations_1.recommendationRequestCheck; } });
|
|
141
|
+
var reputation_1 = require("./reputation");
|
|
142
|
+
Object.defineProperty(exports, "isFullReputationBalance", { enumerable: true, get: function () { return reputation_1.isFullReputationBalance; } });
|
|
143
|
+
var safety_1 = require("./safety");
|
|
144
|
+
Object.defineProperty(exports, "PURCHASE_APPROVAL_STATUSES", { enumerable: true, get: function () { return safety_1.PURCHASE_APPROVAL_STATUSES; } });
|
|
145
|
+
Object.defineProperty(exports, "SAFETY_POLICY_VERSION", { enumerable: true, get: function () { return safety_1.SAFETY_POLICY_VERSION; } });
|
|
146
|
+
Object.defineProperty(exports, "SUPERVISED_ACTIONS", { enumerable: true, get: function () { return safety_1.SUPERVISED_ACTIONS; } });
|
|
147
|
+
Object.defineProperty(exports, "SUPERVISION_CONSENT_VERSION", { enumerable: true, get: function () { return safety_1.SUPERVISION_CONSENT_VERSION; } });
|
|
148
|
+
Object.defineProperty(exports, "SUPERVISION_INVITATION_STATUSES", { enumerable: true, get: function () { return safety_1.SUPERVISION_INVITATION_STATUSES; } });
|
|
149
|
+
Object.defineProperty(exports, "SUPERVISION_STATUSES", { enumerable: true, get: function () { return safety_1.SUPERVISION_STATUSES; } });
|
|
150
|
+
Object.defineProperty(exports, "profileAccessDecisionCheck", { enumerable: true, get: function () { return safety_1.profileAccessDecisionCheck; } });
|
|
151
|
+
Object.defineProperty(exports, "profileAccessInputCheck", { enumerable: true, get: function () { return safety_1.profileAccessInputCheck; } });
|
|
152
|
+
Object.defineProperty(exports, "purchaseApprovalCheck", { enumerable: true, get: function () { return safety_1.purchaseApprovalCheck; } });
|
|
153
|
+
Object.defineProperty(exports, "purchaseApprovalListCheck", { enumerable: true, get: function () { return safety_1.purchaseApprovalListCheck; } });
|
|
154
|
+
Object.defineProperty(exports, "purchaseReviewInputCheck", { enumerable: true, get: function () { return safety_1.purchaseReviewInputCheck; } });
|
|
155
|
+
Object.defineProperty(exports, "safetyOrganizationsInputCheck", { enumerable: true, get: function () { return safety_1.safetyOrganizationsInputCheck; } });
|
|
156
|
+
Object.defineProperty(exports, "safetyOrganizationsResponseCheck", { enumerable: true, get: function () { return safety_1.safetyOrganizationsResponseCheck; } });
|
|
157
|
+
Object.defineProperty(exports, "safetyPeopleInputCheck", { enumerable: true, get: function () { return safety_1.safetyPeopleInputCheck; } });
|
|
158
|
+
Object.defineProperty(exports, "safetyPeopleResponseCheck", { enumerable: true, get: function () { return safety_1.safetyPeopleResponseCheck; } });
|
|
159
|
+
Object.defineProperty(exports, "supervisionAcceptInputCheck", { enumerable: true, get: function () { return safety_1.supervisionAcceptInputCheck; } });
|
|
160
|
+
Object.defineProperty(exports, "supervisionContactInputCheck", { enumerable: true, get: function () { return safety_1.supervisionContactInputCheck; } });
|
|
161
|
+
Object.defineProperty(exports, "supervisionContactsResponseCheck", { enumerable: true, get: function () { return safety_1.supervisionContactsResponseCheck; } });
|
|
162
|
+
Object.defineProperty(exports, "supervisionInvitationCheck", { enumerable: true, get: function () { return safety_1.supervisionInvitationCheck; } });
|
|
163
|
+
Object.defineProperty(exports, "supervisionInviteInputCheck", { enumerable: true, get: function () { return safety_1.supervisionInviteInputCheck; } });
|
|
164
|
+
Object.defineProperty(exports, "supervisionReviewInputCheck", { enumerable: true, get: function () { return safety_1.supervisionReviewInputCheck; } });
|
|
165
|
+
Object.defineProperty(exports, "supervisionStateCheck", { enumerable: true, get: function () { return safety_1.supervisionStateCheck; } });
|
|
166
|
+
var sessionStatus_1 = require("./sessionStatus");
|
|
167
|
+
Object.defineProperty(exports, "publicApplicationCheck", { enumerable: true, get: function () { return sessionStatus_1.publicApplicationCheck; } });
|
|
168
|
+
var signIn_1 = require("./signIn");
|
|
169
|
+
Object.defineProperty(exports, "EMAIL_ACCOUNTS_MAX", { enumerable: true, get: function () { return signIn_1.EMAIL_ACCOUNTS_MAX; } });
|
|
170
|
+
Object.defineProperty(exports, "EMAIL_SIGNIN_CHOICE_TTL_MS", { enumerable: true, get: function () { return signIn_1.EMAIL_SIGNIN_CHOICE_TTL_MS; } });
|
|
171
|
+
Object.defineProperty(exports, "EMAIL_SIGNIN_LINK_TTL_MS", { enumerable: true, get: function () { return signIn_1.EMAIL_SIGNIN_LINK_TTL_MS; } });
|
|
172
|
+
Object.defineProperty(exports, "EMAIL_SIGNIN_LONG_CODE_ALPHABET", { enumerable: true, get: function () { return signIn_1.EMAIL_SIGNIN_LONG_CODE_ALPHABET; } });
|
|
173
|
+
Object.defineProperty(exports, "EMAIL_SIGNIN_LONG_CODE_LENGTH", { enumerable: true, get: function () { return signIn_1.EMAIL_SIGNIN_LONG_CODE_LENGTH; } });
|
|
174
|
+
Object.defineProperty(exports, "PASSWORD_MAX_LENGTH", { enumerable: true, get: function () { return signIn_1.PASSWORD_MAX_LENGTH; } });
|
|
175
|
+
Object.defineProperty(exports, "PASSWORD_MIN_LENGTH", { enumerable: true, get: function () { return signIn_1.PASSWORD_MIN_LENGTH; } });
|
|
176
|
+
Object.defineProperty(exports, "REAUTH_ACTIONS", { enumerable: true, get: function () { return signIn_1.REAUTH_ACTIONS; } });
|
|
177
|
+
Object.defineProperty(exports, "SIGNIN_SECOND_FACTOR_MAX_ATTEMPTS", { enumerable: true, get: function () { return signIn_1.SIGNIN_SECOND_FACTOR_MAX_ATTEMPTS; } });
|
|
178
|
+
Object.defineProperty(exports, "SIGNIN_SECOND_FACTOR_TTL_MS", { enumerable: true, get: function () { return signIn_1.SIGNIN_SECOND_FACTOR_TTL_MS; } });
|
|
179
|
+
Object.defineProperty(exports, "SIGN_IN_ERROR_CODES", { enumerable: true, get: function () { return signIn_1.SIGN_IN_ERROR_CODES; } });
|
|
180
|
+
Object.defineProperty(exports, "TOTP_BACKUP_CODE_COUNT", { enumerable: true, get: function () { return signIn_1.TOTP_BACKUP_CODE_COUNT; } });
|
|
181
|
+
Object.defineProperty(exports, "TOTP_DIGITS", { enumerable: true, get: function () { return signIn_1.TOTP_DIGITS; } });
|
|
182
|
+
Object.defineProperty(exports, "TOTP_PERIOD_SECONDS", { enumerable: true, get: function () { return signIn_1.TOTP_PERIOD_SECONDS; } });
|
|
183
|
+
Object.defineProperty(exports, "emailSignInChooseAccountCheck", { enumerable: true, get: function () { return signIn_1.emailSignInChooseAccountCheck; } });
|
|
184
|
+
Object.defineProperty(exports, "emailSignInLinkResponseCheck", { enumerable: true, get: function () { return signIn_1.emailSignInLinkResponseCheck; } });
|
|
185
|
+
Object.defineProperty(exports, "emailSignInPendingCheck", { enumerable: true, get: function () { return signIn_1.emailSignInPendingCheck; } });
|
|
186
|
+
Object.defineProperty(exports, "emailSignInStartResponseCheck", { enumerable: true, get: function () { return signIn_1.emailSignInStartResponseCheck; } });
|
|
187
|
+
Object.defineProperty(exports, "isEmailSignInChooseAccount", { enumerable: true, get: function () { return signIn_1.isEmailSignInChooseAccount; } });
|
|
188
|
+
Object.defineProperty(exports, "isSecondFactorRequired", { enumerable: true, get: function () { return signIn_1.isSecondFactorRequired; } });
|
|
189
|
+
Object.defineProperty(exports, "normalizeEmailSignInCode", { enumerable: true, get: function () { return signIn_1.normalizeEmailSignInCode; } });
|
|
190
|
+
Object.defineProperty(exports, "reauthProofCheck", { enumerable: true, get: function () { return signIn_1.reauthProofCheck; } });
|
|
191
|
+
Object.defineProperty(exports, "secondFactorRequiredCheck", { enumerable: true, get: function () { return signIn_1.secondFactorRequiredCheck; } });
|
|
192
|
+
Object.defineProperty(exports, "signInMethodsCheck", { enumerable: true, get: function () { return signIn_1.signInMethodsCheck; } });
|
|
193
|
+
Object.defineProperty(exports, "totpBackupCodesResponseCheck", { enumerable: true, get: function () { return signIn_1.totpBackupCodesResponseCheck; } });
|
|
194
|
+
Object.defineProperty(exports, "totpEnrollResponseCheck", { enumerable: true, get: function () { return signIn_1.totpEnrollResponseCheck; } });
|
|
195
|
+
var username_1 = require("./username");
|
|
196
|
+
Object.defineProperty(exports, "BOT_USERNAME_INVALID_MESSAGE", { enumerable: true, get: function () { return username_1.BOT_USERNAME_INVALID_MESSAGE; } });
|
|
197
|
+
Object.defineProperty(exports, "BOT_USERNAME_SUFFIX", { enumerable: true, get: function () { return username_1.BOT_USERNAME_SUFFIX; } });
|
|
198
|
+
Object.defineProperty(exports, "NUMERIC_USERNAME_MESSAGE", { enumerable: true, get: function () { return username_1.NUMERIC_USERNAME_MESSAGE; } });
|
|
199
|
+
Object.defineProperty(exports, "RESERVED_USERNAMES", { enumerable: true, get: function () { return username_1.RESERVED_USERNAMES; } });
|
|
200
|
+
Object.defineProperty(exports, "RESERVED_USERNAME_MESSAGE", { enumerable: true, get: function () { return username_1.RESERVED_USERNAME_MESSAGE; } });
|
|
201
|
+
Object.defineProperty(exports, "USERNAME_INVALID_MESSAGE", { enumerable: true, get: function () { return username_1.USERNAME_INVALID_MESSAGE; } });
|
|
202
|
+
Object.defineProperty(exports, "USERNAME_MAX_LENGTH", { enumerable: true, get: function () { return username_1.USERNAME_MAX_LENGTH; } });
|
|
203
|
+
Object.defineProperty(exports, "USERNAME_MIN_LENGTH", { enumerable: true, get: function () { return username_1.USERNAME_MIN_LENGTH; } });
|
|
204
|
+
Object.defineProperty(exports, "USERNAME_PATTERN_SOURCE", { enumerable: true, get: function () { return username_1.USERNAME_PATTERN_SOURCE; } });
|
|
205
|
+
Object.defineProperty(exports, "applyBotUsernameSuffix", { enumerable: true, get: function () { return username_1.applyBotUsernameSuffix; } });
|
|
206
|
+
Object.defineProperty(exports, "botUsernameCheck", { enumerable: true, get: function () { return username_1.botUsernameCheck; } });
|
|
207
|
+
Object.defineProperty(exports, "stripDisallowedUsernameCharacters", { enumerable: true, get: function () { return username_1.stripDisallowedUsernameCharacters; } });
|
|
208
|
+
Object.defineProperty(exports, "usernameCheck", { enumerable: true, get: function () { return username_1.usernameCheck; } });
|
|
209
|
+
Object.defineProperty(exports, "usernameCheckForAccountKind", { enumerable: true, get: function () { return username_1.usernameCheckForAccountKind; } });
|
|
210
|
+
var userResponse_1 = require("./userResponse");
|
|
211
|
+
Object.defineProperty(exports, "userNameCheck", { enumerable: true, get: function () { return userResponse_1.userNameCheck; } });
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Organization vocabularies and checks, without Zod. Schemas: `../organizations.ts`.
|
|
4
|
+
*
|
|
5
|
+
* Part of `@oxy.so/contracts/client`: never import `zod` here (see `./check.ts`).
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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 check_1 = require("./check");
|
|
10
|
+
/** Real-world identity classification, independent of account topics and permissions. */
|
|
11
|
+
exports.ORGANIZATION_TYPES = [
|
|
12
|
+
'business',
|
|
13
|
+
'nonprofit',
|
|
14
|
+
'public_body',
|
|
15
|
+
'community',
|
|
16
|
+
'other',
|
|
17
|
+
];
|
|
18
|
+
exports.ORGANIZATION_STATUSES = ['active', 'inactive', 'merged', 'suppressed'];
|
|
19
|
+
exports.ORGANIZATION_CLAIM_STATUSES = ['unclaimed', 'claimed'];
|
|
20
|
+
exports.ORGANIZATION_ALIAS_KINDS = [
|
|
21
|
+
'name_variant',
|
|
22
|
+
'former_name',
|
|
23
|
+
'localized_name',
|
|
24
|
+
'marketing_name',
|
|
25
|
+
'misspelling',
|
|
26
|
+
];
|
|
27
|
+
exports.ORGANIZATION_CLAIM_DECISIONS = ['pending', 'approved', 'rejected'];
|
|
28
|
+
exports.ORGANIZATION_NAME_MAX_LENGTH = 300;
|
|
29
|
+
exports.ORGANIZATION_ERROR_CODES = [
|
|
30
|
+
'bad_request',
|
|
31
|
+
'unauthorized',
|
|
32
|
+
'forbidden',
|
|
33
|
+
'not_found',
|
|
34
|
+
'unknown_route',
|
|
35
|
+
'conflict',
|
|
36
|
+
'validation_failed',
|
|
37
|
+
'rate_limited',
|
|
38
|
+
'internal_error',
|
|
39
|
+
'service_unavailable',
|
|
40
|
+
];
|
|
41
|
+
/* -------------------------------------------------------------------------- */
|
|
42
|
+
/* Checks */
|
|
43
|
+
/* -------------------------------------------------------------------------- */
|
|
44
|
+
const id = (0, check_1.string)((0, check_1.minLength)(1), (0, check_1.maxLength)(128));
|
|
45
|
+
const optionalText = (max) => (0, check_1.optional)((0, check_1.nullable)((0, check_1.string)(check_1.trim, (0, check_1.minLength)(1), (0, check_1.maxLength)(max))));
|
|
46
|
+
const evidenceReference = (0, check_1.string)(check_1.trim, (0, check_1.minLength)(1), (0, check_1.maxLength)(1000));
|
|
47
|
+
const createdAt = (0, check_1.string)(check_1.datetime);
|
|
48
|
+
const organizationAlias = (0, check_1.strictObject)({
|
|
49
|
+
alias: (0, check_1.string)(check_1.trim, (0, check_1.minLength)(1), (0, check_1.maxLength)(300)),
|
|
50
|
+
kind: (0, check_1.oneOf)(exports.ORGANIZATION_ALIAS_KINDS),
|
|
51
|
+
language: (0, check_1.optional)((0, check_1.string)((0, check_1.minLength)(2), (0, check_1.maxLength)(35))),
|
|
52
|
+
});
|
|
53
|
+
/** The twin of `organizationNameSchema`. */
|
|
54
|
+
exports.organizationNameCheck = (0, check_1.refine)((0, check_1.string)(check_1.trim, (0, check_1.minLength)(1), (0, check_1.maxLength)(exports.ORGANIZATION_NAME_MAX_LENGTH)), (value) => !/[<>]/.test(value) &&
|
|
55
|
+
Array.from(value).every((character) => character.charCodeAt(0) >= 32 && character.charCodeAt(0) !== 127), 'Organization name must be plain text');
|
|
56
|
+
const organizationFields = {
|
|
57
|
+
name: exports.organizationNameCheck,
|
|
58
|
+
organizationType: (0, check_1.oneOf)(exports.ORGANIZATION_TYPES),
|
|
59
|
+
legalName: optionalText(300),
|
|
60
|
+
websiteUrl: (0, check_1.optional)((0, check_1.nullable)((0, check_1.refine)((0, check_1.string)(check_1.url, (0, check_1.maxLength)(2048)), (value) => /^https?:\/\//.test(value), 'Use HTTP or HTTPS'))),
|
|
61
|
+
countryCode: (0, check_1.optional)((0, check_1.nullable)((0, check_1.string)((0, check_1.pattern)(/^[A-Z]{2}$/)))),
|
|
62
|
+
aliases: (0, check_1.optional)((0, check_1.array)(organizationAlias, (0, check_1.maxItems)(100))),
|
|
63
|
+
};
|
|
64
|
+
exports.createOrganizationCheck = (0, check_1.exact)()((0, check_1.strictObject)(organizationFields));
|
|
65
|
+
exports.updateOrganizationCheck = (0, check_1.exact)()((0, check_1.strictObject)({
|
|
66
|
+
...organizationFields,
|
|
67
|
+
name: (0, check_1.optional)(exports.organizationNameCheck),
|
|
68
|
+
organizationType: (0, check_1.optional)(organizationFields.organizationType),
|
|
69
|
+
}));
|
|
70
|
+
exports.organizationCheck = (0, check_1.exact)()((0, check_1.strictObject)({
|
|
71
|
+
name: exports.organizationNameCheck,
|
|
72
|
+
organizationType: (0, check_1.oneOf)(exports.ORGANIZATION_TYPES),
|
|
73
|
+
legalName: (0, check_1.nullable)((0, check_1.string)()),
|
|
74
|
+
websiteUrl: (0, check_1.nullable)((0, check_1.string)()),
|
|
75
|
+
countryCode: (0, check_1.nullable)((0, check_1.string)()),
|
|
76
|
+
aliases: (0, check_1.array)(organizationAlias),
|
|
77
|
+
accountId: id,
|
|
78
|
+
username: (0, check_1.nullable)((0, check_1.string)()),
|
|
79
|
+
avatar: (0, check_1.nullable)((0, check_1.string)()),
|
|
80
|
+
verifiedDomains: (0, check_1.array)((0, check_1.string)()),
|
|
81
|
+
claimStatus: (0, check_1.oneOf)(exports.ORGANIZATION_CLAIM_STATUSES),
|
|
82
|
+
status: (0, check_1.oneOf)(exports.ORGANIZATION_STATUSES),
|
|
83
|
+
mergedIntoAccountId: (0, check_1.nullable)(id),
|
|
84
|
+
createdAt,
|
|
85
|
+
updatedAt: (0, check_1.string)(check_1.datetime),
|
|
86
|
+
}));
|
|
87
|
+
exports.organizationListCheck = (0, check_1.exact)()((0, check_1.strictObject)({ items: (0, check_1.array)(exports.organizationCheck), nextCursor: (0, check_1.nullable)((0, check_1.string)()) }));
|
|
88
|
+
exports.organizationBatchCheck = (0, check_1.exact)()((0, check_1.strictObject)({
|
|
89
|
+
items: (0, check_1.array)((0, check_1.strictObject)({ requestedAccountId: id, organization: exports.organizationCheck })),
|
|
90
|
+
missingIds: (0, check_1.array)(id),
|
|
91
|
+
}));
|
|
92
|
+
exports.organizationClaimInputCheck = (0, check_1.exact)()((0, check_1.strictObject)({ evidenceReference }));
|
|
93
|
+
const organizationClaimFields = {
|
|
94
|
+
id,
|
|
95
|
+
accountId: id,
|
|
96
|
+
claimantUserId: id,
|
|
97
|
+
status: (0, check_1.oneOf)(exports.ORGANIZATION_CLAIM_DECISIONS),
|
|
98
|
+
createdAt,
|
|
99
|
+
};
|
|
100
|
+
exports.organizationClaimCheck = (0, check_1.exact)()((0, check_1.strictObject)(organizationClaimFields));
|
|
101
|
+
exports.organizationClaimDetailCheck = (0, check_1.exact)()((0, check_1.strictObject)({
|
|
102
|
+
...organizationClaimFields,
|
|
103
|
+
evidenceReference: (0, check_1.string)(),
|
|
104
|
+
reviewEvidenceReference: (0, check_1.nullable)((0, check_1.string)()),
|
|
105
|
+
reviewedAt: (0, check_1.nullable)((0, check_1.string)(check_1.datetime)),
|
|
106
|
+
}));
|
|
107
|
+
exports.organizationClaimListCheck = (0, check_1.exact)()((0, check_1.strictObject)({ items: (0, check_1.array)(exports.organizationClaimDetailCheck), nextCursor: (0, check_1.nullable)((0, check_1.string)()) }));
|
|
108
|
+
exports.organizationClaimReviewCheck = (0, check_1.exact)()((0, check_1.strictObject)({ decision: (0, check_1.oneOf)(['approved', 'rejected']), evidenceReference }));
|
|
109
|
+
exports.organizationImportBatchResultCheck = (0, check_1.exact)()((0, check_1.strictObject)({
|
|
110
|
+
items: (0, check_1.array)((0, check_1.strictObject)({ externalId: (0, check_1.string)(), accountId: id, created: check_1.boolean })),
|
|
111
|
+
}));
|
|
112
|
+
exports.organizationExternalCheck = (0, check_1.exact)()((0, check_1.strictObject)({ accountId: id, created: check_1.boolean }));
|
|
113
|
+
exports.organizationExternalResolutionCheck = (0, check_1.exact)()((0, check_1.strictObject)({ accountId: id }));
|
|
114
|
+
exports.organizationCurationResultCheck = (0, check_1.exact)()((0, check_1.strictObject)({ accountId: id, status: (0, check_1.oneOf)(['active', 'inactive', 'suppressed']) }));
|