@oxy.so/contracts 6.25.0 → 6.27.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/avatarCharacter.js +15 -3
- package/dist/cjs/client/index.js +5 -4
- package/dist/cjs/client/products.js +6 -1
- package/dist/esm/avatarCharacter.js +15 -3
- package/dist/esm/client/index.js +1 -1
- package/dist/esm/client/products.js +5 -0
- package/dist/types/avatarCharacter.d.ts +12 -1
- package/dist/types/client/index.d.ts +1 -1
- package/dist/types/client/products.d.ts +5 -0
- package/package.json +2 -2
|
@@ -17,6 +17,16 @@
|
|
|
17
17
|
* is the SHAPE of what a client writes: only the keys a character has, each an
|
|
18
18
|
* id-like string, a `#rrggbb` paint, a spacing in range. The client resolves
|
|
19
19
|
* the ids and falls back on a default look for one it cannot draw.
|
|
20
|
+
*
|
|
21
|
+
* ## A bot's colour is its account's, not its character's
|
|
22
|
+
*
|
|
23
|
+
* A bot is painted in its account's `color` (`User.color`, a Bloom preset key):
|
|
24
|
+
* Bloom draws a bot account's character in it (`avatarCharacterInColor`,
|
|
25
|
+
* `@oxy.so/bloom` 20), so a character needs no paint of its own and a bot whose
|
|
26
|
+
* owner changes its colour changes everywhere at once. A character is therefore
|
|
27
|
+
* valid with a preset or a shape alone. `color` and `bodyColor` are still
|
|
28
|
+
* accepted from writers that send them, and a renderer that knows the account's
|
|
29
|
+
* colour ignores them.
|
|
20
30
|
*/
|
|
21
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
32
|
exports.AVATAR_PICKABLE_COLORS = exports.AVATAR_PICKABLE_SHAPES = exports.avatarCharacterSchema = exports.AVATAR_EYE_SPACING = void 0;
|
|
@@ -31,7 +41,8 @@ const idSchema = zod_1.z.string().regex(ID);
|
|
|
31
41
|
/**
|
|
32
42
|
* A character a client sends. `.strict()` so a misspelled field is a refusal
|
|
33
43
|
* now rather than a look that never takes effect. A character with nothing in
|
|
34
|
-
* it draws nothing: it needs a preset
|
|
44
|
+
* it draws nothing: it needs a preset or a shape. It needs no paint: the
|
|
45
|
+
* account's colour paints it (see the file comment).
|
|
35
46
|
*/
|
|
36
47
|
exports.avatarCharacterSchema = zod_1.z
|
|
37
48
|
.object({
|
|
@@ -54,8 +65,9 @@ exports.avatarCharacterSchema = zod_1.z
|
|
|
54
65
|
.optional(),
|
|
55
66
|
})
|
|
56
67
|
.strict()
|
|
57
|
-
.refine((c) => c.preset !== undefined ||
|
|
58
|
-
|
|
68
|
+
.refine((c) => c.preset !== undefined || c.shape !== undefined, {
|
|
69
|
+
message: 'A character needs a preset or a shape',
|
|
70
|
+
});
|
|
59
71
|
/** The validated character, or `null` for anything that is not one. */
|
|
60
72
|
function parseAvatarCharacter(value) {
|
|
61
73
|
const parsed = exports.avatarCharacterSchema.safeParse(value);
|
package/dist/cjs/client/index.js
CHANGED
|
@@ -32,10 +32,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
33
|
exports.ORGANIZATION_KEY_PROOF_ACTION_VALUES = exports.ORGANIZATION_KEY_PROOF_ACTIONS = exports.ORGANIZATION_KEY_OPERATIONS = exports.ORGANIZATION_KEY_ERROR_CODES = exports.executeAgentKeyOperationCheck = exports.agentVerifyRequestCheck = exports.agentProofClaimsCheck = exports.agentKeyOperationResultCheck = exports.agentKeyOperationCheck = exports.agentKeyOperationChallengeCheck = exports.agentKeyListResponseCheck = exports.agentChallengeRequestCheck = exports.AGENT_PROOF_TTL_MS = exports.AGENT_PROOF_AUDIENCE = exports.AGENT_PROOF_ACTIONS = exports.ACCOUNT_AUTH_METHODS = exports.emailVerificationStartResponseCheck = exports.emailVerificationConfirmResponseCheck = exports.emailTicketCheck = exports.emailAddressCheck = exports.EMAIL_VERIFICATION_PURPOSES = exports.EMAIL_VERIFICATION_ERROR_CODES = exports.EMAIL_TICKET_TTL_MS = exports.EMAIL_CODE_TTL_MS = exports.EMAIL_CODE_MAX_ATTEMPTS = exports.EMAIL_CODE_LENGTH = exports.isPlainTextTitle = exports.accountTitleCheck = exports.accountNamePolicyForKind = exports.ACCOUNT_TITLE_MAX_LENGTH = exports.ACCOUNT_TITLE_DISALLOWED_SOURCE = exports.ACCOUNT_NAME_POLICY_BY_KIND = exports.newlyAddedRetiredCategories = exports.kindAcceptsAccountCategories = exports.isSelectableAccountCategoryId = exports.isOperatorSwitchTargetKind = exports.isMemberOperatedKind = exports.isDelegatedActAsEligibleKind = exports.isAccountKind = exports.SELECTABLE_ACCOUNT_CATEGORY_IDS = exports.RETIRED_ACCOUNT_CATEGORY_IDS = exports.MAX_ACCOUNT_CATEGORIES = exports.CHILD_ACCOUNT_KINDS = exports.ACCOUNT_KINDS = exports.ACCOUNT_CATEGORY_KINDS = exports.ACCOUNT_CATEGORY_IDS = exports.parseContract = exports.formatCheckPath = exports.checkContract = exports.ContractCheckError = void 0;
|
|
34
34
|
exports.ORGANIZATION_ERROR_CODES = exports.ORGANIZATION_CLAIM_STATUSES = exports.ORGANIZATION_CLAIM_DECISIONS = exports.ORGANIZATION_ALIAS_KINDS = exports.canonicalJson = exports.buildIdentityProofMessage = exports.IDENTITY_PROOF_VERSION = exports.IDENTITY_PROOF_DOMAIN = exports.IDENTITY_PROOF_CHALLENGE_TTL_MS = exports.IDENTITY_PROOF_AUDIENCE = exports.IDENTITY_PROOF_ACTION_VALUES = exports.IDENTITY_PROOF_ACTIONS = exports.IDENTITY_ERROR_CODES = exports.parseIdentityLinkQrPayload = exports.identityLinkStateCheck = exports.identityLinkCreateResponseCheck = exports.buildIdentityLinkQrPayload = exports.IDENTITY_LINK_STATUSES = exports.IDENTITY_LINK_QR_PREFIX = exports.identityKeyHistoryCheck = exports.IDENTITY_KEY_HISTORY_CLAIM_ACTION = exports.sessionAccountsChangedEventCheck = exports.deviceTokenMintResponseCheck = exports.deviceSessionSyncCheck = exports.deviceSessionStateCheck = exports.deviceRegisterResponseCheck = exports.deviceJoinResponseCheck = exports.deviceJoinCodeResponseCheck = exports.holderContextEvidenceV1ResponseCheck = exports.holderContextEvidenceV1RequestCheck = exports.deviceContextTokenV1ResponseCheck = exports.deviceContextTokenV1RequestCheck = exports.deviceBackgroundCredentialResponseCheck = exports.activeTokenCheck = exports.SESSION_ACCOUNTS_CHANGED_EVENT = exports.deviceDirectorySyncCheck = exports.deviceDirectoryCheck = exports.deviceActivateResponseCheck = exports.normalizeDomainName = exports.DOMAIN_NAME_MAX_LENGTH = exports.signedRecordEnvelopeCheck = exports.externalIdentityReferenceCheck = exports.loginResultCheck = exports.isLoopbackOrigin = exports.organizationKeyProofClaims = exports.organizationKeyPayload = exports.organizationKeyChallengeRequestCheck = exports.organizationKeyChallengeCheck = exports.organizationKeyApplyRequestCheck = exports.organizationIdentityKeyStateCheck = void 0;
|
|
35
|
-
exports.
|
|
36
|
-
exports.
|
|
37
|
-
exports.
|
|
38
|
-
exports.keychainItemsResponseCheck = exports.keychainItemResponseCheck = exports.keychainEnrollmentsResponseCheck = exports.keychainEnrollmentResponseCheck = exports.keychainWrapResponseCheck = exports.keychainStateResponseCheck = exports.KEYCHAIN_TIMESTAMP_PATTERN = exports.KEYCHAIN_HASH_PATTERN = exports.KEYCHAIN_BASE64URL_PATTERN = exports.KEYCHAIN_SIGNATURE_PATTERN = exports.KEYCHAIN_NONCE_PATTERN = exports.KEYCHAIN_BYTES32_PATTERN = void 0;
|
|
35
|
+
exports.safetyPeopleResponseCheck = exports.safetyPeopleInputCheck = exports.safetyOrganizationsResponseCheck = exports.safetyOrganizationsInputCheck = exports.purchaseReviewInputCheck = exports.purchaseApprovalListCheck = exports.purchaseApprovalCheck = exports.profileAccessInputCheck = exports.profileAccessDecisionCheck = exports.SUPERVISION_STATUSES = exports.SUPERVISION_INVITATION_STATUSES = exports.SUPERVISION_CONSENT_VERSION = exports.SUPERVISION_CHANGED_EVENT = exports.SUPERVISED_ACTIONS = exports.SAFETY_POLICY_VERSION = exports.PURCHASE_APPROVAL_STATUSES = exports.isFullReputationBalance = exports.recommendationRequestCheck = exports.subscriptionCreditGrantsResponseCheck = exports.subjectProductAccessQueryCheck = exports.subjectProductAccessCheck = exports.productSubscriptionsResponseCheck = exports.productSubscriptionPortalResponseCheck = exports.productSubscriptionPortalRequestCheck = exports.productSubscriptionCancellationResultCheck = exports.productPlanCheckoutRequestCheck = exports.productPlanCatalogueCheck = exports.personalPlanCheckoutResultCheck = exports.personalPlanCheckoutRequestCheck = exports.personalPlanCatalogueCheck = exports.oxyAccountIdCheck = exports.cancelProductSubscriptionCheck = exports.updateOrganizationCheck = exports.organizationNameCheck = exports.organizationListCheck = exports.organizationImportBatchResultCheck = exports.organizationExternalResolutionCheck = exports.organizationExternalCheck = exports.organizationCurationResultCheck = exports.organizationClaimReviewCheck = exports.organizationClaimListCheck = exports.organizationClaimInputCheck = exports.organizationClaimDetailCheck = exports.organizationClaimCheck = exports.organizationCheck = exports.organizationBatchCheck = exports.createOrganizationCheck = exports.ORGANIZATION_TYPES = exports.ORGANIZATION_STATUSES = exports.ORGANIZATION_NAME_MAX_LENGTH = void 0;
|
|
36
|
+
exports.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 = exports.TOTP_PERIOD_SECONDS = exports.TOTP_DIGITS = exports.TOTP_BACKUP_CODE_COUNT = exports.SIGN_IN_ERROR_CODES = exports.SIGNIN_SECOND_FACTOR_TTL_MS = exports.SIGNIN_SECOND_FACTOR_MAX_ATTEMPTS = exports.SIGN_IN_IDENTIFIER_MAX_LENGTH = exports.SECOND_FACTOR_CODE_MAX_LENGTH = exports.REAUTH_ACTIONS = exports.PASSWORD_MIN_LENGTH = exports.PASSWORD_MAX_LENGTH = exports.EMAIL_SIGNIN_LONG_CODE_LENGTH = exports.EMAIL_SIGNIN_LONG_CODE_ALPHABET = exports.EMAIL_SIGNIN_LINK_TTL_MS = exports.EMAIL_SIGNIN_CHOICE_TTL_MS = exports.EMAIL_ACCOUNTS_MAX = exports.CONSOLE_USE_CASES = exports.CONSOLE_TERMS_VERSION = exports.publicApplicationCheck = exports.supervisionStateCheck = exports.supervisionReviewInputCheck = exports.supervisionInviteInputCheck = exports.supervisionInvitationCheck = exports.supervisionContactsResponseCheck = exports.supervisionContactInputCheck = exports.supervisionAcceptInputCheck = void 0;
|
|
37
|
+
exports.KEYCHAIN_ERROR_CODES = exports.KEYCHAIN_LIMITS = exports.KEYCHAIN_DOMAINS = exports.KEYCHAIN_RECOVERY = exports.KEYCHAIN_ENROLLMENT_STATUSES = exports.KEYCHAIN_ROSTER_OPS = exports.KEYCHAIN_PLATFORMS = exports.isLanguageTag = exports.hasCampaignControlCharacters = exports.CAMPAIGN_CLICK_ID_MAX_LENGTH = exports.CAMPAIGN_LABEL_MAX_LENGTH = exports.FREE_USER_PROFILE_COLOR_PRESETS = exports.USER_PROFILE_COLOR_PRESETS = exports.USER_PROFILE_COLORS = exports.deviceAppTokenResponseCheck = exports.PLATFORM_HOSTS = exports.OXYOS_DESKTOP_ENTRY_ID_PATTERN = exports.DEVICE_APP_TOKEN_TTL_SECONDS = exports.DEVICE_APP_TOKEN_ERROR_CODES = exports.APP_TOKEN_DEVICE_ACCESS_DENIED = exports.appAttestKeyResponseCheck = exports.appAssertionResponseCheck = exports.appAssertionChallengeResponseCheck = exports.OXY_APP_ASSERTION_TYPE = exports.OXY_APP_ASSERTION_TTL_SECONDS = exports.OXY_APP_ASSERTION_HEADER = exports.OXY_APP_ASSERTION_AUDIENCE = exports.APP_ASSERTION_PLATFORMS = exports.APP_ASSERTION_ERROR_CODES = exports.APP_ASSERTION_CHALLENGE_PURPOSES = exports.isRightsClaim = exports.isErasureRequest = exports.OPEN_CONTENT_CLAIM_STATES = exports.ERASURE_REQUEST_DEADLINE_DAYS = exports.COUNTER_NOTICE_STATEMENTS = exports.COUNTER_NOTICE_STATEMENT_VERSION = exports.CONTENT_CLAIM_STATES = exports.CONTENT_CLAIM_REFERENCE_PATTERN = exports.CONTENT_CLAIM_LIMITS = exports.CONTENT_CLAIM_KINDS = exports.CONTENT_CLAIM_ERROR_CODES = exports.CONTENT_CLAIM_COUNTER_NOTICE_LIMITS = exports.CLOSED_CONTENT_CLAIM_STATES = exports.CLAIMANT_RELATIONSHIPS = exports.PRONOUNS = exports.PROFILE_LINK_TITLE_MAX = exports.PROFILE_LINKS_MAX = exports.userNameCheck = exports.usernameCheckForAccountKind = exports.usernameCheck = void 0;
|
|
38
|
+
exports.keychainItemsResponseCheck = exports.keychainItemResponseCheck = exports.keychainEnrollmentsResponseCheck = exports.keychainEnrollmentResponseCheck = exports.keychainWrapResponseCheck = exports.keychainStateResponseCheck = exports.KEYCHAIN_TIMESTAMP_PATTERN = exports.KEYCHAIN_HASH_PATTERN = exports.KEYCHAIN_BASE64URL_PATTERN = exports.KEYCHAIN_SIGNATURE_PATTERN = exports.KEYCHAIN_NONCE_PATTERN = exports.KEYCHAIN_BYTES32_PATTERN = exports.KEYCHAIN_ID_PATTERN = void 0;
|
|
39
39
|
var check_1 = require("./check");
|
|
40
40
|
Object.defineProperty(exports, "ContractCheckError", { enumerable: true, get: function () { return check_1.ContractCheckError; } });
|
|
41
41
|
Object.defineProperty(exports, "checkContract", { enumerable: true, get: function () { return check_1.checkContract; } });
|
|
@@ -173,6 +173,7 @@ Object.defineProperty(exports, "organizationNameCheck", { enumerable: true, get:
|
|
|
173
173
|
Object.defineProperty(exports, "updateOrganizationCheck", { enumerable: true, get: function () { return organizations_1.updateOrganizationCheck; } });
|
|
174
174
|
var products_1 = require("./products");
|
|
175
175
|
Object.defineProperty(exports, "cancelProductSubscriptionCheck", { enumerable: true, get: function () { return products_1.cancelProductSubscriptionCheck; } });
|
|
176
|
+
Object.defineProperty(exports, "oxyAccountIdCheck", { enumerable: true, get: function () { return products_1.oxyAccountIdCheck; } });
|
|
176
177
|
Object.defineProperty(exports, "personalPlanCatalogueCheck", { enumerable: true, get: function () { return products_1.personalPlanCatalogueCheck; } });
|
|
177
178
|
Object.defineProperty(exports, "personalPlanCheckoutRequestCheck", { enumerable: true, get: function () { return products_1.personalPlanCheckoutRequestCheck; } });
|
|
178
179
|
Object.defineProperty(exports, "personalPlanCheckoutResultCheck", { enumerable: true, get: function () { return products_1.personalPlanCheckoutResultCheck; } });
|
|
@@ -6,13 +6,18 @@
|
|
|
6
6
|
* Part of `@oxy.so/contracts/client`: never import `zod` here (see `./check.ts`).
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.productSubscriptionCancellationResultCheck = exports.cancelProductSubscriptionCheck = exports.subscriptionCreditGrantsResponseCheck = exports.productSubscriptionsResponseCheck = exports.personalPlanCheckoutResultCheck = exports.productSubscriptionPortalResponseCheck = exports.productSubscriptionPortalRequestCheck = exports.productPlanCheckoutRequestCheck = exports.personalPlanCheckoutRequestCheck = exports.productPlanCatalogueCheck = exports.personalPlanCatalogueCheck = exports.subjectProductAccessCheck = exports.subjectProductAccessQueryCheck = void 0;
|
|
9
|
+
exports.productSubscriptionCancellationResultCheck = exports.cancelProductSubscriptionCheck = exports.subscriptionCreditGrantsResponseCheck = exports.productSubscriptionsResponseCheck = exports.personalPlanCheckoutResultCheck = exports.productSubscriptionPortalResponseCheck = exports.productSubscriptionPortalRequestCheck = exports.productPlanCheckoutRequestCheck = exports.personalPlanCheckoutRequestCheck = exports.productPlanCatalogueCheck = exports.personalPlanCatalogueCheck = exports.subjectProductAccessCheck = exports.subjectProductAccessQueryCheck = exports.oxyAccountIdCheck = void 0;
|
|
10
10
|
const check_1 = require("./check");
|
|
11
11
|
const identifier = (0, check_1.string)((0, check_1.minLength)(1), (0, check_1.maxLength)(160));
|
|
12
12
|
const displayName = (0, check_1.string)((0, check_1.minLength)(1), (0, check_1.maxLength)(100));
|
|
13
13
|
const count = (0, check_1.number)(check_1.int, check_1.nonnegative, check_1.safe);
|
|
14
14
|
const version = (0, check_1.number)(check_1.int, check_1.positive, check_1.safe);
|
|
15
15
|
const oxyAccountId = (0, check_1.branded)((0, check_1.string)((0, check_1.minLength)(1), (0, check_1.maxLength)(64)));
|
|
16
|
+
/**
|
|
17
|
+
* An Oxy account id, branded: the only way a client obtains an `OxyAccountId` (a checkout's
|
|
18
|
+
* `expectedSubjectAccountId`) without the root entry's `oxyAccountIdSchema` and Zod with it.
|
|
19
|
+
*/
|
|
20
|
+
exports.oxyAccountIdCheck = (0, check_1.exact)()(oxyAccountId);
|
|
16
21
|
const actionKey = (0, check_1.string)((0, check_1.minLength)(8), (0, check_1.maxLength)(160), (0, check_1.pattern)(/^[a-zA-Z0-9_-]+$/));
|
|
17
22
|
const combination = (0, check_1.oneOf)(['maximum', 'sum', 'exclusive']);
|
|
18
23
|
const origin = (0, check_1.oneOf)(['individual', 'bundle']);
|
|
@@ -16,6 +16,16 @@
|
|
|
16
16
|
* is the SHAPE of what a client writes: only the keys a character has, each an
|
|
17
17
|
* id-like string, a `#rrggbb` paint, a spacing in range. The client resolves
|
|
18
18
|
* the ids and falls back on a default look for one it cannot draw.
|
|
19
|
+
*
|
|
20
|
+
* ## A bot's colour is its account's, not its character's
|
|
21
|
+
*
|
|
22
|
+
* A bot is painted in its account's `color` (`User.color`, a Bloom preset key):
|
|
23
|
+
* Bloom draws a bot account's character in it (`avatarCharacterInColor`,
|
|
24
|
+
* `@oxy.so/bloom` 20), so a character needs no paint of its own and a bot whose
|
|
25
|
+
* owner changes its colour changes everywhere at once. A character is therefore
|
|
26
|
+
* valid with a preset or a shape alone. `color` and `bodyColor` are still
|
|
27
|
+
* accepted from writers that send them, and a renderer that knows the account's
|
|
28
|
+
* colour ignores them.
|
|
19
29
|
*/
|
|
20
30
|
import { z } from 'zod';
|
|
21
31
|
const ID = /^[a-z][a-z0-9_]{0,39}$/;
|
|
@@ -26,7 +36,8 @@ const idSchema = z.string().regex(ID);
|
|
|
26
36
|
/**
|
|
27
37
|
* A character a client sends. `.strict()` so a misspelled field is a refusal
|
|
28
38
|
* now rather than a look that never takes effect. A character with nothing in
|
|
29
|
-
* it draws nothing: it needs a preset
|
|
39
|
+
* it draws nothing: it needs a preset or a shape. It needs no paint: the
|
|
40
|
+
* account's colour paints it (see the file comment).
|
|
30
41
|
*/
|
|
31
42
|
export const avatarCharacterSchema = z
|
|
32
43
|
.object({
|
|
@@ -49,8 +60,9 @@ export const avatarCharacterSchema = z
|
|
|
49
60
|
.optional(),
|
|
50
61
|
})
|
|
51
62
|
.strict()
|
|
52
|
-
.refine((c) => c.preset !== undefined ||
|
|
53
|
-
|
|
63
|
+
.refine((c) => c.preset !== undefined || c.shape !== undefined, {
|
|
64
|
+
message: 'A character needs a preset or a shape',
|
|
65
|
+
});
|
|
54
66
|
/** The validated character, or `null` for anything that is not one. */
|
|
55
67
|
export function parseAvatarCharacter(value) {
|
|
56
68
|
const parsed = avatarCharacterSchema.safeParse(value);
|
package/dist/esm/client/index.js
CHANGED
|
@@ -31,7 +31,7 @@ export { IDENTITY_KEY_HISTORY_CLAIM_ACTION, identityKeyHistoryCheck } from './id
|
|
|
31
31
|
export { IDENTITY_LINK_QR_PREFIX, IDENTITY_LINK_STATUSES, buildIdentityLinkQrPayload, identityLinkCreateResponseCheck, identityLinkStateCheck, parseIdentityLinkQrPayload, } from './identityLink.js';
|
|
32
32
|
export { IDENTITY_ERROR_CODES, IDENTITY_PROOF_ACTIONS, IDENTITY_PROOF_ACTION_VALUES, IDENTITY_PROOF_AUDIENCE, IDENTITY_PROOF_CHALLENGE_TTL_MS, IDENTITY_PROOF_DOMAIN, IDENTITY_PROOF_VERSION, buildIdentityProofMessage, canonicalJson, } from './identityProof.js';
|
|
33
33
|
export { ORGANIZATION_ALIAS_KINDS, ORGANIZATION_CLAIM_DECISIONS, ORGANIZATION_CLAIM_STATUSES, ORGANIZATION_ERROR_CODES, ORGANIZATION_NAME_MAX_LENGTH, ORGANIZATION_STATUSES, ORGANIZATION_TYPES, createOrganizationCheck, organizationBatchCheck, organizationCheck, organizationClaimCheck, organizationClaimDetailCheck, organizationClaimInputCheck, organizationClaimListCheck, organizationClaimReviewCheck, organizationCurationResultCheck, organizationExternalCheck, organizationExternalResolutionCheck, organizationImportBatchResultCheck, organizationListCheck, organizationNameCheck, updateOrganizationCheck, } from './organizations.js';
|
|
34
|
-
export { cancelProductSubscriptionCheck, personalPlanCatalogueCheck, personalPlanCheckoutRequestCheck, personalPlanCheckoutResultCheck, productPlanCatalogueCheck, productPlanCheckoutRequestCheck, productSubscriptionCancellationResultCheck, productSubscriptionPortalRequestCheck, productSubscriptionPortalResponseCheck, productSubscriptionsResponseCheck, subjectProductAccessCheck, subjectProductAccessQueryCheck, subscriptionCreditGrantsResponseCheck, } from './products.js';
|
|
34
|
+
export { cancelProductSubscriptionCheck, oxyAccountIdCheck, personalPlanCatalogueCheck, personalPlanCheckoutRequestCheck, personalPlanCheckoutResultCheck, productPlanCatalogueCheck, productPlanCheckoutRequestCheck, productSubscriptionCancellationResultCheck, productSubscriptionPortalRequestCheck, productSubscriptionPortalResponseCheck, productSubscriptionsResponseCheck, subjectProductAccessCheck, subjectProductAccessQueryCheck, subscriptionCreditGrantsResponseCheck, } from './products.js';
|
|
35
35
|
export { recommendationRequestCheck } from './recommendations.js';
|
|
36
36
|
export { isFullReputationBalance } from './reputation.js';
|
|
37
37
|
export { PURCHASE_APPROVAL_STATUSES, SAFETY_POLICY_VERSION, SUPERVISED_ACTIONS, SUPERVISION_CHANGED_EVENT, SUPERVISION_CONSENT_VERSION, SUPERVISION_INVITATION_STATUSES, SUPERVISION_STATUSES, profileAccessDecisionCheck, profileAccessInputCheck, purchaseApprovalCheck, purchaseApprovalListCheck, purchaseReviewInputCheck, safetyOrganizationsInputCheck, safetyOrganizationsResponseCheck, safetyPeopleInputCheck, safetyPeopleResponseCheck, supervisionAcceptInputCheck, supervisionContactInputCheck, supervisionContactsResponseCheck, supervisionInvitationCheck, supervisionInviteInputCheck, supervisionReviewInputCheck, supervisionStateCheck, } from './safety.js';
|
|
@@ -10,6 +10,11 @@ const displayName = string(minLength(1), maxLength(100));
|
|
|
10
10
|
const count = number(int, nonnegative, safe);
|
|
11
11
|
const version = number(int, positive, safe);
|
|
12
12
|
const oxyAccountId = branded(string(minLength(1), maxLength(64)));
|
|
13
|
+
/**
|
|
14
|
+
* An Oxy account id, branded: the only way a client obtains an `OxyAccountId` (a checkout's
|
|
15
|
+
* `expectedSubjectAccountId`) without the root entry's `oxyAccountIdSchema` and Zod with it.
|
|
16
|
+
*/
|
|
17
|
+
export const oxyAccountIdCheck = exact()(oxyAccountId);
|
|
13
18
|
const actionKey = string(minLength(8), maxLength(160), pattern(/^[a-zA-Z0-9_-]+$/));
|
|
14
19
|
const combination = oneOf(['maximum', 'sum', 'exclusive']);
|
|
15
20
|
const origin = oneOf(['individual', 'bundle']);
|
|
@@ -16,6 +16,16 @@
|
|
|
16
16
|
* is the SHAPE of what a client writes: only the keys a character has, each an
|
|
17
17
|
* id-like string, a `#rrggbb` paint, a spacing in range. The client resolves
|
|
18
18
|
* the ids and falls back on a default look for one it cannot draw.
|
|
19
|
+
*
|
|
20
|
+
* ## A bot's colour is its account's, not its character's
|
|
21
|
+
*
|
|
22
|
+
* A bot is painted in its account's `color` (`User.color`, a Bloom preset key):
|
|
23
|
+
* Bloom draws a bot account's character in it (`avatarCharacterInColor`,
|
|
24
|
+
* `@oxy.so/bloom` 20), so a character needs no paint of its own and a bot whose
|
|
25
|
+
* owner changes its colour changes everywhere at once. A character is therefore
|
|
26
|
+
* valid with a preset or a shape alone. `color` and `bodyColor` are still
|
|
27
|
+
* accepted from writers that send them, and a renderer that knows the account's
|
|
28
|
+
* colour ignores them.
|
|
19
29
|
*/
|
|
20
30
|
import { z } from 'zod';
|
|
21
31
|
/** The flat shape of Bloom's `AvatarCharacter`; every field is optional (a preset supplies the rest). */
|
|
@@ -40,7 +50,8 @@ export declare const AVATAR_EYE_SPACING: {
|
|
|
40
50
|
/**
|
|
41
51
|
* A character a client sends. `.strict()` so a misspelled field is a refusal
|
|
42
52
|
* now rather than a look that never takes effect. A character with nothing in
|
|
43
|
-
* it draws nothing: it needs a preset
|
|
53
|
+
* it draws nothing: it needs a preset or a shape. It needs no paint: the
|
|
54
|
+
* account's colour paints it (see the file comment).
|
|
44
55
|
*/
|
|
45
56
|
export declare const avatarCharacterSchema: z.ZodType<AvatarCharacter, unknown>;
|
|
46
57
|
/** The validated character, or `null` for anything that is not one. */
|
|
@@ -33,7 +33,7 @@ export type { IdentityKeyHistory, IdentityKeyHistoryClaimRequest } from '../iden
|
|
|
33
33
|
export { IDENTITY_LINK_QR_PREFIX, IDENTITY_LINK_STATUSES, buildIdentityLinkQrPayload, identityLinkCreateResponseCheck, identityLinkStateCheck, parseIdentityLinkQrPayload, } from './identityLink';
|
|
34
34
|
export { IDENTITY_ERROR_CODES, IDENTITY_PROOF_ACTIONS, IDENTITY_PROOF_ACTION_VALUES, IDENTITY_PROOF_AUDIENCE, IDENTITY_PROOF_CHALLENGE_TTL_MS, IDENTITY_PROOF_DOMAIN, IDENTITY_PROOF_VERSION, buildIdentityProofMessage, canonicalJson, } from './identityProof';
|
|
35
35
|
export { ORGANIZATION_ALIAS_KINDS, ORGANIZATION_CLAIM_DECISIONS, ORGANIZATION_CLAIM_STATUSES, ORGANIZATION_ERROR_CODES, ORGANIZATION_NAME_MAX_LENGTH, ORGANIZATION_STATUSES, ORGANIZATION_TYPES, createOrganizationCheck, organizationBatchCheck, organizationCheck, organizationClaimCheck, organizationClaimDetailCheck, organizationClaimInputCheck, organizationClaimListCheck, organizationClaimReviewCheck, organizationCurationResultCheck, organizationExternalCheck, organizationExternalResolutionCheck, organizationImportBatchResultCheck, organizationListCheck, organizationNameCheck, updateOrganizationCheck, } from './organizations';
|
|
36
|
-
export { cancelProductSubscriptionCheck, personalPlanCatalogueCheck, personalPlanCheckoutRequestCheck, personalPlanCheckoutResultCheck, productPlanCatalogueCheck, productPlanCheckoutRequestCheck, productSubscriptionCancellationResultCheck, productSubscriptionPortalRequestCheck, productSubscriptionPortalResponseCheck, productSubscriptionsResponseCheck, subjectProductAccessCheck, subjectProductAccessQueryCheck, subscriptionCreditGrantsResponseCheck, } from './products';
|
|
36
|
+
export { cancelProductSubscriptionCheck, oxyAccountIdCheck, personalPlanCatalogueCheck, personalPlanCheckoutRequestCheck, personalPlanCheckoutResultCheck, productPlanCatalogueCheck, productPlanCheckoutRequestCheck, productSubscriptionCancellationResultCheck, productSubscriptionPortalRequestCheck, productSubscriptionPortalResponseCheck, productSubscriptionsResponseCheck, subjectProductAccessCheck, subjectProductAccessQueryCheck, subscriptionCreditGrantsResponseCheck, } from './products';
|
|
37
37
|
export { recommendationRequestCheck } from './recommendations';
|
|
38
38
|
export { isFullReputationBalance } from './reputation';
|
|
39
39
|
export { PURCHASE_APPROVAL_STATUSES, SAFETY_POLICY_VERSION, SUPERVISED_ACTIONS, SUPERVISION_CHANGED_EVENT, SUPERVISION_CONSENT_VERSION, SUPERVISION_INVITATION_STATUSES, SUPERVISION_STATUSES, profileAccessDecisionCheck, profileAccessInputCheck, purchaseApprovalCheck, purchaseApprovalListCheck, purchaseReviewInputCheck, safetyOrganizationsInputCheck, safetyOrganizationsResponseCheck, safetyPeopleInputCheck, safetyPeopleResponseCheck, supervisionAcceptInputCheck, supervisionContactInputCheck, supervisionContactsResponseCheck, supervisionInvitationCheck, supervisionInviteInputCheck, supervisionReviewInputCheck, supervisionStateCheck, } from './safety';
|
|
@@ -5,6 +5,11 @@
|
|
|
5
5
|
* Part of `@oxy.so/contracts/client`: never import `zod` here (see `./check.ts`).
|
|
6
6
|
*/
|
|
7
7
|
import { type Check } from './check';
|
|
8
|
+
/**
|
|
9
|
+
* An Oxy account id, branded: the only way a client obtains an `OxyAccountId` (a checkout's
|
|
10
|
+
* `expectedSubjectAccountId`) without the root entry's `oxyAccountIdSchema` and Zod with it.
|
|
11
|
+
*/
|
|
12
|
+
export declare const oxyAccountIdCheck: Check<string & import("zod").$brand<"OxyAccountId">>;
|
|
8
13
|
export declare const subjectProductAccessQueryCheck: Check<{
|
|
9
14
|
schemaVersion: 1;
|
|
10
15
|
subjectAccountId: string & import("zod").$brand<"OxyAccountId">;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxy.so/contracts",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.27.0",
|
|
4
4
|
"description": "OxyHQ API contracts — single source of truth for request/response Zod schemas and inferred types, shared by the backend and the client SDKs",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -89,6 +89,6 @@
|
|
|
89
89
|
"@types/node": "^26.6.6",
|
|
90
90
|
"jest": "^30.5.2",
|
|
91
91
|
"typescript": "~6.0.3",
|
|
92
|
-
"@oxy.so/bloom": "
|
|
92
|
+
"@oxy.so/bloom": "19.8.3"
|
|
93
93
|
}
|
|
94
94
|
}
|