@automate.ax/integration-contracts 0.86.2 → 0.87.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,141 @@
1
+ import * as z from "zod";
2
+ const GITHUB_REPOSITORY_BASE_SCHEMA = z.looseObject({
3
+ full_name: z.string(),
4
+ id: z.number().int().positive(),
5
+ name: z.string(),
6
+ });
7
+ const GITHUB_REPOSITORY_CONTENT_BASE_SCHEMA = z.union([
8
+ z.looseObject({ path: z.string(), sha: z.string(), type: z.string() }),
9
+ z
10
+ .looseObject({ path: z.string(), sha: z.string(), type: z.string() })
11
+ .array(),
12
+ ]);
13
+ const GITHUB_FILE_COMMIT_BASE_SCHEMA = z.looseObject({
14
+ commit: z.looseObject({ sha: z.string() }),
15
+ content: z.looseObject({ path: z.string(), sha: z.string() }).nullable(),
16
+ });
17
+ const GITHUB_BRANCH_BASE_SCHEMA = z.looseObject({
18
+ commit: z.looseObject({ sha: z.string() }),
19
+ name: z.string(),
20
+ });
21
+ const GITHUB_REFERENCE_BASE_SCHEMA = z.looseObject({
22
+ object: z.looseObject({ sha: z.string(), type: z.string() }),
23
+ ref: z.string(),
24
+ });
25
+ const GITHUB_WORKFLOW_BASE_SCHEMA = z.looseObject({
26
+ id: z.number().int().positive(),
27
+ name: z.string(),
28
+ path: z.string(),
29
+ state: z.string(),
30
+ });
31
+ const GITHUB_WORKFLOW_RUN_BASE_SCHEMA = z.looseObject({
32
+ conclusion: z.string().nullable(),
33
+ html_url: z.string(),
34
+ id: z.number().int().positive(),
35
+ status: z.string().nullable(),
36
+ });
37
+ const GITHUB_WORKFLOW_JOB_BASE_SCHEMA = z.looseObject({
38
+ conclusion: z.string().nullable(),
39
+ id: z.number().int().positive(),
40
+ name: z.string(),
41
+ status: z.string(),
42
+ });
43
+ const GITHUB_PULL_REQUEST_FILE_BASE_SCHEMA = z.looseObject({
44
+ filename: z.string(),
45
+ sha: z.string(),
46
+ status: z.string(),
47
+ });
48
+ const GITHUB_PULL_REQUEST_REVIEW_BASE_SCHEMA = z.looseObject({
49
+ id: z.number().int().positive(),
50
+ state: z.string(),
51
+ });
52
+ const GITHUB_PULL_REQUEST_REVIEW_COMMENT_BASE_SCHEMA = z.looseObject({
53
+ body: z.string(),
54
+ id: z.number().int().positive(),
55
+ path: z.string(),
56
+ });
57
+ const GITHUB_PULL_REQUEST_BRANCH_UPDATE_BASE_SCHEMA = z.looseObject({
58
+ message: z.string(),
59
+ url: z.string(),
60
+ });
61
+ const GITHUB_RELEASE_BASE_SCHEMA = z.looseObject({
62
+ draft: z.boolean(),
63
+ id: z.number().int().positive(),
64
+ prerelease: z.boolean(),
65
+ tag_name: z.string(),
66
+ });
67
+ const GITHUB_RELEASE_ASSET_BASE_SCHEMA = z.looseObject({
68
+ browser_download_url: z.string(),
69
+ id: z.number().int().positive(),
70
+ name: z.string(),
71
+ size: z.number().int().nonnegative(),
72
+ state: z.string(),
73
+ });
74
+ const GITHUB_DEPLOYMENT_BASE_SCHEMA = z.looseObject({
75
+ environment: z.string(),
76
+ id: z.number().int().positive(),
77
+ ref: z.string(),
78
+ });
79
+ const GITHUB_DEPLOYMENT_CREATION_BASE_SCHEMA = z.union([
80
+ GITHUB_DEPLOYMENT_BASE_SCHEMA,
81
+ z.looseObject({ message: z.string() }),
82
+ ]);
83
+ const GITHUB_DEPLOYMENT_STATUS_BASE_SCHEMA = z.looseObject({
84
+ id: z.number().int().positive(),
85
+ state: z.string(),
86
+ });
87
+ const GITHUB_COMMIT_STATUS_BASE_SCHEMA = z.looseObject({
88
+ context: z.string(),
89
+ id: z.number().int().positive(),
90
+ state: z.string(),
91
+ });
92
+ const GITHUB_CHECK_RUN_BASE_SCHEMA = z.looseObject({
93
+ conclusion: z.string().nullable(),
94
+ head_sha: z.string(),
95
+ id: z.number().int().positive(),
96
+ name: z.string(),
97
+ status: z.string(),
98
+ });
99
+ export const GITHUB_REPOSITORY_SCHEMA = githubResourceSchema(GITHUB_REPOSITORY_BASE_SCHEMA);
100
+ export const GITHUB_REPOSITORY_SUMMARY_SCHEMA = githubResourceSchema(GITHUB_REPOSITORY_BASE_SCHEMA);
101
+ export const GITHUB_REPOSITORY_CONTENT_SCHEMA = githubResourceSchema(GITHUB_REPOSITORY_CONTENT_BASE_SCHEMA);
102
+ export const GITHUB_REPOSITORY_FILE_COMMIT_SCHEMA = githubResourceSchema(GITHUB_FILE_COMMIT_BASE_SCHEMA);
103
+ export const GITHUB_REPOSITORY_FILE_DELETION_SCHEMA = githubResourceSchema(GITHUB_FILE_COMMIT_BASE_SCHEMA);
104
+ export const GITHUB_BRANCH_SCHEMA = githubResourceSchema(GITHUB_BRANCH_BASE_SCHEMA);
105
+ export const GITHUB_BRANCH_SUMMARY_SCHEMA = githubResourceSchema(GITHUB_BRANCH_BASE_SCHEMA);
106
+ export const GITHUB_REFERENCE_SCHEMA = githubResourceSchema(GITHUB_REFERENCE_BASE_SCHEMA);
107
+ export const GITHUB_WORKFLOW_SCHEMA = githubResourceSchema(GITHUB_WORKFLOW_BASE_SCHEMA);
108
+ export const GITHUB_WORKFLOW_RUN_SCHEMA = githubResourceSchema(GITHUB_WORKFLOW_RUN_BASE_SCHEMA);
109
+ export const GITHUB_WORKFLOW_JOB_SCHEMA = githubResourceSchema(GITHUB_WORKFLOW_JOB_BASE_SCHEMA);
110
+ export const GITHUB_PULL_REQUEST_FILE_SCHEMA = githubResourceSchema(GITHUB_PULL_REQUEST_FILE_BASE_SCHEMA);
111
+ export const GITHUB_PULL_REQUEST_REVIEW_RESOURCE_SCHEMA = githubResourceSchema(GITHUB_PULL_REQUEST_REVIEW_BASE_SCHEMA);
112
+ export const GITHUB_PULL_REQUEST_REVIEW_REQUEST_SCHEMA = githubResourceSchema(GITHUB_PULL_REQUEST_REVIEW_BASE_SCHEMA);
113
+ export const GITHUB_PULL_REQUEST_REVIEW_COMMENT_SCHEMA = githubResourceSchema(GITHUB_PULL_REQUEST_REVIEW_COMMENT_BASE_SCHEMA);
114
+ export const GITHUB_PULL_REQUEST_BRANCH_UPDATE_SCHEMA = githubResourceSchema(GITHUB_PULL_REQUEST_BRANCH_UPDATE_BASE_SCHEMA);
115
+ export const GITHUB_RELEASE_SCHEMA = githubResourceSchema(GITHUB_RELEASE_BASE_SCHEMA);
116
+ export const GITHUB_RELEASE_ASSET_SCHEMA = githubResourceSchema(GITHUB_RELEASE_ASSET_BASE_SCHEMA);
117
+ export const GITHUB_DEPLOYMENT_SCHEMA = githubResourceSchema(GITHUB_DEPLOYMENT_BASE_SCHEMA);
118
+ export const GITHUB_DEPLOYMENT_CREATION_SCHEMA = githubResourceSchema(GITHUB_DEPLOYMENT_CREATION_BASE_SCHEMA);
119
+ export const GITHUB_DEPLOYMENT_STATUS_SCHEMA = githubResourceSchema(GITHUB_DEPLOYMENT_STATUS_BASE_SCHEMA);
120
+ export const GITHUB_COMMIT_STATUS_SCHEMA = githubResourceSchema(GITHUB_COMMIT_STATUS_BASE_SCHEMA);
121
+ export const GITHUB_CHECK_RUN_SCHEMA = githubResourceSchema(GITHUB_CHECK_RUN_BASE_SCHEMA);
122
+ export const GITHUB_COMBINED_COMMIT_STATUS_SCHEMA = githubResourceSchema(z.looseObject({
123
+ sha: z.string(),
124
+ state: z.string(),
125
+ statuses: GITHUB_COMMIT_STATUS_BASE_SCHEMA.array(),
126
+ total_count: z.number().int().nonnegative(),
127
+ }));
128
+ export const GITHUB_WORKFLOW_DISPATCH_RESULT_SCHEMA = z.object({
129
+ html_url: z.string(),
130
+ run_url: z.string(),
131
+ workflow_run_id: z.number().int().positive(),
132
+ });
133
+ export const GITHUB_EMPTY_RESPONSE_SCHEMA = z.object({});
134
+ /**
135
+ * Validates a provider resource while preserving its official Octokit type.
136
+ *
137
+ * @param schema - Runtime schema for the resource's stable fields.
138
+ */
139
+ function githubResourceSchema(schema) {
140
+ return z.custom((value) => schema.safeParse(value).success);
141
+ }
@@ -2,6 +2,8 @@ import type { Encodable } from "@automate.ax/codec";
2
2
  import type { webhooks } from "@octokit/openapi-webhooks-types";
3
3
  import type { Octokit } from "@octokit/rest";
4
4
  import * as z from "zod";
5
+ export * from "./resources.js";
6
+ export * from "./additional-events.js";
5
7
  type GitHubWebhookPayload<TKey extends keyof webhooks> = webhooks[TKey]["post"] extends {
6
8
  requestBody: {
7
9
  content: {
@@ -8011,4 +8013,3 @@ export declare const GITHUB_PULL_REQUEST_MERGE_SCHEMA: z.ZodObject<{
8011
8013
  merged: z.ZodBoolean;
8012
8014
  sha: z.ZodNullable<z.ZodString>;
8013
8015
  }, z.core.$strip>;
8014
- export {};
@@ -1,4 +1,6 @@
1
1
  import * as z from "zod";
2
+ export * from "./resources.js";
3
+ export * from "./additional-events.js";
2
4
  const GITHUB_EVENT_BASE_SCHEMA = z.looseObject({
3
5
  installation: z.looseObject({ id: z.number().int().positive() }),
4
6
  repository: z.looseObject({
@@ -1422,8 +1422,8 @@ export declare const LINEAR_ISSUE_REFERENCE_SCHEMA: z.ZodObject<{
1422
1422
  export declare const LINEAR_AGENT_SESSION_STATUS_SCHEMA: z.ZodEnum<{
1423
1423
  error: "error";
1424
1424
  pending: "pending";
1425
- stale: "stale";
1426
1425
  active: "active";
1426
+ stale: "stale";
1427
1427
  awaitingInput: "awaitingInput";
1428
1428
  complete: "complete";
1429
1429
  }>;
@@ -1482,8 +1482,8 @@ export declare const LINEAR_AGENT_SESSION_SCHEMA: z.ZodObject<{
1482
1482
  status: z.ZodEnum<{
1483
1483
  error: "error";
1484
1484
  pending: "pending";
1485
- stale: "stale";
1486
1485
  active: "active";
1486
+ stale: "stale";
1487
1487
  awaitingInput: "awaitingInput";
1488
1488
  complete: "complete";
1489
1489
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automate.ax/integration-contracts",
3
- "version": "0.86.2",
3
+ "version": "0.87.0",
4
4
  "description": "Shared integration payload contracts and provider primitives for Automate.ax.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -45,7 +45,7 @@
45
45
  }
46
46
  },
47
47
  "dependencies": {
48
- "@automate.ax/codec": "0.86.2",
48
+ "@automate.ax/codec": "0.87.0",
49
49
  "@googleapis/calendar": "^15.0.0",
50
50
  "@googleapis/forms": "^6.0.1",
51
51
  "@googleapis/gmail": "^12.0.0",