@remnawave/backend-contract 0.5.6 → 0.5.8
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/index.d.ts +1 -0
- package/build/backend/api/controllers/index.d.ts.map +1 -1
- package/build/backend/api/controllers/index.js +1 -0
- package/build/backend/api/controllers/subscriptions.d.ts +8 -0
- package/build/backend/api/controllers/subscriptions.d.ts.map +1 -0
- package/build/backend/api/controllers/subscriptions.js +10 -0
- package/build/backend/api/controllers/users.d.ts.map +1 -1
- package/build/backend/api/controllers/users.js +5 -5
- package/build/backend/api/routes.d.ts +6 -0
- package/build/backend/api/routes.d.ts.map +1 -1
- package/build/backend/api/routes.js +6 -0
- package/build/backend/commands/index.d.ts +1 -0
- package/build/backend/commands/index.d.ts.map +1 -1
- package/build/backend/commands/index.js +1 -0
- package/build/backend/commands/subscriptions/get-all-subscriptions.command.d.ts +183 -0
- package/build/backend/commands/subscriptions/get-all-subscriptions.command.d.ts.map +1 -0
- package/build/backend/commands/subscriptions/get-all-subscriptions.command.js +49 -0
- package/build/backend/commands/subscriptions/get-by/get-subscription-by-username.command.d.ts +133 -0
- package/build/backend/commands/subscriptions/get-by/get-subscription-by-username.command.d.ts.map +1 -0
- package/build/backend/commands/subscriptions/get-by/get-subscription-by-username.command.js +37 -0
- package/build/backend/commands/subscriptions/get-by/index.d.ts +2 -0
- package/build/backend/commands/subscriptions/get-by/index.d.ts.map +1 -0
- package/build/backend/commands/subscriptions/get-by/index.js +17 -0
- package/build/backend/commands/subscriptions/index.d.ts +3 -0
- package/build/backend/commands/subscriptions/index.d.ts.map +1 -0
- package/build/backend/commands/subscriptions/index.js +18 -0
- package/build/frontend/api/controllers/index.js +1 -0
- package/build/frontend/api/controllers/subscriptions.js +10 -0
- package/build/frontend/api/controllers/users.js +5 -5
- package/build/frontend/api/routes.js +6 -0
- package/build/frontend/commands/index.js +1 -0
- package/build/frontend/commands/subscriptions/get-all-subscriptions.command.js +49 -0
- package/build/frontend/commands/subscriptions/get-by/get-subscription-by-username.command.js +37 -0
- package/build/frontend/commands/subscriptions/get-by/index.js +17 -0
- package/build/frontend/commands/subscriptions/index.js +18 -0
- package/package.json +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../api/controllers/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../api/controllers/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC"}
|
@@ -24,6 +24,7 @@ __exportStar(require("./nodes"), exports);
|
|
24
24
|
__exportStar(require("./subscription"), exports);
|
25
25
|
__exportStar(require("./subscription-settings"), exports);
|
26
26
|
__exportStar(require("./subscription-template"), exports);
|
27
|
+
__exportStar(require("./subscriptions"), exports);
|
27
28
|
__exportStar(require("./system"), exports);
|
28
29
|
__exportStar(require("./users"), exports);
|
29
30
|
__exportStar(require("./xray"), exports);
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"subscriptions.d.ts","sourceRoot":"","sources":["../../../../api/controllers/subscriptions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,EAAG,eAAwB,CAAC;AAEjE,eAAO,MAAM,oBAAoB;;;sCAGJ,MAAM;;CAEzB,CAAC"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.SUBSCRIPTIONS_ROUTES = exports.SUBSCRIPTIONS_CONTROLLER = void 0;
|
4
|
+
exports.SUBSCRIPTIONS_CONTROLLER = 'subscriptions';
|
5
|
+
exports.SUBSCRIPTIONS_ROUTES = {
|
6
|
+
GET: '',
|
7
|
+
GET_BY: {
|
8
|
+
USERNAME: (username) => `by-username/${username}`,
|
9
|
+
},
|
10
|
+
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../../../api/controllers/users.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,EAAG,OAAgB,CAAC;AAEjD,eAAO,MAAM,mBAAmB,EAAG,SAAkB,CAAC;AAEtD,eAAO,MAAM,YAAY;;;;4BAIN,MAAM;iCACD,MAAM;;gCAEP,MAAM;iCACL,MAAM;uCACA,MAAM;+CACE,MAAM;6CAER,MAAM;;;yCAGV,MAAM;sCACT,MAAM;uDACW,MAAM;
|
1
|
+
{"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../../../api/controllers/users.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,EAAG,OAAgB,CAAC;AAEjD,eAAO,MAAM,mBAAmB,EAAG,SAAkB,CAAC;AAEtD,eAAO,MAAM,YAAY;;;;4BAIN,MAAM;iCACD,MAAM;;gCAEP,MAAM;iCACL,MAAM;uCACA,MAAM;+CACE,MAAM;6CAER,MAAM;;;yCAGV,MAAM;sCACT,MAAM;uDACW,MAAM;2CAClB,MAAM;gCACjB,MAAM;;;;;;;;;;;;;;;4CAiBM,MAAM;;CAE/B,CAAC"}
|
@@ -17,11 +17,11 @@ exports.USERS_ROUTES = {
|
|
17
17
|
REVOKE_SUBSCRIPTION: (uuid) => `${uuid}/${exports.USERS_ACTIONS_ROUTE}/revoke`,
|
18
18
|
},
|
19
19
|
GET_BY: {
|
20
|
-
SHORT_UUID: (shortUuid) =>
|
21
|
-
USERNAME: (username) =>
|
22
|
-
SUBSCRIPTION_UUID: (subscriptionUuid) =>
|
23
|
-
TELEGRAM_ID: (telegramId) =>
|
24
|
-
EMAIL: (email) =>
|
20
|
+
SHORT_UUID: (shortUuid) => `by-short-uuid/${shortUuid}`,
|
21
|
+
USERNAME: (username) => `by-username/${username}`,
|
22
|
+
SUBSCRIPTION_UUID: (subscriptionUuid) => `by-subscription-uuid/${subscriptionUuid}`,
|
23
|
+
TELEGRAM_ID: (telegramId) => `by-telegram-id/${telegramId}`,
|
24
|
+
EMAIL: (email) => `by-email/${email}`,
|
25
25
|
},
|
26
26
|
BULK: {
|
27
27
|
DELETE_BY_STATUS: 'bulk/delete-by-status',
|
@@ -126,5 +126,11 @@ export declare const REST_API: {
|
|
126
126
|
readonly GET_USER_HWID_DEVICES: (userUuid: string) => string;
|
127
127
|
readonly DELETE_USER_HWID_DEVICE: "/api/hwid/devices/delete";
|
128
128
|
};
|
129
|
+
readonly SUBSCRIPTIONS: {
|
130
|
+
readonly GET: "/api/subscriptions/";
|
131
|
+
readonly GET_BY: {
|
132
|
+
readonly USERNAME: (username: string) => string;
|
133
|
+
};
|
134
|
+
};
|
129
135
|
};
|
130
136
|
//# sourceMappingURL=routes.d.ts.map
|
@@ -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,cAAc,EAAG,SAAkB,CAAC;AAEjD,eAAO,MAAM,QAAQ;;;;;;;;gCAQE,MAAM;;;;;;;;;qCAYD,MAAM;;gCAGX,MAAM;;oCAIF,MAAM;qCAIL,MAAM;qCAIN,MAAM;;;;;;iDAUM,MAAM;;;;;;;;;;;;;;;;;;;;;;gCA0BvB,MAAM;qCAGD,MAAM;;qCAIN,MAAM;oCAIP,MAAM;2CAIC,MAAM;mDAIE,MAAM;iDAIR,MAAM;;;6CAOV,MAAM;0CAIT,MAAM;2DAIW,MAAM;+CAIlB,MAAM;oCAIjB,MAAM;;;;;;;;;;;;;;;gDAmBM,MAAM;;;;kCAOpB,MAAM;0CAEE,MAAM;uCAET,MAAM;;;;;;qCASR,MAAM;gCAEX,MAAM;;;;;;;;;;;;;;;;;;;;qCAsBD,MAAM;;;;;;;;;mDAYQ,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,cAAc,EAAG,SAAkB,CAAC;AAEjD,eAAO,MAAM,QAAQ;;;;;;;;gCAQE,MAAM;;;;;;;;;qCAYD,MAAM;;gCAGX,MAAM;;oCAIF,MAAM;qCAIL,MAAM;qCAIN,MAAM;;;;;;iDAUM,MAAM;;;;;;;;;;;;;;;;;;;;;;gCA0BvB,MAAM;qCAGD,MAAM;;qCAIN,MAAM;oCAIP,MAAM;2CAIC,MAAM;mDAIE,MAAM;iDAIR,MAAM;;;6CAOV,MAAM;0CAIT,MAAM;2DAIW,MAAM;+CAIlB,MAAM;oCAIjB,MAAM;;;;;;;;;;;;;;;gDAmBM,MAAM;;;;kCAOpB,MAAM;0CAEE,MAAM;uCAET,MAAM;;;;;;qCASR,MAAM;gCAEX,MAAM;;;;;;;;;;;;;;;;;;;;qCAsBD,MAAM;;;;;;;;;mDAYQ,MAAM;;;;;;0CASf,MAAM;;;CAM7B,CAAC"}
|
@@ -163,4 +163,10 @@ exports.REST_API = {
|
|
163
163
|
GET_USER_HWID_DEVICES: (userUuid) => `${exports.ROOT}/${CONTROLLERS.HWID_CONTROLLER}/${CONTROLLERS.HWID_ROUTES.GET_USER_HWID_DEVICES(userUuid)}`,
|
164
164
|
DELETE_USER_HWID_DEVICE: `${exports.ROOT}/${CONTROLLERS.HWID_CONTROLLER}/${CONTROLLERS.HWID_ROUTES.DELETE_USER_HWID_DEVICE}`,
|
165
165
|
},
|
166
|
+
SUBSCRIPTIONS: {
|
167
|
+
GET: `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTIONS_CONTROLLER}/${CONTROLLERS.SUBSCRIPTIONS_ROUTES.GET}`,
|
168
|
+
GET_BY: {
|
169
|
+
USERNAME: (username) => `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTIONS_CONTROLLER}/${CONTROLLERS.SUBSCRIPTIONS_ROUTES.GET_BY.USERNAME(username)}`,
|
170
|
+
},
|
171
|
+
},
|
166
172
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../commands/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../commands/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC"}
|
@@ -24,6 +24,7 @@ __exportStar(require("./nodes"), exports);
|
|
24
24
|
__exportStar(require("./subscription"), exports);
|
25
25
|
__exportStar(require("./subscription-settings"), exports);
|
26
26
|
__exportStar(require("./subscription-template"), exports);
|
27
|
+
__exportStar(require("./subscriptions"), exports);
|
27
28
|
__exportStar(require("./system"), exports);
|
28
29
|
__exportStar(require("./users"), exports);
|
29
30
|
__exportStar(require("./xray"), exports);
|
@@ -0,0 +1,183 @@
|
|
1
|
+
import { z } from 'zod';
|
2
|
+
export declare namespace GetAllSubscriptionsCommand {
|
3
|
+
const url: "/api/subscriptions/";
|
4
|
+
const TSQ_url: "/api/subscriptions/";
|
5
|
+
const endpointDetails: import("../../constants").EndpointDetails;
|
6
|
+
const RequestQuerySchema: z.ZodObject<{
|
7
|
+
start: z.ZodDefault<z.ZodNumber>;
|
8
|
+
size: z.ZodDefault<z.ZodNumber>;
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
10
|
+
start: number;
|
11
|
+
size: number;
|
12
|
+
}, {
|
13
|
+
start?: number | undefined;
|
14
|
+
size?: number | undefined;
|
15
|
+
}>;
|
16
|
+
type RequestQuery = z.infer<typeof RequestQuerySchema>;
|
17
|
+
const ResponseSchema: z.ZodObject<{
|
18
|
+
response: z.ZodObject<{
|
19
|
+
subscriptions: z.ZodArray<z.ZodObject<{
|
20
|
+
isFound: z.ZodBoolean;
|
21
|
+
user: z.ZodObject<{
|
22
|
+
shortUuid: z.ZodString;
|
23
|
+
daysLeft: z.ZodNumber;
|
24
|
+
trafficUsed: z.ZodString;
|
25
|
+
trafficLimit: z.ZodString;
|
26
|
+
username: z.ZodString;
|
27
|
+
expiresAt: z.ZodEffects<z.ZodString, Date, string>;
|
28
|
+
isActive: z.ZodBoolean;
|
29
|
+
userStatus: z.ZodNativeEnum<{
|
30
|
+
readonly ACTIVE: "ACTIVE";
|
31
|
+
readonly DISABLED: "DISABLED";
|
32
|
+
readonly LIMITED: "LIMITED";
|
33
|
+
readonly EXPIRED: "EXPIRED";
|
34
|
+
}>;
|
35
|
+
trafficLimitStrategy: z.ZodNativeEnum<{
|
36
|
+
readonly NO_RESET: "NO_RESET";
|
37
|
+
readonly DAY: "DAY";
|
38
|
+
readonly WEEK: "WEEK";
|
39
|
+
readonly MONTH: "MONTH";
|
40
|
+
}>;
|
41
|
+
}, "strip", z.ZodTypeAny, {
|
42
|
+
username: string;
|
43
|
+
shortUuid: string;
|
44
|
+
trafficLimitStrategy: "MONTH" | "NO_RESET" | "DAY" | "WEEK";
|
45
|
+
daysLeft: number;
|
46
|
+
trafficUsed: string;
|
47
|
+
trafficLimit: string;
|
48
|
+
expiresAt: Date;
|
49
|
+
isActive: boolean;
|
50
|
+
userStatus: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE";
|
51
|
+
}, {
|
52
|
+
username: string;
|
53
|
+
shortUuid: string;
|
54
|
+
trafficLimitStrategy: "MONTH" | "NO_RESET" | "DAY" | "WEEK";
|
55
|
+
daysLeft: number;
|
56
|
+
trafficUsed: string;
|
57
|
+
trafficLimit: string;
|
58
|
+
expiresAt: string;
|
59
|
+
isActive: boolean;
|
60
|
+
userStatus: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE";
|
61
|
+
}>;
|
62
|
+
links: z.ZodArray<z.ZodString, "many">;
|
63
|
+
ssConfLinks: z.ZodRecord<z.ZodString, z.ZodString>;
|
64
|
+
subscriptionUrl: z.ZodString;
|
65
|
+
}, "strip", z.ZodTypeAny, {
|
66
|
+
subscriptionUrl: string;
|
67
|
+
isFound: boolean;
|
68
|
+
user: {
|
69
|
+
username: string;
|
70
|
+
shortUuid: string;
|
71
|
+
trafficLimitStrategy: "MONTH" | "NO_RESET" | "DAY" | "WEEK";
|
72
|
+
daysLeft: number;
|
73
|
+
trafficUsed: string;
|
74
|
+
trafficLimit: string;
|
75
|
+
expiresAt: Date;
|
76
|
+
isActive: boolean;
|
77
|
+
userStatus: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE";
|
78
|
+
};
|
79
|
+
links: string[];
|
80
|
+
ssConfLinks: Record<string, string>;
|
81
|
+
}, {
|
82
|
+
subscriptionUrl: string;
|
83
|
+
isFound: boolean;
|
84
|
+
user: {
|
85
|
+
username: string;
|
86
|
+
shortUuid: string;
|
87
|
+
trafficLimitStrategy: "MONTH" | "NO_RESET" | "DAY" | "WEEK";
|
88
|
+
daysLeft: number;
|
89
|
+
trafficUsed: string;
|
90
|
+
trafficLimit: string;
|
91
|
+
expiresAt: string;
|
92
|
+
isActive: boolean;
|
93
|
+
userStatus: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE";
|
94
|
+
};
|
95
|
+
links: string[];
|
96
|
+
ssConfLinks: Record<string, string>;
|
97
|
+
}>, "many">;
|
98
|
+
total: z.ZodNumber;
|
99
|
+
}, "strip", z.ZodTypeAny, {
|
100
|
+
subscriptions: {
|
101
|
+
subscriptionUrl: string;
|
102
|
+
isFound: boolean;
|
103
|
+
user: {
|
104
|
+
username: string;
|
105
|
+
shortUuid: string;
|
106
|
+
trafficLimitStrategy: "MONTH" | "NO_RESET" | "DAY" | "WEEK";
|
107
|
+
daysLeft: number;
|
108
|
+
trafficUsed: string;
|
109
|
+
trafficLimit: string;
|
110
|
+
expiresAt: Date;
|
111
|
+
isActive: boolean;
|
112
|
+
userStatus: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE";
|
113
|
+
};
|
114
|
+
links: string[];
|
115
|
+
ssConfLinks: Record<string, string>;
|
116
|
+
}[];
|
117
|
+
total: number;
|
118
|
+
}, {
|
119
|
+
subscriptions: {
|
120
|
+
subscriptionUrl: string;
|
121
|
+
isFound: boolean;
|
122
|
+
user: {
|
123
|
+
username: string;
|
124
|
+
shortUuid: string;
|
125
|
+
trafficLimitStrategy: "MONTH" | "NO_RESET" | "DAY" | "WEEK";
|
126
|
+
daysLeft: number;
|
127
|
+
trafficUsed: string;
|
128
|
+
trafficLimit: string;
|
129
|
+
expiresAt: string;
|
130
|
+
isActive: boolean;
|
131
|
+
userStatus: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE";
|
132
|
+
};
|
133
|
+
links: string[];
|
134
|
+
ssConfLinks: Record<string, string>;
|
135
|
+
}[];
|
136
|
+
total: number;
|
137
|
+
}>;
|
138
|
+
}, "strip", z.ZodTypeAny, {
|
139
|
+
response: {
|
140
|
+
subscriptions: {
|
141
|
+
subscriptionUrl: string;
|
142
|
+
isFound: boolean;
|
143
|
+
user: {
|
144
|
+
username: string;
|
145
|
+
shortUuid: string;
|
146
|
+
trafficLimitStrategy: "MONTH" | "NO_RESET" | "DAY" | "WEEK";
|
147
|
+
daysLeft: number;
|
148
|
+
trafficUsed: string;
|
149
|
+
trafficLimit: string;
|
150
|
+
expiresAt: Date;
|
151
|
+
isActive: boolean;
|
152
|
+
userStatus: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE";
|
153
|
+
};
|
154
|
+
links: string[];
|
155
|
+
ssConfLinks: Record<string, string>;
|
156
|
+
}[];
|
157
|
+
total: number;
|
158
|
+
};
|
159
|
+
}, {
|
160
|
+
response: {
|
161
|
+
subscriptions: {
|
162
|
+
subscriptionUrl: string;
|
163
|
+
isFound: boolean;
|
164
|
+
user: {
|
165
|
+
username: string;
|
166
|
+
shortUuid: string;
|
167
|
+
trafficLimitStrategy: "MONTH" | "NO_RESET" | "DAY" | "WEEK";
|
168
|
+
daysLeft: number;
|
169
|
+
trafficUsed: string;
|
170
|
+
trafficLimit: string;
|
171
|
+
expiresAt: string;
|
172
|
+
isActive: boolean;
|
173
|
+
userStatus: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE";
|
174
|
+
};
|
175
|
+
links: string[];
|
176
|
+
ssConfLinks: Record<string, string>;
|
177
|
+
}[];
|
178
|
+
total: number;
|
179
|
+
};
|
180
|
+
}>;
|
181
|
+
type Response = z.infer<typeof ResponseSchema>;
|
182
|
+
}
|
183
|
+
//# sourceMappingURL=get-all-subscriptions.command.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"get-all-subscriptions.command.d.ts","sourceRoot":"","sources":["../../../../commands/subscriptions/get-all-subscriptions.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,yBAAiB,0BAA0B,CAAC;IACjC,MAAM,GAAG,uBAA6B,CAAC;IACvC,MAAM,OAAO,uBAAM,CAAC;IAEpB,MAAM,eAAe,2CAI3B,CAAC;IAEK,MAAM,kBAAkB;;;;;;;;;MAW7B,CAAC;IAEH,KAAY,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAEvD,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA0BzB,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.GetAllSubscriptionsCommand = void 0;
|
4
|
+
const zod_1 = require("zod");
|
5
|
+
const constants_1 = require("../../constants");
|
6
|
+
const api_1 = require("../../api");
|
7
|
+
var GetAllSubscriptionsCommand;
|
8
|
+
(function (GetAllSubscriptionsCommand) {
|
9
|
+
GetAllSubscriptionsCommand.url = api_1.REST_API.SUBSCRIPTIONS.GET;
|
10
|
+
GetAllSubscriptionsCommand.TSQ_url = GetAllSubscriptionsCommand.url;
|
11
|
+
GetAllSubscriptionsCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.SUBSCRIPTIONS_ROUTES.GET, 'get', 'Get all subscriptions');
|
12
|
+
GetAllSubscriptionsCommand.RequestQuerySchema = zod_1.z.object({
|
13
|
+
start: zod_1.z.coerce
|
14
|
+
.number()
|
15
|
+
.default(0)
|
16
|
+
.describe('Start index (offset) of the users to return, default is 0'),
|
17
|
+
size: zod_1.z.coerce
|
18
|
+
.number()
|
19
|
+
.min(1, 'Size (limit) must be greater than 0')
|
20
|
+
.max(500, 'Size (limit) must be less than 500')
|
21
|
+
.describe('Number of subscriptions to return, no more than 500')
|
22
|
+
.default(25),
|
23
|
+
});
|
24
|
+
GetAllSubscriptionsCommand.ResponseSchema = zod_1.z.object({
|
25
|
+
response: zod_1.z.object({
|
26
|
+
subscriptions: zod_1.z.array(zod_1.z.object({
|
27
|
+
isFound: zod_1.z.boolean(),
|
28
|
+
user: zod_1.z.object({
|
29
|
+
shortUuid: zod_1.z.string(),
|
30
|
+
daysLeft: zod_1.z.number(),
|
31
|
+
trafficUsed: zod_1.z.string(),
|
32
|
+
trafficLimit: zod_1.z.string(),
|
33
|
+
username: zod_1.z.string(),
|
34
|
+
expiresAt: zod_1.z
|
35
|
+
.string()
|
36
|
+
.datetime()
|
37
|
+
.transform((str) => new Date(str)),
|
38
|
+
isActive: zod_1.z.boolean(),
|
39
|
+
userStatus: zod_1.z.nativeEnum(constants_1.USERS_STATUS),
|
40
|
+
trafficLimitStrategy: zod_1.z.nativeEnum(constants_1.RESET_PERIODS),
|
41
|
+
}),
|
42
|
+
links: zod_1.z.array(zod_1.z.string()),
|
43
|
+
ssConfLinks: zod_1.z.record(zod_1.z.string(), zod_1.z.string()),
|
44
|
+
subscriptionUrl: zod_1.z.string(),
|
45
|
+
})),
|
46
|
+
total: zod_1.z.number(),
|
47
|
+
}),
|
48
|
+
});
|
49
|
+
})(GetAllSubscriptionsCommand || (exports.GetAllSubscriptionsCommand = GetAllSubscriptionsCommand = {}));
|
@@ -0,0 +1,133 @@
|
|
1
|
+
import { z } from 'zod';
|
2
|
+
export declare namespace GetSubscriptionByUsernameCommand {
|
3
|
+
const url: (username: string) => string;
|
4
|
+
const TSQ_url: string;
|
5
|
+
const endpointDetails: import("../../../constants").EndpointDetails;
|
6
|
+
const RequestSchema: z.ZodObject<{
|
7
|
+
username: z.ZodString;
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
9
|
+
username: string;
|
10
|
+
}, {
|
11
|
+
username: string;
|
12
|
+
}>;
|
13
|
+
type Request = z.infer<typeof RequestSchema>;
|
14
|
+
const ResponseSchema: z.ZodObject<{
|
15
|
+
response: z.ZodObject<{
|
16
|
+
isFound: z.ZodBoolean;
|
17
|
+
user: z.ZodObject<{
|
18
|
+
shortUuid: z.ZodString;
|
19
|
+
daysLeft: z.ZodNumber;
|
20
|
+
trafficUsed: z.ZodString;
|
21
|
+
trafficLimit: z.ZodString;
|
22
|
+
username: z.ZodString;
|
23
|
+
expiresAt: z.ZodEffects<z.ZodString, Date, string>;
|
24
|
+
isActive: z.ZodBoolean;
|
25
|
+
userStatus: z.ZodNativeEnum<{
|
26
|
+
readonly ACTIVE: "ACTIVE";
|
27
|
+
readonly DISABLED: "DISABLED";
|
28
|
+
readonly LIMITED: "LIMITED";
|
29
|
+
readonly EXPIRED: "EXPIRED";
|
30
|
+
}>;
|
31
|
+
trafficLimitStrategy: z.ZodNativeEnum<{
|
32
|
+
readonly NO_RESET: "NO_RESET";
|
33
|
+
readonly DAY: "DAY";
|
34
|
+
readonly WEEK: "WEEK";
|
35
|
+
readonly MONTH: "MONTH";
|
36
|
+
}>;
|
37
|
+
}, "strip", z.ZodTypeAny, {
|
38
|
+
username: string;
|
39
|
+
shortUuid: string;
|
40
|
+
trafficLimitStrategy: "MONTH" | "NO_RESET" | "DAY" | "WEEK";
|
41
|
+
daysLeft: number;
|
42
|
+
trafficUsed: string;
|
43
|
+
trafficLimit: string;
|
44
|
+
expiresAt: Date;
|
45
|
+
isActive: boolean;
|
46
|
+
userStatus: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE";
|
47
|
+
}, {
|
48
|
+
username: string;
|
49
|
+
shortUuid: string;
|
50
|
+
trafficLimitStrategy: "MONTH" | "NO_RESET" | "DAY" | "WEEK";
|
51
|
+
daysLeft: number;
|
52
|
+
trafficUsed: string;
|
53
|
+
trafficLimit: string;
|
54
|
+
expiresAt: string;
|
55
|
+
isActive: boolean;
|
56
|
+
userStatus: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE";
|
57
|
+
}>;
|
58
|
+
links: z.ZodArray<z.ZodString, "many">;
|
59
|
+
ssConfLinks: z.ZodRecord<z.ZodString, z.ZodString>;
|
60
|
+
subscriptionUrl: z.ZodString;
|
61
|
+
}, "strip", z.ZodTypeAny, {
|
62
|
+
subscriptionUrl: string;
|
63
|
+
isFound: boolean;
|
64
|
+
user: {
|
65
|
+
username: string;
|
66
|
+
shortUuid: string;
|
67
|
+
trafficLimitStrategy: "MONTH" | "NO_RESET" | "DAY" | "WEEK";
|
68
|
+
daysLeft: number;
|
69
|
+
trafficUsed: string;
|
70
|
+
trafficLimit: string;
|
71
|
+
expiresAt: Date;
|
72
|
+
isActive: boolean;
|
73
|
+
userStatus: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE";
|
74
|
+
};
|
75
|
+
links: string[];
|
76
|
+
ssConfLinks: Record<string, string>;
|
77
|
+
}, {
|
78
|
+
subscriptionUrl: string;
|
79
|
+
isFound: boolean;
|
80
|
+
user: {
|
81
|
+
username: string;
|
82
|
+
shortUuid: string;
|
83
|
+
trafficLimitStrategy: "MONTH" | "NO_RESET" | "DAY" | "WEEK";
|
84
|
+
daysLeft: number;
|
85
|
+
trafficUsed: string;
|
86
|
+
trafficLimit: string;
|
87
|
+
expiresAt: string;
|
88
|
+
isActive: boolean;
|
89
|
+
userStatus: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE";
|
90
|
+
};
|
91
|
+
links: string[];
|
92
|
+
ssConfLinks: Record<string, string>;
|
93
|
+
}>;
|
94
|
+
}, "strip", z.ZodTypeAny, {
|
95
|
+
response: {
|
96
|
+
subscriptionUrl: string;
|
97
|
+
isFound: boolean;
|
98
|
+
user: {
|
99
|
+
username: string;
|
100
|
+
shortUuid: string;
|
101
|
+
trafficLimitStrategy: "MONTH" | "NO_RESET" | "DAY" | "WEEK";
|
102
|
+
daysLeft: number;
|
103
|
+
trafficUsed: string;
|
104
|
+
trafficLimit: string;
|
105
|
+
expiresAt: Date;
|
106
|
+
isActive: boolean;
|
107
|
+
userStatus: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE";
|
108
|
+
};
|
109
|
+
links: string[];
|
110
|
+
ssConfLinks: Record<string, string>;
|
111
|
+
};
|
112
|
+
}, {
|
113
|
+
response: {
|
114
|
+
subscriptionUrl: string;
|
115
|
+
isFound: boolean;
|
116
|
+
user: {
|
117
|
+
username: string;
|
118
|
+
shortUuid: string;
|
119
|
+
trafficLimitStrategy: "MONTH" | "NO_RESET" | "DAY" | "WEEK";
|
120
|
+
daysLeft: number;
|
121
|
+
trafficUsed: string;
|
122
|
+
trafficLimit: string;
|
123
|
+
expiresAt: string;
|
124
|
+
isActive: boolean;
|
125
|
+
userStatus: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE";
|
126
|
+
};
|
127
|
+
links: string[];
|
128
|
+
ssConfLinks: Record<string, string>;
|
129
|
+
};
|
130
|
+
}>;
|
131
|
+
type Response = z.infer<typeof ResponseSchema>;
|
132
|
+
}
|
133
|
+
//# sourceMappingURL=get-subscription-by-username.command.d.ts.map
|
package/build/backend/commands/subscriptions/get-by/get-subscription-by-username.command.d.ts.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"get-subscription-by-username.command.d.ts","sourceRoot":"","sources":["../../../../../commands/subscriptions/get-by/get-subscription-by-username.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,yBAAiB,gCAAgC,CAAC;IACvC,MAAM,GAAG,8BAAyC,CAAC;IACnD,MAAM,OAAO,QAAmB,CAAC;IAEjC,MAAM,eAAe,8CAI3B,CAAC;IAEK,MAAM,aAAa;;;;;;MAExB,CAAC;IAEH,KAAY,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;IAE7C,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAqBzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.GetSubscriptionByUsernameCommand = void 0;
|
4
|
+
const zod_1 = require("zod");
|
5
|
+
const constants_1 = require("../../../constants");
|
6
|
+
const api_1 = require("../../../api");
|
7
|
+
var GetSubscriptionByUsernameCommand;
|
8
|
+
(function (GetSubscriptionByUsernameCommand) {
|
9
|
+
GetSubscriptionByUsernameCommand.url = api_1.REST_API.SUBSCRIPTIONS.GET_BY.USERNAME;
|
10
|
+
GetSubscriptionByUsernameCommand.TSQ_url = GetSubscriptionByUsernameCommand.url(':username');
|
11
|
+
GetSubscriptionByUsernameCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.SUBSCRIPTIONS_ROUTES.GET_BY.USERNAME(':username'), 'get', 'Get subscription by username');
|
12
|
+
GetSubscriptionByUsernameCommand.RequestSchema = zod_1.z.object({
|
13
|
+
username: zod_1.z.string(),
|
14
|
+
});
|
15
|
+
GetSubscriptionByUsernameCommand.ResponseSchema = zod_1.z.object({
|
16
|
+
response: zod_1.z.object({
|
17
|
+
isFound: zod_1.z.boolean(),
|
18
|
+
user: zod_1.z.object({
|
19
|
+
shortUuid: zod_1.z.string(),
|
20
|
+
daysLeft: zod_1.z.number(),
|
21
|
+
trafficUsed: zod_1.z.string(),
|
22
|
+
trafficLimit: zod_1.z.string(),
|
23
|
+
username: zod_1.z.string(),
|
24
|
+
expiresAt: zod_1.z
|
25
|
+
.string()
|
26
|
+
.datetime()
|
27
|
+
.transform((str) => new Date(str)),
|
28
|
+
isActive: zod_1.z.boolean(),
|
29
|
+
userStatus: zod_1.z.nativeEnum(constants_1.USERS_STATUS),
|
30
|
+
trafficLimitStrategy: zod_1.z.nativeEnum(constants_1.RESET_PERIODS),
|
31
|
+
}),
|
32
|
+
links: zod_1.z.array(zod_1.z.string()),
|
33
|
+
ssConfLinks: zod_1.z.record(zod_1.z.string(), zod_1.z.string()),
|
34
|
+
subscriptionUrl: zod_1.z.string(),
|
35
|
+
}),
|
36
|
+
});
|
37
|
+
})(GetSubscriptionByUsernameCommand || (exports.GetSubscriptionByUsernameCommand = GetSubscriptionByUsernameCommand = {}));
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../commands/subscriptions/get-by/index.ts"],"names":[],"mappings":"AAAA,cAAc,wCAAwC,CAAC"}
|
@@ -0,0 +1,17 @@
|
|
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("./get-subscription-by-username.command"), exports);
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../commands/subscriptions/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,UAAU,CAAC"}
|
@@ -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("./get-all-subscriptions.command"), exports);
|
18
|
+
__exportStar(require("./get-by"), exports);
|
@@ -24,6 +24,7 @@ __exportStar(require("./nodes"), exports);
|
|
24
24
|
__exportStar(require("./subscription"), exports);
|
25
25
|
__exportStar(require("./subscription-settings"), exports);
|
26
26
|
__exportStar(require("./subscription-template"), exports);
|
27
|
+
__exportStar(require("./subscriptions"), exports);
|
27
28
|
__exportStar(require("./system"), exports);
|
28
29
|
__exportStar(require("./users"), exports);
|
29
30
|
__exportStar(require("./xray"), exports);
|
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.SUBSCRIPTIONS_ROUTES = exports.SUBSCRIPTIONS_CONTROLLER = void 0;
|
4
|
+
exports.SUBSCRIPTIONS_CONTROLLER = 'subscriptions';
|
5
|
+
exports.SUBSCRIPTIONS_ROUTES = {
|
6
|
+
GET: '',
|
7
|
+
GET_BY: {
|
8
|
+
USERNAME: (username) => `by-username/${username}`,
|
9
|
+
},
|
10
|
+
};
|
@@ -17,11 +17,11 @@ exports.USERS_ROUTES = {
|
|
17
17
|
REVOKE_SUBSCRIPTION: (uuid) => `${uuid}/${exports.USERS_ACTIONS_ROUTE}/revoke`,
|
18
18
|
},
|
19
19
|
GET_BY: {
|
20
|
-
SHORT_UUID: (shortUuid) =>
|
21
|
-
USERNAME: (username) =>
|
22
|
-
SUBSCRIPTION_UUID: (subscriptionUuid) =>
|
23
|
-
TELEGRAM_ID: (telegramId) =>
|
24
|
-
EMAIL: (email) =>
|
20
|
+
SHORT_UUID: (shortUuid) => `by-short-uuid/${shortUuid}`,
|
21
|
+
USERNAME: (username) => `by-username/${username}`,
|
22
|
+
SUBSCRIPTION_UUID: (subscriptionUuid) => `by-subscription-uuid/${subscriptionUuid}`,
|
23
|
+
TELEGRAM_ID: (telegramId) => `by-telegram-id/${telegramId}`,
|
24
|
+
EMAIL: (email) => `by-email/${email}`,
|
25
25
|
},
|
26
26
|
BULK: {
|
27
27
|
DELETE_BY_STATUS: 'bulk/delete-by-status',
|
@@ -163,4 +163,10 @@ exports.REST_API = {
|
|
163
163
|
GET_USER_HWID_DEVICES: (userUuid) => `${exports.ROOT}/${CONTROLLERS.HWID_CONTROLLER}/${CONTROLLERS.HWID_ROUTES.GET_USER_HWID_DEVICES(userUuid)}`,
|
164
164
|
DELETE_USER_HWID_DEVICE: `${exports.ROOT}/${CONTROLLERS.HWID_CONTROLLER}/${CONTROLLERS.HWID_ROUTES.DELETE_USER_HWID_DEVICE}`,
|
165
165
|
},
|
166
|
+
SUBSCRIPTIONS: {
|
167
|
+
GET: `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTIONS_CONTROLLER}/${CONTROLLERS.SUBSCRIPTIONS_ROUTES.GET}`,
|
168
|
+
GET_BY: {
|
169
|
+
USERNAME: (username) => `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTIONS_CONTROLLER}/${CONTROLLERS.SUBSCRIPTIONS_ROUTES.GET_BY.USERNAME(username)}`,
|
170
|
+
},
|
171
|
+
},
|
166
172
|
};
|
@@ -24,6 +24,7 @@ __exportStar(require("./nodes"), exports);
|
|
24
24
|
__exportStar(require("./subscription"), exports);
|
25
25
|
__exportStar(require("./subscription-settings"), exports);
|
26
26
|
__exportStar(require("./subscription-template"), exports);
|
27
|
+
__exportStar(require("./subscriptions"), exports);
|
27
28
|
__exportStar(require("./system"), exports);
|
28
29
|
__exportStar(require("./users"), exports);
|
29
30
|
__exportStar(require("./xray"), exports);
|
@@ -0,0 +1,49 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.GetAllSubscriptionsCommand = void 0;
|
4
|
+
const zod_1 = require("zod");
|
5
|
+
const constants_1 = require("../../constants");
|
6
|
+
const api_1 = require("../../api");
|
7
|
+
var GetAllSubscriptionsCommand;
|
8
|
+
(function (GetAllSubscriptionsCommand) {
|
9
|
+
GetAllSubscriptionsCommand.url = api_1.REST_API.SUBSCRIPTIONS.GET;
|
10
|
+
GetAllSubscriptionsCommand.TSQ_url = GetAllSubscriptionsCommand.url;
|
11
|
+
GetAllSubscriptionsCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.SUBSCRIPTIONS_ROUTES.GET, 'get', 'Get all subscriptions');
|
12
|
+
GetAllSubscriptionsCommand.RequestQuerySchema = zod_1.z.object({
|
13
|
+
start: zod_1.z.coerce
|
14
|
+
.number()
|
15
|
+
.default(0)
|
16
|
+
.describe('Start index (offset) of the users to return, default is 0'),
|
17
|
+
size: zod_1.z.coerce
|
18
|
+
.number()
|
19
|
+
.min(1, 'Size (limit) must be greater than 0')
|
20
|
+
.max(500, 'Size (limit) must be less than 500')
|
21
|
+
.describe('Number of subscriptions to return, no more than 500')
|
22
|
+
.default(25),
|
23
|
+
});
|
24
|
+
GetAllSubscriptionsCommand.ResponseSchema = zod_1.z.object({
|
25
|
+
response: zod_1.z.object({
|
26
|
+
subscriptions: zod_1.z.array(zod_1.z.object({
|
27
|
+
isFound: zod_1.z.boolean(),
|
28
|
+
user: zod_1.z.object({
|
29
|
+
shortUuid: zod_1.z.string(),
|
30
|
+
daysLeft: zod_1.z.number(),
|
31
|
+
trafficUsed: zod_1.z.string(),
|
32
|
+
trafficLimit: zod_1.z.string(),
|
33
|
+
username: zod_1.z.string(),
|
34
|
+
expiresAt: zod_1.z
|
35
|
+
.string()
|
36
|
+
.datetime()
|
37
|
+
.transform((str) => new Date(str)),
|
38
|
+
isActive: zod_1.z.boolean(),
|
39
|
+
userStatus: zod_1.z.nativeEnum(constants_1.USERS_STATUS),
|
40
|
+
trafficLimitStrategy: zod_1.z.nativeEnum(constants_1.RESET_PERIODS),
|
41
|
+
}),
|
42
|
+
links: zod_1.z.array(zod_1.z.string()),
|
43
|
+
ssConfLinks: zod_1.z.record(zod_1.z.string(), zod_1.z.string()),
|
44
|
+
subscriptionUrl: zod_1.z.string(),
|
45
|
+
})),
|
46
|
+
total: zod_1.z.number(),
|
47
|
+
}),
|
48
|
+
});
|
49
|
+
})(GetAllSubscriptionsCommand || (exports.GetAllSubscriptionsCommand = GetAllSubscriptionsCommand = {}));
|
@@ -0,0 +1,37 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.GetSubscriptionByUsernameCommand = void 0;
|
4
|
+
const zod_1 = require("zod");
|
5
|
+
const constants_1 = require("../../../constants");
|
6
|
+
const api_1 = require("../../../api");
|
7
|
+
var GetSubscriptionByUsernameCommand;
|
8
|
+
(function (GetSubscriptionByUsernameCommand) {
|
9
|
+
GetSubscriptionByUsernameCommand.url = api_1.REST_API.SUBSCRIPTIONS.GET_BY.USERNAME;
|
10
|
+
GetSubscriptionByUsernameCommand.TSQ_url = GetSubscriptionByUsernameCommand.url(':username');
|
11
|
+
GetSubscriptionByUsernameCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.SUBSCRIPTIONS_ROUTES.GET_BY.USERNAME(':username'), 'get', 'Get subscription by username');
|
12
|
+
GetSubscriptionByUsernameCommand.RequestSchema = zod_1.z.object({
|
13
|
+
username: zod_1.z.string(),
|
14
|
+
});
|
15
|
+
GetSubscriptionByUsernameCommand.ResponseSchema = zod_1.z.object({
|
16
|
+
response: zod_1.z.object({
|
17
|
+
isFound: zod_1.z.boolean(),
|
18
|
+
user: zod_1.z.object({
|
19
|
+
shortUuid: zod_1.z.string(),
|
20
|
+
daysLeft: zod_1.z.number(),
|
21
|
+
trafficUsed: zod_1.z.string(),
|
22
|
+
trafficLimit: zod_1.z.string(),
|
23
|
+
username: zod_1.z.string(),
|
24
|
+
expiresAt: zod_1.z
|
25
|
+
.string()
|
26
|
+
.datetime()
|
27
|
+
.transform((str) => new Date(str)),
|
28
|
+
isActive: zod_1.z.boolean(),
|
29
|
+
userStatus: zod_1.z.nativeEnum(constants_1.USERS_STATUS),
|
30
|
+
trafficLimitStrategy: zod_1.z.nativeEnum(constants_1.RESET_PERIODS),
|
31
|
+
}),
|
32
|
+
links: zod_1.z.array(zod_1.z.string()),
|
33
|
+
ssConfLinks: zod_1.z.record(zod_1.z.string(), zod_1.z.string()),
|
34
|
+
subscriptionUrl: zod_1.z.string(),
|
35
|
+
}),
|
36
|
+
});
|
37
|
+
})(GetSubscriptionByUsernameCommand || (exports.GetSubscriptionByUsernameCommand = GetSubscriptionByUsernameCommand = {}));
|
@@ -0,0 +1,17 @@
|
|
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("./get-subscription-by-username.command"), exports);
|
@@ -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("./get-all-subscriptions.command"), exports);
|
18
|
+
__exportStar(require("./get-by"), exports);
|