@eso-status/service-alerts 1.0.7 → 1.0.9
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/lib/classes/ServiceAlertsElement.d.ts +75 -75
- package/lib/classes/ServiceAlertsElement.js +173 -226
- package/lib/connectors/ServiceAlertConnector.d.ts +79 -79
- package/lib/connectors/ServiceAlertConnector.js +149 -198
- package/lib/index.d.ts +7 -7
- package/lib/index.js +24 -68
- package/package.json +27 -20
|
@@ -5,96 +5,96 @@ import { Support, Slug, Status, Type, Zone } from '@eso-status/types';
|
|
|
5
5
|
*/
|
|
6
6
|
export default class ServiceAlertsElement {
|
|
7
7
|
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
* Methode used to get slugs list of raw content
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
* @static
|
|
12
|
+
*
|
|
13
|
+
* @param rawData string Raw data
|
|
14
|
+
* @return Slug[] List of slug
|
|
15
|
+
*/
|
|
16
16
|
static getSlug(rawData: string): Slug[];
|
|
17
17
|
/**
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
* Methode used to determinate service type
|
|
19
|
+
*
|
|
20
|
+
* @public
|
|
21
|
+
* @static
|
|
22
|
+
*
|
|
23
|
+
* @param type Type Type to check
|
|
24
|
+
* @param rawData string Raw data
|
|
25
|
+
* @return boolean Check result
|
|
26
|
+
*/
|
|
27
27
|
static isType(type: Type, rawData: string): boolean;
|
|
28
28
|
/**
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
* Methode used to determinate service support
|
|
30
|
+
*
|
|
31
|
+
* @public
|
|
32
|
+
* @static
|
|
33
|
+
*
|
|
34
|
+
* @param support Support Support to check
|
|
35
|
+
* @param rawData string Raw data
|
|
36
|
+
* @return boolean Check result
|
|
37
|
+
*/
|
|
38
38
|
static isSupport(support: Support, rawData: string): boolean;
|
|
39
39
|
/**
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
40
|
+
* Methode used to determinate service zone
|
|
41
|
+
*
|
|
42
|
+
* @public
|
|
43
|
+
* @static
|
|
44
|
+
*
|
|
45
|
+
* @param zone Zone Zone to check
|
|
46
|
+
* @param rawData string Raw data
|
|
47
|
+
* @return boolean Check result
|
|
48
|
+
*/
|
|
49
49
|
static isZone(zone: Zone, rawData: string): boolean;
|
|
50
50
|
/**
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
51
|
+
* Methode used to get date of raw content
|
|
52
|
+
*
|
|
53
|
+
* @public
|
|
54
|
+
* @static
|
|
55
|
+
*
|
|
56
|
+
* @param rawDate string Raw data
|
|
57
|
+
* @return Moment Date of raw data
|
|
58
|
+
*/
|
|
59
59
|
static getDate(rawDate: string): Moment;
|
|
60
60
|
/**
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
61
|
+
* Methode used to get type of slug
|
|
62
|
+
*
|
|
63
|
+
* @public
|
|
64
|
+
* @static
|
|
65
|
+
*
|
|
66
|
+
* @param slug Slug Slug
|
|
67
|
+
* @return Type Type of slug
|
|
68
|
+
*/
|
|
69
69
|
static getType(slug: Slug): Type;
|
|
70
70
|
/**
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
71
|
+
* Methode used to get support of slug
|
|
72
|
+
*
|
|
73
|
+
* @public
|
|
74
|
+
* @static
|
|
75
|
+
*
|
|
76
|
+
* @param slug Slug Slug
|
|
77
|
+
* @return Support Support of slug
|
|
78
|
+
*/
|
|
79
79
|
static getSupport(slug: Slug): Support;
|
|
80
80
|
/**
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
81
|
+
* Methode used to get zone of slug
|
|
82
|
+
*
|
|
83
|
+
* @public
|
|
84
|
+
* @static
|
|
85
|
+
*
|
|
86
|
+
* @param slug Slug Slug
|
|
87
|
+
* @return Zone Zone of slug
|
|
88
|
+
*/
|
|
89
89
|
static getZone(slug: Slug): Zone;
|
|
90
90
|
/**
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
91
|
+
* Methode used to get status of raw data
|
|
92
|
+
*
|
|
93
|
+
* @public
|
|
94
|
+
* @static
|
|
95
|
+
*
|
|
96
|
+
* @param rawData string Raw data
|
|
97
|
+
* @return Status Status of raw data
|
|
98
|
+
*/
|
|
99
99
|
static getStatus(rawData: string): Status;
|
|
100
100
|
}
|
|
@@ -1,182 +1,131 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
6
|
+
const moment_1 = __importDefault(require("moment"));
|
|
7
|
+
const orderedSlugs = [
|
|
8
|
+
'server_pc_na',
|
|
9
|
+
'server_pc_eu',
|
|
10
|
+
'server_xbox_na',
|
|
11
|
+
'server_xbox_eu',
|
|
12
|
+
'server_ps_na',
|
|
13
|
+
'server_ps_eu',
|
|
14
|
+
'server_pc_pts',
|
|
15
|
+
'service_web_site',
|
|
16
|
+
'service_web_forum',
|
|
17
|
+
'service_store_crown',
|
|
18
|
+
'service_store_eso',
|
|
19
|
+
'service_system_account',
|
|
20
|
+
];
|
|
4
21
|
/**
|
|
5
22
|
* Class with methode for ServiceAlerts element
|
|
6
23
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-extraneous-class -- the published 1.x API exposes static methods, called as is by @eso-status/api 1.x
|
|
25
|
+
class ServiceAlertsElement {
|
|
10
26
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
slugs.push('server_pc_na');
|
|
25
|
-
}
|
|
26
|
-
if (ServiceAlertsElement.isType('server', rawData)
|
|
27
|
-
&& ServiceAlertsElement.isSupport('pc', rawData)
|
|
28
|
-
&& ServiceAlertsElement.isZone('eu', rawData)) {
|
|
29
|
-
slugs.push('server_pc_eu');
|
|
30
|
-
}
|
|
31
|
-
if (ServiceAlertsElement.isType('server', rawData)
|
|
32
|
-
&& ServiceAlertsElement.isSupport('xbox', rawData)
|
|
33
|
-
&& ServiceAlertsElement.isZone('na', rawData)) {
|
|
34
|
-
slugs.push('server_xbox_na');
|
|
35
|
-
}
|
|
36
|
-
if (ServiceAlertsElement.isType('server', rawData)
|
|
37
|
-
&& ServiceAlertsElement.isSupport('xbox', rawData)
|
|
38
|
-
&& ServiceAlertsElement.isZone('eu', rawData)) {
|
|
39
|
-
slugs.push('server_xbox_eu');
|
|
40
|
-
}
|
|
41
|
-
if (ServiceAlertsElement.isType('server', rawData)
|
|
42
|
-
&& ServiceAlertsElement.isSupport('ps', rawData)
|
|
43
|
-
&& ServiceAlertsElement.isZone('na', rawData)) {
|
|
44
|
-
slugs.push('server_ps_na');
|
|
45
|
-
}
|
|
46
|
-
if (ServiceAlertsElement.isType('server', rawData)
|
|
47
|
-
&& ServiceAlertsElement.isSupport('ps', rawData)
|
|
48
|
-
&& ServiceAlertsElement.isZone('eu', rawData)) {
|
|
49
|
-
slugs.push('server_ps_eu');
|
|
50
|
-
}
|
|
51
|
-
if (ServiceAlertsElement.isType('server', rawData)
|
|
52
|
-
&& ServiceAlertsElement.isSupport('pc', rawData)
|
|
53
|
-
&& ServiceAlertsElement.isZone('pts', rawData)) {
|
|
54
|
-
slugs.push('server_pc_pts');
|
|
55
|
-
}
|
|
56
|
-
if (ServiceAlertsElement.isType('service', rawData)
|
|
57
|
-
&& ServiceAlertsElement.isSupport('web', rawData)
|
|
58
|
-
&& ServiceAlertsElement.isZone('site', rawData)) {
|
|
59
|
-
slugs.push('service_web_site');
|
|
60
|
-
}
|
|
61
|
-
if (ServiceAlertsElement.isType('service', rawData)
|
|
62
|
-
&& ServiceAlertsElement.isSupport('web', rawData)
|
|
63
|
-
&& ServiceAlertsElement.isZone('forum', rawData)) {
|
|
64
|
-
slugs.push('service_web_forum');
|
|
65
|
-
}
|
|
66
|
-
if (ServiceAlertsElement.isType('service', rawData)
|
|
67
|
-
&& ServiceAlertsElement.isSupport('store', rawData)
|
|
68
|
-
&& ServiceAlertsElement.isZone('crown', rawData)) {
|
|
69
|
-
slugs.push('service_store_crown');
|
|
70
|
-
}
|
|
71
|
-
if (ServiceAlertsElement.isType('service', rawData)
|
|
72
|
-
&& ServiceAlertsElement.isSupport('store', rawData)
|
|
73
|
-
&& ServiceAlertsElement.isZone('eso', rawData)) {
|
|
74
|
-
slugs.push('service_store_eso');
|
|
75
|
-
}
|
|
76
|
-
if (ServiceAlertsElement.isType('service', rawData)
|
|
77
|
-
&& ServiceAlertsElement.isSupport('system', rawData)
|
|
78
|
-
&& ServiceAlertsElement.isZone('account', rawData)) {
|
|
79
|
-
slugs.push('service_system_account');
|
|
80
|
-
}
|
|
81
|
-
return slugs;
|
|
82
|
-
};
|
|
27
|
+
* Methode used to get slugs list of raw content
|
|
28
|
+
*
|
|
29
|
+
* @public
|
|
30
|
+
* @static
|
|
31
|
+
*
|
|
32
|
+
* @param rawData string Raw data
|
|
33
|
+
* @return Slug[] List of slug
|
|
34
|
+
*/
|
|
35
|
+
static getSlug(rawData) {
|
|
36
|
+
return orderedSlugs.filter((slug) => ServiceAlertsElement.isType(ServiceAlertsElement.getType(slug), rawData) &&
|
|
37
|
+
ServiceAlertsElement.isSupport(ServiceAlertsElement.getSupport(slug), rawData) &&
|
|
38
|
+
ServiceAlertsElement.isZone(ServiceAlertsElement.getZone(slug), rawData));
|
|
39
|
+
}
|
|
83
40
|
/**
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
41
|
+
* Methode used to determinate service type
|
|
42
|
+
*
|
|
43
|
+
* @public
|
|
44
|
+
* @static
|
|
45
|
+
*
|
|
46
|
+
* @param type Type Type to check
|
|
47
|
+
* @param rawData string Raw data
|
|
48
|
+
* @return boolean Check result
|
|
49
|
+
*/
|
|
50
|
+
static isType(type, rawData) {
|
|
94
51
|
if (type === 'server') {
|
|
95
|
-
return rawData.includes('megaserver')
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
return false;
|
|
110
|
-
};
|
|
52
|
+
return (rawData.includes('megaserver') ||
|
|
53
|
+
rawData.includes('PlayStation™ Network') ||
|
|
54
|
+
rawData.includes('Xbox Live™') ||
|
|
55
|
+
rawData.includes('PTS'));
|
|
56
|
+
}
|
|
57
|
+
return (rawData.includes('Website') ||
|
|
58
|
+
rawData.includes('Forums') ||
|
|
59
|
+
rawData.includes('Crown Store') ||
|
|
60
|
+
rawData.includes('ESO store') ||
|
|
61
|
+
rawData.includes('ESO Store') ||
|
|
62
|
+
rawData.includes('account system') ||
|
|
63
|
+
rawData.includes('Account System'));
|
|
64
|
+
}
|
|
111
65
|
/**
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
66
|
+
* Methode used to determinate service support
|
|
67
|
+
*
|
|
68
|
+
* @public
|
|
69
|
+
* @static
|
|
70
|
+
*
|
|
71
|
+
* @param support Support Support to check
|
|
72
|
+
* @param rawData string Raw data
|
|
73
|
+
* @return boolean Check result
|
|
74
|
+
*/
|
|
75
|
+
static isSupport(support, rawData) {
|
|
122
76
|
if (support === 'xbox') {
|
|
123
|
-
return rawData.includes('Xbox')
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
77
|
+
return (rawData.includes('Xbox') ||
|
|
78
|
+
rawData.includes('European megaservers') ||
|
|
79
|
+
rawData.includes('American megaservers') ||
|
|
80
|
+
rawData.includes('the megaservers'));
|
|
127
81
|
}
|
|
128
82
|
if (support === 'ps') {
|
|
129
|
-
return rawData.includes('PlayStation')
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
83
|
+
return (rawData.includes('PlayStation') ||
|
|
84
|
+
rawData.includes('European megaservers') ||
|
|
85
|
+
rawData.includes('American megaservers') ||
|
|
86
|
+
rawData.includes('the megaservers'));
|
|
133
87
|
}
|
|
134
88
|
if (support === 'pc') {
|
|
135
|
-
return rawData.includes('PC/Mac')
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
89
|
+
return (rawData.includes('PC/Mac') ||
|
|
90
|
+
rawData.includes('PTS') ||
|
|
91
|
+
rawData.includes('European megaservers') ||
|
|
92
|
+
rawData.includes('American megaservers') ||
|
|
93
|
+
rawData.includes('the megaservers'));
|
|
140
94
|
}
|
|
141
95
|
if (support === 'web') {
|
|
142
|
-
return rawData.includes('Website')
|
|
143
|
-
|| rawData.includes('Forums');
|
|
96
|
+
return rawData.includes('Website') || rawData.includes('Forums');
|
|
144
97
|
}
|
|
145
98
|
if (support === 'store') {
|
|
146
|
-
return rawData.includes('Crown Store')
|
|
147
|
-
|
|
148
|
-
|
|
99
|
+
return (rawData.includes('Crown Store') ||
|
|
100
|
+
rawData.includes('ESO store') ||
|
|
101
|
+
rawData.includes('ESO Store'));
|
|
149
102
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|| rawData.includes('Account System');
|
|
153
|
-
}
|
|
154
|
-
return false;
|
|
155
|
-
};
|
|
103
|
+
return (rawData.includes('account system') || rawData.includes('Account System'));
|
|
104
|
+
}
|
|
156
105
|
/**
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
106
|
+
* Methode used to determinate service zone
|
|
107
|
+
*
|
|
108
|
+
* @public
|
|
109
|
+
* @static
|
|
110
|
+
*
|
|
111
|
+
* @param zone Zone Zone to check
|
|
112
|
+
* @param rawData string Raw data
|
|
113
|
+
* @return boolean Check result
|
|
114
|
+
*/
|
|
115
|
+
static isZone(zone, rawData) {
|
|
167
116
|
if (zone === 'na') {
|
|
168
|
-
return rawData.includes('North American')
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
117
|
+
return (rawData.includes('North American') ||
|
|
118
|
+
rawData.includes('PlayStation™ Network') ||
|
|
119
|
+
rawData.includes('Xbox Live™') ||
|
|
120
|
+
rawData.includes('the megaservers') ||
|
|
121
|
+
rawData.includes('North American and European'));
|
|
173
122
|
}
|
|
174
123
|
if (zone === 'eu') {
|
|
175
|
-
return rawData.includes('European')
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
124
|
+
return (rawData.includes('European') ||
|
|
125
|
+
rawData.includes('PlayStation™ Network') ||
|
|
126
|
+
rawData.includes('Xbox Live™') ||
|
|
127
|
+
rawData.includes('the megaservers') ||
|
|
128
|
+
rawData.includes('North American and European'));
|
|
180
129
|
}
|
|
181
130
|
if (zone === 'pts') {
|
|
182
131
|
return rawData.includes('PTS');
|
|
@@ -191,94 +140,92 @@ var ServiceAlertsElement = /** @class */ (function () {
|
|
|
191
140
|
return rawData.includes('Crown Store');
|
|
192
141
|
}
|
|
193
142
|
if (zone === 'eso') {
|
|
194
|
-
return rawData.includes('ESO store')
|
|
195
|
-
|| rawData.includes('ESO Store');
|
|
196
|
-
}
|
|
197
|
-
if (zone === 'account') {
|
|
198
|
-
return rawData.includes('account system')
|
|
199
|
-
|| rawData.includes('Account System');
|
|
143
|
+
return rawData.includes('ESO store') || rawData.includes('ESO Store');
|
|
200
144
|
}
|
|
201
|
-
return
|
|
202
|
-
}
|
|
145
|
+
return (rawData.includes('account system') || rawData.includes('Account System'));
|
|
146
|
+
}
|
|
203
147
|
/**
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
return
|
|
148
|
+
* Methode used to get date of raw content
|
|
149
|
+
*
|
|
150
|
+
* @public
|
|
151
|
+
* @static
|
|
152
|
+
*
|
|
153
|
+
* @param rawDate string Raw data
|
|
154
|
+
* @return Moment Date of raw data
|
|
155
|
+
*/
|
|
156
|
+
static getDate(rawDate) {
|
|
157
|
+
const dateTime = /(\d{4}).(\d{2}).(\d{2}) - (\d{1,2}):(\d{2})/.exec(rawDate);
|
|
158
|
+
return ((0, moment_1.default)()
|
|
215
159
|
.utc()
|
|
216
|
-
.set('years',
|
|
217
|
-
|
|
218
|
-
.set('
|
|
219
|
-
.set('
|
|
220
|
-
.set('
|
|
160
|
+
.set('years', dateTime && dateTime.length >= 1 ? Number(dateTime[1]) : 0)
|
|
161
|
+
// moment counts months from 0, the raw date from 1
|
|
162
|
+
.set('months', dateTime && dateTime.length >= 1 ? Number(dateTime[2]) - 1 : 0)
|
|
163
|
+
.set('date', dateTime && dateTime.length >= 1 ? Number(dateTime[3]) : 0)
|
|
164
|
+
.set('hours', dateTime && dateTime.length >= 1 ? Number(dateTime[4]) : 0)
|
|
165
|
+
.set('minutes', dateTime && dateTime.length >= 1 ? Number(dateTime[5]) : 0)
|
|
221
166
|
.set('seconds', 0)
|
|
222
167
|
.set('milliseconds', 0)
|
|
223
|
-
.utcOffset(0);
|
|
224
|
-
}
|
|
168
|
+
.utcOffset(0));
|
|
169
|
+
}
|
|
225
170
|
/**
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
171
|
+
* Methode used to get type of slug
|
|
172
|
+
*
|
|
173
|
+
* @public
|
|
174
|
+
* @static
|
|
175
|
+
*
|
|
176
|
+
* @param slug Slug Slug
|
|
177
|
+
* @return Type Type of slug
|
|
178
|
+
*/
|
|
179
|
+
static getType(slug) {
|
|
235
180
|
return slug.split('_')[0];
|
|
236
|
-
}
|
|
181
|
+
}
|
|
237
182
|
/**
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
183
|
+
* Methode used to get support of slug
|
|
184
|
+
*
|
|
185
|
+
* @public
|
|
186
|
+
* @static
|
|
187
|
+
*
|
|
188
|
+
* @param slug Slug Slug
|
|
189
|
+
* @return Support Support of slug
|
|
190
|
+
*/
|
|
191
|
+
static getSupport(slug) {
|
|
247
192
|
return slug.split('_')[1];
|
|
248
|
-
}
|
|
193
|
+
}
|
|
249
194
|
/**
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
195
|
+
* Methode used to get zone of slug
|
|
196
|
+
*
|
|
197
|
+
* @public
|
|
198
|
+
* @static
|
|
199
|
+
*
|
|
200
|
+
* @param slug Slug Slug
|
|
201
|
+
* @return Zone Zone of slug
|
|
202
|
+
*/
|
|
203
|
+
static getZone(slug) {
|
|
259
204
|
return slug.split('_')[2];
|
|
260
|
-
}
|
|
205
|
+
}
|
|
261
206
|
/**
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
207
|
+
* Methode used to get status of raw data
|
|
208
|
+
*
|
|
209
|
+
* @public
|
|
210
|
+
* @static
|
|
211
|
+
*
|
|
212
|
+
* @param rawData string Raw data
|
|
213
|
+
* @return Status Status of raw data
|
|
214
|
+
*/
|
|
215
|
+
static getStatus(rawData) {
|
|
271
216
|
if (rawData.includes('unavailable')) {
|
|
272
217
|
return 'down';
|
|
273
218
|
}
|
|
274
|
-
if (rawData.includes('available') ||
|
|
219
|
+
if (rawData.includes('available') ||
|
|
220
|
+
rawData.includes('online') ||
|
|
221
|
+
rawData.includes('resolved')) {
|
|
275
222
|
return 'up';
|
|
276
223
|
}
|
|
277
|
-
if (rawData.includes('currently investigating') ||
|
|
224
|
+
if (rawData.includes('currently investigating') ||
|
|
225
|
+
rawData.includes('interruption')) {
|
|
278
226
|
return 'issues';
|
|
279
227
|
}
|
|
280
228
|
return 'down';
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
}());
|
|
229
|
+
}
|
|
230
|
+
}
|
|
284
231
|
exports.default = ServiceAlertsElement;
|