@automate.ax/api-contract 0.20.1 → 0.21.1

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/auth.d.ts CHANGED
@@ -18,7 +18,4 @@ export declare const authContract: {
18
18
  createdAt: z.ZodDate;
19
19
  updatedAt: z.ZodDate;
20
20
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
21
- linkDeviceSession: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
22
- newAccessToken: z.ZodString;
23
- }, z.core.$strip>, z.ZodVoid, Record<never, never>, Record<never, never>>;
24
21
  };
package/dist/auth.js CHANGED
@@ -20,16 +20,4 @@ export const authContract = {
20
20
  tags: ["Session"],
21
21
  })
22
22
  .output(userOutputSchema),
23
- linkDeviceSession: oc
24
- .route({
25
- method: "POST",
26
- path: "/me/session/link-device",
27
- operationId: "linkDeviceSession",
28
- summary: "Link device session",
29
- description: "Migrates anonymous-session data into authenticated user context.",
30
- tags: ["Session"],
31
- successStatus: 204,
32
- })
33
- .input(z.object({ newAccessToken: z.string() }))
34
- .output(z.void()),
35
23
  };
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ export { runtimeContract } from "./runtime.js";
3
3
  export { createdOrganizationApiKeyOutputSchema, organizationApiKeyOutputSchema, } from "./api-key.js";
4
4
  export { integrationConnectionManifestSchema, integrationServiceManifestSchema, type IntegrationConnectionManifest, type IntegrationServiceManifest, } from "./authorization.js";
5
5
  export { activeSubscriptionOutputSchema, createdInvitationOutputSchema, organizationDetailsOutputSchema, organizationInvitationOutputSchema, organizationMemberOutputSchema, organizationProjectOutputSchema, organizationRoleSchema, organizationSummaryOutputSchema, publicOrganizationOutputSchema, } from "./org.js";
6
- export { projectOutputSchema, projectWithOrganizationOutputSchema, } from "./project.js";
6
+ export { projectOutputSchema } from "./project.js";
7
7
  export { reasonableNameSchema } from "./schemas.js";
8
8
  export { userOutputSchema } from "./auth.js";
9
9
  /** Procedures exposed by the public Node client and OpenAPI document. */
@@ -194,6 +194,14 @@ export declare const publicContract: {
194
194
  organizationId: import("zod").ZodString;
195
195
  createdAt: import("zod").ZodDate;
196
196
  createdBy: import("zod").ZodNullable<import("zod").ZodString>;
197
+ org: import("zod").ZodObject<{
198
+ id: import("zod").ZodString;
199
+ name: import("zod").ZodString;
200
+ }, import("zod/v4/core").$strip>;
201
+ activeAutomations: import("zod").ZodArray<import("zod").ZodObject<{
202
+ description: import("zod").ZodString;
203
+ identityKey: import("zod").ZodString;
204
+ }, import("zod/v4/core").$strip>>;
197
205
  }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
198
206
  delete: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
199
207
  projectId: import("zod").ZodString;
@@ -211,6 +219,7 @@ export declare const publicContract: {
211
219
  name: import("zod").ZodString;
212
220
  }, import("zod/v4/core").$strip>;
213
221
  activeAutomations: import("zod").ZodArray<import("zod").ZodObject<{
222
+ description: import("zod").ZodString;
214
223
  identityKey: import("zod").ZodString;
215
224
  }, import("zod/v4/core").$strip>>;
216
225
  }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
@@ -227,6 +236,10 @@ export declare const publicContract: {
227
236
  id: import("zod").ZodString;
228
237
  name: import("zod").ZodString;
229
238
  }, import("zod/v4/core").$strip>;
239
+ activeAutomations: import("zod").ZodArray<import("zod").ZodObject<{
240
+ description: import("zod").ZodString;
241
+ identityKey: import("zod").ZodString;
242
+ }, import("zod/v4/core").$strip>>;
230
243
  }, import("zod/v4/core").$strip>>, Record<never, never>, Record<never, never>>;
231
244
  update: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
232
245
  projectId: import("zod").ZodString;
@@ -410,6 +423,16 @@ export declare const firstPartyContract: {
410
423
  canInvite: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
411
424
  organizationId: import("zod").ZodString;
412
425
  }, import("zod/v4/core").$strip>, import("zod").ZodBoolean, Record<never, never>, Record<never, never>>;
426
+ createBillingPortal: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
427
+ organizationId: import("zod").ZodString;
428
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
429
+ url: import("zod").ZodURL;
430
+ }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
431
+ createCheckout: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
432
+ organizationId: import("zod").ZodString;
433
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
434
+ url: import("zod").ZodURL;
435
+ }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
413
436
  create: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
414
437
  name: import("zod").ZodString;
415
438
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
@@ -558,6 +581,14 @@ export declare const firstPartyContract: {
558
581
  organizationId: import("zod").ZodString;
559
582
  createdAt: import("zod").ZodDate;
560
583
  createdBy: import("zod").ZodNullable<import("zod").ZodString>;
584
+ org: import("zod").ZodObject<{
585
+ id: import("zod").ZodString;
586
+ name: import("zod").ZodString;
587
+ }, import("zod/v4/core").$strip>;
588
+ activeAutomations: import("zod").ZodArray<import("zod").ZodObject<{
589
+ description: import("zod").ZodString;
590
+ identityKey: import("zod").ZodString;
591
+ }, import("zod/v4/core").$strip>>;
561
592
  }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
562
593
  delete: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
563
594
  projectId: import("zod").ZodString;
@@ -575,6 +606,7 @@ export declare const firstPartyContract: {
575
606
  name: import("zod").ZodString;
576
607
  }, import("zod/v4/core").$strip>;
577
608
  activeAutomations: import("zod").ZodArray<import("zod").ZodObject<{
609
+ description: import("zod").ZodString;
578
610
  identityKey: import("zod").ZodString;
579
611
  }, import("zod/v4/core").$strip>>;
580
612
  }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
@@ -591,6 +623,10 @@ export declare const firstPartyContract: {
591
623
  id: import("zod").ZodString;
592
624
  name: import("zod").ZodString;
593
625
  }, import("zod/v4/core").$strip>;
626
+ activeAutomations: import("zod").ZodArray<import("zod").ZodObject<{
627
+ description: import("zod").ZodString;
628
+ identityKey: import("zod").ZodString;
629
+ }, import("zod/v4/core").$strip>>;
594
630
  }, import("zod/v4/core").$strip>>, Record<never, never>, Record<never, never>>;
595
631
  update: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
596
632
  projectId: import("zod").ZodString;
@@ -598,9 +634,6 @@ export declare const firstPartyContract: {
598
634
  }, import("zod/v4/core").$strip>, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
599
635
  };
600
636
  session: {
601
- linkDeviceSession: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
602
- newAccessToken: import("zod").ZodString;
603
- }, import("zod/v4/core").$strip>, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
604
637
  me: import("@orpc/contract").ContractProcedureBuilderWithOutput<import("@orpc/contract").Schema<unknown, unknown>, import("zod").ZodObject<{
605
638
  id: import("zod").ZodString;
606
639
  name: import("zod").ZodString;
@@ -1000,6 +1033,16 @@ export declare const contract: {
1000
1033
  canInvite: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
1001
1034
  organizationId: import("zod").ZodString;
1002
1035
  }, import("zod/v4/core").$strip>, import("zod").ZodBoolean, Record<never, never>, Record<never, never>>;
1036
+ createBillingPortal: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
1037
+ organizationId: import("zod").ZodString;
1038
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1039
+ url: import("zod").ZodURL;
1040
+ }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
1041
+ createCheckout: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
1042
+ organizationId: import("zod").ZodString;
1043
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1044
+ url: import("zod").ZodURL;
1045
+ }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
1003
1046
  create: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
1004
1047
  name: import("zod").ZodString;
1005
1048
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
@@ -1148,6 +1191,14 @@ export declare const contract: {
1148
1191
  organizationId: import("zod").ZodString;
1149
1192
  createdAt: import("zod").ZodDate;
1150
1193
  createdBy: import("zod").ZodNullable<import("zod").ZodString>;
1194
+ org: import("zod").ZodObject<{
1195
+ id: import("zod").ZodString;
1196
+ name: import("zod").ZodString;
1197
+ }, import("zod/v4/core").$strip>;
1198
+ activeAutomations: import("zod").ZodArray<import("zod").ZodObject<{
1199
+ description: import("zod").ZodString;
1200
+ identityKey: import("zod").ZodString;
1201
+ }, import("zod/v4/core").$strip>>;
1151
1202
  }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
1152
1203
  delete: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
1153
1204
  projectId: import("zod").ZodString;
@@ -1165,6 +1216,7 @@ export declare const contract: {
1165
1216
  name: import("zod").ZodString;
1166
1217
  }, import("zod/v4/core").$strip>;
1167
1218
  activeAutomations: import("zod").ZodArray<import("zod").ZodObject<{
1219
+ description: import("zod").ZodString;
1168
1220
  identityKey: import("zod").ZodString;
1169
1221
  }, import("zod/v4/core").$strip>>;
1170
1222
  }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
@@ -1181,6 +1233,10 @@ export declare const contract: {
1181
1233
  id: import("zod").ZodString;
1182
1234
  name: import("zod").ZodString;
1183
1235
  }, import("zod/v4/core").$strip>;
1236
+ activeAutomations: import("zod").ZodArray<import("zod").ZodObject<{
1237
+ description: import("zod").ZodString;
1238
+ identityKey: import("zod").ZodString;
1239
+ }, import("zod/v4/core").$strip>>;
1184
1240
  }, import("zod/v4/core").$strip>>, Record<never, never>, Record<never, never>>;
1185
1241
  update: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
1186
1242
  projectId: import("zod").ZodString;
@@ -1188,9 +1244,6 @@ export declare const contract: {
1188
1244
  }, import("zod/v4/core").$strip>, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
1189
1245
  };
1190
1246
  session: {
1191
- linkDeviceSession: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
1192
- newAccessToken: import("zod").ZodString;
1193
- }, import("zod/v4/core").$strip>, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
1194
1247
  me: import("@orpc/contract").ContractProcedureBuilderWithOutput<import("@orpc/contract").Schema<unknown, unknown>, import("zod").ZodObject<{
1195
1248
  id: import("zod").ZodString;
1196
1249
  name: import("zod").ZodString;
package/dist/index.js CHANGED
@@ -11,7 +11,7 @@ export { runtimeContract } from "./runtime.js";
11
11
  export { createdOrganizationApiKeyOutputSchema, organizationApiKeyOutputSchema, } from "./api-key.js";
12
12
  export { integrationConnectionManifestSchema, integrationServiceManifestSchema, } from "./authorization.js";
13
13
  export { activeSubscriptionOutputSchema, createdInvitationOutputSchema, organizationDetailsOutputSchema, organizationInvitationOutputSchema, organizationMemberOutputSchema, organizationProjectOutputSchema, organizationRoleSchema, organizationSummaryOutputSchema, publicOrganizationOutputSchema, } from "./org.js";
14
- export { projectOutputSchema, projectWithOrganizationOutputSchema, } from "./project.js";
14
+ export { projectOutputSchema } from "./project.js";
15
15
  export { reasonableNameSchema } from "./schemas.js";
16
16
  export { userOutputSchema } from "./auth.js";
17
17
  /** Procedures exposed by the public Node client and OpenAPI document. */
@@ -51,6 +51,8 @@ export const firstPartyContract = {
51
51
  org: {
52
52
  ...publicContract.org,
53
53
  canInvite: orgContract.canInvite,
54
+ createBillingPortal: orgContract.createBillingPortal,
55
+ createCheckout: orgContract.createCheckout,
54
56
  },
55
57
  project: {
56
58
  ...publicContract.project,
@@ -58,7 +60,6 @@ export const firstPartyContract = {
58
60
  },
59
61
  session: {
60
62
  ...publicContract.session,
61
- linkDeviceSession: authContract.linkDeviceSession,
62
63
  },
63
64
  };
64
65
  /** Complete contract implemented by the API service. */
package/dist/org.d.ts CHANGED
@@ -151,6 +151,16 @@ export declare const orgContract: {
151
151
  canInvite: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
152
152
  organizationId: z.ZodString;
153
153
  }, z.core.$strip>, z.ZodBoolean, Record<never, never>, Record<never, never>>;
154
+ createBillingPortal: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
155
+ organizationId: z.ZodString;
156
+ }, z.core.$strip>, z.ZodObject<{
157
+ url: z.ZodURL;
158
+ }, z.core.$strip>, Record<never, never>, Record<never, never>>;
159
+ createCheckout: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
160
+ organizationId: z.ZodString;
161
+ }, z.core.$strip>, z.ZodObject<{
162
+ url: z.ZodURL;
163
+ }, z.core.$strip>, Record<never, never>, Record<never, never>>;
154
164
  create: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
155
165
  name: z.ZodString;
156
166
  }, z.core.$strip>, z.ZodObject<{
package/dist/org.js CHANGED
@@ -67,6 +67,12 @@ export const orgContract = {
67
67
  canInvite: oc
68
68
  .input(z.object({ organizationId: z.string() }))
69
69
  .output(z.boolean()),
70
+ createBillingPortal: oc
71
+ .input(z.object({ organizationId: z.string() }))
72
+ .output(z.object({ url: z.url() })),
73
+ createCheckout: oc
74
+ .input(z.object({ organizationId: z.string() }))
75
+ .output(z.object({ url: z.url() })),
70
76
  create: oc
71
77
  .route({
72
78
  method: "POST",
@@ -86,7 +92,7 @@ export const orgContract = {
86
92
  path: "/organizations/{organizationId}",
87
93
  operationId: "deleteOrganization",
88
94
  summary: "Delete organization",
89
- description: "Deletes an organization. Caller must be the organization owner.",
95
+ description: "Deletes an organization and cancels its billing. Caller must be the organization owner.",
90
96
  tags: ["Organizations"],
91
97
  successStatus: 204,
92
98
  })
package/dist/project.d.ts CHANGED
@@ -5,17 +5,14 @@ export declare const projectOutputSchema: z.ZodObject<{
5
5
  organizationId: z.ZodString;
6
6
  createdAt: z.ZodDate;
7
7
  createdBy: z.ZodNullable<z.ZodString>;
8
- }, z.core.$strip>;
9
- export declare const projectWithOrganizationOutputSchema: z.ZodObject<{
10
- id: z.ZodString;
11
- name: z.ZodString;
12
- organizationId: z.ZodString;
13
- createdAt: z.ZodDate;
14
- createdBy: z.ZodNullable<z.ZodString>;
15
8
  org: z.ZodObject<{
16
9
  id: z.ZodString;
17
10
  name: z.ZodString;
18
11
  }, z.core.$strip>;
12
+ activeAutomations: z.ZodArray<z.ZodObject<{
13
+ description: z.ZodString;
14
+ identityKey: z.ZodString;
15
+ }, z.core.$strip>>;
19
16
  }, z.core.$strip>;
20
17
  export declare const projectContract: {
21
18
  canCreate: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
@@ -30,6 +27,14 @@ export declare const projectContract: {
30
27
  organizationId: z.ZodString;
31
28
  createdAt: z.ZodDate;
32
29
  createdBy: z.ZodNullable<z.ZodString>;
30
+ org: z.ZodObject<{
31
+ id: z.ZodString;
32
+ name: z.ZodString;
33
+ }, z.core.$strip>;
34
+ activeAutomations: z.ZodArray<z.ZodObject<{
35
+ description: z.ZodString;
36
+ identityKey: z.ZodString;
37
+ }, z.core.$strip>>;
33
38
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
34
39
  list: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodOptional<z.ZodObject<{
35
40
  organizationId: z.ZodOptional<z.ZodString>;
@@ -44,6 +49,10 @@ export declare const projectContract: {
44
49
  id: z.ZodString;
45
50
  name: z.ZodString;
46
51
  }, z.core.$strip>;
52
+ activeAutomations: z.ZodArray<z.ZodObject<{
53
+ description: z.ZodString;
54
+ identityKey: z.ZodString;
55
+ }, z.core.$strip>>;
47
56
  }, z.core.$strip>>, Record<never, never>, Record<never, never>>;
48
57
  get: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
49
58
  projectId: z.ZodString;
@@ -58,6 +67,7 @@ export declare const projectContract: {
58
67
  name: z.ZodString;
59
68
  }, z.core.$strip>;
60
69
  activeAutomations: z.ZodArray<z.ZodObject<{
70
+ description: z.ZodString;
61
71
  identityKey: z.ZodString;
62
72
  }, z.core.$strip>>;
63
73
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
package/dist/project.js CHANGED
@@ -7,12 +7,16 @@ export const projectOutputSchema = z.object({
7
7
  organizationId: z.string(),
8
8
  createdAt: z.date(),
9
9
  createdBy: z.string().nullable(),
10
- });
11
- export const projectWithOrganizationOutputSchema = projectOutputSchema.extend({
12
10
  org: z.object({
13
11
  id: z.string(),
14
12
  name: z.string(),
15
13
  }),
14
+ activeAutomations: z
15
+ .object({
16
+ description: z.string(),
17
+ identityKey: z.string(),
18
+ })
19
+ .array(),
16
20
  });
17
21
  export const projectContract = {
18
22
  canCreate: oc
@@ -49,7 +53,7 @@ export const projectContract = {
49
53
  query: z.string().min(1).optional(),
50
54
  })
51
55
  .optional())
52
- .output(projectWithOrganizationOutputSchema.array()),
56
+ .output(projectOutputSchema.array()),
53
57
  get: oc
54
58
  .route({
55
59
  method: "GET",
@@ -60,13 +64,7 @@ export const projectContract = {
60
64
  tags: ["Projects"],
61
65
  })
62
66
  .input(z.object({ projectId: z.string() }))
63
- .output(projectWithOrganizationOutputSchema.extend({
64
- activeAutomations: z
65
- .object({
66
- identityKey: z.string(),
67
- })
68
- .array(),
69
- })),
67
+ .output(projectOutputSchema),
70
68
  update: oc
71
69
  .route({
72
70
  method: "PATCH",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automate.ax/api-contract",
3
- "version": "0.20.1",
3
+ "version": "0.21.1",
4
4
  "description": "Public oRPC contract for the Automate.ax API.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -26,7 +26,7 @@
26
26
  }
27
27
  },
28
28
  "dependencies": {
29
- "@automate.ax/codec": "0.20.1",
29
+ "@automate.ax/codec": "0.21.1",
30
30
  "@orpc/contract": "1.13.14",
31
31
  "zod": "^4.3.6"
32
32
  },
package/src/auth.ts CHANGED
@@ -23,17 +23,4 @@ export const authContract = {
23
23
  tags: ["Session"],
24
24
  })
25
25
  .output(userOutputSchema),
26
- linkDeviceSession: oc
27
- .route({
28
- method: "POST",
29
- path: "/me/session/link-device",
30
- operationId: "linkDeviceSession",
31
- summary: "Link device session",
32
- description:
33
- "Migrates anonymous-session data into authenticated user context.",
34
- tags: ["Session"],
35
- successStatus: 204,
36
- })
37
- .input(z.object({ newAccessToken: z.string() }))
38
- .output(z.void()),
39
26
  }
package/src/index.ts CHANGED
@@ -34,10 +34,7 @@ export {
34
34
  organizationSummaryOutputSchema,
35
35
  publicOrganizationOutputSchema,
36
36
  } from "./org"
37
- export {
38
- projectOutputSchema,
39
- projectWithOrganizationOutputSchema,
40
- } from "./project"
37
+ export { projectOutputSchema } from "./project"
41
38
  export { reasonableNameSchema } from "./schemas"
42
39
  export { userOutputSchema } from "./auth"
43
40
 
@@ -79,6 +76,8 @@ export const firstPartyContract = {
79
76
  org: {
80
77
  ...publicContract.org,
81
78
  canInvite: orgContract.canInvite,
79
+ createBillingPortal: orgContract.createBillingPortal,
80
+ createCheckout: orgContract.createCheckout,
82
81
  },
83
82
  project: {
84
83
  ...publicContract.project,
@@ -86,7 +85,6 @@ export const firstPartyContract = {
86
85
  },
87
86
  session: {
88
87
  ...publicContract.session,
89
- linkDeviceSession: authContract.linkDeviceSession,
90
88
  },
91
89
  }
92
90
 
package/src/org.ts CHANGED
@@ -78,6 +78,12 @@ export const orgContract = {
78
78
  canInvite: oc
79
79
  .input(z.object({ organizationId: z.string() }))
80
80
  .output(z.boolean()),
81
+ createBillingPortal: oc
82
+ .input(z.object({ organizationId: z.string() }))
83
+ .output(z.object({ url: z.url() })),
84
+ createCheckout: oc
85
+ .input(z.object({ organizationId: z.string() }))
86
+ .output(z.object({ url: z.url() })),
81
87
  create: oc
82
88
  .route({
83
89
  method: "POST",
@@ -98,7 +104,7 @@ export const orgContract = {
98
104
  operationId: "deleteOrganization",
99
105
  summary: "Delete organization",
100
106
  description:
101
- "Deletes an organization. Caller must be the organization owner.",
107
+ "Deletes an organization and cancels its billing. Caller must be the organization owner.",
102
108
  tags: ["Organizations"],
103
109
  successStatus: 204,
104
110
  })
package/src/project.ts CHANGED
@@ -8,13 +8,16 @@ export const projectOutputSchema = z.object({
8
8
  organizationId: z.string(),
9
9
  createdAt: z.date(),
10
10
  createdBy: z.string().nullable(),
11
- })
12
-
13
- export const projectWithOrganizationOutputSchema = projectOutputSchema.extend({
14
11
  org: z.object({
15
12
  id: z.string(),
16
13
  name: z.string(),
17
14
  }),
15
+ activeAutomations: z
16
+ .object({
17
+ description: z.string(),
18
+ identityKey: z.string(),
19
+ })
20
+ .array(),
18
21
  })
19
22
 
20
23
  export const projectContract = {
@@ -58,7 +61,7 @@ export const projectContract = {
58
61
  })
59
62
  .optional(),
60
63
  )
61
- .output(projectWithOrganizationOutputSchema.array()),
64
+ .output(projectOutputSchema.array()),
62
65
  get: oc
63
66
  .route({
64
67
  method: "GET",
@@ -70,15 +73,7 @@ export const projectContract = {
70
73
  tags: ["Projects"],
71
74
  })
72
75
  .input(z.object({ projectId: z.string() }))
73
- .output(
74
- projectWithOrganizationOutputSchema.extend({
75
- activeAutomations: z
76
- .object({
77
- identityKey: z.string(),
78
- })
79
- .array(),
80
- }),
81
- ),
76
+ .output(projectOutputSchema),
82
77
  update: oc
83
78
  .route({
84
79
  method: "PATCH",