@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
|
@@ -7,138 +7,10 @@
|
|
|
7
7
|
* {@link ACCOUNT_CATEGORY_IDS} for the four rules that govern it.
|
|
8
8
|
*/
|
|
9
9
|
import { z } from 'zod';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
*
|
|
13
|
-
* `personal` is the only kind minted by signup and the only one that signs in
|
|
14
|
-
* as a device principal; every other kind is a child account created under a
|
|
15
|
-
* parent and reached through `account_members`. The API schema, the Drizzle
|
|
16
|
-
* table and the SDK all derive from this list rather than restating it, so a
|
|
17
|
-
* new kind is one edit here instead of four literals that can drift.
|
|
18
|
-
*
|
|
19
|
-
* The kind names what an account IS. It does not, on its own, answer who may
|
|
20
|
-
* switch into it, who may act as it, who the actor is, or anything commercial —
|
|
21
|
-
* each of those has its own predicate or contract, tabulated at the top of
|
|
22
|
-
* `accountSubject.ts`. In particular a `bot` is a COMPLETE account (issue
|
|
23
|
-
* #1520): it owns resources, holds roles, plans and a balance, receives funds
|
|
24
|
-
* and pays for itself under the same rules as a person, and is its own actor.
|
|
25
|
-
*/
|
|
26
|
-
export type AccountKind = 'personal' | 'organization' | 'project' | 'bot' | 'channel';
|
|
27
|
-
/**
|
|
28
|
-
* The union is spelled out above and the array proves coverage BOTH ways
|
|
29
|
-
* (`satisfies` here, the `Gap` alias below) — the same shape this package's
|
|
30
|
-
* `ACCOUNT_CATEGORY_IDS` / `TRUST_TIERS` pairs use, and the one
|
|
31
|
-
* `db/schema/users.ts` mirrors to keep the `users_kind_check` CHECK honest.
|
|
32
|
-
*
|
|
33
|
-
* Deriving the union from the array instead would cost nothing here and be paid
|
|
34
|
-
* by consumers: `kind` travels into `@oxy.so/services` on every device-directory
|
|
35
|
-
* context (`deviceContextSchema.kind` → `DeviceContext` → the switcher rows),
|
|
36
|
-
* and an indexed-access type is materially more expensive to check there than a
|
|
37
|
-
* literal union.
|
|
38
|
-
*/
|
|
39
|
-
export declare const ACCOUNT_KINDS: readonly ["personal", "organization", "project", "bot", "channel"];
|
|
40
|
-
/** `never` while `ACCOUNT_KINDS` covers the union. */
|
|
41
|
-
export type AccountKindGap = Exclude<AccountKind, (typeof ACCOUNT_KINDS)[number]>;
|
|
10
|
+
export { ACCOUNT_KINDS, CHILD_ACCOUNT_KINDS, isDelegatedActAsEligibleKind, isOperatorSwitchTargetKind, 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
|
+
export type { AccountKind, AccountKindGap, ChildAccountKind, ChildAccountKindGap, AccountCategoryId, AccountCategoryKind, } from './client/accountGraph';
|
|
42
12
|
export declare const accountKindSchema: z.ZodEnum<["personal", "organization", "project", "bot", "channel"]>;
|
|
43
|
-
/**
|
|
44
|
-
* Kinds that may be CREATED as children of another account. Exactly
|
|
45
|
-
* `ACCOUNT_KINDS` minus `personal`, which is always a tree root.
|
|
46
|
-
*/
|
|
47
|
-
export type ChildAccountKind = Exclude<AccountKind, 'personal'>;
|
|
48
|
-
export declare const CHILD_ACCOUNT_KINDS: readonly ["organization", "project", "bot", "channel"];
|
|
49
|
-
/** `never` while `CHILD_ACCOUNT_KINDS` covers the child union. */
|
|
50
|
-
export type ChildAccountKindGap = Exclude<ChildAccountKind, (typeof CHILD_ACCOUNT_KINDS)[number]>;
|
|
51
13
|
export declare const childAccountKindSchema: z.ZodEnum<["organization", "project", "bot", "channel"]>;
|
|
52
|
-
/**
|
|
53
|
-
* Whether an account of this kind may be the SUBJECT OF A DELEGATION — an
|
|
54
|
-
* application acting as it on some person's authority. `POST /internal/accounts/
|
|
55
|
-
* :id/service-switch` and the OAuth delegated subject both gate on this.
|
|
56
|
-
*
|
|
57
|
-
* It is NOT the question an account switcher asks. See
|
|
58
|
-
* {@link isOperatorSwitchTargetKind}, and the note below on why the difference
|
|
59
|
-
* is `bot`.
|
|
60
|
-
*
|
|
61
|
-
* Two kinds are refused, for opposite reasons:
|
|
62
|
-
*
|
|
63
|
-
* - `personal` is a human login, so assuming it would be impersonation.
|
|
64
|
-
* - `channel` is a CONTENT identity, not an operating one. A channel exists so
|
|
65
|
-
* that posts can be authored BY it; it is never a seat anybody occupies. Its
|
|
66
|
-
* operators act on it through their own membership, and an application
|
|
67
|
-
* publishes to it with its own credential. Refusing act-as is what makes
|
|
68
|
-
* "no login, ever" structural rather than incidental: no session can be
|
|
69
|
-
* minted whose subject is a channel, so no bearer exists that could add an
|
|
70
|
-
* auth method to one (every auth-method write resolves its target from the
|
|
71
|
-
* authenticated subject, never from a parameter).
|
|
72
|
-
*
|
|
73
|
-
* Consumers must gate on this predicate rather than testing `kind === 'personal'`,
|
|
74
|
-
* which silently admits every kind added after it was written.
|
|
75
|
-
*
|
|
76
|
-
* Being act-as-eligible is NOT being without an identity of one's own. A bot is
|
|
77
|
-
* act-as-eligible AND its own actor (`accountKindActorNature` → `'agent'` in
|
|
78
|
-
* `accountSubject.ts`): an application acting as it on a person's authority
|
|
79
|
-
* records that person as the actor, and the bot acting with nobody operating it
|
|
80
|
-
* records the bot. Neither ever records the bot's owner in the bot's place.
|
|
81
|
-
*/
|
|
82
|
-
export declare function isDelegatedActAsEligibleKind(kind: AccountKind | null | undefined): boolean;
|
|
83
|
-
/**
|
|
84
|
-
* Whether a PERSON may switch into an account of this kind — become it, in an
|
|
85
|
-
* account switcher, for the rest of their session.
|
|
86
|
-
*
|
|
87
|
-
* ## Why this is not the same question as {@link isDelegatedActAsEligibleKind}
|
|
88
|
-
*
|
|
89
|
-
* The two differ on exactly one kind, `bot`, and that difference is the whole
|
|
90
|
-
* reason both exist.
|
|
91
|
-
*
|
|
92
|
-
* **A bot is not something you become. It is somebody of its own.** It is an
|
|
93
|
-
* agent's identity, with its own resources, roles, plan and balance, and it is
|
|
94
|
-
* the actor of what it does unoperated. A person may still act AS it on their
|
|
95
|
-
* own authority — that is delegation, recorded with the person as actor, and it
|
|
96
|
-
* is what {@link isDelegatedActAsEligibleKind} admits it for. What a person
|
|
97
|
-
* never does is occupy its seat. This is a refusal of a SEAT, not a capability
|
|
98
|
-
* restriction: nothing a bot may do depends on this predicate.
|
|
99
|
-
*
|
|
100
|
-
* Handing a person the bot's seat instead inverts that. It puts a human inside
|
|
101
|
-
* the identity that exists to act without one, and it does so on the human's own
|
|
102
|
-
* device, next to their personal login — which is precisely what happened: a
|
|
103
|
-
* `bot` account held a live session on a person's device, offered to them by a
|
|
104
|
-
* switcher that had asked the delegation question by mistake.
|
|
105
|
-
*
|
|
106
|
-
* `channel` is refused here as well, for the reason set out above, and
|
|
107
|
-
* `personal` because assuming somebody else's login is impersonation.
|
|
108
|
-
*
|
|
109
|
-
* ## This is the narrower predicate, deliberately
|
|
110
|
-
*
|
|
111
|
-
* Everything a person may become, a service may also act as; the reverse does
|
|
112
|
-
* not hold. A caller that is unsure which question it is asking wants THIS one:
|
|
113
|
-
* being wrong here withholds an affordance, while being wrong the other way
|
|
114
|
-
* hands out a seat.
|
|
115
|
-
*/
|
|
116
|
-
export declare function isOperatorSwitchTargetKind(kind: AccountKind | null | undefined): boolean;
|
|
117
|
-
/**
|
|
118
|
-
* Narrow an unknown value to an {@link AccountKind}.
|
|
119
|
-
*
|
|
120
|
-
* The user-DTO serializers read from structurally-permissive `unknown` sources
|
|
121
|
-
* (a Drizzle row, a raw document, an already-formatted object), so each one
|
|
122
|
-
* would otherwise hand-roll this check and they would drift on what counts.
|
|
123
|
-
*/
|
|
124
|
-
export declare function isAccountKind(value: unknown): value is AccountKind;
|
|
125
|
-
/**
|
|
126
|
-
* Every account category, by stable id.
|
|
127
|
-
*
|
|
128
|
-
* Grouped by comment for readability only; the storage, the wire and the picker
|
|
129
|
-
* all treat this as one flat list. `other` is the escape hatch for an account
|
|
130
|
-
* that fits nothing here.
|
|
131
|
-
*
|
|
132
|
-
* TO ADD ONE: append an id (lowercase ASCII, `snake_case`) here, publish
|
|
133
|
-
* `@oxy.so/contracts`, then ship a migration that widens
|
|
134
|
-
* `users_account_categories_check` — never edit an existing migration — and add
|
|
135
|
-
* an `accounts.accountCategory.<id>` label to each client's locales.
|
|
136
|
-
*
|
|
137
|
-
* TO WITHDRAW ONE: leave the id here and add it to
|
|
138
|
-
* {@link RETIRED_ACCOUNT_CATEGORY_IDS}. See rule 3 above.
|
|
139
|
-
*/
|
|
140
|
-
export declare const ACCOUNT_CATEGORY_IDS: readonly ["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", "community", "activism", "environment", "religion", "other"];
|
|
141
|
-
export type AccountCategoryId = (typeof ACCOUNT_CATEGORY_IDS)[number];
|
|
142
14
|
/**
|
|
143
15
|
* Accepts EVERY id, withdrawn ones included — see rule 3.
|
|
144
16
|
*
|
|
@@ -148,55 +20,6 @@ export type AccountCategoryId = (typeof ACCOUNT_CATEGORY_IDS)[number];
|
|
|
148
20
|
* nullable `bio` / `avatar` fix addressed, wearing a different hat.
|
|
149
21
|
*/
|
|
150
22
|
export declare const accountCategoryIdSchema: z.ZodEnum<["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", "community", "activism", "environment", "religion", "other"]>;
|
|
151
|
-
/**
|
|
152
|
-
* Ids withdrawn from the picker. Empty today.
|
|
153
|
-
*
|
|
154
|
-
* A withdrawn id keeps working everywhere it is already stored: it validates,
|
|
155
|
-
* it survives a round-trip save, it still renders from its label key, and it
|
|
156
|
-
* stays PRIMARY if it was primary. Nothing rewrites a stored list — a read-time
|
|
157
|
-
* or migration-time demotion would silently replace a choice its owner made,
|
|
158
|
-
* which is precisely what stable ids exist to prevent. The owner drops it on
|
|
159
|
-
* their next edit; until then it is honoured.
|
|
160
|
-
*
|
|
161
|
-
* What withdrawal changes is only this: the id leaves
|
|
162
|
-
* {@link SELECTABLE_ACCOUNT_CATEGORY_IDS}, so no picker offers it, and
|
|
163
|
-
* {@link newlyAddedRetiredCategories} refuses to let a write ADD it to an
|
|
164
|
-
* account that did not already have it.
|
|
165
|
-
*/
|
|
166
|
-
export declare const RETIRED_ACCOUNT_CATEGORY_IDS: readonly AccountCategoryId[];
|
|
167
|
-
/** Whether a category may still be OFFERED. A stored one is readable either way. */
|
|
168
|
-
export declare function isSelectableAccountCategoryId(id: AccountCategoryId): boolean;
|
|
169
|
-
/** The ids a picker may offer, in declaration order. */
|
|
170
|
-
export declare const SELECTABLE_ACCOUNT_CATEGORY_IDS: readonly AccountCategoryId[];
|
|
171
|
-
/**
|
|
172
|
-
* Which of `next` are withdrawn ids the account did not already carry — i.e.
|
|
173
|
-
* the ones a write must be refused for.
|
|
174
|
-
*
|
|
175
|
-
* `retired` is a parameter rather than a module read so the rule can be
|
|
176
|
-
* exercised against a non-empty set while the production one is empty; a test
|
|
177
|
-
* over `RETIRED_ACCOUNT_CATEGORY_IDS` alone would pass vacuously today and stay
|
|
178
|
-
* passing if the rule were deleted.
|
|
179
|
-
*/
|
|
180
|
-
export declare function newlyAddedRetiredCategories(next: readonly AccountCategoryId[], previous: readonly AccountCategoryId[], retired: readonly AccountCategoryId[]): AccountCategoryId[];
|
|
181
|
-
/**
|
|
182
|
-
* How many categories one account may carry.
|
|
183
|
-
*
|
|
184
|
-
* Four, not "as many as you like". Three reasons, in the order they bind:
|
|
185
|
-
*
|
|
186
|
-
* - The primary has to MEAN something. At ten categories the first element
|
|
187
|
-
* reads as a sort artifact rather than a choice, and rule 2 above is the
|
|
188
|
-
* entire mechanism by which a primary exists.
|
|
189
|
-
* - The profile RENDERS them as a row of chips; four labels of this length is
|
|
190
|
-
* what fits a phone-width profile header before the row wraps or truncates.
|
|
191
|
-
* - Four is enough to place a genuinely compound account without a tag cloud:
|
|
192
|
-
* a housing cooperative that is also a non-profit serving a local community
|
|
193
|
-
* spends `cooperative`, `nonprofit`, `community`, `real_estate` — and is the
|
|
194
|
-
* most compound real example in the ecosystem.
|
|
195
|
-
*
|
|
196
|
-
* One constant, read by the wire schema, the database CHECK and the picker, so
|
|
197
|
-
* changing it is one edit plus a migration.
|
|
198
|
-
*/
|
|
199
|
-
export declare const MAX_ACCOUNT_CATEGORIES = 4;
|
|
200
23
|
/**
|
|
201
24
|
* An account's categories on the wire. ORDER IS MEANINGFUL — index 0 is the
|
|
202
25
|
* primary (rule 2).
|
|
@@ -207,26 +30,7 @@ export declare const MAX_ACCOUNT_CATEGORIES = 4;
|
|
|
207
30
|
* property the list exists to carry. A duplicate only ever comes from a client
|
|
208
31
|
* bug, and a 400 naming the index is how that bug gets found.
|
|
209
32
|
*/
|
|
210
|
-
export declare const accountCategoriesSchema: z.ZodEffects<z.ZodArray<z.ZodEnum<["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", "community", "activism", "environment", "religion", "other"]>, "many">, ("business" | "nonprofit" | "community" | "other" | "
|
|
211
|
-
/**
|
|
212
|
-
* Kinds that may carry categories: every kind EXCEPT `personal`.
|
|
213
|
-
*
|
|
214
|
-
* A person has interests, not a sector — and their interests are not a
|
|
215
|
-
* classification anybody else gets to read off their profile. Spelled out
|
|
216
|
-
* positively, like {@link isDelegatedActAsEligibleKind} and for the same reason: a `kind
|
|
217
|
-
* !== 'personal'` test silently admits every kind invented after it was
|
|
218
|
-
* written, whereas this list forces whoever adds one to decide.
|
|
219
|
-
*/
|
|
220
|
-
export declare const ACCOUNT_CATEGORY_KINDS: readonly ["organization", "project", "bot", "channel"];
|
|
221
|
-
export type AccountCategoryKind = (typeof ACCOUNT_CATEGORY_KINDS)[number];
|
|
222
|
-
/**
|
|
223
|
-
* Whether an account of this kind may carry categories.
|
|
224
|
-
*
|
|
225
|
-
* The API refuses the write and the `users_account_categories_kind_check`
|
|
226
|
-
* constraint makes it unrepresentable; both derive from
|
|
227
|
-
* {@link ACCOUNT_CATEGORY_KINDS}, so they cannot disagree.
|
|
228
|
-
*/
|
|
229
|
-
export declare function kindAcceptsAccountCategories(kind: AccountKind | null | undefined): boolean;
|
|
33
|
+
export declare const accountCategoriesSchema: z.ZodEffects<z.ZodArray<z.ZodEnum<["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", "community", "activism", "environment", "religion", "other"]>, "many">, ("business" | "nonprofit" | "community" | "other" | "news" | "politics" | "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" | "government" | "activism" | "environment" | "religion")[], ("business" | "nonprofit" | "community" | "other" | "news" | "politics" | "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" | "government" | "activism" | "environment" | "religion")[]>;
|
|
230
34
|
/**
|
|
231
35
|
* An account's name on the create/update wire.
|
|
232
36
|
*
|
|
@@ -314,7 +118,7 @@ export declare const createAccountRequestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
314
118
|
*/
|
|
315
119
|
color: z.ZodOptional<z.ZodString>;
|
|
316
120
|
/** Ordered, PRIMARY FIRST — see rule 2 above {@link ACCOUNT_CATEGORY_IDS}. */
|
|
317
|
-
accountCategories: z.ZodOptional<z.ZodEffects<z.ZodArray<z.ZodEnum<["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", "community", "activism", "environment", "religion", "other"]>, "many">, ("business" | "nonprofit" | "community" | "other" | "
|
|
121
|
+
accountCategories: z.ZodOptional<z.ZodEffects<z.ZodArray<z.ZodEnum<["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", "community", "activism", "environment", "religion", "other"]>, "many">, ("business" | "nonprofit" | "community" | "other" | "news" | "politics" | "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" | "government" | "activism" | "environment" | "religion")[], ("business" | "nonprofit" | "community" | "other" | "news" | "politics" | "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" | "government" | "activism" | "environment" | "religion")[]>>;
|
|
318
122
|
organizationType: z.ZodOptional<z.ZodEnum<["business", "nonprofit", "public_body", "community", "other"]>>;
|
|
319
123
|
/**
|
|
320
124
|
* Create the account already opted OUT of discovery.
|
|
@@ -365,7 +169,7 @@ export declare const createAccountRequestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
365
169
|
*/
|
|
366
170
|
character: z.ZodOptional<z.ZodType<import("./avatarCharacter").AvatarCharacter, z.ZodTypeDef, unknown>>;
|
|
367
171
|
}, "strip", z.ZodTypeAny, {
|
|
368
|
-
kind: "organization" | "
|
|
172
|
+
kind: "organization" | "project" | "bot" | "channel";
|
|
369
173
|
username: string;
|
|
370
174
|
color?: string | undefined;
|
|
371
175
|
name?: {
|
|
@@ -378,11 +182,11 @@ export declare const createAccountRequestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
378
182
|
parentAccountId?: string | undefined;
|
|
379
183
|
bio?: string | undefined;
|
|
380
184
|
description?: string | undefined;
|
|
381
|
-
accountCategories?: ("business" | "nonprofit" | "community" | "other" | "
|
|
185
|
+
accountCategories?: ("business" | "nonprofit" | "community" | "other" | "news" | "politics" | "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" | "government" | "activism" | "environment" | "religion")[] | undefined;
|
|
382
186
|
isPrivateAccount?: boolean | undefined;
|
|
383
187
|
character?: import("./avatarCharacter").AvatarCharacter | undefined;
|
|
384
188
|
}, {
|
|
385
|
-
kind: "organization" | "
|
|
189
|
+
kind: "organization" | "project" | "bot" | "channel";
|
|
386
190
|
username: string;
|
|
387
191
|
color?: string | undefined;
|
|
388
192
|
name?: {
|
|
@@ -395,11 +199,11 @@ export declare const createAccountRequestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
395
199
|
parentAccountId?: string | undefined;
|
|
396
200
|
bio?: string | undefined;
|
|
397
201
|
description?: string | undefined;
|
|
398
|
-
accountCategories?: ("business" | "nonprofit" | "community" | "other" | "
|
|
202
|
+
accountCategories?: ("business" | "nonprofit" | "community" | "other" | "news" | "politics" | "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" | "government" | "activism" | "environment" | "religion")[] | undefined;
|
|
399
203
|
isPrivateAccount?: boolean | undefined;
|
|
400
204
|
character?: unknown;
|
|
401
205
|
}>, {
|
|
402
|
-
kind: "organization" | "
|
|
206
|
+
kind: "organization" | "project" | "bot" | "channel";
|
|
403
207
|
username: string;
|
|
404
208
|
color?: string | undefined;
|
|
405
209
|
name?: {
|
|
@@ -412,11 +216,11 @@ export declare const createAccountRequestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
412
216
|
parentAccountId?: string | undefined;
|
|
413
217
|
bio?: string | undefined;
|
|
414
218
|
description?: string | undefined;
|
|
415
|
-
accountCategories?: ("business" | "nonprofit" | "community" | "other" | "
|
|
219
|
+
accountCategories?: ("business" | "nonprofit" | "community" | "other" | "news" | "politics" | "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" | "government" | "activism" | "environment" | "religion")[] | undefined;
|
|
416
220
|
isPrivateAccount?: boolean | undefined;
|
|
417
221
|
character?: import("./avatarCharacter").AvatarCharacter | undefined;
|
|
418
222
|
}, {
|
|
419
|
-
kind: "organization" | "
|
|
223
|
+
kind: "organization" | "project" | "bot" | "channel";
|
|
420
224
|
username: string;
|
|
421
225
|
color?: string | undefined;
|
|
422
226
|
name?: {
|
|
@@ -429,7 +233,7 @@ export declare const createAccountRequestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
429
233
|
parentAccountId?: string | undefined;
|
|
430
234
|
bio?: string | undefined;
|
|
431
235
|
description?: string | undefined;
|
|
432
|
-
accountCategories?: ("business" | "nonprofit" | "community" | "other" | "
|
|
236
|
+
accountCategories?: ("business" | "nonprofit" | "community" | "other" | "news" | "politics" | "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" | "government" | "activism" | "environment" | "religion")[] | undefined;
|
|
433
237
|
isPrivateAccount?: boolean | undefined;
|
|
434
238
|
character?: unknown;
|
|
435
239
|
}>;
|