@eso-status/service-alerts 1.0.8 → 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 (55) hide show
  1. package/LICENSE.md +1 -1
  2. package/README.md +108 -204
  3. package/lib/connector.d.ts +65 -0
  4. package/lib/connector.js +122 -0
  5. package/lib/const.d.ts +6 -0
  6. package/lib/const.js +8 -0
  7. package/lib/formatter/date.formatter.d.ts +19 -0
  8. package/lib/formatter/date.formatter.js +32 -0
  9. package/lib/identifier/slug.identifier.d.ts +89 -0
  10. package/lib/identifier/slug.identifier.js +140 -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 +58 -0
  14. package/lib/identifier/status.identifier.js +74 -0
  15. package/lib/index.d.ts +6 -11
  16. package/lib/index.js +11 -72
  17. package/lib/interface/esoStatusRawData.interface.d.ts +54 -0
  18. package/lib/interface/esoStatusRawData.interface.js +3 -0
  19. package/lib/raw.d.ts +39 -0
  20. package/lib/raw.js +52 -0
  21. package/lib/type/remoteDownRawStatus.type.d.ts +4 -0
  22. package/lib/type/remoteDownRawStatus.type.js +3 -0
  23. package/lib/type/remoteIssuesRawStatus.type.d.ts +4 -0
  24. package/lib/type/remoteIssuesRawStatus.type.js +3 -0
  25. package/lib/type/remoteRawSlug.type.d.ts +13 -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/remoteUpRawStatus.type.d.ts +4 -0
  48. package/lib/type/remoteUpRawStatus.type.js +3 -0
  49. package/lib/type/sourceUrl.type.d.ts +4 -0
  50. package/lib/type/sourceUrl.type.js +3 -0
  51. package/package.json +107 -36
  52. package/lib/classes/ServiceAlertsElement.d.ts +0 -100
  53. package/lib/classes/ServiceAlertsElement.js +0 -284
  54. package/lib/connectors/ServiceAlertConnector.d.ts +0 -112
  55. package/lib/connectors/ServiceAlertConnector.js +0 -263
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Different statuses of announcements indicating that the announcement refers to an inaccessible service/server
3
+ */
4
+ export type RemoteDownRawStatus = 'currently unavailable';
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=remoteDownRawStatus.type.js.map
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Different statuses of announcements indicating that the announcement refers to a service/server that is not functioning properly
3
+ */
4
+ export type RemoteIssuesRawStatus = 'currently investigating issues' | 'currently experiencing a service interruption';
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=remoteIssuesRawStatus.type.js.map
@@ -0,0 +1,13 @@
1
+ import { RemoteServerPcEuRawSlug } from './remoteServerPcEuRawSlug.type';
2
+ import { RemoteServerPcNaRawSlug } from './remoteServerPcNaRawSlug.type';
3
+ import { RemoteServerPcPtsRawSlug } from './remoteServerPcPtsRawSlug.type';
4
+ import { RemoteServerPsEuRawSlug } from './remoteServerPsEuRawSlug.type';
5
+ import { RemoteServerPsNaRawSlug } from './remoteServerPsNaRawSlug.type';
6
+ import { RemoteServerXboxEuRawSlug } from './remoteServerXboxEuRawSlug.type';
7
+ import { RemoteServerXboxNaRawSlug } from './remoteServerXboxNaRawSlug.type';
8
+ import { RemoteServiceStoreEsoRawSlug } from './remoteServiceStoreEsoRawSlug.type';
9
+ import { RemoteServiceSystemAccountRawSlug } from './remoteServiceSystemAccountRawSlug.type';
10
+ /**
11
+ * Different slugs of announcements
12
+ */
13
+ export type RemoteRawSlug = RemoteServerPcEuRawSlug | RemoteServerPsEuRawSlug | RemoteServerXboxEuRawSlug | RemoteServerPcNaRawSlug | RemoteServerPsNaRawSlug | RemoteServerXboxNaRawSlug | RemoteServerPcPtsRawSlug | RemoteServiceStoreEsoRawSlug | RemoteServiceSystemAccountRawSlug;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=remoteRawSlug.type.js.map
@@ -0,0 +1,7 @@
1
+ import { RemoteUpRawStatus } from './remoteUpRawStatus.type';
2
+ import { RemoteDownRawStatus } from './remoteDownRawStatus.type';
3
+ import { RemoteIssuesRawStatus } from './remoteIssuesRawStatus.type';
4
+ /**
5
+ * Different statuses of announcements
6
+ */
7
+ export type RemoteRawStatus = RemoteUpRawStatus | RemoteDownRawStatus | RemoteIssuesRawStatus;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=remoteRawStatus.type.js.map
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Different slugs of announcements concerning the European PC/Mac Megaserver
3
+ */
4
+ export type RemoteServerPcEuRawSlug = 'The European megaservers' | 'The European PC/Mac megaserver';
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=remoteServerPcEuRawSlug.type.js.map
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Different slugs of announcements concerning the North American PC/Mac Megaserver
3
+ */
4
+ export type RemoteServerPcNaRawSlug = 'The North American megaservers' | 'The North American PC/Mac megaserver';
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=remoteServerPcNaRawSlug.type.js.map
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Different slugs of announcements concerning the PTS
3
+ */
4
+ export type RemoteServerPcPtsRawSlug = 'PTS';
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=remoteServerPcPtsRawSlug.type.js.map
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Different slugs of announcements concerning the European PlayStation® Megaserver
3
+ */
4
+ export type RemoteServerPsEuRawSlug = 'The European megaservers' | 'The European PlayStation® megaserver';
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=remoteServerPsEuRawSlug.type.js.map
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Different slugs of announcements concerning the North American PlayStation® Megaserver
3
+ */
4
+ export type RemoteServerPsNaRawSlug = 'The North American megaservers' | 'North American PlayStation® megaserver';
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=remoteServerPsNaRawSlug.type.js.map
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Different slugs of announcements concerning the European Xbox Megaserver
3
+ */
4
+ export type RemoteServerXboxEuRawSlug = 'The European megaservers' | 'The European Xbox megaserver' | 'North American and European Xbox megaservers' | 'Xbox Live™';
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=remoteServerXboxEuRawSlug.type.js.map
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Different slugs of announcements concerning the North American Xbox Megaserver
3
+ */
4
+ export type RemoteServerXboxNaRawSlug = 'The North American megaservers' | 'The North American Xbox megaserver' | 'North American and European Xbox megaservers' | 'Xbox Live™';
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=remoteServerXboxNaRawSlug.type.js.map
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Different slugs of announcements concerning the ESO store
3
+ */
4
+ export type RemoteServiceStoreEsoRawSlug = 'ESO store';
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=remoteServiceStoreEsoRawSlug.type.js.map
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Different slugs of announcements concerning the account system
3
+ */
4
+ export type RemoteServiceSystemAccountRawSlug = 'account system';
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=remoteServiceSystemAccountRawSlug.type.js.map
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Different statuses of announcements indicating that the announcement refers to an accessible service/server
3
+ */
4
+ export type RemoteUpRawStatus = 'currently available' | 'been resolved';
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=remoteUpRawStatus.type.js.map
@@ -0,0 +1,4 @@
1
+ /**
2
+ * URL serving as source for retrieving maintenance announcements
3
+ */
4
+ export type SourceUrl = 'https://help.elderscrollsonline.com/app/answers/detail/a_id/4320';
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=sourceUrl.type.js.map
package/package.json CHANGED
@@ -1,64 +1,135 @@
1
1
  {
2
2
  "name": "@eso-status/service-alerts",
3
- "version": "1.0.8",
4
- "description": "Library used to get servers status of The elders scrolls Online game with https://help.elderscrollsonline.com/app/answers/detail/a_id/4320",
3
+ "version": "2.0.0-dev.0",
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
6
  "main": "lib/index.js",
6
- "scripts": {
7
- "post-install": "cp pre-commit .git/hooks/ && chmod +x .git/hooks/pre-commit && echo 'hook copied'",
8
- "lint": "eslint tests src --ext .ts",
9
- "lint:fix": "eslint tests src --ext .ts --fix",
10
- "build": "rm -R -f lib/* && tsc",
11
- "test": "jest",
12
- "start": "node .",
13
- "dev": "npm run lint && npm run build && npm run start",
14
- "dev:test": "npm run lint && npm run build && npm run test",
15
- "watch": "nodemon --exec npm run dev",
16
- "watch:test": "nodemon --exec npm run dev:test"
17
- },
7
+ "license": "MIT",
8
+ "engineStrict": true,
18
9
  "files": [
19
- "lib/classes/ServiceAlertsElement.d.ts",
20
- "lib/classes/ServiceAlertsElement.js",
21
- "lib/connectors/ServiceAlertConnector.d.ts",
22
- "lib/connectors/ServiceAlertConnector.js",
10
+ "lib/formatter/date.formatter.d.ts",
11
+ "lib/formatter/date.formatter.js",
12
+ "lib/identifier/slug.identifier.d.ts",
13
+ "lib/identifier/slug.identifier.js",
14
+ "lib/identifier/slug.match.d.ts",
15
+ "lib/identifier/slug.match.js",
16
+ "lib/identifier/status.identifier.d.ts",
17
+ "lib/identifier/status.identifier.js",
18
+ "lib/interface/esoStatusRawData.interface.d.ts",
19
+ "lib/interface/esoStatusRawData.interface.js",
20
+ "lib/type/remoteDownRawStatus.type.d.ts",
21
+ "lib/type/remoteDownRawStatus.type.js",
22
+ "lib/type/remoteIssuesRawStatus.type.d.ts",
23
+ "lib/type/remoteIssuesRawStatus.type.js",
24
+ "lib/type/remoteRawSlug.type.d.ts",
25
+ "lib/type/remoteRawSlug.type.js",
26
+ "lib/type/remoteRawStatus.type.d.ts",
27
+ "lib/type/remoteRawStatus.type.js",
28
+ "lib/type/remoteServerPcEuRawSlug.type.d.ts",
29
+ "lib/type/remoteServerPcEuRawSlug.type.js",
30
+ "lib/type/remoteServerPcNaRawSlug.type.d.ts",
31
+ "lib/type/remoteServerPcNaRawSlug.type.js",
32
+ "lib/type/remoteServerPcPtsRawSlug.type.d.ts",
33
+ "lib/type/remoteServerPcPtsRawSlug.type.js",
34
+ "lib/type/remoteServerPsEuRawSlug.type.d.ts",
35
+ "lib/type/remoteServerPsEuRawSlug.type.js",
36
+ "lib/type/remoteServerPsNaRawSlug.type.d.ts",
37
+ "lib/type/remoteServerPsNaRawSlug.type.js",
38
+ "lib/type/remoteServerXboxEuRawSlug.type.d.ts",
39
+ "lib/type/remoteServerXboxEuRawSlug.type.js",
40
+ "lib/type/remoteServerXboxNaRawSlug.type.d.ts",
41
+ "lib/type/remoteServerXboxNaRawSlug.type.js",
42
+ "lib/type/remoteServiceStoreEsoRawSlug.type.d.ts",
43
+ "lib/type/remoteServiceStoreEsoRawSlug.type.js",
44
+ "lib/type/remoteServiceSystemAccountRawSlug.type.d.ts",
45
+ "lib/type/remoteServiceSystemAccountRawSlug.type.js",
46
+ "lib/type/remoteUpRawStatus.type.d.ts",
47
+ "lib/type/remoteUpRawStatus.type.js",
48
+ "lib/type/sourceUrl.type.d.ts",
49
+ "lib/type/sourceUrl.type.js",
50
+ "lib/connector.d.ts",
51
+ "lib/connector.js",
52
+ "lib/const.d.ts",
53
+ "lib/const.js",
23
54
  "lib/index.d.ts",
24
55
  "lib/index.js",
25
- ".npmrc",
56
+ "lib/raw.d.ts",
57
+ "lib/raw.js",
58
+ ".npmrc,",
26
59
  "LICENSE.md",
27
60
  "package.json",
28
61
  "README.md"
29
62
  ],
30
- "engineStrict": true,
31
63
  "engines": {
32
- "node": ">=18.18.0 || >=20.0.0"
64
+ "node": "^18.18.0 || ^20.0.0"
65
+ },
66
+ "bugs": {
67
+ "url": "https://github.com/eso-status/service-alerts/issues"
33
68
  },
69
+ "homepage": "https://github.com/eso-status/service-alerts#readme",
34
70
  "repository": {
35
71
  "type": "git",
36
72
  "url": "git@github.com:eso-status/service-alerts.git"
37
73
  },
38
- "author": "@dov118 <contact@dov118.dev> (https://dov118.dev)",
39
- "license": "MIT",
40
- "bugs": {
41
- "url": "https://github.com/eso-status/service-alerts/issues"
74
+ "scripts": {
75
+ "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
76
+ "lint": "eslint \"{src,test}/**/*.ts\"",
77
+ "lint:fix": "eslint \"{src,test}/**/*.ts\" --fix",
78
+ "build": "rm -R -f lib/* && tsc --project tsconfig.build.json",
79
+ "dev": "npm run build && node .",
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",
84
+ "prepare": "husky"
85
+ },
86
+ "dependencies": {
87
+ "@eso-status/types": "2.0.0-dev.11",
88
+ "axios": "1.7.7",
89
+ "moment": "2.30.1"
42
90
  },
43
- "homepage": "https://github.com/eso-status/service-alerts#readme",
44
91
  "devDependencies": {
45
- "@eso-status/types": "1.0.7",
46
92
  "@types/jest": "29.5.12",
47
- "@types/node": "22.5.1",
48
- "@typescript-eslint/eslint-plugin": "7.18.0",
49
- "@typescript-eslint/parser": "7.18.0",
50
- "@typescript-eslint/typescript-estree": "7.18.0",
51
93
  "eslint": "8.57.0",
52
94
  "eslint-config-airbnb-base": "15.0.0",
53
- "eslint-plugin-import": "2.29.1",
54
- "eslint-plugin-jest": "28.8.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",
55
102
  "jest": "29.7.0",
56
103
  "nodemon": "3.1.4",
104
+ "prettier": "3.3.3",
57
105
  "ts-jest": "29.2.5",
58
106
  "typescript": "5.5.4"
59
107
  },
60
- "dependencies": {
61
- "axios": "1.7.5",
62
- "moment": "2.30.1"
108
+ "jest": {
109
+ "moduleFileExtensions": [
110
+ "js",
111
+ "json",
112
+ "ts"
113
+ ],
114
+ "rootDir": "./",
115
+ "testRegex": ".*\\.e2e-spec\\.ts|.*\\.spec\\.ts$",
116
+ "transform": {
117
+ "^.+\\.ts$": "ts-jest"
118
+ },
119
+ "collectCoverageFrom": [
120
+ "src/**/*.ts"
121
+ ],
122
+ "coverageDirectory": "./coverage",
123
+ "testEnvironment": "node",
124
+ "setupFiles": [
125
+ "dotenv/config"
126
+ ],
127
+ "moduleDirectories": [
128
+ "node_modules",
129
+ "src"
130
+ ],
131
+ "modulePaths": [
132
+ "<rootDir>"
133
+ ]
63
134
  }
64
135
  }
@@ -1,100 +0,0 @@
1
- import { Moment } from 'moment';
2
- import { Support, Slug, Status, Type, Zone } from '@eso-status/types';
3
- /**
4
- * Class with methode for ServiceAlerts element
5
- */
6
- export default class ServiceAlertsElement {
7
- /**
8
- * Methode used to get slugs list of raw content
9
- *
10
- * @public
11
- * @static
12
- *
13
- * @param rawData string Raw data
14
- * @return Slug[] List of slug
15
- */
16
- static getSlug(rawData: string): Slug[];
17
- /**
18
- * Methode used to determinate service type
19
- *
20
- * @public
21
- * @static
22
- *
23
- * @param type Type Type to check
24
- * @param rawData string Raw data
25
- * @return boolean Check result
26
- */
27
- static isType(type: Type, rawData: string): boolean;
28
- /**
29
- * Methode used to determinate service support
30
- *
31
- * @public
32
- * @static
33
- *
34
- * @param support Support Support to check
35
- * @param rawData string Raw data
36
- * @return boolean Check result
37
- */
38
- static isSupport(support: Support, rawData: string): boolean;
39
- /**
40
- * Methode used to determinate service zone
41
- *
42
- * @public
43
- * @static
44
- *
45
- * @param zone Zone Zone to check
46
- * @param rawData string Raw data
47
- * @return boolean Check result
48
- */
49
- static isZone(zone: Zone, rawData: string): boolean;
50
- /**
51
- * Methode used to get date of raw content
52
- *
53
- * @public
54
- * @static
55
- *
56
- * @param rawDate string Raw data
57
- * @return Moment Date of raw data
58
- */
59
- static getDate(rawDate: string): Moment;
60
- /**
61
- * Methode used to get type of slug
62
- *
63
- * @public
64
- * @static
65
- *
66
- * @param slug Slug Slug
67
- * @return Type Type of slug
68
- */
69
- static getType(slug: Slug): Type;
70
- /**
71
- * Methode used to get support of slug
72
- *
73
- * @public
74
- * @static
75
- *
76
- * @param slug Slug Slug
77
- * @return Support Support of slug
78
- */
79
- static getSupport(slug: Slug): Support;
80
- /**
81
- * Methode used to get zone of slug
82
- *
83
- * @public
84
- * @static
85
- *
86
- * @param slug Slug Slug
87
- * @return Zone Zone of slug
88
- */
89
- static getZone(slug: Slug): Zone;
90
- /**
91
- * Methode used to get status of raw data
92
- *
93
- * @public
94
- * @static
95
- *
96
- * @param rawData string Raw data
97
- * @return Status Status of raw data
98
- */
99
- static getStatus(rawData: string): Status;
100
- }