@automate.ax/api-contract 0.46.0 → 0.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -5,9 +5,9 @@ export { DEFAULT_GATEWAY_MODEL_ID, generationInputSchema, generationResultSchema
5
5
  export type { GatewayModelId } from "@ai-sdk/gateway";
6
6
  export { createdOrganizationApiKeyOutputSchema, organizationApiKeyOutputSchema, } from "./api-key.js";
7
7
  export { integrationConnectionManifestSchema, integrationServiceManifestSchema, type IntegrationConnectionManifest, type IntegrationServiceManifest, } from "./authorization.js";
8
- export { activeSubscriptionOutputSchema, createdInvitationOutputSchema, organizationDetailsOutputSchema, organizationInvitationOutputSchema, organizationMemberOutputSchema, organizationProjectOutputSchema, organizationRoleSchema, organizationSummaryOutputSchema, publicOrganizationOutputSchema, } from "./org.js";
8
+ export { activeSubscriptionOutputSchema, createdInvitationOutputSchema, organizationDetailsOutputSchema, organizationInvitationOutputSchema, organizationMemberOutputSchema, organizationPhoneNumberOutputSchema, organizationProjectOutputSchema, organizationRoleSchema, organizationSummaryOutputSchema, publicOrganizationOutputSchema, } from "./org.js";
9
9
  export { projectOutputSchema } from "./project.js";
10
- export { reasonableNameSchema } from "./schemas.js";
10
+ export { e164PhoneNumberSchema, reasonableNameSchema } from "./schemas.js";
11
11
  export { userOutputSchema } from "./auth.js";
12
12
  export { managementPermissionStatement, managementRolePermissions, organizationApiKeyPermissions, type ManagementPermission, } from "./permissions.js";
13
13
  /** Procedures exposed by the public Node client and OpenAPI document. */
@@ -95,10 +95,12 @@ export declare const publicContract: {
95
95
  emailRecipients: import("zod").ZodNumber;
96
96
  projects: import("zod").ZodNumber;
97
97
  seats: import("zod").ZodNumber;
98
+ smsSegments: import("zod").ZodNumber;
98
99
  }, import("zod/v4/core").$strip>;
99
100
  usage: import("zod").ZodObject<{
100
101
  aiSpendUsd: import("zod").ZodNumber;
101
102
  emailRecipients: import("zod").ZodNumber;
103
+ smsSegments: import("zod").ZodNumber;
102
104
  }, import("zod/v4/core").$strip>;
103
105
  members: import("zod").ZodArray<import("zod").ZodObject<{
104
106
  id: import("zod").ZodString;
@@ -125,6 +127,13 @@ export declare const publicContract: {
125
127
  createdAt: import("zod").ZodDate;
126
128
  expiresAt: import("zod").ZodDate;
127
129
  }, import("zod/v4/core").$strip>>;
130
+ phoneNumbers: import("zod").ZodArray<import("zod").ZodObject<{
131
+ id: import("zod").ZodString;
132
+ phoneNumber: import("zod").ZodString;
133
+ createdAt: import("zod").ZodDate;
134
+ verifiedAt: import("zod").ZodNullable<import("zod").ZodDate>;
135
+ consentedAt: import("zod").ZodNullable<import("zod").ZodDate>;
136
+ }, import("zod/v4/core").$strip>>;
128
137
  projects: import("zod").ZodArray<import("zod").ZodObject<{
129
138
  id: import("zod").ZodString;
130
139
  name: import("zod").ZodString;
@@ -185,10 +194,12 @@ export declare const publicContract: {
185
194
  emailRecipients: import("zod").ZodNumber;
186
195
  projects: import("zod").ZodNumber;
187
196
  seats: import("zod").ZodNumber;
197
+ smsSegments: import("zod").ZodNumber;
188
198
  }, import("zod/v4/core").$strip>;
189
199
  usage: import("zod").ZodObject<{
190
200
  aiSpendUsd: import("zod").ZodNumber;
191
201
  emailRecipients: import("zod").ZodNumber;
202
+ smsSegments: import("zod").ZodNumber;
192
203
  }, import("zod/v4/core").$strip>;
193
204
  }, import("zod/v4/core").$strip>>, Record<never, never>, Record<never, never>>;
194
205
  remove: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
@@ -690,6 +701,23 @@ export declare const firstPartyContract: {
690
701
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
691
702
  url: import("zod").ZodURL;
692
703
  }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
704
+ removePhoneNumber: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
705
+ organizationId: import("zod").ZodString;
706
+ phoneNumberId: import("zod").ZodString;
707
+ }, import("zod/v4/core").$strip>, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
708
+ requestPhoneNumberVerification: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
709
+ organizationId: import("zod").ZodString;
710
+ phoneNumber: import("zod").ZodString;
711
+ smsConsent: import("zod").ZodLiteral<true>;
712
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
713
+ expiresAt: import("zod").ZodDate;
714
+ phoneNumberId: import("zod").ZodString;
715
+ }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
716
+ verifyPhoneNumber: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
717
+ organizationId: import("zod").ZodString;
718
+ phoneNumberId: import("zod").ZodString;
719
+ code: import("zod").ZodString;
720
+ }, import("zod/v4/core").$strip>, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
693
721
  create: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
694
722
  name: import("zod").ZodString;
695
723
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
@@ -732,10 +760,12 @@ export declare const firstPartyContract: {
732
760
  emailRecipients: import("zod").ZodNumber;
733
761
  projects: import("zod").ZodNumber;
734
762
  seats: import("zod").ZodNumber;
763
+ smsSegments: import("zod").ZodNumber;
735
764
  }, import("zod/v4/core").$strip>;
736
765
  usage: import("zod").ZodObject<{
737
766
  aiSpendUsd: import("zod").ZodNumber;
738
767
  emailRecipients: import("zod").ZodNumber;
768
+ smsSegments: import("zod").ZodNumber;
739
769
  }, import("zod/v4/core").$strip>;
740
770
  members: import("zod").ZodArray<import("zod").ZodObject<{
741
771
  id: import("zod").ZodString;
@@ -762,6 +792,13 @@ export declare const firstPartyContract: {
762
792
  createdAt: import("zod").ZodDate;
763
793
  expiresAt: import("zod").ZodDate;
764
794
  }, import("zod/v4/core").$strip>>;
795
+ phoneNumbers: import("zod").ZodArray<import("zod").ZodObject<{
796
+ id: import("zod").ZodString;
797
+ phoneNumber: import("zod").ZodString;
798
+ createdAt: import("zod").ZodDate;
799
+ verifiedAt: import("zod").ZodNullable<import("zod").ZodDate>;
800
+ consentedAt: import("zod").ZodNullable<import("zod").ZodDate>;
801
+ }, import("zod/v4/core").$strip>>;
765
802
  projects: import("zod").ZodArray<import("zod").ZodObject<{
766
803
  id: import("zod").ZodString;
767
804
  name: import("zod").ZodString;
@@ -822,10 +859,12 @@ export declare const firstPartyContract: {
822
859
  emailRecipients: import("zod").ZodNumber;
823
860
  projects: import("zod").ZodNumber;
824
861
  seats: import("zod").ZodNumber;
862
+ smsSegments: import("zod").ZodNumber;
825
863
  }, import("zod/v4/core").$strip>;
826
864
  usage: import("zod").ZodObject<{
827
865
  aiSpendUsd: import("zod").ZodNumber;
828
866
  emailRecipients: import("zod").ZodNumber;
867
+ smsSegments: import("zod").ZodNumber;
829
868
  }, import("zod/v4/core").$strip>;
830
869
  }, import("zod/v4/core").$strip>>, Record<never, never>, Record<never, never>>;
831
870
  remove: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
@@ -1665,6 +1704,13 @@ export declare const contract: {
1665
1704
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1666
1705
  id: import("zod").ZodNullable<import("zod").ZodString>;
1667
1706
  }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
1707
+ sendSms: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
1708
+ deliveryIndex: import("zod").ZodDefault<import("zod").ZodNumber>;
1709
+ text: import("zod").ZodString;
1710
+ to: import("zod").ZodDefault<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodLiteral<"*">]>>;
1711
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1712
+ ids: import("zod").ZodArray<import("zod").ZodString>;
1713
+ }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
1668
1714
  };
1669
1715
  account: {
1670
1716
  beginConnection: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
@@ -1966,6 +2012,23 @@ export declare const contract: {
1966
2012
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1967
2013
  url: import("zod").ZodURL;
1968
2014
  }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
2015
+ removePhoneNumber: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
2016
+ organizationId: import("zod").ZodString;
2017
+ phoneNumberId: import("zod").ZodString;
2018
+ }, import("zod/v4/core").$strip>, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
2019
+ requestPhoneNumberVerification: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
2020
+ organizationId: import("zod").ZodString;
2021
+ phoneNumber: import("zod").ZodString;
2022
+ smsConsent: import("zod").ZodLiteral<true>;
2023
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
2024
+ expiresAt: import("zod").ZodDate;
2025
+ phoneNumberId: import("zod").ZodString;
2026
+ }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
2027
+ verifyPhoneNumber: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
2028
+ organizationId: import("zod").ZodString;
2029
+ phoneNumberId: import("zod").ZodString;
2030
+ code: import("zod").ZodString;
2031
+ }, import("zod/v4/core").$strip>, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
1969
2032
  create: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
1970
2033
  name: import("zod").ZodString;
1971
2034
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
@@ -2008,10 +2071,12 @@ export declare const contract: {
2008
2071
  emailRecipients: import("zod").ZodNumber;
2009
2072
  projects: import("zod").ZodNumber;
2010
2073
  seats: import("zod").ZodNumber;
2074
+ smsSegments: import("zod").ZodNumber;
2011
2075
  }, import("zod/v4/core").$strip>;
2012
2076
  usage: import("zod").ZodObject<{
2013
2077
  aiSpendUsd: import("zod").ZodNumber;
2014
2078
  emailRecipients: import("zod").ZodNumber;
2079
+ smsSegments: import("zod").ZodNumber;
2015
2080
  }, import("zod/v4/core").$strip>;
2016
2081
  members: import("zod").ZodArray<import("zod").ZodObject<{
2017
2082
  id: import("zod").ZodString;
@@ -2038,6 +2103,13 @@ export declare const contract: {
2038
2103
  createdAt: import("zod").ZodDate;
2039
2104
  expiresAt: import("zod").ZodDate;
2040
2105
  }, import("zod/v4/core").$strip>>;
2106
+ phoneNumbers: import("zod").ZodArray<import("zod").ZodObject<{
2107
+ id: import("zod").ZodString;
2108
+ phoneNumber: import("zod").ZodString;
2109
+ createdAt: import("zod").ZodDate;
2110
+ verifiedAt: import("zod").ZodNullable<import("zod").ZodDate>;
2111
+ consentedAt: import("zod").ZodNullable<import("zod").ZodDate>;
2112
+ }, import("zod/v4/core").$strip>>;
2041
2113
  projects: import("zod").ZodArray<import("zod").ZodObject<{
2042
2114
  id: import("zod").ZodString;
2043
2115
  name: import("zod").ZodString;
@@ -2098,10 +2170,12 @@ export declare const contract: {
2098
2170
  emailRecipients: import("zod").ZodNumber;
2099
2171
  projects: import("zod").ZodNumber;
2100
2172
  seats: import("zod").ZodNumber;
2173
+ smsSegments: import("zod").ZodNumber;
2101
2174
  }, import("zod/v4/core").$strip>;
2102
2175
  usage: import("zod").ZodObject<{
2103
2176
  aiSpendUsd: import("zod").ZodNumber;
2104
2177
  emailRecipients: import("zod").ZodNumber;
2178
+ smsSegments: import("zod").ZodNumber;
2105
2179
  }, import("zod/v4/core").$strip>;
2106
2180
  }, import("zod/v4/core").$strip>>, Record<never, never>, Record<never, never>>;
2107
2181
  remove: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
package/dist/index.js CHANGED
@@ -14,9 +14,9 @@ export { integrationAccountOutputSchema } from "./account.js";
14
14
  export { DEFAULT_GATEWAY_MODEL_ID, generationInputSchema, generationResultSchema, runtimeContract, } from "./runtime.js";
15
15
  export { createdOrganizationApiKeyOutputSchema, organizationApiKeyOutputSchema, } from "./api-key.js";
16
16
  export { integrationConnectionManifestSchema, integrationServiceManifestSchema, } from "./authorization.js";
17
- export { activeSubscriptionOutputSchema, createdInvitationOutputSchema, organizationDetailsOutputSchema, organizationInvitationOutputSchema, organizationMemberOutputSchema, organizationProjectOutputSchema, organizationRoleSchema, organizationSummaryOutputSchema, publicOrganizationOutputSchema, } from "./org.js";
17
+ export { activeSubscriptionOutputSchema, createdInvitationOutputSchema, organizationDetailsOutputSchema, organizationInvitationOutputSchema, organizationMemberOutputSchema, organizationPhoneNumberOutputSchema, organizationProjectOutputSchema, organizationRoleSchema, organizationSummaryOutputSchema, publicOrganizationOutputSchema, } from "./org.js";
18
18
  export { projectOutputSchema } from "./project.js";
19
- export { reasonableNameSchema } from "./schemas.js";
19
+ export { e164PhoneNumberSchema, reasonableNameSchema } from "./schemas.js";
20
20
  export { userOutputSchema } from "./auth.js";
21
21
  export { managementPermissionStatement, managementRolePermissions, organizationApiKeyPermissions, } from "./permissions.js";
22
22
  /** Procedures exposed by the public Node client and OpenAPI document. */
@@ -60,6 +60,9 @@ export const firstPartyContract = {
60
60
  canInvite: orgContract.canInvite,
61
61
  createBillingPortal: orgContract.createBillingPortal,
62
62
  createCheckout: orgContract.createCheckout,
63
+ removePhoneNumber: orgContract.removePhoneNumber,
64
+ requestPhoneNumberVerification: orgContract.requestPhoneNumberVerification,
65
+ verifyPhoneNumber: orgContract.verifyPhoneNumber,
63
66
  },
64
67
  project: {
65
68
  ...publicContract.project,
package/dist/org.d.ts CHANGED
@@ -46,12 +46,21 @@ export declare const organizationSummaryOutputSchema: z.ZodObject<{
46
46
  emailRecipients: z.ZodNumber;
47
47
  projects: z.ZodNumber;
48
48
  seats: z.ZodNumber;
49
+ smsSegments: z.ZodNumber;
49
50
  }, z.core.$strip>;
50
51
  usage: z.ZodObject<{
51
52
  aiSpendUsd: z.ZodNumber;
52
53
  emailRecipients: z.ZodNumber;
54
+ smsSegments: z.ZodNumber;
53
55
  }, z.core.$strip>;
54
56
  }, z.core.$strip>;
57
+ export declare const organizationPhoneNumberOutputSchema: z.ZodObject<{
58
+ id: z.ZodString;
59
+ phoneNumber: z.ZodString;
60
+ createdAt: z.ZodDate;
61
+ verifiedAt: z.ZodNullable<z.ZodDate>;
62
+ consentedAt: z.ZodNullable<z.ZodDate>;
63
+ }, z.core.$strip>;
55
64
  export declare const organizationMemberOutputSchema: z.ZodObject<{
56
65
  id: z.ZodString;
57
66
  userId: z.ZodString;
@@ -113,10 +122,12 @@ export declare const organizationDetailsOutputSchema: z.ZodObject<{
113
122
  emailRecipients: z.ZodNumber;
114
123
  projects: z.ZodNumber;
115
124
  seats: z.ZodNumber;
125
+ smsSegments: z.ZodNumber;
116
126
  }, z.core.$strip>;
117
127
  usage: z.ZodObject<{
118
128
  aiSpendUsd: z.ZodNumber;
119
129
  emailRecipients: z.ZodNumber;
130
+ smsSegments: z.ZodNumber;
120
131
  }, z.core.$strip>;
121
132
  members: z.ZodArray<z.ZodObject<{
122
133
  id: z.ZodString;
@@ -143,6 +154,13 @@ export declare const organizationDetailsOutputSchema: z.ZodObject<{
143
154
  createdAt: z.ZodDate;
144
155
  expiresAt: z.ZodDate;
145
156
  }, z.core.$strip>>;
157
+ phoneNumbers: z.ZodArray<z.ZodObject<{
158
+ id: z.ZodString;
159
+ phoneNumber: z.ZodString;
160
+ createdAt: z.ZodDate;
161
+ verifiedAt: z.ZodNullable<z.ZodDate>;
162
+ consentedAt: z.ZodNullable<z.ZodDate>;
163
+ }, z.core.$strip>>;
146
164
  projects: z.ZodArray<z.ZodObject<{
147
165
  id: z.ZodString;
148
166
  name: z.ZodString;
@@ -215,10 +233,12 @@ export declare const orgContract: {
215
233
  emailRecipients: z.ZodNumber;
216
234
  projects: z.ZodNumber;
217
235
  seats: z.ZodNumber;
236
+ smsSegments: z.ZodNumber;
218
237
  }, z.core.$strip>;
219
238
  usage: z.ZodObject<{
220
239
  aiSpendUsd: z.ZodNumber;
221
240
  emailRecipients: z.ZodNumber;
241
+ smsSegments: z.ZodNumber;
222
242
  }, z.core.$strip>;
223
243
  members: z.ZodArray<z.ZodObject<{
224
244
  id: z.ZodString;
@@ -245,6 +265,13 @@ export declare const orgContract: {
245
265
  createdAt: z.ZodDate;
246
266
  expiresAt: z.ZodDate;
247
267
  }, z.core.$strip>>;
268
+ phoneNumbers: z.ZodArray<z.ZodObject<{
269
+ id: z.ZodString;
270
+ phoneNumber: z.ZodString;
271
+ createdAt: z.ZodDate;
272
+ verifiedAt: z.ZodNullable<z.ZodDate>;
273
+ consentedAt: z.ZodNullable<z.ZodDate>;
274
+ }, z.core.$strip>>;
248
275
  projects: z.ZodArray<z.ZodObject<{
249
276
  id: z.ZodString;
250
277
  name: z.ZodString;
@@ -305,18 +332,37 @@ export declare const orgContract: {
305
332
  emailRecipients: z.ZodNumber;
306
333
  projects: z.ZodNumber;
307
334
  seats: z.ZodNumber;
335
+ smsSegments: z.ZodNumber;
308
336
  }, z.core.$strip>;
309
337
  usage: z.ZodObject<{
310
338
  aiSpendUsd: z.ZodNumber;
311
339
  emailRecipients: z.ZodNumber;
340
+ smsSegments: z.ZodNumber;
312
341
  }, z.core.$strip>;
313
342
  }, z.core.$strip>>, Record<never, never>, Record<never, never>>;
314
343
  remove: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
315
344
  organizationId: z.ZodString;
316
345
  memberIdOrEmail: z.ZodString;
317
346
  }, z.core.$strip>, z.ZodVoid, Record<never, never>, Record<never, never>>;
347
+ removePhoneNumber: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
348
+ organizationId: z.ZodString;
349
+ phoneNumberId: z.ZodString;
350
+ }, z.core.$strip>, z.ZodVoid, Record<never, never>, Record<never, never>>;
351
+ requestPhoneNumberVerification: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
352
+ organizationId: z.ZodString;
353
+ phoneNumber: z.ZodString;
354
+ smsConsent: z.ZodLiteral<true>;
355
+ }, z.core.$strip>, z.ZodObject<{
356
+ expiresAt: z.ZodDate;
357
+ phoneNumberId: z.ZodString;
358
+ }, z.core.$strip>, Record<never, never>, Record<never, never>>;
318
359
  update: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
319
360
  organizationId: z.ZodString;
320
361
  name: z.ZodString;
321
362
  }, z.core.$strip>, z.ZodVoid, Record<never, never>, Record<never, never>>;
363
+ verifyPhoneNumber: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
364
+ organizationId: z.ZodString;
365
+ phoneNumberId: z.ZodString;
366
+ code: z.ZodString;
367
+ }, z.core.$strip>, z.ZodVoid, Record<never, never>, Record<never, never>>;
322
368
  };
package/dist/org.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { oc } from "@orpc/contract";
2
2
  import { z } from "zod";
3
- import { reasonableNameSchema } from "./schemas.js";
3
+ import { e164PhoneNumberSchema, reasonableNameSchema } from "./schemas.js";
4
4
  export const organizationRoleSchema = z.enum(["member", "admin", "owner"]);
5
5
  export const publicOrganizationOutputSchema = z.object({
6
6
  id: z.string(),
@@ -30,12 +30,21 @@ export const organizationSummaryOutputSchema = z.object({
30
30
  emailRecipients: z.number(),
31
31
  projects: z.number(),
32
32
  seats: z.number(),
33
+ smsSegments: z.number(),
33
34
  }),
34
35
  usage: z.object({
35
36
  aiSpendUsd: z.number(),
36
37
  emailRecipients: z.number(),
38
+ smsSegments: z.number(),
37
39
  }),
38
40
  });
41
+ export const organizationPhoneNumberOutputSchema = z.object({
42
+ id: z.string(),
43
+ phoneNumber: e164PhoneNumberSchema,
44
+ createdAt: z.date(),
45
+ verifiedAt: z.date().nullable(),
46
+ consentedAt: z.date().nullable(),
47
+ });
39
48
  export const organizationMemberOutputSchema = z.object({
40
49
  id: z.string(),
41
50
  userId: z.string(),
@@ -61,6 +70,7 @@ export const organizationProjectOutputSchema = z.object({
61
70
  export const organizationDetailsOutputSchema = organizationSummaryOutputSchema.extend({
62
71
  members: organizationMemberOutputSchema.array(),
63
72
  invitations: organizationInvitationOutputSchema.array(),
73
+ phoneNumbers: organizationPhoneNumberOutputSchema.array(),
64
74
  projects: organizationProjectOutputSchema.array(),
65
75
  });
66
76
  export const createdInvitationOutputSchema = z.object({
@@ -174,6 +184,40 @@ export const orgContract = {
174
184
  memberIdOrEmail: z.string().min(1),
175
185
  }))
176
186
  .output(z.void()),
187
+ removePhoneNumber: oc
188
+ .route({
189
+ method: "DELETE",
190
+ path: "/organizations/{organizationId}/phone-numbers/{phoneNumberId}",
191
+ operationId: "removeOrganizationPhoneNumber",
192
+ summary: "Remove organization phone number",
193
+ description: "Removes an organization SMS destination and its verification and consent state.",
194
+ tags: ["Organizations"],
195
+ successStatus: 204,
196
+ })
197
+ .input(z.object({
198
+ organizationId: z.string(),
199
+ phoneNumberId: z.string(),
200
+ }))
201
+ .output(z.void()),
202
+ requestPhoneNumberVerification: oc
203
+ .route({
204
+ method: "POST",
205
+ path: "/organizations/{organizationId}/phone-numbers/verifications",
206
+ operationId: "requestOrganizationPhoneNumberVerification",
207
+ summary: "Request organization phone verification",
208
+ description: "Sends a verification code after the caller explicitly consents to organization automation SMS alerts.",
209
+ tags: ["Organizations"],
210
+ successStatus: 201,
211
+ })
212
+ .input(z.object({
213
+ organizationId: z.string(),
214
+ phoneNumber: e164PhoneNumberSchema,
215
+ smsConsent: z.literal(true),
216
+ }))
217
+ .output(z.object({
218
+ expiresAt: z.date(),
219
+ phoneNumberId: z.string(),
220
+ })),
177
221
  update: oc
178
222
  .route({
179
223
  method: "PATCH",
@@ -189,4 +233,23 @@ export const orgContract = {
189
233
  name: reasonableNameSchema,
190
234
  }))
191
235
  .output(z.void()),
236
+ verifyPhoneNumber: oc
237
+ .route({
238
+ method: "POST",
239
+ path: "/organizations/{organizationId}/phone-numbers/{phoneNumberId}/verification",
240
+ operationId: "verifyOrganizationPhoneNumber",
241
+ summary: "Verify organization phone number",
242
+ description: "Verifies possession of an organization SMS destination and activates its recorded consent.",
243
+ tags: ["Organizations"],
244
+ successStatus: 204,
245
+ })
246
+ .input(z.object({
247
+ organizationId: z.string(),
248
+ phoneNumberId: z.string(),
249
+ code: z
250
+ .string()
251
+ .trim()
252
+ .regex(/^\d{6}$/),
253
+ }))
254
+ .output(z.void()),
192
255
  };
package/dist/runtime.d.ts CHANGED
@@ -637,5 +637,12 @@ export declare const runtimeContract: {
637
637
  }, z.core.$strip>, z.ZodObject<{
638
638
  id: z.ZodNullable<z.ZodString>;
639
639
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
640
+ sendSms: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
641
+ deliveryIndex: z.ZodDefault<z.ZodNumber>;
642
+ text: z.ZodString;
643
+ to: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"*">]>>;
644
+ }, z.core.$strip>, z.ZodObject<{
645
+ ids: z.ZodArray<z.ZodString>;
646
+ }, z.core.$strip>, Record<never, never>, Record<never, never>>;
640
647
  };
641
648
  export {};
package/dist/runtime.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { encodableSchema } from "@automate.ax/codec";
2
2
  import { oc } from "@orpc/contract";
3
3
  import { z } from "zod";
4
+ import { e164PhoneNumberSchema } from "./schemas.js";
4
5
  /** Default model used by the platform Vercel AI Gateway account. */
5
6
  export const DEFAULT_GATEWAY_MODEL_ID = "openai/gpt-4.1-nano";
6
7
  const SIGNAL_FAILURE_SCHEMA = z.object({
@@ -372,4 +373,13 @@ export const runtimeContract = {
372
373
  .output(z.object({
373
374
  id: z.string().nullable(),
374
375
  })),
376
+ sendSms: oc
377
+ .input(z.object({
378
+ deliveryIndex: z.number().int().nonnegative().default(0),
379
+ text: z.string().trim().min(1).max(1_000),
380
+ to: z.union([e164PhoneNumberSchema, z.literal("*")]).default("*"),
381
+ }))
382
+ .output(z.object({
383
+ ids: z.string().array(),
384
+ })),
375
385
  };
package/dist/schemas.d.ts CHANGED
@@ -1,2 +1,4 @@
1
1
  import { z } from "zod";
2
2
  export declare const reasonableNameSchema: z.ZodString;
3
+ /** Canonical E.164 phone number accepted by SMS boundaries. */
4
+ export declare const e164PhoneNumberSchema: z.ZodString;
package/dist/schemas.js CHANGED
@@ -1,2 +1,7 @@
1
1
  import { z } from "zod";
2
2
  export const reasonableNameSchema = z.string().min(1).max(255).trim();
3
+ /** Canonical E.164 phone number accepted by SMS boundaries. */
4
+ export const e164PhoneNumberSchema = z
5
+ .string()
6
+ .trim()
7
+ .regex(/^\+[1-9]\d{1,14}$/, "Use an E.164 phone number such as +12065550123.");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automate.ax/api-contract",
3
- "version": "0.46.0",
3
+ "version": "0.47.0",
4
4
  "description": "Public oRPC contract for the Automate.ax API.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@ai-sdk/gateway": "^4.0.46",
30
- "@automate.ax/codec": "0.46.0",
30
+ "@automate.ax/codec": "0.47.0",
31
31
  "@orpc/contract": "1.13.14",
32
32
  "zod": "^4.3.6"
33
33
  },
package/src/index.ts CHANGED
@@ -42,13 +42,14 @@ export {
42
42
  organizationDetailsOutputSchema,
43
43
  organizationInvitationOutputSchema,
44
44
  organizationMemberOutputSchema,
45
+ organizationPhoneNumberOutputSchema,
45
46
  organizationProjectOutputSchema,
46
47
  organizationRoleSchema,
47
48
  organizationSummaryOutputSchema,
48
49
  publicOrganizationOutputSchema,
49
50
  } from "./org"
50
51
  export { projectOutputSchema } from "./project"
51
- export { reasonableNameSchema } from "./schemas"
52
+ export { e164PhoneNumberSchema, reasonableNameSchema } from "./schemas"
52
53
  export { userOutputSchema } from "./auth"
53
54
  export {
54
55
  managementPermissionStatement,
@@ -99,6 +100,9 @@ export const firstPartyContract = {
99
100
  canInvite: orgContract.canInvite,
100
101
  createBillingPortal: orgContract.createBillingPortal,
101
102
  createCheckout: orgContract.createCheckout,
103
+ removePhoneNumber: orgContract.removePhoneNumber,
104
+ requestPhoneNumberVerification: orgContract.requestPhoneNumberVerification,
105
+ verifyPhoneNumber: orgContract.verifyPhoneNumber,
102
106
  },
103
107
  project: {
104
108
  ...publicContract.project,
package/src/org.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { oc } from "@orpc/contract"
2
2
  import { z } from "zod"
3
- import { reasonableNameSchema } from "./schemas"
3
+ import { e164PhoneNumberSchema, reasonableNameSchema } from "./schemas"
4
4
 
5
5
  export const organizationRoleSchema = z.enum(["member", "admin", "owner"])
6
6
 
@@ -34,13 +34,23 @@ export const organizationSummaryOutputSchema = z.object({
34
34
  emailRecipients: z.number(),
35
35
  projects: z.number(),
36
36
  seats: z.number(),
37
+ smsSegments: z.number(),
37
38
  }),
38
39
  usage: z.object({
39
40
  aiSpendUsd: z.number(),
40
41
  emailRecipients: z.number(),
42
+ smsSegments: z.number(),
41
43
  }),
42
44
  })
43
45
 
46
+ export const organizationPhoneNumberOutputSchema = z.object({
47
+ id: z.string(),
48
+ phoneNumber: e164PhoneNumberSchema,
49
+ createdAt: z.date(),
50
+ verifiedAt: z.date().nullable(),
51
+ consentedAt: z.date().nullable(),
52
+ })
53
+
44
54
  export const organizationMemberOutputSchema = z.object({
45
55
  id: z.string(),
46
56
  userId: z.string(),
@@ -70,6 +80,7 @@ export const organizationDetailsOutputSchema =
70
80
  organizationSummaryOutputSchema.extend({
71
81
  members: organizationMemberOutputSchema.array(),
72
82
  invitations: organizationInvitationOutputSchema.array(),
83
+ phoneNumbers: organizationPhoneNumberOutputSchema.array(),
73
84
  projects: organizationProjectOutputSchema.array(),
74
85
  })
75
86
 
@@ -197,6 +208,48 @@ export const orgContract = {
197
208
  }),
198
209
  )
199
210
  .output(z.void()),
211
+ removePhoneNumber: oc
212
+ .route({
213
+ method: "DELETE",
214
+ path: "/organizations/{organizationId}/phone-numbers/{phoneNumberId}",
215
+ operationId: "removeOrganizationPhoneNumber",
216
+ summary: "Remove organization phone number",
217
+ description:
218
+ "Removes an organization SMS destination and its verification and consent state.",
219
+ tags: ["Organizations"],
220
+ successStatus: 204,
221
+ })
222
+ .input(
223
+ z.object({
224
+ organizationId: z.string(),
225
+ phoneNumberId: z.string(),
226
+ }),
227
+ )
228
+ .output(z.void()),
229
+ requestPhoneNumberVerification: oc
230
+ .route({
231
+ method: "POST",
232
+ path: "/organizations/{organizationId}/phone-numbers/verifications",
233
+ operationId: "requestOrganizationPhoneNumberVerification",
234
+ summary: "Request organization phone verification",
235
+ description:
236
+ "Sends a verification code after the caller explicitly consents to organization automation SMS alerts.",
237
+ tags: ["Organizations"],
238
+ successStatus: 201,
239
+ })
240
+ .input(
241
+ z.object({
242
+ organizationId: z.string(),
243
+ phoneNumber: e164PhoneNumberSchema,
244
+ smsConsent: z.literal(true),
245
+ }),
246
+ )
247
+ .output(
248
+ z.object({
249
+ expiresAt: z.date(),
250
+ phoneNumberId: z.string(),
251
+ }),
252
+ ),
200
253
  update: oc
201
254
  .route({
202
255
  method: "PATCH",
@@ -214,4 +267,26 @@ export const orgContract = {
214
267
  }),
215
268
  )
216
269
  .output(z.void()),
270
+ verifyPhoneNumber: oc
271
+ .route({
272
+ method: "POST",
273
+ path: "/organizations/{organizationId}/phone-numbers/{phoneNumberId}/verification",
274
+ operationId: "verifyOrganizationPhoneNumber",
275
+ summary: "Verify organization phone number",
276
+ description:
277
+ "Verifies possession of an organization SMS destination and activates its recorded consent.",
278
+ tags: ["Organizations"],
279
+ successStatus: 204,
280
+ })
281
+ .input(
282
+ z.object({
283
+ organizationId: z.string(),
284
+ phoneNumberId: z.string(),
285
+ code: z
286
+ .string()
287
+ .trim()
288
+ .regex(/^\d{6}$/),
289
+ }),
290
+ )
291
+ .output(z.void()),
217
292
  }
package/src/runtime.ts CHANGED
@@ -2,6 +2,7 @@ import { encodableSchema } from "@automate.ax/codec"
2
2
  import type { GatewayModelId } from "@ai-sdk/gateway"
3
3
  import { oc } from "@orpc/contract"
4
4
  import { z } from "zod"
5
+ import { e164PhoneNumberSchema } from "./schemas"
5
6
 
6
7
  /** Default model used by the platform Vercel AI Gateway account. */
7
8
  export const DEFAULT_GATEWAY_MODEL_ID =
@@ -430,4 +431,17 @@ export const runtimeContract = {
430
431
  id: z.string().nullable(),
431
432
  }),
432
433
  ),
434
+ sendSms: oc
435
+ .input(
436
+ z.object({
437
+ deliveryIndex: z.number().int().nonnegative().default(0),
438
+ text: z.string().trim().min(1).max(1_000),
439
+ to: z.union([e164PhoneNumberSchema, z.literal("*")]).default("*"),
440
+ }),
441
+ )
442
+ .output(
443
+ z.object({
444
+ ids: z.string().array(),
445
+ }),
446
+ ),
433
447
  }
package/src/schemas.ts CHANGED
@@ -1,3 +1,9 @@
1
1
  import { z } from "zod"
2
2
 
3
3
  export const reasonableNameSchema = z.string().min(1).max(255).trim()
4
+
5
+ /** Canonical E.164 phone number accepted by SMS boundaries. */
6
+ export const e164PhoneNumberSchema = z
7
+ .string()
8
+ .trim()
9
+ .regex(/^\+[1-9]\d{1,14}$/, "Use an E.164 phone number such as +12065550123.")