@eso-status/service-alerts 1.0.8 → 2.0.0-dev.1
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/LICENSE.md +1 -1
- package/README.md +109 -204
- package/lib/connector.d.ts +65 -0
- package/lib/connector.js +123 -0
- package/lib/const.d.ts +6 -0
- package/lib/const.js +8 -0
- package/lib/formatter/date.formatter.d.ts +19 -0
- package/lib/formatter/date.formatter.js +32 -0
- package/lib/identifier/slug.identifier.d.ts +89 -0
- package/lib/identifier/slug.identifier.js +140 -0
- package/lib/identifier/slug.match.d.ts +26 -0
- package/lib/identifier/slug.match.js +35 -0
- package/lib/identifier/status.identifier.d.ts +58 -0
- package/lib/identifier/status.identifier.js +74 -0
- package/lib/index.d.ts +6 -11
- package/lib/index.js +11 -72
- package/lib/interface/esoStatusRawData.interface.d.ts +54 -0
- package/lib/interface/esoStatusRawData.interface.js +3 -0
- package/lib/raw.d.ts +39 -0
- package/lib/raw.js +52 -0
- package/lib/type/remoteDownRawStatus.type.d.ts +4 -0
- package/lib/type/remoteDownRawStatus.type.js +3 -0
- package/lib/type/remoteIssuesRawStatus.type.d.ts +4 -0
- package/lib/type/remoteIssuesRawStatus.type.js +3 -0
- package/lib/type/remoteRawSlug.type.d.ts +13 -0
- package/lib/type/remoteRawSlug.type.js +3 -0
- package/lib/type/remoteRawStatus.type.d.ts +7 -0
- package/lib/type/remoteRawStatus.type.js +3 -0
- package/lib/type/remoteServerPcEuRawSlug.type.d.ts +4 -0
- package/lib/type/remoteServerPcEuRawSlug.type.js +3 -0
- package/lib/type/remoteServerPcNaRawSlug.type.d.ts +4 -0
- package/lib/type/remoteServerPcNaRawSlug.type.js +3 -0
- package/lib/type/remoteServerPcPtsRawSlug.type.d.ts +4 -0
- package/lib/type/remoteServerPcPtsRawSlug.type.js +3 -0
- package/lib/type/remoteServerPsEuRawSlug.type.d.ts +4 -0
- package/lib/type/remoteServerPsEuRawSlug.type.js +3 -0
- package/lib/type/remoteServerPsNaRawSlug.type.d.ts +4 -0
- package/lib/type/remoteServerPsNaRawSlug.type.js +3 -0
- package/lib/type/remoteServerXboxEuRawSlug.type.d.ts +4 -0
- package/lib/type/remoteServerXboxEuRawSlug.type.js +3 -0
- package/lib/type/remoteServerXboxNaRawSlug.type.d.ts +4 -0
- package/lib/type/remoteServerXboxNaRawSlug.type.js +3 -0
- package/lib/type/remoteServiceStoreEsoRawSlug.type.d.ts +4 -0
- package/lib/type/remoteServiceStoreEsoRawSlug.type.js +3 -0
- package/lib/type/remoteServiceSystemAccountRawSlug.type.d.ts +4 -0
- package/lib/type/remoteServiceSystemAccountRawSlug.type.js +3 -0
- package/lib/type/remoteUpRawStatus.type.d.ts +4 -0
- package/lib/type/remoteUpRawStatus.type.js +3 -0
- package/lib/type/sourceUrl.type.d.ts +4 -0
- package/lib/type/sourceUrl.type.js +3 -0
- package/package.json +107 -36
- package/lib/classes/ServiceAlertsElement.d.ts +0 -100
- package/lib/classes/ServiceAlertsElement.js +0 -284
- package/lib/connectors/ServiceAlertConnector.d.ts +0 -112
- package/lib/connectors/ServiceAlertConnector.js +0 -263
package/LICENSE.md
CHANGED
package/README.md
CHANGED
|
@@ -1,254 +1,159 @@
|
|
|
1
1
|
# eso-status/service-alerts
|
|
2
|
+
|
|
3
|
+
[](https://sonarcloud.io/summary/new_code?id=eso-status_service-alerts)
|
|
4
|
+
[](https://sonarcloud.io/summary/new_code?id=eso-status_service-alerts)
|
|
5
|
+
[](https://sonarcloud.io/summary/new_code?id=eso-status_service-alerts)
|
|
6
|
+
[](https://sonarcloud.io/summary/new_code?id=eso-status_service-alerts)
|
|
7
|
+
[](https://sonarcloud.io/summary/new_code?id=eso-status_service-alerts)
|
|
8
|
+
[](https://sonarcloud.io/summary/new_code?id=eso-status_service-alerts)
|
|
9
|
+
[](https://sonarcloud.io/summary/new_code?id=eso-status_service-alerts)
|
|
10
|
+
|
|
2
11
|
[](https://www.npmjs.com/package/@eso-status/service-alerts)
|
|
3
12
|
[](https://github.com/eso-status/service-alerts/blob/master/LICENSE.md)
|
|
4
13
|
<img src="https://img.shields.io/npm/dt/@eso-status/service-alerts" alt="Downloads" />
|
|
5
|
-
[](https://lgtm.com/projects/g/eso-status/service-alerts/context:javascript)
|
|
6
14
|
<img src="https://img.shields.io/node/v/@eso-status/service-alerts" alt="Node version" />
|
|
15
|
+
|
|
7
16
|
[](https://github.com/eso-status/service-alerts/actions/workflows/CI.yaml)
|
|
8
|
-
[](https://github.com/eso-status/service-alerts/actions/workflows/CD.yaml)
|
|
9
18
|
|
|
10
|
-
eso-status/service-alerts is a library for
|
|
19
|
+
eso-status/service-alerts is a library for retrieving and formatting data, which can be found at [https://help.elderscrollsonline.com/app/answers/detail/a_id/4320](https://help.elderscrollsonline.com/app/answers/detail/a_id/4320).
|
|
11
20
|
|
|
12
21
|
## Table of Contents
|
|
13
|
-
- [
|
|
14
|
-
- [
|
|
15
|
-
- [
|
|
22
|
+
- [Install](#install)
|
|
23
|
+
- [Usage](#usage)
|
|
24
|
+
- [Return exemple](#return-exemple)
|
|
16
25
|
|
|
17
|
-
###
|
|
26
|
+
### Install
|
|
18
27
|
```shell
|
|
19
28
|
npm i @eso-status/service-alerts
|
|
20
29
|
```
|
|
21
30
|
|
|
22
|
-
###
|
|
23
|
-
- TypeScript
|
|
24
|
-
```typescript
|
|
25
|
-
import { RawEsoStatus } from '@eso-status/types';
|
|
26
|
-
import { ServiceAlerts } from "@eso-status/service-alerts";
|
|
27
|
-
|
|
28
|
-
ServiceAlerts.getData().then((data: RawEsoStatus[]): void => {
|
|
29
|
-
|
|
30
|
-
}).catch((error: Error): void => {
|
|
31
|
-
|
|
32
|
-
});
|
|
33
|
-
```
|
|
34
|
-
- JavaScript
|
|
31
|
+
### Usage
|
|
35
32
|
```javascript
|
|
36
|
-
|
|
33
|
+
import ServiceAlerts from '@eso-status/service-alerts';
|
|
34
|
+
import { EsoStatusRawData } from '@eso-status/types';
|
|
37
35
|
|
|
38
|
-
ServiceAlerts.getData()
|
|
39
|
-
|
|
40
|
-
}).catch(function (error) {
|
|
41
|
-
|
|
42
|
-
});
|
|
36
|
+
const esoStatusRawDataList: EsoStatusRawData[] = await ServiceAlerts.getData();
|
|
43
37
|
```
|
|
44
|
-
|
|
45
|
-
### Returned data format ?
|
|
38
|
+
### Return exemple
|
|
46
39
|
```text
|
|
47
40
|
[
|
|
48
41
|
{
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
]
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
42
|
+
source: 'https://help.elderscrollsonline.com/app/answers/detail/a_id/4320',
|
|
43
|
+
raw: '2024.09.04 - 14:00 UTC (10:00 EDT) The ESO store and account system are currently unavailable while we perform maintenance.',
|
|
44
|
+
slug: 'service_store_eso',
|
|
45
|
+
type: 'service',
|
|
46
|
+
support: 'store',
|
|
47
|
+
zone: 'eso',
|
|
48
|
+
status: 'down',
|
|
49
|
+
rawStatus: 'currently unavailable',
|
|
50
|
+
rawSlug: 'ESO store',
|
|
51
|
+
rawDate: '2024.09.04 - 14:00 UTC (10:00 EDT)',
|
|
52
|
+
dates: [ Moment<2024-09-04T14:00:00Z> ]
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
source: 'https://help.elderscrollsonline.com/app/answers/detail/a_id/4320',
|
|
56
|
+
raw: '2024.09.04 - 14:00 UTC (10:00 EDT) The ESO store and account system are currently unavailable while we perform maintenance.',
|
|
57
|
+
slug: 'service_system_account',
|
|
58
|
+
type: 'service',
|
|
59
|
+
support: 'system',
|
|
60
|
+
zone: 'account',
|
|
61
|
+
status: 'down',
|
|
62
|
+
rawStatus: 'currently unavailable',
|
|
63
|
+
rawSlug: 'account system',
|
|
64
|
+
rawDate: '2024.09.04 - 14:00 UTC (10:00 EDT)',
|
|
65
|
+
dates: [ Moment<2024-09-04T14:00:00Z> ]
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
source: 'https://help.elderscrollsonline.com/app/answers/detail/a_id/4320',
|
|
69
|
+
raw: '2024.09.04 - 10:00 UTC (6:00 EDT) The North American Xbox megaserver is currently unavailable while we perform maintenance. The European Xbox megaserver is currently unavailable while we perform maintenance. The North American PlayStation® megaserver is currently unavailable while we perform maintenance. The European PlayStation® megaserver is currently unavailable while we perform maintenance.',
|
|
70
|
+
slug: 'server_ps_eu',
|
|
64
71
|
type: 'server',
|
|
65
|
-
support: '
|
|
66
|
-
zone: '
|
|
67
|
-
status: '
|
|
72
|
+
support: 'ps',
|
|
73
|
+
zone: 'eu',
|
|
74
|
+
status: 'down',
|
|
75
|
+
rawStatus: 'currently unavailable',
|
|
76
|
+
rawSlug: 'The European PlayStation® megaserver',
|
|
77
|
+
rawDate: '2024.09.04 - 10:00 UTC (6:00 EDT)',
|
|
78
|
+
dates: [ Moment<2024-09-04T10:00:00Z> ]
|
|
68
79
|
},
|
|
69
80
|
{
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
raw: [
|
|
74
|
-
'<div><!-- ENTER ESO SERVICE ALERTS BELOW THIS LINE -->\n' +
|
|
75
|
-
'<p>2021.08.25 - 12:00 UTC (8:00 EDT)</p>\n' +
|
|
76
|
-
'<p>The North American Xbox megaserver is currently available.</p>\n' +
|
|
77
|
-
'<p>The European Xbox megaserver is currently available.</p>\n' +
|
|
78
|
-
'<p>The North American PlayStation® megaserver is currently available.</p>\n' +
|
|
79
|
-
'<p>The European PlayStation® megaserver is currently available.</p>\n'
|
|
80
|
-
],
|
|
81
|
-
rawDate: '2021.08.25 - 12:00 UTC (8:00 EDT)',
|
|
82
|
-
rawData: 'The European Xbox megaserver is currently available.',
|
|
83
|
-
slugs: [ 'server_xbox_eu' ],
|
|
84
|
-
dates: [ Moment<2021-09-25T12:00:00Z> ],
|
|
81
|
+
source: 'https://help.elderscrollsonline.com/app/answers/detail/a_id/4320',
|
|
82
|
+
raw: '2024.09.04 - 10:00 UTC (6:00 EDT) The North American Xbox megaserver is currently unavailable while we perform maintenance. The European Xbox megaserver is currently unavailable while we perform maintenance. The North American PlayStation® megaserver is currently unavailable while we perform maintenance. The European PlayStation® megaserver is currently unavailable while we perform maintenance.',
|
|
83
|
+
slug: 'server_xbox_eu',
|
|
85
84
|
type: 'server',
|
|
86
85
|
support: 'xbox',
|
|
87
86
|
zone: 'eu',
|
|
88
|
-
status: '
|
|
87
|
+
status: 'down',
|
|
88
|
+
rawStatus: 'currently unavailable',
|
|
89
|
+
rawSlug: 'The European Xbox megaserver',
|
|
90
|
+
rawDate: '2024.09.04 - 10:00 UTC (6:00 EDT)',
|
|
91
|
+
dates: [ Moment<2024-09-04T10:00:00Z> ]
|
|
89
92
|
},
|
|
90
93
|
{
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
raw: [
|
|
95
|
-
'<div><!-- ENTER ESO SERVICE ALERTS BELOW THIS LINE -->\n' +
|
|
96
|
-
'<p>2021.08.25 - 12:00 UTC (8:00 EDT)</p>\n' +
|
|
97
|
-
'<p>The North American Xbox megaserver is currently available.</p>\n' +
|
|
98
|
-
'<p>The European Xbox megaserver is currently available.</p>\n' +
|
|
99
|
-
'<p>The North American PlayStation® megaserver is currently available.</p>\n' +
|
|
100
|
-
'<p>The European PlayStation® megaserver is currently available.</p>\n'
|
|
101
|
-
],
|
|
102
|
-
rawDate: '2021.08.25 - 12:00 UTC (8:00 EDT)',
|
|
103
|
-
rawData: 'The North American PlayStation® megaserver is currently available.',
|
|
104
|
-
slugs: [ 'server_ps_na' ],
|
|
105
|
-
dates: [ Moment<2021-09-25T12:00:00Z> ],
|
|
94
|
+
source: 'https://help.elderscrollsonline.com/app/answers/detail/a_id/4320',
|
|
95
|
+
raw: '2024.09.04 - 10:00 UTC (6:00 EDT) The North American Xbox megaserver is currently unavailable while we perform maintenance. The European Xbox megaserver is currently unavailable while we perform maintenance. The North American PlayStation® megaserver is currently unavailable while we perform maintenance. The European PlayStation® megaserver is currently unavailable while we perform maintenance.',
|
|
96
|
+
slug: 'server_ps_na',
|
|
106
97
|
type: 'server',
|
|
107
98
|
support: 'ps',
|
|
108
99
|
zone: 'na',
|
|
109
|
-
status: '
|
|
100
|
+
status: 'down',
|
|
101
|
+
rawStatus: 'currently unavailable',
|
|
102
|
+
rawSlug: 'North American PlayStation® megaserver',
|
|
103
|
+
rawDate: '2024.09.04 - 10:00 UTC (6:00 EDT)',
|
|
104
|
+
dates: [ Moment<2024-09-04T10:00:00Z> ]
|
|
110
105
|
},
|
|
111
106
|
{
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
raw: [
|
|
116
|
-
'<div><!-- ENTER ESO SERVICE ALERTS BELOW THIS LINE -->\n' +
|
|
117
|
-
'<p>2021.08.25 - 12:00 UTC (8:00 EDT)</p>\n' +
|
|
118
|
-
'<p>The North American Xbox megaserver is currently available.</p>\n' +
|
|
119
|
-
'<p>The European Xbox megaserver is currently available.</p>\n' +
|
|
120
|
-
'<p>The North American PlayStation® megaserver is currently available.</p>\n' +
|
|
121
|
-
'<p>The European PlayStation® megaserver is currently available.</p>\n'
|
|
122
|
-
],
|
|
123
|
-
rawDate: '2021.08.25 - 12:00 UTC (8:00 EDT)',
|
|
124
|
-
rawData: 'The European PlayStation® megaserver is currently available.',
|
|
125
|
-
slugs: [ 'server_ps_eu' ],
|
|
126
|
-
dates: [ Moment<2021-09-25T12:00:00Z> ],
|
|
107
|
+
source: 'https://help.elderscrollsonline.com/app/answers/detail/a_id/4320',
|
|
108
|
+
raw: '2024.09.04 - 10:00 UTC (6:00 EDT) The North American Xbox megaserver is currently unavailable while we perform maintenance. The European Xbox megaserver is currently unavailable while we perform maintenance. The North American PlayStation® megaserver is currently unavailable while we perform maintenance. The European PlayStation® megaserver is currently unavailable while we perform maintenance.',
|
|
109
|
+
slug: 'server_xbox_na',
|
|
127
110
|
type: 'server',
|
|
128
|
-
support: '
|
|
129
|
-
zone: '
|
|
130
|
-
status: '
|
|
111
|
+
support: 'xbox',
|
|
112
|
+
zone: 'na',
|
|
113
|
+
status: 'down',
|
|
114
|
+
rawStatus: 'currently unavailable',
|
|
115
|
+
rawSlug: 'The North American Xbox megaserver',
|
|
116
|
+
rawDate: '2024.09.04 - 10:00 UTC (6:00 EDT)',
|
|
117
|
+
dates: [ Moment<2024-09-04T10:00:00Z> ]
|
|
131
118
|
},
|
|
132
119
|
{
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
raw: [
|
|
137
|
-
'\n' +
|
|
138
|
-
'\n' +
|
|
139
|
-
'<p>2021.08.24 - 9:45 UTC (5:45 EDT)</p>\n' +
|
|
140
|
-
'<p>The North American PC/Mac megaserver is currently available.</p>\n' +
|
|
141
|
-
'<p>The European PC/Mac megaserver is currently available.</p>\n'
|
|
142
|
-
],
|
|
143
|
-
rawDate: '2021.08.24 - 9:45 UTC (5:45 EDT)',
|
|
144
|
-
rawData: 'The North American PC/Mac megaserver is currently available.',
|
|
145
|
-
slugs: [ 'server_pc_na' ],
|
|
146
|
-
dates: [ Moment<2021-09-24T09:45:00Z> ],
|
|
120
|
+
source: 'https://help.elderscrollsonline.com/app/answers/detail/a_id/4320',
|
|
121
|
+
raw: '2024.09.03 - 10:55 UTC (6:55 EDT) The North American PC/Mac megaserver is currently available. The European PC/Mac megaserver is currently available.',
|
|
122
|
+
slug: 'server_pc_eu',
|
|
147
123
|
type: 'server',
|
|
148
124
|
support: 'pc',
|
|
149
|
-
zone: '
|
|
150
|
-
status: 'up'
|
|
125
|
+
zone: 'eu',
|
|
126
|
+
status: 'up',
|
|
127
|
+
rawStatus: 'currently available',
|
|
128
|
+
rawSlug: 'The European PC/Mac megaserver',
|
|
129
|
+
rawDate: '2024.09.03 - 10:55 UTC (6:55 EDT)',
|
|
130
|
+
dates: [ Moment<2024-09-03T10:55:00Z> ]
|
|
151
131
|
},
|
|
152
132
|
{
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
raw: [
|
|
157
|
-
'\n' +
|
|
158
|
-
'\n' +
|
|
159
|
-
'<p>2021.08.24 - 9:45 UTC (5:45 EDT)</p>\n' +
|
|
160
|
-
'<p>The North American PC/Mac megaserver is currently available.</p>\n' +
|
|
161
|
-
'<p>The European PC/Mac megaserver is currently available.</p>\n'
|
|
162
|
-
],
|
|
163
|
-
rawDate: '2021.08.24 - 9:45 UTC (5:45 EDT)',
|
|
164
|
-
rawData: 'The European PC/Mac megaserver is currently available.',
|
|
165
|
-
slugs: [ 'server_pc_eu' ],
|
|
166
|
-
dates: [ Moment<2021-09-24T09:45:00Z> ],
|
|
133
|
+
source: 'https://help.elderscrollsonline.com/app/answers/detail/a_id/4320',
|
|
134
|
+
raw: '2024.09.03 - 10:55 UTC (6:55 EDT) The North American PC/Mac megaserver is currently available. The European PC/Mac megaserver is currently available.',
|
|
135
|
+
slug: 'server_pc_na',
|
|
167
136
|
type: 'server',
|
|
168
137
|
support: 'pc',
|
|
169
|
-
zone: '
|
|
170
|
-
status: 'up'
|
|
138
|
+
zone: 'na',
|
|
139
|
+
status: 'up',
|
|
140
|
+
rawStatus: 'currently available',
|
|
141
|
+
rawSlug: 'The North American PC/Mac megaserver',
|
|
142
|
+
rawDate: '2024.09.03 - 10:55 UTC (6:55 EDT)',
|
|
143
|
+
dates: [ Moment<2024-09-03T10:55:00Z> ]
|
|
171
144
|
},
|
|
172
145
|
{
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
raw: [
|
|
177
|
-
'\n' +
|
|
178
|
-
'\n' +
|
|
179
|
-
'<p>2021.08.16 - 21:00 UTC (17:00 EDT)</p>\n' +
|
|
180
|
-
'<p>The PTS is currently available.</p>\n'
|
|
181
|
-
],
|
|
182
|
-
rawDate: '2021.08.16 - 21:00 UTC (17:00 EDT)',
|
|
183
|
-
rawData: 'The PTS is currently available.',
|
|
184
|
-
slugs: [ 'server_pc_pts' ],
|
|
185
|
-
dates: [ Moment<2021-09-16T21:00:00Z> ],
|
|
146
|
+
source: 'https://help.elderscrollsonline.com/app/answers/detail/a_id/4320',
|
|
147
|
+
raw: ' 2024.08.27 - 14:40 UTC (10:40 EDT) The PTS is currently available.',
|
|
148
|
+
slug: 'server_pc_pts',
|
|
186
149
|
type: 'server',
|
|
187
150
|
support: 'pc',
|
|
188
151
|
zone: 'pts',
|
|
189
|
-
status: 'up'
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
],
|
|
195
|
-
raw: [
|
|
196
|
-
'\n' +
|
|
197
|
-
' \n' +
|
|
198
|
-
'<p>2021.08.12 - 14:45 UTC (10:45 EDT)</p>\n' +
|
|
199
|
-
'\n' +
|
|
200
|
-
'<p>The ESO store and account system are currently available.</p>\n' +
|
|
201
|
-
'\n'
|
|
202
|
-
],
|
|
203
|
-
rawDate: ' 2021.08.12 - 14:45 UTC (10:45 EDT)',
|
|
204
|
-
rawData: 'The ESO store and account system are currently available.',
|
|
205
|
-
slugs: [ 'service_store_eso' ],
|
|
206
|
-
dates: [ Moment<2021-09-12T14:45:00Z> ],
|
|
207
|
-
type: 'service',
|
|
208
|
-
support: 'store',
|
|
209
|
-
zone: 'eso',
|
|
210
|
-
status: 'up'
|
|
211
|
-
},
|
|
212
|
-
{
|
|
213
|
-
sources: [
|
|
214
|
-
'https://help.elderscrollsonline.com/app/answers/detail/a_id/4320'
|
|
215
|
-
],
|
|
216
|
-
raw: [
|
|
217
|
-
'\n' +
|
|
218
|
-
' \n' +
|
|
219
|
-
'<p>2021.08.12 - 14:45 UTC (10:45 EDT)</p>\n' +
|
|
220
|
-
'\n' +
|
|
221
|
-
'<p>The ESO store and account system are currently available.</p>\n' +
|
|
222
|
-
'\n'
|
|
223
|
-
],
|
|
224
|
-
rawDate: ' 2021.08.12 - 14:45 UTC (10:45 EDT)',
|
|
225
|
-
rawData: 'The ESO store and account system are currently available.',
|
|
226
|
-
slugs: [ 'service_system_account' ],
|
|
227
|
-
dates: [ Moment<2021-09-12T14:45:00Z> ],
|
|
228
|
-
type: 'service',
|
|
229
|
-
support: 'system',
|
|
230
|
-
zone: 'account',
|
|
231
|
-
status: 'up'
|
|
232
|
-
},
|
|
233
|
-
{
|
|
234
|
-
sources: [
|
|
235
|
-
'https://help.elderscrollsonline.com/app/answers/detail/a_id/4320'
|
|
236
|
-
],
|
|
237
|
-
raw: [
|
|
238
|
-
'\n' +
|
|
239
|
-
'<p>2021.01.14 - 14:45 UTC (9:45 EST)</p>\n' +
|
|
240
|
-
'\n' +
|
|
241
|
-
'<p>The ESO Website is currently online.</p>\n' +
|
|
242
|
-
'\n'
|
|
243
|
-
],
|
|
244
|
-
rawDate: '2021.01.14 - 14:45 UTC (9:45 EST)',
|
|
245
|
-
rawData: 'The ESO Website is currently online.',
|
|
246
|
-
slugs: [ 'service_web_site' ],
|
|
247
|
-
dates: [ Moment<2021-02-14T14:45:00Z> ],
|
|
248
|
-
type: 'service',
|
|
249
|
-
support: 'web',
|
|
250
|
-
zone: 'site',
|
|
251
|
-
status: 'up'
|
|
152
|
+
status: 'up',
|
|
153
|
+
rawStatus: 'currently available',
|
|
154
|
+
rawSlug: 'PTS',
|
|
155
|
+
rawDate: ' 2024.08.27 - 14:40 UTC (10:40 EDT)',
|
|
156
|
+
dates: [ Moment<Invalid date> ]
|
|
252
157
|
}
|
|
253
158
|
]
|
|
254
159
|
```
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { EsoStatusRawData } from './interface/esoStatusRawData.interface';
|
|
2
|
+
/**
|
|
3
|
+
* Class for retrieving information from announcements
|
|
4
|
+
*/
|
|
5
|
+
export default class Connector {
|
|
6
|
+
private readonly remoteContent;
|
|
7
|
+
/**
|
|
8
|
+
* List of raw data from announcements
|
|
9
|
+
*/
|
|
10
|
+
raw: string[];
|
|
11
|
+
/**
|
|
12
|
+
* List of information from announcements
|
|
13
|
+
*/
|
|
14
|
+
rawEsoStatus: EsoStatusRawData[];
|
|
15
|
+
/**
|
|
16
|
+
* List of slugs whose data has already been retrieved
|
|
17
|
+
* @private
|
|
18
|
+
*/
|
|
19
|
+
private alreadyGet;
|
|
20
|
+
/**
|
|
21
|
+
* @param remoteContent Content of the source retrieved
|
|
22
|
+
*/
|
|
23
|
+
constructor(remoteContent: string);
|
|
24
|
+
/**
|
|
25
|
+
* Method for creating an instance of the connector
|
|
26
|
+
*/
|
|
27
|
+
static init(): Promise<Connector>;
|
|
28
|
+
/**
|
|
29
|
+
* Method for retrieving remote content
|
|
30
|
+
* @private
|
|
31
|
+
*/
|
|
32
|
+
private static getRemoteContent;
|
|
33
|
+
/**
|
|
34
|
+
* Method for isolating the section containing the list of announcements
|
|
35
|
+
* @private
|
|
36
|
+
*/
|
|
37
|
+
private isolate;
|
|
38
|
+
/**
|
|
39
|
+
* Method for separating announcement blocks
|
|
40
|
+
* @private
|
|
41
|
+
*/
|
|
42
|
+
private split;
|
|
43
|
+
/**
|
|
44
|
+
* Method for removing unwanted elements/characters from an announcement
|
|
45
|
+
* @private
|
|
46
|
+
*/
|
|
47
|
+
private clean;
|
|
48
|
+
/**
|
|
49
|
+
* Method for analyzing each announcement
|
|
50
|
+
* @private
|
|
51
|
+
*/
|
|
52
|
+
private fetch;
|
|
53
|
+
/**
|
|
54
|
+
* Method for retrieving the information contained in an announcement
|
|
55
|
+
* @param raw Raw data of the announcement
|
|
56
|
+
* @private
|
|
57
|
+
*/
|
|
58
|
+
private getEach;
|
|
59
|
+
/**
|
|
60
|
+
* Method for creating the list of announcements while avoiding duplicates
|
|
61
|
+
* @param match Object containing the information of a slug found in an announcement
|
|
62
|
+
* @private
|
|
63
|
+
*/
|
|
64
|
+
private populateRawEsoStatus;
|
|
65
|
+
}
|
package/lib/connector.js
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const axios_1 = require("axios");
|
|
4
|
+
const const_1 = require("./const");
|
|
5
|
+
const raw_1 = require("./raw");
|
|
6
|
+
/**
|
|
7
|
+
* Class for retrieving information from announcements
|
|
8
|
+
*/
|
|
9
|
+
class Connector {
|
|
10
|
+
/**
|
|
11
|
+
* @param remoteContent Content of the source retrieved
|
|
12
|
+
*/
|
|
13
|
+
constructor(remoteContent) {
|
|
14
|
+
this.remoteContent = remoteContent;
|
|
15
|
+
/**
|
|
16
|
+
* List of raw data from announcements
|
|
17
|
+
*/
|
|
18
|
+
this.raw = [];
|
|
19
|
+
/**
|
|
20
|
+
* List of information from announcements
|
|
21
|
+
*/
|
|
22
|
+
this.rawEsoStatus = [];
|
|
23
|
+
/**
|
|
24
|
+
* List of slugs whose data has already been retrieved
|
|
25
|
+
* @private
|
|
26
|
+
*/
|
|
27
|
+
this.alreadyGet = [];
|
|
28
|
+
if (!this.remoteContent) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
this.isolate();
|
|
32
|
+
this.split();
|
|
33
|
+
this.clean();
|
|
34
|
+
this.fetch();
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Method for creating an instance of the connector
|
|
38
|
+
*/
|
|
39
|
+
static async init() {
|
|
40
|
+
return new Connector(await Connector.getRemoteContent());
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Method for retrieving remote content
|
|
44
|
+
* @private
|
|
45
|
+
*/
|
|
46
|
+
static async getRemoteContent() {
|
|
47
|
+
const response = await axios_1.default.get(const_1.default);
|
|
48
|
+
return response?.status === 200 && !!response?.data
|
|
49
|
+
? String(response?.data)
|
|
50
|
+
: '';
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Method for isolating the section containing the list of announcements
|
|
54
|
+
* @private
|
|
55
|
+
*/
|
|
56
|
+
isolate() {
|
|
57
|
+
return this.remoteContent
|
|
58
|
+
.split('<h1>ESO Service Alerts</h1>')[1]
|
|
59
|
+
.split('</div>')
|
|
60
|
+
.shift();
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Method for separating announcement blocks
|
|
64
|
+
* @private
|
|
65
|
+
*/
|
|
66
|
+
split() {
|
|
67
|
+
this.isolate()
|
|
68
|
+
.split('<hr />')
|
|
69
|
+
.forEach((raw) => {
|
|
70
|
+
this.raw.push(raw);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Method for removing unwanted elements/characters from an announcement
|
|
75
|
+
* @private
|
|
76
|
+
*/
|
|
77
|
+
clean() {
|
|
78
|
+
this.raw = this.raw.map((raw) => {
|
|
79
|
+
return raw
|
|
80
|
+
.replaceAll('<!-- ENTER ESO SERVICE ALERTS BELOW THIS LINE -->', '')
|
|
81
|
+
.replaceAll(/\n/g, '')
|
|
82
|
+
.replaceAll(' </p><p>', '</p><p>')
|
|
83
|
+
.replaceAll(' <p>', '<p>')
|
|
84
|
+
.replaceAll(' </p>', '</p>')
|
|
85
|
+
.replaceAll(' <p>', '<p>')
|
|
86
|
+
.replaceAll('</p><p>', ' ')
|
|
87
|
+
.replaceAll('. ', '.')
|
|
88
|
+
.replaceAll('<p>', '')
|
|
89
|
+
.replaceAll('</p>', '')
|
|
90
|
+
.replaceAll(' ', '')
|
|
91
|
+
.replaceAll('<div>', '');
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Method for analyzing each announcement
|
|
96
|
+
* @private
|
|
97
|
+
*/
|
|
98
|
+
fetch() {
|
|
99
|
+
this.raw.forEach((raw) => this.getEach(raw));
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Method for retrieving the information contained in an announcement
|
|
103
|
+
* @param raw Raw data of the announcement
|
|
104
|
+
* @private
|
|
105
|
+
*/
|
|
106
|
+
getEach(raw) {
|
|
107
|
+
new raw_1.default(raw).matches.forEach((match) => this.populateRawEsoStatus(match));
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Method for creating the list of announcements while avoiding duplicates
|
|
111
|
+
* @param match Object containing the information of a slug found in an announcement
|
|
112
|
+
* @private
|
|
113
|
+
*/
|
|
114
|
+
populateRawEsoStatus(match) {
|
|
115
|
+
if (this.alreadyGet.includes(match.slug)) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
this.rawEsoStatus.push(match);
|
|
119
|
+
this.alreadyGet.push(match.slug);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
exports.default = Connector;
|
|
123
|
+
//# sourceMappingURL=connector.js.map
|
package/lib/const.d.ts
ADDED
package/lib/const.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* Official website URL with announcements
|
|
5
|
+
*/
|
|
6
|
+
const ServiceAlertsUrl = 'https://help.elderscrollsonline.com/app/answers/detail/a_id/4320';
|
|
7
|
+
exports.default = ServiceAlertsUrl;
|
|
8
|
+
//# sourceMappingURL=const.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Moment } from 'moment';
|
|
2
|
+
/**
|
|
3
|
+
* Class for identifying and formatting the date contained in an announcement
|
|
4
|
+
*/
|
|
5
|
+
export default class DateFormatter {
|
|
6
|
+
private readonly raw;
|
|
7
|
+
/**
|
|
8
|
+
* Raw date data contained in the announcement
|
|
9
|
+
*/
|
|
10
|
+
rawDate: string;
|
|
11
|
+
/**
|
|
12
|
+
* List of dates formatted correctly contained in the announcement
|
|
13
|
+
*/
|
|
14
|
+
dates: Moment[];
|
|
15
|
+
/**
|
|
16
|
+
* @param raw Raw data of the announcement
|
|
17
|
+
*/
|
|
18
|
+
constructor(raw: string);
|
|
19
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const moment = require("moment");
|
|
4
|
+
/**
|
|
5
|
+
* Class for identifying and formatting the date contained in an announcement
|
|
6
|
+
*/
|
|
7
|
+
class DateFormatter {
|
|
8
|
+
/**
|
|
9
|
+
* @param raw Raw data of the announcement
|
|
10
|
+
*/
|
|
11
|
+
constructor(raw) {
|
|
12
|
+
this.raw = raw;
|
|
13
|
+
this.rawDate = `${this.raw.split(')')[0]})`;
|
|
14
|
+
const split = raw.split(' ');
|
|
15
|
+
const dateData = split[0];
|
|
16
|
+
const hourData = split[2];
|
|
17
|
+
this.dates = [
|
|
18
|
+
moment()
|
|
19
|
+
.utc()
|
|
20
|
+
.set('years', Number(dateData.split('.')[0]))
|
|
21
|
+
.set('months', Number(dateData.split('.')[1]) - 1)
|
|
22
|
+
.set('date', Number(dateData.split('.')[2]))
|
|
23
|
+
.set('hours', Number(hourData.split(':')[0]))
|
|
24
|
+
.set('minutes', Number(hourData.split(':')[1]))
|
|
25
|
+
.set('seconds', 0)
|
|
26
|
+
.set('milliseconds', 0)
|
|
27
|
+
.utcOffset(0),
|
|
28
|
+
];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.default = DateFormatter;
|
|
32
|
+
//# sourceMappingURL=date.formatter.js.map
|