@oxy.so/contracts 1.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/LICENSE +202 -0
- package/NOTICE +16 -0
- package/dist/cjs/.tsbuildinfo +1 -0
- package/dist/cjs/accountGraph.js +489 -0
- package/dist/cjs/agency.js +439 -0
- package/dist/cjs/browserHub.js +215 -0
- package/dist/cjs/civic.js +163 -0
- package/dist/cjs/commonsSignIn.js +59 -0
- package/dist/cjs/deviceBoot.js +50 -0
- package/dist/cjs/deviceDirectory.js +189 -0
- package/dist/cjs/devicePairing.js +138 -0
- package/dist/cjs/deviceSession.js +164 -0
- package/dist/cjs/emailAgentContext.js +32 -0
- package/dist/cjs/followGraph.js +28 -0
- package/dist/cjs/identity.js +258 -0
- package/dist/cjs/inboxPush.js +24 -0
- package/dist/cjs/index.js +618 -0
- package/dist/cjs/inference/accountBilling.js +334 -0
- package/dist/cjs/inference/aliaModelRelease.js +262 -0
- package/dist/cjs/inference/attribution.js +106 -0
- package/dist/cjs/inference/catalogue.js +487 -0
- package/dist/cjs/inference/entitlement.js +217 -0
- package/dist/cjs/inference/errors.js +309 -0
- package/dist/cjs/inference/identifiers.js +224 -0
- package/dist/cjs/inference/inbox.js +105 -0
- package/dist/cjs/inference/modelDocumentation.js +433 -0
- package/dist/cjs/inference/money.js +188 -0
- package/dist/cjs/inference/priceVersion.js +110 -0
- package/dist/cjs/inference/providerConnection.js +455 -0
- package/dist/cjs/inference/request.js +477 -0
- package/dist/cjs/inference/routingPolicy.js +318 -0
- package/dist/cjs/inference/streamEvents.js +258 -0
- package/dist/cjs/inference/usage.js +329 -0
- package/dist/cjs/inference/version.js +105 -0
- package/dist/cjs/keyRecovery.js +91 -0
- package/dist/cjs/keyRotation.js +75 -0
- package/dist/cjs/links.js +68 -0
- package/dist/cjs/moderationReputation.js +298 -0
- package/dist/cjs/oauth.js +66 -0
- package/dist/cjs/oxyRecordTypes.js +71 -0
- package/dist/cjs/protocol.js +53 -0
- package/dist/cjs/recommendations.js +168 -0
- package/dist/cjs/reputation.js +297 -0
- package/dist/cjs/sessionStatus.js +121 -0
- package/dist/cjs/transparency.js +89 -0
- package/dist/cjs/updates.js +252 -0
- package/dist/cjs/userInvalidation.js +89 -0
- package/dist/cjs/userResponse.js +245 -0
- package/dist/cjs/username.js +290 -0
- package/dist/cjs/webauthn.js +71 -0
- package/dist/esm/.tsbuildinfo +1 -0
- package/dist/esm/accountGraph.js +480 -0
- package/dist/esm/agency.js +436 -0
- package/dist/esm/browserHub.js +212 -0
- package/dist/esm/civic.js +160 -0
- package/dist/esm/commonsSignIn.js +56 -0
- package/dist/esm/deviceBoot.js +47 -0
- package/dist/esm/deviceDirectory.js +186 -0
- package/dist/esm/devicePairing.js +135 -0
- package/dist/esm/deviceSession.js +161 -0
- package/dist/esm/emailAgentContext.js +29 -0
- package/dist/esm/followGraph.js +27 -0
- package/dist/esm/identity.js +255 -0
- package/dist/esm/inboxPush.js +21 -0
- package/dist/esm/index.js +172 -0
- package/dist/esm/inference/accountBilling.js +331 -0
- package/dist/esm/inference/aliaModelRelease.js +259 -0
- package/dist/esm/inference/attribution.js +103 -0
- package/dist/esm/inference/catalogue.js +484 -0
- package/dist/esm/inference/entitlement.js +214 -0
- package/dist/esm/inference/errors.js +306 -0
- package/dist/esm/inference/identifiers.js +221 -0
- package/dist/esm/inference/inbox.js +102 -0
- package/dist/esm/inference/modelDocumentation.js +430 -0
- package/dist/esm/inference/money.js +185 -0
- package/dist/esm/inference/priceVersion.js +107 -0
- package/dist/esm/inference/providerConnection.js +452 -0
- package/dist/esm/inference/request.js +474 -0
- package/dist/esm/inference/routingPolicy.js +315 -0
- package/dist/esm/inference/streamEvents.js +255 -0
- package/dist/esm/inference/usage.js +326 -0
- package/dist/esm/inference/version.js +102 -0
- package/dist/esm/keyRecovery.js +88 -0
- package/dist/esm/keyRotation.js +72 -0
- package/dist/esm/links.js +65 -0
- package/dist/esm/moderationReputation.js +295 -0
- package/dist/esm/oauth.js +63 -0
- package/dist/esm/oxyRecordTypes.js +68 -0
- package/dist/esm/protocol.js +50 -0
- package/dist/esm/recommendations.js +165 -0
- package/dist/esm/reputation.js +293 -0
- package/dist/esm/sessionStatus.js +118 -0
- package/dist/esm/transparency.js +86 -0
- package/dist/esm/updates.js +249 -0
- package/dist/esm/userInvalidation.js +85 -0
- package/dist/esm/userResponse.js +240 -0
- package/dist/esm/username.js +283 -0
- package/dist/esm/webauthn.js +68 -0
- package/dist/types/.tsbuildinfo +1 -0
- package/dist/types/accountGraph.d.ts +378 -0
- package/dist/types/agency.d.ts +2162 -0
- package/dist/types/browserHub.d.ts +856 -0
- package/dist/types/civic.d.ts +338 -0
- package/dist/types/commonsSignIn.d.ts +58 -0
- package/dist/types/deviceBoot.d.ts +74 -0
- package/dist/types/deviceDirectory.d.ts +1317 -0
- package/dist/types/devicePairing.d.ts +130 -0
- package/dist/types/deviceSession.d.ts +411 -0
- package/dist/types/emailAgentContext.d.ts +248 -0
- package/dist/types/followGraph.d.ts +150 -0
- package/dist/types/identity.d.ts +402 -0
- package/dist/types/inboxPush.d.ts +30 -0
- package/dist/types/index.d.ts +100 -0
- package/dist/types/inference/accountBilling.d.ts +738 -0
- package/dist/types/inference/aliaModelRelease.d.ts +609 -0
- package/dist/types/inference/attribution.d.ts +176 -0
- package/dist/types/inference/catalogue.d.ts +1618 -0
- package/dist/types/inference/entitlement.d.ts +519 -0
- package/dist/types/inference/errors.d.ts +242 -0
- package/dist/types/inference/identifiers.d.ts +182 -0
- package/dist/types/inference/inbox.d.ts +374 -0
- package/dist/types/inference/modelDocumentation.d.ts +1603 -0
- package/dist/types/inference/money.d.ts +185 -0
- package/dist/types/inference/priceVersion.d.ts +182 -0
- package/dist/types/inference/providerConnection.d.ts +968 -0
- package/dist/types/inference/request.d.ts +2800 -0
- package/dist/types/inference/routingPolicy.d.ts +616 -0
- package/dist/types/inference/streamEvents.d.ts +950 -0
- package/dist/types/inference/usage.d.ts +1164 -0
- package/dist/types/inference/version.d.ts +102 -0
- package/dist/types/keyRecovery.d.ts +138 -0
- package/dist/types/keyRotation.d.ts +103 -0
- package/dist/types/links.d.ts +96 -0
- package/dist/types/moderationReputation.d.ts +487 -0
- package/dist/types/oauth.d.ts +86 -0
- package/dist/types/oxyRecordTypes.d.ts +62 -0
- package/dist/types/protocol.d.ts +86 -0
- package/dist/types/recommendations.d.ts +542 -0
- package/dist/types/reputation.d.ts +457 -0
- package/dist/types/sessionStatus.d.ts +231 -0
- package/dist/types/transparency.d.ts +392 -0
- package/dist/types/updates.d.ts +545 -0
- package/dist/types/userInvalidation.d.ts +94 -0
- package/dist/types/userResponse.d.ts +1706 -0
- package/dist/types/username.d.ts +265 -0
- package/dist/types/webauthn.d.ts +77 -0
- package/package.json +87 -0
|
@@ -0,0 +1,1706 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical API user-response contracts.
|
|
3
|
+
*
|
|
4
|
+
* SINGLE SOURCE OF TRUTH for the wire shape of every user object the API emits
|
|
5
|
+
* and every consumer (the auth app, services, accounts) parses. The API
|
|
6
|
+
* validates its OUTPUT against these schemas; web/RN consumers validate their
|
|
7
|
+
* INPUT against the same schemas. Because there is exactly one definition, the
|
|
8
|
+
* producer and the consumers cannot drift — the class of bugs that motivated
|
|
9
|
+
* this module (the auth app's local Zod schema requiring `name` to be a plain
|
|
10
|
+
* string, dropping every account that had a structured name) is impossible.
|
|
11
|
+
*
|
|
12
|
+
* This package (`@oxy.so/contracts`) is the dedicated, zero-dependency home for
|
|
13
|
+
* these contracts so the backend (`@oxy.so/api`) and the client SDKs
|
|
14
|
+
* (`@oxy.so/core`, `@oxy.so/services`) can all depend on it without
|
|
15
|
+
* the backend having to depend on a client SDK to obtain its schemas.
|
|
16
|
+
*
|
|
17
|
+
* Faithful to the producers:
|
|
18
|
+
* - `packages/api/src/utils/userTransform.ts` `formatUserResponse` — the
|
|
19
|
+
* canonical serialization used by login/signup, device sessions, etc.
|
|
20
|
+
* Emits `id` (NOT `_id`), forwards `username` verbatim (may be absent), and
|
|
21
|
+
* emits `name` as the structured `{ first, last, full, displayName }`
|
|
22
|
+
* subdocument.
|
|
23
|
+
* - `packages/api/src/models/User.ts` — `NameSchema` (`first`/`last` default
|
|
24
|
+
* `''`; `full` and `displayName` are Mongoose VIRTUALS. Formatted API
|
|
25
|
+
* responses compose both fields, while raw-document responses may omit the
|
|
26
|
+
* virtuals if the query did not materialise them.
|
|
27
|
+
*
|
|
28
|
+
* Platform-agnostic — zod only, no react/react-native/expo. ESM-safe (no
|
|
29
|
+
* `require()`).
|
|
30
|
+
*/
|
|
31
|
+
import { z } from 'zod';
|
|
32
|
+
/**
|
|
33
|
+
* Structured human name subdocument. Mirrors `User.name` (`NameSchema`).
|
|
34
|
+
*
|
|
35
|
+
* - `first` / `last` default to `''` in Mongo, so they are optional on the wire.
|
|
36
|
+
* - `full` is a Mongoose virtual — absent unless the query materialised
|
|
37
|
+
* virtuals or the serializer composed it.
|
|
38
|
+
* - `displayName` is the canonical app-facing display string when present.
|
|
39
|
+
* It is OPTIONAL on the wire: the API still synthesizes a default today, but
|
|
40
|
+
* the contract no longer guarantees it, so consumers fall back to a handle
|
|
41
|
+
* (e.g. `getNormalizedUserHandle`) when it is absent.
|
|
42
|
+
*
|
|
43
|
+
* This is declared as an explicit `interface` rather than being inferred from
|
|
44
|
+
* the runtime schema via `z.infer<typeof userNameSchema>`. Inferring it produced
|
|
45
|
+
* a `z.objectOutputType<…, "passthrough">` in the emitted `.d.ts`, whose
|
|
46
|
+
* resolution to the named fields depends on zod's deep conditional-type
|
|
47
|
+
* machinery (`objectUtil.addQuestionMarks` / `flatten` / `PassthroughType`).
|
|
48
|
+
* Under a consumer's `moduleResolution: "node"` (node10), that chain does not
|
|
49
|
+
* always resolve, so `name.displayName` silently widened to `{}` and broke the
|
|
50
|
+
* "render `name.displayName` directly" contract at the type level. An explicit
|
|
51
|
+
* interface emits `displayName?: string` literally and survives BOTH `node` and
|
|
52
|
+
* `bundler` resolution. The index signature preserves the passthrough behaviour
|
|
53
|
+
* (additive name fields are tolerated without a coordinated contract bump).
|
|
54
|
+
*/
|
|
55
|
+
export interface UserNameResponse {
|
|
56
|
+
first?: string;
|
|
57
|
+
last?: string;
|
|
58
|
+
full?: string;
|
|
59
|
+
/** Canonical display string when present — render this directly. */
|
|
60
|
+
displayName?: string;
|
|
61
|
+
[key: string]: unknown;
|
|
62
|
+
}
|
|
63
|
+
export declare const userNameSchema: z.ZodType<UserNameResponse>;
|
|
64
|
+
/**
|
|
65
|
+
* The authenticated viewer's relationship to a fetched profile.
|
|
66
|
+
*
|
|
67
|
+
* Rides the SINGLE-profile fetch (profile-by-username / profile-by-id) so
|
|
68
|
+
* consumers get follow state without a second round-trip. Present ONLY when the
|
|
69
|
+
* request is authenticated (the viewer id is known) — OMITTED entirely for
|
|
70
|
+
* anonymous requests, so a consumer can distinguish "unknown" (field absent)
|
|
71
|
+
* from "known, not following" (`isFollowing: false`).
|
|
72
|
+
*/
|
|
73
|
+
export interface UserRelationship {
|
|
74
|
+
/** The viewer follows this profile (viewer → target). */
|
|
75
|
+
isFollowing: boolean;
|
|
76
|
+
/** This profile follows the viewer (target → viewer). */
|
|
77
|
+
followsYou: boolean;
|
|
78
|
+
}
|
|
79
|
+
export declare const userRelationshipSchema: z.ZodType<UserRelationship>;
|
|
80
|
+
/**
|
|
81
|
+
* Portable per-account theme preference, applied across every Oxy app.
|
|
82
|
+
*
|
|
83
|
+
* Persisted on the Oxy user document and projected onto the self/session
|
|
84
|
+
* payload the SDK already loads during cold boot, so Bloom can theme on first
|
|
85
|
+
* paint with ZERO extra network call. `colorPreset` is a Bloom preset KEY
|
|
86
|
+
* (e.g. `"blue"`) — never raw colors.
|
|
87
|
+
*/
|
|
88
|
+
export interface ThemePreference {
|
|
89
|
+
mode: 'light' | 'dark' | 'system';
|
|
90
|
+
colorPreset: string;
|
|
91
|
+
}
|
|
92
|
+
export declare const themePreferenceSchema: z.ZodType<ThemePreference>;
|
|
93
|
+
/**
|
|
94
|
+
* The canonical user object emitted by `formatUserResponse`.
|
|
95
|
+
*
|
|
96
|
+
* `id` is present on formatted user DTOs. `name.displayName` is OPTIONAL on the
|
|
97
|
+
* contract — the API still synthesizes a default today, but consumers must not
|
|
98
|
+
* assume it is present and should fall back to a handle when it is absent. The
|
|
99
|
+
* rest is forwarded from the user document and may be absent depending on the query's
|
|
100
|
+
* `.select(...)`/`.lean()` projection. Both `id` and `_id` are accepted because
|
|
101
|
+
* some raw-document responses carry `_id` instead of `id`; resolve the
|
|
102
|
+
* identifier with {@link resolveUserId}.
|
|
103
|
+
*
|
|
104
|
+
* `.passthrough()` keeps the large tail of profile fields
|
|
105
|
+
* (`privacySettings`, `locations`, `links`, `linksMetadata`, `bio`,
|
|
106
|
+
* `description`, `languages`, `verified`, timestamps, …) available to callers
|
|
107
|
+
* that need them without enumerating every nested shape here — the load-bearing
|
|
108
|
+
* identity/display fields are the ones we pin precisely.
|
|
109
|
+
*/
|
|
110
|
+
export declare const userResponseSchema: z.ZodObject<{
|
|
111
|
+
/** MongoDB ObjectId as a string. Present on `formatUserResponse` output. */
|
|
112
|
+
id: z.ZodOptional<z.ZodString>;
|
|
113
|
+
/** Raw-document id (e.g. `GET /users/me`). Present when `id` is not. */
|
|
114
|
+
_id: z.ZodOptional<z.ZodString>;
|
|
115
|
+
publicKey: z.ZodOptional<z.ZodString>;
|
|
116
|
+
username: z.ZodOptional<z.ZodString>;
|
|
117
|
+
email: z.ZodOptional<z.ZodString>;
|
|
118
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
119
|
+
address: z.ZodOptional<z.ZodString>;
|
|
120
|
+
birthday: z.ZodOptional<z.ZodString>;
|
|
121
|
+
/** Avatar file id (string) or null. */
|
|
122
|
+
avatar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
123
|
+
/** Named Bloom color preset (e.g. `"blue"`) or null. */
|
|
124
|
+
color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
125
|
+
name: z.ZodType<UserNameResponse, z.ZodTypeDef, UserNameResponse>;
|
|
126
|
+
verified: z.ZodOptional<z.ZodBoolean>;
|
|
127
|
+
/**
|
|
128
|
+
* The account's languages as full BCP-47 locales (`language-REGION`,
|
|
129
|
+
* e.g. `es-ES`, `en-US`, `pt-BR`), ordered with the PRIMARY (UI) locale
|
|
130
|
+
* first. `languages[0]` is the primary locale — there is no singular
|
|
131
|
+
* `language` field.
|
|
132
|
+
*/
|
|
133
|
+
languages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
134
|
+
/**
|
|
135
|
+
* The account's self-sovereign identifier
|
|
136
|
+
* (`did:web:<FEDERATION_DOMAIN>:u:<userId>`). Surfaced as a `User`
|
|
137
|
+
* virtual; present on formatted DTOs once the identity layer is live.
|
|
138
|
+
*/
|
|
139
|
+
did: z.ZodOptional<z.ZodString>;
|
|
140
|
+
/**
|
|
141
|
+
* Proven domain-ownership badges. Each is a {@link verifiedDomainSchema}
|
|
142
|
+
* entry; present only when the account has verified at least one domain.
|
|
143
|
+
*/
|
|
144
|
+
verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
|
|
145
|
+
/**
|
|
146
|
+
* Account-graph classification — what KIND of account this is.
|
|
147
|
+
*
|
|
148
|
+
* ORTHOGONAL to `type` (`local` / `federated` / `agent` / `automated`),
|
|
149
|
+
* which says where the account lives and how it is driven; the two
|
|
150
|
+
* coexist and neither substitutes for the other. A `channel` is a
|
|
151
|
+
* publishing identity nobody can act as, so a consumer that renders
|
|
152
|
+
* authored content reads THIS to tell a channel's post from a person's.
|
|
153
|
+
*
|
|
154
|
+
* Optional because a DTO produced from a source that never carried the
|
|
155
|
+
* column omits it; absent should be read as `personal`, the column's
|
|
156
|
+
* default, not as unknown.
|
|
157
|
+
*/
|
|
158
|
+
kind: z.ZodOptional<z.ZodEnum<["personal", "organization", "project", "bot", "channel"]>>;
|
|
159
|
+
/**
|
|
160
|
+
* What this account is about — the field a profile screen RENDERS.
|
|
161
|
+
*
|
|
162
|
+
* **Ordered, primary first.** `accountCategories[0]` is the primary
|
|
163
|
+
* category; there is deliberately no sibling `primaryCategory` field,
|
|
164
|
+
* because two representations of one fact can disagree (see rule 2 in
|
|
165
|
+
* `accountGraph.ts`). Nothing downstream may sort, de-duplicate or
|
|
166
|
+
* otherwise reorder this array.
|
|
167
|
+
*
|
|
168
|
+
* **Ids, never labels.** Each element is a stable slug; the visible text
|
|
169
|
+
* comes from the reader's own translation catalogue, keyed
|
|
170
|
+
* `accounts.accountCategory.<id>`. A label on the wire would paint every
|
|
171
|
+
* profile in the language of whoever picked it.
|
|
172
|
+
*
|
|
173
|
+
* Absent when the account has none — which is every `personal` account,
|
|
174
|
+
* and any non-personal one that has not chosen. A renderer reads
|
|
175
|
+
* `user.accountCategories ?? []`.
|
|
176
|
+
*/
|
|
177
|
+
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")[]>>;
|
|
178
|
+
/**
|
|
179
|
+
* The authenticated viewer's relationship to this profile. Present ONLY
|
|
180
|
+
* on single-profile fetches (`GET /profiles/username/:username`,
|
|
181
|
+
* `GET /users/:userId`) when the request is authenticated; OMITTED for
|
|
182
|
+
* anonymous requests and for the bulk `POST /users/by-ids` fan-out.
|
|
183
|
+
*/
|
|
184
|
+
relationship: z.ZodOptional<z.ZodType<UserRelationship, z.ZodTypeDef, UserRelationship>>;
|
|
185
|
+
/**
|
|
186
|
+
* Portable theme preference. Rides the self/session payload (cold boot),
|
|
187
|
+
* so it is present on the current-user DTO (`GET /users/me`,
|
|
188
|
+
* `GET /session/user/:sessionId`) and absent until the user sets it.
|
|
189
|
+
*/
|
|
190
|
+
themePreference: z.ZodOptional<z.ZodType<ThemePreference, z.ZodTypeDef, ThemePreference>>;
|
|
191
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
192
|
+
/** MongoDB ObjectId as a string. Present on `formatUserResponse` output. */
|
|
193
|
+
id: z.ZodOptional<z.ZodString>;
|
|
194
|
+
/** Raw-document id (e.g. `GET /users/me`). Present when `id` is not. */
|
|
195
|
+
_id: z.ZodOptional<z.ZodString>;
|
|
196
|
+
publicKey: z.ZodOptional<z.ZodString>;
|
|
197
|
+
username: z.ZodOptional<z.ZodString>;
|
|
198
|
+
email: z.ZodOptional<z.ZodString>;
|
|
199
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
200
|
+
address: z.ZodOptional<z.ZodString>;
|
|
201
|
+
birthday: z.ZodOptional<z.ZodString>;
|
|
202
|
+
/** Avatar file id (string) or null. */
|
|
203
|
+
avatar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
204
|
+
/** Named Bloom color preset (e.g. `"blue"`) or null. */
|
|
205
|
+
color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
206
|
+
name: z.ZodType<UserNameResponse, z.ZodTypeDef, UserNameResponse>;
|
|
207
|
+
verified: z.ZodOptional<z.ZodBoolean>;
|
|
208
|
+
/**
|
|
209
|
+
* The account's languages as full BCP-47 locales (`language-REGION`,
|
|
210
|
+
* e.g. `es-ES`, `en-US`, `pt-BR`), ordered with the PRIMARY (UI) locale
|
|
211
|
+
* first. `languages[0]` is the primary locale — there is no singular
|
|
212
|
+
* `language` field.
|
|
213
|
+
*/
|
|
214
|
+
languages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
215
|
+
/**
|
|
216
|
+
* The account's self-sovereign identifier
|
|
217
|
+
* (`did:web:<FEDERATION_DOMAIN>:u:<userId>`). Surfaced as a `User`
|
|
218
|
+
* virtual; present on formatted DTOs once the identity layer is live.
|
|
219
|
+
*/
|
|
220
|
+
did: z.ZodOptional<z.ZodString>;
|
|
221
|
+
/**
|
|
222
|
+
* Proven domain-ownership badges. Each is a {@link verifiedDomainSchema}
|
|
223
|
+
* entry; present only when the account has verified at least one domain.
|
|
224
|
+
*/
|
|
225
|
+
verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
|
|
226
|
+
/**
|
|
227
|
+
* Account-graph classification — what KIND of account this is.
|
|
228
|
+
*
|
|
229
|
+
* ORTHOGONAL to `type` (`local` / `federated` / `agent` / `automated`),
|
|
230
|
+
* which says where the account lives and how it is driven; the two
|
|
231
|
+
* coexist and neither substitutes for the other. A `channel` is a
|
|
232
|
+
* publishing identity nobody can act as, so a consumer that renders
|
|
233
|
+
* authored content reads THIS to tell a channel's post from a person's.
|
|
234
|
+
*
|
|
235
|
+
* Optional because a DTO produced from a source that never carried the
|
|
236
|
+
* column omits it; absent should be read as `personal`, the column's
|
|
237
|
+
* default, not as unknown.
|
|
238
|
+
*/
|
|
239
|
+
kind: z.ZodOptional<z.ZodEnum<["personal", "organization", "project", "bot", "channel"]>>;
|
|
240
|
+
/**
|
|
241
|
+
* What this account is about — the field a profile screen RENDERS.
|
|
242
|
+
*
|
|
243
|
+
* **Ordered, primary first.** `accountCategories[0]` is the primary
|
|
244
|
+
* category; there is deliberately no sibling `primaryCategory` field,
|
|
245
|
+
* because two representations of one fact can disagree (see rule 2 in
|
|
246
|
+
* `accountGraph.ts`). Nothing downstream may sort, de-duplicate or
|
|
247
|
+
* otherwise reorder this array.
|
|
248
|
+
*
|
|
249
|
+
* **Ids, never labels.** Each element is a stable slug; the visible text
|
|
250
|
+
* comes from the reader's own translation catalogue, keyed
|
|
251
|
+
* `accounts.accountCategory.<id>`. A label on the wire would paint every
|
|
252
|
+
* profile in the language of whoever picked it.
|
|
253
|
+
*
|
|
254
|
+
* Absent when the account has none — which is every `personal` account,
|
|
255
|
+
* and any non-personal one that has not chosen. A renderer reads
|
|
256
|
+
* `user.accountCategories ?? []`.
|
|
257
|
+
*/
|
|
258
|
+
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")[]>>;
|
|
259
|
+
/**
|
|
260
|
+
* The authenticated viewer's relationship to this profile. Present ONLY
|
|
261
|
+
* on single-profile fetches (`GET /profiles/username/:username`,
|
|
262
|
+
* `GET /users/:userId`) when the request is authenticated; OMITTED for
|
|
263
|
+
* anonymous requests and for the bulk `POST /users/by-ids` fan-out.
|
|
264
|
+
*/
|
|
265
|
+
relationship: z.ZodOptional<z.ZodType<UserRelationship, z.ZodTypeDef, UserRelationship>>;
|
|
266
|
+
/**
|
|
267
|
+
* Portable theme preference. Rides the self/session payload (cold boot),
|
|
268
|
+
* so it is present on the current-user DTO (`GET /users/me`,
|
|
269
|
+
* `GET /session/user/:sessionId`) and absent until the user sets it.
|
|
270
|
+
*/
|
|
271
|
+
themePreference: z.ZodOptional<z.ZodType<ThemePreference, z.ZodTypeDef, ThemePreference>>;
|
|
272
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
273
|
+
/** MongoDB ObjectId as a string. Present on `formatUserResponse` output. */
|
|
274
|
+
id: z.ZodOptional<z.ZodString>;
|
|
275
|
+
/** Raw-document id (e.g. `GET /users/me`). Present when `id` is not. */
|
|
276
|
+
_id: z.ZodOptional<z.ZodString>;
|
|
277
|
+
publicKey: z.ZodOptional<z.ZodString>;
|
|
278
|
+
username: z.ZodOptional<z.ZodString>;
|
|
279
|
+
email: z.ZodOptional<z.ZodString>;
|
|
280
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
281
|
+
address: z.ZodOptional<z.ZodString>;
|
|
282
|
+
birthday: z.ZodOptional<z.ZodString>;
|
|
283
|
+
/** Avatar file id (string) or null. */
|
|
284
|
+
avatar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
285
|
+
/** Named Bloom color preset (e.g. `"blue"`) or null. */
|
|
286
|
+
color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
287
|
+
name: z.ZodType<UserNameResponse, z.ZodTypeDef, UserNameResponse>;
|
|
288
|
+
verified: z.ZodOptional<z.ZodBoolean>;
|
|
289
|
+
/**
|
|
290
|
+
* The account's languages as full BCP-47 locales (`language-REGION`,
|
|
291
|
+
* e.g. `es-ES`, `en-US`, `pt-BR`), ordered with the PRIMARY (UI) locale
|
|
292
|
+
* first. `languages[0]` is the primary locale — there is no singular
|
|
293
|
+
* `language` field.
|
|
294
|
+
*/
|
|
295
|
+
languages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
296
|
+
/**
|
|
297
|
+
* The account's self-sovereign identifier
|
|
298
|
+
* (`did:web:<FEDERATION_DOMAIN>:u:<userId>`). Surfaced as a `User`
|
|
299
|
+
* virtual; present on formatted DTOs once the identity layer is live.
|
|
300
|
+
*/
|
|
301
|
+
did: z.ZodOptional<z.ZodString>;
|
|
302
|
+
/**
|
|
303
|
+
* Proven domain-ownership badges. Each is a {@link verifiedDomainSchema}
|
|
304
|
+
* entry; present only when the account has verified at least one domain.
|
|
305
|
+
*/
|
|
306
|
+
verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
|
|
307
|
+
/**
|
|
308
|
+
* Account-graph classification — what KIND of account this is.
|
|
309
|
+
*
|
|
310
|
+
* ORTHOGONAL to `type` (`local` / `federated` / `agent` / `automated`),
|
|
311
|
+
* which says where the account lives and how it is driven; the two
|
|
312
|
+
* coexist and neither substitutes for the other. A `channel` is a
|
|
313
|
+
* publishing identity nobody can act as, so a consumer that renders
|
|
314
|
+
* authored content reads THIS to tell a channel's post from a person's.
|
|
315
|
+
*
|
|
316
|
+
* Optional because a DTO produced from a source that never carried the
|
|
317
|
+
* column omits it; absent should be read as `personal`, the column's
|
|
318
|
+
* default, not as unknown.
|
|
319
|
+
*/
|
|
320
|
+
kind: z.ZodOptional<z.ZodEnum<["personal", "organization", "project", "bot", "channel"]>>;
|
|
321
|
+
/**
|
|
322
|
+
* What this account is about — the field a profile screen RENDERS.
|
|
323
|
+
*
|
|
324
|
+
* **Ordered, primary first.** `accountCategories[0]` is the primary
|
|
325
|
+
* category; there is deliberately no sibling `primaryCategory` field,
|
|
326
|
+
* because two representations of one fact can disagree (see rule 2 in
|
|
327
|
+
* `accountGraph.ts`). Nothing downstream may sort, de-duplicate or
|
|
328
|
+
* otherwise reorder this array.
|
|
329
|
+
*
|
|
330
|
+
* **Ids, never labels.** Each element is a stable slug; the visible text
|
|
331
|
+
* comes from the reader's own translation catalogue, keyed
|
|
332
|
+
* `accounts.accountCategory.<id>`. A label on the wire would paint every
|
|
333
|
+
* profile in the language of whoever picked it.
|
|
334
|
+
*
|
|
335
|
+
* Absent when the account has none — which is every `personal` account,
|
|
336
|
+
* and any non-personal one that has not chosen. A renderer reads
|
|
337
|
+
* `user.accountCategories ?? []`.
|
|
338
|
+
*/
|
|
339
|
+
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")[]>>;
|
|
340
|
+
/**
|
|
341
|
+
* The authenticated viewer's relationship to this profile. Present ONLY
|
|
342
|
+
* on single-profile fetches (`GET /profiles/username/:username`,
|
|
343
|
+
* `GET /users/:userId`) when the request is authenticated; OMITTED for
|
|
344
|
+
* anonymous requests and for the bulk `POST /users/by-ids` fan-out.
|
|
345
|
+
*/
|
|
346
|
+
relationship: z.ZodOptional<z.ZodType<UserRelationship, z.ZodTypeDef, UserRelationship>>;
|
|
347
|
+
/**
|
|
348
|
+
* Portable theme preference. Rides the self/session payload (cold boot),
|
|
349
|
+
* so it is present on the current-user DTO (`GET /users/me`,
|
|
350
|
+
* `GET /session/user/:sessionId`) and absent until the user sets it.
|
|
351
|
+
*/
|
|
352
|
+
themePreference: z.ZodOptional<z.ZodType<ThemePreference, z.ZodTypeDef, ThemePreference>>;
|
|
353
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
354
|
+
export type UserResponse = z.infer<typeof userResponseSchema>;
|
|
355
|
+
export declare const userProfileUpdateSchema: z.ZodObject<{
|
|
356
|
+
name: z.ZodOptional<z.ZodObject<{
|
|
357
|
+
first: z.ZodOptional<z.ZodString>;
|
|
358
|
+
last: z.ZodOptional<z.ZodString>;
|
|
359
|
+
/**
|
|
360
|
+
* Explicit display name, stored rather than composed. Wins over
|
|
361
|
+
* `first`/`last` when set; send `''` to clear it and fall back
|
|
362
|
+
* to the composed pair.
|
|
363
|
+
*/
|
|
364
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
365
|
+
}, "strip", z.ZodTypeAny, {
|
|
366
|
+
first?: string | undefined;
|
|
367
|
+
last?: string | undefined;
|
|
368
|
+
displayName?: string | undefined;
|
|
369
|
+
}, {
|
|
370
|
+
first?: string | undefined;
|
|
371
|
+
last?: string | undefined;
|
|
372
|
+
displayName?: string | undefined;
|
|
373
|
+
}>>;
|
|
374
|
+
username: z.ZodOptional<z.ZodString>;
|
|
375
|
+
email: z.ZodOptional<z.ZodString>;
|
|
376
|
+
avatar: z.ZodOptional<z.ZodString>;
|
|
377
|
+
color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
378
|
+
bio: z.ZodOptional<z.ZodString>;
|
|
379
|
+
description: z.ZodOptional<z.ZodString>;
|
|
380
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
381
|
+
address: z.ZodOptional<z.ZodString>;
|
|
382
|
+
birthday: z.ZodOptional<z.ZodString>;
|
|
383
|
+
locations: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
|
|
384
|
+
links: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
385
|
+
linksMetadata: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
386
|
+
url: z.ZodString;
|
|
387
|
+
title: z.ZodOptional<z.ZodString>;
|
|
388
|
+
description: z.ZodOptional<z.ZodString>;
|
|
389
|
+
image: z.ZodOptional<z.ZodString>;
|
|
390
|
+
id: z.ZodOptional<z.ZodString>;
|
|
391
|
+
}, "strip", z.ZodTypeAny, {
|
|
392
|
+
url: string;
|
|
393
|
+
description?: string | undefined;
|
|
394
|
+
id?: string | undefined;
|
|
395
|
+
title?: string | undefined;
|
|
396
|
+
image?: string | undefined;
|
|
397
|
+
}, {
|
|
398
|
+
url: string;
|
|
399
|
+
description?: string | undefined;
|
|
400
|
+
id?: string | undefined;
|
|
401
|
+
title?: string | undefined;
|
|
402
|
+
image?: string | undefined;
|
|
403
|
+
}>, "many">>;
|
|
404
|
+
/**
|
|
405
|
+
* Ordered account locales (`language-REGION`), primary first. Replaces
|
|
406
|
+
* the eliminated singular `language`; `languages[0]` is the primary UI
|
|
407
|
+
* locale.
|
|
408
|
+
*/
|
|
409
|
+
languages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
410
|
+
accountExpiresAfterInactivityDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
411
|
+
notificationPreferences: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
412
|
+
userPreferences: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
413
|
+
privacySettings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
414
|
+
/**
|
|
415
|
+
* Portable theme preference. Written through the same `PUT /users/me`
|
|
416
|
+
* settings-update path as `languages`/`userPreferences`.
|
|
417
|
+
*/
|
|
418
|
+
themePreference: z.ZodOptional<z.ZodType<ThemePreference, z.ZodTypeDef, ThemePreference>>;
|
|
419
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
420
|
+
name: z.ZodOptional<z.ZodObject<{
|
|
421
|
+
first: z.ZodOptional<z.ZodString>;
|
|
422
|
+
last: z.ZodOptional<z.ZodString>;
|
|
423
|
+
/**
|
|
424
|
+
* Explicit display name, stored rather than composed. Wins over
|
|
425
|
+
* `first`/`last` when set; send `''` to clear it and fall back
|
|
426
|
+
* to the composed pair.
|
|
427
|
+
*/
|
|
428
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
429
|
+
}, "strip", z.ZodTypeAny, {
|
|
430
|
+
first?: string | undefined;
|
|
431
|
+
last?: string | undefined;
|
|
432
|
+
displayName?: string | undefined;
|
|
433
|
+
}, {
|
|
434
|
+
first?: string | undefined;
|
|
435
|
+
last?: string | undefined;
|
|
436
|
+
displayName?: string | undefined;
|
|
437
|
+
}>>;
|
|
438
|
+
username: z.ZodOptional<z.ZodString>;
|
|
439
|
+
email: z.ZodOptional<z.ZodString>;
|
|
440
|
+
avatar: z.ZodOptional<z.ZodString>;
|
|
441
|
+
color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
442
|
+
bio: z.ZodOptional<z.ZodString>;
|
|
443
|
+
description: z.ZodOptional<z.ZodString>;
|
|
444
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
445
|
+
address: z.ZodOptional<z.ZodString>;
|
|
446
|
+
birthday: z.ZodOptional<z.ZodString>;
|
|
447
|
+
locations: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
|
|
448
|
+
links: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
449
|
+
linksMetadata: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
450
|
+
url: z.ZodString;
|
|
451
|
+
title: z.ZodOptional<z.ZodString>;
|
|
452
|
+
description: z.ZodOptional<z.ZodString>;
|
|
453
|
+
image: z.ZodOptional<z.ZodString>;
|
|
454
|
+
id: z.ZodOptional<z.ZodString>;
|
|
455
|
+
}, "strip", z.ZodTypeAny, {
|
|
456
|
+
url: string;
|
|
457
|
+
description?: string | undefined;
|
|
458
|
+
id?: string | undefined;
|
|
459
|
+
title?: string | undefined;
|
|
460
|
+
image?: string | undefined;
|
|
461
|
+
}, {
|
|
462
|
+
url: string;
|
|
463
|
+
description?: string | undefined;
|
|
464
|
+
id?: string | undefined;
|
|
465
|
+
title?: string | undefined;
|
|
466
|
+
image?: string | undefined;
|
|
467
|
+
}>, "many">>;
|
|
468
|
+
/**
|
|
469
|
+
* Ordered account locales (`language-REGION`), primary first. Replaces
|
|
470
|
+
* the eliminated singular `language`; `languages[0]` is the primary UI
|
|
471
|
+
* locale.
|
|
472
|
+
*/
|
|
473
|
+
languages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
474
|
+
accountExpiresAfterInactivityDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
475
|
+
notificationPreferences: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
476
|
+
userPreferences: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
477
|
+
privacySettings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
478
|
+
/**
|
|
479
|
+
* Portable theme preference. Written through the same `PUT /users/me`
|
|
480
|
+
* settings-update path as `languages`/`userPreferences`.
|
|
481
|
+
*/
|
|
482
|
+
themePreference: z.ZodOptional<z.ZodType<ThemePreference, z.ZodTypeDef, ThemePreference>>;
|
|
483
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
484
|
+
name: z.ZodOptional<z.ZodObject<{
|
|
485
|
+
first: z.ZodOptional<z.ZodString>;
|
|
486
|
+
last: z.ZodOptional<z.ZodString>;
|
|
487
|
+
/**
|
|
488
|
+
* Explicit display name, stored rather than composed. Wins over
|
|
489
|
+
* `first`/`last` when set; send `''` to clear it and fall back
|
|
490
|
+
* to the composed pair.
|
|
491
|
+
*/
|
|
492
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
493
|
+
}, "strip", z.ZodTypeAny, {
|
|
494
|
+
first?: string | undefined;
|
|
495
|
+
last?: string | undefined;
|
|
496
|
+
displayName?: string | undefined;
|
|
497
|
+
}, {
|
|
498
|
+
first?: string | undefined;
|
|
499
|
+
last?: string | undefined;
|
|
500
|
+
displayName?: string | undefined;
|
|
501
|
+
}>>;
|
|
502
|
+
username: z.ZodOptional<z.ZodString>;
|
|
503
|
+
email: z.ZodOptional<z.ZodString>;
|
|
504
|
+
avatar: z.ZodOptional<z.ZodString>;
|
|
505
|
+
color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
506
|
+
bio: z.ZodOptional<z.ZodString>;
|
|
507
|
+
description: z.ZodOptional<z.ZodString>;
|
|
508
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
509
|
+
address: z.ZodOptional<z.ZodString>;
|
|
510
|
+
birthday: z.ZodOptional<z.ZodString>;
|
|
511
|
+
locations: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
|
|
512
|
+
links: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
513
|
+
linksMetadata: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
514
|
+
url: z.ZodString;
|
|
515
|
+
title: z.ZodOptional<z.ZodString>;
|
|
516
|
+
description: z.ZodOptional<z.ZodString>;
|
|
517
|
+
image: z.ZodOptional<z.ZodString>;
|
|
518
|
+
id: z.ZodOptional<z.ZodString>;
|
|
519
|
+
}, "strip", z.ZodTypeAny, {
|
|
520
|
+
url: string;
|
|
521
|
+
description?: string | undefined;
|
|
522
|
+
id?: string | undefined;
|
|
523
|
+
title?: string | undefined;
|
|
524
|
+
image?: string | undefined;
|
|
525
|
+
}, {
|
|
526
|
+
url: string;
|
|
527
|
+
description?: string | undefined;
|
|
528
|
+
id?: string | undefined;
|
|
529
|
+
title?: string | undefined;
|
|
530
|
+
image?: string | undefined;
|
|
531
|
+
}>, "many">>;
|
|
532
|
+
/**
|
|
533
|
+
* Ordered account locales (`language-REGION`), primary first. Replaces
|
|
534
|
+
* the eliminated singular `language`; `languages[0]` is the primary UI
|
|
535
|
+
* locale.
|
|
536
|
+
*/
|
|
537
|
+
languages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
538
|
+
accountExpiresAfterInactivityDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
539
|
+
notificationPreferences: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
540
|
+
userPreferences: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
541
|
+
privacySettings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
542
|
+
/**
|
|
543
|
+
* Portable theme preference. Written through the same `PUT /users/me`
|
|
544
|
+
* settings-update path as `languages`/`userPreferences`.
|
|
545
|
+
*/
|
|
546
|
+
themePreference: z.ZodOptional<z.ZodType<ThemePreference, z.ZodTypeDef, ThemePreference>>;
|
|
547
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
548
|
+
export type UserProfileUpdate = z.infer<typeof userProfileUpdateSchema>;
|
|
549
|
+
/**
|
|
550
|
+
* Resolve the canonical user id from a {@link UserResponse}, accepting either
|
|
551
|
+
* the `formatUserResponse` `id` field or the raw-document `_id` field.
|
|
552
|
+
*/
|
|
553
|
+
export declare function resolveUserId(user: UserResponse): string | undefined;
|
|
554
|
+
/**
|
|
555
|
+
* Wire shape of `GET /users/me` — the API success envelope (`{ data: <user> }`)
|
|
556
|
+
* wrapping the current-user DTO. Some older producers use `_id` instead of
|
|
557
|
+
* `id`; resolve via {@link resolveUserId}. The display name still lives under
|
|
558
|
+
* `name.displayName`.
|
|
559
|
+
*/
|
|
560
|
+
export declare const currentUserResponseSchema: z.ZodObject<{
|
|
561
|
+
data: z.ZodObject<{
|
|
562
|
+
/** MongoDB ObjectId as a string. Present on `formatUserResponse` output. */
|
|
563
|
+
id: z.ZodOptional<z.ZodString>;
|
|
564
|
+
/** Raw-document id (e.g. `GET /users/me`). Present when `id` is not. */
|
|
565
|
+
_id: z.ZodOptional<z.ZodString>;
|
|
566
|
+
publicKey: z.ZodOptional<z.ZodString>;
|
|
567
|
+
username: z.ZodOptional<z.ZodString>;
|
|
568
|
+
email: z.ZodOptional<z.ZodString>;
|
|
569
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
570
|
+
address: z.ZodOptional<z.ZodString>;
|
|
571
|
+
birthday: z.ZodOptional<z.ZodString>;
|
|
572
|
+
/** Avatar file id (string) or null. */
|
|
573
|
+
avatar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
574
|
+
/** Named Bloom color preset (e.g. `"blue"`) or null. */
|
|
575
|
+
color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
576
|
+
name: z.ZodType<UserNameResponse, z.ZodTypeDef, UserNameResponse>;
|
|
577
|
+
verified: z.ZodOptional<z.ZodBoolean>;
|
|
578
|
+
/**
|
|
579
|
+
* The account's languages as full BCP-47 locales (`language-REGION`,
|
|
580
|
+
* e.g. `es-ES`, `en-US`, `pt-BR`), ordered with the PRIMARY (UI) locale
|
|
581
|
+
* first. `languages[0]` is the primary locale — there is no singular
|
|
582
|
+
* `language` field.
|
|
583
|
+
*/
|
|
584
|
+
languages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
585
|
+
/**
|
|
586
|
+
* The account's self-sovereign identifier
|
|
587
|
+
* (`did:web:<FEDERATION_DOMAIN>:u:<userId>`). Surfaced as a `User`
|
|
588
|
+
* virtual; present on formatted DTOs once the identity layer is live.
|
|
589
|
+
*/
|
|
590
|
+
did: z.ZodOptional<z.ZodString>;
|
|
591
|
+
/**
|
|
592
|
+
* Proven domain-ownership badges. Each is a {@link verifiedDomainSchema}
|
|
593
|
+
* entry; present only when the account has verified at least one domain.
|
|
594
|
+
*/
|
|
595
|
+
verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
|
|
596
|
+
/**
|
|
597
|
+
* Account-graph classification — what KIND of account this is.
|
|
598
|
+
*
|
|
599
|
+
* ORTHOGONAL to `type` (`local` / `federated` / `agent` / `automated`),
|
|
600
|
+
* which says where the account lives and how it is driven; the two
|
|
601
|
+
* coexist and neither substitutes for the other. A `channel` is a
|
|
602
|
+
* publishing identity nobody can act as, so a consumer that renders
|
|
603
|
+
* authored content reads THIS to tell a channel's post from a person's.
|
|
604
|
+
*
|
|
605
|
+
* Optional because a DTO produced from a source that never carried the
|
|
606
|
+
* column omits it; absent should be read as `personal`, the column's
|
|
607
|
+
* default, not as unknown.
|
|
608
|
+
*/
|
|
609
|
+
kind: z.ZodOptional<z.ZodEnum<["personal", "organization", "project", "bot", "channel"]>>;
|
|
610
|
+
/**
|
|
611
|
+
* What this account is about — the field a profile screen RENDERS.
|
|
612
|
+
*
|
|
613
|
+
* **Ordered, primary first.** `accountCategories[0]` is the primary
|
|
614
|
+
* category; there is deliberately no sibling `primaryCategory` field,
|
|
615
|
+
* because two representations of one fact can disagree (see rule 2 in
|
|
616
|
+
* `accountGraph.ts`). Nothing downstream may sort, de-duplicate or
|
|
617
|
+
* otherwise reorder this array.
|
|
618
|
+
*
|
|
619
|
+
* **Ids, never labels.** Each element is a stable slug; the visible text
|
|
620
|
+
* comes from the reader's own translation catalogue, keyed
|
|
621
|
+
* `accounts.accountCategory.<id>`. A label on the wire would paint every
|
|
622
|
+
* profile in the language of whoever picked it.
|
|
623
|
+
*
|
|
624
|
+
* Absent when the account has none — which is every `personal` account,
|
|
625
|
+
* and any non-personal one that has not chosen. A renderer reads
|
|
626
|
+
* `user.accountCategories ?? []`.
|
|
627
|
+
*/
|
|
628
|
+
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")[]>>;
|
|
629
|
+
/**
|
|
630
|
+
* The authenticated viewer's relationship to this profile. Present ONLY
|
|
631
|
+
* on single-profile fetches (`GET /profiles/username/:username`,
|
|
632
|
+
* `GET /users/:userId`) when the request is authenticated; OMITTED for
|
|
633
|
+
* anonymous requests and for the bulk `POST /users/by-ids` fan-out.
|
|
634
|
+
*/
|
|
635
|
+
relationship: z.ZodOptional<z.ZodType<UserRelationship, z.ZodTypeDef, UserRelationship>>;
|
|
636
|
+
/**
|
|
637
|
+
* Portable theme preference. Rides the self/session payload (cold boot),
|
|
638
|
+
* so it is present on the current-user DTO (`GET /users/me`,
|
|
639
|
+
* `GET /session/user/:sessionId`) and absent until the user sets it.
|
|
640
|
+
*/
|
|
641
|
+
themePreference: z.ZodOptional<z.ZodType<ThemePreference, z.ZodTypeDef, ThemePreference>>;
|
|
642
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
643
|
+
/** MongoDB ObjectId as a string. Present on `formatUserResponse` output. */
|
|
644
|
+
id: z.ZodOptional<z.ZodString>;
|
|
645
|
+
/** Raw-document id (e.g. `GET /users/me`). Present when `id` is not. */
|
|
646
|
+
_id: z.ZodOptional<z.ZodString>;
|
|
647
|
+
publicKey: z.ZodOptional<z.ZodString>;
|
|
648
|
+
username: z.ZodOptional<z.ZodString>;
|
|
649
|
+
email: z.ZodOptional<z.ZodString>;
|
|
650
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
651
|
+
address: z.ZodOptional<z.ZodString>;
|
|
652
|
+
birthday: z.ZodOptional<z.ZodString>;
|
|
653
|
+
/** Avatar file id (string) or null. */
|
|
654
|
+
avatar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
655
|
+
/** Named Bloom color preset (e.g. `"blue"`) or null. */
|
|
656
|
+
color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
657
|
+
name: z.ZodType<UserNameResponse, z.ZodTypeDef, UserNameResponse>;
|
|
658
|
+
verified: z.ZodOptional<z.ZodBoolean>;
|
|
659
|
+
/**
|
|
660
|
+
* The account's languages as full BCP-47 locales (`language-REGION`,
|
|
661
|
+
* e.g. `es-ES`, `en-US`, `pt-BR`), ordered with the PRIMARY (UI) locale
|
|
662
|
+
* first. `languages[0]` is the primary locale — there is no singular
|
|
663
|
+
* `language` field.
|
|
664
|
+
*/
|
|
665
|
+
languages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
666
|
+
/**
|
|
667
|
+
* The account's self-sovereign identifier
|
|
668
|
+
* (`did:web:<FEDERATION_DOMAIN>:u:<userId>`). Surfaced as a `User`
|
|
669
|
+
* virtual; present on formatted DTOs once the identity layer is live.
|
|
670
|
+
*/
|
|
671
|
+
did: z.ZodOptional<z.ZodString>;
|
|
672
|
+
/**
|
|
673
|
+
* Proven domain-ownership badges. Each is a {@link verifiedDomainSchema}
|
|
674
|
+
* entry; present only when the account has verified at least one domain.
|
|
675
|
+
*/
|
|
676
|
+
verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
|
|
677
|
+
/**
|
|
678
|
+
* Account-graph classification — what KIND of account this is.
|
|
679
|
+
*
|
|
680
|
+
* ORTHOGONAL to `type` (`local` / `federated` / `agent` / `automated`),
|
|
681
|
+
* which says where the account lives and how it is driven; the two
|
|
682
|
+
* coexist and neither substitutes for the other. A `channel` is a
|
|
683
|
+
* publishing identity nobody can act as, so a consumer that renders
|
|
684
|
+
* authored content reads THIS to tell a channel's post from a person's.
|
|
685
|
+
*
|
|
686
|
+
* Optional because a DTO produced from a source that never carried the
|
|
687
|
+
* column omits it; absent should be read as `personal`, the column's
|
|
688
|
+
* default, not as unknown.
|
|
689
|
+
*/
|
|
690
|
+
kind: z.ZodOptional<z.ZodEnum<["personal", "organization", "project", "bot", "channel"]>>;
|
|
691
|
+
/**
|
|
692
|
+
* What this account is about — the field a profile screen RENDERS.
|
|
693
|
+
*
|
|
694
|
+
* **Ordered, primary first.** `accountCategories[0]` is the primary
|
|
695
|
+
* category; there is deliberately no sibling `primaryCategory` field,
|
|
696
|
+
* because two representations of one fact can disagree (see rule 2 in
|
|
697
|
+
* `accountGraph.ts`). Nothing downstream may sort, de-duplicate or
|
|
698
|
+
* otherwise reorder this array.
|
|
699
|
+
*
|
|
700
|
+
* **Ids, never labels.** Each element is a stable slug; the visible text
|
|
701
|
+
* comes from the reader's own translation catalogue, keyed
|
|
702
|
+
* `accounts.accountCategory.<id>`. A label on the wire would paint every
|
|
703
|
+
* profile in the language of whoever picked it.
|
|
704
|
+
*
|
|
705
|
+
* Absent when the account has none — which is every `personal` account,
|
|
706
|
+
* and any non-personal one that has not chosen. A renderer reads
|
|
707
|
+
* `user.accountCategories ?? []`.
|
|
708
|
+
*/
|
|
709
|
+
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")[]>>;
|
|
710
|
+
/**
|
|
711
|
+
* The authenticated viewer's relationship to this profile. Present ONLY
|
|
712
|
+
* on single-profile fetches (`GET /profiles/username/:username`,
|
|
713
|
+
* `GET /users/:userId`) when the request is authenticated; OMITTED for
|
|
714
|
+
* anonymous requests and for the bulk `POST /users/by-ids` fan-out.
|
|
715
|
+
*/
|
|
716
|
+
relationship: z.ZodOptional<z.ZodType<UserRelationship, z.ZodTypeDef, UserRelationship>>;
|
|
717
|
+
/**
|
|
718
|
+
* Portable theme preference. Rides the self/session payload (cold boot),
|
|
719
|
+
* so it is present on the current-user DTO (`GET /users/me`,
|
|
720
|
+
* `GET /session/user/:sessionId`) and absent until the user sets it.
|
|
721
|
+
*/
|
|
722
|
+
themePreference: z.ZodOptional<z.ZodType<ThemePreference, z.ZodTypeDef, ThemePreference>>;
|
|
723
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
724
|
+
/** MongoDB ObjectId as a string. Present on `formatUserResponse` output. */
|
|
725
|
+
id: z.ZodOptional<z.ZodString>;
|
|
726
|
+
/** Raw-document id (e.g. `GET /users/me`). Present when `id` is not. */
|
|
727
|
+
_id: z.ZodOptional<z.ZodString>;
|
|
728
|
+
publicKey: z.ZodOptional<z.ZodString>;
|
|
729
|
+
username: z.ZodOptional<z.ZodString>;
|
|
730
|
+
email: z.ZodOptional<z.ZodString>;
|
|
731
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
732
|
+
address: z.ZodOptional<z.ZodString>;
|
|
733
|
+
birthday: z.ZodOptional<z.ZodString>;
|
|
734
|
+
/** Avatar file id (string) or null. */
|
|
735
|
+
avatar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
736
|
+
/** Named Bloom color preset (e.g. `"blue"`) or null. */
|
|
737
|
+
color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
738
|
+
name: z.ZodType<UserNameResponse, z.ZodTypeDef, UserNameResponse>;
|
|
739
|
+
verified: z.ZodOptional<z.ZodBoolean>;
|
|
740
|
+
/**
|
|
741
|
+
* The account's languages as full BCP-47 locales (`language-REGION`,
|
|
742
|
+
* e.g. `es-ES`, `en-US`, `pt-BR`), ordered with the PRIMARY (UI) locale
|
|
743
|
+
* first. `languages[0]` is the primary locale — there is no singular
|
|
744
|
+
* `language` field.
|
|
745
|
+
*/
|
|
746
|
+
languages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
747
|
+
/**
|
|
748
|
+
* The account's self-sovereign identifier
|
|
749
|
+
* (`did:web:<FEDERATION_DOMAIN>:u:<userId>`). Surfaced as a `User`
|
|
750
|
+
* virtual; present on formatted DTOs once the identity layer is live.
|
|
751
|
+
*/
|
|
752
|
+
did: z.ZodOptional<z.ZodString>;
|
|
753
|
+
/**
|
|
754
|
+
* Proven domain-ownership badges. Each is a {@link verifiedDomainSchema}
|
|
755
|
+
* entry; present only when the account has verified at least one domain.
|
|
756
|
+
*/
|
|
757
|
+
verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
|
|
758
|
+
/**
|
|
759
|
+
* Account-graph classification — what KIND of account this is.
|
|
760
|
+
*
|
|
761
|
+
* ORTHOGONAL to `type` (`local` / `federated` / `agent` / `automated`),
|
|
762
|
+
* which says where the account lives and how it is driven; the two
|
|
763
|
+
* coexist and neither substitutes for the other. A `channel` is a
|
|
764
|
+
* publishing identity nobody can act as, so a consumer that renders
|
|
765
|
+
* authored content reads THIS to tell a channel's post from a person's.
|
|
766
|
+
*
|
|
767
|
+
* Optional because a DTO produced from a source that never carried the
|
|
768
|
+
* column omits it; absent should be read as `personal`, the column's
|
|
769
|
+
* default, not as unknown.
|
|
770
|
+
*/
|
|
771
|
+
kind: z.ZodOptional<z.ZodEnum<["personal", "organization", "project", "bot", "channel"]>>;
|
|
772
|
+
/**
|
|
773
|
+
* What this account is about — the field a profile screen RENDERS.
|
|
774
|
+
*
|
|
775
|
+
* **Ordered, primary first.** `accountCategories[0]` is the primary
|
|
776
|
+
* category; there is deliberately no sibling `primaryCategory` field,
|
|
777
|
+
* because two representations of one fact can disagree (see rule 2 in
|
|
778
|
+
* `accountGraph.ts`). Nothing downstream may sort, de-duplicate or
|
|
779
|
+
* otherwise reorder this array.
|
|
780
|
+
*
|
|
781
|
+
* **Ids, never labels.** Each element is a stable slug; the visible text
|
|
782
|
+
* comes from the reader's own translation catalogue, keyed
|
|
783
|
+
* `accounts.accountCategory.<id>`. A label on the wire would paint every
|
|
784
|
+
* profile in the language of whoever picked it.
|
|
785
|
+
*
|
|
786
|
+
* Absent when the account has none — which is every `personal` account,
|
|
787
|
+
* and any non-personal one that has not chosen. A renderer reads
|
|
788
|
+
* `user.accountCategories ?? []`.
|
|
789
|
+
*/
|
|
790
|
+
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")[]>>;
|
|
791
|
+
/**
|
|
792
|
+
* The authenticated viewer's relationship to this profile. Present ONLY
|
|
793
|
+
* on single-profile fetches (`GET /profiles/username/:username`,
|
|
794
|
+
* `GET /users/:userId`) when the request is authenticated; OMITTED for
|
|
795
|
+
* anonymous requests and for the bulk `POST /users/by-ids` fan-out.
|
|
796
|
+
*/
|
|
797
|
+
relationship: z.ZodOptional<z.ZodType<UserRelationship, z.ZodTypeDef, UserRelationship>>;
|
|
798
|
+
/**
|
|
799
|
+
* Portable theme preference. Rides the self/session payload (cold boot),
|
|
800
|
+
* so it is present on the current-user DTO (`GET /users/me`,
|
|
801
|
+
* `GET /session/user/:sessionId`) and absent until the user sets it.
|
|
802
|
+
*/
|
|
803
|
+
themePreference: z.ZodOptional<z.ZodType<ThemePreference, z.ZodTypeDef, ThemePreference>>;
|
|
804
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
805
|
+
}, "strip", z.ZodTypeAny, {
|
|
806
|
+
data: {
|
|
807
|
+
name: UserNameResponse;
|
|
808
|
+
kind?: "bot" | "personal" | "organization" | "project" | "channel" | undefined;
|
|
809
|
+
username?: string | undefined;
|
|
810
|
+
avatar?: string | null | undefined;
|
|
811
|
+
color?: string | null | undefined;
|
|
812
|
+
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;
|
|
813
|
+
id?: string | undefined;
|
|
814
|
+
publicKey?: string | undefined;
|
|
815
|
+
did?: string | undefined;
|
|
816
|
+
verifiedDomains?: import("./identity").VerifiedDomain[] | undefined;
|
|
817
|
+
_id?: string | undefined;
|
|
818
|
+
email?: string | undefined;
|
|
819
|
+
phone?: string | undefined;
|
|
820
|
+
address?: string | undefined;
|
|
821
|
+
birthday?: string | undefined;
|
|
822
|
+
verified?: boolean | undefined;
|
|
823
|
+
languages?: string[] | undefined;
|
|
824
|
+
relationship?: UserRelationship | undefined;
|
|
825
|
+
themePreference?: ThemePreference | undefined;
|
|
826
|
+
} & {
|
|
827
|
+
[k: string]: unknown;
|
|
828
|
+
};
|
|
829
|
+
}, {
|
|
830
|
+
data: {
|
|
831
|
+
name: UserNameResponse;
|
|
832
|
+
kind?: "bot" | "personal" | "organization" | "project" | "channel" | undefined;
|
|
833
|
+
username?: string | undefined;
|
|
834
|
+
avatar?: string | null | undefined;
|
|
835
|
+
color?: string | null | undefined;
|
|
836
|
+
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;
|
|
837
|
+
id?: string | undefined;
|
|
838
|
+
publicKey?: string | undefined;
|
|
839
|
+
did?: string | undefined;
|
|
840
|
+
verifiedDomains?: import("./identity").VerifiedDomain[] | undefined;
|
|
841
|
+
_id?: string | undefined;
|
|
842
|
+
email?: string | undefined;
|
|
843
|
+
phone?: string | undefined;
|
|
844
|
+
address?: string | undefined;
|
|
845
|
+
birthday?: string | undefined;
|
|
846
|
+
verified?: boolean | undefined;
|
|
847
|
+
languages?: string[] | undefined;
|
|
848
|
+
relationship?: UserRelationship | undefined;
|
|
849
|
+
themePreference?: ThemePreference | undefined;
|
|
850
|
+
} & {
|
|
851
|
+
[k: string]: unknown;
|
|
852
|
+
};
|
|
853
|
+
}>;
|
|
854
|
+
export type CurrentUserResponseContract = z.infer<typeof currentUserResponseSchema>;
|
|
855
|
+
/**
|
|
856
|
+
* One entry of `GET /session/device/sessions/:sessionId` — the deduplicated
|
|
857
|
+
* accounts signed in on this physical device (one per user, most recent
|
|
858
|
+
* session). Backs the multi-account chooser. The embedded user mirrors
|
|
859
|
+
* `formatUserResponse`; it is nullable on slots that lost their user document.
|
|
860
|
+
*/
|
|
861
|
+
export declare const deviceLinkedSessionSchema: z.ZodObject<{
|
|
862
|
+
sessionId: z.ZodString;
|
|
863
|
+
isCurrent: z.ZodOptional<z.ZodBoolean>;
|
|
864
|
+
user: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
865
|
+
/** MongoDB ObjectId as a string. Present on `formatUserResponse` output. */
|
|
866
|
+
id: z.ZodOptional<z.ZodString>;
|
|
867
|
+
/** Raw-document id (e.g. `GET /users/me`). Present when `id` is not. */
|
|
868
|
+
_id: z.ZodOptional<z.ZodString>;
|
|
869
|
+
publicKey: z.ZodOptional<z.ZodString>;
|
|
870
|
+
username: z.ZodOptional<z.ZodString>;
|
|
871
|
+
email: z.ZodOptional<z.ZodString>;
|
|
872
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
873
|
+
address: z.ZodOptional<z.ZodString>;
|
|
874
|
+
birthday: z.ZodOptional<z.ZodString>;
|
|
875
|
+
/** Avatar file id (string) or null. */
|
|
876
|
+
avatar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
877
|
+
/** Named Bloom color preset (e.g. `"blue"`) or null. */
|
|
878
|
+
color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
879
|
+
name: z.ZodType<UserNameResponse, z.ZodTypeDef, UserNameResponse>;
|
|
880
|
+
verified: z.ZodOptional<z.ZodBoolean>;
|
|
881
|
+
/**
|
|
882
|
+
* The account's languages as full BCP-47 locales (`language-REGION`,
|
|
883
|
+
* e.g. `es-ES`, `en-US`, `pt-BR`), ordered with the PRIMARY (UI) locale
|
|
884
|
+
* first. `languages[0]` is the primary locale — there is no singular
|
|
885
|
+
* `language` field.
|
|
886
|
+
*/
|
|
887
|
+
languages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
888
|
+
/**
|
|
889
|
+
* The account's self-sovereign identifier
|
|
890
|
+
* (`did:web:<FEDERATION_DOMAIN>:u:<userId>`). Surfaced as a `User`
|
|
891
|
+
* virtual; present on formatted DTOs once the identity layer is live.
|
|
892
|
+
*/
|
|
893
|
+
did: z.ZodOptional<z.ZodString>;
|
|
894
|
+
/**
|
|
895
|
+
* Proven domain-ownership badges. Each is a {@link verifiedDomainSchema}
|
|
896
|
+
* entry; present only when the account has verified at least one domain.
|
|
897
|
+
*/
|
|
898
|
+
verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
|
|
899
|
+
/**
|
|
900
|
+
* Account-graph classification — what KIND of account this is.
|
|
901
|
+
*
|
|
902
|
+
* ORTHOGONAL to `type` (`local` / `federated` / `agent` / `automated`),
|
|
903
|
+
* which says where the account lives and how it is driven; the two
|
|
904
|
+
* coexist and neither substitutes for the other. A `channel` is a
|
|
905
|
+
* publishing identity nobody can act as, so a consumer that renders
|
|
906
|
+
* authored content reads THIS to tell a channel's post from a person's.
|
|
907
|
+
*
|
|
908
|
+
* Optional because a DTO produced from a source that never carried the
|
|
909
|
+
* column omits it; absent should be read as `personal`, the column's
|
|
910
|
+
* default, not as unknown.
|
|
911
|
+
*/
|
|
912
|
+
kind: z.ZodOptional<z.ZodEnum<["personal", "organization", "project", "bot", "channel"]>>;
|
|
913
|
+
/**
|
|
914
|
+
* What this account is about — the field a profile screen RENDERS.
|
|
915
|
+
*
|
|
916
|
+
* **Ordered, primary first.** `accountCategories[0]` is the primary
|
|
917
|
+
* category; there is deliberately no sibling `primaryCategory` field,
|
|
918
|
+
* because two representations of one fact can disagree (see rule 2 in
|
|
919
|
+
* `accountGraph.ts`). Nothing downstream may sort, de-duplicate or
|
|
920
|
+
* otherwise reorder this array.
|
|
921
|
+
*
|
|
922
|
+
* **Ids, never labels.** Each element is a stable slug; the visible text
|
|
923
|
+
* comes from the reader's own translation catalogue, keyed
|
|
924
|
+
* `accounts.accountCategory.<id>`. A label on the wire would paint every
|
|
925
|
+
* profile in the language of whoever picked it.
|
|
926
|
+
*
|
|
927
|
+
* Absent when the account has none — which is every `personal` account,
|
|
928
|
+
* and any non-personal one that has not chosen. A renderer reads
|
|
929
|
+
* `user.accountCategories ?? []`.
|
|
930
|
+
*/
|
|
931
|
+
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")[]>>;
|
|
932
|
+
/**
|
|
933
|
+
* The authenticated viewer's relationship to this profile. Present ONLY
|
|
934
|
+
* on single-profile fetches (`GET /profiles/username/:username`,
|
|
935
|
+
* `GET /users/:userId`) when the request is authenticated; OMITTED for
|
|
936
|
+
* anonymous requests and for the bulk `POST /users/by-ids` fan-out.
|
|
937
|
+
*/
|
|
938
|
+
relationship: z.ZodOptional<z.ZodType<UserRelationship, z.ZodTypeDef, UserRelationship>>;
|
|
939
|
+
/**
|
|
940
|
+
* Portable theme preference. Rides the self/session payload (cold boot),
|
|
941
|
+
* so it is present on the current-user DTO (`GET /users/me`,
|
|
942
|
+
* `GET /session/user/:sessionId`) and absent until the user sets it.
|
|
943
|
+
*/
|
|
944
|
+
themePreference: z.ZodOptional<z.ZodType<ThemePreference, z.ZodTypeDef, ThemePreference>>;
|
|
945
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
946
|
+
/** MongoDB ObjectId as a string. Present on `formatUserResponse` output. */
|
|
947
|
+
id: z.ZodOptional<z.ZodString>;
|
|
948
|
+
/** Raw-document id (e.g. `GET /users/me`). Present when `id` is not. */
|
|
949
|
+
_id: z.ZodOptional<z.ZodString>;
|
|
950
|
+
publicKey: z.ZodOptional<z.ZodString>;
|
|
951
|
+
username: z.ZodOptional<z.ZodString>;
|
|
952
|
+
email: z.ZodOptional<z.ZodString>;
|
|
953
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
954
|
+
address: z.ZodOptional<z.ZodString>;
|
|
955
|
+
birthday: z.ZodOptional<z.ZodString>;
|
|
956
|
+
/** Avatar file id (string) or null. */
|
|
957
|
+
avatar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
958
|
+
/** Named Bloom color preset (e.g. `"blue"`) or null. */
|
|
959
|
+
color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
960
|
+
name: z.ZodType<UserNameResponse, z.ZodTypeDef, UserNameResponse>;
|
|
961
|
+
verified: z.ZodOptional<z.ZodBoolean>;
|
|
962
|
+
/**
|
|
963
|
+
* The account's languages as full BCP-47 locales (`language-REGION`,
|
|
964
|
+
* e.g. `es-ES`, `en-US`, `pt-BR`), ordered with the PRIMARY (UI) locale
|
|
965
|
+
* first. `languages[0]` is the primary locale — there is no singular
|
|
966
|
+
* `language` field.
|
|
967
|
+
*/
|
|
968
|
+
languages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
969
|
+
/**
|
|
970
|
+
* The account's self-sovereign identifier
|
|
971
|
+
* (`did:web:<FEDERATION_DOMAIN>:u:<userId>`). Surfaced as a `User`
|
|
972
|
+
* virtual; present on formatted DTOs once the identity layer is live.
|
|
973
|
+
*/
|
|
974
|
+
did: z.ZodOptional<z.ZodString>;
|
|
975
|
+
/**
|
|
976
|
+
* Proven domain-ownership badges. Each is a {@link verifiedDomainSchema}
|
|
977
|
+
* entry; present only when the account has verified at least one domain.
|
|
978
|
+
*/
|
|
979
|
+
verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
|
|
980
|
+
/**
|
|
981
|
+
* Account-graph classification — what KIND of account this is.
|
|
982
|
+
*
|
|
983
|
+
* ORTHOGONAL to `type` (`local` / `federated` / `agent` / `automated`),
|
|
984
|
+
* which says where the account lives and how it is driven; the two
|
|
985
|
+
* coexist and neither substitutes for the other. A `channel` is a
|
|
986
|
+
* publishing identity nobody can act as, so a consumer that renders
|
|
987
|
+
* authored content reads THIS to tell a channel's post from a person's.
|
|
988
|
+
*
|
|
989
|
+
* Optional because a DTO produced from a source that never carried the
|
|
990
|
+
* column omits it; absent should be read as `personal`, the column's
|
|
991
|
+
* default, not as unknown.
|
|
992
|
+
*/
|
|
993
|
+
kind: z.ZodOptional<z.ZodEnum<["personal", "organization", "project", "bot", "channel"]>>;
|
|
994
|
+
/**
|
|
995
|
+
* What this account is about — the field a profile screen RENDERS.
|
|
996
|
+
*
|
|
997
|
+
* **Ordered, primary first.** `accountCategories[0]` is the primary
|
|
998
|
+
* category; there is deliberately no sibling `primaryCategory` field,
|
|
999
|
+
* because two representations of one fact can disagree (see rule 2 in
|
|
1000
|
+
* `accountGraph.ts`). Nothing downstream may sort, de-duplicate or
|
|
1001
|
+
* otherwise reorder this array.
|
|
1002
|
+
*
|
|
1003
|
+
* **Ids, never labels.** Each element is a stable slug; the visible text
|
|
1004
|
+
* comes from the reader's own translation catalogue, keyed
|
|
1005
|
+
* `accounts.accountCategory.<id>`. A label on the wire would paint every
|
|
1006
|
+
* profile in the language of whoever picked it.
|
|
1007
|
+
*
|
|
1008
|
+
* Absent when the account has none — which is every `personal` account,
|
|
1009
|
+
* and any non-personal one that has not chosen. A renderer reads
|
|
1010
|
+
* `user.accountCategories ?? []`.
|
|
1011
|
+
*/
|
|
1012
|
+
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")[]>>;
|
|
1013
|
+
/**
|
|
1014
|
+
* The authenticated viewer's relationship to this profile. Present ONLY
|
|
1015
|
+
* on single-profile fetches (`GET /profiles/username/:username`,
|
|
1016
|
+
* `GET /users/:userId`) when the request is authenticated; OMITTED for
|
|
1017
|
+
* anonymous requests and for the bulk `POST /users/by-ids` fan-out.
|
|
1018
|
+
*/
|
|
1019
|
+
relationship: z.ZodOptional<z.ZodType<UserRelationship, z.ZodTypeDef, UserRelationship>>;
|
|
1020
|
+
/**
|
|
1021
|
+
* Portable theme preference. Rides the self/session payload (cold boot),
|
|
1022
|
+
* so it is present on the current-user DTO (`GET /users/me`,
|
|
1023
|
+
* `GET /session/user/:sessionId`) and absent until the user sets it.
|
|
1024
|
+
*/
|
|
1025
|
+
themePreference: z.ZodOptional<z.ZodType<ThemePreference, z.ZodTypeDef, ThemePreference>>;
|
|
1026
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
1027
|
+
/** MongoDB ObjectId as a string. Present on `formatUserResponse` output. */
|
|
1028
|
+
id: z.ZodOptional<z.ZodString>;
|
|
1029
|
+
/** Raw-document id (e.g. `GET /users/me`). Present when `id` is not. */
|
|
1030
|
+
_id: z.ZodOptional<z.ZodString>;
|
|
1031
|
+
publicKey: z.ZodOptional<z.ZodString>;
|
|
1032
|
+
username: z.ZodOptional<z.ZodString>;
|
|
1033
|
+
email: z.ZodOptional<z.ZodString>;
|
|
1034
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
1035
|
+
address: z.ZodOptional<z.ZodString>;
|
|
1036
|
+
birthday: z.ZodOptional<z.ZodString>;
|
|
1037
|
+
/** Avatar file id (string) or null. */
|
|
1038
|
+
avatar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1039
|
+
/** Named Bloom color preset (e.g. `"blue"`) or null. */
|
|
1040
|
+
color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1041
|
+
name: z.ZodType<UserNameResponse, z.ZodTypeDef, UserNameResponse>;
|
|
1042
|
+
verified: z.ZodOptional<z.ZodBoolean>;
|
|
1043
|
+
/**
|
|
1044
|
+
* The account's languages as full BCP-47 locales (`language-REGION`,
|
|
1045
|
+
* e.g. `es-ES`, `en-US`, `pt-BR`), ordered with the PRIMARY (UI) locale
|
|
1046
|
+
* first. `languages[0]` is the primary locale — there is no singular
|
|
1047
|
+
* `language` field.
|
|
1048
|
+
*/
|
|
1049
|
+
languages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1050
|
+
/**
|
|
1051
|
+
* The account's self-sovereign identifier
|
|
1052
|
+
* (`did:web:<FEDERATION_DOMAIN>:u:<userId>`). Surfaced as a `User`
|
|
1053
|
+
* virtual; present on formatted DTOs once the identity layer is live.
|
|
1054
|
+
*/
|
|
1055
|
+
did: z.ZodOptional<z.ZodString>;
|
|
1056
|
+
/**
|
|
1057
|
+
* Proven domain-ownership badges. Each is a {@link verifiedDomainSchema}
|
|
1058
|
+
* entry; present only when the account has verified at least one domain.
|
|
1059
|
+
*/
|
|
1060
|
+
verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
|
|
1061
|
+
/**
|
|
1062
|
+
* Account-graph classification — what KIND of account this is.
|
|
1063
|
+
*
|
|
1064
|
+
* ORTHOGONAL to `type` (`local` / `federated` / `agent` / `automated`),
|
|
1065
|
+
* which says where the account lives and how it is driven; the two
|
|
1066
|
+
* coexist and neither substitutes for the other. A `channel` is a
|
|
1067
|
+
* publishing identity nobody can act as, so a consumer that renders
|
|
1068
|
+
* authored content reads THIS to tell a channel's post from a person's.
|
|
1069
|
+
*
|
|
1070
|
+
* Optional because a DTO produced from a source that never carried the
|
|
1071
|
+
* column omits it; absent should be read as `personal`, the column's
|
|
1072
|
+
* default, not as unknown.
|
|
1073
|
+
*/
|
|
1074
|
+
kind: z.ZodOptional<z.ZodEnum<["personal", "organization", "project", "bot", "channel"]>>;
|
|
1075
|
+
/**
|
|
1076
|
+
* What this account is about — the field a profile screen RENDERS.
|
|
1077
|
+
*
|
|
1078
|
+
* **Ordered, primary first.** `accountCategories[0]` is the primary
|
|
1079
|
+
* category; there is deliberately no sibling `primaryCategory` field,
|
|
1080
|
+
* because two representations of one fact can disagree (see rule 2 in
|
|
1081
|
+
* `accountGraph.ts`). Nothing downstream may sort, de-duplicate or
|
|
1082
|
+
* otherwise reorder this array.
|
|
1083
|
+
*
|
|
1084
|
+
* **Ids, never labels.** Each element is a stable slug; the visible text
|
|
1085
|
+
* comes from the reader's own translation catalogue, keyed
|
|
1086
|
+
* `accounts.accountCategory.<id>`. A label on the wire would paint every
|
|
1087
|
+
* profile in the language of whoever picked it.
|
|
1088
|
+
*
|
|
1089
|
+
* Absent when the account has none — which is every `personal` account,
|
|
1090
|
+
* and any non-personal one that has not chosen. A renderer reads
|
|
1091
|
+
* `user.accountCategories ?? []`.
|
|
1092
|
+
*/
|
|
1093
|
+
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")[]>>;
|
|
1094
|
+
/**
|
|
1095
|
+
* The authenticated viewer's relationship to this profile. Present ONLY
|
|
1096
|
+
* on single-profile fetches (`GET /profiles/username/:username`,
|
|
1097
|
+
* `GET /users/:userId`) when the request is authenticated; OMITTED for
|
|
1098
|
+
* anonymous requests and for the bulk `POST /users/by-ids` fan-out.
|
|
1099
|
+
*/
|
|
1100
|
+
relationship: z.ZodOptional<z.ZodType<UserRelationship, z.ZodTypeDef, UserRelationship>>;
|
|
1101
|
+
/**
|
|
1102
|
+
* Portable theme preference. Rides the self/session payload (cold boot),
|
|
1103
|
+
* so it is present on the current-user DTO (`GET /users/me`,
|
|
1104
|
+
* `GET /session/user/:sessionId`) and absent until the user sets it.
|
|
1105
|
+
*/
|
|
1106
|
+
themePreference: z.ZodOptional<z.ZodType<ThemePreference, z.ZodTypeDef, ThemePreference>>;
|
|
1107
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
1108
|
+
}, "strip", z.ZodTypeAny, {
|
|
1109
|
+
sessionId: string;
|
|
1110
|
+
isCurrent?: boolean | undefined;
|
|
1111
|
+
user?: z.objectOutputType<{
|
|
1112
|
+
/** MongoDB ObjectId as a string. Present on `formatUserResponse` output. */
|
|
1113
|
+
id: z.ZodOptional<z.ZodString>;
|
|
1114
|
+
/** Raw-document id (e.g. `GET /users/me`). Present when `id` is not. */
|
|
1115
|
+
_id: z.ZodOptional<z.ZodString>;
|
|
1116
|
+
publicKey: z.ZodOptional<z.ZodString>;
|
|
1117
|
+
username: z.ZodOptional<z.ZodString>;
|
|
1118
|
+
email: z.ZodOptional<z.ZodString>;
|
|
1119
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
1120
|
+
address: z.ZodOptional<z.ZodString>;
|
|
1121
|
+
birthday: z.ZodOptional<z.ZodString>;
|
|
1122
|
+
/** Avatar file id (string) or null. */
|
|
1123
|
+
avatar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1124
|
+
/** Named Bloom color preset (e.g. `"blue"`) or null. */
|
|
1125
|
+
color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1126
|
+
name: z.ZodType<UserNameResponse, z.ZodTypeDef, UserNameResponse>;
|
|
1127
|
+
verified: z.ZodOptional<z.ZodBoolean>;
|
|
1128
|
+
/**
|
|
1129
|
+
* The account's languages as full BCP-47 locales (`language-REGION`,
|
|
1130
|
+
* e.g. `es-ES`, `en-US`, `pt-BR`), ordered with the PRIMARY (UI) locale
|
|
1131
|
+
* first. `languages[0]` is the primary locale — there is no singular
|
|
1132
|
+
* `language` field.
|
|
1133
|
+
*/
|
|
1134
|
+
languages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1135
|
+
/**
|
|
1136
|
+
* The account's self-sovereign identifier
|
|
1137
|
+
* (`did:web:<FEDERATION_DOMAIN>:u:<userId>`). Surfaced as a `User`
|
|
1138
|
+
* virtual; present on formatted DTOs once the identity layer is live.
|
|
1139
|
+
*/
|
|
1140
|
+
did: z.ZodOptional<z.ZodString>;
|
|
1141
|
+
/**
|
|
1142
|
+
* Proven domain-ownership badges. Each is a {@link verifiedDomainSchema}
|
|
1143
|
+
* entry; present only when the account has verified at least one domain.
|
|
1144
|
+
*/
|
|
1145
|
+
verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
|
|
1146
|
+
/**
|
|
1147
|
+
* Account-graph classification — what KIND of account this is.
|
|
1148
|
+
*
|
|
1149
|
+
* ORTHOGONAL to `type` (`local` / `federated` / `agent` / `automated`),
|
|
1150
|
+
* which says where the account lives and how it is driven; the two
|
|
1151
|
+
* coexist and neither substitutes for the other. A `channel` is a
|
|
1152
|
+
* publishing identity nobody can act as, so a consumer that renders
|
|
1153
|
+
* authored content reads THIS to tell a channel's post from a person's.
|
|
1154
|
+
*
|
|
1155
|
+
* Optional because a DTO produced from a source that never carried the
|
|
1156
|
+
* column omits it; absent should be read as `personal`, the column's
|
|
1157
|
+
* default, not as unknown.
|
|
1158
|
+
*/
|
|
1159
|
+
kind: z.ZodOptional<z.ZodEnum<["personal", "organization", "project", "bot", "channel"]>>;
|
|
1160
|
+
/**
|
|
1161
|
+
* What this account is about — the field a profile screen RENDERS.
|
|
1162
|
+
*
|
|
1163
|
+
* **Ordered, primary first.** `accountCategories[0]` is the primary
|
|
1164
|
+
* category; there is deliberately no sibling `primaryCategory` field,
|
|
1165
|
+
* because two representations of one fact can disagree (see rule 2 in
|
|
1166
|
+
* `accountGraph.ts`). Nothing downstream may sort, de-duplicate or
|
|
1167
|
+
* otherwise reorder this array.
|
|
1168
|
+
*
|
|
1169
|
+
* **Ids, never labels.** Each element is a stable slug; the visible text
|
|
1170
|
+
* comes from the reader's own translation catalogue, keyed
|
|
1171
|
+
* `accounts.accountCategory.<id>`. A label on the wire would paint every
|
|
1172
|
+
* profile in the language of whoever picked it.
|
|
1173
|
+
*
|
|
1174
|
+
* Absent when the account has none — which is every `personal` account,
|
|
1175
|
+
* and any non-personal one that has not chosen. A renderer reads
|
|
1176
|
+
* `user.accountCategories ?? []`.
|
|
1177
|
+
*/
|
|
1178
|
+
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")[]>>;
|
|
1179
|
+
/**
|
|
1180
|
+
* The authenticated viewer's relationship to this profile. Present ONLY
|
|
1181
|
+
* on single-profile fetches (`GET /profiles/username/:username`,
|
|
1182
|
+
* `GET /users/:userId`) when the request is authenticated; OMITTED for
|
|
1183
|
+
* anonymous requests and for the bulk `POST /users/by-ids` fan-out.
|
|
1184
|
+
*/
|
|
1185
|
+
relationship: z.ZodOptional<z.ZodType<UserRelationship, z.ZodTypeDef, UserRelationship>>;
|
|
1186
|
+
/**
|
|
1187
|
+
* Portable theme preference. Rides the self/session payload (cold boot),
|
|
1188
|
+
* so it is present on the current-user DTO (`GET /users/me`,
|
|
1189
|
+
* `GET /session/user/:sessionId`) and absent until the user sets it.
|
|
1190
|
+
*/
|
|
1191
|
+
themePreference: z.ZodOptional<z.ZodType<ThemePreference, z.ZodTypeDef, ThemePreference>>;
|
|
1192
|
+
}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
1193
|
+
}, {
|
|
1194
|
+
sessionId: string;
|
|
1195
|
+
isCurrent?: boolean | undefined;
|
|
1196
|
+
user?: z.objectInputType<{
|
|
1197
|
+
/** MongoDB ObjectId as a string. Present on `formatUserResponse` output. */
|
|
1198
|
+
id: z.ZodOptional<z.ZodString>;
|
|
1199
|
+
/** Raw-document id (e.g. `GET /users/me`). Present when `id` is not. */
|
|
1200
|
+
_id: z.ZodOptional<z.ZodString>;
|
|
1201
|
+
publicKey: z.ZodOptional<z.ZodString>;
|
|
1202
|
+
username: z.ZodOptional<z.ZodString>;
|
|
1203
|
+
email: z.ZodOptional<z.ZodString>;
|
|
1204
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
1205
|
+
address: z.ZodOptional<z.ZodString>;
|
|
1206
|
+
birthday: z.ZodOptional<z.ZodString>;
|
|
1207
|
+
/** Avatar file id (string) or null. */
|
|
1208
|
+
avatar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1209
|
+
/** Named Bloom color preset (e.g. `"blue"`) or null. */
|
|
1210
|
+
color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1211
|
+
name: z.ZodType<UserNameResponse, z.ZodTypeDef, UserNameResponse>;
|
|
1212
|
+
verified: z.ZodOptional<z.ZodBoolean>;
|
|
1213
|
+
/**
|
|
1214
|
+
* The account's languages as full BCP-47 locales (`language-REGION`,
|
|
1215
|
+
* e.g. `es-ES`, `en-US`, `pt-BR`), ordered with the PRIMARY (UI) locale
|
|
1216
|
+
* first. `languages[0]` is the primary locale — there is no singular
|
|
1217
|
+
* `language` field.
|
|
1218
|
+
*/
|
|
1219
|
+
languages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1220
|
+
/**
|
|
1221
|
+
* The account's self-sovereign identifier
|
|
1222
|
+
* (`did:web:<FEDERATION_DOMAIN>:u:<userId>`). Surfaced as a `User`
|
|
1223
|
+
* virtual; present on formatted DTOs once the identity layer is live.
|
|
1224
|
+
*/
|
|
1225
|
+
did: z.ZodOptional<z.ZodString>;
|
|
1226
|
+
/**
|
|
1227
|
+
* Proven domain-ownership badges. Each is a {@link verifiedDomainSchema}
|
|
1228
|
+
* entry; present only when the account has verified at least one domain.
|
|
1229
|
+
*/
|
|
1230
|
+
verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
|
|
1231
|
+
/**
|
|
1232
|
+
* Account-graph classification — what KIND of account this is.
|
|
1233
|
+
*
|
|
1234
|
+
* ORTHOGONAL to `type` (`local` / `federated` / `agent` / `automated`),
|
|
1235
|
+
* which says where the account lives and how it is driven; the two
|
|
1236
|
+
* coexist and neither substitutes for the other. A `channel` is a
|
|
1237
|
+
* publishing identity nobody can act as, so a consumer that renders
|
|
1238
|
+
* authored content reads THIS to tell a channel's post from a person's.
|
|
1239
|
+
*
|
|
1240
|
+
* Optional because a DTO produced from a source that never carried the
|
|
1241
|
+
* column omits it; absent should be read as `personal`, the column's
|
|
1242
|
+
* default, not as unknown.
|
|
1243
|
+
*/
|
|
1244
|
+
kind: z.ZodOptional<z.ZodEnum<["personal", "organization", "project", "bot", "channel"]>>;
|
|
1245
|
+
/**
|
|
1246
|
+
* What this account is about — the field a profile screen RENDERS.
|
|
1247
|
+
*
|
|
1248
|
+
* **Ordered, primary first.** `accountCategories[0]` is the primary
|
|
1249
|
+
* category; there is deliberately no sibling `primaryCategory` field,
|
|
1250
|
+
* because two representations of one fact can disagree (see rule 2 in
|
|
1251
|
+
* `accountGraph.ts`). Nothing downstream may sort, de-duplicate or
|
|
1252
|
+
* otherwise reorder this array.
|
|
1253
|
+
*
|
|
1254
|
+
* **Ids, never labels.** Each element is a stable slug; the visible text
|
|
1255
|
+
* comes from the reader's own translation catalogue, keyed
|
|
1256
|
+
* `accounts.accountCategory.<id>`. A label on the wire would paint every
|
|
1257
|
+
* profile in the language of whoever picked it.
|
|
1258
|
+
*
|
|
1259
|
+
* Absent when the account has none — which is every `personal` account,
|
|
1260
|
+
* and any non-personal one that has not chosen. A renderer reads
|
|
1261
|
+
* `user.accountCategories ?? []`.
|
|
1262
|
+
*/
|
|
1263
|
+
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")[]>>;
|
|
1264
|
+
/**
|
|
1265
|
+
* The authenticated viewer's relationship to this profile. Present ONLY
|
|
1266
|
+
* on single-profile fetches (`GET /profiles/username/:username`,
|
|
1267
|
+
* `GET /users/:userId`) when the request is authenticated; OMITTED for
|
|
1268
|
+
* anonymous requests and for the bulk `POST /users/by-ids` fan-out.
|
|
1269
|
+
*/
|
|
1270
|
+
relationship: z.ZodOptional<z.ZodType<UserRelationship, z.ZodTypeDef, UserRelationship>>;
|
|
1271
|
+
/**
|
|
1272
|
+
* Portable theme preference. Rides the self/session payload (cold boot),
|
|
1273
|
+
* so it is present on the current-user DTO (`GET /users/me`,
|
|
1274
|
+
* `GET /session/user/:sessionId`) and absent until the user sets it.
|
|
1275
|
+
*/
|
|
1276
|
+
themePreference: z.ZodOptional<z.ZodType<ThemePreference, z.ZodTypeDef, ThemePreference>>;
|
|
1277
|
+
}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
1278
|
+
}>;
|
|
1279
|
+
export type DeviceLinkedSessionResponse = z.infer<typeof deviceLinkedSessionSchema>;
|
|
1280
|
+
/** Wire shape of `GET /session/device/sessions/:sessionId` (an array). */
|
|
1281
|
+
export declare const deviceLinkedSessionsResponseSchema: z.ZodArray<z.ZodObject<{
|
|
1282
|
+
sessionId: z.ZodString;
|
|
1283
|
+
isCurrent: z.ZodOptional<z.ZodBoolean>;
|
|
1284
|
+
user: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
1285
|
+
/** MongoDB ObjectId as a string. Present on `formatUserResponse` output. */
|
|
1286
|
+
id: z.ZodOptional<z.ZodString>;
|
|
1287
|
+
/** Raw-document id (e.g. `GET /users/me`). Present when `id` is not. */
|
|
1288
|
+
_id: z.ZodOptional<z.ZodString>;
|
|
1289
|
+
publicKey: z.ZodOptional<z.ZodString>;
|
|
1290
|
+
username: z.ZodOptional<z.ZodString>;
|
|
1291
|
+
email: z.ZodOptional<z.ZodString>;
|
|
1292
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
1293
|
+
address: z.ZodOptional<z.ZodString>;
|
|
1294
|
+
birthday: z.ZodOptional<z.ZodString>;
|
|
1295
|
+
/** Avatar file id (string) or null. */
|
|
1296
|
+
avatar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1297
|
+
/** Named Bloom color preset (e.g. `"blue"`) or null. */
|
|
1298
|
+
color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1299
|
+
name: z.ZodType<UserNameResponse, z.ZodTypeDef, UserNameResponse>;
|
|
1300
|
+
verified: z.ZodOptional<z.ZodBoolean>;
|
|
1301
|
+
/**
|
|
1302
|
+
* The account's languages as full BCP-47 locales (`language-REGION`,
|
|
1303
|
+
* e.g. `es-ES`, `en-US`, `pt-BR`), ordered with the PRIMARY (UI) locale
|
|
1304
|
+
* first. `languages[0]` is the primary locale — there is no singular
|
|
1305
|
+
* `language` field.
|
|
1306
|
+
*/
|
|
1307
|
+
languages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1308
|
+
/**
|
|
1309
|
+
* The account's self-sovereign identifier
|
|
1310
|
+
* (`did:web:<FEDERATION_DOMAIN>:u:<userId>`). Surfaced as a `User`
|
|
1311
|
+
* virtual; present on formatted DTOs once the identity layer is live.
|
|
1312
|
+
*/
|
|
1313
|
+
did: z.ZodOptional<z.ZodString>;
|
|
1314
|
+
/**
|
|
1315
|
+
* Proven domain-ownership badges. Each is a {@link verifiedDomainSchema}
|
|
1316
|
+
* entry; present only when the account has verified at least one domain.
|
|
1317
|
+
*/
|
|
1318
|
+
verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
|
|
1319
|
+
/**
|
|
1320
|
+
* Account-graph classification — what KIND of account this is.
|
|
1321
|
+
*
|
|
1322
|
+
* ORTHOGONAL to `type` (`local` / `federated` / `agent` / `automated`),
|
|
1323
|
+
* which says where the account lives and how it is driven; the two
|
|
1324
|
+
* coexist and neither substitutes for the other. A `channel` is a
|
|
1325
|
+
* publishing identity nobody can act as, so a consumer that renders
|
|
1326
|
+
* authored content reads THIS to tell a channel's post from a person's.
|
|
1327
|
+
*
|
|
1328
|
+
* Optional because a DTO produced from a source that never carried the
|
|
1329
|
+
* column omits it; absent should be read as `personal`, the column's
|
|
1330
|
+
* default, not as unknown.
|
|
1331
|
+
*/
|
|
1332
|
+
kind: z.ZodOptional<z.ZodEnum<["personal", "organization", "project", "bot", "channel"]>>;
|
|
1333
|
+
/**
|
|
1334
|
+
* What this account is about — the field a profile screen RENDERS.
|
|
1335
|
+
*
|
|
1336
|
+
* **Ordered, primary first.** `accountCategories[0]` is the primary
|
|
1337
|
+
* category; there is deliberately no sibling `primaryCategory` field,
|
|
1338
|
+
* because two representations of one fact can disagree (see rule 2 in
|
|
1339
|
+
* `accountGraph.ts`). Nothing downstream may sort, de-duplicate or
|
|
1340
|
+
* otherwise reorder this array.
|
|
1341
|
+
*
|
|
1342
|
+
* **Ids, never labels.** Each element is a stable slug; the visible text
|
|
1343
|
+
* comes from the reader's own translation catalogue, keyed
|
|
1344
|
+
* `accounts.accountCategory.<id>`. A label on the wire would paint every
|
|
1345
|
+
* profile in the language of whoever picked it.
|
|
1346
|
+
*
|
|
1347
|
+
* Absent when the account has none — which is every `personal` account,
|
|
1348
|
+
* and any non-personal one that has not chosen. A renderer reads
|
|
1349
|
+
* `user.accountCategories ?? []`.
|
|
1350
|
+
*/
|
|
1351
|
+
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")[]>>;
|
|
1352
|
+
/**
|
|
1353
|
+
* The authenticated viewer's relationship to this profile. Present ONLY
|
|
1354
|
+
* on single-profile fetches (`GET /profiles/username/:username`,
|
|
1355
|
+
* `GET /users/:userId`) when the request is authenticated; OMITTED for
|
|
1356
|
+
* anonymous requests and for the bulk `POST /users/by-ids` fan-out.
|
|
1357
|
+
*/
|
|
1358
|
+
relationship: z.ZodOptional<z.ZodType<UserRelationship, z.ZodTypeDef, UserRelationship>>;
|
|
1359
|
+
/**
|
|
1360
|
+
* Portable theme preference. Rides the self/session payload (cold boot),
|
|
1361
|
+
* so it is present on the current-user DTO (`GET /users/me`,
|
|
1362
|
+
* `GET /session/user/:sessionId`) and absent until the user sets it.
|
|
1363
|
+
*/
|
|
1364
|
+
themePreference: z.ZodOptional<z.ZodType<ThemePreference, z.ZodTypeDef, ThemePreference>>;
|
|
1365
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
1366
|
+
/** MongoDB ObjectId as a string. Present on `formatUserResponse` output. */
|
|
1367
|
+
id: z.ZodOptional<z.ZodString>;
|
|
1368
|
+
/** Raw-document id (e.g. `GET /users/me`). Present when `id` is not. */
|
|
1369
|
+
_id: z.ZodOptional<z.ZodString>;
|
|
1370
|
+
publicKey: z.ZodOptional<z.ZodString>;
|
|
1371
|
+
username: z.ZodOptional<z.ZodString>;
|
|
1372
|
+
email: z.ZodOptional<z.ZodString>;
|
|
1373
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
1374
|
+
address: z.ZodOptional<z.ZodString>;
|
|
1375
|
+
birthday: z.ZodOptional<z.ZodString>;
|
|
1376
|
+
/** Avatar file id (string) or null. */
|
|
1377
|
+
avatar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1378
|
+
/** Named Bloom color preset (e.g. `"blue"`) or null. */
|
|
1379
|
+
color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1380
|
+
name: z.ZodType<UserNameResponse, z.ZodTypeDef, UserNameResponse>;
|
|
1381
|
+
verified: z.ZodOptional<z.ZodBoolean>;
|
|
1382
|
+
/**
|
|
1383
|
+
* The account's languages as full BCP-47 locales (`language-REGION`,
|
|
1384
|
+
* e.g. `es-ES`, `en-US`, `pt-BR`), ordered with the PRIMARY (UI) locale
|
|
1385
|
+
* first. `languages[0]` is the primary locale — there is no singular
|
|
1386
|
+
* `language` field.
|
|
1387
|
+
*/
|
|
1388
|
+
languages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1389
|
+
/**
|
|
1390
|
+
* The account's self-sovereign identifier
|
|
1391
|
+
* (`did:web:<FEDERATION_DOMAIN>:u:<userId>`). Surfaced as a `User`
|
|
1392
|
+
* virtual; present on formatted DTOs once the identity layer is live.
|
|
1393
|
+
*/
|
|
1394
|
+
did: z.ZodOptional<z.ZodString>;
|
|
1395
|
+
/**
|
|
1396
|
+
* Proven domain-ownership badges. Each is a {@link verifiedDomainSchema}
|
|
1397
|
+
* entry; present only when the account has verified at least one domain.
|
|
1398
|
+
*/
|
|
1399
|
+
verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
|
|
1400
|
+
/**
|
|
1401
|
+
* Account-graph classification — what KIND of account this is.
|
|
1402
|
+
*
|
|
1403
|
+
* ORTHOGONAL to `type` (`local` / `federated` / `agent` / `automated`),
|
|
1404
|
+
* which says where the account lives and how it is driven; the two
|
|
1405
|
+
* coexist and neither substitutes for the other. A `channel` is a
|
|
1406
|
+
* publishing identity nobody can act as, so a consumer that renders
|
|
1407
|
+
* authored content reads THIS to tell a channel's post from a person's.
|
|
1408
|
+
*
|
|
1409
|
+
* Optional because a DTO produced from a source that never carried the
|
|
1410
|
+
* column omits it; absent should be read as `personal`, the column's
|
|
1411
|
+
* default, not as unknown.
|
|
1412
|
+
*/
|
|
1413
|
+
kind: z.ZodOptional<z.ZodEnum<["personal", "organization", "project", "bot", "channel"]>>;
|
|
1414
|
+
/**
|
|
1415
|
+
* What this account is about — the field a profile screen RENDERS.
|
|
1416
|
+
*
|
|
1417
|
+
* **Ordered, primary first.** `accountCategories[0]` is the primary
|
|
1418
|
+
* category; there is deliberately no sibling `primaryCategory` field,
|
|
1419
|
+
* because two representations of one fact can disagree (see rule 2 in
|
|
1420
|
+
* `accountGraph.ts`). Nothing downstream may sort, de-duplicate or
|
|
1421
|
+
* otherwise reorder this array.
|
|
1422
|
+
*
|
|
1423
|
+
* **Ids, never labels.** Each element is a stable slug; the visible text
|
|
1424
|
+
* comes from the reader's own translation catalogue, keyed
|
|
1425
|
+
* `accounts.accountCategory.<id>`. A label on the wire would paint every
|
|
1426
|
+
* profile in the language of whoever picked it.
|
|
1427
|
+
*
|
|
1428
|
+
* Absent when the account has none — which is every `personal` account,
|
|
1429
|
+
* and any non-personal one that has not chosen. A renderer reads
|
|
1430
|
+
* `user.accountCategories ?? []`.
|
|
1431
|
+
*/
|
|
1432
|
+
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")[]>>;
|
|
1433
|
+
/**
|
|
1434
|
+
* The authenticated viewer's relationship to this profile. Present ONLY
|
|
1435
|
+
* on single-profile fetches (`GET /profiles/username/:username`,
|
|
1436
|
+
* `GET /users/:userId`) when the request is authenticated; OMITTED for
|
|
1437
|
+
* anonymous requests and for the bulk `POST /users/by-ids` fan-out.
|
|
1438
|
+
*/
|
|
1439
|
+
relationship: z.ZodOptional<z.ZodType<UserRelationship, z.ZodTypeDef, UserRelationship>>;
|
|
1440
|
+
/**
|
|
1441
|
+
* Portable theme preference. Rides the self/session payload (cold boot),
|
|
1442
|
+
* so it is present on the current-user DTO (`GET /users/me`,
|
|
1443
|
+
* `GET /session/user/:sessionId`) and absent until the user sets it.
|
|
1444
|
+
*/
|
|
1445
|
+
themePreference: z.ZodOptional<z.ZodType<ThemePreference, z.ZodTypeDef, ThemePreference>>;
|
|
1446
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
1447
|
+
/** MongoDB ObjectId as a string. Present on `formatUserResponse` output. */
|
|
1448
|
+
id: z.ZodOptional<z.ZodString>;
|
|
1449
|
+
/** Raw-document id (e.g. `GET /users/me`). Present when `id` is not. */
|
|
1450
|
+
_id: z.ZodOptional<z.ZodString>;
|
|
1451
|
+
publicKey: z.ZodOptional<z.ZodString>;
|
|
1452
|
+
username: z.ZodOptional<z.ZodString>;
|
|
1453
|
+
email: z.ZodOptional<z.ZodString>;
|
|
1454
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
1455
|
+
address: z.ZodOptional<z.ZodString>;
|
|
1456
|
+
birthday: z.ZodOptional<z.ZodString>;
|
|
1457
|
+
/** Avatar file id (string) or null. */
|
|
1458
|
+
avatar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1459
|
+
/** Named Bloom color preset (e.g. `"blue"`) or null. */
|
|
1460
|
+
color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1461
|
+
name: z.ZodType<UserNameResponse, z.ZodTypeDef, UserNameResponse>;
|
|
1462
|
+
verified: z.ZodOptional<z.ZodBoolean>;
|
|
1463
|
+
/**
|
|
1464
|
+
* The account's languages as full BCP-47 locales (`language-REGION`,
|
|
1465
|
+
* e.g. `es-ES`, `en-US`, `pt-BR`), ordered with the PRIMARY (UI) locale
|
|
1466
|
+
* first. `languages[0]` is the primary locale — there is no singular
|
|
1467
|
+
* `language` field.
|
|
1468
|
+
*/
|
|
1469
|
+
languages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1470
|
+
/**
|
|
1471
|
+
* The account's self-sovereign identifier
|
|
1472
|
+
* (`did:web:<FEDERATION_DOMAIN>:u:<userId>`). Surfaced as a `User`
|
|
1473
|
+
* virtual; present on formatted DTOs once the identity layer is live.
|
|
1474
|
+
*/
|
|
1475
|
+
did: z.ZodOptional<z.ZodString>;
|
|
1476
|
+
/**
|
|
1477
|
+
* Proven domain-ownership badges. Each is a {@link verifiedDomainSchema}
|
|
1478
|
+
* entry; present only when the account has verified at least one domain.
|
|
1479
|
+
*/
|
|
1480
|
+
verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
|
|
1481
|
+
/**
|
|
1482
|
+
* Account-graph classification — what KIND of account this is.
|
|
1483
|
+
*
|
|
1484
|
+
* ORTHOGONAL to `type` (`local` / `federated` / `agent` / `automated`),
|
|
1485
|
+
* which says where the account lives and how it is driven; the two
|
|
1486
|
+
* coexist and neither substitutes for the other. A `channel` is a
|
|
1487
|
+
* publishing identity nobody can act as, so a consumer that renders
|
|
1488
|
+
* authored content reads THIS to tell a channel's post from a person's.
|
|
1489
|
+
*
|
|
1490
|
+
* Optional because a DTO produced from a source that never carried the
|
|
1491
|
+
* column omits it; absent should be read as `personal`, the column's
|
|
1492
|
+
* default, not as unknown.
|
|
1493
|
+
*/
|
|
1494
|
+
kind: z.ZodOptional<z.ZodEnum<["personal", "organization", "project", "bot", "channel"]>>;
|
|
1495
|
+
/**
|
|
1496
|
+
* What this account is about — the field a profile screen RENDERS.
|
|
1497
|
+
*
|
|
1498
|
+
* **Ordered, primary first.** `accountCategories[0]` is the primary
|
|
1499
|
+
* category; there is deliberately no sibling `primaryCategory` field,
|
|
1500
|
+
* because two representations of one fact can disagree (see rule 2 in
|
|
1501
|
+
* `accountGraph.ts`). Nothing downstream may sort, de-duplicate or
|
|
1502
|
+
* otherwise reorder this array.
|
|
1503
|
+
*
|
|
1504
|
+
* **Ids, never labels.** Each element is a stable slug; the visible text
|
|
1505
|
+
* comes from the reader's own translation catalogue, keyed
|
|
1506
|
+
* `accounts.accountCategory.<id>`. A label on the wire would paint every
|
|
1507
|
+
* profile in the language of whoever picked it.
|
|
1508
|
+
*
|
|
1509
|
+
* Absent when the account has none — which is every `personal` account,
|
|
1510
|
+
* and any non-personal one that has not chosen. A renderer reads
|
|
1511
|
+
* `user.accountCategories ?? []`.
|
|
1512
|
+
*/
|
|
1513
|
+
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")[]>>;
|
|
1514
|
+
/**
|
|
1515
|
+
* The authenticated viewer's relationship to this profile. Present ONLY
|
|
1516
|
+
* on single-profile fetches (`GET /profiles/username/:username`,
|
|
1517
|
+
* `GET /users/:userId`) when the request is authenticated; OMITTED for
|
|
1518
|
+
* anonymous requests and for the bulk `POST /users/by-ids` fan-out.
|
|
1519
|
+
*/
|
|
1520
|
+
relationship: z.ZodOptional<z.ZodType<UserRelationship, z.ZodTypeDef, UserRelationship>>;
|
|
1521
|
+
/**
|
|
1522
|
+
* Portable theme preference. Rides the self/session payload (cold boot),
|
|
1523
|
+
* so it is present on the current-user DTO (`GET /users/me`,
|
|
1524
|
+
* `GET /session/user/:sessionId`) and absent until the user sets it.
|
|
1525
|
+
*/
|
|
1526
|
+
themePreference: z.ZodOptional<z.ZodType<ThemePreference, z.ZodTypeDef, ThemePreference>>;
|
|
1527
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
1528
|
+
}, "strip", z.ZodTypeAny, {
|
|
1529
|
+
sessionId: string;
|
|
1530
|
+
isCurrent?: boolean | undefined;
|
|
1531
|
+
user?: z.objectOutputType<{
|
|
1532
|
+
/** MongoDB ObjectId as a string. Present on `formatUserResponse` output. */
|
|
1533
|
+
id: z.ZodOptional<z.ZodString>;
|
|
1534
|
+
/** Raw-document id (e.g. `GET /users/me`). Present when `id` is not. */
|
|
1535
|
+
_id: z.ZodOptional<z.ZodString>;
|
|
1536
|
+
publicKey: z.ZodOptional<z.ZodString>;
|
|
1537
|
+
username: z.ZodOptional<z.ZodString>;
|
|
1538
|
+
email: z.ZodOptional<z.ZodString>;
|
|
1539
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
1540
|
+
address: z.ZodOptional<z.ZodString>;
|
|
1541
|
+
birthday: z.ZodOptional<z.ZodString>;
|
|
1542
|
+
/** Avatar file id (string) or null. */
|
|
1543
|
+
avatar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1544
|
+
/** Named Bloom color preset (e.g. `"blue"`) or null. */
|
|
1545
|
+
color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1546
|
+
name: z.ZodType<UserNameResponse, z.ZodTypeDef, UserNameResponse>;
|
|
1547
|
+
verified: z.ZodOptional<z.ZodBoolean>;
|
|
1548
|
+
/**
|
|
1549
|
+
* The account's languages as full BCP-47 locales (`language-REGION`,
|
|
1550
|
+
* e.g. `es-ES`, `en-US`, `pt-BR`), ordered with the PRIMARY (UI) locale
|
|
1551
|
+
* first. `languages[0]` is the primary locale — there is no singular
|
|
1552
|
+
* `language` field.
|
|
1553
|
+
*/
|
|
1554
|
+
languages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1555
|
+
/**
|
|
1556
|
+
* The account's self-sovereign identifier
|
|
1557
|
+
* (`did:web:<FEDERATION_DOMAIN>:u:<userId>`). Surfaced as a `User`
|
|
1558
|
+
* virtual; present on formatted DTOs once the identity layer is live.
|
|
1559
|
+
*/
|
|
1560
|
+
did: z.ZodOptional<z.ZodString>;
|
|
1561
|
+
/**
|
|
1562
|
+
* Proven domain-ownership badges. Each is a {@link verifiedDomainSchema}
|
|
1563
|
+
* entry; present only when the account has verified at least one domain.
|
|
1564
|
+
*/
|
|
1565
|
+
verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
|
|
1566
|
+
/**
|
|
1567
|
+
* Account-graph classification — what KIND of account this is.
|
|
1568
|
+
*
|
|
1569
|
+
* ORTHOGONAL to `type` (`local` / `federated` / `agent` / `automated`),
|
|
1570
|
+
* which says where the account lives and how it is driven; the two
|
|
1571
|
+
* coexist and neither substitutes for the other. A `channel` is a
|
|
1572
|
+
* publishing identity nobody can act as, so a consumer that renders
|
|
1573
|
+
* authored content reads THIS to tell a channel's post from a person's.
|
|
1574
|
+
*
|
|
1575
|
+
* Optional because a DTO produced from a source that never carried the
|
|
1576
|
+
* column omits it; absent should be read as `personal`, the column's
|
|
1577
|
+
* default, not as unknown.
|
|
1578
|
+
*/
|
|
1579
|
+
kind: z.ZodOptional<z.ZodEnum<["personal", "organization", "project", "bot", "channel"]>>;
|
|
1580
|
+
/**
|
|
1581
|
+
* What this account is about — the field a profile screen RENDERS.
|
|
1582
|
+
*
|
|
1583
|
+
* **Ordered, primary first.** `accountCategories[0]` is the primary
|
|
1584
|
+
* category; there is deliberately no sibling `primaryCategory` field,
|
|
1585
|
+
* because two representations of one fact can disagree (see rule 2 in
|
|
1586
|
+
* `accountGraph.ts`). Nothing downstream may sort, de-duplicate or
|
|
1587
|
+
* otherwise reorder this array.
|
|
1588
|
+
*
|
|
1589
|
+
* **Ids, never labels.** Each element is a stable slug; the visible text
|
|
1590
|
+
* comes from the reader's own translation catalogue, keyed
|
|
1591
|
+
* `accounts.accountCategory.<id>`. A label on the wire would paint every
|
|
1592
|
+
* profile in the language of whoever picked it.
|
|
1593
|
+
*
|
|
1594
|
+
* Absent when the account has none — which is every `personal` account,
|
|
1595
|
+
* and any non-personal one that has not chosen. A renderer reads
|
|
1596
|
+
* `user.accountCategories ?? []`.
|
|
1597
|
+
*/
|
|
1598
|
+
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")[]>>;
|
|
1599
|
+
/**
|
|
1600
|
+
* The authenticated viewer's relationship to this profile. Present ONLY
|
|
1601
|
+
* on single-profile fetches (`GET /profiles/username/:username`,
|
|
1602
|
+
* `GET /users/:userId`) when the request is authenticated; OMITTED for
|
|
1603
|
+
* anonymous requests and for the bulk `POST /users/by-ids` fan-out.
|
|
1604
|
+
*/
|
|
1605
|
+
relationship: z.ZodOptional<z.ZodType<UserRelationship, z.ZodTypeDef, UserRelationship>>;
|
|
1606
|
+
/**
|
|
1607
|
+
* Portable theme preference. Rides the self/session payload (cold boot),
|
|
1608
|
+
* so it is present on the current-user DTO (`GET /users/me`,
|
|
1609
|
+
* `GET /session/user/:sessionId`) and absent until the user sets it.
|
|
1610
|
+
*/
|
|
1611
|
+
themePreference: z.ZodOptional<z.ZodType<ThemePreference, z.ZodTypeDef, ThemePreference>>;
|
|
1612
|
+
}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
1613
|
+
}, {
|
|
1614
|
+
sessionId: string;
|
|
1615
|
+
isCurrent?: boolean | undefined;
|
|
1616
|
+
user?: z.objectInputType<{
|
|
1617
|
+
/** MongoDB ObjectId as a string. Present on `formatUserResponse` output. */
|
|
1618
|
+
id: z.ZodOptional<z.ZodString>;
|
|
1619
|
+
/** Raw-document id (e.g. `GET /users/me`). Present when `id` is not. */
|
|
1620
|
+
_id: z.ZodOptional<z.ZodString>;
|
|
1621
|
+
publicKey: z.ZodOptional<z.ZodString>;
|
|
1622
|
+
username: z.ZodOptional<z.ZodString>;
|
|
1623
|
+
email: z.ZodOptional<z.ZodString>;
|
|
1624
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
1625
|
+
address: z.ZodOptional<z.ZodString>;
|
|
1626
|
+
birthday: z.ZodOptional<z.ZodString>;
|
|
1627
|
+
/** Avatar file id (string) or null. */
|
|
1628
|
+
avatar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1629
|
+
/** Named Bloom color preset (e.g. `"blue"`) or null. */
|
|
1630
|
+
color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1631
|
+
name: z.ZodType<UserNameResponse, z.ZodTypeDef, UserNameResponse>;
|
|
1632
|
+
verified: z.ZodOptional<z.ZodBoolean>;
|
|
1633
|
+
/**
|
|
1634
|
+
* The account's languages as full BCP-47 locales (`language-REGION`,
|
|
1635
|
+
* e.g. `es-ES`, `en-US`, `pt-BR`), ordered with the PRIMARY (UI) locale
|
|
1636
|
+
* first. `languages[0]` is the primary locale — there is no singular
|
|
1637
|
+
* `language` field.
|
|
1638
|
+
*/
|
|
1639
|
+
languages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1640
|
+
/**
|
|
1641
|
+
* The account's self-sovereign identifier
|
|
1642
|
+
* (`did:web:<FEDERATION_DOMAIN>:u:<userId>`). Surfaced as a `User`
|
|
1643
|
+
* virtual; present on formatted DTOs once the identity layer is live.
|
|
1644
|
+
*/
|
|
1645
|
+
did: z.ZodOptional<z.ZodString>;
|
|
1646
|
+
/**
|
|
1647
|
+
* Proven domain-ownership badges. Each is a {@link verifiedDomainSchema}
|
|
1648
|
+
* entry; present only when the account has verified at least one domain.
|
|
1649
|
+
*/
|
|
1650
|
+
verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
|
|
1651
|
+
/**
|
|
1652
|
+
* Account-graph classification — what KIND of account this is.
|
|
1653
|
+
*
|
|
1654
|
+
* ORTHOGONAL to `type` (`local` / `federated` / `agent` / `automated`),
|
|
1655
|
+
* which says where the account lives and how it is driven; the two
|
|
1656
|
+
* coexist and neither substitutes for the other. A `channel` is a
|
|
1657
|
+
* publishing identity nobody can act as, so a consumer that renders
|
|
1658
|
+
* authored content reads THIS to tell a channel's post from a person's.
|
|
1659
|
+
*
|
|
1660
|
+
* Optional because a DTO produced from a source that never carried the
|
|
1661
|
+
* column omits it; absent should be read as `personal`, the column's
|
|
1662
|
+
* default, not as unknown.
|
|
1663
|
+
*/
|
|
1664
|
+
kind: z.ZodOptional<z.ZodEnum<["personal", "organization", "project", "bot", "channel"]>>;
|
|
1665
|
+
/**
|
|
1666
|
+
* What this account is about — the field a profile screen RENDERS.
|
|
1667
|
+
*
|
|
1668
|
+
* **Ordered, primary first.** `accountCategories[0]` is the primary
|
|
1669
|
+
* category; there is deliberately no sibling `primaryCategory` field,
|
|
1670
|
+
* because two representations of one fact can disagree (see rule 2 in
|
|
1671
|
+
* `accountGraph.ts`). Nothing downstream may sort, de-duplicate or
|
|
1672
|
+
* otherwise reorder this array.
|
|
1673
|
+
*
|
|
1674
|
+
* **Ids, never labels.** Each element is a stable slug; the visible text
|
|
1675
|
+
* comes from the reader's own translation catalogue, keyed
|
|
1676
|
+
* `accounts.accountCategory.<id>`. A label on the wire would paint every
|
|
1677
|
+
* profile in the language of whoever picked it.
|
|
1678
|
+
*
|
|
1679
|
+
* Absent when the account has none — which is every `personal` account,
|
|
1680
|
+
* and any non-personal one that has not chosen. A renderer reads
|
|
1681
|
+
* `user.accountCategories ?? []`.
|
|
1682
|
+
*/
|
|
1683
|
+
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")[]>>;
|
|
1684
|
+
/**
|
|
1685
|
+
* The authenticated viewer's relationship to this profile. Present ONLY
|
|
1686
|
+
* on single-profile fetches (`GET /profiles/username/:username`,
|
|
1687
|
+
* `GET /users/:userId`) when the request is authenticated; OMITTED for
|
|
1688
|
+
* anonymous requests and for the bulk `POST /users/by-ids` fan-out.
|
|
1689
|
+
*/
|
|
1690
|
+
relationship: z.ZodOptional<z.ZodType<UserRelationship, z.ZodTypeDef, UserRelationship>>;
|
|
1691
|
+
/**
|
|
1692
|
+
* Portable theme preference. Rides the self/session payload (cold boot),
|
|
1693
|
+
* so it is present on the current-user DTO (`GET /users/me`,
|
|
1694
|
+
* `GET /session/user/:sessionId`) and absent until the user sets it.
|
|
1695
|
+
*/
|
|
1696
|
+
themePreference: z.ZodOptional<z.ZodType<ThemePreference, z.ZodTypeDef, ThemePreference>>;
|
|
1697
|
+
}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
1698
|
+
}>, "many">;
|
|
1699
|
+
export type DeviceLinkedSessionsResponseContract = z.infer<typeof deviceLinkedSessionsResponseSchema>;
|
|
1700
|
+
/**
|
|
1701
|
+
* Safely parse a value against a contract schema. Returns the parsed (typed)
|
|
1702
|
+
* value, or `null` when validation fails — the same ergonomics the auth app's
|
|
1703
|
+
* local `safeParse` provided, now sourced from the contracts package so the
|
|
1704
|
+
* parse helper and the schemas live together.
|
|
1705
|
+
*/
|
|
1706
|
+
export declare function safeParseContract<T>(schema: z.ZodType<T>, data: unknown): T | null;
|