@purpleschool/multisite 0.0.18 → 0.0.19
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/api/controller/http/subscription.ts +1 -0
- package/api/controller/http/user.ts +7 -0
- package/api/routes.ts +14 -0
- package/build/api/controller/http/subscription.d.ts +1 -0
- package/build/api/controller/http/subscription.d.ts.map +1 -1
- package/build/api/controller/http/subscription.js +1 -0
- package/build/api/controller/http/user.d.ts +7 -0
- package/build/api/controller/http/user.d.ts.map +1 -1
- package/build/api/controller/http/user.js +7 -0
- package/build/api/routes.d.ts +8 -0
- package/build/api/routes.d.ts.map +1 -1
- package/build/api/routes.js +8 -0
- package/build/commands/subscription/index.d.ts +1 -0
- package/build/commands/subscription/index.d.ts.map +1 -1
- package/build/commands/subscription/index.js +1 -0
- package/build/commands/subscription/recover-subscription.command.d.ts +14 -0
- package/build/commands/subscription/recover-subscription.command.d.ts.map +1 -0
- package/build/commands/subscription/recover-subscription.command.js +11 -0
- package/build/constants/errors/errors.d.ts +5 -0
- package/build/constants/errors/errors.d.ts.map +1 -1
- package/build/constants/errors/errors.js +5 -0
- package/build/queries/user/find-users.command.d.ts +83 -0
- package/build/queries/user/find-users.command.d.ts.map +1 -0
- package/build/queries/user/find-users.command.js +27 -0
- package/build/queries/user/get-all-users.command.d.ts +38 -0
- package/build/queries/user/get-all-users.command.d.ts.map +1 -0
- package/build/queries/user/get-all-users.command.js +16 -0
- package/build/queries/user/index.d.ts +2 -0
- package/build/queries/user/index.d.ts.map +1 -1
- package/build/queries/user/index.js +2 -0
- package/commands/subscription/index.ts +1 -0
- package/commands/subscription/recover-subscription.command.ts +11 -0
- package/constants/errors/errors.ts +5 -0
- package/package.json +1 -1
- package/queries/user/find-users.command.ts +29 -0
- package/queries/user/get-all-users.command.ts +17 -0
- package/queries/user/index.ts +2 -0
|
@@ -3,4 +3,11 @@ export const USER_CONTROLLER = 'users' as const;
|
|
|
3
3
|
export const USER_ROUTES = {
|
|
4
4
|
GET: 'me',
|
|
5
5
|
BALANCE: 'balance',
|
|
6
|
+
GET_ALL: 'all',
|
|
7
|
+
FIND_BY_CRITERIA: 'criteria',
|
|
8
|
+
FIND_BY_UUID: (uuid: string) => `${uuid}`,
|
|
9
|
+
GET_BALANCE: (uuid: string) => `balance/${uuid}`,
|
|
10
|
+
GET_SUBSCRIPTIONS: (uuid: string) => `subscriptions/${uuid}`,
|
|
11
|
+
GET_PRODUCTS: (uuid: string) => `products/${uuid}`,
|
|
12
|
+
GET_PAYMENTS: (uuid: string) => `payments/${uuid}`,
|
|
6
13
|
} as const;
|
package/api/routes.ts
CHANGED
|
@@ -26,6 +26,18 @@ export const REST_API = {
|
|
|
26
26
|
USERS: {
|
|
27
27
|
GET: `${ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET}`,
|
|
28
28
|
BALANCE: `${ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.BALANCE}`,
|
|
29
|
+
GET_ALL: `${ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET_ALL}`,
|
|
30
|
+
FIND_BY_CRITERIA: `${ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.FIND_BY_CRITERIA}`,
|
|
31
|
+
FIND_BY_UUID: (uuid: string) =>
|
|
32
|
+
`${ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.FIND_BY_UUID(uuid)}`,
|
|
33
|
+
GET_BALANCE: (uuid: string) =>
|
|
34
|
+
`${ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET_BALANCE(uuid)}`,
|
|
35
|
+
GET_SUBSCRIPTIONS: (uuid: string) =>
|
|
36
|
+
`${ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET_SUBSCRIPTIONS(uuid)}`,
|
|
37
|
+
GET_PRODUCTS: (uuid: string) =>
|
|
38
|
+
`${ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET_PRODUCTS(uuid)}`,
|
|
39
|
+
GET_PAYMENTS: (uuid: string) =>
|
|
40
|
+
`${ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET_PAYMENTS(uuid)}`,
|
|
29
41
|
},
|
|
30
42
|
PRODUCT_PUBLIC: {
|
|
31
43
|
GET: `${ROOT}/${CONTROLLERS.PRODUCT_PUBLIC_CONTROLLER}/${CONTROLLERS.PRODUCT_ROUTES.GET_ALL}`,
|
|
@@ -51,6 +63,8 @@ export const REST_API = {
|
|
|
51
63
|
GET_MY: `${ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.GET_MY}`,
|
|
52
64
|
CANCEL: (uuid: string) =>
|
|
53
65
|
`${ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${uuid}/${CONTROLLERS.SUBSCRIPTION_ROUTES.CANCEL}`,
|
|
66
|
+
RECOVER: (uuid: string) =>
|
|
67
|
+
`${ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${uuid}/${CONTROLLERS.SUBSCRIPTION_ROUTES.RECOVER}`,
|
|
54
68
|
},
|
|
55
69
|
PAYMENT: {
|
|
56
70
|
HISTORY: `${ROOT}/${CONTROLLERS.PAYMENT_CONTROLLER}/${CONTROLLERS.PAYMENT_ROUTES.HISTORY}`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscription.d.ts","sourceRoot":"","sources":["../../../../api/controller/http/subscription.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,+BAA+B,EAAG,sBAA+B,CAAC;AAC/E,eAAO,MAAM,8BAA8B,EAAG,qBAA8B,CAAC;AAE7E,eAAO,MAAM,mBAAmB
|
|
1
|
+
{"version":3,"file":"subscription.d.ts","sourceRoot":"","sources":["../../../../api/controller/http/subscription.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,+BAA+B,EAAG,sBAA+B,CAAC;AAC/E,eAAO,MAAM,8BAA8B,EAAG,qBAA8B,CAAC;AAE7E,eAAO,MAAM,mBAAmB;;;;;;;;CAQtB,CAAC"}
|
|
@@ -2,5 +2,12 @@ export declare const USER_CONTROLLER: "users";
|
|
|
2
2
|
export declare const USER_ROUTES: {
|
|
3
3
|
readonly GET: "me";
|
|
4
4
|
readonly BALANCE: "balance";
|
|
5
|
+
readonly GET_ALL: "all";
|
|
6
|
+
readonly FIND_BY_CRITERIA: "criteria";
|
|
7
|
+
readonly FIND_BY_UUID: (uuid: string) => string;
|
|
8
|
+
readonly GET_BALANCE: (uuid: string) => string;
|
|
9
|
+
readonly GET_SUBSCRIPTIONS: (uuid: string) => string;
|
|
10
|
+
readonly GET_PRODUCTS: (uuid: string) => string;
|
|
11
|
+
readonly GET_PAYMENTS: (uuid: string) => string;
|
|
5
12
|
};
|
|
6
13
|
//# sourceMappingURL=user.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../../api/controller/http/user.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,EAAG,OAAgB,CAAC;AAEhD,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../../api/controller/http/user.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,EAAG,OAAgB,CAAC;AAEhD,eAAO,MAAM,WAAW;;;;;kCAKC,MAAM;iCACP,MAAM;uCACA,MAAM;kCACX,MAAM;kCACN,MAAM;CACrB,CAAC"}
|
|
@@ -5,4 +5,11 @@ exports.USER_CONTROLLER = 'users';
|
|
|
5
5
|
exports.USER_ROUTES = {
|
|
6
6
|
GET: 'me',
|
|
7
7
|
BALANCE: 'balance',
|
|
8
|
+
GET_ALL: 'all',
|
|
9
|
+
FIND_BY_CRITERIA: 'criteria',
|
|
10
|
+
FIND_BY_UUID: (uuid) => `${uuid}`,
|
|
11
|
+
GET_BALANCE: (uuid) => `balance/${uuid}`,
|
|
12
|
+
GET_SUBSCRIPTIONS: (uuid) => `subscriptions/${uuid}`,
|
|
13
|
+
GET_PRODUCTS: (uuid) => `products/${uuid}`,
|
|
14
|
+
GET_PAYMENTS: (uuid) => `payments/${uuid}`,
|
|
8
15
|
};
|
package/build/api/routes.d.ts
CHANGED
|
@@ -23,6 +23,13 @@ export declare const REST_API: {
|
|
|
23
23
|
readonly USERS: {
|
|
24
24
|
readonly GET: "/api/users/me";
|
|
25
25
|
readonly BALANCE: "/api/users/balance";
|
|
26
|
+
readonly GET_ALL: "/api/users/all";
|
|
27
|
+
readonly FIND_BY_CRITERIA: "/api/users/criteria";
|
|
28
|
+
readonly FIND_BY_UUID: (uuid: string) => string;
|
|
29
|
+
readonly GET_BALANCE: (uuid: string) => string;
|
|
30
|
+
readonly GET_SUBSCRIPTIONS: (uuid: string) => string;
|
|
31
|
+
readonly GET_PRODUCTS: (uuid: string) => string;
|
|
32
|
+
readonly GET_PAYMENTS: (uuid: string) => string;
|
|
26
33
|
};
|
|
27
34
|
readonly PRODUCT_PUBLIC: {
|
|
28
35
|
readonly GET: "/api/product/public/all";
|
|
@@ -43,6 +50,7 @@ export declare const REST_API: {
|
|
|
43
50
|
readonly SUMMARY: "/api/subscription/private/summary";
|
|
44
51
|
readonly GET_MY: "/api/subscription/private/my";
|
|
45
52
|
readonly CANCEL: (uuid: string) => string;
|
|
53
|
+
readonly RECOVER: (uuid: string) => string;
|
|
46
54
|
};
|
|
47
55
|
readonly PAYMENT: {
|
|
48
56
|
readonly HISTORY: "/api/payments/history";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../api/routes.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,EAAG,MAAe,CAAC;AAEpC,eAAO,MAAM,QAAQ
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../api/routes.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,EAAG,MAAe,CAAC;AAEpC,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;sCA0BQ,MAAM;qCAEP,MAAM;2CAEA,MAAM;sCAEX,MAAM;sCAEN,MAAM;;;;kCAKV,MAAM;;;;6BAKX,MAAM;;;;;kCAMD,MAAM;;;;6BAKX,MAAM;;;gCAIH,MAAM;iCAEL,MAAM;;;;;;kCAOL,MAAM;;;;;;iCAOP,MAAM;gCAEP,MAAM;sCAEA,MAAM;gCAEZ,MAAM;;+BAGP,MAAM;;;;;;iCAOJ,MAAM;gCAEP,MAAM;sCAEA,MAAM;gCAEZ,MAAM;;+BAGP,MAAM;;;;;;iCAOJ,MAAM;gCAEP,MAAM;sCAEA,MAAM;gCAEZ,MAAM;;+BAGP,MAAM;;;;;;iCAOJ,MAAM;gCAEP,MAAM;sCAEA,MAAM;gCAEZ,MAAM;;+BAGP,MAAM;;;;;;iCAOJ,MAAM;gCAEP,MAAM;sCAEA,MAAM;gCAEZ,MAAM;;+BAGP,MAAM;;;;;;iCAOJ,MAAM;gCAEP,MAAM;sCAEA,MAAM;gCAEZ,MAAM;;+BAGP,MAAM;;;;;;;iCAQJ,MAAM;+BAER,MAAM;sCAEC,MAAM;gCAEZ,MAAM;gCAEN,MAAM;;;;;;;;iCASL,MAAM;+BAER,MAAM;sCAEC,MAAM;gCAEZ,MAAM;gCAEN,MAAM;;;;;;;;;;;iCAYL,MAAM;gCAEP,MAAM;sCAEA,MAAM;gCAEZ,MAAM;;+BAGP,MAAM;;;;;;iCAOJ,MAAM;gCAEP,MAAM;sCAEA,MAAM;gCAEZ,MAAM;;+BAGP,MAAM;;;;;;;6BAQR,MAAM;;;;;6BAKN,MAAM;;;;;;;;sCAQG,MAAM;wCAEJ,MAAM;;gCAGd,MAAM;gCAEN,MAAM;iDAEW,MAAM;;;;sCAKjB,MAAM;;gCAGZ,MAAM;gCAEN,MAAM;;CAGnB,CAAC"}
|
package/build/api/routes.js
CHANGED
|
@@ -60,6 +60,13 @@ exports.REST_API = {
|
|
|
60
60
|
USERS: {
|
|
61
61
|
GET: `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET}`,
|
|
62
62
|
BALANCE: `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.BALANCE}`,
|
|
63
|
+
GET_ALL: `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET_ALL}`,
|
|
64
|
+
FIND_BY_CRITERIA: `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.FIND_BY_CRITERIA}`,
|
|
65
|
+
FIND_BY_UUID: (uuid) => `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.FIND_BY_UUID(uuid)}`,
|
|
66
|
+
GET_BALANCE: (uuid) => `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET_BALANCE(uuid)}`,
|
|
67
|
+
GET_SUBSCRIPTIONS: (uuid) => `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET_SUBSCRIPTIONS(uuid)}`,
|
|
68
|
+
GET_PRODUCTS: (uuid) => `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET_PRODUCTS(uuid)}`,
|
|
69
|
+
GET_PAYMENTS: (uuid) => `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET_PAYMENTS(uuid)}`,
|
|
63
70
|
},
|
|
64
71
|
PRODUCT_PUBLIC: {
|
|
65
72
|
GET: `${exports.ROOT}/${CONTROLLERS.PRODUCT_PUBLIC_CONTROLLER}/${CONTROLLERS.PRODUCT_ROUTES.GET_ALL}`,
|
|
@@ -80,6 +87,7 @@ exports.REST_API = {
|
|
|
80
87
|
SUMMARY: `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.SUMMARY}`,
|
|
81
88
|
GET_MY: `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.GET_MY}`,
|
|
82
89
|
CANCEL: (uuid) => `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${uuid}/${CONTROLLERS.SUBSCRIPTION_ROUTES.CANCEL}`,
|
|
90
|
+
RECOVER: (uuid) => `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${uuid}/${CONTROLLERS.SUBSCRIPTION_ROUTES.RECOVER}`,
|
|
83
91
|
},
|
|
84
92
|
PAYMENT: {
|
|
85
93
|
HISTORY: `${exports.ROOT}/${CONTROLLERS.PAYMENT_CONTROLLER}/${CONTROLLERS.PAYMENT_ROUTES.HISTORY}`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../commands/subscription/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../commands/subscription/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC"}
|
|
@@ -17,3 +17,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./buy-subscription.command"), exports);
|
|
18
18
|
__exportStar(require("./fast-buy-subscription.command"), exports);
|
|
19
19
|
__exportStar(require("./cancel-subscription.command"), exports);
|
|
20
|
+
__exportStar(require("./recover-subscription.command"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare namespace RecoverSubscriptionCommand {
|
|
3
|
+
const RequestParamSchema: z.ZodObject<{
|
|
4
|
+
uuidSiteUserToSubscription: z.ZodString;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
uuidSiteUserToSubscription: string;
|
|
7
|
+
}, {
|
|
8
|
+
uuidSiteUserToSubscription: string;
|
|
9
|
+
}>;
|
|
10
|
+
type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
11
|
+
const ResponseSchema: z.ZodVoid;
|
|
12
|
+
type Response = z.infer<typeof ResponseSchema>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=recover-subscription.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recover-subscription.command.d.ts","sourceRoot":"","sources":["../../../commands/subscription/recover-subscription.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,yBAAiB,0BAA0B,CAAC;IACjC,MAAM,kBAAkB;;;;;;MAE7B,CAAC;IACH,KAAY,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAEvD,MAAM,cAAc,WAAW,CAAC;IACvC,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RecoverSubscriptionCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var RecoverSubscriptionCommand;
|
|
6
|
+
(function (RecoverSubscriptionCommand) {
|
|
7
|
+
RecoverSubscriptionCommand.RequestParamSchema = zod_1.z.object({
|
|
8
|
+
uuidSiteUserToSubscription: zod_1.z.string().uuid(),
|
|
9
|
+
});
|
|
10
|
+
RecoverSubscriptionCommand.ResponseSchema = zod_1.z.void();
|
|
11
|
+
})(RecoverSubscriptionCommand || (exports.RecoverSubscriptionCommand = RecoverSubscriptionCommand = {}));
|
|
@@ -204,6 +204,11 @@ export declare const ERRORS: {
|
|
|
204
204
|
readonly code: "SUBSCRIPTION_006";
|
|
205
205
|
readonly httpCode: 500;
|
|
206
206
|
};
|
|
207
|
+
readonly SUBSCRIPTION_RECOVER_ERROR: {
|
|
208
|
+
readonly message: "Ошибка при восстановлении подписки";
|
|
209
|
+
readonly code: "SUBSCRIPTION_007";
|
|
210
|
+
readonly httpCode: 500;
|
|
211
|
+
};
|
|
207
212
|
readonly ORDER_NOT_FOUND: {
|
|
208
213
|
readonly message: "Заказ не найден";
|
|
209
214
|
readonly code: "ORDER_001";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../constants/errors/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../constants/errors/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2xBT,CAAC"}
|
|
@@ -213,6 +213,11 @@ exports.ERRORS = {
|
|
|
213
213
|
code: 'SUBSCRIPTION_006',
|
|
214
214
|
httpCode: 500,
|
|
215
215
|
},
|
|
216
|
+
SUBSCRIPTION_RECOVER_ERROR: {
|
|
217
|
+
message: 'Ошибка при восстановлении подписки',
|
|
218
|
+
code: 'SUBSCRIPTION_007',
|
|
219
|
+
httpCode: 500,
|
|
220
|
+
},
|
|
216
221
|
// ORDER
|
|
217
222
|
ORDER_NOT_FOUND: {
|
|
218
223
|
message: 'Заказ не найден',
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { USER_ROLE, USER_STATUS } from '../../constants';
|
|
3
|
+
export declare namespace FindUsersCommand {
|
|
4
|
+
const RequestQuerySchema: z.ZodObject<{
|
|
5
|
+
uuid: z.ZodOptional<z.ZodString>;
|
|
6
|
+
email: z.ZodOptional<z.ZodString>;
|
|
7
|
+
role: z.ZodOptional<z.ZodNativeEnum<typeof USER_ROLE>>;
|
|
8
|
+
status: z.ZodOptional<z.ZodNativeEnum<typeof USER_STATUS>>;
|
|
9
|
+
limit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
10
|
+
offset: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
email?: string | undefined;
|
|
13
|
+
uuid?: string | undefined;
|
|
14
|
+
role?: USER_ROLE | undefined;
|
|
15
|
+
status?: USER_STATUS | undefined;
|
|
16
|
+
limit?: number | undefined;
|
|
17
|
+
offset?: number | undefined;
|
|
18
|
+
}, {
|
|
19
|
+
email?: string | undefined;
|
|
20
|
+
uuid?: string | undefined;
|
|
21
|
+
role?: USER_ROLE | undefined;
|
|
22
|
+
status?: USER_STATUS | undefined;
|
|
23
|
+
limit?: number | undefined;
|
|
24
|
+
offset?: number | undefined;
|
|
25
|
+
}>;
|
|
26
|
+
type RequestQuery = z.infer<typeof RequestQuerySchema>;
|
|
27
|
+
const ResponseItemSchema: z.ZodObject<{
|
|
28
|
+
uuid: z.ZodString;
|
|
29
|
+
email: z.ZodString;
|
|
30
|
+
role: z.ZodNativeEnum<typeof USER_ROLE>;
|
|
31
|
+
siteId: z.ZodString;
|
|
32
|
+
}, "strip", z.ZodTypeAny, {
|
|
33
|
+
email: string;
|
|
34
|
+
uuid: string;
|
|
35
|
+
siteId: string;
|
|
36
|
+
role: USER_ROLE;
|
|
37
|
+
}, {
|
|
38
|
+
email: string;
|
|
39
|
+
uuid: string;
|
|
40
|
+
siteId: string;
|
|
41
|
+
role: USER_ROLE;
|
|
42
|
+
}>;
|
|
43
|
+
const ResponseSchema: z.ZodObject<{
|
|
44
|
+
data: z.ZodArray<z.ZodObject<{
|
|
45
|
+
uuid: z.ZodString;
|
|
46
|
+
email: z.ZodString;
|
|
47
|
+
role: z.ZodNativeEnum<typeof USER_ROLE>;
|
|
48
|
+
siteId: z.ZodString;
|
|
49
|
+
}, "strip", z.ZodTypeAny, {
|
|
50
|
+
email: string;
|
|
51
|
+
uuid: string;
|
|
52
|
+
siteId: string;
|
|
53
|
+
role: USER_ROLE;
|
|
54
|
+
}, {
|
|
55
|
+
email: string;
|
|
56
|
+
uuid: string;
|
|
57
|
+
siteId: string;
|
|
58
|
+
role: USER_ROLE;
|
|
59
|
+
}>, "many">;
|
|
60
|
+
totalPages: z.ZodNumber;
|
|
61
|
+
page: z.ZodNumber;
|
|
62
|
+
}, "strip", z.ZodTypeAny, {
|
|
63
|
+
page: number;
|
|
64
|
+
data: {
|
|
65
|
+
email: string;
|
|
66
|
+
uuid: string;
|
|
67
|
+
siteId: string;
|
|
68
|
+
role: USER_ROLE;
|
|
69
|
+
}[];
|
|
70
|
+
totalPages: number;
|
|
71
|
+
}, {
|
|
72
|
+
page: number;
|
|
73
|
+
data: {
|
|
74
|
+
email: string;
|
|
75
|
+
uuid: string;
|
|
76
|
+
siteId: string;
|
|
77
|
+
role: USER_ROLE;
|
|
78
|
+
}[];
|
|
79
|
+
totalPages: number;
|
|
80
|
+
}>;
|
|
81
|
+
type Response = z.infer<typeof ResponseSchema>;
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=find-users.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-users.command.d.ts","sourceRoot":"","sources":["../../../queries/user/find-users.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEzD,yBAAiB,gBAAgB,CAAC;IACvB,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;MAO7B,CAAC;IAEH,KAAY,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAEvD,MAAM,kBAAkB;;;;;;;;;;;;;;;MAK7B,CAAC;IAEI,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAIzB,CAAC;IACH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindUsersCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("../../constants");
|
|
6
|
+
var FindUsersCommand;
|
|
7
|
+
(function (FindUsersCommand) {
|
|
8
|
+
FindUsersCommand.RequestQuerySchema = zod_1.z.object({
|
|
9
|
+
uuid: zod_1.z.string().uuid().optional(),
|
|
10
|
+
email: zod_1.z.string().email().optional(),
|
|
11
|
+
role: zod_1.z.nativeEnum(constants_1.USER_ROLE).optional(),
|
|
12
|
+
status: zod_1.z.nativeEnum(constants_1.USER_STATUS).optional(),
|
|
13
|
+
limit: zod_1.z.coerce.number().int().min(1).default(20).optional(),
|
|
14
|
+
offset: zod_1.z.coerce.number().int().min(0).default(0).optional(),
|
|
15
|
+
});
|
|
16
|
+
FindUsersCommand.ResponseItemSchema = zod_1.z.object({
|
|
17
|
+
uuid: zod_1.z.string().uuid(),
|
|
18
|
+
email: zod_1.z.string().email(),
|
|
19
|
+
role: zod_1.z.nativeEnum(constants_1.USER_ROLE),
|
|
20
|
+
siteId: zod_1.z.string().uuid(),
|
|
21
|
+
});
|
|
22
|
+
FindUsersCommand.ResponseSchema = zod_1.z.object({
|
|
23
|
+
data: zod_1.z.array(FindUsersCommand.ResponseItemSchema),
|
|
24
|
+
totalPages: zod_1.z.number().int(),
|
|
25
|
+
page: zod_1.z.number().int(),
|
|
26
|
+
});
|
|
27
|
+
})(FindUsersCommand || (exports.FindUsersCommand = FindUsersCommand = {}));
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { USER_ROLE } from '../../constants';
|
|
3
|
+
export declare namespace GetAllUsersCommand {
|
|
4
|
+
const ResponseSchema: z.ZodObject<{
|
|
5
|
+
data: z.ZodArray<z.ZodObject<{
|
|
6
|
+
uuid: z.ZodString;
|
|
7
|
+
email: z.ZodString;
|
|
8
|
+
role: z.ZodNativeEnum<typeof USER_ROLE>;
|
|
9
|
+
siteId: z.ZodString;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
email: string;
|
|
12
|
+
uuid: string;
|
|
13
|
+
siteId: string;
|
|
14
|
+
role: USER_ROLE;
|
|
15
|
+
}, {
|
|
16
|
+
email: string;
|
|
17
|
+
uuid: string;
|
|
18
|
+
siteId: string;
|
|
19
|
+
role: USER_ROLE;
|
|
20
|
+
}>, "many">;
|
|
21
|
+
}, "strip", z.ZodTypeAny, {
|
|
22
|
+
data: {
|
|
23
|
+
email: string;
|
|
24
|
+
uuid: string;
|
|
25
|
+
siteId: string;
|
|
26
|
+
role: USER_ROLE;
|
|
27
|
+
}[];
|
|
28
|
+
}, {
|
|
29
|
+
data: {
|
|
30
|
+
email: string;
|
|
31
|
+
uuid: string;
|
|
32
|
+
siteId: string;
|
|
33
|
+
role: USER_ROLE;
|
|
34
|
+
}[];
|
|
35
|
+
}>;
|
|
36
|
+
type Response = z.infer<typeof ResponseSchema>;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=get-all-users.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-all-users.command.d.ts","sourceRoot":"","sources":["../../../queries/user/get-all-users.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,yBAAiB,kBAAkB,CAAC;IACzB,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MASzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetAllUsersCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("../../constants");
|
|
6
|
+
var GetAllUsersCommand;
|
|
7
|
+
(function (GetAllUsersCommand) {
|
|
8
|
+
GetAllUsersCommand.ResponseSchema = zod_1.z.object({
|
|
9
|
+
data: zod_1.z.array(zod_1.z.object({
|
|
10
|
+
uuid: zod_1.z.string().uuid(),
|
|
11
|
+
email: zod_1.z.string().email(),
|
|
12
|
+
role: zod_1.z.nativeEnum(constants_1.USER_ROLE),
|
|
13
|
+
siteId: zod_1.z.string().uuid(),
|
|
14
|
+
})),
|
|
15
|
+
});
|
|
16
|
+
})(GetAllUsersCommand || (exports.GetAllUsersCommand = GetAllUsersCommand = {}));
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * from './get-user.command';
|
|
2
|
+
export * from './get-all-users.command';
|
|
2
3
|
export * from './get-user-balance.command';
|
|
3
4
|
export * from './get-my-products.command';
|
|
4
5
|
export * from './get-my-subscriptions.command';
|
|
6
|
+
export * from './find-users.command';
|
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../queries/user/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../queries/user/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sBAAsB,CAAC"}
|
|
@@ -15,6 +15,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./get-user.command"), exports);
|
|
18
|
+
__exportStar(require("./get-all-users.command"), exports);
|
|
18
19
|
__exportStar(require("./get-user-balance.command"), exports);
|
|
19
20
|
__exportStar(require("./get-my-products.command"), exports);
|
|
20
21
|
__exportStar(require("./get-my-subscriptions.command"), exports);
|
|
22
|
+
__exportStar(require("./find-users.command"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace RecoverSubscriptionCommand {
|
|
4
|
+
export const RequestParamSchema = z.object({
|
|
5
|
+
uuidSiteUserToSubscription: z.string().uuid(),
|
|
6
|
+
});
|
|
7
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
8
|
+
|
|
9
|
+
export const ResponseSchema = z.void();
|
|
10
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
11
|
+
}
|
|
@@ -216,6 +216,11 @@ export const ERRORS = {
|
|
|
216
216
|
code: 'SUBSCRIPTION_006',
|
|
217
217
|
httpCode: 500,
|
|
218
218
|
},
|
|
219
|
+
SUBSCRIPTION_RECOVER_ERROR: {
|
|
220
|
+
message: 'Ошибка при восстановлении подписки',
|
|
221
|
+
code: 'SUBSCRIPTION_007',
|
|
222
|
+
httpCode: 500,
|
|
223
|
+
},
|
|
219
224
|
|
|
220
225
|
// ORDER
|
|
221
226
|
ORDER_NOT_FOUND: {
|
package/package.json
CHANGED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { USER_ROLE, USER_STATUS } from '../../constants';
|
|
3
|
+
|
|
4
|
+
export namespace FindUsersCommand {
|
|
5
|
+
export const RequestQuerySchema = z.object({
|
|
6
|
+
uuid: z.string().uuid().optional(),
|
|
7
|
+
email: z.string().email().optional(),
|
|
8
|
+
role: z.nativeEnum(USER_ROLE).optional(),
|
|
9
|
+
status: z.nativeEnum(USER_STATUS).optional(),
|
|
10
|
+
limit: z.coerce.number().int().min(1).default(20).optional(),
|
|
11
|
+
offset: z.coerce.number().int().min(0).default(0).optional(),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export type RequestQuery = z.infer<typeof RequestQuerySchema>;
|
|
15
|
+
|
|
16
|
+
export const ResponseItemSchema = z.object({
|
|
17
|
+
uuid: z.string().uuid(),
|
|
18
|
+
email: z.string().email(),
|
|
19
|
+
role: z.nativeEnum(USER_ROLE),
|
|
20
|
+
siteId: z.string().uuid(),
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export const ResponseSchema = z.object({
|
|
24
|
+
data: z.array(ResponseItemSchema),
|
|
25
|
+
totalPages: z.number().int(),
|
|
26
|
+
page: z.number().int(),
|
|
27
|
+
});
|
|
28
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { USER_ROLE } from '../../constants';
|
|
3
|
+
|
|
4
|
+
export namespace GetAllUsersCommand {
|
|
5
|
+
export const ResponseSchema = z.object({
|
|
6
|
+
data: z.array(
|
|
7
|
+
z.object({
|
|
8
|
+
uuid: z.string().uuid(),
|
|
9
|
+
email: z.string().email(),
|
|
10
|
+
role: z.nativeEnum(USER_ROLE),
|
|
11
|
+
siteId: z.string().uuid(),
|
|
12
|
+
}),
|
|
13
|
+
),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
17
|
+
}
|
package/queries/user/index.ts
CHANGED