@pipedream/statuspage 0.0.4 → 0.1.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/actions/create-incident/create-incident.mjs +1 -1
- package/actions/fetch-active-incidents/fetch-active-incidents.mjs +55 -0
- package/actions/update-incident/update-incident.mjs +1 -1
- package/package.json +1 -1
- package/sources/incident-updated/incident-updated.mjs +1 -1
- package/sources/new-incident-created/new-incident-created.mjs +1 -1
- package/statuspage.app.mjs +8 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import statuspage from "../../statuspage.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "statuspage-fetch-active-incidents",
|
|
5
|
+
name: "Fetch Active Incidents",
|
|
6
|
+
description: "Fetch unresolved (active) incidents for a Statuspage page — i.e. incidents not yet in the `resolved` or `postmortem` state. Returns an array (possibly empty) of incident objects. [See the documentation](https://developer.statuspage.io/#operation/getPagesPageIdIncidentsUnresolved)",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
annotations: {
|
|
10
|
+
destructiveHint: false,
|
|
11
|
+
openWorldHint: true,
|
|
12
|
+
readOnlyHint: true,
|
|
13
|
+
},
|
|
14
|
+
props: {
|
|
15
|
+
statuspage,
|
|
16
|
+
pageId: {
|
|
17
|
+
propDefinition: [
|
|
18
|
+
statuspage,
|
|
19
|
+
"pageId",
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
page: {
|
|
23
|
+
type: "integer",
|
|
24
|
+
label: "Page",
|
|
25
|
+
description: "The page number to fetch",
|
|
26
|
+
optional: true,
|
|
27
|
+
default: 1,
|
|
28
|
+
},
|
|
29
|
+
perPage: {
|
|
30
|
+
type: "integer",
|
|
31
|
+
label: "Per Page",
|
|
32
|
+
description: "The number of incidents to fetch per page",
|
|
33
|
+
optional: true,
|
|
34
|
+
default: 100,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
async run({ $ }) {
|
|
38
|
+
const response = await this.statuspage.getUnresolvedIncidents({
|
|
39
|
+
$,
|
|
40
|
+
pageId: this.pageId,
|
|
41
|
+
params: {
|
|
42
|
+
page: this.page,
|
|
43
|
+
per_page: this.perPage,
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
if (response?.length) {
|
|
48
|
+
$.export("$summary", `Successfully retrieved ${response.length} active incident(s)`);
|
|
49
|
+
} else {
|
|
50
|
+
$.export("$summary", "No active incidents found");
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return response;
|
|
54
|
+
},
|
|
55
|
+
};
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@ import common from "../common/common.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
...common,
|
|
5
5
|
name: "New Incident Created (Instant)",
|
|
6
|
-
version: "0.0.
|
|
6
|
+
version: "0.0.4",
|
|
7
7
|
key: "statuspage-new-incident-created",
|
|
8
8
|
description: "Emit new event on each created incident.",
|
|
9
9
|
type: "source",
|
package/statuspage.app.mjs
CHANGED
|
@@ -137,6 +137,14 @@ export default {
|
|
|
137
137
|
...args,
|
|
138
138
|
});
|
|
139
139
|
},
|
|
140
|
+
async getUnresolvedIncidents({
|
|
141
|
+
pageId, ...args
|
|
142
|
+
}) {
|
|
143
|
+
return this._makeRequest({
|
|
144
|
+
path: `/pages/${pageId}/incidents/unresolved`,
|
|
145
|
+
...args,
|
|
146
|
+
});
|
|
147
|
+
},
|
|
140
148
|
async getComponents({
|
|
141
149
|
pageId, ...args
|
|
142
150
|
}) {
|