@eso-status/service-alerts 2.0.0-dev.1 → 2.0.0-dev.11

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
@@ -49,7 +49,7 @@ const esoStatusRawDataList: EsoStatusRawData[] = await ServiceAlerts.getData();
49
49
  rawStatus: 'currently unavailable',
50
50
  rawSlug: 'ESO store',
51
51
  rawDate: '2024.09.04 - 14:00 UTC (10:00 EDT)',
52
- dates: [ Moment<2024-09-04T14:00:00Z> ]
52
+ dates: [ '2024-09-04T14:00:00Z' ]
53
53
  },
54
54
  {
55
55
  source: 'https://help.elderscrollsonline.com/app/answers/detail/a_id/4320',
@@ -62,7 +62,7 @@ const esoStatusRawDataList: EsoStatusRawData[] = await ServiceAlerts.getData();
62
62
  rawStatus: 'currently unavailable',
63
63
  rawSlug: 'account system',
64
64
  rawDate: '2024.09.04 - 14:00 UTC (10:00 EDT)',
65
- dates: [ Moment<2024-09-04T14:00:00Z> ]
65
+ dates: [ '2024-09-04T14:00:00Z' ]
66
66
  },
67
67
  {
68
68
  source: 'https://help.elderscrollsonline.com/app/answers/detail/a_id/4320',
@@ -75,7 +75,7 @@ const esoStatusRawDataList: EsoStatusRawData[] = await ServiceAlerts.getData();
75
75
  rawStatus: 'currently unavailable',
76
76
  rawSlug: 'The European PlayStation® megaserver',
77
77
  rawDate: '2024.09.04 - 10:00 UTC (6:00 EDT)',
78
- dates: [ Moment<2024-09-04T10:00:00Z> ]
78
+ dates: [ '2024-09-04T10:00:00Z' ]
79
79
  },
80
80
  {
81
81
  source: 'https://help.elderscrollsonline.com/app/answers/detail/a_id/4320',
@@ -88,7 +88,7 @@ const esoStatusRawDataList: EsoStatusRawData[] = await ServiceAlerts.getData();
88
88
  rawStatus: 'currently unavailable',
89
89
  rawSlug: 'The European Xbox megaserver',
90
90
  rawDate: '2024.09.04 - 10:00 UTC (6:00 EDT)',
91
- dates: [ Moment<2024-09-04T10:00:00Z> ]
91
+ dates: [ '2024-09-04T10:00:00Z' ]
92
92
  },
93
93
  {
94
94
  source: 'https://help.elderscrollsonline.com/app/answers/detail/a_id/4320',
@@ -101,7 +101,7 @@ const esoStatusRawDataList: EsoStatusRawData[] = await ServiceAlerts.getData();
101
101
  rawStatus: 'currently unavailable',
102
102
  rawSlug: 'North American PlayStation® megaserver',
103
103
  rawDate: '2024.09.04 - 10:00 UTC (6:00 EDT)',
104
- dates: [ Moment<2024-09-04T10:00:00Z> ]
104
+ dates: [ '2024-09-04T10:00:00Z' ]
105
105
  },
106
106
  {
107
107
  source: 'https://help.elderscrollsonline.com/app/answers/detail/a_id/4320',
@@ -114,7 +114,7 @@ const esoStatusRawDataList: EsoStatusRawData[] = await ServiceAlerts.getData();
114
114
  rawStatus: 'currently unavailable',
115
115
  rawSlug: 'The North American Xbox megaserver',
116
116
  rawDate: '2024.09.04 - 10:00 UTC (6:00 EDT)',
117
- dates: [ Moment<2024-09-04T10:00:00Z> ]
117
+ dates: [ '2024-09-04T10:00:00Z' ]
118
118
  },
119
119
  {
120
120
  source: 'https://help.elderscrollsonline.com/app/answers/detail/a_id/4320',
@@ -127,7 +127,7 @@ const esoStatusRawDataList: EsoStatusRawData[] = await ServiceAlerts.getData();
127
127
  rawStatus: 'currently available',
128
128
  rawSlug: 'The European PC/Mac megaserver',
129
129
  rawDate: '2024.09.03 - 10:55 UTC (6:55 EDT)',
130
- dates: [ Moment<2024-09-03T10:55:00Z> ]
130
+ dates: [ '2024-09-03T10:55:00Z' ]
131
131
  },
132
132
  {
133
133
  source: 'https://help.elderscrollsonline.com/app/answers/detail/a_id/4320',
@@ -138,9 +138,9 @@ const esoStatusRawDataList: EsoStatusRawData[] = await ServiceAlerts.getData();
138
138
  zone: 'na',
139
139
  status: 'up',
140
140
  rawStatus: 'currently available',
141
- rawSlug: 'The North American PC/Mac megaserver',
141
+ rawSlug: 'North American PC/Mac megaserver',
142
142
  rawDate: '2024.09.03 - 10:55 UTC (6:55 EDT)',
143
- dates: [ Moment<2024-09-03T10:55:00Z> ]
143
+ dates: [ '2024-09-03T10:55:00Z' ]
144
144
  },
145
145
  {
146
146
  source: 'https://help.elderscrollsonline.com/app/answers/detail/a_id/4320',
@@ -153,7 +153,7 @@ const esoStatusRawDataList: EsoStatusRawData[] = await ServiceAlerts.getData();
153
153
  rawStatus: 'currently available',
154
154
  rawSlug: 'PTS',
155
155
  rawDate: ' 2024.08.27 - 14:40 UTC (10:40 EDT)',
156
- dates: [ Moment<Invalid date> ]
156
+ dates: [ 'Invalid date' ]
157
157
  }
158
158
  ]
159
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
@@ -59,6 +59,13 @@ class Connector {
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
@@ -78,17 +85,21 @@ class Connector {
78
85
  this.raw = this.raw.map((raw) => {
79
86
  return raw
80
87
  .replaceAll('<!-- ENTER ESO SERVICE ALERTS BELOW THIS LINE -->', '')
81
- .replaceAll(/\n/g, '')
82
- .replaceAll(' </p><p>', '</p><p>')
88
+ .replaceAll('\n', '')
89
+ .replaceAll(' <p>', '<p>')
83
90
  .replaceAll(' <p>', '<p>')
84
- .replaceAll(' </p>', '</p>')
85
91
  .replaceAll(' <p>', '<p>')
92
+ .replaceAll(' </p>', '</p>')
86
93
  .replaceAll('</p><p>', ' ')
87
94
  .replaceAll('. &nbsp;', '.')
88
95
  .replaceAll('<p>', '')
89
96
  .replaceAll('</p>', '')
90
97
  .replaceAll('&nbsp;', '')
91
- .replaceAll('<div>', '');
98
+ .replaceAll('<div>', '')
99
+ .replaceAll('American PlayStation®', 'American PlayStation®');
100
+ });
101
+ this.raw = this.raw.filter((raw) => {
102
+ return raw !== ' ';
92
103
  });
93
104
  }
94
105
  /**
@@ -96,7 +107,9 @@ class Connector {
96
107
  * @private
97
108
  */
98
109
  fetch() {
99
- this.raw.forEach((raw) => this.getEach(raw));
110
+ this.raw.forEach((raw) => {
111
+ this.getEach(raw);
112
+ });
100
113
  }
101
114
  /**
102
115
  * Method for retrieving the information contained in an announcement
@@ -104,7 +117,9 @@ class Connector {
104
117
  * @private
105
118
  */
106
119
  getEach(raw) {
107
- 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
+ });
108
123
  }
109
124
  /**
110
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,106 @@ 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
+ 'North American and European PC/Mac megaservers',
37
+ ];
38
+ /**
39
+ * List of indicators proving that the announcement pertains to the slug server_ps_eu
40
+ * @private
41
+ */
42
+ ServerPsEuMatchesList = [
43
+ 'The European megaservers',
44
+ 'The European PlayStation® megaserver',
45
+ 'PlayStation™ Network',
46
+ ];
47
+ /**
48
+ * List of indicators proving that the announcement pertains to the slug server_xbox_eu
49
+ * @private
50
+ */
51
+ ServerXboxEuMatchesList = [
52
+ 'The European megaservers',
53
+ 'The European Xbox megaserver',
54
+ 'North American and European Xbox megaservers',
55
+ 'Xbox Live™',
56
+ ];
57
+ /**
58
+ * List of indicators proving that the announcement pertains to the slug server_pc_na
59
+ * @private
60
+ */
61
+ ServerPcNaMatchesList = [
62
+ 'The North American megaservers',
63
+ 'North American PC/Mac megaserver',
64
+ 'North American and European PC/Mac megaservers',
65
+ ];
66
+ /**
67
+ * List of indicators proving that the announcement pertains to the slug server_ps_na
68
+ * @private
69
+ */
70
+ ServerPsNaMatchesList = [
71
+ 'The North American megaservers',
72
+ 'North American PlayStation® megaserver',
73
+ 'PlayStation™ Network',
74
+ ];
75
+ /**
76
+ * List of indicators proving that the announcement pertains to the slug server_xbox_na
77
+ * @private
78
+ */
79
+ ServerXboxNaMatchesList = [
80
+ 'The North American megaservers',
81
+ 'The North American Xbox megaserver',
82
+ 'North American and European Xbox megaservers',
83
+ 'Xbox Live™',
84
+ ];
85
+ /**
86
+ * List of indicators proving that the announcement pertains to the slug server_pc_pts
87
+ * @private
88
+ */
89
+ ServerPcPtsMatchesList = ['PTS'];
90
+ /**
91
+ * List of indicators proving that the announcement pertains to the slug service_store_eso
92
+ * @private
93
+ */
94
+ ServiceStoreEsoMatchesList = ['ESO store'];
95
+ /**
96
+ * List of indicators proving that the announcement pertains to the slug service_system_account
97
+ * @private
98
+ */
99
+ ServiceSystemAccountMatchesList = ['account system'];
9
100
  /**
10
101
  * @param raw Raw data of the announcement
11
102
  */
12
103
  constructor(raw) {
13
104
  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
105
  this.slugMatches = [];
97
- this.slugList.forEach((slug) => this.identify(slug));
106
+ this.slugList.forEach((slug) => {
107
+ this.identify(slug);
108
+ });
98
109
  }
99
110
  /**
100
111
  * Method for retrieving the list of indicators for a slug to test
@@ -102,7 +113,8 @@ class SlugIdentifier {
102
113
  * @private
103
114
  */
104
115
  getMatchList(slug) {
105
- return this[SlugIdentifier.getMatchListName(slug)];
116
+ const key = SlugIdentifier.getMatchListName(slug);
117
+ return this[key];
106
118
  }
107
119
  /**
108
120
  * 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 European PC/Mac Megaserver
3
3
  */
4
- export type RemoteServerPcEuRawSlug = 'The European megaservers' | 'The European PC/Mac megaserver';
4
+ export type RemoteServerPcEuRawSlug = 'The European megaservers' | 'The European PC/Mac megaserver' | 'North American and European PC/Mac megaservers';
@@ -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' | 'North American and European PC/Mac megaservers';
@@ -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.1",
3
+ "version": "2.0.0-dev.11",
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"