@pipedream/statuspage 0.0.4 → 0.2.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,178 @@
1
+ import statuspage from "../../statuspage.app.mjs";
2
+
3
+ export default {
4
+ name: "Create Maintenance",
5
+ version: "0.0.1",
6
+ annotations: {
7
+ destructiveHint: false,
8
+ openWorldHint: true,
9
+ readOnlyHint: false,
10
+ },
11
+ key: "statuspage-create-maintenance",
12
+ description: "Creates a scheduled maintenance incident in Statuspage. [See the documentation](https://developer.statuspage.io/#operation/postPagesPageIdIncidents)",
13
+ type: "action",
14
+ props: {
15
+ statuspage,
16
+ pageId: {
17
+ propDefinition: [
18
+ statuspage,
19
+ "pageId",
20
+ ],
21
+ },
22
+ name: {
23
+ label: "Name",
24
+ description: "The name of the scheduled maintenance",
25
+ type: "string",
26
+ },
27
+ body: {
28
+ label: "Body",
29
+ description: "The body of the scheduled maintenance",
30
+ type: "string",
31
+ },
32
+ scheduledFor: {
33
+ label: "Scheduled For",
34
+ description: "The ISO 8601 datetime when the maintenance is scheduled to start (e.g. `2024-01-15T10:00:00.000Z`)",
35
+ type: "string",
36
+ },
37
+ scheduledUntil: {
38
+ label: "Scheduled Until",
39
+ description: "The ISO 8601 datetime when the maintenance is scheduled to end (e.g. `2024-01-15T12:00:00.000Z`)",
40
+ type: "string",
41
+ },
42
+ componentIds: {
43
+ label: "Component IDs",
44
+ description: "The IDs of the components affected by this maintenance",
45
+ type: "string[]",
46
+ propDefinition: [
47
+ statuspage,
48
+ "componentId",
49
+ (c) => ({
50
+ pageId: c.pageId,
51
+ }),
52
+ ],
53
+ optional: true,
54
+ },
55
+ deliverNotifications: {
56
+ label: "Deliver Notifications",
57
+ description: "Whether to deliver notifications for this scheduled maintenance",
58
+ type: "boolean",
59
+ optional: true,
60
+ default: true,
61
+ },
62
+ scheduledRemindPrior: {
63
+ label: "Scheduled Remind Prior",
64
+ description: "Whether to remind subscribers prior to the maintenance",
65
+ type: "boolean",
66
+ optional: true,
67
+ default: true,
68
+ },
69
+ scheduledAutoInProgress: {
70
+ label: "Scheduled Auto In Progress",
71
+ description: "Whether to automatically transition to in progress at the scheduled start time",
72
+ type: "boolean",
73
+ optional: true,
74
+ default: true,
75
+ },
76
+ autoTransitionDeliverNotificationsAtStart: {
77
+ label: "Auto Transition Deliver Notifications At Start",
78
+ description: "Whether to deliver notifications when transitioning to in progress",
79
+ type: "boolean",
80
+ optional: true,
81
+ default: true,
82
+ },
83
+ autoTransitionToMaintenanceState: {
84
+ label: "Auto Transition To Maintenance State",
85
+ description: "Whether to automatically transition components to maintenance state at start",
86
+ type: "boolean",
87
+ optional: true,
88
+ default: true,
89
+ },
90
+ scheduledAutoCompleted: {
91
+ label: "Scheduled Auto Completed",
92
+ description: "Whether to automatically complete the maintenance at the scheduled end time",
93
+ type: "boolean",
94
+ optional: true,
95
+ default: true,
96
+ },
97
+ autoTransitionDeliverNotificationsAtEnd: {
98
+ label: "Auto Transition Deliver Notifications At End",
99
+ description: "Whether to deliver notifications when completing the maintenance",
100
+ type: "boolean",
101
+ optional: true,
102
+ default: true,
103
+ },
104
+ autoTransitionToOperationalState: {
105
+ label: "Auto Transition To Operational State",
106
+ description: "Whether to automatically transition components back to operational state at end",
107
+ type: "boolean",
108
+ optional: true,
109
+ default: true,
110
+ },
111
+ autoTweetOnCreation: {
112
+ label: "Auto Tweet On Creation",
113
+ description: "Whether to automatically tweet when the maintenance is created",
114
+ type: "boolean",
115
+ optional: true,
116
+ default: false,
117
+ },
118
+ autoTweetOneHourBefore: {
119
+ label: "Auto Tweet One Hour Before",
120
+ description: "Whether to automatically tweet one hour before the maintenance starts",
121
+ type: "boolean",
122
+ optional: true,
123
+ default: false,
124
+ },
125
+ autoTweetAtBeginning: {
126
+ label: "Auto Tweet At Beginning",
127
+ description: "Whether to automatically tweet when the maintenance begins",
128
+ type: "boolean",
129
+ optional: true,
130
+ default: false,
131
+ },
132
+ autoTweetOnCompletion: {
133
+ label: "Auto Tweet On Completion",
134
+ description: "Whether to automatically tweet when the maintenance is completed",
135
+ type: "boolean",
136
+ optional: true,
137
+ default: false,
138
+ },
139
+ },
140
+ async run({ $ }) {
141
+ const response = await this.statuspage.createIncident({
142
+ $,
143
+ pageId: this.pageId,
144
+ data: {
145
+ incident: {
146
+ name: this.name,
147
+ status: "scheduled",
148
+ body: this.body,
149
+ scheduled_for: this.scheduledFor,
150
+ scheduled_until: this.scheduledUntil,
151
+ deliver_notifications: this.deliverNotifications,
152
+ scheduled_remind_prior: this.scheduledRemindPrior,
153
+ scheduled_auto_in_progress: this.scheduledAutoInProgress,
154
+ auto_transition_deliver_notifications_at_start: // changed — split for max-len
155
+ this.autoTransitionDeliverNotificationsAtStart,
156
+ auto_transition_to_maintenance_state: this.autoTransitionToMaintenanceState,
157
+ scheduled_auto_completed: this.scheduledAutoCompleted,
158
+ auto_transition_deliver_notifications_at_end: // changed — split for max-len
159
+ this.autoTransitionDeliverNotificationsAtEnd,
160
+ auto_transition_to_operational_state: this.autoTransitionToOperationalState,
161
+ auto_tweet_on_creation: this.autoTweetOnCreation,
162
+ auto_tweet_one_hour_before: this.autoTweetOneHourBefore,
163
+ auto_tweet_at_beginning: this.autoTweetAtBeginning,
164
+ auto_tweet_on_completion: this.autoTweetOnCompletion,
165
+ ...(this.componentIds?.length && {
166
+ component_ids: this.componentIds,
167
+ }),
168
+ },
169
+ },
170
+ });
171
+
172
+ if (response) {
173
+ $.export("$summary", `Successfully created maintenance with id ${response.id}`);
174
+ }
175
+
176
+ return response;
177
+ },
178
+ };
@@ -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.2.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
  }) {