@eso-status/live-services 2.0.0-dev.0 → 2.0.0-dev.1
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/connector.d.ts +10 -0
- package/lib/connector.js +21 -0
- package/lib/const.d.ts +10 -0
- package/lib/const.js +49 -0
- package/lib/index.d.ts +10 -0
- package/lib/interface/esoStatusRawData.interface.d.ts +46 -0
- package/lib/interface/esoStatusRawData.interface.js +3 -0
- package/lib/interface/rawAssociation.interface.d.ts +10 -0
- package/lib/interface/rawAssociation.interface.js +3 -0
- package/lib/interface/remoteData.interface.d.ts +21 -0
- package/lib/interface/remoteData.interface.js +3 -0
- package/lib/type/remoteRaw.type.d.ts +4 -0
- package/lib/type/remoteRaw.type.js +3 -0
- package/lib/type/remoteRawSlug.type.d.ts +4 -0
- package/lib/type/remoteRawSlug.type.js +3 -0
- package/lib/type/remoteRawStatus.type.d.ts +4 -0
- package/lib/type/remoteRawStatus.type.js +3 -0
- package/lib/type/remoteResultCode.type.d.ts +4 -0
- package/lib/type/remoteResultCode.type.js +3 -0
- package/lib/type/remoteResultMessage.type.d.ts +4 -0
- package/lib/type/remoteResultMessage.type.js +3 -0
- package/lib/type/sourceUrl.type.d.ts +4 -0
- package/lib/type/sourceUrl.type.js +3 -0
- package/package.json +31 -2
package/lib/connector.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const axios_1 = require("axios");
|
|
4
|
+
const const_1 = require("./const");
|
|
5
|
+
/**
|
|
6
|
+
* Class for retrieving information from announcements
|
|
7
|
+
*/
|
|
8
|
+
class Connector {
|
|
9
|
+
/**
|
|
10
|
+
* Method for retrieving remote content via a URL
|
|
11
|
+
* @private
|
|
12
|
+
*/
|
|
13
|
+
static async getRemoteContent() {
|
|
14
|
+
const response = await axios_1.default.get(const_1.LiveServicesURL);
|
|
15
|
+
return response?.status === 200 && !!response?.data
|
|
16
|
+
? JSON.stringify(response?.data)
|
|
17
|
+
: '';
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.default = Connector;
|
|
21
|
+
//# sourceMappingURL=connector.js.map
|
package/lib/const.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RawAssociation } from './interface/rawAssociation.interface';
|
|
2
|
+
import { SourceUrl } from './type/sourceUrl.type';
|
|
3
|
+
/**
|
|
4
|
+
* URL serving as source for retrieving maintenance announcements
|
|
5
|
+
*/
|
|
6
|
+
export declare const LiveServicesURL: SourceUrl;
|
|
7
|
+
/**
|
|
8
|
+
* Association between raw data and its support and zone
|
|
9
|
+
*/
|
|
10
|
+
export declare const rawSupportZoneAssociations: RawAssociation[];
|
package/lib/const.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.rawSupportZoneAssociations = exports.LiveServicesURL = void 0;
|
|
4
|
+
const types_1 = require("@eso-status/types");
|
|
5
|
+
/**
|
|
6
|
+
* URL serving as source for retrieving maintenance announcements
|
|
7
|
+
*/
|
|
8
|
+
exports.LiveServicesURL = 'https://live-services.elderscrollsonline.com/status/realms';
|
|
9
|
+
/**
|
|
10
|
+
* Association between raw data and its support and zone
|
|
11
|
+
*/
|
|
12
|
+
exports.rawSupportZoneAssociations = [
|
|
13
|
+
{
|
|
14
|
+
raw: 'The Elder Scrolls Online (EU)',
|
|
15
|
+
support: types_1.PcSupport,
|
|
16
|
+
zone: types_1.EuZone,
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
raw: 'The Elder Scrolls Online (NA)',
|
|
20
|
+
support: types_1.PcSupport,
|
|
21
|
+
zone: types_1.NaZone,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
raw: 'The Elder Scrolls Online (PS4 - EU)',
|
|
25
|
+
support: types_1.PsSupport,
|
|
26
|
+
zone: types_1.EuZone,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
raw: 'The Elder Scrolls Online (PS4 - US)',
|
|
30
|
+
support: types_1.PsSupport,
|
|
31
|
+
zone: types_1.NaZone,
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
raw: 'The Elder Scrolls Online (PTS)',
|
|
35
|
+
support: types_1.PcSupport,
|
|
36
|
+
zone: types_1.PtsZone,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
raw: 'The Elder Scrolls Online (XBox - EU)',
|
|
40
|
+
support: types_1.XboxSupport,
|
|
41
|
+
zone: types_1.EuZone,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
raw: 'The Elder Scrolls Online (XBox - US)',
|
|
45
|
+
support: types_1.XboxSupport,
|
|
46
|
+
zone: types_1.NaZone,
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
//# sourceMappingURL=const.js.map
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { EsoStatusRawData } from './interface/esoStatusRawData.interface';
|
|
2
|
+
/**
|
|
3
|
+
* Class for retrieving announcement information
|
|
4
|
+
*/
|
|
5
|
+
export default class LiveServices {
|
|
6
|
+
/**
|
|
7
|
+
* Method for retrieving announcement information
|
|
8
|
+
*/
|
|
9
|
+
static getData(): Promise<EsoStatusRawData[]>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ServerTypeType, Slug, Status, Support, Zone } from '@eso-status/types';
|
|
2
|
+
import { RemoteRawStatus } from '../type/remoteRawStatus.type';
|
|
3
|
+
import { RemoteRawSlug } from '../type/remoteRawSlug.type';
|
|
4
|
+
import { RemoteRaw } from '../type/remoteRaw.type';
|
|
5
|
+
import { SourceUrl } from '../type/sourceUrl.type';
|
|
6
|
+
/**
|
|
7
|
+
* Raw data of an ESO server/service status
|
|
8
|
+
*/
|
|
9
|
+
export interface EsoStatusRawData {
|
|
10
|
+
/**
|
|
11
|
+
* URL of the data source
|
|
12
|
+
*/
|
|
13
|
+
source: SourceUrl;
|
|
14
|
+
/**
|
|
15
|
+
* Raw data used to identify the server/service and its status
|
|
16
|
+
*/
|
|
17
|
+
raw: RemoteRaw;
|
|
18
|
+
/**
|
|
19
|
+
* Status of the server/service
|
|
20
|
+
*/
|
|
21
|
+
status: Status;
|
|
22
|
+
/**
|
|
23
|
+
* Raw data used to identify the status
|
|
24
|
+
*/
|
|
25
|
+
rawStatus?: RemoteRawStatus;
|
|
26
|
+
/**
|
|
27
|
+
* Slug of the server/service
|
|
28
|
+
*/
|
|
29
|
+
slug: Slug;
|
|
30
|
+
/**
|
|
31
|
+
* Raw data used to identify the slug
|
|
32
|
+
*/
|
|
33
|
+
rawSlug: RemoteRawSlug;
|
|
34
|
+
/**
|
|
35
|
+
* Type of the server/service
|
|
36
|
+
*/
|
|
37
|
+
type: ServerTypeType;
|
|
38
|
+
/**
|
|
39
|
+
* Support of the server/service
|
|
40
|
+
*/
|
|
41
|
+
support: Support;
|
|
42
|
+
/**
|
|
43
|
+
* Zone of the server/service
|
|
44
|
+
*/
|
|
45
|
+
zone: Zone;
|
|
46
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Support, Zone } from '@eso-status/types';
|
|
2
|
+
import { RemoteRawSlug } from '../type/remoteRawSlug.type';
|
|
3
|
+
/**
|
|
4
|
+
* Structure of an association between a server, its support, and its zone
|
|
5
|
+
*/
|
|
6
|
+
export interface RawAssociation {
|
|
7
|
+
raw: RemoteRawSlug;
|
|
8
|
+
support: Support;
|
|
9
|
+
zone: Zone;
|
|
10
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { RemoteResultMessage } from '../type/remoteResultMessage.type';
|
|
2
|
+
import { RemoteResultCode } from '../type/remoteResultCode.type';
|
|
3
|
+
import { RemoteRawStatus } from '../type/remoteRawStatus.type';
|
|
4
|
+
/**
|
|
5
|
+
* Structure of the data returned by the API
|
|
6
|
+
*/
|
|
7
|
+
export interface RemoteData {
|
|
8
|
+
zos_platform_response: {
|
|
9
|
+
response: {
|
|
10
|
+
'The Elder Scrolls Online (EU)': RemoteRawStatus;
|
|
11
|
+
'The Elder Scrolls Online (NA)': RemoteRawStatus;
|
|
12
|
+
'The Elder Scrolls Online (PS4 - EU)': RemoteRawStatus;
|
|
13
|
+
'The Elder Scrolls Online (PS4 - US)': RemoteRawStatus;
|
|
14
|
+
'The Elder Scrolls Online (PTS)': RemoteRawStatus;
|
|
15
|
+
'The Elder Scrolls Online (XBox - EU)': RemoteRawStatus;
|
|
16
|
+
'The Elder Scrolls Online (XBox - US)': RemoteRawStatus;
|
|
17
|
+
};
|
|
18
|
+
result_code: RemoteResultCode;
|
|
19
|
+
result_message: RemoteResultMessage;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Different raw data from announcements
|
|
3
|
+
*/
|
|
4
|
+
export type RemoteRaw = '"The Elder Scrolls Online (EU)":"UP"' | '"The Elder Scrolls Online (EU)":"DOWN"' | '"The Elder Scrolls Online (NA)":"UP"' | '"The Elder Scrolls Online (NA)":"DOWN"' | '"The Elder Scrolls Online (PS4 - EU)":"UP"' | '"The Elder Scrolls Online (PS4 - EU)":"DOWN"' | '"The Elder Scrolls Online (PS4 - US)":"UP"' | '"The Elder Scrolls Online (PS4 - US)":"DOWN"' | '"The Elder Scrolls Online (XBox - EU)":"UP"' | '"The Elder Scrolls Online (XBox - EU)":"DOWN"' | '"The Elder Scrolls Online (XBox - US)":"UP"' | '"The Elder Scrolls Online (XBox - US)":"DOWN"' | '"The Elder Scrolls Online (PTS)":"UP"' | '"The Elder Scrolls Online (PTS)":"DOWN"';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Different slugs of announcements
|
|
3
|
+
*/
|
|
4
|
+
export type RemoteRawSlug = 'The Elder Scrolls Online (EU)' | 'The Elder Scrolls Online (NA)' | 'The Elder Scrolls Online (PS4 - EU)' | 'The Elder Scrolls Online (PS4 - US)' | 'The Elder Scrolls Online (PTS)' | 'The Elder Scrolls Online (XBox - EU)' | 'The Elder Scrolls Online (XBox - US)';
|
package/package.json
CHANGED
|
@@ -1,12 +1,41 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eso-status/live-services",
|
|
3
|
-
"version": "2.0.0-dev.
|
|
3
|
+
"version": "2.0.0-dev.1",
|
|
4
4
|
"description": "Library for retrieving and formatting data, which can be found at https://live-services.elderscrollsonline.com/status/realms",
|
|
5
5
|
"author": "@dov118 <contact@dov118.dev> (https://dov118.dev)",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"engineStrict": true,
|
|
9
|
-
"files": [
|
|
9
|
+
"files": [
|
|
10
|
+
"lib/interface/esoStatusRawData.interface.d.ts",
|
|
11
|
+
"lib/interface/esoStatusRawData.interface.js",
|
|
12
|
+
"lib/interface/rawAssociation.interface.d.ts",
|
|
13
|
+
"lib/interface/rawAssociation.interface.js",
|
|
14
|
+
"lib/interface/remoteData.interface.d.ts",
|
|
15
|
+
"lib/interface/remoteData.interface.js",
|
|
16
|
+
"lib/type/remoteRaw.type.d.ts",
|
|
17
|
+
"lib/type/remoteRaw.type.js",
|
|
18
|
+
"lib/type/remoteRawSlug.type.d.ts",
|
|
19
|
+
"lib/type/remoteRawSlug.type.js",
|
|
20
|
+
"lib/type/remoteRawStatus.type.d.ts",
|
|
21
|
+
"lib/type/remoteRawStatus.type.js",
|
|
22
|
+
"lib/type/remoteResultCode.type.d.ts",
|
|
23
|
+
"lib/type/remoteResultCode.type.js",
|
|
24
|
+
"lib/type/remoteResultMessage.type.d.ts",
|
|
25
|
+
"lib/type/remoteResultMessage.type.js",
|
|
26
|
+
"lib/type/sourceUrl.type.d.ts",
|
|
27
|
+
"lib/type/sourceUrl.type.js",
|
|
28
|
+
"lib/connector.d.ts",
|
|
29
|
+
"lib/connector.js",
|
|
30
|
+
"lib/const.d.ts",
|
|
31
|
+
"lib/const.js",
|
|
32
|
+
"lib/index.d.ts",
|
|
33
|
+
"lib/index.js",
|
|
34
|
+
".npmrc,",
|
|
35
|
+
"LICENSE.md",
|
|
36
|
+
"package.json",
|
|
37
|
+
"README.md"
|
|
38
|
+
],
|
|
10
39
|
"engines": {
|
|
11
40
|
"node": "^18.18.0 || ^20.0.0"
|
|
12
41
|
},
|