@eso-status/forum-message 2.0.0-dev.23 → 2.0.0-dev.25

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 (114) hide show
  1. package/README.md +118 -112
  2. package/lib/connector.d.ts +40 -5
  3. package/lib/connector.js +93 -67
  4. package/lib/connector.js.map +1 -0
  5. package/lib/const/ForumMessagePtsUrl.const.d.ts +3 -0
  6. package/lib/const/ForumMessagePtsUrl.const.js +5 -0
  7. package/lib/const/ForumMessagePtsUrl.const.js.map +1 -0
  8. package/lib/const/ForumMessageUrl.const.d.ts +3 -0
  9. package/lib/const/ForumMessageUrl.const.js +5 -0
  10. package/lib/const/ForumMessageUrl.const.js.map +1 -0
  11. package/lib/formatter/date.formatter.js +10 -7
  12. package/lib/formatter/date.formatter.js.map +1 -0
  13. package/lib/identifier/slug.identifier.js +28 -48
  14. package/lib/identifier/slug.identifier.js.map +1 -0
  15. package/lib/identifier/slug.match.js.map +1 -0
  16. package/lib/identifier/status.identifier.js.map +1 -0
  17. package/lib/index.js +2 -2
  18. package/lib/index.js.map +1 -0
  19. package/lib/interface/esoStatusRawData.interface.d.ts +58 -0
  20. package/lib/interface/esoStatusRawData.interface.js +3 -0
  21. package/lib/interface/esoStatusRawData.interface.js.map +1 -0
  22. package/lib/pattern/content/forumMessagePtsReplace.pattern.d.ts +2 -0
  23. package/lib/pattern/content/forumMessagePtsReplace.pattern.js +7 -0
  24. package/lib/pattern/content/forumMessagePtsReplace.pattern.js.map +1 -0
  25. package/lib/pattern/content/forumMessageReplace.pattern.d.ts +2 -0
  26. package/lib/pattern/content/forumMessageReplace.pattern.js +14 -0
  27. package/lib/pattern/content/forumMessageReplace.pattern.js.map +1 -0
  28. package/lib/pattern/message/messageFilter.pattern.d.ts +2 -0
  29. package/lib/pattern/message/messageFilter.pattern.js +12 -0
  30. package/lib/pattern/message/messageFilter.pattern.js.map +1 -0
  31. package/lib/pattern/message/messageReplace.pattern.d.ts +2 -0
  32. package/lib/pattern/message/messageReplace.pattern.js +28 -0
  33. package/lib/pattern/message/messageReplace.pattern.js.map +1 -0
  34. package/lib/pattern/message/messageSanitize.pattern.d.ts +2 -0
  35. package/lib/pattern/message/messageSanitize.pattern.js +28 -0
  36. package/lib/pattern/message/messageSanitize.pattern.js.map +1 -0
  37. package/lib/pattern/slugIdentifier/serverPcEuSlugIdentifier.pattern.d.ts +6 -0
  38. package/lib/pattern/slugIdentifier/serverPcEuSlugIdentifier.pattern.js +20 -0
  39. package/lib/pattern/slugIdentifier/serverPcEuSlugIdentifier.pattern.js.map +1 -0
  40. package/lib/pattern/slugIdentifier/serverPcNaSlugIdentifier.pattern.d.ts +6 -0
  41. package/lib/pattern/slugIdentifier/serverPcNaSlugIdentifier.pattern.js +21 -0
  42. package/lib/pattern/slugIdentifier/serverPcNaSlugIdentifier.pattern.js.map +1 -0
  43. package/lib/pattern/slugIdentifier/serverPcPtsSlugIdentifier.pattern.d.ts +6 -0
  44. package/lib/pattern/slugIdentifier/serverPcPtsSlugIdentifier.pattern.js +5 -0
  45. package/lib/pattern/slugIdentifier/serverPcPtsSlugIdentifier.pattern.js.map +1 -0
  46. package/lib/pattern/slugIdentifier/serverPsEuSlugIdentifier.pattern.d.ts +6 -0
  47. package/lib/pattern/slugIdentifier/serverPsEuSlugIdentifier.pattern.js +19 -0
  48. package/lib/pattern/slugIdentifier/serverPsEuSlugIdentifier.pattern.js.map +1 -0
  49. package/lib/pattern/slugIdentifier/serverPsNaSlugIdentifier.pattern.d.ts +6 -0
  50. package/lib/pattern/slugIdentifier/serverPsNaSlugIdentifier.pattern.js +23 -0
  51. package/lib/pattern/slugIdentifier/serverPsNaSlugIdentifier.pattern.js.map +1 -0
  52. package/lib/pattern/slugIdentifier/serverXboxEuSlugIdentifier.pattern.d.ts +6 -0
  53. package/lib/pattern/slugIdentifier/serverXboxEuSlugIdentifier.pattern.js +17 -0
  54. package/lib/pattern/slugIdentifier/serverXboxEuSlugIdentifier.pattern.js.map +1 -0
  55. package/lib/pattern/slugIdentifier/serverXboxNaSlugIdentifier.pattern.d.ts +6 -0
  56. package/lib/pattern/slugIdentifier/serverXboxNaSlugIdentifier.pattern.js +16 -0
  57. package/lib/pattern/slugIdentifier/serverXboxNaSlugIdentifier.pattern.js.map +1 -0
  58. package/lib/pattern/slugIdentifier/serviceStoreEsoSlugIdentifier.pattern.d.ts +6 -0
  59. package/lib/pattern/slugIdentifier/serviceStoreEsoSlugIdentifier.pattern.js +5 -0
  60. package/lib/pattern/slugIdentifier/serviceStoreEsoSlugIdentifier.pattern.js.map +1 -0
  61. package/lib/pattern/slugIdentifier/serviceSystemAccountSlugIdentifier.pattern.d.ts +6 -0
  62. package/lib/pattern/slugIdentifier/serviceSystemAccountSlugIdentifier.pattern.js +5 -0
  63. package/lib/pattern/slugIdentifier/serviceSystemAccountSlugIdentifier.pattern.js.map +1 -0
  64. package/lib/pattern/slugIdentifier/serviceWebSiteSlugIdentifier.pattern.d.ts +6 -0
  65. package/lib/pattern/slugIdentifier/serviceWebSiteSlugIdentifier.pattern.js +5 -0
  66. package/lib/pattern/slugIdentifier/serviceWebSiteSlugIdentifier.pattern.js.map +1 -0
  67. package/lib/raw.d.ts +10 -0
  68. package/lib/raw.js +18 -0
  69. package/lib/raw.js.map +1 -0
  70. package/lib/tsconfig.build.tsbuildinfo +1 -0
  71. package/lib/type/matchesList.type.d.ts +4 -0
  72. package/lib/type/matchesList.type.js +3 -0
  73. package/lib/type/matchesList.type.js.map +1 -0
  74. package/lib/type/messagePattern.type.d.ts +1 -0
  75. package/lib/type/messagePattern.type.js +3 -0
  76. package/lib/type/messagePattern.type.js.map +1 -0
  77. package/lib/type/messageType.type.js.map +1 -0
  78. package/lib/type/remoteDownRawStatus.type.js.map +1 -0
  79. package/lib/type/remoteIssuesRawStatus.type.js.map +1 -0
  80. package/lib/type/remotePlannedRawStatus.type.js.map +1 -0
  81. package/lib/type/remoteRawSlug.type.d.ts +2 -1
  82. package/lib/type/remoteRawSlug.type.js.map +1 -0
  83. package/lib/type/remoteRawStatus.type.js.map +1 -0
  84. package/lib/type/remoteServerPcEuRawSlug.type.d.ts +1 -1
  85. package/lib/type/remoteServerPcEuRawSlug.type.js.map +1 -0
  86. package/lib/type/remoteServerPcNaRawSlug.type.d.ts +1 -1
  87. package/lib/type/remoteServerPcNaRawSlug.type.js.map +1 -0
  88. package/lib/type/remoteServerPcPtsRawSlug.type.js.map +1 -0
  89. package/lib/type/remoteServerPsEuRawSlug.type.d.ts +1 -1
  90. package/lib/type/remoteServerPsEuRawSlug.type.js.map +1 -0
  91. package/lib/type/remoteServerPsNaRawSlug.type.d.ts +1 -1
  92. package/lib/type/remoteServerPsNaRawSlug.type.js.map +1 -0
  93. package/lib/type/remoteServerXboxEuRawSlug.type.d.ts +1 -1
  94. package/lib/type/remoteServerXboxEuRawSlug.type.js.map +1 -0
  95. package/lib/type/remoteServerXboxNaRawSlug.type.d.ts +1 -1
  96. package/lib/type/remoteServerXboxNaRawSlug.type.js.map +1 -0
  97. package/lib/type/remoteServiceStoreEsoRawSlug.type.d.ts +1 -1
  98. package/lib/type/remoteServiceStoreEsoRawSlug.type.js.map +1 -0
  99. package/lib/type/remoteServiceSystemAccountRawSlug.type.d.ts +1 -1
  100. package/lib/type/remoteServiceSystemAccountRawSlug.type.js.map +1 -0
  101. package/lib/type/remoteServiceWebSiteRawSlug.type.d.ts +1 -1
  102. package/lib/type/remoteServiceWebSiteRawSlug.type.js.map +1 -0
  103. package/lib/type/remoteUpRawStatus.type.js.map +1 -0
  104. package/lib/type/sourceUrl.type.d.ts +3 -1
  105. package/lib/type/sourceUrl.type.js.map +1 -0
  106. package/lib/type/sourceUrlForumMessage.type.d.ts +1 -0
  107. package/lib/type/sourceUrlForumMessage.type.js +3 -0
  108. package/lib/type/sourceUrlForumMessage.type.js.map +1 -0
  109. package/lib/type/sourceUrlForumMessagePts.type.d.ts +1 -0
  110. package/lib/type/sourceUrlForumMessagePts.type.js +3 -0
  111. package/lib/type/sourceUrlForumMessagePts.type.js.map +1 -0
  112. package/package.json +15 -89
  113. package/lib/const.d.ts +0 -9
  114. package/lib/const.js +0 -12
package/README.md CHANGED
@@ -19,138 +19,144 @@
19
19
  eso-status/forum-message is a library for retrieving and formatting data, which can be found at [https://forums.elderscrollsonline.com](https://forums.elderscrollsonline.com) or [https://forums.elderscrollsonline.com/en/categories/pts](https://forums.elderscrollsonline.com/en/categories/pts).
20
20
 
21
21
  ## Table of Contents
22
+
22
23
  - [Install](#install)
23
24
  - [Usage](#usage)
24
25
  - [Return exemple](#return-exemple)
25
26
 
26
27
  ### Install
28
+
27
29
  ```shell
28
30
  npm i @eso-status/forum-message
29
31
  ```
30
32
 
31
33
  ### Usage
34
+
32
35
  ```javascript
33
- import ForumMessage from '@eso-status/forum-message';
34
36
  import { EsoStatusRawData } from '@eso-status/types';
35
- import { ForumMessagePTSURL } from '@eso-status/forum-message/const';
37
+ import ForumMessage from '@eso-status/forum-message';
38
+ import ForumMessageUrl from '@eso-status/forum-message/const/ForumMessageUrl.const';
36
39
 
37
40
  // Homepage data
38
41
  const esoStatusRawDataList: EsoStatusRawData[] = await ForumMessage.getData();
39
42
 
40
43
  // PTS category homepage data
41
- const esoStatusRawDataList: EsoStatusRawData[] = await ForumMessage.getData(ForumMessagePTSURL);
44
+ const esoStatusRawDataList: EsoStatusRawData[] = await ForumMessage.getData('https://forums.elderscrollsonline.com');
42
45
  ```
46
+
43
47
  ### Return exemple
48
+
44
49
  ```text
45
50
  [
46
- {
47
- source: 'https://forums.elderscrollsonline.com',
48
- raw: ' PC/Mac: NA and EU megaservers for patch maintenance September 3, 4:00AM EDT (8:00 UTC) 9:00AM EDT (13:00 UTC)',
49
- slug: 'server_pc_eu',
50
- type: 'server',
51
- support: 'pc',
52
- zone: 'eu',
53
- status: 'planned',
54
- rawSlug: 'PC/Mac: NA and EU megaservers for',
55
- rawDate: 'September 3, 4:00AM EDT (8:00 UTC) – 9:00AM EDT (13:00 UTC)',
56
- dates: [ '2024-09-03T08:00:00Z', '2024-09-03T13:00:00Z' ]
57
- },
58
- {
59
- source: 'https://forums.elderscrollsonline.com',
60
- raw: '• PC/Mac: NA and EU megaservers for patch maintenance – September 3, 4:00AM EDT (8:00 UTC) – 9:00AM EDT (13:00 UTC)',
61
- slug: 'server_pc_na',
62
- type: 'server',
63
- support: 'pc',
64
- zone: 'na',
65
- status: 'planned',
66
- rawSlug: 'PC/Mac: NA and EU megaservers for',
67
- rawDate: 'September 3, 4:00AM EDT (8:00 UTC) – 9:00AM EDT (13:00 UTC)',
68
- dates: [ '2024-09-03T08:00:00Z', '2024-09-03T13:00:00Z' ]
69
- },
70
- {
71
- source: 'https://forums.elderscrollsonline.com',
72
- raw: '• Xbox: NA and EU megaservers for patch maintenance – September 4, 6:00AM EDT (10:00 UTC) - 12:00PM EDT (16:00 UTC)',
73
- slug: 'server_xbox_eu',
74
- type: 'server',
75
- support: 'xbox',
76
- zone: 'eu',
77
- status: 'planned',
78
- rawSlug: 'Xbox: NA and EU megaservers for',
79
- rawDate: 'September 4, 6:00AM EDT (10:00 UTC) - 12:00PM EDT (16:00 UTC)',
80
- dates: [ '2024-09-04T10:00:00Z', '2024-09-04T16:00:00Z' ]
81
- },
82
- {
83
- source: 'https://forums.elderscrollsonline.com',
84
- raw: ' Xbox: NA and EU megaservers for patch maintenance – September 4, 6:00AM EDT (10:00 UTC) - 12:00PM EDT (16:00 UTC)',
85
- slug: 'server_xbox_na',
86
- type: 'server',
87
- support: 'xbox',
88
- zone: 'na',
89
- status: 'planned',
90
- rawSlug: 'Xbox: NA and EU megaservers for',
91
- rawDate: 'September 4, 6:00AM EDT (10:00 UTC) - 12:00PM EDT (16:00 UTC)',
92
- dates: [ '2024-09-04T10:00:00Z', '2024-09-04T16:00:00Z' ]
93
- },
94
- {
95
- source: 'https://forums.elderscrollsonline.com',
96
- raw: '• PlayStation®: NA and EU megaservers for patch maintenance – September 4, 6:00AM EDT (10:00 UTC) - 12:00PM EDT (16:00 UTC)',
97
- slug: 'server_ps_eu',
98
- type: 'server',
99
- support: 'ps',
100
- zone: 'eu',
101
- status: 'planned',
102
- rawSlug: 'PlayStation®: NA and EU megaservers for',
103
- rawDate: 'September 4, 6:00AM EDT (10:00 UTC) - 12:00PM EDT (16:00 UTC)',
104
- dates: [ '2024-09-04T10:00:00Z', '2024-09-04T16:00:00Z' ]
105
- },
106
- {
107
- source: 'https://forums.elderscrollsonline.com',
108
- raw: '• PlayStation®: NA and EU megaservers for patch maintenance – September 4, 6:00AM EDT (10:00 UTC) - 12:00PM EDT (16:00 UTC)',
109
- slug: 'server_ps_na',
110
- type: 'server',
111
- support: 'ps',
112
- zone: 'na',
113
- status: 'planned',
114
- rawSlug: 'PlayStation®: NA and EU megaservers for',
115
- rawDate: 'September 4, 6:00AM EDT (10:00 UTC) - 12:00PM EDT (16:00 UTC)',
116
- dates: [ '2024-09-04T10:00:00Z', '2024-09-04T16:00:00Z' ]
117
- },
118
- {
119
- source: 'https://forums.elderscrollsonline.com',
120
- raw: '• ESO Store and Account System for maintenance – September 4, 10:00AM EDT (14:00 UTC) - 12:00PM EDT (16:00 UTC)',
121
- slug: 'service_store_eso',
122
- type: 'service',
123
- support: 'store',
124
- zone: 'eso',
125
- status: 'planned',
126
- rawSlug: 'ESO Store and Account System for',
127
- rawDate: 'September 4, 10:00AM EDT (14:00 UTC) - 12:00PM EDT (16:00 UTC)',
128
- dates: [ '2024-09-04T14:00:00Z', '2024-09-04T16:00:00Z' ]
129
- },
130
- {
131
- source: 'https://forums.elderscrollsonline.com',
132
- raw: 'ESO Store and Account System for maintenance September 4, 10:00AM EDT (14:00 UTC) - 12:00PM EDT (16:00 UTC)',
133
- slug: 'service_system_account',
134
- type: 'service',
135
- support: 'system',
136
- zone: 'account',
137
- status: 'planned',
138
- rawSlug: 'ESO Store and Account System for',
139
- rawDate: 'September 4, 10:00AM EDT (14:00 UTC) - 12:00PM EDT (16:00 UTC)',
140
- dates: [ '2024-09-04T14:00:00Z', '2024-09-04T16:00:00Z' ]
141
- },
142
- {
143
- source: 'https://forums.elderscrollsonline.com/en/categories/pts',
144
- raw: 'We will be performing maintenance on the PTS on Thursday at 9:00AM EDT (13:00 UTC).',
145
- slug: 'server_pc_pts',
146
- type: 'server',
147
- support: 'pc',
148
- zone: 'pts',
149
- status: 'planned',
150
- rawSlug: 'PTS',
151
- rawDate: 'Thursday at 9:00AM EDT (13:00 UTC)',
152
- rawStatus: 'We will be performing maintenance',
153
- dates: [ '2024-09-05T13:00:00Z' ]
154
- }
51
+ {
52
+ source: 'https://forums.elderscrollsonline.com',
53
+ raw: '[IN PROGRESS] NA megaservers for patch maintenance - March 9, 4:00AM EDT (8:00 UTC) - 12:00PM EDT (16:00 UTC)',
54
+ pattern: '[IN PROGRESS] NA megaservers for maintenance - [month] [day number], [hour]:[minute][meridiem] [timezone] ([hour]:[minute] [timezone]) - [hour]:[minute][meridiem] [timezone] ([hour]:[minute] [timezone])',
55
+ slug: 'server_pc_na',
56
+ type: 'server',
57
+ support: 'pc',
58
+ zone: 'na',
59
+ status: 'down',
60
+ rawStatus: '[IN PROGRESS]',
61
+ rawSlug: '[IN PROGRESS] NA megaservers',
62
+ rawDate: 'March 9, 4:00AM EDT (8:00 UTC) - 12:00PM EDT (16:00 UTC)',
63
+ dates: ['2026-03-09T08:00:00.000Z', '2026-03-09T16:00:00.000Z'],
64
+ },
65
+ {
66
+ source: 'https://forums.elderscrollsonline.com',
67
+ raw: '[IN PROGRESS] NA megaservers for patch maintenance - March 9, 4:00AM EDT (8:00 UTC) - 12:00PM EDT (16:00 UTC)',
68
+ pattern: '[IN PROGRESS] NA megaservers for maintenance - [month] [day number], [hour]:[minute][meridiem] [timezone] ([hour]:[minute] [timezone]) - [hour]:[minute][meridiem] [timezone] ([hour]:[minute] [timezone])',
69
+ slug: 'server_ps_na',
70
+ type: 'server',
71
+ support: 'ps',
72
+ zone: 'na',
73
+ status: 'down',
74
+ rawStatus: '[IN PROGRESS]',
75
+ rawSlug: '[IN PROGRESS] NA megaservers',
76
+ rawDate: 'March 9, 4:00AM EDT (8:00 UTC) - 12:00PM EDT (16:00 UTC)',
77
+ dates: ['2026-03-09T08:00:00.000Z', '2026-03-09T16:00:00.000Z'],
78
+ },
79
+ {
80
+ source: 'https://forums.elderscrollsonline.com',
81
+ raw: '[IN PROGRESS] NA megaservers for patch maintenance - March 9, 4:00AM EDT (8:00 UTC) - 12:00PM EDT (16:00 UTC)',
82
+ pattern: '[IN PROGRESS] NA megaservers for maintenance - [month] [day number], [hour]:[minute][meridiem] [timezone] ([hour]:[minute] [timezone]) - [hour]:[minute][meridiem] [timezone] ([hour]:[minute] [timezone])',
83
+ slug: 'server_xbox_na',
84
+ type: 'server',
85
+ support: 'xbox',
86
+ zone: 'na',
87
+ status: 'down',
88
+ rawStatus: '[IN PROGRESS]',
89
+ rawSlug: '[IN PROGRESS] NA megaservers',
90
+ rawDate: 'March 9, 4:00AM EDT (8:00 UTC) - 12:00PM EDT (16:00 UTC)',
91
+ dates: ['2026-03-09T08:00:00.000Z', '2026-03-09T16:00:00.000Z'],
92
+ },
93
+ {
94
+ source: 'https://forums.elderscrollsonline.com',
95
+ raw: '[IN PROGRESS] EU megaservers for patch maintenance - March 9, 8:00 UTC (4:00AM EDT) - 16:00 UTC (12:00PM EDT)',
96
+ pattern: '[IN PROGRESS] EU megaservers for maintenance - [month] [day number], [hour]:[minute] [timezone] ([hour]:[minute][meridiem] [timezone]) - [hour]:[minute] [timezone] ([hour]:[minute][meridiem] [timezone])',
97
+ slug: 'server_pc_eu',
98
+ type: 'server',
99
+ support: 'pc',
100
+ zone: 'eu',
101
+ status: 'down',
102
+ rawStatus: '[IN PROGRESS]',
103
+ rawSlug: '[IN PROGRESS] EU megaservers',
104
+ rawDate: 'March 9, 8:00 UTC (4:00AM EDT) - 16:00 UTC (12:00PM EDT)',
105
+ dates: ['2026-03-09T08:00:00.000Z', '2026-03-09T16:00:00.000Z'],
106
+ },
107
+ {
108
+ source: 'https://forums.elderscrollsonline.com',
109
+ raw: '[IN PROGRESS] EU megaservers for patch maintenance - March 9, 8:00 UTC (4:00AM EDT) - 16:00 UTC (12:00PM EDT)',
110
+ pattern: '[IN PROGRESS] EU megaservers for maintenance - [month] [day number], [hour]:[minute] [timezone] ([hour]:[minute][meridiem] [timezone]) - [hour]:[minute] [timezone] ([hour]:[minute][meridiem] [timezone])',
111
+ slug: 'server_ps_eu',
112
+ type: 'server',
113
+ support: 'ps',
114
+ zone: 'eu',
115
+ status: 'down',
116
+ rawStatus: '[IN PROGRESS]',
117
+ rawSlug: '[IN PROGRESS] EU megaservers',
118
+ rawDate: 'March 9, 8:00 UTC (4:00AM EDT) - 16:00 UTC (12:00PM EDT)',
119
+ dates: ['2026-03-09T08:00:00.000Z', '2026-03-09T16:00:00.000Z'],
120
+ },
121
+ {
122
+ source: 'https://forums.elderscrollsonline.com',
123
+ raw: '[IN PROGRESS] EU megaservers for patch maintenance - March 9, 8:00 UTC (4:00AM EDT) - 16:00 UTC (12:00PM EDT)',
124
+ pattern: '[IN PROGRESS] EU megaservers for maintenance - [month] [day number], [hour]:[minute] [timezone] ([hour]:[minute][meridiem] [timezone]) - [hour]:[minute] [timezone] ([hour]:[minute][meridiem] [timezone])',
125
+ slug: 'server_xbox_eu',
126
+ type: 'server',
127
+ support: 'xbox',
128
+ zone: 'eu',
129
+ status: 'down',
130
+ rawStatus: '[IN PROGRESS]',
131
+ rawSlug: '[IN PROGRESS] EU megaservers',
132
+ rawDate: 'March 9, 8:00 UTC (4:00AM EDT) - 16:00 UTC (12:00PM EDT)',
133
+ dates: ['2026-03-09T08:00:00.000Z', '2026-03-09T16:00:00.000Z'],
134
+ },
135
+ {
136
+ source: 'https://forums.elderscrollsonline.com',
137
+ raw: 'ESO Store and Account System for maintenance - March 11, 9:00AM EDT (13:00 UTC) - 1:00PM EDT (17:00 UTC)',
138
+ pattern: 'ESO Store and Account System for maintenance - [month] [day number], [hour]:[minute][meridiem] [timezone] ([hour]:[minute] [timezone]) - [hour]:[minute][meridiem] [timezone] ([hour]:[minute] [timezone])',
139
+ slug: 'service_store_eso',
140
+ type: 'service',
141
+ support: 'store',
142
+ zone: 'eso',
143
+ status: 'planned',
144
+ rawSlug: 'ESO Store',
145
+ rawDate: 'March 11, 9:00AM EDT (13:00 UTC) - 1:00PM EDT (17:00 UTC)',
146
+ dates: ['2026-03-11T13:00:00.000Z', '2026-03-11T17:00:00.000Z'],
147
+ },
148
+ {
149
+ source: 'https://forums.elderscrollsonline.com',
150
+ raw: 'ESO Store and Account System for maintenance - March 11, 9:00AM EDT (13:00 UTC) - 1:00PM EDT (17:00 UTC)',
151
+ pattern: 'ESO Store and Account System for maintenance - [month] [day number], [hour]:[minute][meridiem] [timezone] ([hour]:[minute] [timezone]) - [hour]:[minute][meridiem] [timezone] ([hour]:[minute] [timezone])',
152
+ slug: 'service_system_account',
153
+ type: 'service',
154
+ support: 'system',
155
+ zone: 'account',
156
+ status: 'planned',
157
+ rawSlug: 'Account System',
158
+ rawDate: 'March 11, 9:00AM EDT (13:00 UTC) - 1:00PM EDT (17:00 UTC)',
159
+ dates: ['2026-03-11T13:00:00.000Z', '2026-03-11T17:00:00.000Z'],
160
+ },
155
161
  ]
156
162
  ```
@@ -1,5 +1,6 @@
1
1
  import { SourceUrl } from './type/sourceUrl.type';
2
2
  import { EsoStatusRawData } from './interface/esoStatusRawData.interface';
3
+ import { MessagePatternType } from './type/messagePattern.type';
3
4
  /**
4
5
  * Class for retrieving information from announcements
5
6
  */
@@ -14,6 +15,30 @@ export default class Connector {
14
15
  * List of information from announcements
15
16
  */
16
17
  rawEsoStatus: EsoStatusRawData[];
18
+ /**
19
+ * Sanitized remote content to compare changes between two versions
20
+ * @private
21
+ */
22
+ private sanitizedRemoteContent;
23
+ /**
24
+ * Patterns that matched the raw messages from the data source
25
+ */
26
+ patterns: MessagePatternType[];
27
+ /**
28
+ * List of information from announcements by zone
29
+ * @private
30
+ */
31
+ private readonly messagesZones;
32
+ /**
33
+ * List of raw data from announcements
34
+ * @private
35
+ */
36
+ private readonly messages;
37
+ /**
38
+ * List of sanitized data from announcements
39
+ * @private
40
+ */
41
+ private sanitizedMessages;
17
42
  /**
18
43
  * @param url URL used as the source to retrieve announcements
19
44
  * @param remoteContent Content of the source retrieved via URL
@@ -30,6 +55,11 @@ export default class Connector {
30
55
  * @private
31
56
  */
32
57
  private static getRemoteContent;
58
+ /**
59
+ * Get a sanitized remote content to compare changes between two versions
60
+ * @private
61
+ */
62
+ private cleanRemoteContent;
33
63
  /**
34
64
  * Method for retrieving raw announcements for all announcement levels
35
65
  * @private
@@ -40,15 +70,15 @@ export default class Connector {
40
70
  * @private
41
71
  */
42
72
  private getMessagesByType;
43
- /**
44
- * Method for formatting the raw data of retrieved announcements
45
- * @private
46
- */
47
- private replace;
48
73
  /**
49
74
  * Method for separating each announcement message
50
75
  */
51
76
  private split;
77
+ /**
78
+ * Method for formatting the raw data of retrieved announcements
79
+ * @private
80
+ */
81
+ private sanitize;
52
82
  /**
53
83
  * Method for removing unnecessary announcements
54
84
  * @private
@@ -65,4 +95,9 @@ export default class Connector {
65
95
  * @private
66
96
  */
67
97
  private fetchEach;
98
+ /**
99
+ * Method to get all patterns
100
+ * @private
101
+ */
102
+ private generatePatternList;
68
103
  }
package/lib/connector.js CHANGED
@@ -1,7 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const axios_1 = require("axios");
4
3
  const raw_1 = require("./raw");
4
+ const axios_1 = require("axios");
5
+ const ForumMessagePtsUrl_const_1 = require("./const/ForumMessagePtsUrl.const");
6
+ const types_1 = require("@eso-status/types");
7
+ const messageSanitize_pattern_1 = require("./pattern/message/messageSanitize.pattern");
8
+ const messageFilter_pattern_1 = require("./pattern/message/messageFilter.pattern");
9
+ const forumMessagePtsReplace_pattern_1 = require("./pattern/content/forumMessagePtsReplace.pattern");
10
+ const forumMessageReplace_pattern_1 = require("./pattern/content/forumMessageReplace.pattern");
5
11
  /**
6
12
  * Class for retrieving information from announcements
7
13
  */
@@ -16,6 +22,30 @@ class Connector {
16
22
  * List of information from announcements
17
23
  */
18
24
  rawEsoStatus = [];
25
+ /**
26
+ * Sanitized remote content to compare changes between two versions
27
+ * @private
28
+ */
29
+ sanitizedRemoteContent = '';
30
+ /**
31
+ * Patterns that matched the raw messages from the data source
32
+ */
33
+ patterns = [];
34
+ /**
35
+ * List of information from announcements by zone
36
+ * @private
37
+ */
38
+ messagesZones = [];
39
+ /**
40
+ * List of raw data from announcements
41
+ * @private
42
+ */
43
+ messages = [];
44
+ /**
45
+ * List of sanitized data from announcements
46
+ * @private
47
+ */
48
+ sanitizedMessages = [];
19
49
  /**
20
50
  * @param url URL used as the source to retrieve announcements
21
51
  * @param remoteContent Content of the source retrieved via URL
@@ -23,11 +53,14 @@ class Connector {
23
53
  constructor(url, remoteContent) {
24
54
  this.url = url;
25
55
  this.remoteContent = remoteContent;
56
+ this.sanitizedRemoteContent = this.remoteContent;
57
+ this.cleanRemoteContent();
26
58
  this.getMessages();
27
- this.replace();
28
59
  this.split();
60
+ this.sanitize();
29
61
  this.filter();
30
62
  this.fetch();
63
+ this.generatePatternList();
31
64
  }
32
65
  /**
33
66
  * Method for creating an instance of the connector via a URL
@@ -45,6 +78,20 @@ class Connector {
45
78
  const response = await axios_1.default.get(url);
46
79
  return response.status === 200 && !!response.data ? response.data : '';
47
80
  }
81
+ /**
82
+ * Get a sanitized remote content to compare changes between two versions
83
+ * @private
84
+ */
85
+ cleanRemoteContent() {
86
+ for (const [pattern, replacement] of forumMessageReplace_pattern_1.default) {
87
+ this.sanitizedRemoteContent = this.sanitizedRemoteContent.replace(pattern, replacement.toString());
88
+ }
89
+ if (this.url === ForumMessagePtsUrl_const_1.default) {
90
+ for (const [pattern, replacement] of forumMessagePtsReplace_pattern_1.default) {
91
+ this.sanitizedRemoteContent = this.sanitizedRemoteContent.replace(pattern, replacement.toString());
92
+ }
93
+ }
94
+ }
48
95
  /**
49
96
  * Method for retrieving raw announcements for all announcement levels
50
97
  * @private
@@ -59,70 +106,29 @@ class Connector {
59
106
  * @private
60
107
  */
61
108
  getMessagesByType(type) {
62
- const split = this.remoteContent.split(`<div class="DismissMessage ${type}">`);
63
- split.shift();
64
- split.forEach((item) => {
65
- const result = item.split('</div>');
66
- if (result.length >= 2) {
67
- this.raw.push(result[0]);
68
- }
69
- });
109
+ const regex = new RegExp(String.raw `<div[^>]*class="[^"]*DismissMessage ${type}[^"]*"[^>]*>([\s\S]*?)<\/div>`, 'g');
110
+ for (const match of this.remoteContent.matchAll(regex)) {
111
+ this.messagesZones.push(match[1]);
112
+ }
70
113
  }
71
114
  /**
72
- * Method for formatting the raw data of retrieved announcements
73
- * @private
115
+ * Method for separating each announcement message
74
116
  */
75
- replace() {
76
- const list = [];
77
- this.raw.forEach((raw) => {
78
- raw.split('<br').forEach((line) => {
79
- const split = line.split('/>');
80
- list.push(split.join(''));
81
- });
82
- });
83
- this.raw = list.map((raw) => {
84
- let initialRaw = raw;
85
- initialRaw = initialRaw.replace(' 。', '');
86
- initialRaw = initialRaw.replaceAll('\n', '');
87
- initialRaw = initialRaw.replaceAll('>•', '•');
88
- initialRaw = initialRaw.replaceAll(' •', '•');
89
- initialRaw = initialRaw.replaceAll('<br/>\n', '<br>');
90
- initialRaw = initialRaw.replace(' Thank you for your patience!', '');
91
- initialRaw = initialRaw.replace(' Thank you for your patience.', '');
92
- initialRaw = initialRaw.replace(' We will update as new information becomes available.', '');
93
- initialRaw = initialRaw.replace(' If you continue to experience difficulties at login, please restart your client. Thank you for your patience!', '');
94
- initialRaw = initialRaw.replace(' ', ' ');
95
- if (initialRaw.includes('\t')) {
96
- const split = initialRaw.split('\t');
97
- if (split[0] === ' ') {
98
- return split[1];
99
- }
100
- if (split[0].includes('•')) {
101
- return `• ${split[1]}`;
102
- }
103
- }
104
- if (initialRaw.endsWith(' ')) {
105
- initialRaw = initialRaw.substring(0, initialRaw.length - 1);
106
- }
107
- if (initialRaw.includes('. Please check here for status updates: <a href')) {
108
- return initialRaw.split(' Please check here for status updates: <a href')[0];
109
- }
110
- if (initialRaw.includes(' <a href')) {
111
- return initialRaw.split(' <a href')[0];
112
- }
113
- return initialRaw;
117
+ split() {
118
+ this.messagesZones.forEach((messagesZone) => {
119
+ this.messages.push(...messagesZone.split(/<br\s*\/?>/i));
114
120
  });
115
121
  }
116
122
  /**
117
- * Method for separating each announcement message
123
+ * Method for formatting the raw data of retrieved announcements
124
+ * @private
118
125
  */
119
- split() {
120
- const rawList = this.raw;
121
- this.raw = [];
122
- rawList.forEach((raw) => {
123
- raw.split('<br>').forEach((split) => {
124
- this.raw.push(split);
125
- });
126
+ sanitize() {
127
+ this.sanitizedMessages = this.messages.map((message) => {
128
+ for (const [pattern, replacement] of messageSanitize_pattern_1.default) {
129
+ message = message.replace(pattern, replacement.toString());
130
+ }
131
+ return message;
126
132
  });
127
133
  }
128
134
  /**
@@ -130,14 +136,8 @@ class Connector {
130
136
  * @private
131
137
  */
132
138
  filter() {
133
- this.raw = this.raw.filter((raw) => {
134
- return (!raw.includes('Maintenance for the week of ') &&
135
- !raw.includes('Mantenimiento de la semana del ') &&
136
- !raw.includes('• PC/Mac: No maintenance – ') &&
137
- !raw.includes('hora peninsular') &&
138
- raw !== '' &&
139
- !raw.startsWith('<') &&
140
- !raw.endsWith('>'));
139
+ this.raw = this.sanitizedMessages.filter((message) => {
140
+ return (messageFilter_pattern_1.default.filter((pattern) => pattern.test(message)).length === 0);
141
141
  });
142
142
  }
143
143
  /**
@@ -159,6 +159,32 @@ class Connector {
159
159
  this.rawEsoStatus.push(match);
160
160
  });
161
161
  }
162
+ /**
163
+ * Method to get all patterns
164
+ * @private
165
+ */
166
+ generatePatternList() {
167
+ [
168
+ types_1.ServerPcEuSlug,
169
+ types_1.ServerPcNaSlug,
170
+ types_1.ServerPcPtsSlug,
171
+ types_1.ServerPsEuSlug,
172
+ types_1.ServerPsNaSlug,
173
+ types_1.ServerXboxEuSlug,
174
+ types_1.ServerXboxNaSlug,
175
+ types_1.ServiceStoreEsoSlug,
176
+ types_1.ServiceSystemAccountSlug,
177
+ types_1.ServiceWebSiteSlug,
178
+ ].forEach((slug) => {
179
+ this.rawEsoStatus.forEach((rawEsoStatus) => {
180
+ if (rawEsoStatus.slug === slug) {
181
+ if (!this.patterns.includes(rawEsoStatus.pattern)) {
182
+ this.patterns.push(rawEsoStatus.pattern);
183
+ }
184
+ }
185
+ });
186
+ });
187
+ }
162
188
  }
163
189
  exports.default = Connector;
164
190
  //# sourceMappingURL=connector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connector.js","sourceRoot":"","sources":["../src/connector.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,3 @@
1
+ import { SourceUrlForumMessagePtsType } from '../type/sourceUrlForumMessagePts.type';
2
+ declare const ForumMessagePtsUrl: SourceUrlForumMessagePtsType;
3
+ export default ForumMessagePtsUrl;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const ForumMessagePtsUrl = 'https://forums.elderscrollsonline.com/en/categories/pts';
4
+ exports.default = ForumMessagePtsUrl;
5
+ //# sourceMappingURL=ForumMessagePtsUrl.const.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ForumMessagePtsUrl.const.js","sourceRoot":"","sources":["../../src/const/ForumMessagePtsUrl.const.ts"],"names":[],"mappings":";;AAEA,MAAM,kBAAkB,GACtB,yDAAyD,CAAC;AAC5D,kBAAe,kBAAkB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { SourceUrlForumMessageType } from '../type/sourceUrlForumMessage.type';
2
+ declare const ForumMessageUrl: SourceUrlForumMessageType;
3
+ export default ForumMessageUrl;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const ForumMessageUrl = 'https://forums.elderscrollsonline.com';
4
+ exports.default = ForumMessageUrl;
5
+ //# sourceMappingURL=ForumMessageUrl.const.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ForumMessageUrl.const.js","sourceRoot":"","sources":["../../src/const/ForumMessageUrl.const.ts"],"names":[],"mappings":";;AAEA,MAAM,eAAe,GACnB,uCAAuC,CAAC;AAC1C,kBAAe,eAAe,CAAC"}
@@ -44,12 +44,12 @@ class DateFormatter {
44
44
  * @private
45
45
  */
46
46
  getRawClassicDate() {
47
- const split = this.raw.split(' ');
47
+ const split = this.raw.split(' - ');
48
48
  if (split.length > 2) {
49
49
  split.shift();
50
- return split.join(' ');
50
+ return split.join(' - ');
51
51
  }
52
- return split.length === 2 ? split[1] : '';
52
+ return '';
53
53
  }
54
54
  /**
55
55
  * Method for retrieving the raw date in case #2
@@ -126,9 +126,10 @@ class DateFormatter {
126
126
  * @private
127
127
  */
128
128
  formatSpecial() {
129
- const date = this.getSpecialDate();
129
+ const hours = this.getRawHour();
130
+ const date = this.getSpecialDate(hours);
130
131
  return [
131
- DateFormatter.generateDate(date.get('years'), date.get('months'), date.get('dates'), this.getRawHour(), this.getRawSpecialMinute()),
132
+ DateFormatter.generateDate(date.get('years'), date.get('months'), date.get('dates'), hours, this.getRawSpecialMinute()),
132
133
  ];
133
134
  }
134
135
  /**
@@ -136,13 +137,15 @@ class DateFormatter {
136
137
  * 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.
137
138
  * @private
138
139
  */
139
- getSpecialDate() {
140
+ getSpecialDate(hours) {
140
141
  const current = moment();
141
142
  const targetDayIndex = moment()
142
143
  .days(this.rawDate.split(' ')[0])
143
144
  .get('days');
144
145
  current.set('days', targetDayIndex);
145
- if (moment().get('days') > targetDayIndex) {
146
+ if (moment().get('days') > targetDayIndex ||
147
+ (moment().get('days') === targetDayIndex &&
148
+ hours < moment().utc().get('hours'))) {
146
149
  current.add(1, 'week');
147
150
  }
148
151
  return current;