@wenex/sdk 0.2.2 → 0.2.4
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/common/enums/index.d.ts +1 -0
- package/common/enums/index.js +1 -0
- package/common/enums/index.js.map +1 -1
- package/common/enums/special/index.d.ts +1 -0
- package/common/enums/special/index.js +18 -0
- package/common/enums/special/index.js.map +1 -0
- package/common/enums/special/stat-type.enum.d.ts +5 -0
- package/common/enums/special/stat-type.enum.js +10 -0
- package/common/enums/special/stat-type.enum.js.map +1 -0
- package/common/interfaces/common/generic.interface.d.ts +1 -0
- package/common/interfaces/index.d.ts +1 -0
- package/common/interfaces/index.js +1 -0
- package/common/interfaces/index.js.map +1 -1
- package/common/interfaces/special/file.interface.d.ts +42 -0
- package/common/interfaces/special/file.interface.js +3 -0
- package/common/interfaces/special/file.interface.js.map +1 -0
- package/common/interfaces/special/index.d.ts +2 -0
- package/common/interfaces/special/index.js +19 -0
- package/common/interfaces/special/index.js.map +1 -0
- package/common/interfaces/special/stat.interface.d.ts +44 -0
- package/common/interfaces/special/stat.interface.js +3 -0
- package/common/interfaces/special/stat.interface.js.map +1 -0
- package/index.d.ts +3 -1
- package/index.js +5 -1
- package/index.js.map +1 -1
- package/package.json +5 -5
- package/services/index.d.ts +1 -0
- package/services/index.js +1 -0
- package/services/index.js.map +1 -1
- package/services/special/files.service.d.ts +12 -0
- package/services/special/files.service.js +41 -0
- package/services/special/files.service.js.map +1 -0
- package/services/special/index.d.ts +13 -0
- package/services/special/index.js +36 -0
- package/services/special/index.js.map +1 -0
- package/services/special/stats.service.d.ts +8 -0
- package/services/special/stats.service.js +26 -0
- package/services/special/stats.service.js.map +1 -0
package/common/enums/index.d.ts
CHANGED
package/common/enums/index.js
CHANGED
|
@@ -17,5 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./auth"), exports);
|
|
18
18
|
__exportStar(require("./common"), exports);
|
|
19
19
|
__exportStar(require("./domain"), exports);
|
|
20
|
+
__exportStar(require("./special"), exports);
|
|
20
21
|
__exportStar(require("./identity"), exports);
|
|
21
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/enums/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,2CAAyB;AACzB,2CAAyB;AACzB,6CAA2B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/enums/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,2CAAyB;AACzB,2CAAyB;AACzB,4CAA0B;AAC1B,6CAA2B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './stat-type.enum';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./stat-type.enum"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/enums/special/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StatType = void 0;
|
|
4
|
+
var StatType;
|
|
5
|
+
(function (StatType) {
|
|
6
|
+
StatType["Daily"] = "daily";
|
|
7
|
+
StatType["Yearly"] = "yearly";
|
|
8
|
+
StatType["Monthly"] = "monthly";
|
|
9
|
+
})(StatType || (exports.StatType = StatType = {}));
|
|
10
|
+
//# sourceMappingURL=stat-type.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stat-type.enum.js","sourceRoot":"","sources":["../../../src/common/enums/special/stat-type.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,QAIX;AAJD,WAAY,QAAQ;IAClB,2BAAe,CAAA;IACf,6BAAiB,CAAA;IACjB,+BAAmB,CAAA;AACrB,CAAC,EAJW,QAAQ,wBAAR,QAAQ,QAInB"}
|
|
@@ -18,5 +18,6 @@ __exportStar(require("./common"), exports);
|
|
|
18
18
|
__exportStar(require("./auth"), exports);
|
|
19
19
|
__exportStar(require("./config"), exports);
|
|
20
20
|
__exportStar(require("./domain"), exports);
|
|
21
|
+
__exportStar(require("./special"), exports);
|
|
21
22
|
__exportStar(require("./identity"), exports);
|
|
22
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AAEzB,yCAAuB;AACvB,2CAAyB;AACzB,2CAAyB;AACzB,6CAA2B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AAEzB,yCAAuB;AACvB,2CAAyB;AACzB,2CAAyB;AACzB,4CAA0B;AAC1B,6CAA2B"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
+
import type { Document } from 'mongoose';
|
|
26
|
+
import { Core, Dto } from '../common';
|
|
27
|
+
export interface File extends Core {
|
|
28
|
+
field?: string;
|
|
29
|
+
original: string;
|
|
30
|
+
encoding?: string;
|
|
31
|
+
mimetype: string;
|
|
32
|
+
size: number;
|
|
33
|
+
bucket: string;
|
|
34
|
+
key: string;
|
|
35
|
+
acl: string;
|
|
36
|
+
content_type?: string;
|
|
37
|
+
storage_class?: string;
|
|
38
|
+
location: string;
|
|
39
|
+
etag?: string;
|
|
40
|
+
}
|
|
41
|
+
export type FileDoc = File & Document;
|
|
42
|
+
export type FileDto = Dto<File>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file.interface.js","sourceRoot":"","sources":["../../../src/common/interfaces/special/file.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./stat.interface"), exports);
|
|
18
|
+
__exportStar(require("./file.interface"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/interfaces/special/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,mDAAiC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
+
import type { Document } from 'mongoose';
|
|
26
|
+
import { StatType } from '../../enums';
|
|
27
|
+
import { Core, Dto, Flags, MakeOptional } from '../common';
|
|
28
|
+
export interface Stat extends Core {
|
|
29
|
+
type: StatType;
|
|
30
|
+
key: string;
|
|
31
|
+
value: number;
|
|
32
|
+
day?: number;
|
|
33
|
+
hours?: number[];
|
|
34
|
+
month?: number;
|
|
35
|
+
days?: number[];
|
|
36
|
+
year: number;
|
|
37
|
+
months?: number[];
|
|
38
|
+
flags?: Flags;
|
|
39
|
+
}
|
|
40
|
+
export type StatDoc = Stat & Document;
|
|
41
|
+
export type StatDto = Dto<MakeOptional<Stat, 'year'> & {
|
|
42
|
+
alpha?: number;
|
|
43
|
+
hour?: number;
|
|
44
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stat.interface.js","sourceRoot":"","sources":["../../../src/common/interfaces/special/stat.interface.ts"],"names":[],"mappings":""}
|
package/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AxiosInstance } from 'axios';
|
|
2
|
+
import { AuthClient, ConfigClient, DomainClient, IdentityClient, SpecialClient } from './services';
|
|
2
3
|
import { GraphqlService } from './common/classes';
|
|
3
|
-
import { AuthClient, ConfigClient, DomainClient, IdentityClient } from './services';
|
|
4
4
|
export * from './services';
|
|
5
5
|
export declare class PlatformClient {
|
|
6
6
|
readonly axios: AxiosInstance;
|
|
@@ -8,11 +8,13 @@ export declare class PlatformClient {
|
|
|
8
8
|
private $auth;
|
|
9
9
|
private $config;
|
|
10
10
|
private $domain;
|
|
11
|
+
private $special;
|
|
11
12
|
private $identity;
|
|
12
13
|
constructor(axios: AxiosInstance);
|
|
13
14
|
get graphql(): GraphqlService;
|
|
14
15
|
get auth(): AuthClient;
|
|
15
16
|
get domain(): DomainClient;
|
|
16
17
|
get config(): ConfigClient;
|
|
18
|
+
get special(): SpecialClient;
|
|
17
19
|
get identity(): IdentityClient;
|
|
18
20
|
}
|
package/index.js
CHANGED
|
@@ -15,8 +15,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.PlatformClient = void 0;
|
|
18
|
-
const classes_1 = require("./common/classes");
|
|
19
18
|
const services_1 = require("./services");
|
|
19
|
+
const classes_1 = require("./common/classes");
|
|
20
20
|
__exportStar(require("./services"), exports);
|
|
21
21
|
class PlatformClient {
|
|
22
22
|
constructor(axios) {
|
|
@@ -38,6 +38,10 @@ class PlatformClient {
|
|
|
38
38
|
var _a;
|
|
39
39
|
return (this.$config = (_a = this.$config) !== null && _a !== void 0 ? _a : new services_1.ConfigClient(this.axios));
|
|
40
40
|
}
|
|
41
|
+
get special() {
|
|
42
|
+
var _a;
|
|
43
|
+
return (this.$special = (_a = this.$special) !== null && _a !== void 0 ? _a : new services_1.SpecialClient(this.axios));
|
|
44
|
+
}
|
|
41
45
|
get identity() {
|
|
42
46
|
var _a;
|
|
43
47
|
return (this.$identity = (_a = this.$identity) !== null && _a !== void 0 ? _a : new services_1.IdentityClient(this.axios));
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAEA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAEA,yCAMoB;AACpB,8CAAkD;AAElD,6CAA2B;AAE3B,MAAa,cAAc;IASzB,YAAqB,KAAoB;QAApB,UAAK,GAAL,KAAK,CAAe;IAAG,CAAC;IAE7C,IAAI,OAAO;;QACT,OAAO,CAAC,IAAI,CAAC,QAAQ,GAAG,MAAA,IAAI,CAAC,QAAQ,mCAAI,IAAI,wBAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAC3E,CAAC;IAED,IAAI,IAAI;;QACN,OAAO,CAAC,IAAI,CAAC,KAAK,GAAG,MAAA,IAAI,CAAC,KAAK,mCAAI,IAAI,qBAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IACjE,CAAC;IAED,IAAI,MAAM;;QACR,OAAO,CAAC,IAAI,CAAC,OAAO,GAAG,MAAA,IAAI,CAAC,OAAO,mCAAI,IAAI,uBAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IACvE,CAAC;IAED,IAAI,MAAM;;QACR,OAAO,CAAC,IAAI,CAAC,OAAO,GAAG,MAAA,IAAI,CAAC,OAAO,mCAAI,IAAI,uBAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IACvE,CAAC;IAED,IAAI,OAAO;;QACT,OAAO,CAAC,IAAI,CAAC,QAAQ,GAAG,MAAA,IAAI,CAAC,QAAQ,mCAAI,IAAI,wBAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAC1E,CAAC;IAED,IAAI,QAAQ;;QACV,OAAO,CAAC,IAAI,CAAC,SAAS,GAAG,MAAA,IAAI,CAAC,SAAS,mCAAI,IAAI,yBAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7E,CAAC;CACF;AAlCD,wCAkCC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wenex/sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "Wenex SDK",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/debug": "^4.1.12",
|
|
39
39
|
"@types/jest": "^29.5.11",
|
|
40
|
-
"@types/node": "^20.10.
|
|
41
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
42
|
-
"@typescript-eslint/parser": "^6.
|
|
40
|
+
"@types/node": "^20.10.5",
|
|
41
|
+
"@typescript-eslint/eslint-plugin": "^6.15.0",
|
|
42
|
+
"@typescript-eslint/parser": "^6.15.0",
|
|
43
43
|
"dotenv": "^16.3.1",
|
|
44
|
-
"eslint": "^8.
|
|
44
|
+
"eslint": "^8.56.0",
|
|
45
45
|
"eslint-config-prettier": "^9.1.0",
|
|
46
46
|
"eslint-plugin-prettier": "^5.0.1",
|
|
47
47
|
"jest": "^29.7.0",
|
package/services/index.d.ts
CHANGED
package/services/index.js
CHANGED
|
@@ -17,5 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./auth"), exports);
|
|
18
18
|
__exportStar(require("./domain"), exports);
|
|
19
19
|
__exportStar(require("./config"), exports);
|
|
20
|
+
__exportStar(require("./special"), exports);
|
|
20
21
|
__exportStar(require("./identity"), exports);
|
|
21
22
|
//# sourceMappingURL=index.js.map
|
package/services/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,2CAAyB;AACzB,2CAAyB;AACzB,6CAA2B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,2CAAyB;AACzB,2CAAyB;AACzB,4CAA0B;AAC1B,6CAA2B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AxiosInstance, ResponseType } from 'axios';
|
|
2
|
+
import { File, FileDto, Serializer } from '../../common/interfaces';
|
|
3
|
+
import { RequestConfig, RestfulService } from '../../common/classes';
|
|
4
|
+
export declare class FilesService extends RestfulService<File, FileDto> {
|
|
5
|
+
protected axios: AxiosInstance;
|
|
6
|
+
constructor(axios: AxiosInstance);
|
|
7
|
+
download<T = any>(id: string, config?: RequestConfig<File>, responseType?: ResponseType): Promise<T>;
|
|
8
|
+
upload(items: {
|
|
9
|
+
value: Blob;
|
|
10
|
+
filename?: string;
|
|
11
|
+
}[], scope: 'private' | 'public', config?: RequestConfig<File>): Promise<Serializer<File>[]>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.FilesService = void 0;
|
|
13
|
+
const classes_1 = require("../../common/classes");
|
|
14
|
+
class FilesService extends classes_1.RestfulService {
|
|
15
|
+
constructor(axios) {
|
|
16
|
+
super('files', axios);
|
|
17
|
+
this.axios = axios;
|
|
18
|
+
}
|
|
19
|
+
download(id, config = {}, responseType = 'blob') {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
config.responseType = responseType;
|
|
22
|
+
const url = this.url(`download/${id}`);
|
|
23
|
+
return yield this.get(url, config);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
upload(items, scope, config = {}) {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
const form = new FormData();
|
|
29
|
+
items.forEach((item) => form.append('file', item.value, item.filename));
|
|
30
|
+
Object.assign(config, {
|
|
31
|
+
headers: {
|
|
32
|
+
'Content-Type': 'multipart/form-data',
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
const url = this.url(`upload/${scope}`);
|
|
36
|
+
return yield this.post(url, form, config);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.FilesService = FilesService;
|
|
41
|
+
//# sourceMappingURL=files.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.service.js","sourceRoot":"","sources":["../../src/services/special/files.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAIA,kDAAqE;AAErE,MAAa,YAAa,SAAQ,wBAA6B;IAC7D,YAAsB,KAAoB;QACxC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QADF,UAAK,GAAL,KAAK,CAAe;IAE1C,CAAC;IAEK,QAAQ,CACZ,EAAU,EACV,SAA8B,EAAE,EAChC,eAA6B,MAAM;;YAEnC,MAAM,CAAC,YAAY,GAAG,YAAY,CAAC;YACnC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;YACvC,OAAO,MAAM,IAAI,CAAC,GAAG,CAAI,GAAG,EAAE,MAAM,CAAC,CAAC;QACxC,CAAC;KAAA;IAEK,MAAM,CACV,KAA2C,EAC3C,KAA2B,EAC3B,SAA8B,EAAE;;YAEhC,MAAM,IAAI,GAAG,IAAI,QAAQ,EAAE,CAAC;YAC5B,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;YAExE,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE;gBACpB,OAAO,EAAE;oBACP,cAAc,EAAE,qBAAqB;iBACtC;aACF,CAAC,CAAC;YAEH,MAAM,GAAG,GAAW,IAAI,CAAC,GAAG,CAAC,UAAU,KAAK,EAAE,CAAC,CAAC;YAChD,OAAO,MAAM,IAAI,CAAC,IAAI,CAA+B,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;QAC1E,CAAC;KAAA;CACF;AAhCD,oCAgCC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { FilesService } from './files.service';
|
|
3
|
+
import { StatsService } from './stats.service';
|
|
4
|
+
export * from './stats.service';
|
|
5
|
+
export * from './files.service';
|
|
6
|
+
export declare class SpecialClient {
|
|
7
|
+
readonly axios: AxiosInstance;
|
|
8
|
+
private $files;
|
|
9
|
+
private $stats;
|
|
10
|
+
constructor(axios: AxiosInstance);
|
|
11
|
+
get files(): FilesService;
|
|
12
|
+
get stats(): StatsService;
|
|
13
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.SpecialClient = void 0;
|
|
18
|
+
const files_service_1 = require("./files.service");
|
|
19
|
+
const stats_service_1 = require("./stats.service");
|
|
20
|
+
__exportStar(require("./stats.service"), exports);
|
|
21
|
+
__exportStar(require("./files.service"), exports);
|
|
22
|
+
class SpecialClient {
|
|
23
|
+
constructor(axios) {
|
|
24
|
+
this.axios = axios;
|
|
25
|
+
}
|
|
26
|
+
get files() {
|
|
27
|
+
var _a;
|
|
28
|
+
return (this.$files = (_a = this.$files) !== null && _a !== void 0 ? _a : new files_service_1.FilesService(this.axios));
|
|
29
|
+
}
|
|
30
|
+
get stats() {
|
|
31
|
+
var _a;
|
|
32
|
+
return (this.$stats = (_a = this.$stats) !== null && _a !== void 0 ? _a : new stats_service_1.StatsService(this.axios));
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.SpecialClient = SpecialClient;
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/services/special/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAEA,mDAA+C;AAC/C,mDAA+C;AAE/C,kDAAgC;AAChC,kDAAgC;AAEhC,MAAa,aAAa;IAIxB,YAAqB,KAAoB;QAApB,UAAK,GAAL,KAAK,CAAe;IAAG,CAAC;IAE7C,IAAI,KAAK;;QACP,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,MAAA,IAAI,CAAC,MAAM,mCAAI,IAAI,4BAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IACrE,CAAC;IAED,IAAI,KAAK;;QACP,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,MAAA,IAAI,CAAC,MAAM,mCAAI,IAAI,4BAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IACrE,CAAC;CACF;AAbD,sCAaC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { Stat, StatDto } from '../../common/interfaces';
|
|
3
|
+
import { RequestConfig, RestfulService } from '../../common/classes';
|
|
4
|
+
export declare class StatsService extends RestfulService<Stat, StatDto> {
|
|
5
|
+
protected axios: AxiosInstance;
|
|
6
|
+
constructor(axios: AxiosInstance);
|
|
7
|
+
collect(data: StatDto, config?: RequestConfig<Stat>): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.StatsService = void 0;
|
|
13
|
+
const classes_1 = require("../../common/classes");
|
|
14
|
+
class StatsService extends classes_1.RestfulService {
|
|
15
|
+
constructor(axios) {
|
|
16
|
+
super('stats', axios);
|
|
17
|
+
this.axios = axios;
|
|
18
|
+
}
|
|
19
|
+
collect(data, config) {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
return this.post(this.url('collect'), data, config);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.StatsService = StatsService;
|
|
26
|
+
//# sourceMappingURL=stats.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stats.service.js","sourceRoot":"","sources":["../../src/services/special/stats.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,kDAAqE;AAErE,MAAa,YAAa,SAAQ,wBAA6B;IAC7D,YAAsB,KAAoB;QACxC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QADF,UAAK,GAAL,KAAK,CAAe;IAE1C,CAAC;IAEK,OAAO,CAAC,IAAa,EAAE,MAA4B;;YACvD,OAAO,IAAI,CAAC,IAAI,CAAgB,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;QACrE,CAAC;KAAA;CACF;AARD,oCAQC"}
|