@automate.ax/api-contract 0.27.0 → 0.29.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.
@@ -11,8 +11,13 @@ export declare const deploymentTriggerInfoSchema: z.ZodObject<{
11
11
  }, z.core.$strip>;
12
12
  export type DeploymentTriggerInfo = z.infer<typeof deploymentTriggerInfoSchema>;
13
13
  export declare const deploymentContract: {
14
+ cancel: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
15
+ deploymentId: z.ZodString;
16
+ projectId: z.ZodString;
17
+ }, z.core.$strip>, z.ZodVoid, Record<never, never>, Record<never, never>>;
14
18
  create: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
15
19
  artifact: z.ZodCustom<Blob, Blob>;
20
+ cancelExisting: z.ZodDefault<z.ZodBoolean>;
16
21
  manifest: z.ZodArray<z.ZodObject<{
17
22
  identityKey: z.ZodString;
18
23
  }, z.core.$strip>>;
@@ -22,9 +27,31 @@ export declare const deploymentContract: {
22
27
  }>;
23
28
  projectId: z.ZodString;
24
29
  rebindAccounts: z.ZodDefault<z.ZodBoolean>;
30
+ git: z.ZodOptional<z.ZodObject<{
31
+ commitSha: z.ZodString;
32
+ dirty: z.ZodBoolean;
33
+ repositoryUrl: z.ZodString;
34
+ }, z.core.$strip>>;
25
35
  }, z.core.$strip>, z.ZodObject<{
26
36
  id: z.ZodString;
27
- }, z.core.$strip>, Record<never, never>, Record<never, never>>;
37
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, {
38
+ DEPLOYMENT_IN_PROGRESS: {
39
+ readonly data: z.ZodObject<{
40
+ deploymentId: z.ZodString;
41
+ status: z.ZodEnum<{
42
+ succeeded: "succeeded";
43
+ failed: "failed";
44
+ planning: "planning";
45
+ awaiting_authorization: "awaiting_authorization";
46
+ configuring: "configuring";
47
+ publishing: "publishing";
48
+ cancelled: "cancelled";
49
+ }>;
50
+ }, z.core.$strip>;
51
+ readonly message: "A deployment is already in progress.";
52
+ readonly status: 409;
53
+ };
54
+ }>, Record<never, never>>;
28
55
  get: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
29
56
  deploymentId: z.ZodString;
30
57
  projectId: z.ZodString;
@@ -42,6 +69,11 @@ export declare const deploymentContract: {
42
69
  }, z.core.$strip>>;
43
70
  }, z.core.$strip>>;
44
71
  id: z.ZodString;
72
+ git: z.ZodNullable<z.ZodObject<{
73
+ commitSha: z.ZodString;
74
+ dirty: z.ZodBoolean;
75
+ repositoryUrl: z.ZodString;
76
+ }, z.core.$strip>>;
45
77
  job: z.ZodNullable<z.ZodObject<{
46
78
  attempts: z.ZodNumber;
47
79
  error: z.ZodNullable<z.ZodString>;
@@ -59,6 +91,7 @@ export declare const deploymentContract: {
59
91
  awaiting_authorization: "awaiting_authorization";
60
92
  configuring: "configuring";
61
93
  publishing: "publishing";
94
+ cancelled: "cancelled";
62
95
  }>;
63
96
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
64
97
  };
@@ -12,10 +12,40 @@ export const deploymentTriggerInfoSchema = z.object({
12
12
  name: z.string(),
13
13
  type: z.string(),
14
14
  });
15
+ const DEPLOYMENT_STATUS_SCHEMA = z.enum([
16
+ "planning",
17
+ "awaiting_authorization",
18
+ "configuring",
19
+ "publishing",
20
+ "succeeded",
21
+ "failed",
22
+ "cancelled",
23
+ ]);
24
+ const DEPLOYMENT_IN_PROGRESS_ERROR = {
25
+ data: z.object({
26
+ deploymentId: z.string(),
27
+ status: DEPLOYMENT_STATUS_SCHEMA,
28
+ }),
29
+ message: "A deployment is already in progress.",
30
+ status: 409,
31
+ };
32
+ const GIT_SOURCE_SCHEMA = z.object({
33
+ commitSha: z.string().regex(/^[0-9a-f]{40}(?:[0-9a-f]{24})?$/),
34
+ dirty: z.boolean(),
35
+ repositoryUrl: z.string().min(1),
36
+ });
15
37
  export const deploymentContract = {
38
+ cancel: oc
39
+ .input(z.object({
40
+ deploymentId: z.string(),
41
+ projectId: z.string(),
42
+ }))
43
+ .output(z.void()),
16
44
  create: oc
45
+ .errors({ DEPLOYMENT_IN_PROGRESS: DEPLOYMENT_IN_PROGRESS_ERROR })
17
46
  .input(z.object({
18
47
  artifact: z.instanceof(Blob),
48
+ cancelExisting: z.boolean().default(false),
19
49
  manifest: z
20
50
  .object({
21
51
  identityKey: z.string().min(1),
@@ -37,6 +67,7 @@ export const deploymentContract = {
37
67
  mode: z.enum(["reconcile", "upsert"]),
38
68
  projectId: z.string(),
39
69
  rebindAccounts: z.boolean().default(false),
70
+ git: GIT_SOURCE_SCHEMA.optional(),
40
71
  }))
41
72
  .output(z.object({ id: z.string() })),
42
73
  get: oc
@@ -53,6 +84,7 @@ export const deploymentContract = {
53
84
  })
54
85
  .array(),
55
86
  id: z.string(),
87
+ git: GIT_SOURCE_SCHEMA.nullable(),
56
88
  job: z
57
89
  .object({
58
90
  attempts: z.number().int().nonnegative(),
@@ -65,13 +97,6 @@ export const deploymentContract = {
65
97
  id: z.string(),
66
98
  name: z.string(),
67
99
  }),
68
- status: z.enum([
69
- "planning",
70
- "awaiting_authorization",
71
- "configuring",
72
- "publishing",
73
- "succeeded",
74
- "failed",
75
- ]),
100
+ status: DEPLOYMENT_STATUS_SCHEMA,
76
101
  })),
77
102
  };
package/dist/index.d.ts CHANGED
@@ -469,8 +469,13 @@ export declare const firstPartyContract: {
469
469
  }, import("zod/v4/core").$strip>, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
470
470
  };
471
471
  deployment: {
472
+ cancel: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
473
+ deploymentId: import("zod").ZodString;
474
+ projectId: import("zod").ZodString;
475
+ }, import("zod/v4/core").$strip>, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
472
476
  create: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
473
477
  artifact: import("zod").ZodCustom<Blob, Blob>;
478
+ cancelExisting: import("zod").ZodDefault<import("zod").ZodBoolean>;
474
479
  manifest: import("zod").ZodArray<import("zod").ZodObject<{
475
480
  identityKey: import("zod").ZodString;
476
481
  }, import("zod/v4/core").$strip>>;
@@ -480,9 +485,31 @@ export declare const firstPartyContract: {
480
485
  }>;
481
486
  projectId: import("zod").ZodString;
482
487
  rebindAccounts: import("zod").ZodDefault<import("zod").ZodBoolean>;
488
+ git: import("zod").ZodOptional<import("zod").ZodObject<{
489
+ commitSha: import("zod").ZodString;
490
+ dirty: import("zod").ZodBoolean;
491
+ repositoryUrl: import("zod").ZodString;
492
+ }, import("zod/v4/core").$strip>>;
483
493
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
484
494
  id: import("zod").ZodString;
485
- }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
495
+ }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, {
496
+ DEPLOYMENT_IN_PROGRESS: {
497
+ readonly data: import("zod").ZodObject<{
498
+ deploymentId: import("zod").ZodString;
499
+ status: import("zod").ZodEnum<{
500
+ succeeded: "succeeded";
501
+ failed: "failed";
502
+ planning: "planning";
503
+ awaiting_authorization: "awaiting_authorization";
504
+ configuring: "configuring";
505
+ publishing: "publishing";
506
+ cancelled: "cancelled";
507
+ }>;
508
+ }, import("zod/v4/core").$strip>;
509
+ readonly message: "A deployment is already in progress.";
510
+ readonly status: 409;
511
+ };
512
+ }>, Record<never, never>>;
486
513
  get: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
487
514
  deploymentId: import("zod").ZodString;
488
515
  projectId: import("zod").ZodString;
@@ -500,6 +527,11 @@ export declare const firstPartyContract: {
500
527
  }, import("zod/v4/core").$strip>>;
501
528
  }, import("zod/v4/core").$strip>>;
502
529
  id: import("zod").ZodString;
530
+ git: import("zod").ZodNullable<import("zod").ZodObject<{
531
+ commitSha: import("zod").ZodString;
532
+ dirty: import("zod").ZodBoolean;
533
+ repositoryUrl: import("zod").ZodString;
534
+ }, import("zod/v4/core").$strip>>;
503
535
  job: import("zod").ZodNullable<import("zod").ZodObject<{
504
536
  attempts: import("zod").ZodNumber;
505
537
  error: import("zod").ZodNullable<import("zod").ZodString>;
@@ -517,6 +549,7 @@ export declare const firstPartyContract: {
517
549
  awaiting_authorization: "awaiting_authorization";
518
550
  configuring: "configuring";
519
551
  publishing: "publishing";
552
+ cancelled: "cancelled";
520
553
  }>;
521
554
  }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
522
555
  };
@@ -1285,8 +1318,13 @@ export declare const contract: {
1285
1318
  }, import("zod/v4/core").$strip>, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
1286
1319
  };
1287
1320
  deployment: {
1321
+ cancel: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
1322
+ deploymentId: import("zod").ZodString;
1323
+ projectId: import("zod").ZodString;
1324
+ }, import("zod/v4/core").$strip>, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
1288
1325
  create: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
1289
1326
  artifact: import("zod").ZodCustom<Blob, Blob>;
1327
+ cancelExisting: import("zod").ZodDefault<import("zod").ZodBoolean>;
1290
1328
  manifest: import("zod").ZodArray<import("zod").ZodObject<{
1291
1329
  identityKey: import("zod").ZodString;
1292
1330
  }, import("zod/v4/core").$strip>>;
@@ -1296,9 +1334,31 @@ export declare const contract: {
1296
1334
  }>;
1297
1335
  projectId: import("zod").ZodString;
1298
1336
  rebindAccounts: import("zod").ZodDefault<import("zod").ZodBoolean>;
1337
+ git: import("zod").ZodOptional<import("zod").ZodObject<{
1338
+ commitSha: import("zod").ZodString;
1339
+ dirty: import("zod").ZodBoolean;
1340
+ repositoryUrl: import("zod").ZodString;
1341
+ }, import("zod/v4/core").$strip>>;
1299
1342
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1300
1343
  id: import("zod").ZodString;
1301
- }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
1344
+ }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, {
1345
+ DEPLOYMENT_IN_PROGRESS: {
1346
+ readonly data: import("zod").ZodObject<{
1347
+ deploymentId: import("zod").ZodString;
1348
+ status: import("zod").ZodEnum<{
1349
+ succeeded: "succeeded";
1350
+ failed: "failed";
1351
+ planning: "planning";
1352
+ awaiting_authorization: "awaiting_authorization";
1353
+ configuring: "configuring";
1354
+ publishing: "publishing";
1355
+ cancelled: "cancelled";
1356
+ }>;
1357
+ }, import("zod/v4/core").$strip>;
1358
+ readonly message: "A deployment is already in progress.";
1359
+ readonly status: 409;
1360
+ };
1361
+ }>, Record<never, never>>;
1302
1362
  get: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
1303
1363
  deploymentId: import("zod").ZodString;
1304
1364
  projectId: import("zod").ZodString;
@@ -1316,6 +1376,11 @@ export declare const contract: {
1316
1376
  }, import("zod/v4/core").$strip>>;
1317
1377
  }, import("zod/v4/core").$strip>>;
1318
1378
  id: import("zod").ZodString;
1379
+ git: import("zod").ZodNullable<import("zod").ZodObject<{
1380
+ commitSha: import("zod").ZodString;
1381
+ dirty: import("zod").ZodBoolean;
1382
+ repositoryUrl: import("zod").ZodString;
1383
+ }, import("zod/v4/core").$strip>>;
1319
1384
  job: import("zod").ZodNullable<import("zod").ZodObject<{
1320
1385
  attempts: import("zod").ZodNumber;
1321
1386
  error: import("zod").ZodNullable<import("zod").ZodString>;
@@ -1333,6 +1398,7 @@ export declare const contract: {
1333
1398
  awaiting_authorization: "awaiting_authorization";
1334
1399
  configuring: "configuring";
1335
1400
  publishing: "publishing";
1401
+ cancelled: "cancelled";
1336
1402
  }>;
1337
1403
  }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
1338
1404
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automate.ax/api-contract",
3
- "version": "0.27.0",
3
+ "version": "0.29.0",
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.27.0",
29
+ "@automate.ax/codec": "0.29.0",
30
30
  "@orpc/contract": "1.13.14",
31
31
  "zod": "^4.3.6"
32
32
  },
package/src/deployment.ts CHANGED
@@ -17,11 +17,46 @@ export const deploymentTriggerInfoSchema = z.object({
17
17
 
18
18
  export type DeploymentTriggerInfo = z.infer<typeof deploymentTriggerInfoSchema>
19
19
 
20
+ const DEPLOYMENT_STATUS_SCHEMA = z.enum([
21
+ "planning",
22
+ "awaiting_authorization",
23
+ "configuring",
24
+ "publishing",
25
+ "succeeded",
26
+ "failed",
27
+ "cancelled",
28
+ ])
29
+
30
+ const DEPLOYMENT_IN_PROGRESS_ERROR = {
31
+ data: z.object({
32
+ deploymentId: z.string(),
33
+ status: DEPLOYMENT_STATUS_SCHEMA,
34
+ }),
35
+ message: "A deployment is already in progress.",
36
+ status: 409,
37
+ } as const
38
+
39
+ const GIT_SOURCE_SCHEMA = z.object({
40
+ commitSha: z.string().regex(/^[0-9a-f]{40}(?:[0-9a-f]{24})?$/),
41
+ dirty: z.boolean(),
42
+ repositoryUrl: z.string().min(1),
43
+ })
44
+
20
45
  export const deploymentContract = {
46
+ cancel: oc
47
+ .input(
48
+ z.object({
49
+ deploymentId: z.string(),
50
+ projectId: z.string(),
51
+ }),
52
+ )
53
+ .output(z.void()),
21
54
  create: oc
55
+ .errors({ DEPLOYMENT_IN_PROGRESS: DEPLOYMENT_IN_PROGRESS_ERROR })
22
56
  .input(
23
57
  z.object({
24
58
  artifact: z.instanceof(Blob),
59
+ cancelExisting: z.boolean().default(false),
25
60
  manifest: z
26
61
  .object({
27
62
  identityKey: z.string().min(1),
@@ -44,6 +79,7 @@ export const deploymentContract = {
44
79
  mode: z.enum(["reconcile", "upsert"]),
45
80
  projectId: z.string(),
46
81
  rebindAccounts: z.boolean().default(false),
82
+ git: GIT_SOURCE_SCHEMA.optional(),
47
83
  }),
48
84
  )
49
85
  .output(z.object({ id: z.string() })),
@@ -64,6 +100,7 @@ export const deploymentContract = {
64
100
  })
65
101
  .array(),
66
102
  id: z.string(),
103
+ git: GIT_SOURCE_SCHEMA.nullable(),
67
104
  job: z
68
105
  .object({
69
106
  attempts: z.number().int().nonnegative(),
@@ -76,14 +113,7 @@ export const deploymentContract = {
76
113
  id: z.string(),
77
114
  name: z.string(),
78
115
  }),
79
- status: z.enum([
80
- "planning",
81
- "awaiting_authorization",
82
- "configuring",
83
- "publishing",
84
- "succeeded",
85
- "failed",
86
- ]),
116
+ status: DEPLOYMENT_STATUS_SCHEMA,
87
117
  }),
88
118
  ),
89
119
  }