@axis-backstage/plugin-statuspage-common 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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # @axis-backstage/plugin-statuspage-common
2
+
3
+ ## 0.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - b445aaa: Initial Release of the Statuspage Plugin
package/README.md ADDED
@@ -0,0 +1,5 @@
1
+ # plugin-statuspage-common
2
+
3
+ Welcome to the common package for the statuspage plugin!
4
+
5
+ Contains common types shared between frontend and backend plugins.
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const STATUSPAGE_ANNOTATION = "statuspage.io/components";
6
+
7
+ exports.STATUSPAGE_ANNOTATION = STATUSPAGE_ANNOTATION;
8
+ //# sourceMappingURL=index.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs.js","sources":["../src/annotations.ts"],"sourcesContent":["/**\n * Annotation used by Entities that will embed statuspage.io components and\n * component groups.\n *\n * @public\n */\nexport const STATUSPAGE_ANNOTATION = 'statuspage.io/components';\n"],"names":[],"mappings":";;;;AAMO,MAAM,qBAAwB,GAAA;;;;"}
@@ -0,0 +1,129 @@
1
+ /**
2
+ * Represents the detailed status of a page, including various timestamps,
3
+ * status information, and related metadata.
4
+ *
5
+ * @public
6
+ */
7
+ type Incident = {
8
+ name: string;
9
+ status: IncidentStatus;
10
+ created_at: Date;
11
+ updated_at: Date;
12
+ monitoring_at: Date | null;
13
+ resolved_at: Date;
14
+ impact: string;
15
+ shortlink: string;
16
+ scheduled_for: Date | null;
17
+ scheduled_until: Date | null;
18
+ scheduled_remind_prior: boolean;
19
+ scheduled_reminded_at: Date | null;
20
+ impact_override: null;
21
+ scheduled_auto_in_progress: boolean;
22
+ scheduled_auto_completed: boolean;
23
+ metadata: any;
24
+ started_at: Date;
25
+ reminder_intervals: null;
26
+ id: string;
27
+ page_id: string;
28
+ incident_updates: IncidentUpdate[];
29
+ postmortem_body: null | string;
30
+ postmortem_body_last_updated_at: Date | null;
31
+ postmortem_ignored: boolean;
32
+ postmortem_published_at: Date | null;
33
+ postmortem_notified_subscribers: boolean;
34
+ postmortem_notified_twitter: boolean;
35
+ components: Component[];
36
+ };
37
+ /**
38
+ * Describes a component within a Statuspage, including its status,
39
+ * descriptive information, and related timestamps.
40
+ *
41
+ * @public
42
+ */
43
+ type Component = {
44
+ id: string;
45
+ page_id: string;
46
+ group_id: null | string;
47
+ created_at: Date;
48
+ updated_at: Date;
49
+ group: boolean;
50
+ name: string;
51
+ description: null | string;
52
+ position: number;
53
+ status: ComponentStatus;
54
+ showcase: boolean;
55
+ only_show_if_degraded: boolean;
56
+ automation_email: string;
57
+ start_date: Date | null;
58
+ };
59
+ /**
60
+ * Enumerates the possible status values for a component or service,
61
+ * indicating its operational state.
62
+ *
63
+ * @public
64
+ */
65
+ type ComponentStatus = 'under_maintenance' | 'operational' | 'degraded_performance' | 'partial_outage' | 'major_outage';
66
+ /**
67
+ * Contains information about an update to an incident, including
68
+ * the update's status, content, and relevant timestamps.
69
+ *
70
+ * @public
71
+ */
72
+ type IncidentUpdate = {
73
+ status: string;
74
+ body: string;
75
+ created_at: Date;
76
+ wants_twitter_update: boolean;
77
+ twitter_updated_at: null;
78
+ updated_at: Date;
79
+ display_at: Date | null;
80
+ deliver_notifications: boolean;
81
+ tweet_id: null;
82
+ id: string;
83
+ incident_id: string;
84
+ custom_tweet: null;
85
+ affected_components: AffectedComponent[] | null;
86
+ };
87
+ /**
88
+ * Details a component affected by an incident, including its status
89
+ * before and after the incident.
90
+ *
91
+ * @public
92
+ */
93
+ type AffectedComponent = {
94
+ code: string;
95
+ name: string;
96
+ old_status: ComponentStatus;
97
+ new_status: ComponentStatus;
98
+ };
99
+ /**
100
+ * Status of an incident.
101
+ *
102
+ * @public
103
+ */
104
+ type IncidentStatus = 'completed' | 'resolved' | 'postmortem';
105
+ /**
106
+ * Type that describes an ComponentGroup.
107
+ *
108
+ * @public
109
+ */
110
+ type ComponentGroup = {
111
+ id: string;
112
+ page_id: string;
113
+ name: string;
114
+ description: null | string;
115
+ components: string[];
116
+ position: number;
117
+ created_at: Date;
118
+ updated_at: Date;
119
+ };
120
+
121
+ /**
122
+ * Annotation used by Entities that will embed statuspage.io components and
123
+ * component groups.
124
+ *
125
+ * @public
126
+ */
127
+ declare const STATUSPAGE_ANNOTATION = "statuspage.io/components";
128
+
129
+ export { AffectedComponent, Component, ComponentGroup, ComponentStatus, Incident, IncidentStatus, IncidentUpdate, STATUSPAGE_ANNOTATION };
@@ -0,0 +1,4 @@
1
+ const STATUSPAGE_ANNOTATION = "statuspage.io/components";
2
+
3
+ export { STATUSPAGE_ANNOTATION };
4
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":["../src/annotations.ts"],"sourcesContent":["/**\n * Annotation used by Entities that will embed statuspage.io components and\n * component groups.\n *\n * @public\n */\nexport const STATUSPAGE_ANNOTATION = 'statuspage.io/components';\n"],"names":[],"mappings":"AAMO,MAAM,qBAAwB,GAAA;;;;"}
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@axis-backstage/plugin-statuspage-common",
3
+ "description": "Common functionalities for the statuspage plugin",
4
+ "version": "0.2.0",
5
+ "main": "dist/index.cjs.js",
6
+ "types": "dist/index.d.ts",
7
+ "license": "Apache-2.0",
8
+ "publishConfig": {
9
+ "access": "public",
10
+ "main": "dist/index.cjs.js",
11
+ "module": "dist/index.esm.js",
12
+ "types": "dist/index.d.ts"
13
+ },
14
+ "backstage": {
15
+ "role": "common-library"
16
+ },
17
+ "sideEffects": false,
18
+ "scripts": {
19
+ "build": "backstage-cli package build",
20
+ "lint": "backstage-cli package lint",
21
+ "test": "backstage-cli package test",
22
+ "clean": "backstage-cli package clean",
23
+ "prepack": "backstage-cli package prepack",
24
+ "postpack": "backstage-cli package postpack"
25
+ },
26
+ "devDependencies": {
27
+ "@backstage/cli": "^0.25.1"
28
+ },
29
+ "files": [
30
+ "dist"
31
+ ],
32
+ "module": "dist/index.esm.js"
33
+ }