@trigger.dev/core 3.3.14 → 3.3.16
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/commonjs/v3/errors.d.ts +8 -0
- package/dist/commonjs/v3/errors.js +27 -1
- package/dist/commonjs/v3/errors.js.map +1 -1
- package/dist/commonjs/v3/schemas/index.d.ts +1 -0
- package/dist/commonjs/v3/schemas/index.js +1 -0
- package/dist/commonjs/v3/schemas/index.js.map +1 -1
- package/dist/commonjs/v3/schemas/webhooks.d.ts +1612 -0
- package/dist/commonjs/v3/schemas/webhooks.js +187 -0
- package/dist/commonjs/v3/schemas/webhooks.js.map +1 -0
- package/dist/commonjs/version.js +1 -1
- package/dist/esm/v3/errors.d.ts +8 -0
- package/dist/esm/v3/errors.js +24 -0
- package/dist/esm/v3/errors.js.map +1 -1
- package/dist/esm/v3/schemas/index.d.ts +1 -0
- package/dist/esm/v3/schemas/index.js +1 -0
- package/dist/esm/v3/schemas/index.js.map +1 -1
- package/dist/esm/v3/schemas/webhooks.d.ts +1612 -0
- package/dist/esm/v3/schemas/webhooks.js +184 -0
- package/dist/esm/v3/schemas/webhooks.js.map +1 -0
- package/dist/esm/version.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { RuntimeEnvironmentTypeSchema } from "../../schemas/api.js";
|
|
3
|
+
import { RunStatus } from "./api.js";
|
|
4
|
+
import { TaskRunError } from "./common.js";
|
|
5
|
+
/** Represents a failed run alert webhook payload */
|
|
6
|
+
const AlertWebhookRunFailedObject = z.object({
|
|
7
|
+
/** Task information */
|
|
8
|
+
task: z.object({
|
|
9
|
+
/** Unique identifier for the task */
|
|
10
|
+
id: z.string(),
|
|
11
|
+
/** File path where the task is defined */
|
|
12
|
+
filePath: z.string(),
|
|
13
|
+
/** Name of the exported task function */
|
|
14
|
+
exportName: z.string(),
|
|
15
|
+
/** Version of the task */
|
|
16
|
+
version: z.string(),
|
|
17
|
+
/** Version of the SDK used */
|
|
18
|
+
sdkVersion: z.string(),
|
|
19
|
+
/** Version of the CLI used */
|
|
20
|
+
cliVersion: z.string(),
|
|
21
|
+
}),
|
|
22
|
+
/** Run information */
|
|
23
|
+
run: z.object({
|
|
24
|
+
/** Unique identifier for the run */
|
|
25
|
+
id: z.string(),
|
|
26
|
+
/** Run number */
|
|
27
|
+
number: z.number(),
|
|
28
|
+
/** Current status of the run */
|
|
29
|
+
status: RunStatus,
|
|
30
|
+
/** When the run was created */
|
|
31
|
+
createdAt: z.coerce.date(),
|
|
32
|
+
/** When the run started executing */
|
|
33
|
+
startedAt: z.coerce.date().optional(),
|
|
34
|
+
/** When the run finished executing */
|
|
35
|
+
completedAt: z.coerce.date().optional(),
|
|
36
|
+
/** Whether this is a test run */
|
|
37
|
+
isTest: z.boolean(),
|
|
38
|
+
/** Idempotency key for the run */
|
|
39
|
+
idempotencyKey: z.string().optional(),
|
|
40
|
+
/** Associated tags */
|
|
41
|
+
tags: z.array(z.string()),
|
|
42
|
+
/** Error information */
|
|
43
|
+
error: TaskRunError,
|
|
44
|
+
/** Whether the run was an out-of-memory error */
|
|
45
|
+
isOutOfMemoryError: z.boolean(),
|
|
46
|
+
/** Machine preset used for the run */
|
|
47
|
+
machine: z.string(),
|
|
48
|
+
/** URL to view the run in the dashboard */
|
|
49
|
+
dashboardUrl: z.string(),
|
|
50
|
+
}),
|
|
51
|
+
/** Environment information */
|
|
52
|
+
environment: z.object({
|
|
53
|
+
/** Environment ID */
|
|
54
|
+
id: z.string(),
|
|
55
|
+
/** Environment type */
|
|
56
|
+
type: RuntimeEnvironmentTypeSchema,
|
|
57
|
+
/** Environment slug */
|
|
58
|
+
slug: z.string(),
|
|
59
|
+
}),
|
|
60
|
+
/** Organization information */
|
|
61
|
+
organization: z.object({
|
|
62
|
+
/** Organization ID */
|
|
63
|
+
id: z.string(),
|
|
64
|
+
/** Organization slug */
|
|
65
|
+
slug: z.string(),
|
|
66
|
+
/** Organization name */
|
|
67
|
+
name: z.string(),
|
|
68
|
+
}),
|
|
69
|
+
/** Project information */
|
|
70
|
+
project: z.object({
|
|
71
|
+
/** Project ID */
|
|
72
|
+
id: z.string(),
|
|
73
|
+
/** Project reference */
|
|
74
|
+
ref: z.string(),
|
|
75
|
+
/** Project slug */
|
|
76
|
+
slug: z.string(),
|
|
77
|
+
/** Project name */
|
|
78
|
+
name: z.string(),
|
|
79
|
+
}),
|
|
80
|
+
});
|
|
81
|
+
/** Represents a deployment error */
|
|
82
|
+
export const DeployError = z.object({
|
|
83
|
+
/** Error name */
|
|
84
|
+
name: z.string(),
|
|
85
|
+
/** Error message */
|
|
86
|
+
message: z.string(),
|
|
87
|
+
/** Error stack trace */
|
|
88
|
+
stack: z.string().optional(),
|
|
89
|
+
/** Standard error output */
|
|
90
|
+
stderr: z.string().optional(),
|
|
91
|
+
});
|
|
92
|
+
const deploymentCommonProperties = {
|
|
93
|
+
/** Environment information */
|
|
94
|
+
environment: z.object({
|
|
95
|
+
id: z.string(),
|
|
96
|
+
type: RuntimeEnvironmentTypeSchema,
|
|
97
|
+
slug: z.string(),
|
|
98
|
+
}),
|
|
99
|
+
/** Organization information */
|
|
100
|
+
organization: z.object({
|
|
101
|
+
id: z.string(),
|
|
102
|
+
slug: z.string(),
|
|
103
|
+
name: z.string(),
|
|
104
|
+
}),
|
|
105
|
+
/** Project information */
|
|
106
|
+
project: z.object({
|
|
107
|
+
id: z.string(),
|
|
108
|
+
ref: z.string(),
|
|
109
|
+
slug: z.string(),
|
|
110
|
+
name: z.string(),
|
|
111
|
+
}),
|
|
112
|
+
};
|
|
113
|
+
const deploymentDeploymentCommonProperties = {
|
|
114
|
+
/** Deployment ID */
|
|
115
|
+
id: z.string(),
|
|
116
|
+
/** Deployment status */
|
|
117
|
+
status: z.string(),
|
|
118
|
+
/** Deployment version */
|
|
119
|
+
version: z.string(),
|
|
120
|
+
/** Short code identifier */
|
|
121
|
+
shortCode: z.string(),
|
|
122
|
+
};
|
|
123
|
+
/** Represents a successful deployment alert webhook payload */
|
|
124
|
+
export const AlertWebhookDeploymentSuccessObject = z.object({
|
|
125
|
+
...deploymentCommonProperties,
|
|
126
|
+
deployment: z.object({
|
|
127
|
+
...deploymentDeploymentCommonProperties,
|
|
128
|
+
/** When the deployment completed */
|
|
129
|
+
deployedAt: z.coerce.date(),
|
|
130
|
+
}),
|
|
131
|
+
/** Deployed tasks */
|
|
132
|
+
tasks: z.array(z.object({
|
|
133
|
+
/** Task ID */
|
|
134
|
+
id: z.string(),
|
|
135
|
+
/** File path where the task is defined */
|
|
136
|
+
filePath: z.string(),
|
|
137
|
+
/** Name of the exported task function */
|
|
138
|
+
exportName: z.string(),
|
|
139
|
+
/** Source of the trigger */
|
|
140
|
+
triggerSource: z.string(),
|
|
141
|
+
})),
|
|
142
|
+
});
|
|
143
|
+
/** Represents a failed deployment alert webhook payload */
|
|
144
|
+
export const AlertWebhookDeploymentFailedObject = z.object({
|
|
145
|
+
...deploymentCommonProperties,
|
|
146
|
+
deployment: z.object({
|
|
147
|
+
...deploymentDeploymentCommonProperties,
|
|
148
|
+
/** When the deployment failed */
|
|
149
|
+
failedAt: z.coerce.date(),
|
|
150
|
+
}),
|
|
151
|
+
/** Error information */
|
|
152
|
+
error: DeployError,
|
|
153
|
+
});
|
|
154
|
+
/** Common properties for all webhooks */
|
|
155
|
+
const commonProperties = {
|
|
156
|
+
/** Webhook ID */
|
|
157
|
+
id: z.string(),
|
|
158
|
+
/** When the webhook was created */
|
|
159
|
+
created: z.coerce.date(),
|
|
160
|
+
/** Version of the webhook */
|
|
161
|
+
webhookVersion: z.string(),
|
|
162
|
+
};
|
|
163
|
+
/** Represents all possible webhook types */
|
|
164
|
+
export const Webhook = z.discriminatedUnion("type", [
|
|
165
|
+
/** Run failed alert webhook */
|
|
166
|
+
z.object({
|
|
167
|
+
...commonProperties,
|
|
168
|
+
type: z.literal("alert.run.failed"),
|
|
169
|
+
object: AlertWebhookRunFailedObject,
|
|
170
|
+
}),
|
|
171
|
+
/** Deployment success alert webhook */
|
|
172
|
+
z.object({
|
|
173
|
+
...commonProperties,
|
|
174
|
+
type: z.literal("alert.deployment.success"),
|
|
175
|
+
object: AlertWebhookDeploymentSuccessObject,
|
|
176
|
+
}),
|
|
177
|
+
/** Deployment failed alert webhook */
|
|
178
|
+
z.object({
|
|
179
|
+
...commonProperties,
|
|
180
|
+
type: z.literal("alert.deployment.failed"),
|
|
181
|
+
object: AlertWebhookDeploymentFailedObject,
|
|
182
|
+
}),
|
|
183
|
+
]);
|
|
184
|
+
//# sourceMappingURL=webhooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../../../../src/v3/schemas/webhooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,oDAAoD;AACpD,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,uBAAuB;IACvB,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;QACb,qCAAqC;QACrC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;QACd,0CAA0C;QAC1C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;QACpB,yCAAyC;QACzC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;QACtB,0BAA0B;QAC1B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;QACnB,8BAA8B;QAC9B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;QACtB,8BAA8B;QAC9B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;KACvB,CAAC;IACF,sBAAsB;IACtB,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC;QACZ,o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