@oxyhq/contracts 0.13.1 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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>;
@@ -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
  }>]>;
@@ -9,6 +9,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';
@@ -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[];