@remnawave/backend-contract 2.1.39 → 2.1.40
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/build/backend/api/controllers/hwid.d.ts +2 -0
- package/build/backend/api/controllers/hwid.d.ts.map +1 -1
- package/build/backend/api/controllers/hwid.js +2 -0
- package/build/backend/api/routes.d.ts +2 -0
- package/build/backend/api/routes.d.ts.map +1 -1
- package/build/backend/api/routes.js +2 -0
- package/build/backend/commands/hwid/get-all-hwid-devices.command.d.ts +146 -0
- package/build/backend/commands/hwid/get-all-hwid-devices.command.d.ts.map +1 -0
- package/build/backend/commands/hwid/get-all-hwid-devices.command.js +49 -0
- package/build/backend/commands/hwid/get-hwid-devices-stats.command.d.ts +105 -0
- package/build/backend/commands/hwid/get-hwid-devices-stats.command.d.ts.map +1 -0
- package/build/backend/commands/hwid/get-hwid-devices-stats.command.js +29 -0
- package/build/backend/commands/hwid/index.d.ts +2 -0
- package/build/backend/commands/hwid/index.d.ts.map +1 -1
- package/build/backend/commands/hwid/index.js +2 -0
- package/build/backend/constants/errors/errors.d.ts +10 -0
- package/build/backend/constants/errors/errors.d.ts.map +1 -1
- package/build/backend/constants/errors/errors.js +10 -0
- package/build/frontend/api/controllers/hwid.js +2 -0
- package/build/frontend/api/routes.js +2 -0
- package/build/frontend/commands/hwid/get-all-hwid-devices.command.js +49 -0
- package/build/frontend/commands/hwid/get-hwid-devices-stats.command.js +29 -0
- package/build/frontend/commands/hwid/index.js +2 -0
- package/build/frontend/constants/errors/errors.js +10 -0
- package/package.json +1 -1
@@ -1,8 +1,10 @@
|
|
1
1
|
export declare const HWID_CONTROLLER: "hwid";
|
2
2
|
export declare const HWID_ROUTES: {
|
3
|
+
readonly GET_ALL_HWID_DEVICES: "devices";
|
3
4
|
readonly CREATE_USER_HWID_DEVICE: "devices";
|
4
5
|
readonly GET_USER_HWID_DEVICES: (userUuid: string) => string;
|
5
6
|
readonly DELETE_USER_HWID_DEVICE: "devices/delete";
|
6
7
|
readonly DELETE_ALL_USER_HWID_DEVICES: "devices/delete-all";
|
8
|
+
readonly STATS: "devices/stats";
|
7
9
|
};
|
8
10
|
//# sourceMappingURL=hwid.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"hwid.d.ts","sourceRoot":"","sources":["../../../../api/controllers/hwid.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,EAAG,MAAe,CAAC;AAE/C,eAAO,MAAM,WAAW
|
1
|
+
{"version":3,"file":"hwid.d.ts","sourceRoot":"","sources":["../../../../api/controllers/hwid.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,EAAG,MAAe,CAAC;AAE/C,eAAO,MAAM,WAAW;;;+CAGc,MAAM;;;;CAKlC,CAAC"}
|
@@ -3,8 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.HWID_ROUTES = exports.HWID_CONTROLLER = void 0;
|
4
4
|
exports.HWID_CONTROLLER = 'hwid';
|
5
5
|
exports.HWID_ROUTES = {
|
6
|
+
GET_ALL_HWID_DEVICES: 'devices', // get
|
6
7
|
CREATE_USER_HWID_DEVICE: 'devices',
|
7
8
|
GET_USER_HWID_DEVICES: (userUuid) => `devices/${userUuid}`,
|
8
9
|
DELETE_USER_HWID_DEVICE: 'devices/delete',
|
9
10
|
DELETE_ALL_USER_HWID_DEVICES: 'devices/delete-all',
|
11
|
+
STATS: 'devices/stats', // get
|
10
12
|
};
|
@@ -127,10 +127,12 @@ export declare const REST_API: {
|
|
127
127
|
readonly UPDATE: "/api/subscription-settings/";
|
128
128
|
};
|
129
129
|
readonly HWID: {
|
130
|
+
readonly GET_ALL_HWID_DEVICES: "/api/hwid/devices";
|
130
131
|
readonly CREATE_USER_HWID_DEVICE: "/api/hwid/devices";
|
131
132
|
readonly GET_USER_HWID_DEVICES: (userUuid: string) => string;
|
132
133
|
readonly DELETE_USER_HWID_DEVICE: "/api/hwid/devices/delete";
|
133
134
|
readonly DELETE_ALL_USER_HWID_DEVICES: "/api/hwid/devices/delete-all";
|
135
|
+
readonly STATS: "/api/hwid/devices/stats";
|
134
136
|
};
|
135
137
|
readonly SUBSCRIPTIONS: {
|
136
138
|
readonly GET: "/api/subscriptions/";
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../api/routes.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,EAAG,MAAe,CAAC;AACpC,eAAO,MAAM,YAAY,EAAG,UAAmB,CAAC;AAChD,eAAO,MAAM,WAAW,EAAG,SAAkB,CAAC;AAC9C,eAAO,MAAM,cAAc,EAAG,SAAkB,CAAC;AAEjD,eAAO,MAAM,QAAQ;;;;;;;;;;;;;gCAcE,MAAM;;;;;;;;;qCAYD,MAAM;;gCAGX,MAAM;;oCAIF,MAAM;qCAIL,MAAM;qCAIN,MAAM;;;;;;iDAUM,MAAM;;;;;;;;gCAWvB,MAAM;qCAGD,MAAM;0CAED,MAAM;sDAEM,MAAM;;qCAMvB,MAAM;oCAIP,MAAM;2CAIC,MAAM;iDAIA,MAAM;;;6CAOV,MAAM;0CAIT,MAAM;2DAIW,MAAM;+CAIlB,MAAM;oCAIjB,MAAM;gCAIV,MAAM;;;;;;;;;;;;;;;gDAmBU,MAAM;;;;;;;kCAWpB,MAAM;0CAEE,MAAM;uCAET,MAAM;;;;;;qCASR,MAAM;gCAEX,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCA+BD,MAAM
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../api/routes.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,EAAG,MAAe,CAAC;AACpC,eAAO,MAAM,YAAY,EAAG,UAAmB,CAAC;AAChD,eAAO,MAAM,WAAW,EAAG,SAAkB,CAAC;AAC9C,eAAO,MAAM,cAAc,EAAG,SAAkB,CAAC;AAEjD,eAAO,MAAM,QAAQ;;;;;;;;;;;;;gCAcE,MAAM;;;;;;;;;qCAYD,MAAM;;gCAGX,MAAM;;oCAIF,MAAM;qCAIL,MAAM;qCAIN,MAAM;;;;;;iDAUM,MAAM;;;;;;;;gCAWvB,MAAM;qCAGD,MAAM;0CAED,MAAM;sDAEM,MAAM;;qCAMvB,MAAM;oCAIP,MAAM;2CAIC,MAAM;iDAIA,MAAM;;;6CAOV,MAAM;0CAIT,MAAM;2DAIW,MAAM;+CAIlB,MAAM;oCAIjB,MAAM;gCAIV,MAAM;;;;;;;;;;;;;;;gDAmBU,MAAM;;;;;;;kCAWpB,MAAM;0CAEE,MAAM;uCAET,MAAM;;;;;;qCASR,MAAM;gCAEX,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCA+BD,MAAM;;;;;;;;;;mDAaQ,MAAM;;;;;;;;0CAWf,MAAM;kCAId,MAAM;6CAIK,MAAM;iDAIF,MAAM;;;;;;;qCAUlB,MAAM;gCAIX,MAAM;sDAIgB,MAAM;;;;;;;qCAUvB,MAAM;gCAIX,MAAM;0CAII,MAAM;;uCAKT,MAAM;0CAEH,MAAM;;;;;;;yCASP,MAAM;8CAED,MAAM;;;;6CAMP,MAAM;;;gDAKH,MAAM;;CAGnC,CAAC"}
|
@@ -164,10 +164,12 @@ exports.REST_API = {
|
|
164
164
|
UPDATE: `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_SETTINGS_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_SETTINGS_ROUTES.UPDATE}`,
|
165
165
|
},
|
166
166
|
HWID: {
|
167
|
+
GET_ALL_HWID_DEVICES: `${exports.ROOT}/${CONTROLLERS.HWID_CONTROLLER}/${CONTROLLERS.HWID_ROUTES.GET_ALL_HWID_DEVICES}`,
|
167
168
|
CREATE_USER_HWID_DEVICE: `${exports.ROOT}/${CONTROLLERS.HWID_CONTROLLER}/${CONTROLLERS.HWID_ROUTES.CREATE_USER_HWID_DEVICE}`,
|
168
169
|
GET_USER_HWID_DEVICES: (userUuid) => `${exports.ROOT}/${CONTROLLERS.HWID_CONTROLLER}/${CONTROLLERS.HWID_ROUTES.GET_USER_HWID_DEVICES(userUuid)}`,
|
169
170
|
DELETE_USER_HWID_DEVICE: `${exports.ROOT}/${CONTROLLERS.HWID_CONTROLLER}/${CONTROLLERS.HWID_ROUTES.DELETE_USER_HWID_DEVICE}`,
|
170
171
|
DELETE_ALL_USER_HWID_DEVICES: `${exports.ROOT}/${CONTROLLERS.HWID_CONTROLLER}/${CONTROLLERS.HWID_ROUTES.DELETE_ALL_USER_HWID_DEVICES}`,
|
172
|
+
STATS: `${exports.ROOT}/${CONTROLLERS.HWID_CONTROLLER}/${CONTROLLERS.HWID_ROUTES.STATS}`,
|
171
173
|
},
|
172
174
|
SUBSCRIPTIONS: {
|
173
175
|
GET: `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTIONS_CONTROLLER}/${CONTROLLERS.SUBSCRIPTIONS_ROUTES.GET}`,
|
@@ -0,0 +1,146 @@
|
|
1
|
+
import { z } from 'zod';
|
2
|
+
export declare namespace GetAllHwidDevicesCommand {
|
3
|
+
const url: "/api/hwid/devices";
|
4
|
+
const TSQ_url: "/api/hwid/devices";
|
5
|
+
const endpointDetails: import("../../constants").EndpointDetails;
|
6
|
+
const RequestQuerySchema: z.ZodObject<{
|
7
|
+
start: z.ZodDefault<z.ZodNumber>;
|
8
|
+
size: z.ZodDefault<z.ZodNumber>;
|
9
|
+
filters: z.ZodOptional<z.ZodEffects<z.ZodArray<z.ZodObject<{
|
10
|
+
id: z.ZodString;
|
11
|
+
value: z.ZodUnknown;
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
13
|
+
id: string;
|
14
|
+
value?: unknown;
|
15
|
+
}, {
|
16
|
+
id: string;
|
17
|
+
value?: unknown;
|
18
|
+
}>, "many">, {
|
19
|
+
id: string;
|
20
|
+
value?: unknown;
|
21
|
+
}[], unknown>>;
|
22
|
+
filterModes: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodString>, Record<string, string>, unknown>>;
|
23
|
+
globalFilterMode: z.ZodOptional<z.ZodString>;
|
24
|
+
sorting: z.ZodOptional<z.ZodEffects<z.ZodArray<z.ZodObject<{
|
25
|
+
id: z.ZodString;
|
26
|
+
desc: z.ZodBoolean;
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
28
|
+
id: string;
|
29
|
+
desc: boolean;
|
30
|
+
}, {
|
31
|
+
id: string;
|
32
|
+
desc: boolean;
|
33
|
+
}>, "many">, {
|
34
|
+
id: string;
|
35
|
+
desc: boolean;
|
36
|
+
}[], unknown>>;
|
37
|
+
}, "strip", z.ZodTypeAny, {
|
38
|
+
start: number;
|
39
|
+
size: number;
|
40
|
+
filters?: {
|
41
|
+
id: string;
|
42
|
+
value?: unknown;
|
43
|
+
}[] | undefined;
|
44
|
+
filterModes?: Record<string, string> | undefined;
|
45
|
+
globalFilterMode?: string | undefined;
|
46
|
+
sorting?: {
|
47
|
+
id: string;
|
48
|
+
desc: boolean;
|
49
|
+
}[] | undefined;
|
50
|
+
}, {
|
51
|
+
start?: number | undefined;
|
52
|
+
size?: number | undefined;
|
53
|
+
filters?: unknown;
|
54
|
+
filterModes?: unknown;
|
55
|
+
globalFilterMode?: string | undefined;
|
56
|
+
sorting?: unknown;
|
57
|
+
}>;
|
58
|
+
type RequestQuery = z.infer<typeof RequestQuerySchema>;
|
59
|
+
const ResponseSchema: z.ZodObject<{
|
60
|
+
response: z.ZodObject<{
|
61
|
+
devices: z.ZodArray<z.ZodObject<{
|
62
|
+
hwid: z.ZodString;
|
63
|
+
userUuid: z.ZodString;
|
64
|
+
platform: z.ZodNullable<z.ZodString>;
|
65
|
+
osVersion: z.ZodNullable<z.ZodString>;
|
66
|
+
deviceModel: z.ZodNullable<z.ZodString>;
|
67
|
+
userAgent: z.ZodNullable<z.ZodString>;
|
68
|
+
createdAt: z.ZodEffects<z.ZodString, Date, string>;
|
69
|
+
updatedAt: z.ZodEffects<z.ZodString, Date, string>;
|
70
|
+
}, "strip", z.ZodTypeAny, {
|
71
|
+
hwid: string;
|
72
|
+
createdAt: Date;
|
73
|
+
updatedAt: Date;
|
74
|
+
userUuid: string;
|
75
|
+
platform: string | null;
|
76
|
+
osVersion: string | null;
|
77
|
+
deviceModel: string | null;
|
78
|
+
userAgent: string | null;
|
79
|
+
}, {
|
80
|
+
hwid: string;
|
81
|
+
createdAt: string;
|
82
|
+
updatedAt: string;
|
83
|
+
userUuid: string;
|
84
|
+
platform: string | null;
|
85
|
+
osVersion: string | null;
|
86
|
+
deviceModel: string | null;
|
87
|
+
userAgent: string | null;
|
88
|
+
}>, "many">;
|
89
|
+
total: z.ZodNumber;
|
90
|
+
}, "strip", z.ZodTypeAny, {
|
91
|
+
devices: {
|
92
|
+
hwid: string;
|
93
|
+
createdAt: Date;
|
94
|
+
updatedAt: Date;
|
95
|
+
userUuid: string;
|
96
|
+
platform: string | null;
|
97
|
+
osVersion: string | null;
|
98
|
+
deviceModel: string | null;
|
99
|
+
userAgent: string | null;
|
100
|
+
}[];
|
101
|
+
total: number;
|
102
|
+
}, {
|
103
|
+
devices: {
|
104
|
+
hwid: string;
|
105
|
+
createdAt: string;
|
106
|
+
updatedAt: string;
|
107
|
+
userUuid: string;
|
108
|
+
platform: string | null;
|
109
|
+
osVersion: string | null;
|
110
|
+
deviceModel: string | null;
|
111
|
+
userAgent: string | null;
|
112
|
+
}[];
|
113
|
+
total: number;
|
114
|
+
}>;
|
115
|
+
}, "strip", z.ZodTypeAny, {
|
116
|
+
response: {
|
117
|
+
devices: {
|
118
|
+
hwid: string;
|
119
|
+
createdAt: Date;
|
120
|
+
updatedAt: Date;
|
121
|
+
userUuid: string;
|
122
|
+
platform: string | null;
|
123
|
+
osVersion: string | null;
|
124
|
+
deviceModel: string | null;
|
125
|
+
userAgent: string | null;
|
126
|
+
}[];
|
127
|
+
total: number;
|
128
|
+
};
|
129
|
+
}, {
|
130
|
+
response: {
|
131
|
+
devices: {
|
132
|
+
hwid: string;
|
133
|
+
createdAt: string;
|
134
|
+
updatedAt: string;
|
135
|
+
userUuid: string;
|
136
|
+
platform: string | null;
|
137
|
+
osVersion: string | null;
|
138
|
+
deviceModel: string | null;
|
139
|
+
userAgent: string | null;
|
140
|
+
}[];
|
141
|
+
total: number;
|
142
|
+
};
|
143
|
+
}>;
|
144
|
+
type Response = z.infer<typeof ResponseSchema>;
|
145
|
+
}
|
146
|
+
//# sourceMappingURL=get-all-hwid-devices.command.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"get-all-hwid-devices.command.d.ts","sourceRoot":"","sources":["../../../../commands/hwid/get-all-hwid-devices.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,yBAAiB,wBAAwB,CAAC;IAC/B,MAAM,GAAG,qBAAqC,CAAC;IAC/C,MAAM,OAAO,qBAAM,CAAC;IAEpB,MAAM,eAAe,2CAI3B,CAAC;IAYK,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAiC7B,CAAC;IAEH,KAAY,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAEvD,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAKzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
|
@@ -0,0 +1,49 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.GetAllHwidDevicesCommand = void 0;
|
4
|
+
const zod_1 = require("zod");
|
5
|
+
const constants_1 = require("../../constants");
|
6
|
+
const models_1 = require("../../models");
|
7
|
+
const api_1 = require("../../api");
|
8
|
+
var GetAllHwidDevicesCommand;
|
9
|
+
(function (GetAllHwidDevicesCommand) {
|
10
|
+
GetAllHwidDevicesCommand.url = api_1.REST_API.HWID.GET_ALL_HWID_DEVICES;
|
11
|
+
GetAllHwidDevicesCommand.TSQ_url = GetAllHwidDevicesCommand.url;
|
12
|
+
GetAllHwidDevicesCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.HWID_ROUTES.GET_ALL_HWID_DEVICES, 'get', 'Get all HWID devices');
|
13
|
+
const FilterSchema = zod_1.z.object({
|
14
|
+
id: zod_1.z.string(),
|
15
|
+
value: zod_1.z.unknown(),
|
16
|
+
});
|
17
|
+
const SortingSchema = zod_1.z.object({
|
18
|
+
id: zod_1.z.string(),
|
19
|
+
desc: zod_1.z.boolean(),
|
20
|
+
});
|
21
|
+
GetAllHwidDevicesCommand.RequestQuerySchema = zod_1.z.object({
|
22
|
+
start: zod_1.z.coerce
|
23
|
+
.number()
|
24
|
+
.default(0)
|
25
|
+
.describe('Start index (offset) of the users to return, default is 0'),
|
26
|
+
size: zod_1.z.coerce
|
27
|
+
.number()
|
28
|
+
.min(1, 'Size (limit) must be greater than 0')
|
29
|
+
.max(1000, 'Size (limit) must be less than 1000')
|
30
|
+
.describe('Number of users to return, no more than 1000')
|
31
|
+
.default(25),
|
32
|
+
filters: zod_1.z
|
33
|
+
.preprocess((str) => (typeof str === 'string' ? JSON.parse(str) : str), zod_1.z.array(FilterSchema))
|
34
|
+
.optional(),
|
35
|
+
filterModes: zod_1.z
|
36
|
+
.preprocess((str) => (typeof str === 'string' ? JSON.parse(str) : str), zod_1.z.record(zod_1.z.string(), zod_1.z.string()))
|
37
|
+
.optional(),
|
38
|
+
globalFilterMode: zod_1.z.string().optional(),
|
39
|
+
sorting: zod_1.z
|
40
|
+
.preprocess((str) => (typeof str === 'string' ? JSON.parse(str) : str), zod_1.z.array(SortingSchema))
|
41
|
+
.optional(),
|
42
|
+
});
|
43
|
+
GetAllHwidDevicesCommand.ResponseSchema = zod_1.z.object({
|
44
|
+
response: zod_1.z.object({
|
45
|
+
devices: zod_1.z.array(models_1.HwidUserDeviceSchema),
|
46
|
+
total: zod_1.z.number(),
|
47
|
+
}),
|
48
|
+
});
|
49
|
+
})(GetAllHwidDevicesCommand || (exports.GetAllHwidDevicesCommand = GetAllHwidDevicesCommand = {}));
|
@@ -0,0 +1,105 @@
|
|
1
|
+
import { z } from 'zod';
|
2
|
+
export declare namespace GetHwidDevicesStatsCommand {
|
3
|
+
const url: "/api/hwid/devices/stats";
|
4
|
+
const TSQ_url: "/api/hwid/devices/stats";
|
5
|
+
const endpointDetails: import("../../constants").EndpointDetails;
|
6
|
+
const ResponseSchema: z.ZodObject<{
|
7
|
+
response: z.ZodObject<{
|
8
|
+
byPlatform: z.ZodArray<z.ZodObject<{
|
9
|
+
platform: z.ZodString;
|
10
|
+
count: z.ZodNumber;
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
12
|
+
platform: string;
|
13
|
+
count: number;
|
14
|
+
}, {
|
15
|
+
platform: string;
|
16
|
+
count: number;
|
17
|
+
}>, "many">;
|
18
|
+
byApp: z.ZodArray<z.ZodObject<{
|
19
|
+
app: z.ZodString;
|
20
|
+
count: z.ZodNumber;
|
21
|
+
}, "strip", z.ZodTypeAny, {
|
22
|
+
count: number;
|
23
|
+
app: string;
|
24
|
+
}, {
|
25
|
+
count: number;
|
26
|
+
app: string;
|
27
|
+
}>, "many">;
|
28
|
+
stats: z.ZodObject<{
|
29
|
+
totalUniqueDevices: z.ZodNumber;
|
30
|
+
totalHwidDevices: z.ZodNumber;
|
31
|
+
averageHwidDevicesPerUser: z.ZodNumber;
|
32
|
+
}, "strip", z.ZodTypeAny, {
|
33
|
+
totalUniqueDevices: number;
|
34
|
+
totalHwidDevices: number;
|
35
|
+
averageHwidDevicesPerUser: number;
|
36
|
+
}, {
|
37
|
+
totalUniqueDevices: number;
|
38
|
+
totalHwidDevices: number;
|
39
|
+
averageHwidDevicesPerUser: number;
|
40
|
+
}>;
|
41
|
+
}, "strip", z.ZodTypeAny, {
|
42
|
+
stats: {
|
43
|
+
totalUniqueDevices: number;
|
44
|
+
totalHwidDevices: number;
|
45
|
+
averageHwidDevicesPerUser: number;
|
46
|
+
};
|
47
|
+
byPlatform: {
|
48
|
+
platform: string;
|
49
|
+
count: number;
|
50
|
+
}[];
|
51
|
+
byApp: {
|
52
|
+
count: number;
|
53
|
+
app: string;
|
54
|
+
}[];
|
55
|
+
}, {
|
56
|
+
stats: {
|
57
|
+
totalUniqueDevices: number;
|
58
|
+
totalHwidDevices: number;
|
59
|
+
averageHwidDevicesPerUser: number;
|
60
|
+
};
|
61
|
+
byPlatform: {
|
62
|
+
platform: string;
|
63
|
+
count: number;
|
64
|
+
}[];
|
65
|
+
byApp: {
|
66
|
+
count: number;
|
67
|
+
app: string;
|
68
|
+
}[];
|
69
|
+
}>;
|
70
|
+
}, "strip", z.ZodTypeAny, {
|
71
|
+
response: {
|
72
|
+
stats: {
|
73
|
+
totalUniqueDevices: number;
|
74
|
+
totalHwidDevices: number;
|
75
|
+
averageHwidDevicesPerUser: number;
|
76
|
+
};
|
77
|
+
byPlatform: {
|
78
|
+
platform: string;
|
79
|
+
count: number;
|
80
|
+
}[];
|
81
|
+
byApp: {
|
82
|
+
count: number;
|
83
|
+
app: string;
|
84
|
+
}[];
|
85
|
+
};
|
86
|
+
}, {
|
87
|
+
response: {
|
88
|
+
stats: {
|
89
|
+
totalUniqueDevices: number;
|
90
|
+
totalHwidDevices: number;
|
91
|
+
averageHwidDevicesPerUser: number;
|
92
|
+
};
|
93
|
+
byPlatform: {
|
94
|
+
platform: string;
|
95
|
+
count: number;
|
96
|
+
}[];
|
97
|
+
byApp: {
|
98
|
+
count: number;
|
99
|
+
app: string;
|
100
|
+
}[];
|
101
|
+
};
|
102
|
+
}>;
|
103
|
+
type Response = z.infer<typeof ResponseSchema>;
|
104
|
+
}
|
105
|
+
//# sourceMappingURL=get-hwid-devices-stats.command.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"get-hwid-devices-stats.command.d.ts","sourceRoot":"","sources":["../../../../commands/hwid/get-hwid-devices-stats.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,yBAAiB,0BAA0B,CAAC;IACjC,MAAM,GAAG,2BAAsB,CAAC;IAChC,MAAM,OAAO,2BAAM,CAAC;IAEpB,MAAM,eAAe,2CAI3B,CAAC;IAEK,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAoBzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.GetHwidDevicesStatsCommand = void 0;
|
4
|
+
const zod_1 = require("zod");
|
5
|
+
const constants_1 = require("../../constants");
|
6
|
+
const api_1 = require("../../api");
|
7
|
+
var GetHwidDevicesStatsCommand;
|
8
|
+
(function (GetHwidDevicesStatsCommand) {
|
9
|
+
GetHwidDevicesStatsCommand.url = api_1.REST_API.HWID.STATS;
|
10
|
+
GetHwidDevicesStatsCommand.TSQ_url = GetHwidDevicesStatsCommand.url;
|
11
|
+
GetHwidDevicesStatsCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.HWID_ROUTES.STATS, 'get', 'Get HWID devices stats');
|
12
|
+
GetHwidDevicesStatsCommand.ResponseSchema = zod_1.z.object({
|
13
|
+
response: zod_1.z.object({
|
14
|
+
byPlatform: zod_1.z.array(zod_1.z.object({
|
15
|
+
platform: zod_1.z.string(),
|
16
|
+
count: zod_1.z.number(),
|
17
|
+
})),
|
18
|
+
byApp: zod_1.z.array(zod_1.z.object({
|
19
|
+
app: zod_1.z.string(),
|
20
|
+
count: zod_1.z.number(),
|
21
|
+
})),
|
22
|
+
stats: zod_1.z.object({
|
23
|
+
totalUniqueDevices: zod_1.z.number(),
|
24
|
+
totalHwidDevices: zod_1.z.number(),
|
25
|
+
averageHwidDevicesPerUser: zod_1.z.number(),
|
26
|
+
}),
|
27
|
+
}),
|
28
|
+
});
|
29
|
+
})(GetHwidDevicesStatsCommand || (exports.GetHwidDevicesStatsCommand = GetHwidDevicesStatsCommand = {}));
|
@@ -1,5 +1,7 @@
|
|
1
1
|
export * from './create-user-hwid-device.command';
|
2
2
|
export * from './delete-all-user-hwid-devices.command';
|
3
3
|
export * from './delete-user-hwid-device.command';
|
4
|
+
export * from './get-all-hwid-devices.command';
|
5
|
+
export * from './get-hwid-devices-stats.command';
|
4
6
|
export * from './get-user-hwid-devices.command';
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../commands/hwid/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC;AAClD,cAAc,wCAAwC,CAAC;AACvD,cAAc,mCAAmC,CAAC;AAClD,cAAc,iCAAiC,CAAC"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../commands/hwid/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC;AAClD,cAAc,wCAAwC,CAAC;AACvD,cAAc,mCAAmC,CAAC;AAClD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC"}
|
@@ -17,4 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./create-user-hwid-device.command"), exports);
|
18
18
|
__exportStar(require("./delete-all-user-hwid-devices.command"), exports);
|
19
19
|
__exportStar(require("./delete-user-hwid-device.command"), exports);
|
20
|
+
__exportStar(require("./get-all-hwid-devices.command"), exports);
|
21
|
+
__exportStar(require("./get-hwid-devices-stats.command"), exports);
|
20
22
|
__exportStar(require("./get-user-hwid-devices.command"), exports);
|
@@ -814,5 +814,15 @@ export declare const ERRORS: {
|
|
814
814
|
readonly message: "Get user subscription request history error";
|
815
815
|
readonly httpCode: 500;
|
816
816
|
};
|
817
|
+
readonly GET_ALL_HWID_DEVICES_ERROR: {
|
818
|
+
readonly code: "A158";
|
819
|
+
readonly message: "Get all hwid devices error";
|
820
|
+
readonly httpCode: 500;
|
821
|
+
};
|
822
|
+
readonly GET_HWID_DEVICES_STATS_ERROR: {
|
823
|
+
readonly code: "A159";
|
824
|
+
readonly message: "Get hwid devices stats error";
|
825
|
+
readonly httpCode: 500;
|
826
|
+
};
|
817
827
|
};
|
818
828
|
//# sourceMappingURL=errors.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../constants/errors/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAwJY,MAAM;;;;;;;;;;wCAUN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCA4IN,MAAM
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../constants/errors/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAwJY,MAAM;;;;;;;;;;wCAUN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCA4IN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8e3B,CAAC"}
|
@@ -785,4 +785,14 @@ exports.ERRORS = {
|
|
785
785
|
message: 'Get user subscription request history error',
|
786
786
|
httpCode: 500,
|
787
787
|
},
|
788
|
+
GET_ALL_HWID_DEVICES_ERROR: {
|
789
|
+
code: 'A158',
|
790
|
+
message: 'Get all hwid devices error',
|
791
|
+
httpCode: 500,
|
792
|
+
},
|
793
|
+
GET_HWID_DEVICES_STATS_ERROR: {
|
794
|
+
code: 'A159',
|
795
|
+
message: 'Get hwid devices stats error',
|
796
|
+
httpCode: 500,
|
797
|
+
},
|
788
798
|
};
|
@@ -3,8 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.HWID_ROUTES = exports.HWID_CONTROLLER = void 0;
|
4
4
|
exports.HWID_CONTROLLER = 'hwid';
|
5
5
|
exports.HWID_ROUTES = {
|
6
|
+
GET_ALL_HWID_DEVICES: 'devices', // get
|
6
7
|
CREATE_USER_HWID_DEVICE: 'devices',
|
7
8
|
GET_USER_HWID_DEVICES: (userUuid) => `devices/${userUuid}`,
|
8
9
|
DELETE_USER_HWID_DEVICE: 'devices/delete',
|
9
10
|
DELETE_ALL_USER_HWID_DEVICES: 'devices/delete-all',
|
11
|
+
STATS: 'devices/stats', // get
|
10
12
|
};
|
@@ -164,10 +164,12 @@ exports.REST_API = {
|
|
164
164
|
UPDATE: `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_SETTINGS_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_SETTINGS_ROUTES.UPDATE}`,
|
165
165
|
},
|
166
166
|
HWID: {
|
167
|
+
GET_ALL_HWID_DEVICES: `${exports.ROOT}/${CONTROLLERS.HWID_CONTROLLER}/${CONTROLLERS.HWID_ROUTES.GET_ALL_HWID_DEVICES}`,
|
167
168
|
CREATE_USER_HWID_DEVICE: `${exports.ROOT}/${CONTROLLERS.HWID_CONTROLLER}/${CONTROLLERS.HWID_ROUTES.CREATE_USER_HWID_DEVICE}`,
|
168
169
|
GET_USER_HWID_DEVICES: (userUuid) => `${exports.ROOT}/${CONTROLLERS.HWID_CONTROLLER}/${CONTROLLERS.HWID_ROUTES.GET_USER_HWID_DEVICES(userUuid)}`,
|
169
170
|
DELETE_USER_HWID_DEVICE: `${exports.ROOT}/${CONTROLLERS.HWID_CONTROLLER}/${CONTROLLERS.HWID_ROUTES.DELETE_USER_HWID_DEVICE}`,
|
170
171
|
DELETE_ALL_USER_HWID_DEVICES: `${exports.ROOT}/${CONTROLLERS.HWID_CONTROLLER}/${CONTROLLERS.HWID_ROUTES.DELETE_ALL_USER_HWID_DEVICES}`,
|
172
|
+
STATS: `${exports.ROOT}/${CONTROLLERS.HWID_CONTROLLER}/${CONTROLLERS.HWID_ROUTES.STATS}`,
|
171
173
|
},
|
172
174
|
SUBSCRIPTIONS: {
|
173
175
|
GET: `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTIONS_CONTROLLER}/${CONTROLLERS.SUBSCRIPTIONS_ROUTES.GET}`,
|
@@ -0,0 +1,49 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.GetAllHwidDevicesCommand = void 0;
|
4
|
+
const zod_1 = require("zod");
|
5
|
+
const constants_1 = require("../../constants");
|
6
|
+
const models_1 = require("../../models");
|
7
|
+
const api_1 = require("../../api");
|
8
|
+
var GetAllHwidDevicesCommand;
|
9
|
+
(function (GetAllHwidDevicesCommand) {
|
10
|
+
GetAllHwidDevicesCommand.url = api_1.REST_API.HWID.GET_ALL_HWID_DEVICES;
|
11
|
+
GetAllHwidDevicesCommand.TSQ_url = GetAllHwidDevicesCommand.url;
|
12
|
+
GetAllHwidDevicesCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.HWID_ROUTES.GET_ALL_HWID_DEVICES, 'get', 'Get all HWID devices');
|
13
|
+
const FilterSchema = zod_1.z.object({
|
14
|
+
id: zod_1.z.string(),
|
15
|
+
value: zod_1.z.unknown(),
|
16
|
+
});
|
17
|
+
const SortingSchema = zod_1.z.object({
|
18
|
+
id: zod_1.z.string(),
|
19
|
+
desc: zod_1.z.boolean(),
|
20
|
+
});
|
21
|
+
GetAllHwidDevicesCommand.RequestQuerySchema = zod_1.z.object({
|
22
|
+
start: zod_1.z.coerce
|
23
|
+
.number()
|
24
|
+
.default(0)
|
25
|
+
.describe('Start index (offset) of the users to return, default is 0'),
|
26
|
+
size: zod_1.z.coerce
|
27
|
+
.number()
|
28
|
+
.min(1, 'Size (limit) must be greater than 0')
|
29
|
+
.max(1000, 'Size (limit) must be less than 1000')
|
30
|
+
.describe('Number of users to return, no more than 1000')
|
31
|
+
.default(25),
|
32
|
+
filters: zod_1.z
|
33
|
+
.preprocess((str) => (typeof str === 'string' ? JSON.parse(str) : str), zod_1.z.array(FilterSchema))
|
34
|
+
.optional(),
|
35
|
+
filterModes: zod_1.z
|
36
|
+
.preprocess((str) => (typeof str === 'string' ? JSON.parse(str) : str), zod_1.z.record(zod_1.z.string(), zod_1.z.string()))
|
37
|
+
.optional(),
|
38
|
+
globalFilterMode: zod_1.z.string().optional(),
|
39
|
+
sorting: zod_1.z
|
40
|
+
.preprocess((str) => (typeof str === 'string' ? JSON.parse(str) : str), zod_1.z.array(SortingSchema))
|
41
|
+
.optional(),
|
42
|
+
});
|
43
|
+
GetAllHwidDevicesCommand.ResponseSchema = zod_1.z.object({
|
44
|
+
response: zod_1.z.object({
|
45
|
+
devices: zod_1.z.array(models_1.HwidUserDeviceSchema),
|
46
|
+
total: zod_1.z.number(),
|
47
|
+
}),
|
48
|
+
});
|
49
|
+
})(GetAllHwidDevicesCommand || (exports.GetAllHwidDevicesCommand = GetAllHwidDevicesCommand = {}));
|
@@ -0,0 +1,29 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.GetHwidDevicesStatsCommand = void 0;
|
4
|
+
const zod_1 = require("zod");
|
5
|
+
const constants_1 = require("../../constants");
|
6
|
+
const api_1 = require("../../api");
|
7
|
+
var GetHwidDevicesStatsCommand;
|
8
|
+
(function (GetHwidDevicesStatsCommand) {
|
9
|
+
GetHwidDevicesStatsCommand.url = api_1.REST_API.HWID.STATS;
|
10
|
+
GetHwidDevicesStatsCommand.TSQ_url = GetHwidDevicesStatsCommand.url;
|
11
|
+
GetHwidDevicesStatsCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.HWID_ROUTES.STATS, 'get', 'Get HWID devices stats');
|
12
|
+
GetHwidDevicesStatsCommand.ResponseSchema = zod_1.z.object({
|
13
|
+
response: zod_1.z.object({
|
14
|
+
byPlatform: zod_1.z.array(zod_1.z.object({
|
15
|
+
platform: zod_1.z.string(),
|
16
|
+
count: zod_1.z.number(),
|
17
|
+
})),
|
18
|
+
byApp: zod_1.z.array(zod_1.z.object({
|
19
|
+
app: zod_1.z.string(),
|
20
|
+
count: zod_1.z.number(),
|
21
|
+
})),
|
22
|
+
stats: zod_1.z.object({
|
23
|
+
totalUniqueDevices: zod_1.z.number(),
|
24
|
+
totalHwidDevices: zod_1.z.number(),
|
25
|
+
averageHwidDevicesPerUser: zod_1.z.number(),
|
26
|
+
}),
|
27
|
+
}),
|
28
|
+
});
|
29
|
+
})(GetHwidDevicesStatsCommand || (exports.GetHwidDevicesStatsCommand = GetHwidDevicesStatsCommand = {}));
|
@@ -17,4 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./create-user-hwid-device.command"), exports);
|
18
18
|
__exportStar(require("./delete-all-user-hwid-devices.command"), exports);
|
19
19
|
__exportStar(require("./delete-user-hwid-device.command"), exports);
|
20
|
+
__exportStar(require("./get-all-hwid-devices.command"), exports);
|
21
|
+
__exportStar(require("./get-hwid-devices-stats.command"), exports);
|
20
22
|
__exportStar(require("./get-user-hwid-devices.command"), exports);
|
@@ -785,4 +785,14 @@ exports.ERRORS = {
|
|
785
785
|
message: 'Get user subscription request history error',
|
786
786
|
httpCode: 500,
|
787
787
|
},
|
788
|
+
GET_ALL_HWID_DEVICES_ERROR: {
|
789
|
+
code: 'A158',
|
790
|
+
message: 'Get all hwid devices error',
|
791
|
+
httpCode: 500,
|
792
|
+
},
|
793
|
+
GET_HWID_DEVICES_STATS_ERROR: {
|
794
|
+
code: 'A159',
|
795
|
+
message: 'Get hwid devices stats error',
|
796
|
+
httpCode: 500,
|
797
|
+
},
|
788
798
|
};
|