@eso-status/service-alerts 1.0.8 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -1,77 +1,33 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
4
  };
38
5
  Object.defineProperty(exports, "__esModule", { value: true });
39
6
  exports.ServiceAlerts = void 0;
40
- var ServiceAlertConnector_1 = require("./connectors/ServiceAlertConnector");
7
+ const ServiceAlertConnector_1 = __importDefault(require("./connectors/ServiceAlertConnector"));
41
8
  /**
42
9
  * Class of Service Alerts
43
10
  */
44
- var ServiceAlerts = /** @class */ (function () {
45
- function ServiceAlerts() {
46
- }
11
+ // eslint-disable-next-line @typescript-eslint/no-extraneous-class -- the published 1.x API exposes static methods, called as is by @eso-status/api 1.x
12
+ class ServiceAlerts {
47
13
  /**
48
- * Methode used to get Service Alerts data
49
- *
50
- * @public
51
- * @static
52
- *
53
- * @return Promise<RawEsoStatus[]> Service Alerts elements
54
- */
55
- ServiceAlerts.getData = function () {
56
- return __awaiter(this, void 0, void 0, function () {
57
- var remoteContent, filteredContent, filteredContentList, rawData, splitRawData, splitRawDataWithSlug, splitRawDataList, lastRawData;
58
- return __generator(this, function (_a) {
59
- switch (_a.label) {
60
- case 0: return [4 /*yield*/, ServiceAlertConnector_1.default.getRemoteContent()];
61
- case 1:
62
- remoteContent = _a.sent();
63
- filteredContent = ServiceAlertConnector_1.default.getFilterContent(remoteContent);
64
- filteredContentList = ServiceAlertConnector_1.default.changeFilterContentForList(filteredContent);
65
- rawData = ServiceAlertConnector_1.default.getRawData(filteredContentList);
66
- splitRawData = ServiceAlertConnector_1.default.splitRawData(rawData);
67
- splitRawDataWithSlug = ServiceAlertConnector_1.default.getSlugOfSplitRawData(splitRawData);
68
- splitRawDataList = ServiceAlertConnector_1.default.splitRawDataList(splitRawDataWithSlug);
69
- lastRawData = ServiceAlertConnector_1.default.getLastRawData(splitRawDataList);
70
- return [2 /*return*/, ServiceAlertConnector_1.default.getData(lastRawData)];
71
- }
72
- });
73
- });
74
- };
75
- return ServiceAlerts;
76
- }());
14
+ * Methode used to get Service Alerts data
15
+ *
16
+ * @public
17
+ * @static
18
+ *
19
+ * @return Promise<RawEsoStatus[]> Service Alerts elements
20
+ */
21
+ static async getData() {
22
+ const remoteContent = await ServiceAlertConnector_1.default.getRemoteContent();
23
+ const filteredContent = ServiceAlertConnector_1.default.getFilterContent(remoteContent);
24
+ const filteredContentList = ServiceAlertConnector_1.default.changeFilterContentForList(filteredContent);
25
+ const rawData = ServiceAlertConnector_1.default.getRawData(filteredContentList);
26
+ const splitRawData = ServiceAlertConnector_1.default.splitRawData(rawData);
27
+ const splitRawDataWithSlug = ServiceAlertConnector_1.default.getSlugOfSplitRawData(splitRawData);
28
+ const splitRawDataList = ServiceAlertConnector_1.default.splitRawDataList(splitRawDataWithSlug);
29
+ const lastRawData = ServiceAlertConnector_1.default.getLastRawData(splitRawDataList);
30
+ return ServiceAlertConnector_1.default.getData(lastRawData);
31
+ }
32
+ }
77
33
  exports.ServiceAlerts = ServiceAlerts;
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@eso-status/service-alerts",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
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",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
7
+ "format": "prettier --write \"src/**/*.ts\" \"tests/**/*.ts\"",
8
+ "lint": "eslint \"{src,tests}/**/*.ts\"",
9
+ "lint:fix": "eslint \"{src,tests}/**/*.ts\" --fix",
7
10
  "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
11
  "build": "rm -R -f lib/* && tsc",
11
12
  "test": "jest",
12
13
  "start": "node .",
@@ -33,7 +34,7 @@
33
34
  },
34
35
  "repository": {
35
36
  "type": "git",
36
- "url": "git@github.com:eso-status/service-alerts.git"
37
+ "url": "git+https://github.com/eso-status/service-alerts.git"
37
38
  },
38
39
  "author": "@dov118 <contact@dov118.dev> (https://dov118.dev)",
39
40
  "license": "MIT",
@@ -42,23 +43,29 @@
42
43
  },
43
44
  "homepage": "https://github.com/eso-status/service-alerts#readme",
44
45
  "devDependencies": {
45
- "@eso-status/types": "1.0.7",
46
- "@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
- "eslint": "8.57.0",
52
- "eslint-config-airbnb-base": "15.0.0",
53
- "eslint-plugin-import": "2.29.1",
54
- "eslint-plugin-jest": "28.8.0",
55
- "jest": "29.7.0",
56
- "nodemon": "3.1.4",
57
- "ts-jest": "29.2.5",
58
- "typescript": "5.5.4"
46
+ "@eslint/js": "10.0.1",
47
+ "@eso-status/types": "1.0.9",
48
+ "@types/jest": "30.0.0",
49
+ "@types/node": "26.6.6",
50
+ "eslint": "10.15.0",
51
+ "eslint-config-prettier": "10.1.8",
52
+ "eslint-plugin-jest": "29.17.0",
53
+ "eslint-plugin-sonarjs": "4.2.2",
54
+ "eslint-plugin-unused-imports": "4.4.1",
55
+ "globals": "17.14.0",
56
+ "jest": "30.5.2",
57
+ "nodemon": "3.1.14",
58
+ "prettier": "3.10.1",
59
+ "ts-jest": "29.4.15",
60
+ "typescript": "6.0.3",
61
+ "typescript-eslint": "8.72.2"
59
62
  },
60
63
  "dependencies": {
61
- "axios": "1.7.5",
62
- "moment": "2.30.1"
64
+ "axios": "1.21.1",
65
+ "moment": "2.31.0"
66
+ },
67
+ "overrides": {
68
+ "minimatch@>=7.0.0 <11.0.1": "11.0.1",
69
+ "glob@>=9.0.0 <=14.0.1": "14.0.2"
63
70
  }
64
71
  }