@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.
@@ -2,7 +2,7 @@ import statuspage from "../../statuspage.app.mjs";
2
2
 
3
3
  export default {
4
4
  name: "Create Incident",
5
- version: "0.0.3",
5
+ version: "0.0.4",
6
6
  annotations: {
7
7
  destructiveHint: false,
8
8
  openWorldHint: true,
@@ -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
+ };
@@ -2,7 +2,7 @@ import statuspage from "../../statuspage.app.mjs";
2
2
 
3
3
  export default {
4
4
  name: "Update Incident",
5
- version: "0.0.5",
5
+ version: "0.0.6",
6
6
  annotations: {
7
7
  destructiveHint: false,
8
8
  openWorldHint: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/statuspage",
3
- "version": "0.0.4",
3
+ "version": "0.1.0",
4
4
  "description": "Pipedream Statuspage Components",
5
5
  "main": "statuspage.app.mjs",
6
6
  "keywords": [
@@ -3,7 +3,7 @@ import common from "../common/common.mjs";
3
3
  export default {
4
4
  ...common,
5
5
  name: "Incident Updated (Instant)",
6
- version: "0.0.3",
6
+ version: "0.0.4",
7
7
  key: "statuspage-incident-updated",
8
8
  description: "Emit new event on each updated incident.",
9
9
  type: "source",
@@ -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.3",
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",
@@ -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
  }) {