@eso-status/forum-message 1.0.12 → 2.0.0-dev.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/LICENSE.md +1 -1
  2. package/README.md +100 -93
  3. package/lib/connector.d.ts +68 -0
  4. package/lib/connector.js +122 -0
  5. package/lib/const.d.ts +9 -0
  6. package/lib/const.js +12 -0
  7. package/lib/formatter/date.formatter.d.ts +97 -0
  8. package/lib/formatter/date.formatter.js +161 -0
  9. package/lib/identifier/slug.identifier.d.ts +94 -0
  10. package/lib/identifier/slug.identifier.js +139 -0
  11. package/lib/identifier/slug.match.d.ts +26 -0
  12. package/lib/identifier/slug.match.js +35 -0
  13. package/lib/identifier/status.identifier.d.ts +63 -0
  14. package/lib/identifier/status.identifier.js +85 -0
  15. package/lib/index.d.ts +11 -13
  16. package/lib/index.js +14 -72
  17. package/lib/raw.d.ts +42 -0
  18. package/lib/raw.js +58 -0
  19. package/lib/type/messageType.type.d.ts +4 -0
  20. package/lib/type/messageType.type.js +3 -0
  21. package/lib/type/remoteDownRawStatus.type.d.ts +4 -0
  22. package/lib/type/remoteDownRawStatus.type.js +3 -0
  23. package/lib/type/remotePlannedRawStatus.type.d.ts +4 -0
  24. package/lib/type/remotePlannedRawStatus.type.js +3 -0
  25. package/lib/type/remoteRawSlug.type.d.ts +11 -0
  26. package/lib/type/remoteRawSlug.type.js +3 -0
  27. package/lib/type/remoteRawStatus.type.d.ts +7 -0
  28. package/lib/type/remoteRawStatus.type.js +3 -0
  29. package/lib/type/remoteServerPcEuRawSlug.type.d.ts +4 -0
  30. package/lib/type/remoteServerPcEuRawSlug.type.js +3 -0
  31. package/lib/type/remoteServerPcNaRawSlug.type.d.ts +4 -0
  32. package/lib/type/remoteServerPcNaRawSlug.type.js +3 -0
  33. package/lib/type/remoteServerPcPtsRawSlug.type.d.ts +4 -0
  34. package/lib/type/remoteServerPcPtsRawSlug.type.js +3 -0
  35. package/lib/type/remoteServerPsEuRawSlug.type.d.ts +4 -0
  36. package/lib/type/remoteServerPsEuRawSlug.type.js +3 -0
  37. package/lib/type/remoteServerPsNaRawSlug.type.d.ts +4 -0
  38. package/lib/type/remoteServerPsNaRawSlug.type.js +3 -0
  39. package/lib/type/remoteServerXboxEuRawSlug.type.d.ts +4 -0
  40. package/lib/type/remoteServerXboxEuRawSlug.type.js +3 -0
  41. package/lib/type/remoteServerXboxNaRawSlug.type.d.ts +4 -0
  42. package/lib/type/remoteServerXboxNaRawSlug.type.js +3 -0
  43. package/lib/type/remoteServiceStoreEsoRawSlug.type.d.ts +4 -0
  44. package/lib/type/remoteServiceStoreEsoRawSlug.type.js +3 -0
  45. package/lib/type/remoteServiceSystemAccountRawSlug.type.d.ts +4 -0
  46. package/lib/type/remoteServiceSystemAccountRawSlug.type.js +3 -0
  47. package/lib/type/remoteServiceWebSiteRawSlug.type.d.ts +4 -0
  48. package/lib/type/remoteServiceWebSiteRawSlug.type.js +3 -0
  49. package/lib/type/remoteUpRawStatus.type.d.ts +4 -0
  50. package/lib/type/remoteUpRawStatus.type.js +3 -0
  51. package/lib/type/sourceUrl.type.d.ts +4 -0
  52. package/lib/type/sourceUrl.type.js +3 -0
  53. package/package.json +110 -37
  54. package/lib/classes/ForumMessageElement.d.ts +0 -110
  55. package/lib/classes/ForumMessageElement.js +0 -395
  56. package/lib/connectors/ForumMessageConnector.d.ts +0 -127
  57. package/lib/connectors/ForumMessageConnector.js +0 -311
@@ -0,0 +1,161 @@
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.checkFormat();
14
+ }
15
+ /**
16
+ * Method for retrieving the raw date and the list of dates present in the announcement based on its format
17
+ * Case #1: The announcement contains a date with a start and end time (hour/minute)
18
+ * Case #2: The announcement contains the name of the next maintenance day with a start time (hour/minute)
19
+ * @private
20
+ */
21
+ checkFormat() {
22
+ let rawDate = this.getRawClassicDate();
23
+ if (rawDate !== '') {
24
+ this.rawDate = rawDate;
25
+ this.dates = this.formatClassic();
26
+ }
27
+ rawDate = this.getRawSpecialDate();
28
+ if (rawDate !== '') {
29
+ this.rawDate = rawDate;
30
+ this.dates = this.formatSpecial();
31
+ }
32
+ }
33
+ /**
34
+ * Method for retrieving the raw date in case #1
35
+ * @private
36
+ */
37
+ getRawClassicDate() {
38
+ const split = this.raw.split(' – ');
39
+ if (split.length > 2) {
40
+ split.shift();
41
+ return split.join(' – ');
42
+ }
43
+ return split.length === 2 ? split[1] : '';
44
+ }
45
+ /**
46
+ * Method for retrieving the raw date in case #2
47
+ * @private
48
+ */
49
+ getRawSpecialDate() {
50
+ const split = this.raw.split('on the PTS on ');
51
+ return split.length === 2 ? split[1] : '';
52
+ }
53
+ /**
54
+ * Method for generating the list of correctly formatted dates for case #1
55
+ * @private
56
+ */
57
+ formatClassic() {
58
+ return [
59
+ DateFormatter.generateMoment(moment().get('years'), moment().month(this.getRawClassicMouth()).get('months'), this.getRawClassicDay(), this.getRawHour(), this.getRawClassicMinute1()),
60
+ DateFormatter.generateMoment(moment().get('years'), moment().month(this.getRawClassicMouth()).get('months'), this.getRawClassicDay(), this.getRawClassicHour2(), this.getRawClassicMinute2()),
61
+ ];
62
+ }
63
+ /**
64
+ * Method for retrieving the month number for case #1
65
+ * @private
66
+ */
67
+ getRawClassicMouth() {
68
+ return this.rawDate.split(' ')[0];
69
+ }
70
+ /**
71
+ * Method for retrieving the day number for case #1
72
+ * @private
73
+ */
74
+ getRawClassicDay() {
75
+ return Number(this.rawDate.split(' ')[1].replace(',', ''));
76
+ }
77
+ /**
78
+ * Method for retrieving the hour number from a raw date
79
+ * @private
80
+ */
81
+ getRawHour() {
82
+ return Number(this.rawDate.split('(')[1].split(':')[0]);
83
+ }
84
+ /**
85
+ * Method for retrieving the minute number of the start time for case #1
86
+ * @private
87
+ */
88
+ getRawClassicMinute1() {
89
+ return Number(this.rawDate.split('(')[1].split(':')[1].split(' ')[0]);
90
+ }
91
+ /**
92
+ * Method for retrieving the end hour number in case #1
93
+ * @private
94
+ */
95
+ getRawClassicHour2() {
96
+ return Number(this.rawDate.split('(')[2].split(':')[0]);
97
+ }
98
+ /**
99
+ * Method for retrieving the minute number of the end time in case #1
100
+ * @private
101
+ */
102
+ getRawClassicMinute2() {
103
+ return Number(this.rawDate.split('(')[2].split(':')[1].split(' ')[0]);
104
+ }
105
+ /**
106
+ * Method for generating the correctly formatted date in case #2
107
+ * @private
108
+ */
109
+ formatSpecial() {
110
+ const date = this.getSpecialDate();
111
+ return [
112
+ DateFormatter.generateMoment(date.get('years'), date.get('months'), date.get('dates'), this.getRawHour(), this.getRawSpecialMinute()),
113
+ ];
114
+ }
115
+ /**
116
+ * Method for retrieving the maintenance date in case #2
117
+ * Case #2 does not provide the month or day (i.e., no day number), only the name of the day (Monday, Tuesday, etc.). Therefore, you need to check if the day has already passed in the current week to determine whether to add a week to the maintenance date.
118
+ * @private
119
+ */
120
+ getSpecialDate() {
121
+ const current = moment();
122
+ const targetDayIndex = moment()
123
+ .days(this.rawDate.split(' ')[0])
124
+ .get('days');
125
+ current.set('days', targetDayIndex);
126
+ if (moment().get('days') > targetDayIndex) {
127
+ current.add(1, 'week');
128
+ }
129
+ return current;
130
+ }
131
+ /**
132
+ * Method for retrieving the minute number of the time in case #2
133
+ * @private
134
+ */
135
+ getRawSpecialMinute() {
136
+ return Number(this.rawDate.split(':')[2].split(' ')[0]);
137
+ }
138
+ /**
139
+ * Method for formatting a date correctly
140
+ * @param year
141
+ * @param month
142
+ * @param day
143
+ * @param hour
144
+ * @param minute
145
+ * @private
146
+ */
147
+ static generateMoment(year, month, day, hour, minute) {
148
+ return moment()
149
+ .utc()
150
+ .set('years', year)
151
+ .set('months', month)
152
+ .set('date', day)
153
+ .set('hours', hour)
154
+ .set('minutes', minute)
155
+ .set('seconds', 0)
156
+ .set('milliseconds', 0)
157
+ .utcOffset(0);
158
+ }
159
+ }
160
+ exports.default = DateFormatter;
161
+ //# sourceMappingURL=date.formatter.js.map
@@ -0,0 +1,94 @@
1
+ import SlugMatch from './slug.match';
2
+ /**
3
+ * Class for identifying the list of slugs contained in an announcement
4
+ */
5
+ export default class SlugIdentifier {
6
+ private readonly raw;
7
+ /**
8
+ * List of slug information found in the announcement
9
+ */
10
+ slugMatches: SlugMatch[];
11
+ /**
12
+ * List of slugs to check for presence in the announcement
13
+ * @private
14
+ */
15
+ private readonly slugList;
16
+ /**
17
+ * List of indicators proving that the announcement pertains to the slug server_pc_eu
18
+ * @private
19
+ */
20
+ private readonly ServerPcEuMatchesList;
21
+ /**
22
+ * List of indicators proving that the announcement pertains to the slug server_pc_na
23
+ * @private
24
+ */
25
+ private readonly ServerPcNaMatchesList;
26
+ /**
27
+ * List of indicators proving that the announcement pertains to the slug server_pc_pts
28
+ * @private
29
+ */
30
+ private readonly ServerPcPtsMatchesList;
31
+ /**
32
+ * List of indicators proving that the announcement pertains to the slug server_ps_eu
33
+ * @private
34
+ */
35
+ private readonly ServerPsEuMatchesList;
36
+ /**
37
+ * List of indicators proving that the announcement pertains to the slug server_ps_na
38
+ * @private
39
+ */
40
+ private readonly ServerPsNaMatchesList;
41
+ /**
42
+ * List of indicators proving that the announcement pertains to the slug server_xbox_eu
43
+ * @private
44
+ */
45
+ private readonly ServerXboxEuMatchesList;
46
+ /**
47
+ * List of indicators proving that the announcement pertains to the slug server_xbox_na
48
+ * @private
49
+ */
50
+ private readonly ServerXboxNaMatchesList;
51
+ /**
52
+ * List of indicators proving that the announcement pertains to the slug service_store_eso
53
+ * @private
54
+ */
55
+ private readonly ServiceStoreEsoMatchesList;
56
+ /**
57
+ * List of indicators proving that the announcement pertains to the slug service_system_account
58
+ * @private
59
+ */
60
+ private readonly ServiceSystemAccountMatchesList;
61
+ /**
62
+ * List of indicators proving that the announcement pertains to the slug service_web_site
63
+ * @private
64
+ */
65
+ private readonly ServiceWebSiteMatchesList;
66
+ /**
67
+ * @param raw Raw data of the announcement
68
+ */
69
+ constructor(raw: string);
70
+ /**
71
+ * Method for retrieving the list of indicators for a slug to test
72
+ * @param slug Slug to test
73
+ * @private
74
+ */
75
+ private getMatchList;
76
+ /**
77
+ * Method for retrieving the name of the list of indicators for a slug to test
78
+ * @param slug Slug to test
79
+ * @private
80
+ */
81
+ private static getMatchListName;
82
+ /**
83
+ * Method for retrieving the indicators of a slug present in the announcement
84
+ * @param slug Slug to test
85
+ * @private
86
+ */
87
+ private getMatches;
88
+ /**
89
+ * Method for testing if the announcement contains indicators of a given slug
90
+ * @param slug Slug to test
91
+ * @private
92
+ */
93
+ private identify;
94
+ }
@@ -0,0 +1,139 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const slug_match_1 = require("./slug.match");
4
+ /**
5
+ * Class for identifying the list of slugs contained in an announcement
6
+ */
7
+ class SlugIdentifier {
8
+ /**
9
+ * @param raw Raw data of the announcement
10
+ */
11
+ constructor(raw) {
12
+ this.raw = raw;
13
+ /**
14
+ * List of slugs to check for presence in the announcement
15
+ * @private
16
+ */
17
+ this.slugList = [
18
+ 'server_pc_eu',
19
+ 'server_pc_na',
20
+ 'server_pc_pts',
21
+ 'server_ps_eu',
22
+ 'server_ps_na',
23
+ 'server_xbox_eu',
24
+ 'server_xbox_na',
25
+ 'service_store_eso',
26
+ 'service_system_account',
27
+ 'service_web_site',
28
+ ];
29
+ /**
30
+ * List of indicators proving that the announcement pertains to the slug server_pc_eu
31
+ * @private
32
+ */
33
+ this.ServerPcEuMatchesList = [
34
+ 'PC/Mac: EU megaserver for',
35
+ 'PC/Mac: NA and EU megaservers for',
36
+ ];
37
+ /**
38
+ * List of indicators proving that the announcement pertains to the slug server_pc_na
39
+ * @private
40
+ */
41
+ this.ServerPcNaMatchesList = [
42
+ 'PC/Mac: NA megaserver for',
43
+ 'PC/Mac: NA and EU megaservers for',
44
+ ];
45
+ /**
46
+ * List of indicators proving that the announcement pertains to the slug server_pc_pts
47
+ * @private
48
+ */
49
+ this.ServerPcPtsMatchesList = ['PTS'];
50
+ /**
51
+ * List of indicators proving that the announcement pertains to the slug server_ps_eu
52
+ * @private
53
+ */
54
+ this.ServerPsEuMatchesList = [
55
+ 'PlayStation®: NA and EU megaservers for',
56
+ ];
57
+ /**
58
+ * List of indicators proving that the announcement pertains to the slug server_ps_na
59
+ * @private
60
+ */
61
+ this.ServerPsNaMatchesList = [
62
+ 'PlayStation®: NA and EU megaservers for',
63
+ ];
64
+ /**
65
+ * List of indicators proving that the announcement pertains to the slug server_xbox_eu
66
+ * @private
67
+ */
68
+ this.ServerXboxEuMatchesList = [
69
+ 'Xbox: NA and EU megaservers for',
70
+ ];
71
+ /**
72
+ * List of indicators proving that the announcement pertains to the slug server_xbox_na
73
+ * @private
74
+ */
75
+ this.ServerXboxNaMatchesList = [
76
+ 'Xbox: NA and EU megaservers for',
77
+ ];
78
+ /**
79
+ * List of indicators proving that the announcement pertains to the slug service_store_eso
80
+ * @private
81
+ */
82
+ this.ServiceStoreEsoMatchesList = ['ESO Store and Account System for'];
83
+ /**
84
+ * List of indicators proving that the announcement pertains to the slug service_system_account
85
+ * @private
86
+ */
87
+ this.ServiceSystemAccountMatchesList = ['ESO Store and Account System for'];
88
+ /**
89
+ * List of indicators proving that the announcement pertains to the slug service_web_site
90
+ * @private
91
+ */
92
+ this.ServiceWebSiteMatchesList = [
93
+ 'ESO Website for',
94
+ ];
95
+ this.slugMatches = [];
96
+ this.slugList.forEach((slug) => this.identify(slug));
97
+ }
98
+ /**
99
+ * Method for retrieving the list of indicators for a slug to test
100
+ * @param slug Slug to test
101
+ * @private
102
+ */
103
+ getMatchList(slug) {
104
+ return this[SlugIdentifier.getMatchListName(slug)];
105
+ }
106
+ /**
107
+ * Method for retrieving the name of the list of indicators for a slug to test
108
+ * @param slug Slug to test
109
+ * @private
110
+ */
111
+ static getMatchListName(slug) {
112
+ return `${slug
113
+ .split('_')
114
+ .map((item) => item.charAt(0).toUpperCase() + item.slice(1))
115
+ .join('')}MatchesList`;
116
+ }
117
+ /**
118
+ * Method for retrieving the indicators of a slug present in the announcement
119
+ * @param slug Slug to test
120
+ * @private
121
+ */
122
+ getMatches(slug) {
123
+ return this.getMatchList(slug).filter((identifier) => this.raw.includes(identifier));
124
+ }
125
+ /**
126
+ * Method for testing if the announcement contains indicators of a given slug
127
+ * @param slug Slug to test
128
+ * @private
129
+ */
130
+ identify(slug) {
131
+ const matches = this.getMatches(slug);
132
+ if (!matches.length) {
133
+ return;
134
+ }
135
+ this.slugMatches.push(new slug_match_1.default(matches[0], slug));
136
+ }
137
+ }
138
+ exports.default = SlugIdentifier;
139
+ //# sourceMappingURL=slug.identifier.js.map
@@ -0,0 +1,26 @@
1
+ import { Slug, Support, Type, Zone } from '@eso-status/types';
2
+ import { RemoteRawSlug } from '../type/remoteRawSlug.type';
3
+ /**
4
+ * Class for retrieving information about a slug found in an announcement
5
+ */
6
+ export default class SlugMatch {
7
+ readonly rawSlug: RemoteRawSlug;
8
+ readonly slug: Slug;
9
+ /**
10
+ * @param rawSlug Data used to identify the presence of the slug in the announcement
11
+ * @param slug Slug found in the announcement
12
+ */
13
+ constructor(rawSlug: RemoteRawSlug, slug: Slug);
14
+ /**
15
+ * Method for retrieving the type of the slug
16
+ */
17
+ getType(): Type;
18
+ /**
19
+ * Method for retrieving the support of the slug
20
+ */
21
+ getSupport(): Support;
22
+ /**
23
+ * Method for retrieving the area of the slug
24
+ */
25
+ getZone(): Zone;
26
+ }
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * Class for retrieving information about a slug found in an announcement
5
+ */
6
+ class SlugMatch {
7
+ /**
8
+ * @param rawSlug Data used to identify the presence of the slug in the announcement
9
+ * @param slug Slug found in the announcement
10
+ */
11
+ constructor(rawSlug, slug) {
12
+ this.rawSlug = rawSlug;
13
+ this.slug = slug;
14
+ }
15
+ /**
16
+ * Method for retrieving the type of the slug
17
+ */
18
+ getType() {
19
+ return this.slug.split('_')[0];
20
+ }
21
+ /**
22
+ * Method for retrieving the support of the slug
23
+ */
24
+ getSupport() {
25
+ return this.slug.split('_')[1];
26
+ }
27
+ /**
28
+ * Method for retrieving the area of the slug
29
+ */
30
+ getZone() {
31
+ return this.slug.split('_')[2];
32
+ }
33
+ }
34
+ exports.default = SlugMatch;
35
+ //# sourceMappingURL=slug.match.js.map
@@ -0,0 +1,63 @@
1
+ import { Status } from '@eso-status/types';
2
+ import { RemoteRawStatus } from '../type/remoteRawStatus.type';
3
+ /**
4
+ * Class for identifying the status contained in an announcement
5
+ */
6
+ export default class StatusIdentifier {
7
+ private readonly raw;
8
+ /**
9
+ * Data used to identify the presence of the status in the announcement
10
+ */
11
+ rawStatus: RemoteRawStatus;
12
+ /**
13
+ * Status found in the announcement
14
+ */
15
+ status: Status;
16
+ /**
17
+ * List of statuses to check for presence in the announcement
18
+ * @private
19
+ */
20
+ private readonly statusList;
21
+ /**
22
+ * List of indicators proving that the announcement pertains to the status up
23
+ * @private
24
+ */
25
+ private readonly upMatchesList;
26
+ /**
27
+ * List of indicators proving that the announcement pertains to the status down
28
+ * @private
29
+ */
30
+ private readonly downMatchesList;
31
+ /**
32
+ * List of indicators proving that the announcement pertains to the status planned
33
+ * @private
34
+ */
35
+ private readonly plannedMatchesList;
36
+ /**
37
+ * @param raw Raw data of the announcement
38
+ */
39
+ constructor(raw: string);
40
+ /**
41
+ * Method for retrieving the list of indicators for a status to test
42
+ * @param status Status to test
43
+ * @private
44
+ */
45
+ private getMatchList;
46
+ /**
47
+ * Method for retrieving the indicators of a status present in the announcement
48
+ * @param status Status to test
49
+ * @private
50
+ */
51
+ private getMatches;
52
+ /**
53
+ * Method for testing if the announcement contains indicators of a given status
54
+ * @param status Status to test
55
+ * @private
56
+ */
57
+ private identify;
58
+ /**
59
+ * Method for setting the default status to planned in the absence of indicators for other statuses
60
+ * @private
61
+ */
62
+ private default;
63
+ }
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * Class for identifying the status contained in an announcement
5
+ */
6
+ class StatusIdentifier {
7
+ /**
8
+ * @param raw Raw data of the announcement
9
+ */
10
+ constructor(raw) {
11
+ this.raw = raw;
12
+ /**
13
+ * List of statuses to check for presence in the announcement
14
+ * @private
15
+ */
16
+ this.statusList = ['up', 'down', 'planned'];
17
+ /**
18
+ * List of indicators proving that the announcement pertains to the status up
19
+ * @private
20
+ */
21
+ this.upMatchesList = [
22
+ '[COMPLETE]',
23
+ 'now available',
24
+ 'complete',
25
+ ];
26
+ /**
27
+ * List of indicators proving that the announcement pertains to the status down
28
+ * @private
29
+ */
30
+ this.downMatchesList = [
31
+ '[EXTENDED]',
32
+ '[IN PROGRESS]',
33
+ 'unavailable',
34
+ ];
35
+ /**
36
+ * List of indicators proving that the announcement pertains to the status planned
37
+ * @private
38
+ */
39
+ this.plannedMatchesList = [
40
+ 'We will be performing maintenance',
41
+ ];
42
+ this.statusList.forEach((status) => this.identify(status));
43
+ this.default();
44
+ }
45
+ /**
46
+ * Method for retrieving the list of indicators for a status to test
47
+ * @param status Status to test
48
+ * @private
49
+ */
50
+ getMatchList(status) {
51
+ return this[`${status}MatchesList`];
52
+ }
53
+ /**
54
+ * Method for retrieving the indicators of a status present in the announcement
55
+ * @param status Status to test
56
+ * @private
57
+ */
58
+ getMatches(status) {
59
+ return this.getMatchList(status).filter((identifier) => this.raw.includes(identifier));
60
+ }
61
+ /**
62
+ * Method for testing if the announcement contains indicators of a given status
63
+ * @param status Status to test
64
+ * @private
65
+ */
66
+ identify(status) {
67
+ const matches = this.getMatches(status);
68
+ if (!matches.length) {
69
+ return;
70
+ }
71
+ this.rawStatus = matches.shift();
72
+ this.status = status;
73
+ }
74
+ /**
75
+ * Method for setting the default status to planned in the absence of indicators for other statuses
76
+ * @private
77
+ */
78
+ default() {
79
+ if (!this.status) {
80
+ this.status = 'planned';
81
+ }
82
+ }
83
+ }
84
+ exports.default = StatusIdentifier;
85
+ //# sourceMappingURL=status.identifier.js.map
package/lib/index.d.ts CHANGED
@@ -1,17 +1,15 @@
1
- import { RawEsoStatus } from '@eso-status/types';
2
- export declare const ForumMessageURL = "https://forums.elderscrollsonline.com/";
3
- export declare const ForumMessagePTSURL = "https://forums.elderscrollsonline.com/en/categories/pts";
1
+ import { EsoStatusRawData } from '@eso-status/types';
2
+ import { SourceUrl } from './type/sourceUrl.type';
4
3
  /**
5
- * Class of Forum Message
4
+ * Class for retrieving announcement information
6
5
  */
7
- export declare class ForumMessage {
6
+ export default class ForumMessage {
8
7
  /**
9
- * Methode used to get Forum Message data
10
- *
11
- * @public
12
- * @static
13
- *
14
- * @return Promise<RawEsoStatus[]> Forum Message elements
15
- */
16
- static getData(url?: string): Promise<RawEsoStatus[]>;
8
+ * Method for retrieving announcement information
9
+ */
10
+ static getData(): Promise<EsoStatusRawData[]>;
11
+ /**
12
+ * Method for retrieving announcement information from a specific URL
13
+ */
14
+ static getData(url: SourceUrl): Promise<EsoStatusRawData[]>;
17
15
  }