@oxyhq/contracts 0.13.0 → 0.13.2

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.
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Account graph wire contracts — organization taxonomy and create-account input.
3
+ *
4
+ * `organizationCategory` classifies `kind: 'organization'` accounts (agency,
5
+ * cooperative, landlord, …) without polluting `User.kind`. Meaningful only when
6
+ * `kind === 'organization'`.
7
+ */
8
+ import { z } from 'zod';
9
+ export declare const ORGANIZATION_CATEGORIES: readonly ["agency", "cooperative", "landlord", "other"];
10
+ export type OrganizationCategory = (typeof ORGANIZATION_CATEGORIES)[number];
11
+ export declare const organizationCategorySchema: z.ZodEnum<["agency", "cooperative", "landlord", "other"]>;
12
+ /**
13
+ * POST /accounts — create a non-personal account under the caller's tree.
14
+ * `organizationCategory` is accepted only when `kind` is `organization`.
15
+ */
16
+ export declare const createAccountRequestSchema: z.ZodEffects<z.ZodObject<{
17
+ parentAccountId: z.ZodOptional<z.ZodString>;
18
+ kind: z.ZodEnum<["organization", "project", "bot"]>;
19
+ username: z.ZodString;
20
+ name: z.ZodOptional<z.ZodObject<{
21
+ first: z.ZodOptional<z.ZodString>;
22
+ last: z.ZodOptional<z.ZodString>;
23
+ }, "strip", z.ZodTypeAny, {
24
+ first?: string | undefined;
25
+ last?: string | undefined;
26
+ }, {
27
+ first?: string | undefined;
28
+ last?: string | undefined;
29
+ }>>;
30
+ bio: z.ZodOptional<z.ZodString>;
31
+ avatar: z.ZodOptional<z.ZodString>;
32
+ description: z.ZodOptional<z.ZodString>;
33
+ organizationCategory: z.ZodOptional<z.ZodEnum<["agency", "cooperative", "landlord", "other"]>>;
34
+ }, "strip", z.ZodTypeAny, {
35
+ kind: "organization" | "project" | "bot";
36
+ username: string;
37
+ parentAccountId?: string | undefined;
38
+ name?: {
39
+ first?: string | undefined;
40
+ last?: string | undefined;
41
+ } | undefined;
42
+ bio?: string | undefined;
43
+ avatar?: string | undefined;
44
+ description?: string | undefined;
45
+ organizationCategory?: "agency" | "cooperative" | "landlord" | "other" | undefined;
46
+ }, {
47
+ kind: "organization" | "project" | "bot";
48
+ username: string;
49
+ parentAccountId?: string | undefined;
50
+ name?: {
51
+ first?: string | undefined;
52
+ last?: string | undefined;
53
+ } | undefined;
54
+ bio?: string | undefined;
55
+ avatar?: string | undefined;
56
+ description?: string | undefined;
57
+ organizationCategory?: "agency" | "cooperative" | "landlord" | "other" | undefined;
58
+ }>, {
59
+ kind: "organization" | "project" | "bot";
60
+ username: string;
61
+ parentAccountId?: string | undefined;
62
+ name?: {
63
+ first?: string | undefined;
64
+ last?: string | undefined;
65
+ } | undefined;
66
+ bio?: string | undefined;
67
+ avatar?: string | undefined;
68
+ description?: string | undefined;
69
+ organizationCategory?: "agency" | "cooperative" | "landlord" | "other" | undefined;
70
+ }, {
71
+ kind: "organization" | "project" | "bot";
72
+ username: string;
73
+ parentAccountId?: string | undefined;
74
+ name?: {
75
+ first?: string | undefined;
76
+ last?: string | undefined;
77
+ } | undefined;
78
+ bio?: string | undefined;
79
+ avatar?: string | undefined;
80
+ description?: string | undefined;
81
+ organizationCategory?: "agency" | "cooperative" | "landlord" | "other" | undefined;
82
+ }>;
83
+ export type CreateAccountRequest = z.infer<typeof createAccountRequestSchema>;
@@ -270,3 +270,48 @@ export declare const deviceTokenMintResponseSchema: z.ZodObject<{
270
270
  }>;
271
271
  export type DeviceTokenMintRequest = z.infer<typeof deviceTokenMintRequestSchema>;
272
272
  export type DeviceTokenMintResponse = z.infer<typeof deviceTokenMintResponseSchema>;
273
+ /** Request body for `POST /session/device/hub-ticket`. */
274
+ export declare const deviceHubTicketIssueRequestSchema: z.ZodObject<{
275
+ returnOrigin: z.ZodString;
276
+ }, "strip", z.ZodTypeAny, {
277
+ returnOrigin: string;
278
+ }, {
279
+ returnOrigin: string;
280
+ }>;
281
+ /** Response from `POST /session/device/hub-ticket`. */
282
+ export declare const deviceHubTicketIssueResponseSchema: z.ZodObject<{
283
+ ticket: z.ZodString;
284
+ expiresIn: z.ZodNumber;
285
+ }, "strip", z.ZodTypeAny, {
286
+ ticket: string;
287
+ expiresIn: number;
288
+ }, {
289
+ ticket: string;
290
+ expiresIn: number;
291
+ }>;
292
+ /** Request body for `POST /session/device/redeem-ticket`. */
293
+ export declare const deviceHubTicketRedeemRequestSchema: z.ZodObject<{
294
+ ticket: z.ZodString;
295
+ returnOrigin: z.ZodString;
296
+ }, "strip", z.ZodTypeAny, {
297
+ returnOrigin: string;
298
+ ticket: string;
299
+ }, {
300
+ returnOrigin: string;
301
+ ticket: string;
302
+ }>;
303
+ /** Response from `POST /session/device/redeem-ticket`. */
304
+ export declare const deviceHubTicketRedeemResponseSchema: z.ZodObject<{
305
+ deviceId: z.ZodString;
306
+ deviceSecret: z.ZodString;
307
+ }, "strip", z.ZodTypeAny, {
308
+ deviceId: string;
309
+ deviceSecret: string;
310
+ }, {
311
+ deviceId: string;
312
+ deviceSecret: string;
313
+ }>;
314
+ export type DeviceHubTicketIssueRequest = z.infer<typeof deviceHubTicketIssueRequestSchema>;
315
+ export type DeviceHubTicketIssueResponse = z.infer<typeof deviceHubTicketIssueResponseSchema>;
316
+ export type DeviceHubTicketRedeemRequest = z.infer<typeof deviceHubTicketRedeemRequestSchema>;
317
+ export type DeviceHubTicketRedeemResponse = z.infer<typeof deviceHubTicketRedeemResponseSchema>;
@@ -82,13 +82,13 @@ export declare const verificationMethodSchema: z.ZodDiscriminatedUnion<"type", [
82
82
  controller: z.ZodString;
83
83
  publicKeyHex: z.ZodString;
84
84
  }, "strip", z.ZodTypeAny, {
85
- id: string;
86
85
  type: "EcdsaSecp256k1VerificationKey2019";
86
+ id: string;
87
87
  controller: string;
88
88
  publicKeyHex: string;
89
89
  }, {
90
- id: string;
91
90
  type: "EcdsaSecp256k1VerificationKey2019";
91
+ id: string;
92
92
  controller: string;
93
93
  publicKeyHex: string;
94
94
  }>, z.ZodObject<{
@@ -97,13 +97,13 @@ export declare const verificationMethodSchema: z.ZodDiscriminatedUnion<"type", [
97
97
  controller: z.ZodString;
98
98
  publicKeyMultibase: z.ZodString;
99
99
  }, "strip", z.ZodTypeAny, {
100
- id: string;
101
100
  type: "Multikey";
101
+ id: string;
102
102
  controller: string;
103
103
  publicKeyMultibase: string;
104
104
  }, {
105
- id: string;
106
105
  type: "Multikey";
106
+ id: string;
107
107
  controller: string;
108
108
  publicKeyMultibase: string;
109
109
  }>]>;
@@ -2,19 +2,19 @@
2
2
  * @oxyhq/contracts — single source of truth for API request/response contracts.
3
3
  *
4
4
  * Zod schemas plus their inferred types, shared by the backend (`@oxyhq/api`)
5
- * and the client SDKs (`@oxyhq/core`, `@oxyhq/auth`, `@oxyhq/services`). The
5
+ * and the client SDKs (`@oxyhq/core`, `@oxyhq/services`). The
6
6
  * producer validates its output and every consumer validates its input against
7
7
  * exactly the same definitions, so the wire shape cannot drift.
8
8
  *
9
9
  * Platform-agnostic — zod is the only runtime dependency. No react/react-native/
10
10
  * expo, no `require()` in the ESM build.
11
11
  */
12
+ export { ORGANIZATION_CATEGORIES, organizationCategorySchema, createAccountRequestSchema, } from './accountGraph';
13
+ export type { OrganizationCategory, CreateAccountRequest, } from './accountGraph';
12
14
  export { userNameSchema, userResponseSchema, userProfileUpdateSchema, currentUserResponseSchema, deviceLinkedSessionSchema, deviceLinkedSessionsResponseSchema, resolveUserId, safeParseContract, } from './userResponse';
13
15
  export type { UserNameResponse, UserResponse, UserProfileUpdate, CurrentUserResponseContract, DeviceLinkedSessionResponse, DeviceLinkedSessionsResponseContract, } from './userResponse';
14
16
  export { applicationTypeSchema, publicApplicationSchema, sessionStatusSchema, } from './sessionStatus';
15
17
  export type { ApplicationTypeContract, PublicApplicationResponse, SessionStatusResponse, } from './sessionStatus';
16
- export { fedcmTokenPayloadSchema, } from './fedcmToken';
17
- export type { FedcmTokenPayload, } from './fedcmToken';
18
18
  export { recommendationExcludeTypeSchema, recommendationBoostSchema, recommendationSignalWeightsSchema, recommendationRequestSchema, recommendationCountSchema, recommendationItemSchema, recommendationResponseSchema, appEndorsementInputSchema, appInterestInputSchema, appUserSignalIngestSchema, appAffinityEventTypeSchema, appAffinityEventSchema, appAffinityEventsIngestSchema, } from './recommendations';
19
19
  export type { RecommendationExcludeType, RecommendationBoost, RecommendationSignalWeights, RecommendationRequest, RecommendationCount, RecommendationItem, RecommendationResponse, AppEndorsementInput, AppInterestInput, AppUserSignalIngest, AppAffinityEventType, AppAffinityEvent, AppAffinityEventsIngest, } from './recommendations';
20
20
  export { verificationMethodSchema, didServiceSchema, didDocumentSchema, signedRecordEnvelopeSchema, verifiedDomainSchema, domainVerificationRequestSchema, domainVerificationInstructionsSchema, authMethodEntrySchema, authMethodsResponseSchema, exportAttestationSchema, exportBundleSchema, } from './identity';
@@ -27,7 +27,7 @@ export { publicCardSchema, signedPublicCardSchema, realLifeAttestationRecordSche
27
27
  export type { CardTrustTier, PersonhoodStatus, PublicCard, SignedPublicCard, RealLifeAttestationRecord, RealLifeAttestationResult, ValidationVerdict, ValidationRequestStatus, ValidationVerdictRecord, ValidationOpenRequest, ValidationOpenResult, ValidationRequestSummary, ValidationVoteResult, PersonhoodVouchRecord, PersonhoodBreakdown, PersonhoodStatusResult, VouchResult, CredentialStatus, CredentialRecord, VerifiableCredentialResponse, CredentialIssueResult, CredentialListResult, CredentialVerifyResult, } from './civic';
28
28
  export { linkPreviewSchema, linkPreviewBatchRequestSchema, linkPreviewBatchResponseSchema, linkPreviewResponseSchema, } from './links';
29
29
  export type { LinkPreviewStatus, LinkPreview, LinkPreviewBatchRequest, LinkPreviewBatchResponse, } from './links';
30
- export { sessionAccountSchema, deviceSessionStateSchema, activeTokenSchema, deviceSessionSyncSchema, deviceTokenMintRequestSchema, deviceTokenMintResponseSchema, } from './deviceSession';
31
- export type { SessionAccount, DeviceSessionState, ActiveToken, DeviceSessionSync, DeviceTokenMintRequest, DeviceTokenMintResponse, } from './deviceSession';
30
+ export { sessionAccountSchema, deviceSessionStateSchema, activeTokenSchema, deviceSessionSyncSchema, deviceTokenMintRequestSchema, deviceTokenMintResponseSchema, deviceHubTicketIssueRequestSchema, deviceHubTicketIssueResponseSchema, deviceHubTicketRedeemRequestSchema, deviceHubTicketRedeemResponseSchema, } from './deviceSession';
31
+ export type { SessionAccount, DeviceSessionState, ActiveToken, DeviceSessionSync, DeviceTokenMintRequest, DeviceTokenMintResponse, DeviceHubTicketIssueRequest, DeviceHubTicketIssueResponse, DeviceHubTicketRedeemRequest, DeviceHubTicketRedeemResponse, } from './deviceSession';
32
32
  export { loginResultSchema, } from './deviceBoot';
33
33
  export type { LoginTwoFactorRequired, LoginSessionResult, LoginResult, SecurityAlert, SecurityAlertAnomaly, } from './deviceBoot';
@@ -68,9 +68,9 @@ export declare const publicApplicationSchema: z.ZodObject<{
68
68
  scopes: z.ZodArray<z.ZodString, "many">;
69
69
  developerName: z.ZodOptional<z.ZodString>;
70
70
  }, "strip", z.ZodTypeAny, {
71
- id: string;
72
71
  type: "first_party" | "third_party" | "internal" | "system";
73
72
  name: string;
73
+ id: string;
74
74
  isOfficial: boolean;
75
75
  isInternal: boolean;
76
76
  scopes: string[];
@@ -81,9 +81,9 @@ export declare const publicApplicationSchema: z.ZodObject<{
81
81
  termsUrl?: string | undefined;
82
82
  developerName?: string | undefined;
83
83
  }, {
84
- id: string;
85
84
  type: "first_party" | "third_party" | "internal" | "system";
86
85
  name: string;
86
+ id: string;
87
87
  isOfficial: boolean;
88
88
  isInternal: boolean;
89
89
  scopes: string[];
@@ -132,9 +132,9 @@ export declare const sessionStatusSchema: z.ZodObject<{
132
132
  scopes: z.ZodArray<z.ZodString, "many">;
133
133
  developerName: z.ZodOptional<z.ZodString>;
134
134
  }, "strip", z.ZodTypeAny, {
135
- id: string;
136
135
  type: "first_party" | "third_party" | "internal" | "system";
137
136
  name: string;
137
+ id: string;
138
138
  isOfficial: boolean;
139
139
  isInternal: boolean;
140
140
  scopes: string[];
@@ -145,9 +145,9 @@ export declare const sessionStatusSchema: z.ZodObject<{
145
145
  termsUrl?: string | undefined;
146
146
  developerName?: string | undefined;
147
147
  }, {
148
- id: string;
149
148
  type: "first_party" | "third_party" | "internal" | "system";
150
149
  name: string;
150
+ id: string;
151
151
  isOfficial: boolean;
152
152
  isInternal: boolean;
153
153
  scopes: string[];
@@ -171,9 +171,9 @@ export declare const sessionStatusSchema: z.ZodObject<{
171
171
  authorized?: boolean | undefined;
172
172
  sessionToken?: string | undefined;
173
173
  application?: {
174
- id: string;
175
174
  type: "first_party" | "third_party" | "internal" | "system";
176
175
  name: string;
176
+ id: string;
177
177
  isOfficial: boolean;
178
178
  isInternal: boolean;
179
179
  scopes: string[];
@@ -193,9 +193,9 @@ export declare const sessionStatusSchema: z.ZodObject<{
193
193
  authorized?: boolean | undefined;
194
194
  sessionToken?: string | undefined;
195
195
  application?: {
196
- id: string;
197
196
  type: "first_party" | "third_party" | "internal" | "system";
198
197
  name: string;
198
+ id: string;
199
199
  isOfficial: boolean;
200
200
  isInternal: boolean;
201
201
  scopes: string[];
@@ -11,7 +11,7 @@
11
11
  *
12
12
  * This package (`@oxyhq/contracts`) is the dedicated, zero-dependency home for
13
13
  * these contracts so the backend (`@oxyhq/api`) and the client SDKs
14
- * (`@oxyhq/core`, `@oxyhq/auth`, `@oxyhq/services`) can all depend on it without
14
+ * (`@oxyhq/core`, `@oxyhq/services`) can all depend on it without
15
15
  * the backend having to depend on a client SDK to obtain its schemas.
16
16
  *
17
17
  * Faithful to the producers:
@@ -107,6 +107,11 @@ export declare const userResponseSchema: z.ZodObject<{
107
107
  * entry; present only when the account has verified at least one domain.
108
108
  */
109
109
  verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
110
+ /**
111
+ * Real-estate / team taxonomy for `kind: 'organization'` accounts.
112
+ * Absent on personal, project, and bot accounts.
113
+ */
114
+ organizationCategory: z.ZodOptional<z.ZodEnum<["agency", "cooperative", "landlord", "other"]>>;
110
115
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
111
116
  /** MongoDB ObjectId as a string. Present on `formatUserResponse` output. */
112
117
  id: z.ZodOptional<z.ZodString>;
@@ -136,6 +141,11 @@ export declare const userResponseSchema: z.ZodObject<{
136
141
  * entry; present only when the account has verified at least one domain.
137
142
  */
138
143
  verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
144
+ /**
145
+ * Real-estate / team taxonomy for `kind: 'organization'` accounts.
146
+ * Absent on personal, project, and bot accounts.
147
+ */
148
+ organizationCategory: z.ZodOptional<z.ZodEnum<["agency", "cooperative", "landlord", "other"]>>;
139
149
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
140
150
  /** MongoDB ObjectId as a string. Present on `formatUserResponse` output. */
141
151
  id: z.ZodOptional<z.ZodString>;
@@ -165,6 +175,11 @@ export declare const userResponseSchema: z.ZodObject<{
165
175
  * entry; present only when the account has verified at least one domain.
166
176
  */
167
177
  verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
178
+ /**
179
+ * Real-estate / team taxonomy for `kind: 'organization'` accounts.
180
+ * Absent on personal, project, and bot accounts.
181
+ */
182
+ organizationCategory: z.ZodOptional<z.ZodEnum<["agency", "cooperative", "landlord", "other"]>>;
168
183
  }, z.ZodTypeAny, "passthrough">>;
169
184
  export type UserResponse = z.infer<typeof userResponseSchema>;
170
185
  export declare const userProfileUpdateSchema: z.ZodObject<{
@@ -197,14 +212,14 @@ export declare const userProfileUpdateSchema: z.ZodObject<{
197
212
  id: z.ZodOptional<z.ZodString>;
198
213
  }, "strip", z.ZodTypeAny, {
199
214
  url: string;
200
- id?: string | undefined;
201
215
  description?: string | undefined;
216
+ id?: string | undefined;
202
217
  title?: string | undefined;
203
218
  image?: string | undefined;
204
219
  }, {
205
220
  url: string;
206
- id?: string | undefined;
207
221
  description?: string | undefined;
222
+ id?: string | undefined;
208
223
  title?: string | undefined;
209
224
  image?: string | undefined;
210
225
  }>, "many">>;
@@ -243,14 +258,14 @@ export declare const userProfileUpdateSchema: z.ZodObject<{
243
258
  id: z.ZodOptional<z.ZodString>;
244
259
  }, "strip", z.ZodTypeAny, {
245
260
  url: string;
246
- id?: string | undefined;
247
261
  description?: string | undefined;
262
+ id?: string | undefined;
248
263
  title?: string | undefined;
249
264
  image?: string | undefined;
250
265
  }, {
251
266
  url: string;
252
- id?: string | undefined;
253
267
  description?: string | undefined;
268
+ id?: string | undefined;
254
269
  title?: string | undefined;
255
270
  image?: string | undefined;
256
271
  }>, "many">>;
@@ -289,14 +304,14 @@ export declare const userProfileUpdateSchema: z.ZodObject<{
289
304
  id: z.ZodOptional<z.ZodString>;
290
305
  }, "strip", z.ZodTypeAny, {
291
306
  url: string;
292
- id?: string | undefined;
293
307
  description?: string | undefined;
308
+ id?: string | undefined;
294
309
  title?: string | undefined;
295
310
  image?: string | undefined;
296
311
  }, {
297
312
  url: string;
298
- id?: string | undefined;
299
313
  description?: string | undefined;
314
+ id?: string | undefined;
300
315
  title?: string | undefined;
301
316
  image?: string | undefined;
302
317
  }>, "many">>;
@@ -348,6 +363,11 @@ export declare const currentUserResponseSchema: z.ZodObject<{
348
363
  * entry; present only when the account has verified at least one domain.
349
364
  */
350
365
  verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
366
+ /**
367
+ * Real-estate / team taxonomy for `kind: 'organization'` accounts.
368
+ * Absent on personal, project, and bot accounts.
369
+ */
370
+ organizationCategory: z.ZodOptional<z.ZodEnum<["agency", "cooperative", "landlord", "other"]>>;
351
371
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
352
372
  /** MongoDB ObjectId as a string. Present on `formatUserResponse` output. */
353
373
  id: z.ZodOptional<z.ZodString>;
@@ -377,6 +397,11 @@ export declare const currentUserResponseSchema: z.ZodObject<{
377
397
  * entry; present only when the account has verified at least one domain.
378
398
  */
379
399
  verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
400
+ /**
401
+ * Real-estate / team taxonomy for `kind: 'organization'` accounts.
402
+ * Absent on personal, project, and bot accounts.
403
+ */
404
+ organizationCategory: z.ZodOptional<z.ZodEnum<["agency", "cooperative", "landlord", "other"]>>;
380
405
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
381
406
  /** MongoDB ObjectId as a string. Present on `formatUserResponse` output. */
382
407
  id: z.ZodOptional<z.ZodString>;
@@ -406,17 +431,23 @@ export declare const currentUserResponseSchema: z.ZodObject<{
406
431
  * entry; present only when the account has verified at least one domain.
407
432
  */
408
433
  verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
434
+ /**
435
+ * Real-estate / team taxonomy for `kind: 'organization'` accounts.
436
+ * Absent on personal, project, and bot accounts.
437
+ */
438
+ organizationCategory: z.ZodOptional<z.ZodEnum<["agency", "cooperative", "landlord", "other"]>>;
409
439
  }, z.ZodTypeAny, "passthrough">>;
410
440
  }, "strip", z.ZodTypeAny, {
411
441
  data: {
412
442
  name: UserNameResponse;
443
+ username?: string | undefined;
444
+ avatar?: string | null | undefined;
445
+ organizationCategory?: "agency" | "cooperative" | "landlord" | "other" | undefined;
413
446
  id?: string | undefined;
414
447
  publicKey?: string | undefined;
415
448
  did?: string | undefined;
416
449
  verifiedDomains?: import("./identity").VerifiedDomain[] | undefined;
417
450
  verified?: boolean | undefined;
418
- username?: string | undefined;
419
- avatar?: string | null | undefined;
420
451
  _id?: string | undefined;
421
452
  email?: string | undefined;
422
453
  phone?: string | undefined;
@@ -430,13 +461,14 @@ export declare const currentUserResponseSchema: z.ZodObject<{
430
461
  }, {
431
462
  data: {
432
463
  name: UserNameResponse;
464
+ username?: string | undefined;
465
+ avatar?: string | null | undefined;
466
+ organizationCategory?: "agency" | "cooperative" | "landlord" | "other" | undefined;
433
467
  id?: string | undefined;
434
468
  publicKey?: string | undefined;
435
469
  did?: string | undefined;
436
470
  verifiedDomains?: import("./identity").VerifiedDomain[] | undefined;
437
471
  verified?: boolean | undefined;
438
- username?: string | undefined;
439
- avatar?: string | null | undefined;
440
472
  _id?: string | undefined;
441
473
  email?: string | undefined;
442
474
  phone?: string | undefined;
@@ -487,6 +519,11 @@ export declare const deviceLinkedSessionSchema: z.ZodObject<{
487
519
  * entry; present only when the account has verified at least one domain.
488
520
  */
489
521
  verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
522
+ /**
523
+ * Real-estate / team taxonomy for `kind: 'organization'` accounts.
524
+ * Absent on personal, project, and bot accounts.
525
+ */
526
+ organizationCategory: z.ZodOptional<z.ZodEnum<["agency", "cooperative", "landlord", "other"]>>;
490
527
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
491
528
  /** MongoDB ObjectId as a string. Present on `formatUserResponse` output. */
492
529
  id: z.ZodOptional<z.ZodString>;
@@ -516,6 +553,11 @@ export declare const deviceLinkedSessionSchema: z.ZodObject<{
516
553
  * entry; present only when the account has verified at least one domain.
517
554
  */
518
555
  verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
556
+ /**
557
+ * Real-estate / team taxonomy for `kind: 'organization'` accounts.
558
+ * Absent on personal, project, and bot accounts.
559
+ */
560
+ organizationCategory: z.ZodOptional<z.ZodEnum<["agency", "cooperative", "landlord", "other"]>>;
519
561
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
520
562
  /** MongoDB ObjectId as a string. Present on `formatUserResponse` output. */
521
563
  id: z.ZodOptional<z.ZodString>;
@@ -545,6 +587,11 @@ export declare const deviceLinkedSessionSchema: z.ZodObject<{
545
587
  * entry; present only when the account has verified at least one domain.
546
588
  */
547
589
  verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
590
+ /**
591
+ * Real-estate / team taxonomy for `kind: 'organization'` accounts.
592
+ * Absent on personal, project, and bot accounts.
593
+ */
594
+ organizationCategory: z.ZodOptional<z.ZodEnum<["agency", "cooperative", "landlord", "other"]>>;
548
595
  }, z.ZodTypeAny, "passthrough">>>>;
549
596
  }, "strip", z.ZodTypeAny, {
550
597
  sessionId: string;
@@ -577,6 +624,11 @@ export declare const deviceLinkedSessionSchema: z.ZodObject<{
577
624
  * entry; present only when the account has verified at least one domain.
578
625
  */
579
626
  verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
627
+ /**
628
+ * Real-estate / team taxonomy for `kind: 'organization'` accounts.
629
+ * Absent on personal, project, and bot accounts.
630
+ */
631
+ organizationCategory: z.ZodOptional<z.ZodEnum<["agency", "cooperative", "landlord", "other"]>>;
580
632
  }, z.ZodTypeAny, "passthrough"> | null | undefined;
581
633
  isCurrent?: boolean | undefined;
582
634
  }, {
@@ -610,6 +662,11 @@ export declare const deviceLinkedSessionSchema: z.ZodObject<{
610
662
  * entry; present only when the account has verified at least one domain.
611
663
  */
612
664
  verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
665
+ /**
666
+ * Real-estate / team taxonomy for `kind: 'organization'` accounts.
667
+ * Absent on personal, project, and bot accounts.
668
+ */
669
+ organizationCategory: z.ZodOptional<z.ZodEnum<["agency", "cooperative", "landlord", "other"]>>;
613
670
  }, z.ZodTypeAny, "passthrough"> | null | undefined;
614
671
  isCurrent?: boolean | undefined;
615
672
  }>;
@@ -647,6 +704,11 @@ export declare const deviceLinkedSessionsResponseSchema: z.ZodArray<z.ZodObject<
647
704
  * entry; present only when the account has verified at least one domain.
648
705
  */
649
706
  verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
707
+ /**
708
+ * Real-estate / team taxonomy for `kind: 'organization'` accounts.
709
+ * Absent on personal, project, and bot accounts.
710
+ */
711
+ organizationCategory: z.ZodOptional<z.ZodEnum<["agency", "cooperative", "landlord", "other"]>>;
650
712
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
651
713
  /** MongoDB ObjectId as a string. Present on `formatUserResponse` output. */
652
714
  id: z.ZodOptional<z.ZodString>;
@@ -676,6 +738,11 @@ export declare const deviceLinkedSessionsResponseSchema: z.ZodArray<z.ZodObject<
676
738
  * entry; present only when the account has verified at least one domain.
677
739
  */
678
740
  verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
741
+ /**
742
+ * Real-estate / team taxonomy for `kind: 'organization'` accounts.
743
+ * Absent on personal, project, and bot accounts.
744
+ */
745
+ organizationCategory: z.ZodOptional<z.ZodEnum<["agency", "cooperative", "landlord", "other"]>>;
679
746
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
680
747
  /** MongoDB ObjectId as a string. Present on `formatUserResponse` output. */
681
748
  id: z.ZodOptional<z.ZodString>;
@@ -705,6 +772,11 @@ export declare const deviceLinkedSessionsResponseSchema: z.ZodArray<z.ZodObject<
705
772
  * entry; present only when the account has verified at least one domain.
706
773
  */
707
774
  verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
775
+ /**
776
+ * Real-estate / team taxonomy for `kind: 'organization'` accounts.
777
+ * Absent on personal, project, and bot accounts.
778
+ */
779
+ organizationCategory: z.ZodOptional<z.ZodEnum<["agency", "cooperative", "landlord", "other"]>>;
708
780
  }, z.ZodTypeAny, "passthrough">>>>;
709
781
  }, "strip", z.ZodTypeAny, {
710
782
  sessionId: string;
@@ -737,6 +809,11 @@ export declare const deviceLinkedSessionsResponseSchema: z.ZodArray<z.ZodObject<
737
809
  * entry; present only when the account has verified at least one domain.
738
810
  */
739
811
  verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
812
+ /**
813
+ * Real-estate / team taxonomy for `kind: 'organization'` accounts.
814
+ * Absent on personal, project, and bot accounts.
815
+ */
816
+ organizationCategory: z.ZodOptional<z.ZodEnum<["agency", "cooperative", "landlord", "other"]>>;
740
817
  }, z.ZodTypeAny, "passthrough"> | null | undefined;
741
818
  isCurrent?: boolean | undefined;
742
819
  }, {
@@ -770,6 +847,11 @@ export declare const deviceLinkedSessionsResponseSchema: z.ZodArray<z.ZodObject<
770
847
  * entry; present only when the account has verified at least one domain.
771
848
  */
772
849
  verifiedDomains: z.ZodOptional<z.ZodArray<z.ZodType<import("./identity").VerifiedDomain, z.ZodTypeDef, import("./identity").VerifiedDomain>, "many">>;
850
+ /**
851
+ * Real-estate / team taxonomy for `kind: 'organization'` accounts.
852
+ * Absent on personal, project, and bot accounts.
853
+ */
854
+ organizationCategory: z.ZodOptional<z.ZodEnum<["agency", "cooperative", "landlord", "other"]>>;
773
855
  }, z.ZodTypeAny, "passthrough"> | null | undefined;
774
856
  isCurrent?: boolean | undefined;
775
857
  }>, "many">;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxyhq/contracts",
3
- "version": "0.13.0",
3
+ "version": "0.13.2",
4
4
  "description": "OxyHQ API contracts — single source of truth for request/response Zod schemas and inferred types, shared by the backend and the client SDKs",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -1,66 +0,0 @@
1
- "use strict";
2
- /**
3
- * Canonical contract for the FedCM ID-token JWT payload.
4
- *
5
- * DEAD SINCE THE WAVE-2 FEDCM DELETION (found during the comment sweep, not
6
- * fixed here — this is a published `@oxyhq/contracts` export, so removing it
7
- * is a breaking change/major-version decision, out of scope for a comment
8
- * fix): `POST /fedcm/exchange`, `fedcm.service.exchangeIdToken`, and
9
- * `packages/auth/server/index.ts`'s `mintSessionForClient` — every consumer
10
- * and producer this file describes — are all deleted. No current code
11
- * imports `fedcmTokenPayloadSchema` / `FedcmTokenPayload` outside this
12
- * package. Flag for a follow-up major-version cleanup.
13
- *
14
- * Original doc (historical, describes the now-deleted system):
15
- * SINGLE SOURCE OF TRUTH for the decoded claims of the HS256 ID token the auth
16
- * IdP (`auth.oxy.so`) signs and `POST /fedcm/exchange` consumes. The API decodes
17
- * the JWT, verifies its signature, then validates the resulting claim object
18
- * against this schema before trusting any field — a malformed payload (e.g. a
19
- * forged token whose signature happened to match but whose body is the wrong
20
- * shape) is rejected at the boundary instead of being cast and used.
21
- *
22
- * Validation philosophy — match the existing exchange behaviour exactly:
23
- * - This schema validates the STRUCTURAL shape of the decoded claims only
24
- * (types of the fields, not their presence or business-rule validity).
25
- * - `sub` / `aud` / `nonce` / `iss` / `exp` presence + value checks remain in
26
- * `fedcm.service.exchangeIdToken`, which returns the specific
27
- * `missing_required_fields` / `invalid_issuer` / `token_expired` errors. So
28
- * every field is `.optional()` here: a token missing `nonce` must still reach
29
- * the `missing_required_fields` branch, not be rejected as a malformed token.
30
- * - `.passthrough()` preserves any additional claims the IdP may add without a
31
- * coordinated contract bump.
32
- *
33
- * Faithful to the producer:
34
- * - `packages/auth/server/index.ts` `mintSessionForClient` — builds the
35
- * assertion with `iss` (central issuer), `sub` (user id), `aud` (RP origin),
36
- * `exp` / `iat` (numeric epoch seconds), and `nonce` (the server-minted,
37
- * origin-bound nonce).
38
- *
39
- * Platform-agnostic — zod only, no react/react-native/expo. ESM-safe (no
40
- * `require()`).
41
- */
42
- Object.defineProperty(exports, "__esModule", { value: true });
43
- exports.fedcmTokenPayloadSchema = void 0;
44
- const zod_1 = require("zod");
45
- /**
46
- * Decoded FedCM ID-token claims. Every field is optional because presence is
47
- * enforced downstream (see module doc); the schema's job is to guarantee that
48
- * any present claim has the correct primitive type before it is read.
49
- */
50
- exports.fedcmTokenPayloadSchema = zod_1.z
51
- .object({
52
- iss: zod_1.z.string().optional(),
53
- sub: zod_1.z.string().optional(),
54
- aud: zod_1.z.string().optional(),
55
- exp: zod_1.z.number().optional(),
56
- iat: zod_1.z.number().optional(),
57
- nonce: zod_1.z.string().optional(),
58
- /**
59
- * An explicit central deviceId minted by the IdP, threaded through so the
60
- * RP session can inherit a unified device id instead of deriving one from
61
- * the (userId, RP origin) stableDeviceKey. Optional and additive — omitted
62
- * tokens fall back to the existing stableDeviceKey/UA-IP derivation.
63
- */
64
- deviceId: zod_1.z.string().optional(),
65
- })
66
- .passthrough();