@oxy.so/contracts 4.12.0 → 4.14.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/.tsbuildinfo +1 -1
- package/dist/cjs/accountGraph.js +38 -4
- package/dist/cjs/avatarCharacter.js +120 -0
- package/dist/cjs/index.js +25 -14
- package/dist/cjs/organizations.js +210 -0
- package/dist/cjs/recommendations.js +3 -0
- package/dist/cjs/safety.js +15 -0
- package/dist/cjs/userResponse.js +7 -0
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/accountGraph.js +36 -2
- package/dist/esm/avatarCharacter.js +115 -0
- package/dist/esm/index.js +4 -1
- package/dist/esm/organizations.js +207 -0
- package/dist/esm/recommendations.js +3 -0
- package/dist/esm/safety.js +12 -0
- package/dist/esm/userResponse.js +7 -0
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/accountGraph.d.ts +57 -14
- package/dist/types/accountSubject.d.ts +4 -4
- package/dist/types/avatarCharacter.d.ts +57 -0
- package/dist/types/deviceDirectory.d.ts +246 -246
- package/dist/types/externalIdentity.d.ts +62 -55
- package/dist/types/index.d.ts +5 -1
- package/dist/types/organizations.d.ts +1088 -0
- package/dist/types/recommendations.d.ts +40 -28
- package/dist/types/safety.d.ts +24 -0
- package/dist/types/userResponse.d.ts +200 -102
- package/package.json +1 -1
|
@@ -207,7 +207,7 @@ export declare const MAX_ACCOUNT_CATEGORIES = 4;
|
|
|
207
207
|
* property the list exists to carry. A duplicate only ever comes from a client
|
|
208
208
|
* bug, and a 400 naming the index is how that bug gets found.
|
|
209
209
|
*/
|
|
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">, ("
|
|
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">, ("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")[], ("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")[]>;
|
|
211
211
|
/**
|
|
212
212
|
* Kinds that may carry categories: every kind EXCEPT `personal`.
|
|
213
213
|
*
|
|
@@ -227,6 +227,33 @@ export type AccountCategoryKind = (typeof ACCOUNT_CATEGORY_KINDS)[number];
|
|
|
227
227
|
* {@link ACCOUNT_CATEGORY_KINDS}, so they cannot disagree.
|
|
228
228
|
*/
|
|
229
229
|
export declare function kindAcceptsAccountCategories(kind: AccountKind | null | undefined): boolean;
|
|
230
|
+
/**
|
|
231
|
+
* An account's name on the create/update wire.
|
|
232
|
+
*
|
|
233
|
+
* `displayName` is EXPLICIT and stored, not derived. `first`/`last` model a
|
|
234
|
+
* human name, and composing a display string from them is right for a person —
|
|
235
|
+
* but a non-personal account has a TITLE, not a given and family name. Without
|
|
236
|
+
* this field the only way to name a channel "Notas de Nate" was to put the whole
|
|
237
|
+
* title in `first`, which renders correctly by accident while recording it as
|
|
238
|
+
* somebody's given name.
|
|
239
|
+
*
|
|
240
|
+
* When present it wins over the composed `first`/`last` (see the API's
|
|
241
|
+
* `composeDisplayName`, which already preferred an explicit value — only the
|
|
242
|
+
* storage for one was missing).
|
|
243
|
+
*/
|
|
244
|
+
export declare const accountNameSchema: z.ZodOptional<z.ZodObject<{
|
|
245
|
+
first: z.ZodOptional<z.ZodString>;
|
|
246
|
+
last: z.ZodOptional<z.ZodString>;
|
|
247
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
248
|
+
}, "strip", z.ZodTypeAny, {
|
|
249
|
+
first?: string | undefined;
|
|
250
|
+
last?: string | undefined;
|
|
251
|
+
displayName?: string | undefined;
|
|
252
|
+
}, {
|
|
253
|
+
first?: string | undefined;
|
|
254
|
+
last?: string | undefined;
|
|
255
|
+
displayName?: string | undefined;
|
|
256
|
+
}>>;
|
|
230
257
|
/**
|
|
231
258
|
* POST /accounts — create a non-personal account under the caller's tree.
|
|
232
259
|
*
|
|
@@ -287,7 +314,8 @@ export declare const createAccountRequestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
287
314
|
*/
|
|
288
315
|
color: z.ZodOptional<z.ZodString>;
|
|
289
316
|
/** Ordered, PRIMARY FIRST — see rule 2 above {@link ACCOUNT_CATEGORY_IDS}. */
|
|
290
|
-
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">, ("
|
|
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">, ("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")[], ("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")[]>>;
|
|
318
|
+
organizationType: z.ZodOptional<z.ZodEnum<["business", "nonprofit", "public_body", "community", "other"]>>;
|
|
291
319
|
/**
|
|
292
320
|
* Create the account already opted OUT of discovery.
|
|
293
321
|
*
|
|
@@ -329,9 +357,17 @@ export declare const createAccountRequestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
329
357
|
* remedy must not either.
|
|
330
358
|
*/
|
|
331
359
|
isPrivateAccount: z.ZodOptional<z.ZodBoolean>;
|
|
360
|
+
/**
|
|
361
|
+
* The 3D avatar character of a `bot` — and ONLY of a bot (the refinement
|
|
362
|
+
* below). Optional on the wire: a bot created without one is given a look
|
|
363
|
+
* seeded from its handle (`avatarCharacterFor`), so every bot account has a
|
|
364
|
+
* character from birth and the owner customizes it afterwards.
|
|
365
|
+
*/
|
|
366
|
+
character: z.ZodOptional<z.ZodType<import("./avatarCharacter").AvatarCharacter, z.ZodTypeDef, unknown>>;
|
|
332
367
|
}, "strip", z.ZodTypeAny, {
|
|
333
|
-
kind: "
|
|
368
|
+
kind: "organization" | "project" | "bot" | "channel";
|
|
334
369
|
username: string;
|
|
370
|
+
color?: string | undefined;
|
|
335
371
|
parentAccountId?: string | undefined;
|
|
336
372
|
name?: {
|
|
337
373
|
first?: string | undefined;
|
|
@@ -341,12 +377,14 @@ export declare const createAccountRequestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
341
377
|
bio?: string | undefined;
|
|
342
378
|
avatar?: string | undefined;
|
|
343
379
|
description?: string | undefined;
|
|
344
|
-
|
|
345
|
-
|
|
380
|
+
accountCategories?: ("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")[] | undefined;
|
|
381
|
+
organizationType?: "business" | "nonprofit" | "community" | "other" | "public_body" | undefined;
|
|
346
382
|
isPrivateAccount?: boolean | undefined;
|
|
383
|
+
character?: import("./avatarCharacter").AvatarCharacter | undefined;
|
|
347
384
|
}, {
|
|
348
|
-
kind: "
|
|
385
|
+
kind: "organization" | "project" | "bot" | "channel";
|
|
349
386
|
username: string;
|
|
387
|
+
color?: string | undefined;
|
|
350
388
|
parentAccountId?: string | undefined;
|
|
351
389
|
name?: {
|
|
352
390
|
first?: string | undefined;
|
|
@@ -356,12 +394,14 @@ export declare const createAccountRequestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
356
394
|
bio?: string | undefined;
|
|
357
395
|
avatar?: string | undefined;
|
|
358
396
|
description?: string | undefined;
|
|
359
|
-
|
|
360
|
-
|
|
397
|
+
accountCategories?: ("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")[] | undefined;
|
|
398
|
+
organizationType?: "business" | "nonprofit" | "community" | "other" | "public_body" | undefined;
|
|
361
399
|
isPrivateAccount?: boolean | undefined;
|
|
400
|
+
character?: unknown;
|
|
362
401
|
}>, {
|
|
363
|
-
kind: "
|
|
402
|
+
kind: "organization" | "project" | "bot" | "channel";
|
|
364
403
|
username: string;
|
|
404
|
+
color?: string | undefined;
|
|
365
405
|
parentAccountId?: string | undefined;
|
|
366
406
|
name?: {
|
|
367
407
|
first?: string | undefined;
|
|
@@ -371,12 +411,14 @@ export declare const createAccountRequestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
371
411
|
bio?: string | undefined;
|
|
372
412
|
avatar?: string | undefined;
|
|
373
413
|
description?: string | undefined;
|
|
374
|
-
|
|
375
|
-
|
|
414
|
+
accountCategories?: ("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")[] | undefined;
|
|
415
|
+
organizationType?: "business" | "nonprofit" | "community" | "other" | "public_body" | undefined;
|
|
376
416
|
isPrivateAccount?: boolean | undefined;
|
|
417
|
+
character?: import("./avatarCharacter").AvatarCharacter | undefined;
|
|
377
418
|
}, {
|
|
378
|
-
kind: "
|
|
419
|
+
kind: "organization" | "project" | "bot" | "channel";
|
|
379
420
|
username: string;
|
|
421
|
+
color?: string | undefined;
|
|
380
422
|
parentAccountId?: string | undefined;
|
|
381
423
|
name?: {
|
|
382
424
|
first?: string | undefined;
|
|
@@ -386,8 +428,9 @@ export declare const createAccountRequestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
386
428
|
bio?: string | undefined;
|
|
387
429
|
avatar?: string | undefined;
|
|
388
430
|
description?: string | undefined;
|
|
389
|
-
|
|
390
|
-
|
|
431
|
+
accountCategories?: ("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")[] | undefined;
|
|
432
|
+
organizationType?: "business" | "nonprofit" | "community" | "other" | "public_body" | undefined;
|
|
391
433
|
isPrivateAccount?: boolean | undefined;
|
|
434
|
+
character?: unknown;
|
|
392
435
|
}>;
|
|
393
436
|
export type CreateAccountRequest = z.infer<typeof createAccountRequestSchema>;
|
|
@@ -166,7 +166,7 @@ export declare const financialEffectAttributionSchema: z.ZodEffects<z.ZodObject<
|
|
|
166
166
|
}>;
|
|
167
167
|
}, "strict", z.ZodTypeAny, {
|
|
168
168
|
schemaVersion: 1;
|
|
169
|
-
direction: "
|
|
169
|
+
direction: "debit" | "credit";
|
|
170
170
|
subjectAccountId: string & z.BRAND<"OxyAccountId">;
|
|
171
171
|
actor: {
|
|
172
172
|
schemaVersion: 1;
|
|
@@ -176,7 +176,7 @@ export declare const financialEffectAttributionSchema: z.ZodEffects<z.ZodObject<
|
|
|
176
176
|
};
|
|
177
177
|
}, {
|
|
178
178
|
schemaVersion: 1;
|
|
179
|
-
direction: "
|
|
179
|
+
direction: "debit" | "credit";
|
|
180
180
|
subjectAccountId: string;
|
|
181
181
|
actor: {
|
|
182
182
|
schemaVersion: 1;
|
|
@@ -186,7 +186,7 @@ export declare const financialEffectAttributionSchema: z.ZodEffects<z.ZodObject<
|
|
|
186
186
|
};
|
|
187
187
|
}>, {
|
|
188
188
|
schemaVersion: 1;
|
|
189
|
-
direction: "
|
|
189
|
+
direction: "debit" | "credit";
|
|
190
190
|
subjectAccountId: string & z.BRAND<"OxyAccountId">;
|
|
191
191
|
actor: {
|
|
192
192
|
schemaVersion: 1;
|
|
@@ -196,7 +196,7 @@ export declare const financialEffectAttributionSchema: z.ZodEffects<z.ZodObject<
|
|
|
196
196
|
};
|
|
197
197
|
}, {
|
|
198
198
|
schemaVersion: 1;
|
|
199
|
-
direction: "
|
|
199
|
+
direction: "debit" | "credit";
|
|
200
200
|
subjectAccountId: string;
|
|
201
201
|
actor: {
|
|
202
202
|
schemaVersion: 1;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The 3D avatar character a `bot` account carries.
|
|
3
|
+
*
|
|
4
|
+
* ONE definition for the wire shape, its validator and the generator that picks
|
|
5
|
+
* a look for a new bot, shared by the Oxy API (which stores and serves it) and
|
|
6
|
+
* every client. It mirrors Bloom's flat `AvatarCharacter`
|
|
7
|
+
* (`@oxy.so/bloom/agent-avatar`).
|
|
8
|
+
*
|
|
9
|
+
* ## The vocabulary is Bloom's and is NOT enforced here
|
|
10
|
+
*
|
|
11
|
+
* Bloom is a React Native package this one cannot depend on, so the ids a
|
|
12
|
+
* character is made of are restated below as a curated SUBSET, only to PICK a
|
|
13
|
+
* look for a new bot ({@link avatarCharacterFor}). A STORED character is never
|
|
14
|
+
* checked against them: validating against a stale copy of somebody else's
|
|
15
|
+
* catalogue is how a working look starts being refused. What the schema checks
|
|
16
|
+
* is the SHAPE of what a client writes: only the keys a character has, each an
|
|
17
|
+
* id-like string, a `#rrggbb` paint, a spacing in range. The client resolves
|
|
18
|
+
* the ids and falls back on a default look for one it cannot draw.
|
|
19
|
+
*/
|
|
20
|
+
import { z } from 'zod';
|
|
21
|
+
/** The flat shape of Bloom's `AvatarCharacter`; every field is optional (a preset supplies the rest). */
|
|
22
|
+
export interface AvatarCharacter {
|
|
23
|
+
preset?: string;
|
|
24
|
+
shape?: string;
|
|
25
|
+
eyes?: string;
|
|
26
|
+
eyewear?: string;
|
|
27
|
+
accessory?: string;
|
|
28
|
+
/** Named paint. */
|
|
29
|
+
color?: string;
|
|
30
|
+
/** Exact paint, `#rrggbb`; it wins over `color`. */
|
|
31
|
+
bodyColor?: string;
|
|
32
|
+
/** A multiplier (0.5 to 1.5) on the shape's eye separation. */
|
|
33
|
+
eyeSpacing?: number;
|
|
34
|
+
}
|
|
35
|
+
/** Bounds of {@link AvatarCharacter.eyeSpacing}. */
|
|
36
|
+
export declare const AVATAR_EYE_SPACING: {
|
|
37
|
+
readonly min: 0.5;
|
|
38
|
+
readonly max: 1.5;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* A character a client sends. `.strict()` so a misspelled field is a refusal
|
|
42
|
+
* now rather than a look that never takes effect. A character with nothing in
|
|
43
|
+
* it draws nothing: it needs a preset, or a shape and a paint.
|
|
44
|
+
*/
|
|
45
|
+
export declare const avatarCharacterSchema: z.ZodType<AvatarCharacter, z.ZodTypeDef, unknown>;
|
|
46
|
+
/** The validated character, or `null` for anything that is not one. */
|
|
47
|
+
export declare function parseAvatarCharacter(value: unknown): AvatarCharacter | null;
|
|
48
|
+
/** The parts a new bot's look is picked from: the plain, friendly shapes, in the editor's order. */
|
|
49
|
+
export declare const AVATAR_PICKABLE_SHAPES: readonly ["rounded_triangle", "capsule", "rounded_head_two_ears", "six_lobed_flower", "heart", "four_lobed_butterfly", "circle_two_ears", "twelve_scalloped_rosette", "rounded_cube", "rounded_diamond", "slender", "pocket", "petal", "star", "cloud", "shield", "pebble", "squircle"];
|
|
50
|
+
/** Bloom's named paints. */
|
|
51
|
+
export declare const AVATAR_PICKABLE_COLORS: readonly ["pink", "orchid", "violet", "blue", "cyan", "teal", "lime", "yellow", "coral"];
|
|
52
|
+
/**
|
|
53
|
+
* A look for a new bot, picked from its seed (its handle): a shape and a paint,
|
|
54
|
+
* plain oval eyes, nothing on its head. Stable — the same seed is the same look
|
|
55
|
+
* — and the owner changes it afterwards.
|
|
56
|
+
*/
|
|
57
|
+
export declare function avatarCharacterFor(seed: string): AvatarCharacter;
|