@eso-status/service-alerts 2.0.0-dev.0 → 2.0.0-dev.10

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/README.md CHANGED
@@ -31,6 +31,7 @@ npm i @eso-status/service-alerts
31
31
  ### Usage
32
32
  ```javascript
33
33
  import ServiceAlerts from '@eso-status/service-alerts';
34
+ import { EsoStatusRawData } from '@eso-status/types';
34
35
 
35
36
  const esoStatusRawDataList: EsoStatusRawData[] = await ServiceAlerts.getData();
36
37
  ```
@@ -48,7 +49,7 @@ const esoStatusRawDataList: EsoStatusRawData[] = await ServiceAlerts.getData();
48
49
  rawStatus: 'currently unavailable',
49
50
  rawSlug: 'ESO store',
50
51
  rawDate: '2024.09.04 - 14:00 UTC (10:00 EDT)',
51
- dates: [ Moment<2024-09-04T14:00:00Z> ]
52
+ dates: [ '2024-09-04T14:00:00Z' ]
52
53
  },
53
54
  {
54
55
  source: 'https://help.elderscrollsonline.com/app/answers/detail/a_id/4320',
@@ -61,7 +62,7 @@ const esoStatusRawDataList: EsoStatusRawData[] = await ServiceAlerts.getData();
61
62
  rawStatus: 'currently unavailable',
62
63
  rawSlug: 'account system',
63
64
  rawDate: '2024.09.04 - 14:00 UTC (10:00 EDT)',
64
- dates: [ Moment<2024-09-04T14:00:00Z> ]
65
+ dates: [ '2024-09-04T14:00:00Z' ]
65
66
  },
66
67
  {
67
68
  source: 'https://help.elderscrollsonline.com/app/answers/detail/a_id/4320',
@@ -74,7 +75,7 @@ const esoStatusRawDataList: EsoStatusRawData[] = await ServiceAlerts.getData();
74
75
  rawStatus: 'currently unavailable',
75
76
  rawSlug: 'The European PlayStation® megaserver',
76
77
  rawDate: '2024.09.04 - 10:00 UTC (6:00 EDT)',
77
- dates: [ Moment<2024-09-04T10:00:00Z> ]
78
+ dates: [ '2024-09-04T10:00:00Z' ]
78
79
  },
79
80
  {
80
81
  source: 'https://help.elderscrollsonline.com/app/answers/detail/a_id/4320',
@@ -87,7 +88,7 @@ const esoStatusRawDataList: EsoStatusRawData[] = await ServiceAlerts.getData();
87
88
  rawStatus: 'currently unavailable',
88
89
  rawSlug: 'The European Xbox megaserver',
89
90
  rawDate: '2024.09.04 - 10:00 UTC (6:00 EDT)',
90
- dates: [ Moment<2024-09-04T10:00:00Z> ]
91
+ dates: [ '2024-09-04T10:00:00Z' ]
91
92
  },
92
93
  {
93
94
  source: 'https://help.elderscrollsonline.com/app/answers/detail/a_id/4320',
@@ -100,7 +101,7 @@ const esoStatusRawDataList: EsoStatusRawData[] = await ServiceAlerts.getData();
100
101
  rawStatus: 'currently unavailable',
101
102
  rawSlug: 'North American PlayStation® megaserver',
102
103
  rawDate: '2024.09.04 - 10:00 UTC (6:00 EDT)',
103
- dates: [ Moment<2024-09-04T10:00:00Z> ]
104
+ dates: [ '2024-09-04T10:00:00Z' ]
104
105
  },
105
106
  {
106
107
  source: 'https://help.elderscrollsonline.com/app/answers/detail/a_id/4320',
@@ -113,7 +114,7 @@ const esoStatusRawDataList: EsoStatusRawData[] = await ServiceAlerts.getData();
113
114
  rawStatus: 'currently unavailable',
114
115
  rawSlug: 'The North American Xbox megaserver',
115
116
  rawDate: '2024.09.04 - 10:00 UTC (6:00 EDT)',
116
- dates: [ Moment<2024-09-04T10:00:00Z> ]
117
+ dates: [ '2024-09-04T10:00:00Z' ]
117
118
  },
118
119
  {
119
120
  source: 'https://help.elderscrollsonline.com/app/answers/detail/a_id/4320',
@@ -126,7 +127,7 @@ const esoStatusRawDataList: EsoStatusRawData[] = await ServiceAlerts.getData();
126
127
  rawStatus: 'currently available',
127
128
  rawSlug: 'The European PC/Mac megaserver',
128
129
  rawDate: '2024.09.03 - 10:55 UTC (6:55 EDT)',
129
- dates: [ Moment<2024-09-03T10:55:00Z> ]
130
+ dates: [ '2024-09-03T10:55:00Z' ]
130
131
  },
131
132
  {
132
133
  source: 'https://help.elderscrollsonline.com/app/answers/detail/a_id/4320',
@@ -137,9 +138,9 @@ const esoStatusRawDataList: EsoStatusRawData[] = await ServiceAlerts.getData();
137
138
  zone: 'na',
138
139
  status: 'up',
139
140
  rawStatus: 'currently available',
140
- rawSlug: 'The North American PC/Mac megaserver',
141
+ rawSlug: 'North American PC/Mac megaserver',
141
142
  rawDate: '2024.09.03 - 10:55 UTC (6:55 EDT)',
142
- dates: [ Moment<2024-09-03T10:55:00Z> ]
143
+ dates: [ '2024-09-03T10:55:00Z' ]
143
144
  },
144
145
  {
145
146
  source: 'https://help.elderscrollsonline.com/app/answers/detail/a_id/4320',
@@ -152,7 +153,7 @@ const esoStatusRawDataList: EsoStatusRawData[] = await ServiceAlerts.getData();
152
153
  rawStatus: 'currently available',
153
154
  rawSlug: 'PTS',
154
155
  rawDate: ' 2024.08.27 - 14:40 UTC (10:40 EDT)',
155
- dates: [ Moment<Invalid date> ]
156
+ dates: [ 'Invalid date' ]
156
157
  }
157
158
  ]
158
159
  ```
@@ -3,7 +3,7 @@ import { EsoStatusRawData } from './interface/esoStatusRawData.interface';
3
3
  * Class for retrieving information from announcements
4
4
  */
5
5
  export default class Connector {
6
- private readonly remoteContent;
6
+ private remoteContent;
7
7
  /**
8
8
  * List of raw data from announcements
9
9
  */
@@ -16,7 +16,7 @@ export default class Connector {
16
16
  * List of slugs whose data has already been retrieved
17
17
  * @private
18
18
  */
19
- private alreadyGet;
19
+ private readonly alreadyGet;
20
20
  /**
21
21
  * @param remoteContent Content of the source retrieved
22
22
  */
@@ -35,6 +35,11 @@ export default class Connector {
35
35
  * @private
36
36
  */
37
37
  private isolate;
38
+ /**
39
+ * Method for removing unwanted elements/characters from an announcement before split
40
+ * @private
41
+ */
42
+ private cleanBefore;
38
43
  /**
39
44
  * Method for separating announcement blocks
40
45
  * @private
package/lib/connector.js CHANGED
@@ -7,28 +7,30 @@ const raw_1 = require("./raw");
7
7
  * Class for retrieving information from announcements
8
8
  */
9
9
  class Connector {
10
+ remoteContent;
11
+ /**
12
+ * List of raw data from announcements
13
+ */
14
+ raw = [];
15
+ /**
16
+ * List of information from announcements
17
+ */
18
+ rawEsoStatus = [];
19
+ /**
20
+ * List of slugs whose data has already been retrieved
21
+ * @private
22
+ */
23
+ alreadyGet = [];
10
24
  /**
11
25
  * @param remoteContent Content of the source retrieved
12
26
  */
13
27
  constructor(remoteContent) {
14
28
  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
29
  if (!this.remoteContent) {
29
30
  return;
30
31
  }
31
32
  this.isolate();
33
+ this.cleanBefore();
32
34
  this.split();
33
35
  this.clean();
34
36
  this.fetch();
@@ -45,9 +47,7 @@ class Connector {
45
47
  */
46
48
  static async getRemoteContent() {
47
49
  const response = await axios_1.default.get(const_1.default);
48
- return response?.status === 200 && !!response?.data
49
- ? String(response?.data)
50
- : '';
50
+ return response.status === 200 && !!response.data ? response.data : '';
51
51
  }
52
52
  /**
53
53
  * Method for isolating the section containing the list of announcements
@@ -55,10 +55,17 @@ class Connector {
55
55
  */
56
56
  isolate() {
57
57
  return this.remoteContent
58
- .split('<!-- ENTER ESO SERVICE ALERTS BELOW THIS LINE -->')[1]
58
+ .split('<h1>ESO Service Alerts</h1>')[1]
59
59
  .split('</div>')
60
60
  .shift();
61
61
  }
62
+ /**
63
+ * Method for removing unwanted elements/characters from an announcement before split
64
+ * @private
65
+ */
66
+ cleanBefore() {
67
+ this.remoteContent = this.remoteContent.replaceAll('<hr>', '<hr />');
68
+ }
62
69
  /**
63
70
  * Method for separating announcement blocks
64
71
  * @private
@@ -77,17 +84,22 @@ class Connector {
77
84
  clean() {
78
85
  this.raw = this.raw.map((raw) => {
79
86
  return raw
80
- .replaceAll(/\n/g, '')
81
- .replaceAll(' </p><p>', '</p><p>')
87
+ .replaceAll('<!-- ENTER ESO SERVICE ALERTS BELOW THIS LINE -->', '')
88
+ .replaceAll('\n', '')
89
+ .replaceAll(' <p>', '<p>')
82
90
  .replaceAll(' <p>', '<p>')
83
- .replaceAll(' </p>', '</p>')
84
91
  .replaceAll(' <p>', '<p>')
92
+ .replaceAll(' </p>', '</p>')
85
93
  .replaceAll('</p><p>', ' ')
86
94
  .replaceAll('. &nbsp;', '.')
87
95
  .replaceAll('<p>', '')
88
96
  .replaceAll('</p>', '')
89
97
  .replaceAll('&nbsp;', '')
90
- .replaceAll('<div>', '');
98
+ .replaceAll('<div>', '')
99
+ .replaceAll('American PlayStation®', 'American PlayStation®');
100
+ });
101
+ this.raw = this.raw.filter((raw) => {
102
+ return raw !== ' ';
91
103
  });
92
104
  }
93
105
  /**
@@ -95,7 +107,9 @@ class Connector {
95
107
  * @private
96
108
  */
97
109
  fetch() {
98
- this.raw.forEach((raw) => this.getEach(raw));
110
+ this.raw.forEach((raw) => {
111
+ this.getEach(raw);
112
+ });
99
113
  }
100
114
  /**
101
115
  * Method for retrieving the information contained in an announcement
@@ -103,7 +117,9 @@ class Connector {
103
117
  * @private
104
118
  */
105
119
  getEach(raw) {
106
- new raw_1.default(raw).matches.forEach((match) => this.populateRawEsoStatus(match));
120
+ new raw_1.default(raw).matches.forEach((match) => {
121
+ this.populateRawEsoStatus(match);
122
+ });
107
123
  }
108
124
  /**
109
125
  * Method for creating the list of announcements while avoiding duplicates
@@ -1,4 +1,3 @@
1
- import { Moment } from 'moment';
2
1
  /**
3
2
  * Class for identifying and formatting the date contained in an announcement
4
3
  */
@@ -9,9 +8,9 @@ export default class DateFormatter {
9
8
  */
10
9
  rawDate: string;
11
10
  /**
12
- * List of dates formatted correctly contained in the announcement
11
+ * List of dates formatted correctly contained in the announcement (ISO 8601)
13
12
  */
14
- dates: Moment[];
13
+ dates: string[];
15
14
  /**
16
15
  * @param raw Raw data of the announcement
17
16
  */
@@ -5,6 +5,15 @@ const moment = require("moment");
5
5
  * Class for identifying and formatting the date contained in an announcement
6
6
  */
7
7
  class DateFormatter {
8
+ raw;
9
+ /**
10
+ * Raw date data contained in the announcement
11
+ */
12
+ rawDate;
13
+ /**
14
+ * List of dates formatted correctly contained in the announcement (ISO 8601)
15
+ */
16
+ dates;
8
17
  /**
9
18
  * @param raw Raw data of the announcement
10
19
  */
@@ -24,7 +33,8 @@ class DateFormatter {
24
33
  .set('minutes', Number(hourData.split(':')[1]))
25
34
  .set('seconds', 0)
26
35
  .set('milliseconds', 0)
27
- .utcOffset(0),
36
+ .utcOffset(0)
37
+ .toISOString(),
28
38
  ];
29
39
  }
30
40
  }
@@ -6,95 +6,104 @@ const slug_match_1 = require("./slug.match");
6
6
  * Class for identifying the list of slugs contained in an announcement
7
7
  */
8
8
  class SlugIdentifier {
9
+ raw;
10
+ /**
11
+ * List of slug information found in the announcement
12
+ */
13
+ slugMatches;
14
+ /**
15
+ * List of slugs to check for presence in the announcement
16
+ * @private
17
+ */
18
+ slugList = [
19
+ types_1.ServerPcEuSlug,
20
+ types_1.ServerPsEuSlug,
21
+ types_1.ServerXboxEuSlug,
22
+ types_1.ServerPcNaSlug,
23
+ types_1.ServerPsNaSlug,
24
+ types_1.ServerXboxNaSlug,
25
+ types_1.ServerPcPtsSlug,
26
+ types_1.ServiceStoreEsoSlug,
27
+ types_1.ServiceSystemAccountSlug,
28
+ ];
29
+ /**
30
+ * List of indicators proving that the announcement pertains to the slug server_pc_eu
31
+ * @private
32
+ */
33
+ ServerPcEuMatchesList = [
34
+ 'The European megaservers',
35
+ 'The European PC/Mac megaserver',
36
+ ];
37
+ /**
38
+ * List of indicators proving that the announcement pertains to the slug server_ps_eu
39
+ * @private
40
+ */
41
+ ServerPsEuMatchesList = [
42
+ 'The European megaservers',
43
+ 'The European PlayStation® megaserver',
44
+ 'PlayStation™ Network',
45
+ ];
46
+ /**
47
+ * List of indicators proving that the announcement pertains to the slug server_xbox_eu
48
+ * @private
49
+ */
50
+ ServerXboxEuMatchesList = [
51
+ 'The European megaservers',
52
+ 'The European Xbox megaserver',
53
+ 'North American and European Xbox megaservers',
54
+ 'Xbox Live™',
55
+ ];
56
+ /**
57
+ * List of indicators proving that the announcement pertains to the slug server_pc_na
58
+ * @private
59
+ */
60
+ ServerPcNaMatchesList = [
61
+ 'The North American megaservers',
62
+ 'North American PC/Mac megaserver',
63
+ ];
64
+ /**
65
+ * List of indicators proving that the announcement pertains to the slug server_ps_na
66
+ * @private
67
+ */
68
+ ServerPsNaMatchesList = [
69
+ 'The North American megaservers',
70
+ 'North American PlayStation® megaserver',
71
+ 'PlayStation™ Network',
72
+ ];
73
+ /**
74
+ * List of indicators proving that the announcement pertains to the slug server_xbox_na
75
+ * @private
76
+ */
77
+ ServerXboxNaMatchesList = [
78
+ 'The North American megaservers',
79
+ 'The North American Xbox megaserver',
80
+ 'North American and European Xbox megaservers',
81
+ 'Xbox Live™',
82
+ ];
83
+ /**
84
+ * List of indicators proving that the announcement pertains to the slug server_pc_pts
85
+ * @private
86
+ */
87
+ ServerPcPtsMatchesList = ['PTS'];
88
+ /**
89
+ * List of indicators proving that the announcement pertains to the slug service_store_eso
90
+ * @private
91
+ */
92
+ ServiceStoreEsoMatchesList = ['ESO store'];
93
+ /**
94
+ * List of indicators proving that the announcement pertains to the slug service_system_account
95
+ * @private
96
+ */
97
+ ServiceSystemAccountMatchesList = ['account system'];
9
98
  /**
10
99
  * @param raw Raw data of the announcement
11
100
  */
12
101
  constructor(raw) {
13
102
  this.raw = raw;
14
- /**
15
- * List of slugs to check for presence in the announcement
16
- * @private
17
- */
18
- this.slugList = [
19
- types_1.ServerPcEuSlug,
20
- types_1.ServerPsEuSlug,
21
- types_1.ServerXboxEuSlug,
22
- types_1.ServerPcNaSlug,
23
- types_1.ServerPsNaSlug,
24
- types_1.ServerXboxNaSlug,
25
- types_1.ServerPcPtsSlug,
26
- types_1.ServiceStoreEsoSlug,
27
- types_1.ServiceSystemAccountSlug,
28
- ];
29
- /**
30
- * List of indicators proving that the announcement pertains to the slug server_pc_eu
31
- * @private
32
- */
33
- this.ServerPcEuMatchesList = [
34
- 'The European megaservers',
35
- 'The European PC/Mac megaserver',
36
- ];
37
- /**
38
- * List of indicators proving that the announcement pertains to the slug server_ps_eu
39
- * @private
40
- */
41
- this.ServerPsEuMatchesList = [
42
- 'The European megaservers',
43
- 'The European PlayStation® megaserver',
44
- ];
45
- /**
46
- * List of indicators proving that the announcement pertains to the slug server_xbox_eu
47
- * @private
48
- */
49
- this.ServerXboxEuMatchesList = [
50
- 'The European megaservers',
51
- 'The European Xbox megaserver',
52
- 'North American and European Xbox megaservers',
53
- 'Xbox Live™',
54
- ];
55
- /**
56
- * List of indicators proving that the announcement pertains to the slug server_pc_na
57
- * @private
58
- */
59
- this.ServerPcNaMatchesList = [
60
- 'The North American megaservers',
61
- 'The North American PC/Mac megaserver',
62
- ];
63
- /**
64
- * List of indicators proving that the announcement pertains to the slug server_ps_na
65
- * @private
66
- */
67
- this.ServerPsNaMatchesList = [
68
- 'The North American megaservers',
69
- 'North American PlayStation® megaserver',
70
- ];
71
- /**
72
- * List of indicators proving that the announcement pertains to the slug server_xbox_na
73
- * @private
74
- */
75
- this.ServerXboxNaMatchesList = [
76
- 'The North American megaservers',
77
- 'The North American Xbox megaserver',
78
- 'North American and European Xbox megaservers',
79
- 'Xbox Live™',
80
- ];
81
- /**
82
- * List of indicators proving that the announcement pertains to the slug server_pc_pts
83
- * @private
84
- */
85
- this.ServerPcPtsMatchesList = ['PTS'];
86
- /**
87
- * List of indicators proving that the announcement pertains to the slug service_store_eso
88
- * @private
89
- */
90
- this.ServiceStoreEsoMatchesList = ['ESO store'];
91
- /**
92
- * List of indicators proving that the announcement pertains to the slug service_system_account
93
- * @private
94
- */
95
- this.ServiceSystemAccountMatchesList = ['account system'];
96
103
  this.slugMatches = [];
97
- this.slugList.forEach((slug) => this.identify(slug));
104
+ this.slugList.forEach((slug) => {
105
+ this.identify(slug);
106
+ });
98
107
  }
99
108
  /**
100
109
  * Method for retrieving the list of indicators for a slug to test
@@ -102,7 +111,8 @@ class SlugIdentifier {
102
111
  * @private
103
112
  */
104
113
  getMatchList(slug) {
105
- return this[SlugIdentifier.getMatchListName(slug)];
114
+ const key = SlugIdentifier.getMatchListName(slug);
115
+ return this[key];
106
116
  }
107
117
  /**
108
118
  * Method for retrieving the name of the list of indicators for a slug to test
@@ -4,6 +4,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  * Class for retrieving information about a slug found in an announcement
5
5
  */
6
6
  class SlugMatch {
7
+ rawSlug;
8
+ slug;
7
9
  /**
8
10
  * @param rawSlug Data used to identify the presence of the slug in the announcement
9
11
  * @param slug Slug found in the announcement
@@ -5,40 +5,51 @@ const types_1 = require("@eso-status/types");
5
5
  * Class for identifying the status contained in an announcement
6
6
  */
7
7
  class StatusIdentifier {
8
+ raw;
9
+ /**
10
+ * Data used to identify the presence of the status in the announcement
11
+ */
12
+ rawStatus;
13
+ /**
14
+ * Status found in the announcement
15
+ */
16
+ status;
17
+ /**
18
+ * List of statuses to check for presence in the announcement
19
+ * @private
20
+ */
21
+ statusList = [types_1.UpStatus, types_1.DownStatus, types_1.IssuesStatus];
22
+ /**
23
+ * List of indicators proving that the announcement pertains to the status up
24
+ * @private
25
+ */
26
+ upMatchesList = [
27
+ 'currently available',
28
+ 'been resolved',
29
+ ];
30
+ /**
31
+ * List of indicators proving that the announcement pertains to the status down
32
+ * @private
33
+ */
34
+ downMatchesList = [
35
+ 'currently unavailable',
36
+ ];
37
+ /**
38
+ * List of indicators proving that the announcement pertains to the status planned
39
+ * @private
40
+ */
41
+ issuesMatchesList = [
42
+ 'currently investigating',
43
+ 'currently experiencing a service interruption',
44
+ ];
8
45
  /**
9
46
  * @param raw Raw data of the announcement
10
47
  */
11
48
  constructor(raw) {
12
49
  this.raw = raw;
13
- /**
14
- * List of statuses to check for presence in the announcement
15
- * @private
16
- */
17
- this.statusList = [types_1.UpStatus, types_1.DownStatus, types_1.IssuesStatus];
18
- /**
19
- * List of indicators proving that the announcement pertains to the status up
20
- * @private
21
- */
22
- this.upMatchesList = [
23
- 'currently available',
24
- 'been resolved',
25
- ];
26
- /**
27
- * List of indicators proving that the announcement pertains to the status down
28
- * @private
29
- */
30
- this.downMatchesList = [
31
- 'currently unavailable',
32
- ];
33
- /**
34
- * List of indicators proving that the announcement pertains to the status planned
35
- * @private
36
- */
37
- this.issuesMatchesList = [
38
- 'currently investigating issues',
39
- 'currently experiencing a service interruption',
40
- ];
41
- this.statusList.forEach((status) => this.identify(status));
50
+ this.statusList.forEach((status) => {
51
+ this.identify(status);
52
+ });
42
53
  }
43
54
  /**
44
55
  * Method for retrieving the list of indicators for a status to test
@@ -46,7 +57,8 @@ class StatusIdentifier {
46
57
  * @private
47
58
  */
48
59
  getMatchList(status) {
49
- return this[`${status}MatchesList`];
60
+ const key = `${status}MatchesList`;
61
+ return this[key];
50
62
  }
51
63
  /**
52
64
  * Method for retrieving the indicators of a status present in the announcement
package/lib/index.js CHANGED
@@ -4,6 +4,7 @@ const connector_1 = require("./connector");
4
4
  /**
5
5
  * Class for retrieving announcement information
6
6
  */
7
+ /* eslint-disable @typescript-eslint/no-extraneous-class */
7
8
  class ServiceAlerts {
8
9
  /**
9
10
  * Method for retrieving announcement information
@@ -13,4 +14,5 @@ class ServiceAlerts {
13
14
  }
14
15
  }
15
16
  exports.default = ServiceAlerts;
17
+ /* eslint-enable @typescript-eslint/no-extraneous-class */
16
18
  //# sourceMappingURL=index.js.map
@@ -1,54 +1,53 @@
1
- import { Moment } from 'moment/moment';
2
1
  import { Slug, Status, Support, Type, Zone } from '@eso-status/types';
3
2
  import { RemoteRawSlug } from '../type/remoteRawSlug.type';
4
3
  import { RemoteRawStatus } from '../type/remoteRawStatus.type';
5
4
  import { SourceUrl } from '../type/sourceUrl.type';
6
5
  /**
7
- * Donnée brute du status d'un server/service ESO
6
+ * Raw data of an ESO server/service status
8
7
  */
9
8
  export interface EsoStatusRawData {
10
9
  /**
11
- * URL de la source de la donnée
10
+ * URL of the data source
12
11
  */
13
12
  source: SourceUrl;
14
13
  /**
15
- * Donnée brute permettant d'identifier le server/service et son status
14
+ * Raw data used to identify the server/service and its status
16
15
  */
17
16
  raw: string;
18
17
  /**
19
- * Status du server/service
18
+ * Status of the server/service
20
19
  */
21
20
  status: Status;
22
21
  /**
23
- * Donnée brute ayant permis d'identifier le status
22
+ * Raw data used to identify the status
24
23
  */
25
24
  rawStatus: RemoteRawStatus;
26
25
  /**
27
- * Slug du server/service
26
+ * Slug of the server/service
28
27
  */
29
28
  slug: Slug;
30
29
  /**
31
- * Donnée brute ayant permis d'identifier le slug
30
+ * Raw data used to identify the slug
32
31
  */
33
32
  rawSlug: RemoteRawSlug;
34
33
  /**
35
- * Type du server/service
34
+ * Type of the server/service
36
35
  */
37
36
  type: Type;
38
37
  /**
39
- * Support du server/service
38
+ * Support of the server/service
40
39
  */
41
40
  support: Support;
42
41
  /**
43
- * Zone du server/service
42
+ * Zone of the server/service
44
43
  */
45
44
  zone: Zone;
46
45
  /**
47
- * Liste des dates contenue dans l'annonce
46
+ * List of dates contained in the announcement (ISO 8601)
48
47
  */
49
- dates: Moment[];
48
+ dates: string[];
50
49
  /**
51
- * Donnée brute de la date contenue dans l'annonce
50
+ * Raw data of the date contained in the announcement
52
51
  */
53
52
  rawDate: string;
54
53
  }
package/lib/raw.d.ts CHANGED
@@ -3,7 +3,7 @@ import { EsoStatusRawData } from './interface/esoStatusRawData.interface';
3
3
  * Class containing announcement information
4
4
  */
5
5
  export default class Raw {
6
- private raw;
6
+ private readonly raw;
7
7
  /**
8
8
  * Status identification class
9
9
  * @private
@@ -18,7 +18,7 @@ export default class Raw {
18
18
  * Class for identifying the list of slugs
19
19
  * @private
20
20
  */
21
- private slugsIdentifier;
21
+ private readonly slugsIdentifier;
22
22
  /**
23
23
  * List of information about slugs found in the announcement
24
24
  */
package/lib/raw.js CHANGED
@@ -8,15 +8,31 @@ const const_1 = require("./const");
8
8
  * Class containing announcement information
9
9
  */
10
10
  class Raw {
11
+ raw;
12
+ /**
13
+ * Status identification class
14
+ * @private
15
+ */
16
+ statusIdentifier;
17
+ /**
18
+ * Class for identifying and formatting the date(s)
19
+ * @private
20
+ */
21
+ dateFormatter;
22
+ /**
23
+ * Class for identifying the list of slugs
24
+ * @private
25
+ */
26
+ slugsIdentifier;
27
+ /**
28
+ * List of information about slugs found in the announcement
29
+ */
30
+ matches = [];
11
31
  /**
12
32
  * @param raw Raw data of the announcement
13
33
  */
14
34
  constructor(raw) {
15
35
  this.raw = raw;
16
- /**
17
- * List of information about slugs found in the announcement
18
- */
19
- this.matches = [];
20
36
  this.statusIdentifier = new status_identifier_1.default(this.raw);
21
37
  this.dateFormatter = new date_formatter_1.default(this.raw);
22
38
  this.slugsIdentifier = new slug_identifier_1.default(this.raw);
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * Different statuses of announcements indicating that the announcement refers to a service/server that is not functioning properly
3
3
  */
4
- export type RemoteIssuesRawStatus = 'currently investigating issues' | 'currently experiencing a service interruption';
4
+ export type RemoteIssuesRawStatus = 'currently investigating' | 'currently experiencing a service interruption';
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * Different slugs of announcements concerning the North American PC/Mac Megaserver
3
3
  */
4
- export type RemoteServerPcNaRawSlug = 'The North American megaservers' | 'The North American PC/Mac megaserver';
4
+ export type RemoteServerPcNaRawSlug = 'The North American megaservers' | 'North American PC/Mac megaserver';
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * Different slugs of announcements concerning the European PlayStation® Megaserver
3
3
  */
4
- export type RemoteServerPsEuRawSlug = 'The European megaservers' | 'The European PlayStation® megaserver';
4
+ export type RemoteServerPsEuRawSlug = 'The European megaservers' | 'The European PlayStation® megaserver' | 'PlayStation™ Network';
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * Different slugs of announcements concerning the North American PlayStation® Megaserver
3
3
  */
4
- export type RemoteServerPsNaRawSlug = 'The North American megaservers' | 'North American PlayStation® megaserver';
4
+ export type RemoteServerPsNaRawSlug = 'The North American megaservers' | 'North American PlayStation® megaserver' | 'PlayStation™ Network';
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@eso-status/service-alerts",
3
- "version": "2.0.0-dev.0",
3
+ "version": "2.0.0-dev.10",
4
4
  "description": "Library for retrieving and formatting data, available at https://help.elderscrollsonline.com/app/answers/detail/a_id/4320.",
5
- "author": "@dov118 <contact@dov118.dev> (https://dov118.dev)",
5
+ "author": "@dov118 <contact.dov118.dev@gmail.com> (https://dov118.dev)",
6
6
  "main": "lib/index.js",
7
7
  "license": "MIT",
8
8
  "engineStrict": true,
@@ -61,7 +61,7 @@
61
61
  "README.md"
62
62
  ],
63
63
  "engines": {
64
- "node": "^18.18.0 || ^20.0.0"
64
+ "node": "^20.19.0 || ^22.13.0 || >=24"
65
65
  },
66
66
  "bugs": {
67
67
  "url": "https://github.com/eso-status/service-alerts/issues"
@@ -78,32 +78,42 @@
78
78
  "build": "rm -R -f lib/* && tsc --project tsconfig.build.json",
79
79
  "dev": "npm run build && node .",
80
80
  "watch": "nodemon --exec npm run dev",
81
- "test": "npm run build && jest --runInBand --setupFiles",
82
- "test:watch": "jest --runInBand --watch --setupFiles",
83
- "test:cov": "jest --runInBand --coverage --setupFiles",
81
+ "test": "npm run build && jest --runInBand",
82
+ "test:watch": "jest --runInBand --watch",
83
+ "test:cov": "jest --runInBand --coverage",
84
84
  "prepare": "husky"
85
85
  },
86
86
  "dependencies": {
87
- "@eso-status/types": "2.0.0-dev.11",
88
- "axios": "1.7.7",
87
+ "@eso-status/types": "2.0.0-dev.17",
88
+ "axios": "1.13.6",
89
89
  "moment": "2.30.1"
90
90
  },
91
+ "lint-staged": {
92
+ "*.ts": [
93
+ "eslint --fix",
94
+ "prettier --write"
95
+ ],
96
+ "*.{json,md,yml,yaml}": [
97
+ "prettier --write"
98
+ ]
99
+ },
91
100
  "devDependencies": {
92
- "@types/jest": "29.5.12",
93
- "eslint": "8.57.0",
94
- "eslint-config-airbnb-base": "15.0.0",
95
- "eslint-config-airbnb-typescript": "18.0.0",
96
- "eslint-config-prettier": "9.1.0",
97
- "eslint-plugin-jest": "28.8.3",
98
- "eslint-plugin-prettier": "5.2.1",
99
- "eslint-plugin-sonarjs": "2.0.2",
100
- "eslint-plugin-unused-imports": "4.1.3",
101
- "husky": "9.1.5",
102
- "jest": "29.7.0",
103
- "nodemon": "3.1.4",
104
- "prettier": "3.3.3",
105
- "ts-jest": "29.2.5",
106
- "typescript": "5.5.4"
101
+ "@eslint/js": "10.0.1",
102
+ "@types/jest": "30.0.0",
103
+ "eslint": "10.0.3",
104
+ "eslint-config-prettier": "10.1.8",
105
+ "eslint-plugin-jest": "29.15.0",
106
+ "eslint-plugin-sonarjs": "4.0.2",
107
+ "eslint-plugin-unused-imports": "4.4.1",
108
+ "globals": "17.4.0",
109
+ "husky": "9.1.7",
110
+ "jest": "30.3.0",
111
+ "lint-staged": "16.3.3",
112
+ "nodemon": "3.1.14",
113
+ "prettier": "3.8.1",
114
+ "ts-jest": "29.4.6",
115
+ "typescript": "5.9.3",
116
+ "typescript-eslint": "8.57.0"
107
117
  },
108
118
  "jest": {
109
119
  "moduleFileExtensions": [
@@ -121,9 +131,6 @@
121
131
  ],
122
132
  "coverageDirectory": "./coverage",
123
133
  "testEnvironment": "node",
124
- "setupFiles": [
125
- "dotenv/config"
126
- ],
127
134
  "moduleDirectories": [
128
135
  "node_modules",
129
136
  "src"