@automate.ax/integration-contracts 0.88.2 → 0.88.3
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/github/additional-events.d.ts +219 -16710
- package/dist/github/additional-events.js +67 -98
- package/dist/github/index.d.ts +97 -2
- package/dist/github/index.js +382 -5
- package/dist/github/openapi-types.d.ts +21 -0
- package/dist/github/openapi-types.generated.d.ts +52350 -0
- package/dist/github/openapi-types.generated.js +1 -0
- package/dist/github/openapi-types.js +1 -0
- package/dist/github/resources.d.ts +7435 -17936
- package/dist/github/resources.js +40 -135
- package/dist/github/rest-schemas.d.ts +11 -0
- package/dist/github/rest-schemas.generated.json +1 -0
- package/dist/github/rest-schemas.js +24 -0
- package/dist/github/schemas.d.ts +4554 -7321
- package/dist/github/schemas.js +68 -77
- package/dist/github/webhook-operations.d.ts +52 -0
- package/dist/github/webhook-operations.js +134 -0
- package/dist/github/webhook-schemas.d.ts +12 -0
- package/dist/github/webhook-schemas.generated.json +1 -0
- package/dist/github/webhook-schemas.js +28 -0
- package/dist/linear/schemas.d.ts +1 -1
- package/dist/vercel/index.d.ts +12 -12
- package/dist/vercel/schemas.d.ts +18 -18
- package/package.json +6 -3
- package/src/github/additional-events.ts +631 -273
- package/src/github/index.ts +761 -8
- package/src/github/openapi-types.generated.ts +52352 -0
- package/src/github/openapi-types.ts +59 -0
- package/src/github/resources.ts +106 -303
- package/src/github/rest-schemas.generated.json +1 -0
- package/src/github/rest-schemas.ts +35 -0
- package/src/github/schemas.ts +593 -195
- package/src/github/webhook-operations.ts +171 -0
- package/src/github/webhook-schemas.generated.json +1 -0
- package/src/github/webhook-schemas.ts +43 -0
package/dist/github/resources.js
CHANGED
|
@@ -1,141 +1,46 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
});
|
|
2
|
+
import { githubRestResourceSchema } from "./rest-schemas.js";
|
|
3
|
+
export const GITHUB_REPOSITORY_SCHEMA = githubRestResourceSchema("repository");
|
|
4
|
+
export const GITHUB_REPOSITORY_SUMMARY_SCHEMA = githubRestResourceSchema("repository-summary");
|
|
5
|
+
export const GITHUB_REPOSITORY_CONTENT_SCHEMA = githubRestResourceSchema("repository-content");
|
|
6
|
+
export const GITHUB_REPOSITORY_FILE_COMMIT_SCHEMA = githubRestResourceSchema("file-commit");
|
|
7
|
+
export const GITHUB_REPOSITORY_FILE_DELETION_SCHEMA = githubRestResourceSchema("file-deletion");
|
|
8
|
+
export const GITHUB_BRANCH_SCHEMA = githubRestResourceSchema("branch");
|
|
9
|
+
export const GITHUB_BRANCH_SUMMARY_SCHEMA = githubRestResourceSchema("branch-summary");
|
|
10
|
+
export const GITHUB_REFERENCE_SCHEMA = githubRestResourceSchema("reference");
|
|
11
|
+
export const GITHUB_WORKFLOW_SCHEMA = githubRestResourceSchema("workflow");
|
|
12
|
+
export const GITHUB_WORKFLOW_RUN_SCHEMA = githubRestResourceSchema("workflow-run");
|
|
13
|
+
export const GITHUB_WORKFLOW_JOB_SCHEMA = githubRestResourceSchema("workflow-job");
|
|
14
|
+
export const GITHUB_PULL_REQUEST_FILE_SCHEMA = githubRestResourceSchema("pull-request-file");
|
|
15
|
+
export const GITHUB_PULL_REQUEST_REVIEW_RESOURCE_SCHEMA = githubRestResourceSchema("pull-request-review");
|
|
16
|
+
export const GITHUB_PULL_REQUEST_REVIEW_REQUEST_SCHEMA = githubRestResourceSchema("pull-request-review-request");
|
|
17
|
+
export const GITHUB_PULL_REQUEST_REVIEW_COMMENT_SCHEMA = githubRestResourceSchema("pull-request-review-comment");
|
|
18
|
+
export const GITHUB_PULL_REQUEST_BRANCH_UPDATE_SCHEMA = githubRestResourceSchema("pull-request-branch-update");
|
|
19
|
+
export const GITHUB_RELEASE_SCHEMA = githubRestResourceSchema("release");
|
|
20
|
+
export const GITHUB_RELEASE_ASSET_SCHEMA = githubRestResourceSchema("release-asset");
|
|
21
|
+
export const GITHUB_DEPLOYMENT_SCHEMA = githubRestResourceSchema("deployment");
|
|
22
|
+
export const GITHUB_DEPLOYMENT_CREATION_SCHEMA = githubRestResourceSchema("deployment-creation");
|
|
23
|
+
export const GITHUB_DEPLOYMENT_STATUS_SCHEMA = githubRestResourceSchema("deployment-status");
|
|
24
|
+
export const GITHUB_COMMIT_STATUS_SCHEMA = githubRestResourceSchema("commit-status");
|
|
25
|
+
export const GITHUB_CHECK_RUN_SCHEMA = githubRestResourceSchema("check-run");
|
|
26
|
+
export const GITHUB_COMBINED_COMMIT_STATUS_SCHEMA = githubRestResourceSchema("combined-commit-status");
|
|
27
|
+
export const GITHUB_WORKFLOW_DISPATCH_RESULT_SCHEMA = z.preprocess(normalizeGitHubJsonResponse, githubRestResourceSchema("workflow-dispatch"));
|
|
133
28
|
export const GITHUB_EMPTY_RESPONSE_SCHEMA = z.object({});
|
|
134
29
|
/**
|
|
135
|
-
*
|
|
30
|
+
* Octokit returns text when GitHub omits or mislabels the JSON content type.
|
|
31
|
+
* Leave malformed text untouched so output validation fails terminally outside
|
|
32
|
+
* the action handler instead of throwing a retryable post-side-effect error.
|
|
136
33
|
*
|
|
137
|
-
* @param
|
|
34
|
+
* @param value - Octokit response data.
|
|
138
35
|
*/
|
|
139
|
-
function
|
|
140
|
-
|
|
36
|
+
function normalizeGitHubJsonResponse(value) {
|
|
37
|
+
if (typeof value !== "string")
|
|
38
|
+
return value;
|
|
39
|
+
try {
|
|
40
|
+
const parsed = JSON.parse(value);
|
|
41
|
+
return parsed;
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
return value;
|
|
45
|
+
}
|
|
141
46
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
import schemaData from "./rest-schemas.generated.json";
|
|
3
|
+
export type GitHubRestResourceName = keyof typeof schemaData.resources;
|
|
4
|
+
/**
|
|
5
|
+
* Validates a complete current GitHub REST resource while preserving its
|
|
6
|
+
* provider response and public type.
|
|
7
|
+
*
|
|
8
|
+
* @template TResource - Public provider resource type.
|
|
9
|
+
* @param resource - Frozen generated REST resource key.
|
|
10
|
+
*/
|
|
11
|
+
export declare function githubRestResourceSchema<TResource>(resource: GitHubRestResourceName): z.ZodType<TResource>;
|