@pipedream/statuspage 0.1.0 → 0.3.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.
|
@@ -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,24 @@
|
|
|
1
|
+
import statuspage from "../../statuspage.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "statuspage-list-page-id-options",
|
|
5
|
+
name: "List Page ID Options",
|
|
6
|
+
description: "Retrieves available options for the Page ID field.",
|
|
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
|
+
},
|
|
17
|
+
async run({ $ }) {
|
|
18
|
+
const options = await statuspage.propDefinitions.pageId.options.call(this.statuspage);
|
|
19
|
+
$.export("$summary", `Successfully retrieved ${options.length} option${options.length === 1
|
|
20
|
+
? ""
|
|
21
|
+
: "s"}`);
|
|
22
|
+
return options;
|
|
23
|
+
},
|
|
24
|
+
};
|