@oxy.so/contracts 5.8.0 → 6.0.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 +6 -5
- package/dist/cjs/accountEmail.js +13 -5
- package/dist/cjs/accountGraph.js +10 -9
- package/dist/cjs/accountName.js +3 -2
- package/dist/cjs/agency.js +91 -34
- package/dist/cjs/agentKeys.js +21 -17
- package/dist/cjs/appAssertions.js +14 -13
- package/dist/cjs/applicationRoles.js +19 -12
- package/dist/cjs/civic.js +10 -9
- package/dist/cjs/client/check.js +61 -53
- package/dist/cjs/consoleOnboarding.js +9 -4
- package/dist/cjs/contentClaims.js +23 -14
- package/dist/cjs/deviceDirectory.js +11 -9
- package/dist/cjs/deviceSession.js +27 -25
- package/dist/cjs/email/messages.js +20 -18
- package/dist/cjs/emailAgentContext.js +11 -9
- package/dist/cjs/externalIdentity.js +15 -11
- package/dist/cjs/federationInstanceFetch.js +12 -7
- package/dist/cjs/identity.js +19 -17
- package/dist/cjs/identityLink.js +6 -4
- package/dist/cjs/identityProof.js +6 -4
- package/dist/cjs/inboxPush.js +5 -4
- package/dist/cjs/index.js +15 -6
- package/dist/cjs/inference/accountBilling.js +35 -33
- package/dist/cjs/inference/aliaModelRelease.js +9 -7
- package/dist/cjs/inference/attribution.js +14 -12
- package/dist/cjs/inference/catalogue.js +35 -29
- package/dist/cjs/inference/economics.js +24 -19
- package/dist/cjs/inference/embeddings.js +9 -7
- package/dist/cjs/inference/entitlement.js +17 -15
- package/dist/cjs/inference/errors.js +15 -8
- package/dist/cjs/inference/identifiers.js +33 -21
- package/dist/cjs/inference/inbox.js +37 -35
- package/dist/cjs/inference/modelDocumentation.js +16 -14
- package/dist/cjs/inference/money.js +5 -4
- package/dist/cjs/inference/priceVersion.js +10 -5
- package/dist/cjs/inference/providerConnection.js +21 -14
- package/dist/cjs/inference/realtime.js +88 -47
- package/dist/cjs/inference/request.js +27 -25
- package/dist/cjs/inference/routingPolicy.js +12 -10
- package/dist/cjs/inference/streamEvents.js +22 -16
- package/dist/cjs/inference/usage.js +32 -15
- package/dist/cjs/keyRecovery.js +8 -6
- package/dist/cjs/keyRotation.js +5 -4
- package/dist/cjs/linkedAccounts.js +22 -18
- package/dist/cjs/moderationReputation.js +29 -27
- package/dist/cjs/notifications.js +25 -9
- package/dist/cjs/numberChecks.js +45 -0
- package/dist/cjs/oauth.js +14 -12
- package/dist/cjs/organizations.js +23 -21
- package/dist/cjs/products/access.js +10 -8
- package/dist/cjs/products/billing.js +10 -8
- package/dist/cjs/products/checkout.js +22 -10
- package/dist/cjs/products/plans.js +15 -10
- package/dist/cjs/protocol.js +6 -5
- package/dist/cjs/recommendations.js +27 -19
- package/dist/cjs/reputation.js +15 -13
- package/dist/cjs/safety.js +43 -27
- package/dist/cjs/serviceToken.js +81 -2
- package/dist/cjs/sessionRevocation.js +8 -6
- package/dist/cjs/signIn.js +42 -24
- package/dist/cjs/stickers.js +19 -15
- package/dist/cjs/stringChecks.js +70 -0
- package/dist/cjs/transparency.js +14 -12
- package/dist/cjs/updates.js +24 -22
- package/dist/cjs/userInvalidation.js +7 -5
- package/dist/cjs/userResponse.js +8 -7
- package/dist/cjs/username.js +7 -6
- package/dist/esm/accountAccess.js +4 -3
- package/dist/esm/accountEmail.js +13 -5
- package/dist/esm/accountGraph.js +8 -7
- package/dist/esm/accountName.js +3 -2
- package/dist/esm/agency.js +90 -33
- package/dist/esm/agentKeys.js +21 -17
- package/dist/esm/appAssertions.js +11 -10
- package/dist/esm/applicationRoles.js +16 -9
- package/dist/esm/civic.js +8 -7
- package/dist/esm/client/check.js +61 -53
- package/dist/esm/consoleOnboarding.js +7 -2
- package/dist/esm/contentClaims.js +23 -14
- package/dist/esm/deviceDirectory.js +11 -9
- package/dist/esm/deviceSession.js +27 -25
- package/dist/esm/email/messages.js +18 -16
- package/dist/esm/emailAgentContext.js +11 -9
- package/dist/esm/externalIdentity.js +15 -11
- package/dist/esm/federationInstanceFetch.js +10 -5
- package/dist/esm/identity.js +17 -15
- package/dist/esm/identityLink.js +6 -4
- package/dist/esm/identityProof.js +6 -4
- package/dist/esm/inboxPush.js +3 -2
- package/dist/esm/index.js +4 -2
- package/dist/esm/inference/accountBilling.js +33 -31
- package/dist/esm/inference/aliaModelRelease.js +7 -5
- package/dist/esm/inference/attribution.js +14 -12
- package/dist/esm/inference/catalogue.js +33 -27
- package/dist/esm/inference/economics.js +22 -17
- package/dist/esm/inference/embeddings.js +9 -7
- package/dist/esm/inference/entitlement.js +15 -13
- package/dist/esm/inference/errors.js +13 -6
- package/dist/esm/inference/identifiers.js +31 -19
- package/dist/esm/inference/inbox.js +37 -35
- package/dist/esm/inference/modelDocumentation.js +14 -12
- package/dist/esm/inference/money.js +3 -2
- package/dist/esm/inference/priceVersion.js +8 -3
- package/dist/esm/inference/providerConnection.js +19 -12
- package/dist/esm/inference/realtime.js +85 -44
- package/dist/esm/inference/request.js +25 -23
- package/dist/esm/inference/routingPolicy.js +9 -7
- package/dist/esm/inference/streamEvents.js +20 -14
- package/dist/esm/inference/usage.js +30 -13
- package/dist/esm/keyRecovery.js +8 -6
- package/dist/esm/keyRotation.js +5 -4
- package/dist/esm/linkedAccounts.js +20 -16
- package/dist/esm/moderationReputation.js +27 -25
- package/dist/esm/notifications.js +23 -7
- package/dist/esm/numberChecks.js +41 -0
- package/dist/esm/oauth.js +14 -12
- package/dist/esm/organizations.js +23 -21
- package/dist/esm/products/access.js +10 -8
- package/dist/esm/products/billing.js +10 -8
- package/dist/esm/products/checkout.js +22 -10
- package/dist/esm/products/plans.js +15 -10
- package/dist/esm/protocol.js +4 -3
- package/dist/esm/recommendations.js +25 -17
- package/dist/esm/reputation.js +13 -11
- package/dist/esm/safety.js +43 -27
- package/dist/esm/serviceToken.js +80 -1
- package/dist/esm/sessionRevocation.js +6 -4
- package/dist/esm/signIn.js +42 -24
- package/dist/esm/stickers.js +17 -13
- package/dist/esm/stringChecks.js +63 -0
- package/dist/esm/transparency.js +14 -12
- package/dist/esm/updates.js +22 -20
- package/dist/esm/userInvalidation.js +4 -2
- package/dist/esm/userResponse.js +4 -3
- package/dist/esm/username.js +3 -2
- package/dist/types/accountAccess.d.ts +29 -70
- package/dist/types/accountEmail.d.ts +2 -14
- package/dist/types/accountGraph.d.ts +179 -171
- package/dist/types/accountName.d.ts +1 -1
- package/dist/types/accountSubject.d.ts +20 -93
- package/dist/types/agency.d.ts +528 -2924
- package/dist/types/agentKeys.d.ts +48 -421
- package/dist/types/appAssertions.d.ts +56 -210
- package/dist/types/applicationRoles.d.ts +30 -276
- package/dist/types/avatarCharacter.d.ts +1 -1
- package/dist/types/civic.d.ts +1 -13
- package/dist/types/client/agentKeys.d.ts +18 -18
- package/dist/types/client/appAssertions.d.ts +3 -3
- package/dist/types/client/check.d.ts +13 -13
- package/dist/types/client/deviceDirectory.d.ts +51 -51
- package/dist/types/client/deviceSession.d.ts +14 -14
- package/dist/types/client/organizations.d.ts +25 -25
- package/dist/types/client/products.d.ts +33 -33
- package/dist/types/client/recommendations.d.ts +2 -2
- package/dist/types/client/safety.d.ts +45 -45
- package/dist/types/client/sessionStatus.d.ts +4 -4
- package/dist/types/client/signIn.d.ts +1 -1
- package/dist/types/commonsSignIn.d.ts +4 -1
- package/dist/types/consoleOnboarding.d.ts +24 -44
- package/dist/types/contentClaims.d.ts +24 -180
- package/dist/types/deviceDirectory.d.ts +109 -1040
- package/dist/types/deviceSession.d.ts +36 -298
- package/dist/types/email/messages.d.ts +212 -1793
- package/dist/types/emailAgentContext.d.ts +10 -194
- package/dist/types/externalIdentity.d.ts +121 -615
- package/dist/types/federationInstanceFetch.d.ts +3 -32
- package/dist/types/identity.d.ts +15 -92
- package/dist/types/identityLink.d.ts +6 -84
- package/dist/types/identityProof.d.ts +5 -17
- package/dist/types/inboxPush.d.ts +1 -9
- package/dist/types/index.d.ts +5 -3
- package/dist/types/inference/accountBilling.d.ts +151 -488
- package/dist/types/inference/aliaModelRelease.d.ts +42 -439
- package/dist/types/inference/attribution.d.ts +75 -104
- package/dist/types/inference/catalogue.d.ts +417 -1599
- package/dist/types/inference/economics.d.ts +69 -276
- package/dist/types/inference/embeddings.d.ts +110 -406
- package/dist/types/inference/entitlement.d.ts +80 -335
- package/dist/types/inference/errors.d.ts +90 -102
- package/dist/types/inference/identifiers.d.ts +12 -4
- package/dist/types/inference/inbox.d.ts +105 -420
- package/dist/types/inference/modelDocumentation.d.ts +201 -1390
- package/dist/types/inference/money.d.ts +65 -32
- package/dist/types/inference/priceVersion.d.ts +53 -120
- package/dist/types/inference/providerConnection.d.ts +253 -710
- package/dist/types/inference/realtime.d.ts +954 -6825
- package/dist/types/inference/request.d.ts +300 -2572
- package/dist/types/inference/routingPolicy.d.ts +95 -503
- package/dist/types/inference/streamEvents.d.ts +253 -721
- package/dist/types/inference/usage.d.ts +317 -950
- package/dist/types/keyRecovery.d.ts +3 -51
- package/dist/types/keyRotation.d.ts +3 -38
- package/dist/types/linkedAccounts.d.ts +50 -236
- package/dist/types/moderationReputation.d.ts +81 -14
- package/dist/types/notifications.d.ts +19 -51
- package/dist/types/numberChecks.d.ts +9 -0
- package/dist/types/oauth.d.ts +101 -809
- package/dist/types/organizations.d.ts +268 -921
- package/dist/types/oxyRecordTypes.d.ts +11 -1
- package/dist/types/products/access.d.ts +125 -775
- package/dist/types/products/billing.d.ts +67 -503
- package/dist/types/products/checkout.d.ts +16 -69
- package/dist/types/products/plans.d.ts +33 -366
- package/dist/types/recommendations.d.ts +76 -389
- package/dist/types/reputation.d.ts +37 -5
- package/dist/types/safety.d.ts +408 -2048
- package/dist/types/serviceToken.d.ts +247 -7
- package/dist/types/sessionRevocation.d.ts +2 -17
- package/dist/types/sessionStatus.d.ts +27 -115
- package/dist/types/signIn.d.ts +53 -553
- package/dist/types/stickers.d.ts +67 -819
- package/dist/types/stringChecks.d.ts +16 -0
- package/dist/types/transparency.d.ts +14 -302
- package/dist/types/updates.d.ts +60 -316
- package/dist/types/userInvalidation.d.ts +4 -13
- package/dist/types/userResponse.d.ts +302 -2400
- package/dist/types/username.d.ts +3 -3
- package/package.json +2 -2
package/dist/esm/username.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { utf16MaxLength, utf16MinLength } from './stringChecks.js';
|
|
1
2
|
/**
|
|
2
3
|
* Username policy — the ONE rule, for every kind of account.
|
|
3
4
|
*
|
|
@@ -115,8 +116,8 @@ export { USERNAME_MIN_LENGTH, USERNAME_MAX_LENGTH, USERNAME_INVALID_MESSAGE, RES
|
|
|
115
116
|
export const usernameSchema = z
|
|
116
117
|
.string()
|
|
117
118
|
.trim()
|
|
118
|
-
.
|
|
119
|
-
.
|
|
119
|
+
.check(utf16MinLength(USERNAME_MIN_LENGTH, USERNAME_INVALID_MESSAGE))
|
|
120
|
+
.check(utf16MaxLength(USERNAME_MAX_LENGTH, USERNAME_INVALID_MESSAGE))
|
|
120
121
|
.regex(USERNAME_PATTERN, USERNAME_INVALID_MESSAGE)
|
|
121
122
|
.refine((username) => !/^[0-9]+$/.test(username), NUMERIC_USERNAME_MESSAGE)
|
|
122
123
|
.refine((username) => !RESERVED_USERNAMES.has(username.toLowerCase()), RESERVED_USERNAME_MESSAGE)
|
|
@@ -38,7 +38,11 @@ export declare const ACCOUNTS_MEMBERSHIP_READ_SCOPE: "accounts:membership:read";
|
|
|
38
38
|
*/
|
|
39
39
|
export declare const ACCOUNT_ACCESS_SOURCES: readonly ["self", "direct", "inherited"];
|
|
40
40
|
export type AccountAccessSource = (typeof ACCOUNT_ACCESS_SOURCES)[number];
|
|
41
|
-
export declare const accountAccessSourceSchema: z.ZodEnum<
|
|
41
|
+
export declare const accountAccessSourceSchema: z.ZodEnum<{
|
|
42
|
+
self: "self";
|
|
43
|
+
direct: "direct";
|
|
44
|
+
inherited: "inherited";
|
|
45
|
+
}>;
|
|
42
46
|
/**
|
|
43
47
|
* One person's EFFECTIVE access over one account.
|
|
44
48
|
*
|
|
@@ -50,79 +54,34 @@ export declare const accountAccessSourceSchema: z.ZodEnum<["self", "direct", "in
|
|
|
50
54
|
*/
|
|
51
55
|
export declare const accountAccessGrantSchema: z.ZodObject<{
|
|
52
56
|
role: z.ZodString;
|
|
53
|
-
permissions: z.ZodArray<z.ZodString
|
|
54
|
-
/** Only an active membership grants access, so this is the one value. */
|
|
57
|
+
permissions: z.ZodArray<z.ZodString>;
|
|
55
58
|
status: z.ZodLiteral<"active">;
|
|
56
|
-
source: z.ZodEnum<
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}, {
|
|
63
|
-
status: "active";
|
|
64
|
-
role: string;
|
|
65
|
-
permissions: string[];
|
|
66
|
-
source: "self" | "direct" | "inherited";
|
|
67
|
-
}>;
|
|
59
|
+
source: z.ZodEnum<{
|
|
60
|
+
self: "self";
|
|
61
|
+
direct: "direct";
|
|
62
|
+
inherited: "inherited";
|
|
63
|
+
}>;
|
|
64
|
+
}, z.core.$strip>;
|
|
68
65
|
export type AccountAccessGrant = z.infer<typeof accountAccessGrantSchema>;
|
|
69
|
-
export declare const accountAccessVerdictSchema: z.
|
|
66
|
+
export declare const accountAccessVerdictSchema: z.ZodObject<{
|
|
70
67
|
accountId: z.ZodString;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
68
|
+
kind: z.ZodNullable<z.ZodEnum<{
|
|
69
|
+
personal: "personal";
|
|
70
|
+
organization: "organization";
|
|
71
|
+
project: "project";
|
|
72
|
+
bot: "bot";
|
|
73
|
+
channel: "channel";
|
|
74
|
+
community: "community";
|
|
75
|
+
}>>;
|
|
74
76
|
access: z.ZodNullable<z.ZodObject<{
|
|
75
77
|
role: z.ZodString;
|
|
76
|
-
permissions: z.ZodArray<z.ZodString
|
|
77
|
-
/** Only an active membership grants access, so this is the one value. */
|
|
78
|
+
permissions: z.ZodArray<z.ZodString>;
|
|
78
79
|
status: z.ZodLiteral<"active">;
|
|
79
|
-
source: z.ZodEnum<
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
status: "active";
|
|
87
|
-
role: string;
|
|
88
|
-
permissions: string[];
|
|
89
|
-
source: "self" | "direct" | "inherited";
|
|
90
|
-
}>>;
|
|
91
|
-
}, "strip", z.ZodTypeAny, {
|
|
92
|
-
kind: "personal" | "organization" | "project" | "bot" | "channel" | "community" | null;
|
|
93
|
-
accountId: string;
|
|
94
|
-
access: {
|
|
95
|
-
status: "active";
|
|
96
|
-
role: string;
|
|
97
|
-
permissions: string[];
|
|
98
|
-
source: "self" | "direct" | "inherited";
|
|
99
|
-
} | null;
|
|
100
|
-
}, {
|
|
101
|
-
kind: "personal" | "organization" | "project" | "bot" | "channel" | "community" | null;
|
|
102
|
-
accountId: string;
|
|
103
|
-
access: {
|
|
104
|
-
status: "active";
|
|
105
|
-
role: string;
|
|
106
|
-
permissions: string[];
|
|
107
|
-
source: "self" | "direct" | "inherited";
|
|
108
|
-
} | null;
|
|
109
|
-
}>, {
|
|
110
|
-
kind: "personal" | "organization" | "project" | "bot" | "channel" | "community" | null;
|
|
111
|
-
accountId: string;
|
|
112
|
-
access: {
|
|
113
|
-
status: "active";
|
|
114
|
-
role: string;
|
|
115
|
-
permissions: string[];
|
|
116
|
-
source: "self" | "direct" | "inherited";
|
|
117
|
-
} | null;
|
|
118
|
-
}, {
|
|
119
|
-
kind: "personal" | "organization" | "project" | "bot" | "channel" | "community" | null;
|
|
120
|
-
accountId: string;
|
|
121
|
-
access: {
|
|
122
|
-
status: "active";
|
|
123
|
-
role: string;
|
|
124
|
-
permissions: string[];
|
|
125
|
-
source: "self" | "direct" | "inherited";
|
|
126
|
-
} | null;
|
|
127
|
-
}>;
|
|
80
|
+
source: z.ZodEnum<{
|
|
81
|
+
self: "self";
|
|
82
|
+
direct: "direct";
|
|
83
|
+
inherited: "inherited";
|
|
84
|
+
}>;
|
|
85
|
+
}, z.core.$strip>>;
|
|
86
|
+
}, z.core.$strip>;
|
|
128
87
|
export type AccountAccessVerdict = z.infer<typeof accountAccessVerdictSchema>;
|
|
@@ -23,13 +23,7 @@ export declare const emailTicketSchema: z.ZodString;
|
|
|
23
23
|
export declare const emailVerificationStartRequestSchema: z.ZodObject<{
|
|
24
24
|
purpose: z.ZodLiteral<"signup">;
|
|
25
25
|
email: z.ZodString;
|
|
26
|
-
},
|
|
27
|
-
email: string;
|
|
28
|
-
purpose: "signup";
|
|
29
|
-
}, {
|
|
30
|
-
email: string;
|
|
31
|
-
purpose: "signup";
|
|
32
|
-
}>;
|
|
26
|
+
}, z.core.$strict>;
|
|
33
27
|
export type EmailVerificationStartRequest = z.infer<typeof emailVerificationStartRequestSchema>;
|
|
34
28
|
export interface EmailVerificationStartResponse {
|
|
35
29
|
/** Names this verification in `confirm`. Returned whether or not a code was sent. */
|
|
@@ -42,13 +36,7 @@ export declare const emailVerificationStartResponseSchema: z.ZodType<EmailVerifi
|
|
|
42
36
|
export declare const emailVerificationConfirmRequestSchema: z.ZodObject<{
|
|
43
37
|
verificationId: z.ZodString;
|
|
44
38
|
code: z.ZodString;
|
|
45
|
-
},
|
|
46
|
-
code: string;
|
|
47
|
-
verificationId: string;
|
|
48
|
-
}, {
|
|
49
|
-
code: string;
|
|
50
|
-
verificationId: string;
|
|
51
|
-
}>;
|
|
39
|
+
}, z.core.$strict>;
|
|
52
40
|
export type EmailVerificationConfirmRequest = z.infer<typeof emailVerificationConfirmRequestSchema>;
|
|
53
41
|
export interface EmailVerificationConfirmResponse {
|
|
54
42
|
ticket: string;
|
|
@@ -9,8 +9,21 @@
|
|
|
9
9
|
import { z } from 'zod';
|
|
10
10
|
export { ACCOUNT_KINDS, CHILD_ACCOUNT_KINDS, isDelegatedActAsEligibleKind, isOperatorSwitchTargetKind, isMemberOperatedKind, isAccountKind, ACCOUNT_CATEGORY_IDS, RETIRED_ACCOUNT_CATEGORY_IDS, isSelectableAccountCategoryId, SELECTABLE_ACCOUNT_CATEGORY_IDS, newlyAddedRetiredCategories, MAX_ACCOUNT_CATEGORIES, ACCOUNT_CATEGORY_KINDS, kindAcceptsAccountCategories, } from './client/accountGraph';
|
|
11
11
|
export type { AccountKind, AccountKindGap, ChildAccountKind, ChildAccountKindGap, AccountCategoryId, AccountCategoryKind, } from './client/accountGraph';
|
|
12
|
-
export declare const accountKindSchema: z.ZodEnum<
|
|
13
|
-
|
|
12
|
+
export declare const accountKindSchema: z.ZodEnum<{
|
|
13
|
+
personal: "personal";
|
|
14
|
+
organization: "organization";
|
|
15
|
+
project: "project";
|
|
16
|
+
bot: "bot";
|
|
17
|
+
channel: "channel";
|
|
18
|
+
community: "community";
|
|
19
|
+
}>;
|
|
20
|
+
export declare const childAccountKindSchema: z.ZodEnum<{
|
|
21
|
+
organization: "organization";
|
|
22
|
+
project: "project";
|
|
23
|
+
bot: "bot";
|
|
24
|
+
channel: "channel";
|
|
25
|
+
community: "community";
|
|
26
|
+
}>;
|
|
14
27
|
/**
|
|
15
28
|
* Accepts EVERY id, withdrawn ones included — see rule 3.
|
|
16
29
|
*
|
|
@@ -19,7 +32,54 @@ export declare const childAccountKindSchema: z.ZodEnum<["organization", "project
|
|
|
19
32
|
* picked one could no longer save its bio either. That is the same failure the
|
|
20
33
|
* nullable `bio` / `avatar` fix addressed, wearing a different hat.
|
|
21
34
|
*/
|
|
22
|
-
export declare const accountCategoryIdSchema: z.ZodEnum<
|
|
35
|
+
export declare const accountCategoryIdSchema: z.ZodEnum<{
|
|
36
|
+
community: "community";
|
|
37
|
+
news: "news";
|
|
38
|
+
politics: "politics";
|
|
39
|
+
business: "business";
|
|
40
|
+
startup: "startup";
|
|
41
|
+
finance: "finance";
|
|
42
|
+
crypto: "crypto";
|
|
43
|
+
marketplace: "marketplace";
|
|
44
|
+
retail: "retail";
|
|
45
|
+
real_estate: "real_estate";
|
|
46
|
+
agency: "agency";
|
|
47
|
+
landlord: "landlord";
|
|
48
|
+
cooperative: "cooperative";
|
|
49
|
+
architecture: "architecture";
|
|
50
|
+
technology: "technology";
|
|
51
|
+
software: "software";
|
|
52
|
+
ai: "ai";
|
|
53
|
+
security: "security";
|
|
54
|
+
automation: "automation";
|
|
55
|
+
science: "science";
|
|
56
|
+
education: "education";
|
|
57
|
+
books: "books";
|
|
58
|
+
health: "health";
|
|
59
|
+
fitness: "fitness";
|
|
60
|
+
sports: "sports";
|
|
61
|
+
gaming: "gaming";
|
|
62
|
+
music: "music";
|
|
63
|
+
film: "film";
|
|
64
|
+
podcast: "podcast";
|
|
65
|
+
art: "art";
|
|
66
|
+
photography: "photography";
|
|
67
|
+
comedy: "comedy";
|
|
68
|
+
food: "food";
|
|
69
|
+
travel: "travel";
|
|
70
|
+
fashion: "fashion";
|
|
71
|
+
home_garden: "home_garden";
|
|
72
|
+
diy: "diy";
|
|
73
|
+
automotive: "automotive";
|
|
74
|
+
animals: "animals";
|
|
75
|
+
family: "family";
|
|
76
|
+
nonprofit: "nonprofit";
|
|
77
|
+
government: "government";
|
|
78
|
+
activism: "activism";
|
|
79
|
+
environment: "environment";
|
|
80
|
+
religion: "religion";
|
|
81
|
+
other: "other";
|
|
82
|
+
}>;
|
|
23
83
|
/**
|
|
24
84
|
* An account's categories on the wire. ORDER IS MEANINGFUL — index 0 is the
|
|
25
85
|
* primary (rule 2).
|
|
@@ -30,7 +90,54 @@ export declare const accountCategoryIdSchema: z.ZodEnum<["news", "politics", "bu
|
|
|
30
90
|
* property the list exists to carry. A duplicate only ever comes from a client
|
|
31
91
|
* bug, and a 400 naming the index is how that bug gets found.
|
|
32
92
|
*/
|
|
33
|
-
export declare const accountCategoriesSchema: z.
|
|
93
|
+
export declare const accountCategoriesSchema: z.ZodArray<z.ZodEnum<{
|
|
94
|
+
community: "community";
|
|
95
|
+
news: "news";
|
|
96
|
+
politics: "politics";
|
|
97
|
+
business: "business";
|
|
98
|
+
startup: "startup";
|
|
99
|
+
finance: "finance";
|
|
100
|
+
crypto: "crypto";
|
|
101
|
+
marketplace: "marketplace";
|
|
102
|
+
retail: "retail";
|
|
103
|
+
real_estate: "real_estate";
|
|
104
|
+
agency: "agency";
|
|
105
|
+
landlord: "landlord";
|
|
106
|
+
cooperative: "cooperative";
|
|
107
|
+
architecture: "architecture";
|
|
108
|
+
technology: "technology";
|
|
109
|
+
software: "software";
|
|
110
|
+
ai: "ai";
|
|
111
|
+
security: "security";
|
|
112
|
+
automation: "automation";
|
|
113
|
+
science: "science";
|
|
114
|
+
education: "education";
|
|
115
|
+
books: "books";
|
|
116
|
+
health: "health";
|
|
117
|
+
fitness: "fitness";
|
|
118
|
+
sports: "sports";
|
|
119
|
+
gaming: "gaming";
|
|
120
|
+
music: "music";
|
|
121
|
+
film: "film";
|
|
122
|
+
podcast: "podcast";
|
|
123
|
+
art: "art";
|
|
124
|
+
photography: "photography";
|
|
125
|
+
comedy: "comedy";
|
|
126
|
+
food: "food";
|
|
127
|
+
travel: "travel";
|
|
128
|
+
fashion: "fashion";
|
|
129
|
+
home_garden: "home_garden";
|
|
130
|
+
diy: "diy";
|
|
131
|
+
automotive: "automotive";
|
|
132
|
+
animals: "animals";
|
|
133
|
+
family: "family";
|
|
134
|
+
nonprofit: "nonprofit";
|
|
135
|
+
government: "government";
|
|
136
|
+
activism: "activism";
|
|
137
|
+
environment: "environment";
|
|
138
|
+
religion: "religion";
|
|
139
|
+
other: "other";
|
|
140
|
+
}>>;
|
|
34
141
|
/**
|
|
35
142
|
* An account's name on the create/update wire.
|
|
36
143
|
*
|
|
@@ -49,15 +156,7 @@ export declare const accountNameSchema: z.ZodOptional<z.ZodObject<{
|
|
|
49
156
|
first: z.ZodOptional<z.ZodString>;
|
|
50
157
|
last: z.ZodOptional<z.ZodString>;
|
|
51
158
|
displayName: z.ZodOptional<z.ZodString>;
|
|
52
|
-
},
|
|
53
|
-
first?: string | undefined;
|
|
54
|
-
last?: string | undefined;
|
|
55
|
-
displayName?: string | undefined;
|
|
56
|
-
}, {
|
|
57
|
-
first?: string | undefined;
|
|
58
|
-
last?: string | undefined;
|
|
59
|
-
displayName?: string | undefined;
|
|
60
|
-
}>>;
|
|
159
|
+
}, z.core.$strip>>;
|
|
61
160
|
/**
|
|
62
161
|
* POST /accounts — create a non-personal account under the caller's tree.
|
|
63
162
|
*
|
|
@@ -69,172 +168,81 @@ export declare const accountNameSchema: z.ZodOptional<z.ZodObject<{
|
|
|
69
168
|
* accept categories would break that reasoning silently, so
|
|
70
169
|
* `__tests__/accountGraph.test.ts` asserts every child kind is a category kind.
|
|
71
170
|
*/
|
|
72
|
-
export declare const createAccountRequestSchema: z.
|
|
171
|
+
export declare const createAccountRequestSchema: z.ZodObject<{
|
|
73
172
|
parentAccountId: z.ZodOptional<z.ZodString>;
|
|
74
|
-
kind: z.ZodEnum<
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
* A `bot` is held to that AND to the label its handle must end in. That half
|
|
83
|
-
* cannot live on this field — it depends on `kind`, a sibling — so it is in the
|
|
84
|
-
* `superRefine` below, which reports its issue against this path.
|
|
85
|
-
*/
|
|
86
|
-
username: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>;
|
|
173
|
+
kind: z.ZodEnum<{
|
|
174
|
+
organization: "organization";
|
|
175
|
+
project: "project";
|
|
176
|
+
bot: "bot";
|
|
177
|
+
channel: "channel";
|
|
178
|
+
community: "community";
|
|
179
|
+
}>;
|
|
180
|
+
username: z.ZodString;
|
|
87
181
|
name: z.ZodOptional<z.ZodObject<{
|
|
88
182
|
first: z.ZodOptional<z.ZodString>;
|
|
89
183
|
last: z.ZodOptional<z.ZodString>;
|
|
90
184
|
displayName: z.ZodOptional<z.ZodString>;
|
|
91
|
-
},
|
|
92
|
-
first?: string | undefined;
|
|
93
|
-
last?: string | undefined;
|
|
94
|
-
displayName?: string | undefined;
|
|
95
|
-
}, {
|
|
96
|
-
first?: string | undefined;
|
|
97
|
-
last?: string | undefined;
|
|
98
|
-
displayName?: string | undefined;
|
|
99
|
-
}>>;
|
|
185
|
+
}, z.core.$strip>>;
|
|
100
186
|
bio: z.ZodOptional<z.ZodString>;
|
|
101
187
|
avatar: z.ZodOptional<z.ZodString>;
|
|
102
188
|
description: z.ZodOptional<z.ZodString>;
|
|
103
|
-
/**
|
|
104
|
-
* A named color preset KEY (`"blue"`, `"mint"`, …), never a hex value.
|
|
105
|
-
*
|
|
106
|
-
* Here at CREATION for the reason `isPrivateAccount` is, in miniature: for a
|
|
107
|
-
* managed account the color is a visual identity, and an account that is
|
|
108
|
-
* discoverable without one and acquires it on a second request is a face that
|
|
109
|
-
* changes by itself. One statement, one row, born looking like what its owner
|
|
110
|
-
* chose.
|
|
111
|
-
*
|
|
112
|
-
* The VALUE is checked in the API rather than here. The vocabulary is
|
|
113
|
-
* `USER_COLOR_PRESETS`, which is declared next to the `users_color_check` CHECK
|
|
114
|
-
* that is rendered from it — pinning the list a second time in this package
|
|
115
|
-
* would be a second source of truth for what the database accepts, and the two
|
|
116
|
-
* would drift apart silently. What this shape does is keep an over-long or
|
|
117
|
-
* non-string value from reaching the service at all.
|
|
118
|
-
*/
|
|
119
189
|
color: z.ZodOptional<z.ZodString>;
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
190
|
+
accountCategories: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
191
|
+
community: "community";
|
|
192
|
+
news: "news";
|
|
193
|
+
politics: "politics";
|
|
194
|
+
business: "business";
|
|
195
|
+
startup: "startup";
|
|
196
|
+
finance: "finance";
|
|
197
|
+
crypto: "crypto";
|
|
198
|
+
marketplace: "marketplace";
|
|
199
|
+
retail: "retail";
|
|
200
|
+
real_estate: "real_estate";
|
|
201
|
+
agency: "agency";
|
|
202
|
+
landlord: "landlord";
|
|
203
|
+
cooperative: "cooperative";
|
|
204
|
+
architecture: "architecture";
|
|
205
|
+
technology: "technology";
|
|
206
|
+
software: "software";
|
|
207
|
+
ai: "ai";
|
|
208
|
+
security: "security";
|
|
209
|
+
automation: "automation";
|
|
210
|
+
science: "science";
|
|
211
|
+
education: "education";
|
|
212
|
+
books: "books";
|
|
213
|
+
health: "health";
|
|
214
|
+
fitness: "fitness";
|
|
215
|
+
sports: "sports";
|
|
216
|
+
gaming: "gaming";
|
|
217
|
+
music: "music";
|
|
218
|
+
film: "film";
|
|
219
|
+
podcast: "podcast";
|
|
220
|
+
art: "art";
|
|
221
|
+
photography: "photography";
|
|
222
|
+
comedy: "comedy";
|
|
223
|
+
food: "food";
|
|
224
|
+
travel: "travel";
|
|
225
|
+
fashion: "fashion";
|
|
226
|
+
home_garden: "home_garden";
|
|
227
|
+
diy: "diy";
|
|
228
|
+
automotive: "automotive";
|
|
229
|
+
animals: "animals";
|
|
230
|
+
family: "family";
|
|
231
|
+
nonprofit: "nonprofit";
|
|
232
|
+
government: "government";
|
|
233
|
+
activism: "activism";
|
|
234
|
+
environment: "environment";
|
|
235
|
+
religion: "religion";
|
|
236
|
+
other: "other";
|
|
237
|
+
}>>>;
|
|
238
|
+
organizationType: z.ZodOptional<z.ZodEnum<{
|
|
239
|
+
community: "community";
|
|
240
|
+
business: "business";
|
|
241
|
+
nonprofit: "nonprofit";
|
|
242
|
+
other: "other";
|
|
243
|
+
public_body: "public_body";
|
|
244
|
+
}>>;
|
|
163
245
|
isPrivateAccount: z.ZodOptional<z.ZodBoolean>;
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
* below). Optional on the wire: a bot created without one is given a look
|
|
167
|
-
* seeded from its handle (`avatarCharacterFor`), so every bot account has a
|
|
168
|
-
* character from birth and the owner customizes it afterwards.
|
|
169
|
-
*/
|
|
170
|
-
character: z.ZodOptional<z.ZodType<import("./avatarCharacter").AvatarCharacter, z.ZodTypeDef, unknown>>;
|
|
171
|
-
}, "strip", z.ZodTypeAny, {
|
|
172
|
-
kind: "organization" | "project" | "bot" | "channel" | "community";
|
|
173
|
-
username: string;
|
|
174
|
-
color?: string | undefined;
|
|
175
|
-
name?: {
|
|
176
|
-
first?: string | undefined;
|
|
177
|
-
last?: string | undefined;
|
|
178
|
-
displayName?: string | undefined;
|
|
179
|
-
} | undefined;
|
|
180
|
-
organizationType?: "community" | "business" | "nonprofit" | "other" | "public_body" | undefined;
|
|
181
|
-
avatar?: string | undefined;
|
|
182
|
-
parentAccountId?: string | undefined;
|
|
183
|
-
bio?: string | undefined;
|
|
184
|
-
description?: string | undefined;
|
|
185
|
-
accountCategories?: ("community" | "news" | "politics" | "business" | "startup" | "finance" | "crypto" | "marketplace" | "retail" | "real_estate" | "agency" | "landlord" | "cooperative" | "architecture" | "technology" | "software" | "ai" | "security" | "automation" | "science" | "education" | "books" | "health" | "fitness" | "sports" | "gaming" | "music" | "film" | "podcast" | "art" | "photography" | "comedy" | "food" | "travel" | "fashion" | "home_garden" | "diy" | "automotive" | "animals" | "family" | "nonprofit" | "government" | "activism" | "environment" | "religion" | "other")[] | undefined;
|
|
186
|
-
isPrivateAccount?: boolean | undefined;
|
|
187
|
-
character?: import("./avatarCharacter").AvatarCharacter | undefined;
|
|
188
|
-
}, {
|
|
189
|
-
kind: "organization" | "project" | "bot" | "channel" | "community";
|
|
190
|
-
username: string;
|
|
191
|
-
color?: string | undefined;
|
|
192
|
-
name?: {
|
|
193
|
-
first?: string | undefined;
|
|
194
|
-
last?: string | undefined;
|
|
195
|
-
displayName?: string | undefined;
|
|
196
|
-
} | undefined;
|
|
197
|
-
organizationType?: "community" | "business" | "nonprofit" | "other" | "public_body" | undefined;
|
|
198
|
-
avatar?: string | undefined;
|
|
199
|
-
parentAccountId?: string | undefined;
|
|
200
|
-
bio?: string | undefined;
|
|
201
|
-
description?: string | undefined;
|
|
202
|
-
accountCategories?: ("community" | "news" | "politics" | "business" | "startup" | "finance" | "crypto" | "marketplace" | "retail" | "real_estate" | "agency" | "landlord" | "cooperative" | "architecture" | "technology" | "software" | "ai" | "security" | "automation" | "science" | "education" | "books" | "health" | "fitness" | "sports" | "gaming" | "music" | "film" | "podcast" | "art" | "photography" | "comedy" | "food" | "travel" | "fashion" | "home_garden" | "diy" | "automotive" | "animals" | "family" | "nonprofit" | "government" | "activism" | "environment" | "religion" | "other")[] | undefined;
|
|
203
|
-
isPrivateAccount?: boolean | undefined;
|
|
204
|
-
character?: unknown;
|
|
205
|
-
}>, {
|
|
206
|
-
kind: "organization" | "project" | "bot" | "channel" | "community";
|
|
207
|
-
username: string;
|
|
208
|
-
color?: string | undefined;
|
|
209
|
-
name?: {
|
|
210
|
-
first?: string | undefined;
|
|
211
|
-
last?: string | undefined;
|
|
212
|
-
displayName?: string | undefined;
|
|
213
|
-
} | undefined;
|
|
214
|
-
organizationType?: "community" | "business" | "nonprofit" | "other" | "public_body" | undefined;
|
|
215
|
-
avatar?: string | undefined;
|
|
216
|
-
parentAccountId?: string | undefined;
|
|
217
|
-
bio?: string | undefined;
|
|
218
|
-
description?: string | undefined;
|
|
219
|
-
accountCategories?: ("community" | "news" | "politics" | "business" | "startup" | "finance" | "crypto" | "marketplace" | "retail" | "real_estate" | "agency" | "landlord" | "cooperative" | "architecture" | "technology" | "software" | "ai" | "security" | "automation" | "science" | "education" | "books" | "health" | "fitness" | "sports" | "gaming" | "music" | "film" | "podcast" | "art" | "photography" | "comedy" | "food" | "travel" | "fashion" | "home_garden" | "diy" | "automotive" | "animals" | "family" | "nonprofit" | "government" | "activism" | "environment" | "religion" | "other")[] | undefined;
|
|
220
|
-
isPrivateAccount?: boolean | undefined;
|
|
221
|
-
character?: import("./avatarCharacter").AvatarCharacter | undefined;
|
|
222
|
-
}, {
|
|
223
|
-
kind: "organization" | "project" | "bot" | "channel" | "community";
|
|
224
|
-
username: string;
|
|
225
|
-
color?: string | undefined;
|
|
226
|
-
name?: {
|
|
227
|
-
first?: string | undefined;
|
|
228
|
-
last?: string | undefined;
|
|
229
|
-
displayName?: string | undefined;
|
|
230
|
-
} | undefined;
|
|
231
|
-
organizationType?: "community" | "business" | "nonprofit" | "other" | "public_body" | undefined;
|
|
232
|
-
avatar?: string | undefined;
|
|
233
|
-
parentAccountId?: string | undefined;
|
|
234
|
-
bio?: string | undefined;
|
|
235
|
-
description?: string | undefined;
|
|
236
|
-
accountCategories?: ("community" | "news" | "politics" | "business" | "startup" | "finance" | "crypto" | "marketplace" | "retail" | "real_estate" | "agency" | "landlord" | "cooperative" | "architecture" | "technology" | "software" | "ai" | "security" | "automation" | "science" | "education" | "books" | "health" | "fitness" | "sports" | "gaming" | "music" | "film" | "podcast" | "art" | "photography" | "comedy" | "food" | "travel" | "fashion" | "home_garden" | "diy" | "automotive" | "animals" | "family" | "nonprofit" | "government" | "activism" | "environment" | "religion" | "other")[] | undefined;
|
|
237
|
-
isPrivateAccount?: boolean | undefined;
|
|
238
|
-
character?: unknown;
|
|
239
|
-
}>;
|
|
246
|
+
character: z.ZodOptional<z.ZodType<import("./avatarCharacter").AvatarCharacter, unknown, z.core.$ZodTypeInternals<import("./avatarCharacter").AvatarCharacter, unknown>>>;
|
|
247
|
+
}, z.core.$strip>;
|
|
240
248
|
export type CreateAccountRequest = z.infer<typeof createAccountRequestSchema>;
|
|
@@ -2,4 +2,4 @@ import { z } from 'zod';
|
|
|
2
2
|
export { ACCOUNT_NAME_POLICY_BY_KIND, ACCOUNT_TITLE_DISALLOWED_SOURCE, ACCOUNT_TITLE_MAX_LENGTH, accountNamePolicyForKind, isPlainTextTitle, } from './client/accountName';
|
|
3
3
|
export type { AccountNamePolicy } from './client/accountName';
|
|
4
4
|
/** A non-personal account's title — see `./client/accountName.ts` for the policy. */
|
|
5
|
-
export declare const accountTitleSchema: z.
|
|
5
|
+
export declare const accountTitleSchema: z.ZodString;
|