@frogbotai/piece-pagerduty 0.22.0 → 0.23.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.
- package/README.md +39 -0
- package/dist/actions.d.ts +208 -0
- package/dist/actions.d.ts.map +1 -0
- package/dist/actions.js +187 -0
- package/dist/actions.js.map +1 -0
- package/dist/client.d.ts +15 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +36 -0
- package/dist/client.js.map +1 -0
- package/dist/config.d.ts +9 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +12 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +273 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +38 -31
- package/dist/index.js.map +1 -1
- package/dist/triggers.d.ts +61 -0
- package/dist/triggers.d.ts.map +1 -0
- package/dist/triggers.js +52 -0
- package/dist/triggers.js.map +1 -0
- package/dist/webhook.d.ts +4 -0
- package/dist/webhook.d.ts.map +1 -0
- package/dist/webhook.js +25 -0
- package/dist/webhook.js.map +1 -0
- package/package.json +5 -5
package/README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# `@frogbotai/piece-pagerduty`
|
|
2
|
+
|
|
3
|
+
Manage PagerDuty incidents through its REST API and receive signed V3 webhook events.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { createPagerduty } from '@frogbotai/piece-pagerduty';
|
|
9
|
+
|
|
10
|
+
export const pagerduty = createPagerduty({
|
|
11
|
+
auth: { apiKey: process.env.PAGERDUTY_API_KEY! },
|
|
12
|
+
signingSecret: process.env.PAGERDUTY_WEBHOOK_SIGNING_SECRET!,
|
|
13
|
+
});
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The signing secret is optional for action-only instances and required to authenticate webhook
|
|
17
|
+
deliveries. For each enabled trigger, copy its generated webhook URL into a PagerDuty V3 webhook
|
|
18
|
+
subscription, select the corresponding event type below, and configure the subscription with the
|
|
19
|
+
same signing secret. Registration and removal are manual; FrogBot stores the generated URL but does
|
|
20
|
+
not claim to create or delete the PagerDuty subscription.
|
|
21
|
+
|
|
22
|
+
## Actions
|
|
23
|
+
|
|
24
|
+
| Upstream action slug | Previous wrapper export | Native action | Notes |
|
|
25
|
+
| ---------------------- | ----------------------- | --------------------- | -------------------------------------------------------------------------------------------- |
|
|
26
|
+
| `create_incident` | `createIncident` | `createIncident` | |
|
|
27
|
+
| `list_incidents` | `listIncidents` | `listIncidents` | |
|
|
28
|
+
| `get_incident` | `getIncident` | `getIncident` | |
|
|
29
|
+
| `acknowledge_incident` | `acknowledgeIncident` | `acknowledgeIncident` | |
|
|
30
|
+
| `resolve_incident` | `resolveIncident` | `resolveIncident` | |
|
|
31
|
+
| `custom_api_call` | `customApiCall` | `customApiCall` | Caller headers are intentionally unsupported so credentials cannot be replaced or forwarded. |
|
|
32
|
+
|
|
33
|
+
## Triggers
|
|
34
|
+
|
|
35
|
+
| Upstream trigger slug | Native trigger | Type | Notes |
|
|
36
|
+
| ---------------------- | ---------------------- | ------- | ------------------------------------------------------ |
|
|
37
|
+
| `newIncident` | `newIncident` | Webhook | Manually register the URL for `incident.triggered`. |
|
|
38
|
+
| `incidentResolved` | `incidentResolved` | Webhook | Manually register the URL for `incident.resolved`. |
|
|
39
|
+
| `incidentAcknowledged` | `incidentAcknowledged` | Webhook | Manually register the URL for `incident.acknowledged`. |
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { type PieceRunArgs } from 'frogbot/pieces';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import type { PagerdutyClient } from './client.js';
|
|
4
|
+
declare const createIncidentInput: z.ZodObject<{
|
|
5
|
+
fromEmail: z.ZodEmail;
|
|
6
|
+
serviceId: z.ZodString;
|
|
7
|
+
title: z.ZodString;
|
|
8
|
+
urgency: z.ZodDefault<z.ZodEnum<{
|
|
9
|
+
high: "high";
|
|
10
|
+
low: "low";
|
|
11
|
+
}>>;
|
|
12
|
+
details: z.ZodOptional<z.ZodString>;
|
|
13
|
+
incidentKey: z.ZodOptional<z.ZodString>;
|
|
14
|
+
assigneeIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
15
|
+
priorityId: z.ZodOptional<z.ZodString>;
|
|
16
|
+
conferenceNumber: z.ZodOptional<z.ZodString>;
|
|
17
|
+
conferenceUrl: z.ZodOptional<z.ZodURL>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
export declare const createIncident: {
|
|
20
|
+
slug: string;
|
|
21
|
+
description: string;
|
|
22
|
+
input: z.ZodObject<{
|
|
23
|
+
fromEmail: z.ZodEmail;
|
|
24
|
+
serviceId: z.ZodString;
|
|
25
|
+
title: z.ZodString;
|
|
26
|
+
urgency: z.ZodDefault<z.ZodEnum<{
|
|
27
|
+
high: "high";
|
|
28
|
+
low: "low";
|
|
29
|
+
}>>;
|
|
30
|
+
details: z.ZodOptional<z.ZodString>;
|
|
31
|
+
incidentKey: z.ZodOptional<z.ZodString>;
|
|
32
|
+
assigneeIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
33
|
+
priorityId: z.ZodOptional<z.ZodString>;
|
|
34
|
+
conferenceNumber: z.ZodOptional<z.ZodString>;
|
|
35
|
+
conferenceUrl: z.ZodOptional<z.ZodURL>;
|
|
36
|
+
}, z.core.$strip>;
|
|
37
|
+
output: z.ZodObject<{
|
|
38
|
+
id: z.ZodString;
|
|
39
|
+
status: z.ZodOptional<z.ZodString>;
|
|
40
|
+
}, z.core.$loose>;
|
|
41
|
+
idempotent: false;
|
|
42
|
+
options: {
|
|
43
|
+
serviceId: ({ client }: {
|
|
44
|
+
client: PagerdutyClient;
|
|
45
|
+
}) => Promise<{
|
|
46
|
+
label: string;
|
|
47
|
+
value: string;
|
|
48
|
+
}[]>;
|
|
49
|
+
};
|
|
50
|
+
run({ input, client, }: PieceRunArgs<z.output<typeof createIncidentInput>, object, PagerdutyClient>): Promise<{
|
|
51
|
+
[x: string]: unknown;
|
|
52
|
+
id: string;
|
|
53
|
+
status?: string | undefined;
|
|
54
|
+
}>;
|
|
55
|
+
};
|
|
56
|
+
declare const listIncidentsInput: z.ZodObject<{
|
|
57
|
+
statuses: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
58
|
+
triggered: "triggered";
|
|
59
|
+
acknowledged: "acknowledged";
|
|
60
|
+
resolved: "resolved";
|
|
61
|
+
}>>>;
|
|
62
|
+
urgency: z.ZodOptional<z.ZodEnum<{
|
|
63
|
+
high: "high";
|
|
64
|
+
low: "low";
|
|
65
|
+
}>>;
|
|
66
|
+
since: z.ZodOptional<z.ZodString>;
|
|
67
|
+
until: z.ZodOptional<z.ZodString>;
|
|
68
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
69
|
+
offset: z.ZodDefault<z.ZodNumber>;
|
|
70
|
+
}, z.core.$strip>;
|
|
71
|
+
export declare const listIncidents: {
|
|
72
|
+
slug: string;
|
|
73
|
+
description: string;
|
|
74
|
+
input: z.ZodObject<{
|
|
75
|
+
statuses: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
76
|
+
triggered: "triggered";
|
|
77
|
+
acknowledged: "acknowledged";
|
|
78
|
+
resolved: "resolved";
|
|
79
|
+
}>>>;
|
|
80
|
+
urgency: z.ZodOptional<z.ZodEnum<{
|
|
81
|
+
high: "high";
|
|
82
|
+
low: "low";
|
|
83
|
+
}>>;
|
|
84
|
+
since: z.ZodOptional<z.ZodString>;
|
|
85
|
+
until: z.ZodOptional<z.ZodString>;
|
|
86
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
87
|
+
offset: z.ZodDefault<z.ZodNumber>;
|
|
88
|
+
}, z.core.$strip>;
|
|
89
|
+
output: z.ZodObject<{
|
|
90
|
+
incidents: z.ZodArray<z.ZodObject<{
|
|
91
|
+
id: z.ZodString;
|
|
92
|
+
status: z.ZodOptional<z.ZodString>;
|
|
93
|
+
}, z.core.$loose>>;
|
|
94
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
95
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
96
|
+
more: z.ZodOptional<z.ZodBoolean>;
|
|
97
|
+
}, z.core.$loose>;
|
|
98
|
+
idempotent: true;
|
|
99
|
+
run({ input, client, }: PieceRunArgs<z.output<typeof listIncidentsInput>, object, PagerdutyClient>): Promise<{
|
|
100
|
+
[x: string]: unknown;
|
|
101
|
+
incidents: {
|
|
102
|
+
[x: string]: unknown;
|
|
103
|
+
id: string;
|
|
104
|
+
status?: string | undefined;
|
|
105
|
+
}[];
|
|
106
|
+
limit?: number | undefined;
|
|
107
|
+
offset?: number | undefined;
|
|
108
|
+
more?: boolean | undefined;
|
|
109
|
+
}>;
|
|
110
|
+
};
|
|
111
|
+
declare const getIncidentInput: z.ZodObject<{
|
|
112
|
+
incidentId: z.ZodString;
|
|
113
|
+
}, z.core.$strip>;
|
|
114
|
+
export declare const getIncident: {
|
|
115
|
+
slug: string;
|
|
116
|
+
description: string;
|
|
117
|
+
input: z.ZodObject<{
|
|
118
|
+
incidentId: z.ZodString;
|
|
119
|
+
}, z.core.$strip>;
|
|
120
|
+
output: z.ZodObject<{
|
|
121
|
+
id: z.ZodString;
|
|
122
|
+
status: z.ZodOptional<z.ZodString>;
|
|
123
|
+
}, z.core.$loose>;
|
|
124
|
+
idempotent: true;
|
|
125
|
+
run({ input, client, }: PieceRunArgs<z.output<typeof getIncidentInput>, object, PagerdutyClient>): Promise<{
|
|
126
|
+
[x: string]: unknown;
|
|
127
|
+
id: string;
|
|
128
|
+
status?: string | undefined;
|
|
129
|
+
}>;
|
|
130
|
+
};
|
|
131
|
+
export declare const acknowledgeIncident: {
|
|
132
|
+
slug: "acknowledgeIncident" | "resolveIncident";
|
|
133
|
+
description: string;
|
|
134
|
+
input: z.ZodObject<{
|
|
135
|
+
resolution?: z.ZodOptional<z.ZodString> | undefined;
|
|
136
|
+
incidentId: z.ZodString;
|
|
137
|
+
fromEmail: z.ZodEmail;
|
|
138
|
+
}, z.core.$strip>;
|
|
139
|
+
output: z.ZodObject<{
|
|
140
|
+
id: z.ZodString;
|
|
141
|
+
status: z.ZodOptional<z.ZodString>;
|
|
142
|
+
}, z.core.$loose>;
|
|
143
|
+
idempotent: true;
|
|
144
|
+
run({ input: values, client, }: PieceRunArgs<z.output<z.ZodObject<{
|
|
145
|
+
resolution?: z.ZodOptional<z.ZodString> | undefined;
|
|
146
|
+
incidentId: z.ZodString;
|
|
147
|
+
fromEmail: z.ZodEmail;
|
|
148
|
+
}, z.core.$strip>>, object, PagerdutyClient>): Promise<{
|
|
149
|
+
[x: string]: unknown;
|
|
150
|
+
id: string;
|
|
151
|
+
status?: string | undefined;
|
|
152
|
+
}>;
|
|
153
|
+
};
|
|
154
|
+
export declare const resolveIncident: {
|
|
155
|
+
slug: "acknowledgeIncident" | "resolveIncident";
|
|
156
|
+
description: string;
|
|
157
|
+
input: z.ZodObject<{
|
|
158
|
+
resolution?: z.ZodOptional<z.ZodString> | undefined;
|
|
159
|
+
incidentId: z.ZodString;
|
|
160
|
+
fromEmail: z.ZodEmail;
|
|
161
|
+
}, z.core.$strip>;
|
|
162
|
+
output: z.ZodObject<{
|
|
163
|
+
id: z.ZodString;
|
|
164
|
+
status: z.ZodOptional<z.ZodString>;
|
|
165
|
+
}, z.core.$loose>;
|
|
166
|
+
idempotent: true;
|
|
167
|
+
run({ input: values, client, }: PieceRunArgs<z.output<z.ZodObject<{
|
|
168
|
+
resolution?: z.ZodOptional<z.ZodString> | undefined;
|
|
169
|
+
incidentId: z.ZodString;
|
|
170
|
+
fromEmail: z.ZodEmail;
|
|
171
|
+
}, z.core.$strip>>, object, PagerdutyClient>): Promise<{
|
|
172
|
+
[x: string]: unknown;
|
|
173
|
+
id: string;
|
|
174
|
+
status?: string | undefined;
|
|
175
|
+
}>;
|
|
176
|
+
};
|
|
177
|
+
declare const customApiCallInput: z.ZodObject<{
|
|
178
|
+
method: z.ZodEnum<{
|
|
179
|
+
GET: "GET";
|
|
180
|
+
POST: "POST";
|
|
181
|
+
PATCH: "PATCH";
|
|
182
|
+
PUT: "PUT";
|
|
183
|
+
DELETE: "DELETE";
|
|
184
|
+
}>;
|
|
185
|
+
path: z.ZodString;
|
|
186
|
+
queryParams: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
|
|
187
|
+
body: z.ZodOptional<z.ZodJSONSchema>;
|
|
188
|
+
}, z.core.$strip>;
|
|
189
|
+
export declare const customApiCall: {
|
|
190
|
+
slug: string;
|
|
191
|
+
description: string;
|
|
192
|
+
input: z.ZodObject<{
|
|
193
|
+
method: z.ZodEnum<{
|
|
194
|
+
GET: "GET";
|
|
195
|
+
POST: "POST";
|
|
196
|
+
PATCH: "PATCH";
|
|
197
|
+
PUT: "PUT";
|
|
198
|
+
DELETE: "DELETE";
|
|
199
|
+
}>;
|
|
200
|
+
path: z.ZodString;
|
|
201
|
+
queryParams: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
|
|
202
|
+
body: z.ZodOptional<z.ZodJSONSchema>;
|
|
203
|
+
}, z.core.$strip>;
|
|
204
|
+
output: z.ZodJSONSchema;
|
|
205
|
+
run({ input, client, }: PieceRunArgs<z.output<typeof customApiCallInput>, object, PagerdutyClient>): Promise<z.core.util.JSONType>;
|
|
206
|
+
};
|
|
207
|
+
export {};
|
|
208
|
+
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC/E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAYnD,QAAA,MAAM,mBAAmB;;;;;;;;;;;;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object({ id: z.string(), status: z.string().optional() }).passthrough();
|
|
3
|
+
const incidentOutput = incident;
|
|
4
|
+
const incidentResponse = z.object({ incident: incidentOutput });
|
|
5
|
+
const servicesResponse = z.object({
|
|
6
|
+
services: z.array(z.object({ id: z.string(), name: z.string() })),
|
|
7
|
+
more: z.boolean(),
|
|
8
|
+
});
|
|
9
|
+
const fromEmail = z.email().meta({ label: 'From email' });
|
|
10
|
+
const incidentId = z.string().min(1).meta({ label: 'Incident ID' });
|
|
11
|
+
const createIncidentInput = z.object({
|
|
12
|
+
fromEmail,
|
|
13
|
+
serviceId: z.string().min(1).meta({ label: 'Service' }),
|
|
14
|
+
title: z.string().min(1),
|
|
15
|
+
urgency: z.enum(['high', 'low']).default('high'),
|
|
16
|
+
details: z.string().optional(),
|
|
17
|
+
incidentKey: z.string().optional(),
|
|
18
|
+
assigneeIds: z.array(z.string()).optional(),
|
|
19
|
+
priorityId: z.string().optional(),
|
|
20
|
+
conferenceNumber: z.string().optional(),
|
|
21
|
+
conferenceUrl: z.url().optional(),
|
|
22
|
+
});
|
|
23
|
+
export const createIncident = {
|
|
24
|
+
slug: 'createIncident',
|
|
25
|
+
description: 'Create a PagerDuty incident.',
|
|
26
|
+
input: createIncidentInput,
|
|
27
|
+
output: incidentOutput,
|
|
28
|
+
idempotent: false,
|
|
29
|
+
options: {
|
|
30
|
+
serviceId: async ({ client }) => {
|
|
31
|
+
const services = [];
|
|
32
|
+
let offset = 0;
|
|
33
|
+
let more = true;
|
|
34
|
+
while (more) {
|
|
35
|
+
const response = servicesResponse.parse(await client.request({
|
|
36
|
+
method: 'GET',
|
|
37
|
+
path: '/services',
|
|
38
|
+
query: { limit: '100', offset: String(offset) },
|
|
39
|
+
}));
|
|
40
|
+
services.push(...response.services);
|
|
41
|
+
more = response.more;
|
|
42
|
+
offset += 100;
|
|
43
|
+
}
|
|
44
|
+
return services.map(({ id, name }) => ({ label: name, value: id }));
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
async run({ input, client, }) {
|
|
48
|
+
const payload = {
|
|
49
|
+
type: 'incident',
|
|
50
|
+
title: input.title,
|
|
51
|
+
service: { id: input.serviceId, type: 'service_reference' },
|
|
52
|
+
urgency: input.urgency,
|
|
53
|
+
};
|
|
54
|
+
if (input.details)
|
|
55
|
+
payload.body = { type: 'incident_body', details: input.details };
|
|
56
|
+
if (input.incidentKey)
|
|
57
|
+
payload.incident_key = input.incidentKey;
|
|
58
|
+
if (input.assigneeIds?.length) {
|
|
59
|
+
payload.assignments = input.assigneeIds.map((id) => ({
|
|
60
|
+
assignee: { id, type: 'user_reference' },
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
if (input.priorityId)
|
|
64
|
+
payload.priority = { id: input.priorityId, type: 'priority_reference' };
|
|
65
|
+
if (input.conferenceNumber || input.conferenceUrl) {
|
|
66
|
+
payload.conference_bridge = {
|
|
67
|
+
...(input.conferenceNumber ? { conference_number: input.conferenceNumber } : {}),
|
|
68
|
+
...(input.conferenceUrl ? { conference_url: input.conferenceUrl } : {}),
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
const response = incidentResponse.parse(await client.request({
|
|
72
|
+
method: 'POST',
|
|
73
|
+
path: '/incidents',
|
|
74
|
+
fromEmail: input.fromEmail,
|
|
75
|
+
body: { incident: payload },
|
|
76
|
+
}));
|
|
77
|
+
return response.incident;
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
const listIncidentsInput = z.object({
|
|
81
|
+
statuses: z.array(z.enum(['triggered', 'acknowledged', 'resolved'])).optional(),
|
|
82
|
+
urgency: z.enum(['high', 'low']).optional(),
|
|
83
|
+
since: z.string().optional(),
|
|
84
|
+
until: z.string().optional(),
|
|
85
|
+
limit: z.number().int().default(25),
|
|
86
|
+
offset: z.number().int().default(0),
|
|
87
|
+
});
|
|
88
|
+
const listIncidentsOutput = z
|
|
89
|
+
.object({
|
|
90
|
+
incidents: z.array(incident),
|
|
91
|
+
limit: z.number().optional(),
|
|
92
|
+
offset: z.number().optional(),
|
|
93
|
+
more: z.boolean().optional(),
|
|
94
|
+
})
|
|
95
|
+
.passthrough();
|
|
96
|
+
export const listIncidents = {
|
|
97
|
+
slug: 'listIncidents',
|
|
98
|
+
description: 'List PagerDuty incidents with optional filters and pagination.',
|
|
99
|
+
input: listIncidentsInput,
|
|
100
|
+
output: listIncidentsOutput,
|
|
101
|
+
idempotent: true,
|
|
102
|
+
async run({ input, client, }) {
|
|
103
|
+
const response = await client.request({
|
|
104
|
+
method: 'GET',
|
|
105
|
+
path: '/incidents',
|
|
106
|
+
query: {
|
|
107
|
+
'statuses[]': input.statuses,
|
|
108
|
+
'urgencies[]': input.urgency ? [input.urgency] : undefined,
|
|
109
|
+
since: input.since,
|
|
110
|
+
until: input.until,
|
|
111
|
+
limit: String(Math.max(1, Math.min(100, input.limit))),
|
|
112
|
+
offset: String(Math.max(0, input.offset)),
|
|
113
|
+
},
|
|
114
|
+
});
|
|
115
|
+
return listIncidentsOutput.parse(response);
|
|
116
|
+
},
|
|
117
|
+
};
|
|
118
|
+
function updateIncident(slug, status) {
|
|
119
|
+
const input = z.object({
|
|
120
|
+
incidentId,
|
|
121
|
+
fromEmail,
|
|
122
|
+
...(status === 'resolved' ? { resolution: z.string().optional() } : {}),
|
|
123
|
+
});
|
|
124
|
+
return {
|
|
125
|
+
slug,
|
|
126
|
+
description: `${status === 'resolved' ? 'Resolve' : 'Acknowledge'} a PagerDuty incident.`,
|
|
127
|
+
input,
|
|
128
|
+
output: incidentOutput,
|
|
129
|
+
idempotent: true,
|
|
130
|
+
async run({ input: values, client, }) {
|
|
131
|
+
const resolution = 'resolution' in values ? values.resolution : undefined;
|
|
132
|
+
const response = incidentResponse.parse(await client.request({
|
|
133
|
+
method: 'PUT',
|
|
134
|
+
path: `/incidents/${encodeURIComponent(values.incidentId)}`,
|
|
135
|
+
fromEmail: values.fromEmail,
|
|
136
|
+
body: {
|
|
137
|
+
incident: {
|
|
138
|
+
type: 'incident',
|
|
139
|
+
status,
|
|
140
|
+
...(resolution ? { body: { type: 'incident_body', details: resolution } } : {}),
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
}));
|
|
144
|
+
return response.incident;
|
|
145
|
+
},
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
const getIncidentInput = z.object({ incidentId });
|
|
149
|
+
export const getIncident = {
|
|
150
|
+
slug: 'getIncident',
|
|
151
|
+
description: 'Get a PagerDuty incident by ID.',
|
|
152
|
+
input: getIncidentInput,
|
|
153
|
+
output: incidentOutput,
|
|
154
|
+
idempotent: true,
|
|
155
|
+
async run({ input, client, }) {
|
|
156
|
+
const response = incidentResponse.parse(await client.request({
|
|
157
|
+
method: 'GET',
|
|
158
|
+
path: `/incidents/${encodeURIComponent(input.incidentId)}`,
|
|
159
|
+
}));
|
|
160
|
+
return response.incident;
|
|
161
|
+
},
|
|
162
|
+
};
|
|
163
|
+
export const acknowledgeIncident = updateIncident('acknowledgeIncident', 'acknowledged');
|
|
164
|
+
export const resolveIncident = updateIncident('resolveIncident', 'resolved');
|
|
165
|
+
const customApiCallInput = z.object({
|
|
166
|
+
method: z.enum(['GET', 'POST', 'PATCH', 'PUT', 'DELETE']),
|
|
167
|
+
path: z.string().startsWith('/'),
|
|
168
|
+
queryParams: z.record(z.string(), z.union([z.string(), z.array(z.string())])).default({}),
|
|
169
|
+
body: z.json().optional(),
|
|
170
|
+
});
|
|
171
|
+
const customApiCallOutput = z.json();
|
|
172
|
+
export const customApiCall = {
|
|
173
|
+
slug: 'customApiCall',
|
|
174
|
+
description: 'Make a custom PagerDuty REST API v2 call.',
|
|
175
|
+
input: customApiCallInput,
|
|
176
|
+
output: customApiCallOutput,
|
|
177
|
+
async run({ input, client, }) {
|
|
178
|
+
const response = await client.request({
|
|
179
|
+
method: input.method,
|
|
180
|
+
path: input.path,
|
|
181
|
+
query: input.queryParams,
|
|
182
|
+
body: input.body,
|
|
183
|
+
});
|
|
184
|
+
return customApiCallOutput.parse(response);
|
|
185
|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CAAC,OAAO,CAAC,EAAE,CAAC;IACzF,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;CAC1B,CAAC,CAAC;AACH,MAAM,mBAAmB,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AAErC,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,2CAA2C;IACxD,KAAK,EAAE,kBAAkB;IACzB,MAAM,EAAE,mBAAmB;IAC3B,KAAK,CAAC,GAAG,CAAC,EACR,KAAK,EACL,MAAM,GACqE;QAC3E,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;YACpC,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,KAAK,EAAE,KAAK,CAAC,WAAW;YACxB,IAAI,EAAE,KAAK,CAAC,IAAI;SACjB,CAAC,CAAC;QAEH,OAAO,mBAAmB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC7C,CAAC;CAMF,CAAC"}
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type Query = Record<string, string | string[] | undefined>;
|
|
2
|
+
export type PagerdutyClient = ReturnType<typeof createPagerdutyClient>;
|
|
3
|
+
export declare function createPagerdutyClient({ auth }: {
|
|
4
|
+
auth: unknown;
|
|
5
|
+
}): {
|
|
6
|
+
request: ({ method, path, query, body, fromEmail, }: {
|
|
7
|
+
method: string;
|
|
8
|
+
path: string;
|
|
9
|
+
query?: Query;
|
|
10
|
+
body?: unknown;
|
|
11
|
+
fromEmail?: string;
|
|
12
|
+
}) => Promise<unknown>;
|
|
13
|
+
};
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAIA,KAAK,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC;AAE3D,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEvE,wBAAgB,qBAAqB,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE;yDAS5D;QACD,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,CAAC,EAAE,KAAK,CAAC;QACd,IAAI,CAAC,EAAE,OAAO,CAAC;QACf,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB;EAsCF"}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { pagerdutyAuth } from './config.js';
|
|
2
|
+
const baseUrl = 'https://api.pagerduty.com';
|
|
3
|
+
export function createPagerdutyClient({ auth }) {
|
|
4
|
+
const { apiKey } = pagerdutyAuth.parse(auth);
|
|
5
|
+
async function request({ method, path, query, body, fromEmail, }) {
|
|
6
|
+
const url = new URL(path, baseUrl);
|
|
7
|
+
if (url.origin !== baseUrl || !path.startsWith('/') || path.startsWith('//')) {
|
|
8
|
+
throw new Error('Path must target the PagerDuty API.');
|
|
9
|
+
}
|
|
10
|
+
Object.entries(query ?? {}).forEach(([key, value]) => {
|
|
11
|
+
if (value === undefined || value === '')
|
|
12
|
+
return;
|
|
13
|
+
for (const item of Array.isArray(value) ? value : [value]) {
|
|
14
|
+
url.searchParams.append(key, item);
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
const response = await fetch(url, {
|
|
18
|
+
method,
|
|
19
|
+
headers: {
|
|
20
|
+
Authorization: `Token token=${apiKey}`,
|
|
21
|
+
Accept: 'application/vnd.pagerduty+json;version=2',
|
|
22
|
+
'Content-Type': 'application/json',
|
|
23
|
+
...(fromEmail ? { From: fromEmail } : {}),
|
|
24
|
+
},
|
|
25
|
+
body: body === undefined ? undefined : JSON.stringify(body),
|
|
26
|
+
});
|
|
27
|
+
const text = await response.text();
|
|
28
|
+
const data = text ? JSON.parse(text) : undefined;
|
|
29
|
+
if (!response.ok) {
|
|
30
|
+
throw new Error(`PagerDuty request failed with ${response.status}: ${text || response.statusText}`);
|
|
31
|
+
}
|
|
32
|
+
return data;
|
|
33
|
+
}
|
|
34
|
+
return { request };
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,OAAO,GAAG,2BAA2B,CAAC;AAM5C,MAAM,UAAU,qBAAqB,CAAC,EAAE,IAAI,EAAqB;IAC/D,MAAM,EAAE,MAAM,EAAE,GAAG,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAE7C,KAAK,UAAU,OAAO,CAAC,EACrB,MAAM,EACN,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,SAAS,GAOV;QACC,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAEnC,IAAI,GAAG,CAAC,MAAM,KAAK,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YAC7E,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;QACzD,CAAC;QAED,MAAM,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;YACnD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE;gBAAE,OAAO;YAEhD,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC1D,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;YACrC,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;YAChC,MAAM;YACN,OAAO,EAAE;gBACP,aAAa,EAAE,eAAe,MAAM,EAAE;gBACtC,MAAM,EAAE,0CAA0C;gBAClD,cAAc,EAAE,kBAAkB;gBAClC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAC1C;YACD,IAAI,EAAE,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;SAC5D,CAAC,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QACnC,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAa,CAAC,CAAC,CAAC,SAAS,CAAC;QAE9D,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CACb,iCAAiC,QAAQ,CAAC,MAAM,KAAK,IAAI,IAAI,QAAQ,CAAC,UAAU,EAAE,CACnF,CAAC;QACJ,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,CAAC;AACrB,CAAC"}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const pagerdutyAuth: z.ZodObject<{
|
|
3
|
+
apiKey: z.ZodString;
|
|
4
|
+
}, z.core.$strip>;
|
|
5
|
+
export declare const pagerdutyOptions: z.ZodObject<{
|
|
6
|
+
signingSecret: z.ZodOptional<z.ZodString>;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export type PagerdutyOptions = z.output<typeof pagerdutyOptions>;
|
|
9
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,aAAa;;iBAExB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;iBAM3B,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const pagerdutyAuth = z.object({
|
|
3
|
+
apiKey: z.string().min(1).meta({ label: 'API key', secret: true }),
|
|
4
|
+
});
|
|
5
|
+
export const pagerdutyOptions = z.object({
|
|
6
|
+
signingSecret: z
|
|
7
|
+
.string()
|
|
8
|
+
.min(1)
|
|
9
|
+
.meta({ label: 'Webhook signing secret', secret: true })
|
|
10
|
+
.optional(),
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;CACnE,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,aAAa,EAAE,CAAC;SACb,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,IAAI,CAAC,EAAE,KAAK,EAAE,wBAAwB,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;SACvD,QAAQ,EAAE;CACd,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,275 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const pagerdutyActions: readonly ["
|
|
1
|
+
import { createPagerdutyClient } from './client.js';
|
|
2
|
+
export declare const pagerdutyActions: readonly ["createIncident", "listIncidents", "getIncident", "acknowledgeIncident", "resolveIncident", "customApiCall"];
|
|
3
|
+
export declare const pagerdutyTriggers: readonly ["newIncident", "incidentResolved", "incidentAcknowledged"];
|
|
3
4
|
export declare const pagerdutyScopes: readonly [];
|
|
4
|
-
export declare
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
5
|
+
export declare const createPagerduty: import("frogbot/pieces").PieceFactory<{
|
|
6
|
+
readonly slug: "pagerduty";
|
|
7
|
+
readonly label: "PagerDuty";
|
|
8
|
+
readonly admin: {
|
|
9
|
+
readonly description: "Manage PagerDuty incidents and receive incident events";
|
|
10
|
+
readonly group: "Developer Tools";
|
|
11
|
+
};
|
|
12
|
+
readonly auth: import("zod").ZodObject<{
|
|
13
|
+
apiKey: import("zod").ZodString;
|
|
14
|
+
}, import("zod/v4/core").$strip>;
|
|
15
|
+
readonly options: import("zod").ZodObject<{
|
|
16
|
+
signingSecret: import("zod").ZodOptional<import("zod").ZodString>;
|
|
17
|
+
}, import("zod/v4/core").$strip>;
|
|
18
|
+
readonly client: typeof createPagerdutyClient;
|
|
19
|
+
readonly actions: readonly [{
|
|
20
|
+
slug: string;
|
|
21
|
+
description: string;
|
|
22
|
+
input: import("zod").ZodObject<{
|
|
23
|
+
fromEmail: import("zod").ZodEmail;
|
|
24
|
+
serviceId: import("zod").ZodString;
|
|
25
|
+
title: import("zod").ZodString;
|
|
26
|
+
urgency: import("zod").ZodDefault<import("zod").ZodEnum<{
|
|
27
|
+
high: "high";
|
|
28
|
+
low: "low";
|
|
29
|
+
}>>;
|
|
30
|
+
details: import("zod").ZodOptional<import("zod").ZodString>;
|
|
31
|
+
incidentKey: import("zod").ZodOptional<import("zod").ZodString>;
|
|
32
|
+
assigneeIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
33
|
+
priorityId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
34
|
+
conferenceNumber: import("zod").ZodOptional<import("zod").ZodString>;
|
|
35
|
+
conferenceUrl: import("zod").ZodOptional<import("zod").ZodURL>;
|
|
36
|
+
}, import("zod/v4/core").$strip>;
|
|
37
|
+
output: import("zod").ZodObject<{
|
|
38
|
+
id: import("zod").ZodString;
|
|
39
|
+
status: import("zod").ZodOptional<import("zod").ZodString>;
|
|
40
|
+
}, import("zod/v4/core").$loose>;
|
|
41
|
+
idempotent: false;
|
|
42
|
+
options: {
|
|
43
|
+
serviceId: ({ client }: {
|
|
44
|
+
client: import("./client.js").PagerdutyClient;
|
|
45
|
+
}) => Promise<{
|
|
46
|
+
label: string;
|
|
47
|
+
value: string;
|
|
48
|
+
}[]>;
|
|
49
|
+
};
|
|
50
|
+
run({ input, client, }: import("frogbot/pieces").PieceRunArgs<import("zod").infer<import("zod").ZodObject<{
|
|
51
|
+
fromEmail: import("zod").ZodEmail;
|
|
52
|
+
serviceId: import("zod").ZodString;
|
|
53
|
+
title: import("zod").ZodString;
|
|
54
|
+
urgency: import("zod").ZodDefault<import("zod").ZodEnum<{
|
|
55
|
+
high: "high";
|
|
56
|
+
low: "low";
|
|
57
|
+
}>>;
|
|
58
|
+
details: import("zod").ZodOptional<import("zod").ZodString>;
|
|
59
|
+
incidentKey: import("zod").ZodOptional<import("zod").ZodString>;
|
|
60
|
+
assigneeIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
61
|
+
priorityId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
62
|
+
conferenceNumber: import("zod").ZodOptional<import("zod").ZodString>;
|
|
63
|
+
conferenceUrl: import("zod").ZodOptional<import("zod").ZodURL>;
|
|
64
|
+
}, import("zod/v4/core").$strip>>, object, import("./client.js").PagerdutyClient>): Promise<{
|
|
65
|
+
[x: string]: unknown;
|
|
66
|
+
id: string;
|
|
67
|
+
status?: string | undefined;
|
|
68
|
+
}>;
|
|
69
|
+
}, {
|
|
70
|
+
slug: string;
|
|
71
|
+
description: string;
|
|
72
|
+
input: import("zod").ZodObject<{
|
|
73
|
+
statuses: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodEnum<{
|
|
74
|
+
triggered: "triggered";
|
|
75
|
+
acknowledged: "acknowledged";
|
|
76
|
+
resolved: "resolved";
|
|
77
|
+
}>>>;
|
|
78
|
+
urgency: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
79
|
+
high: "high";
|
|
80
|
+
low: "low";
|
|
81
|
+
}>>;
|
|
82
|
+
since: import("zod").ZodOptional<import("zod").ZodString>;
|
|
83
|
+
until: import("zod").ZodOptional<import("zod").ZodString>;
|
|
84
|
+
limit: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
85
|
+
offset: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
86
|
+
}, import("zod/v4/core").$strip>;
|
|
87
|
+
output: import("zod").ZodObject<{
|
|
88
|
+
incidents: import("zod").ZodArray<import("zod").ZodObject<{
|
|
89
|
+
id: import("zod").ZodString;
|
|
90
|
+
status: import("zod").ZodOptional<import("zod").ZodString>;
|
|
91
|
+
}, import("zod/v4/core").$loose>>;
|
|
92
|
+
limit: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
93
|
+
offset: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
94
|
+
more: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
95
|
+
}, import("zod/v4/core").$loose>;
|
|
96
|
+
idempotent: true;
|
|
97
|
+
run({ input, client, }: import("frogbot/pieces").PieceRunArgs<import("zod").infer<import("zod").ZodObject<{
|
|
98
|
+
statuses: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodEnum<{
|
|
99
|
+
triggered: "triggered";
|
|
100
|
+
acknowledged: "acknowledged";
|
|
101
|
+
resolved: "resolved";
|
|
102
|
+
}>>>;
|
|
103
|
+
urgency: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
104
|
+
high: "high";
|
|
105
|
+
low: "low";
|
|
106
|
+
}>>;
|
|
107
|
+
since: import("zod").ZodOptional<import("zod").ZodString>;
|
|
108
|
+
until: import("zod").ZodOptional<import("zod").ZodString>;
|
|
109
|
+
limit: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
110
|
+
offset: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
111
|
+
}, import("zod/v4/core").$strip>>, object, import("./client.js").PagerdutyClient>): Promise<{
|
|
112
|
+
[x: string]: unknown;
|
|
113
|
+
incidents: {
|
|
114
|
+
[x: string]: unknown;
|
|
115
|
+
id: string;
|
|
116
|
+
status?: string | undefined;
|
|
117
|
+
}[];
|
|
118
|
+
limit?: number | undefined;
|
|
119
|
+
offset?: number | undefined;
|
|
120
|
+
more?: boolean | undefined;
|
|
121
|
+
}>;
|
|
122
|
+
}, {
|
|
123
|
+
slug: string;
|
|
124
|
+
description: string;
|
|
125
|
+
input: import("zod").ZodObject<{
|
|
126
|
+
incidentId: import("zod").ZodString;
|
|
127
|
+
}, import("zod/v4/core").$strip>;
|
|
128
|
+
output: import("zod").ZodObject<{
|
|
129
|
+
id: import("zod").ZodString;
|
|
130
|
+
status: import("zod").ZodOptional<import("zod").ZodString>;
|
|
131
|
+
}, import("zod/v4/core").$loose>;
|
|
132
|
+
idempotent: true;
|
|
133
|
+
run({ input, client, }: import("frogbot/pieces").PieceRunArgs<import("zod").infer<import("zod").ZodObject<{
|
|
134
|
+
incidentId: import("zod").ZodString;
|
|
135
|
+
}, import("zod/v4/core").$strip>>, object, import("./client.js").PagerdutyClient>): Promise<{
|
|
136
|
+
[x: string]: unknown;
|
|
137
|
+
id: string;
|
|
138
|
+
status?: string | undefined;
|
|
139
|
+
}>;
|
|
140
|
+
}, {
|
|
141
|
+
slug: "acknowledgeIncident" | "resolveIncident";
|
|
142
|
+
description: string;
|
|
143
|
+
input: import("zod").ZodObject<{
|
|
144
|
+
resolution?: import("zod").ZodOptional<import("zod").ZodString> | undefined;
|
|
145
|
+
incidentId: import("zod").ZodString;
|
|
146
|
+
fromEmail: import("zod").ZodEmail;
|
|
147
|
+
}, import("zod/v4/core").$strip>;
|
|
148
|
+
output: import("zod").ZodObject<{
|
|
149
|
+
id: import("zod").ZodString;
|
|
150
|
+
status: import("zod").ZodOptional<import("zod").ZodString>;
|
|
151
|
+
}, import("zod/v4/core").$loose>;
|
|
152
|
+
idempotent: true;
|
|
153
|
+
run({ input: values, client, }: import("frogbot/pieces").PieceRunArgs<import("zod").infer<import("zod").ZodObject<{
|
|
154
|
+
resolution?: import("zod").ZodOptional<import("zod").ZodString> | undefined;
|
|
155
|
+
incidentId: import("zod").ZodString;
|
|
156
|
+
fromEmail: import("zod").ZodEmail;
|
|
157
|
+
}, import("zod/v4/core").$strip>>, object, import("./client.js").PagerdutyClient>): Promise<{
|
|
158
|
+
[x: string]: unknown;
|
|
159
|
+
id: string;
|
|
160
|
+
status?: string | undefined;
|
|
161
|
+
}>;
|
|
162
|
+
}, {
|
|
163
|
+
slug: "acknowledgeIncident" | "resolveIncident";
|
|
164
|
+
description: string;
|
|
165
|
+
input: import("zod").ZodObject<{
|
|
166
|
+
resolution?: import("zod").ZodOptional<import("zod").ZodString> | undefined;
|
|
167
|
+
incidentId: import("zod").ZodString;
|
|
168
|
+
fromEmail: import("zod").ZodEmail;
|
|
169
|
+
}, import("zod/v4/core").$strip>;
|
|
170
|
+
output: import("zod").ZodObject<{
|
|
171
|
+
id: import("zod").ZodString;
|
|
172
|
+
status: import("zod").ZodOptional<import("zod").ZodString>;
|
|
173
|
+
}, import("zod/v4/core").$loose>;
|
|
174
|
+
idempotent: true;
|
|
175
|
+
run({ input: values, client, }: import("frogbot/pieces").PieceRunArgs<import("zod").infer<import("zod").ZodObject<{
|
|
176
|
+
resolution?: import("zod").ZodOptional<import("zod").ZodString> | undefined;
|
|
177
|
+
incidentId: import("zod").ZodString;
|
|
178
|
+
fromEmail: import("zod").ZodEmail;
|
|
179
|
+
}, import("zod/v4/core").$strip>>, object, import("./client.js").PagerdutyClient>): Promise<{
|
|
180
|
+
[x: string]: unknown;
|
|
181
|
+
id: string;
|
|
182
|
+
status?: string | undefined;
|
|
183
|
+
}>;
|
|
184
|
+
}, {
|
|
185
|
+
slug: string;
|
|
186
|
+
description: string;
|
|
187
|
+
input: import("zod").ZodObject<{
|
|
188
|
+
method: import("zod").ZodEnum<{
|
|
189
|
+
GET: "GET";
|
|
190
|
+
POST: "POST";
|
|
191
|
+
PATCH: "PATCH";
|
|
192
|
+
PUT: "PUT";
|
|
193
|
+
DELETE: "DELETE";
|
|
194
|
+
}>;
|
|
195
|
+
path: import("zod").ZodString;
|
|
196
|
+
queryParams: import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>]>>>;
|
|
197
|
+
body: import("zod").ZodOptional<import("zod").ZodJSONSchema>;
|
|
198
|
+
}, import("zod/v4/core").$strip>;
|
|
199
|
+
output: import("zod").ZodJSONSchema;
|
|
200
|
+
run({ input, client, }: import("frogbot/pieces").PieceRunArgs<import("zod").infer<import("zod").ZodObject<{
|
|
201
|
+
method: import("zod").ZodEnum<{
|
|
202
|
+
GET: "GET";
|
|
203
|
+
POST: "POST";
|
|
204
|
+
PATCH: "PATCH";
|
|
205
|
+
PUT: "PUT";
|
|
206
|
+
DELETE: "DELETE";
|
|
207
|
+
}>;
|
|
208
|
+
path: import("zod").ZodString;
|
|
209
|
+
queryParams: import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>]>>>;
|
|
210
|
+
body: import("zod").ZodOptional<import("zod").ZodJSONSchema>;
|
|
211
|
+
}, import("zod/v4/core").$strip>>, object, import("./client.js").PagerdutyClient>): Promise<import("zod").JSONType>;
|
|
212
|
+
}];
|
|
213
|
+
readonly triggers: readonly [import("frogbot/pieces").PieceWebhookTrigger<import("zod").ZodObject<{}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
214
|
+
event: import("zod").ZodObject<{
|
|
215
|
+
id: import("zod").ZodString;
|
|
216
|
+
event_type: import("zod").ZodString;
|
|
217
|
+
}, import("zod/v4/core").$loose>;
|
|
218
|
+
}, import("zod/v4/core").$loose>, {
|
|
219
|
+
signingSecret?: string | undefined;
|
|
220
|
+
}, {
|
|
221
|
+
request: ({ method, path, query, body, fromEmail, }: {
|
|
222
|
+
method: string;
|
|
223
|
+
path: string;
|
|
224
|
+
query?: {
|
|
225
|
+
[x: string]: string | string[] | undefined;
|
|
226
|
+
};
|
|
227
|
+
body?: unknown;
|
|
228
|
+
fromEmail?: string;
|
|
229
|
+
}) => Promise<unknown>;
|
|
230
|
+
}, {
|
|
231
|
+
webhookUrl: string;
|
|
232
|
+
}>, import("frogbot/pieces").PieceWebhookTrigger<import("zod").ZodObject<{}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
233
|
+
event: import("zod").ZodObject<{
|
|
234
|
+
id: import("zod").ZodString;
|
|
235
|
+
event_type: import("zod").ZodString;
|
|
236
|
+
}, import("zod/v4/core").$loose>;
|
|
237
|
+
}, import("zod/v4/core").$loose>, {
|
|
238
|
+
signingSecret?: string | undefined;
|
|
239
|
+
}, {
|
|
240
|
+
request: ({ method, path, query, body, fromEmail, }: {
|
|
241
|
+
method: string;
|
|
242
|
+
path: string;
|
|
243
|
+
query?: {
|
|
244
|
+
[x: string]: string | string[] | undefined;
|
|
245
|
+
};
|
|
246
|
+
body?: unknown;
|
|
247
|
+
fromEmail?: string;
|
|
248
|
+
}) => Promise<unknown>;
|
|
249
|
+
}, {
|
|
250
|
+
webhookUrl: string;
|
|
251
|
+
}>, import("frogbot/pieces").PieceWebhookTrigger<import("zod").ZodObject<{}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
252
|
+
event: import("zod").ZodObject<{
|
|
253
|
+
id: import("zod").ZodString;
|
|
254
|
+
event_type: import("zod").ZodString;
|
|
255
|
+
}, import("zod/v4/core").$loose>;
|
|
256
|
+
}, import("zod/v4/core").$loose>, {
|
|
257
|
+
signingSecret?: string | undefined;
|
|
258
|
+
}, {
|
|
259
|
+
request: ({ method, path, query, body, fromEmail, }: {
|
|
260
|
+
method: string;
|
|
261
|
+
path: string;
|
|
262
|
+
query?: {
|
|
263
|
+
[x: string]: string | string[] | undefined;
|
|
264
|
+
};
|
|
265
|
+
body?: unknown;
|
|
266
|
+
fromEmail?: string;
|
|
267
|
+
}) => Promise<unknown>;
|
|
268
|
+
}, {
|
|
269
|
+
webhookUrl: string;
|
|
270
|
+
}>];
|
|
271
|
+
readonly webhook: import("frogbot/pieces").PieceWebhook<{
|
|
272
|
+
signingSecret?: string | undefined;
|
|
273
|
+
}>;
|
|
274
|
+
}>;
|
|
18
275
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAKpD,eAAO,MAAM,gBAAgB,wHAOnB,CAAC;AACX,eAAO,MAAM,iBAAiB,sEAIpB,CAAC;AACX,eAAO,MAAM,eAAe,aAAc,CAAC;AAE3C,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAdlB,CAAC;;;gBACH,CAAC;qBACK,CAAC;;;;;;;;;;;;;;;iBAFL,CAAC;;;gBACH,CAAC;qBACK,CAAC;;;;;;;;;;;;;;;iBAFL,CAAC;;;gBACH,CAAC;qBACK,CAAC;;;;;;;;EAgCb,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,35 +1,42 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { definePiece } from 'frogbot/pieces';
|
|
2
|
+
import { acknowledgeIncident, createIncident, customApiCall, getIncident, listIncidents, resolveIncident, } from './actions.js';
|
|
3
|
+
import { createPagerdutyClient } from './client.js';
|
|
4
|
+
import { pagerdutyAuth, pagerdutyOptions } from './config.js';
|
|
5
|
+
import { incidentAcknowledged, incidentResolved, newIncident } from './triggers.js';
|
|
6
|
+
import { pagerdutyWebhook } from './webhook.js';
|
|
3
7
|
export const pagerdutyActions = [
|
|
4
|
-
'
|
|
5
|
-
'
|
|
6
|
-
'
|
|
7
|
-
'
|
|
8
|
-
'
|
|
8
|
+
'createIncident',
|
|
9
|
+
'listIncidents',
|
|
10
|
+
'getIncident',
|
|
11
|
+
'acknowledgeIncident',
|
|
12
|
+
'resolveIncident',
|
|
13
|
+
'customApiCall',
|
|
14
|
+
];
|
|
15
|
+
export const pagerdutyTriggers = [
|
|
16
|
+
'newIncident',
|
|
17
|
+
'incidentResolved',
|
|
18
|
+
'incidentAcknowledged',
|
|
9
19
|
];
|
|
10
20
|
export const pagerdutyScopes = [];
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
createIncident
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
customApiCall: piece.tool('custom_api_call'),
|
|
33
|
-
});
|
|
34
|
-
}
|
|
21
|
+
export const createPagerduty = definePiece({
|
|
22
|
+
slug: 'pagerduty',
|
|
23
|
+
label: 'PagerDuty',
|
|
24
|
+
admin: {
|
|
25
|
+
description: 'Manage PagerDuty incidents and receive incident events',
|
|
26
|
+
group: 'Developer Tools',
|
|
27
|
+
},
|
|
28
|
+
auth: pagerdutyAuth,
|
|
29
|
+
options: pagerdutyOptions,
|
|
30
|
+
client: createPagerdutyClient,
|
|
31
|
+
actions: [
|
|
32
|
+
createIncident,
|
|
33
|
+
listIncidents,
|
|
34
|
+
getIncident,
|
|
35
|
+
acknowledgeIncident,
|
|
36
|
+
resolveIncident,
|
|
37
|
+
customApiCall,
|
|
38
|
+
],
|
|
39
|
+
triggers: [newIncident, incidentResolved, incidentAcknowledged],
|
|
40
|
+
webhook: pagerdutyWebhook,
|
|
41
|
+
});
|
|
35
42
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,WAAW,EACX,aAAa,EACb,eAAe,GAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,gBAAgB;IAChB,eAAe;IACf,aAAa;IACb,qBAAqB;IACrB,iBAAiB;IACjB,eAAe;CACP,CAAC;AACX,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,aAAa;IACb,kBAAkB;IAClB,sBAAsB;CACd,CAAC;AACX,MAAM,CAAC,MAAM,eAAe,GAAG,EAAW,CAAC;AAE3C,MAAM,CAAC,MAAM,eAAe,GAAG,WAAW,CAAC;IACzC,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,WAAW;IAClB,KAAK,EAAE;QACL,WAAW,EAAE,wDAAwD;QACrE,KAAK,EAAE,iBAAiB;KACzB;IACD,IAAI,EAAE,aAAa;IACnB,OAAO,EAAE,gBAAgB;IACzB,MAAM,EAAE,qBAAqB;IAC7B,OAAO,EAAE;QACP,cAAc;QACd,aAAa;QACb,WAAW;QACX,mBAAmB;QACnB,eAAe;QACf,aAAa;KACd;IACD,QAAQ,EAAE,CAAC,WAAW,EAAE,gBAAgB,EAAE,oBAAoB,CAAC;IAC/D,OAAO,EAAE,gBAAgB;CAC1B,CAAC,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { PieceWebhookTrigger } from 'frogbot/pieces';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
type ManualWebhookState = {
|
|
4
|
+
webhookUrl: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const newIncident: PieceWebhookTrigger<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
7
|
+
event: z.ZodObject<{
|
|
8
|
+
id: z.ZodString;
|
|
9
|
+
event_type: z.ZodString;
|
|
10
|
+
}, z.core.$loose>;
|
|
11
|
+
}, z.core.$loose>, {
|
|
12
|
+
signingSecret?: string | undefined;
|
|
13
|
+
}, {
|
|
14
|
+
request: ({ method, path, query, body, fromEmail, }: {
|
|
15
|
+
method: string;
|
|
16
|
+
path: string;
|
|
17
|
+
query?: {
|
|
18
|
+
[x: string]: string | string[] | undefined;
|
|
19
|
+
};
|
|
20
|
+
body?: unknown;
|
|
21
|
+
fromEmail?: string;
|
|
22
|
+
}) => Promise<unknown>;
|
|
23
|
+
}, ManualWebhookState>;
|
|
24
|
+
export declare const incidentResolved: PieceWebhookTrigger<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
25
|
+
event: z.ZodObject<{
|
|
26
|
+
id: z.ZodString;
|
|
27
|
+
event_type: z.ZodString;
|
|
28
|
+
}, z.core.$loose>;
|
|
29
|
+
}, z.core.$loose>, {
|
|
30
|
+
signingSecret?: string | undefined;
|
|
31
|
+
}, {
|
|
32
|
+
request: ({ method, path, query, body, fromEmail, }: {
|
|
33
|
+
method: string;
|
|
34
|
+
path: string;
|
|
35
|
+
query?: {
|
|
36
|
+
[x: string]: string | string[] | undefined;
|
|
37
|
+
};
|
|
38
|
+
body?: unknown;
|
|
39
|
+
fromEmail?: string;
|
|
40
|
+
}) => Promise<unknown>;
|
|
41
|
+
}, ManualWebhookState>;
|
|
42
|
+
export declare const incidentAcknowledged: PieceWebhookTrigger<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
43
|
+
event: z.ZodObject<{
|
|
44
|
+
id: z.ZodString;
|
|
45
|
+
event_type: z.ZodString;
|
|
46
|
+
}, z.core.$loose>;
|
|
47
|
+
}, z.core.$loose>, {
|
|
48
|
+
signingSecret?: string | undefined;
|
|
49
|
+
}, {
|
|
50
|
+
request: ({ method, path, query, body, fromEmail, }: {
|
|
51
|
+
method: string;
|
|
52
|
+
path: string;
|
|
53
|
+
query?: {
|
|
54
|
+
[x: string]: string | string[] | undefined;
|
|
55
|
+
};
|
|
56
|
+
body?: unknown;
|
|
57
|
+
fromEmail?: string;
|
|
58
|
+
}) => Promise<unknown>;
|
|
59
|
+
}, ManualWebhookState>;
|
|
60
|
+
export {};
|
|
61
|
+
//# sourceMappingURL=triggers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"triggers.d.ts","sourceRoot":"","sources":["../src/triggers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiBxB,KAAK,kBAAkB,GAAG;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC;AA0CjD,eAAO,MAAM,WAAW;;;;;;;;;;;aArCtB,CAAC;;;YACE,CAAC;iBAEM,CAAC;;sBAuCX,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;aA5C3B,CAAC;;;YACE,CAAC;iBAEM,CAAC;;sBA8CX,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;aAnD/B,CAAC;;;YACE,CAAC;iBAEM,CAAC;;sBAqDX,CAAC"}
|
package/dist/triggers.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
const input = z.object({});
|
|
3
|
+
const output = z
|
|
4
|
+
.object({
|
|
5
|
+
event: z
|
|
6
|
+
.object({
|
|
7
|
+
id: z.string(),
|
|
8
|
+
event_type: z.string(),
|
|
9
|
+
})
|
|
10
|
+
.passthrough(),
|
|
11
|
+
})
|
|
12
|
+
.passthrough();
|
|
13
|
+
function manualTrigger({ slug, label, description, eventType, }) {
|
|
14
|
+
return {
|
|
15
|
+
slug,
|
|
16
|
+
label,
|
|
17
|
+
description,
|
|
18
|
+
type: 'webhook',
|
|
19
|
+
input,
|
|
20
|
+
output,
|
|
21
|
+
async onEnable({ webhookUrl }) {
|
|
22
|
+
return { webhookUrl };
|
|
23
|
+
},
|
|
24
|
+
async onDisable() { },
|
|
25
|
+
async run({ req, state }) {
|
|
26
|
+
const delivery = output.safeParse(req.data);
|
|
27
|
+
if (!state.webhookUrl || !delivery.success || delivery.data.event.event_type !== eventType) {
|
|
28
|
+
return [];
|
|
29
|
+
}
|
|
30
|
+
return [{ data: delivery.data, dedupeKey: delivery.data.event.id }];
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export const newIncident = manualTrigger({
|
|
35
|
+
slug: 'newIncident',
|
|
36
|
+
label: 'New Incident',
|
|
37
|
+
description: 'Triggers when a new incident is created.',
|
|
38
|
+
eventType: 'incident.triggered',
|
|
39
|
+
});
|
|
40
|
+
export const incidentResolved = manualTrigger({
|
|
41
|
+
slug: 'incidentResolved',
|
|
42
|
+
label: 'Incident Resolved',
|
|
43
|
+
description: 'Triggers when an incident is resolved.',
|
|
44
|
+
eventType: 'incident.resolved',
|
|
45
|
+
});
|
|
46
|
+
export const incidentAcknowledged = manualTrigger({
|
|
47
|
+
slug: 'incidentAcknowledged',
|
|
48
|
+
label: 'Incident Acknowledged',
|
|
49
|
+
description: 'Triggers when an incident is acknowledged.',
|
|
50
|
+
eventType: 'incident.acknowledged',
|
|
51
|
+
});
|
|
52
|
+
//# sourceMappingURL=triggers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"triggers.js","sourceRoot":"","sources":["../src/triggers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAC3B,MAAM,MAAM,GAAG,CAAC;KACb,MAAM,CAAC;IACN,KAAK,EAAE,CAAC;SACL,MAAM,CAAC;QACN,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;QACd,UAAU,EAAE,CAAC,CAAC,MAA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AoB,GAAG,aAAa,CAAC;IAChD,IAAI,EAAE,sBAAsB;IAC5B,KAAK,EAAE,uBAAuB;IAC9B,WAAW,EAAE,4CAA4C;IACzD,SAAS,EAAE,uBAAuB;CACnC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook.d.ts","sourceRoot":"","sources":["../src/webhook.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,eAAO,MAAM,gBAAgB,EAAE,YAAY,CAAC,gBAAgB,CA0B3D,CAAC"}
|
package/dist/webhook.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { createHmac, timingSafeEqual } from 'node:crypto';
|
|
2
|
+
export const pagerdutyWebhook = {
|
|
3
|
+
async verify({ req, options }) {
|
|
4
|
+
const header = req.headers.get('x-pagerduty-signature');
|
|
5
|
+
if (!options.signingSecret || !header || !req.arrayBuffer)
|
|
6
|
+
return false;
|
|
7
|
+
try {
|
|
8
|
+
const body = Buffer.from(await req.arrayBuffer());
|
|
9
|
+
if (body.length === 0)
|
|
10
|
+
return false;
|
|
11
|
+
const expected = createHmac('sha256', options.signingSecret).update(body).digest();
|
|
12
|
+
return header.split(',').some((value) => {
|
|
13
|
+
const signature = value.trim();
|
|
14
|
+
if (!signature.startsWith('v1='))
|
|
15
|
+
return false;
|
|
16
|
+
const actual = Buffer.from(signature.slice(3), 'hex');
|
|
17
|
+
return actual.length === expected.length && timingSafeEqual(actual, expected);
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=webhook.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook.js","sourceRoot":"","sources":["../src/webhook.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|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frogbotai/piece-pagerduty",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.23.0",
|
|
4
|
+
"description": "pagerduty tools for FrogBot.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Colby Gilbert",
|
|
7
7
|
"type": "module",
|
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
],
|
|
20
20
|
"sideEffects": false,
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"
|
|
22
|
+
"zod": "^4.3.6"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"frogbot": "0.
|
|
25
|
+
"frogbot": "0.23.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"typescript": "5.6.2",
|
|
29
|
-
"frogbot": "0.
|
|
29
|
+
"frogbot": "0.23.0"
|
|
30
30
|
},
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public"
|