@remnawave/backend-contract 0.3.37 → 0.3.39

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.
Files changed (33) hide show
  1. package/build/backend/api/controllers/users.d.ts +4 -0
  2. package/build/backend/api/controllers/users.d.ts.map +1 -1
  3. package/build/backend/api/controllers/users.js +4 -0
  4. package/build/backend/api/routes.d.ts +4 -0
  5. package/build/backend/api/routes.d.ts.map +1 -1
  6. package/build/backend/api/routes.js +4 -0
  7. package/build/backend/commands/users/bulk/bulk-delete-users.command.d.ts +32 -0
  8. package/build/backend/commands/users/bulk/bulk-delete-users.command.d.ts.map +1 -0
  9. package/build/backend/commands/users/bulk/bulk-delete-users.command.js +18 -0
  10. package/build/backend/commands/users/bulk/bulk-reset-traffic-users.command.d.ts +32 -0
  11. package/build/backend/commands/users/bulk/bulk-reset-traffic-users.command.d.ts.map +1 -0
  12. package/build/backend/commands/users/bulk/bulk-reset-traffic-users.command.js +18 -0
  13. package/build/backend/commands/users/bulk/bulk-revoke-users-subscription.command.d.ts +32 -0
  14. package/build/backend/commands/users/bulk/bulk-revoke-users-subscription.command.d.ts.map +1 -0
  15. package/build/backend/commands/users/bulk/bulk-revoke-users-subscription.command.js +18 -0
  16. package/build/backend/commands/users/bulk/bulk-update-users.command.d.ts +85 -0
  17. package/build/backend/commands/users/bulk/bulk-update-users.command.d.ts.map +1 -0
  18. package/build/backend/commands/users/bulk/bulk-update-users.command.js +46 -0
  19. package/build/backend/commands/users/bulk/index.d.ts +4 -0
  20. package/build/backend/commands/users/bulk/index.d.ts.map +1 -1
  21. package/build/backend/commands/users/bulk/index.js +4 -0
  22. package/build/backend/constants/errors/errors.d.ts +20 -0
  23. package/build/backend/constants/errors/errors.d.ts.map +1 -1
  24. package/build/backend/constants/errors/errors.js +20 -0
  25. package/build/frontend/api/controllers/users.js +4 -0
  26. package/build/frontend/api/routes.js +4 -0
  27. package/build/frontend/commands/users/bulk/bulk-delete-users.command.js +18 -0
  28. package/build/frontend/commands/users/bulk/bulk-reset-traffic-users.command.js +18 -0
  29. package/build/frontend/commands/users/bulk/bulk-revoke-users-subscription.command.js +18 -0
  30. package/build/frontend/commands/users/bulk/bulk-update-users.command.js +46 -0
  31. package/build/frontend/commands/users/bulk/index.js +4 -0
  32. package/build/frontend/constants/errors/errors.js +20 -0
  33. package/package.json +1 -1
@@ -14,6 +14,10 @@ export declare const USERS_ROUTES: {
14
14
  readonly RESET_USER_TRAFFIC: "reset-traffic";
15
15
  readonly BULK: {
16
16
  readonly DELETE_BY_STATUS: "bulk/delete-by-status";
17
+ readonly UPDATE: "bulk/update";
18
+ readonly RESET_TRAFFIC: "bulk/reset-traffic";
19
+ readonly REVOKE_SUBSCRIPTION: "bulk/revoke-subscription";
20
+ readonly DELETE: "bulk/delete";
17
21
  };
18
22
  readonly GET_BY_TELEGRAM_ID: "tg";
19
23
  readonly GET_BY_EMAIL: "email";
@@ -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,YAAY;;;;;;;;;;;;;;;;;;CAkBf,CAAC"}
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,YAAY;;;;;;;;;;;;;;;;;;;;;;CAsBf,CAAC"}
@@ -17,6 +17,10 @@ exports.USERS_ROUTES = {
17
17
  RESET_USER_TRAFFIC: 'reset-traffic',
18
18
  BULK: {
19
19
  DELETE_BY_STATUS: 'bulk/delete-by-status',
20
+ UPDATE: 'bulk/update',
21
+ RESET_TRAFFIC: 'bulk/reset-traffic',
22
+ REVOKE_SUBSCRIPTION: 'bulk/revoke-subscription',
23
+ DELETE: 'bulk/delete',
20
24
  },
21
25
  GET_BY_TELEGRAM_ID: 'tg',
22
26
  GET_BY_EMAIL: 'email',
@@ -60,6 +60,10 @@ export declare const REST_API: {
60
60
  readonly RESET_USER_TRAFFIC: (uuid: string) => string;
61
61
  readonly BULK: {
62
62
  readonly DELETE_BY_STATUS: "/api/users/bulk/delete-by-status";
63
+ readonly UPDATE: "/api/users/bulk/update";
64
+ readonly RESET_TRAFFIC: "/api/users/bulk/reset-traffic";
65
+ readonly REVOKE_SUBSCRIPTION: "/api/users/bulk/revoke-subscription";
66
+ readonly DELETE: "/api/users/bulk/delete";
63
67
  };
64
68
  readonly GET_BY_TELEGRAM_ID: (telegramId: string) => string;
65
69
  readonly GET_BY_EMAIL: (email: string) => string;
@@ -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;;;;;;;;gCASN,MAAM;;;iCAIL,MAAM;iCAEN,MAAM;iCAEN,MAAM;gCAEP,MAAM;;;;;;;;;;;;;;kDAeY,MAAM;;;;;;;;;;qCAWnB,MAAM;gDAEK,MAAM;6CAET,MAAM;8DAEW,MAAM;6CAEvB,MAAM;sCAEb,MAAM;qCAEP,MAAM;qCAEN,MAAM;;;4CAIC,MAAM;;;;kDAKA,MAAM;uCAEjB,MAAM;;;kCAIX,MAAM;0CAEE,MAAM;uCAET,MAAM;;;;;;;;gCASb,MAAM;iCAEL,MAAM;;;;;;;;;;;;;;;0CAgBG,MAAM;;;;;;;CAQ7B,CAAC"}
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;;;;;;;;gCASN,MAAM;;;iCAIL,MAAM;iCAEN,MAAM;iCAEN,MAAM;gCAEP,MAAM;;;;;;;;;;;;;;kDAeY,MAAM;;;;;;;;;;qCAWnB,MAAM;gDAEK,MAAM;6CAET,MAAM;8DAEW,MAAM;6CAEvB,MAAM;sCAEb,MAAM;qCAEP,MAAM;qCAEN,MAAM;;;4CAIC,MAAM;;;;;;;;kDASA,MAAM;uCAEjB,MAAM;;;kCAIX,MAAM;0CAEE,MAAM;uCAET,MAAM;;;;;;;;gCASb,MAAM;iCAEL,MAAM;;;;;;;;;;;;;;;0CAgBG,MAAM;;;;;;;CAQ7B,CAAC"}
@@ -97,6 +97,10 @@ exports.REST_API = {
97
97
  RESET_USER_TRAFFIC: (uuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.RESET_USER_TRAFFIC}/${uuid}`,
98
98
  BULK: {
99
99
  DELETE_BY_STATUS: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.BULK.DELETE_BY_STATUS}`,
100
+ UPDATE: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.BULK.UPDATE}`,
101
+ RESET_TRAFFIC: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.BULK.RESET_TRAFFIC}`,
102
+ REVOKE_SUBSCRIPTION: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.BULK.REVOKE_SUBSCRIPTION}`,
103
+ DELETE: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.BULK.DELETE}`,
100
104
  },
101
105
  GET_BY_TELEGRAM_ID: (telegramId) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY_TELEGRAM_ID}/${telegramId}`,
102
106
  GET_BY_EMAIL: (email) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY_EMAIL}/${email}`,
@@ -0,0 +1,32 @@
1
+ import { z } from 'zod';
2
+ export declare namespace BulkDeleteUsersCommand {
3
+ const url: "/api/users/bulk/delete";
4
+ const TSQ_url: "/api/users/bulk/delete";
5
+ const RequestSchema: z.ZodObject<{
6
+ uuids: z.ZodArray<z.ZodString, "many">;
7
+ }, "strip", z.ZodTypeAny, {
8
+ uuids: string[];
9
+ }, {
10
+ uuids: string[];
11
+ }>;
12
+ type Request = z.infer<typeof RequestSchema>;
13
+ const ResponseSchema: z.ZodObject<{
14
+ response: z.ZodObject<{
15
+ affectedRows: z.ZodNumber;
16
+ }, "strip", z.ZodTypeAny, {
17
+ affectedRows: number;
18
+ }, {
19
+ affectedRows: number;
20
+ }>;
21
+ }, "strip", z.ZodTypeAny, {
22
+ response: {
23
+ affectedRows: number;
24
+ };
25
+ }, {
26
+ response: {
27
+ affectedRows: number;
28
+ };
29
+ }>;
30
+ type Response = z.infer<typeof ResponseSchema>;
31
+ }
32
+ //# sourceMappingURL=bulk-delete-users.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bulk-delete-users.command.d.ts","sourceRoot":"","sources":["../../../../../commands/users/bulk/bulk-delete-users.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,yBAAiB,sBAAsB,CAAC;IAC7B,MAAM,GAAG,0BAA6B,CAAC;IACvC,MAAM,OAAO,0BAAM,CAAC;IAEpB,MAAM,aAAa;;;;;;MAExB,CAAC;IAEH,KAAY,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;IAE7C,MAAM,cAAc;;;;;;;;;;;;;;;;MAIzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BulkDeleteUsersCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../../api");
6
+ var BulkDeleteUsersCommand;
7
+ (function (BulkDeleteUsersCommand) {
8
+ BulkDeleteUsersCommand.url = api_1.REST_API.USERS.BULK.DELETE;
9
+ BulkDeleteUsersCommand.TSQ_url = BulkDeleteUsersCommand.url;
10
+ BulkDeleteUsersCommand.RequestSchema = zod_1.z.object({
11
+ uuids: zod_1.z.array(zod_1.z.string().uuid()),
12
+ });
13
+ BulkDeleteUsersCommand.ResponseSchema = zod_1.z.object({
14
+ response: zod_1.z.object({
15
+ affectedRows: zod_1.z.number(),
16
+ }),
17
+ });
18
+ })(BulkDeleteUsersCommand || (exports.BulkDeleteUsersCommand = BulkDeleteUsersCommand = {}));
@@ -0,0 +1,32 @@
1
+ import { z } from 'zod';
2
+ export declare namespace BulkResetTrafficUsersCommand {
3
+ const url: "/api/users/bulk/reset-traffic";
4
+ const TSQ_url: "/api/users/bulk/reset-traffic";
5
+ const RequestSchema: z.ZodObject<{
6
+ uuids: z.ZodArray<z.ZodString, "many">;
7
+ }, "strip", z.ZodTypeAny, {
8
+ uuids: string[];
9
+ }, {
10
+ uuids: string[];
11
+ }>;
12
+ type Request = z.infer<typeof RequestSchema>;
13
+ const ResponseSchema: z.ZodObject<{
14
+ response: z.ZodObject<{
15
+ affectedRows: z.ZodNumber;
16
+ }, "strip", z.ZodTypeAny, {
17
+ affectedRows: number;
18
+ }, {
19
+ affectedRows: number;
20
+ }>;
21
+ }, "strip", z.ZodTypeAny, {
22
+ response: {
23
+ affectedRows: number;
24
+ };
25
+ }, {
26
+ response: {
27
+ affectedRows: number;
28
+ };
29
+ }>;
30
+ type Response = z.infer<typeof ResponseSchema>;
31
+ }
32
+ //# sourceMappingURL=bulk-reset-traffic-users.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bulk-reset-traffic-users.command.d.ts","sourceRoot":"","sources":["../../../../../commands/users/bulk/bulk-reset-traffic-users.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,yBAAiB,4BAA4B,CAAC;IACnC,MAAM,GAAG,iCAAoC,CAAC;IAC9C,MAAM,OAAO,iCAAM,CAAC;IAEpB,MAAM,aAAa;;;;;;MAExB,CAAC;IAEH,KAAY,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;IAE7C,MAAM,cAAc;;;;;;;;;;;;;;;;MAIzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BulkResetTrafficUsersCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../../api");
6
+ var BulkResetTrafficUsersCommand;
7
+ (function (BulkResetTrafficUsersCommand) {
8
+ BulkResetTrafficUsersCommand.url = api_1.REST_API.USERS.BULK.RESET_TRAFFIC;
9
+ BulkResetTrafficUsersCommand.TSQ_url = BulkResetTrafficUsersCommand.url;
10
+ BulkResetTrafficUsersCommand.RequestSchema = zod_1.z.object({
11
+ uuids: zod_1.z.array(zod_1.z.string().uuid()),
12
+ });
13
+ BulkResetTrafficUsersCommand.ResponseSchema = zod_1.z.object({
14
+ response: zod_1.z.object({
15
+ affectedRows: zod_1.z.number(),
16
+ }),
17
+ });
18
+ })(BulkResetTrafficUsersCommand || (exports.BulkResetTrafficUsersCommand = BulkResetTrafficUsersCommand = {}));
@@ -0,0 +1,32 @@
1
+ import { z } from 'zod';
2
+ export declare namespace BulkRevokeUsersSubscriptionCommand {
3
+ const url: "/api/users/bulk/revoke-subscription";
4
+ const TSQ_url: "/api/users/bulk/revoke-subscription";
5
+ const RequestSchema: z.ZodObject<{
6
+ uuids: z.ZodArray<z.ZodString, "many">;
7
+ }, "strip", z.ZodTypeAny, {
8
+ uuids: string[];
9
+ }, {
10
+ uuids: string[];
11
+ }>;
12
+ type Request = z.infer<typeof RequestSchema>;
13
+ const ResponseSchema: z.ZodObject<{
14
+ response: z.ZodObject<{
15
+ affectedRows: z.ZodNumber;
16
+ }, "strip", z.ZodTypeAny, {
17
+ affectedRows: number;
18
+ }, {
19
+ affectedRows: number;
20
+ }>;
21
+ }, "strip", z.ZodTypeAny, {
22
+ response: {
23
+ affectedRows: number;
24
+ };
25
+ }, {
26
+ response: {
27
+ affectedRows: number;
28
+ };
29
+ }>;
30
+ type Response = z.infer<typeof ResponseSchema>;
31
+ }
32
+ //# sourceMappingURL=bulk-revoke-users-subscription.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bulk-revoke-users-subscription.command.d.ts","sourceRoot":"","sources":["../../../../../commands/users/bulk/bulk-revoke-users-subscription.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,yBAAiB,kCAAkC,CAAC;IACzC,MAAM,GAAG,uCAA0C,CAAC;IACpD,MAAM,OAAO,uCAAM,CAAC;IAEpB,MAAM,aAAa;;;;;;MAExB,CAAC;IAEH,KAAY,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;IAE7C,MAAM,cAAc;;;;;;;;;;;;;;;;MAIzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BulkRevokeUsersSubscriptionCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../../api");
6
+ var BulkRevokeUsersSubscriptionCommand;
7
+ (function (BulkRevokeUsersSubscriptionCommand) {
8
+ BulkRevokeUsersSubscriptionCommand.url = api_1.REST_API.USERS.BULK.REVOKE_SUBSCRIPTION;
9
+ BulkRevokeUsersSubscriptionCommand.TSQ_url = BulkRevokeUsersSubscriptionCommand.url;
10
+ BulkRevokeUsersSubscriptionCommand.RequestSchema = zod_1.z.object({
11
+ uuids: zod_1.z.array(zod_1.z.string().uuid()),
12
+ });
13
+ BulkRevokeUsersSubscriptionCommand.ResponseSchema = zod_1.z.object({
14
+ response: zod_1.z.object({
15
+ affectedRows: zod_1.z.number(),
16
+ }),
17
+ });
18
+ })(BulkRevokeUsersSubscriptionCommand || (exports.BulkRevokeUsersSubscriptionCommand = BulkRevokeUsersSubscriptionCommand = {}));
@@ -0,0 +1,85 @@
1
+ import { z } from 'zod';
2
+ export declare namespace BulkUpdateUsersCommand {
3
+ const url: "/api/users/bulk/update";
4
+ const TSQ_url: "/api/users/bulk/update";
5
+ const RequestSchema: z.ZodObject<{
6
+ uuids: z.ZodArray<z.ZodString, "many">;
7
+ fields: z.ZodObject<{
8
+ status: z.ZodOptional<z.ZodDefault<z.ZodNativeEnum<{
9
+ readonly ACTIVE: "ACTIVE";
10
+ readonly DISABLED: "DISABLED";
11
+ readonly LIMITED: "LIMITED";
12
+ readonly EXPIRED: "EXPIRED";
13
+ }>>>;
14
+ trafficLimitBytes: z.ZodOptional<z.ZodNumber>;
15
+ trafficLimitStrategy: z.ZodOptional<z.ZodNativeEnum<{
16
+ readonly NO_RESET: "NO_RESET";
17
+ readonly DAY: "DAY";
18
+ readonly WEEK: "WEEK";
19
+ readonly MONTH: "MONTH";
20
+ }>>;
21
+ expireAt: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, Date, string>, Date, string>>;
22
+ description: z.ZodOptional<z.ZodString>;
23
+ telegramId: z.ZodOptional<z.ZodNumber>;
24
+ email: z.ZodOptional<z.ZodString>;
25
+ }, "strip", z.ZodTypeAny, {
26
+ status?: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE" | undefined;
27
+ email?: string | undefined;
28
+ trafficLimitBytes?: number | undefined;
29
+ description?: string | undefined;
30
+ trafficLimitStrategy?: "MONTH" | "NO_RESET" | "DAY" | "WEEK" | undefined;
31
+ expireAt?: Date | undefined;
32
+ telegramId?: number | undefined;
33
+ }, {
34
+ status?: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE" | undefined;
35
+ email?: string | undefined;
36
+ trafficLimitBytes?: number | undefined;
37
+ description?: string | undefined;
38
+ trafficLimitStrategy?: "MONTH" | "NO_RESET" | "DAY" | "WEEK" | undefined;
39
+ expireAt?: string | undefined;
40
+ telegramId?: number | undefined;
41
+ }>;
42
+ }, "strip", z.ZodTypeAny, {
43
+ uuids: string[];
44
+ fields: {
45
+ status?: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE" | undefined;
46
+ email?: string | undefined;
47
+ trafficLimitBytes?: number | undefined;
48
+ description?: string | undefined;
49
+ trafficLimitStrategy?: "MONTH" | "NO_RESET" | "DAY" | "WEEK" | undefined;
50
+ expireAt?: Date | undefined;
51
+ telegramId?: number | undefined;
52
+ };
53
+ }, {
54
+ uuids: string[];
55
+ fields: {
56
+ status?: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE" | undefined;
57
+ email?: string | undefined;
58
+ trafficLimitBytes?: number | undefined;
59
+ description?: string | undefined;
60
+ trafficLimitStrategy?: "MONTH" | "NO_RESET" | "DAY" | "WEEK" | undefined;
61
+ expireAt?: string | undefined;
62
+ telegramId?: number | undefined;
63
+ };
64
+ }>;
65
+ type Request = z.infer<typeof RequestSchema>;
66
+ const ResponseSchema: z.ZodObject<{
67
+ response: z.ZodObject<{
68
+ affectedRows: z.ZodNumber;
69
+ }, "strip", z.ZodTypeAny, {
70
+ affectedRows: number;
71
+ }, {
72
+ affectedRows: number;
73
+ }>;
74
+ }, "strip", z.ZodTypeAny, {
75
+ response: {
76
+ affectedRows: number;
77
+ };
78
+ }, {
79
+ response: {
80
+ affectedRows: number;
81
+ };
82
+ }>;
83
+ type Response = z.infer<typeof ResponseSchema>;
84
+ }
85
+ //# sourceMappingURL=bulk-update-users.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bulk-update-users.command.d.ts","sourceRoot":"","sources":["../../../../../commands/users/bulk/bulk-update-users.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,yBAAiB,sBAAsB,CAAC;IAC7B,MAAM,GAAG,0BAA6B,CAAC;IACvC,MAAM,OAAO,0BAAM,CAAC;IAEpB,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAkCxB,CAAC;IAEH,KAAY,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;IAE7C,MAAM,cAAc;;;;;;;;;;;;;;;;MAIzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BulkUpdateUsersCommand = 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 BulkUpdateUsersCommand;
9
+ (function (BulkUpdateUsersCommand) {
10
+ BulkUpdateUsersCommand.url = api_1.REST_API.USERS.BULK.UPDATE;
11
+ BulkUpdateUsersCommand.TSQ_url = BulkUpdateUsersCommand.url;
12
+ BulkUpdateUsersCommand.RequestSchema = zod_1.z.object({
13
+ uuids: zod_1.z.array(zod_1.z.string().uuid()),
14
+ fields: zod_1.z.object({
15
+ status: models_1.UsersSchema.shape.status.optional(),
16
+ trafficLimitBytes: zod_1.z.optional(zod_1.z
17
+ .number({
18
+ invalid_type_error: 'Traffic limit must be a number',
19
+ })
20
+ .int('Traffic limit must be an integer')
21
+ .min(0, 'Traffic limit must be greater than 0')
22
+ .describe('Traffic limit in bytes. 0 - unlimited')),
23
+ trafficLimitStrategy: zod_1.z.optional(zod_1.z
24
+ .nativeEnum(constants_1.RESET_PERIODS, {
25
+ description: 'Available reset periods',
26
+ })
27
+ .describe('Traffic limit reset strategy')),
28
+ expireAt: zod_1.z.optional(zod_1.z
29
+ .string()
30
+ .datetime({ message: 'Invalid date format' })
31
+ .transform((str) => new Date(str))
32
+ .refine((date) => date > new Date(), {
33
+ message: 'Expiration date cannot be in the past',
34
+ })
35
+ .describe('Expiration date: 2025-01-17T15:38:45.065Z')),
36
+ description: zod_1.z.optional(zod_1.z.string()),
37
+ telegramId: zod_1.z.optional(zod_1.z.number()),
38
+ email: zod_1.z.optional(zod_1.z.string().email('Invalid email format')),
39
+ }),
40
+ });
41
+ BulkUpdateUsersCommand.ResponseSchema = zod_1.z.object({
42
+ response: zod_1.z.object({
43
+ affectedRows: zod_1.z.number(),
44
+ }),
45
+ });
46
+ })(BulkUpdateUsersCommand || (exports.BulkUpdateUsersCommand = BulkUpdateUsersCommand = {}));
@@ -1,2 +1,6 @@
1
1
  export * from './bulk-delete-users-by-status.command';
2
+ export * from './bulk-delete-users.command';
3
+ export * from './bulk-reset-traffic-users.command';
4
+ export * from './bulk-revoke-users-subscription.command';
5
+ export * from './bulk-update-users.command';
2
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../commands/users/bulk/index.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../commands/users/bulk/index.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,CAAC;AACtD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,CAAC;AACnD,cAAc,0CAA0C,CAAC;AACzD,cAAc,6BAA6B,CAAC"}
@@ -15,3 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./bulk-delete-users-by-status.command"), exports);
18
+ __exportStar(require("./bulk-delete-users.command"), exports);
19
+ __exportStar(require("./bulk-reset-traffic-users.command"), exports);
20
+ __exportStar(require("./bulk-revoke-users-subscription.command"), exports);
21
+ __exportStar(require("./bulk-update-users.command"), exports);
@@ -439,5 +439,25 @@ export declare const ERRORS: {
439
439
  readonly message: "Set port to hosts error";
440
440
  readonly httpCode: 500;
441
441
  };
442
+ readonly BULK_DELETE_USERS_BY_UUID_ERROR: {
443
+ readonly code: "A084";
444
+ readonly message: "Bulk delete users by UUID error";
445
+ readonly httpCode: 500;
446
+ };
447
+ readonly BULK_REVOKE_USERS_SUBSCRIPTION_ERROR: {
448
+ readonly code: "A085";
449
+ readonly message: "Bulk revoke users subscription error";
450
+ readonly httpCode: 500;
451
+ };
452
+ readonly BULK_RESET_USER_TRAFFIC_ERROR: {
453
+ readonly code: "A086";
454
+ readonly message: "Bulk reset user traffic error";
455
+ readonly httpCode: 500;
456
+ };
457
+ readonly BULK_UPDATE_USERS_ERROR: {
458
+ readonly code: "A087";
459
+ readonly message: "Bulk update users error";
460
+ readonly httpCode: 500;
461
+ };
442
462
  };
443
463
  //# 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4G3B,CAAC"}
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgI3B,CAAC"}
@@ -410,4 +410,24 @@ exports.ERRORS = {
410
410
  message: 'Set port to hosts error',
411
411
  httpCode: 500,
412
412
  },
413
+ BULK_DELETE_USERS_BY_UUID_ERROR: {
414
+ code: 'A084',
415
+ message: 'Bulk delete users by UUID error',
416
+ httpCode: 500,
417
+ },
418
+ BULK_REVOKE_USERS_SUBSCRIPTION_ERROR: {
419
+ code: 'A085',
420
+ message: 'Bulk revoke users subscription error',
421
+ httpCode: 500,
422
+ },
423
+ BULK_RESET_USER_TRAFFIC_ERROR: {
424
+ code: 'A086',
425
+ message: 'Bulk reset user traffic error',
426
+ httpCode: 500,
427
+ },
428
+ BULK_UPDATE_USERS_ERROR: {
429
+ code: 'A087',
430
+ message: 'Bulk update users error',
431
+ httpCode: 500,
432
+ },
413
433
  };
@@ -17,6 +17,10 @@ exports.USERS_ROUTES = {
17
17
  RESET_USER_TRAFFIC: 'reset-traffic',
18
18
  BULK: {
19
19
  DELETE_BY_STATUS: 'bulk/delete-by-status',
20
+ UPDATE: 'bulk/update',
21
+ RESET_TRAFFIC: 'bulk/reset-traffic',
22
+ REVOKE_SUBSCRIPTION: 'bulk/revoke-subscription',
23
+ DELETE: 'bulk/delete',
20
24
  },
21
25
  GET_BY_TELEGRAM_ID: 'tg',
22
26
  GET_BY_EMAIL: 'email',
@@ -97,6 +97,10 @@ exports.REST_API = {
97
97
  RESET_USER_TRAFFIC: (uuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.RESET_USER_TRAFFIC}/${uuid}`,
98
98
  BULK: {
99
99
  DELETE_BY_STATUS: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.BULK.DELETE_BY_STATUS}`,
100
+ UPDATE: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.BULK.UPDATE}`,
101
+ RESET_TRAFFIC: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.BULK.RESET_TRAFFIC}`,
102
+ REVOKE_SUBSCRIPTION: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.BULK.REVOKE_SUBSCRIPTION}`,
103
+ DELETE: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.BULK.DELETE}`,
100
104
  },
101
105
  GET_BY_TELEGRAM_ID: (telegramId) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY_TELEGRAM_ID}/${telegramId}`,
102
106
  GET_BY_EMAIL: (email) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY_EMAIL}/${email}`,
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BulkDeleteUsersCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../../api");
6
+ var BulkDeleteUsersCommand;
7
+ (function (BulkDeleteUsersCommand) {
8
+ BulkDeleteUsersCommand.url = api_1.REST_API.USERS.BULK.DELETE;
9
+ BulkDeleteUsersCommand.TSQ_url = BulkDeleteUsersCommand.url;
10
+ BulkDeleteUsersCommand.RequestSchema = zod_1.z.object({
11
+ uuids: zod_1.z.array(zod_1.z.string().uuid()),
12
+ });
13
+ BulkDeleteUsersCommand.ResponseSchema = zod_1.z.object({
14
+ response: zod_1.z.object({
15
+ affectedRows: zod_1.z.number(),
16
+ }),
17
+ });
18
+ })(BulkDeleteUsersCommand || (exports.BulkDeleteUsersCommand = BulkDeleteUsersCommand = {}));
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BulkResetTrafficUsersCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../../api");
6
+ var BulkResetTrafficUsersCommand;
7
+ (function (BulkResetTrafficUsersCommand) {
8
+ BulkResetTrafficUsersCommand.url = api_1.REST_API.USERS.BULK.RESET_TRAFFIC;
9
+ BulkResetTrafficUsersCommand.TSQ_url = BulkResetTrafficUsersCommand.url;
10
+ BulkResetTrafficUsersCommand.RequestSchema = zod_1.z.object({
11
+ uuids: zod_1.z.array(zod_1.z.string().uuid()),
12
+ });
13
+ BulkResetTrafficUsersCommand.ResponseSchema = zod_1.z.object({
14
+ response: zod_1.z.object({
15
+ affectedRows: zod_1.z.number(),
16
+ }),
17
+ });
18
+ })(BulkResetTrafficUsersCommand || (exports.BulkResetTrafficUsersCommand = BulkResetTrafficUsersCommand = {}));
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BulkRevokeUsersSubscriptionCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../../api");
6
+ var BulkRevokeUsersSubscriptionCommand;
7
+ (function (BulkRevokeUsersSubscriptionCommand) {
8
+ BulkRevokeUsersSubscriptionCommand.url = api_1.REST_API.USERS.BULK.REVOKE_SUBSCRIPTION;
9
+ BulkRevokeUsersSubscriptionCommand.TSQ_url = BulkRevokeUsersSubscriptionCommand.url;
10
+ BulkRevokeUsersSubscriptionCommand.RequestSchema = zod_1.z.object({
11
+ uuids: zod_1.z.array(zod_1.z.string().uuid()),
12
+ });
13
+ BulkRevokeUsersSubscriptionCommand.ResponseSchema = zod_1.z.object({
14
+ response: zod_1.z.object({
15
+ affectedRows: zod_1.z.number(),
16
+ }),
17
+ });
18
+ })(BulkRevokeUsersSubscriptionCommand || (exports.BulkRevokeUsersSubscriptionCommand = BulkRevokeUsersSubscriptionCommand = {}));
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BulkUpdateUsersCommand = 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 BulkUpdateUsersCommand;
9
+ (function (BulkUpdateUsersCommand) {
10
+ BulkUpdateUsersCommand.url = api_1.REST_API.USERS.BULK.UPDATE;
11
+ BulkUpdateUsersCommand.TSQ_url = BulkUpdateUsersCommand.url;
12
+ BulkUpdateUsersCommand.RequestSchema = zod_1.z.object({
13
+ uuids: zod_1.z.array(zod_1.z.string().uuid()),
14
+ fields: zod_1.z.object({
15
+ status: models_1.UsersSchema.shape.status.optional(),
16
+ trafficLimitBytes: zod_1.z.optional(zod_1.z
17
+ .number({
18
+ invalid_type_error: 'Traffic limit must be a number',
19
+ })
20
+ .int('Traffic limit must be an integer')
21
+ .min(0, 'Traffic limit must be greater than 0')
22
+ .describe('Traffic limit in bytes. 0 - unlimited')),
23
+ trafficLimitStrategy: zod_1.z.optional(zod_1.z
24
+ .nativeEnum(constants_1.RESET_PERIODS, {
25
+ description: 'Available reset periods',
26
+ })
27
+ .describe('Traffic limit reset strategy')),
28
+ expireAt: zod_1.z.optional(zod_1.z
29
+ .string()
30
+ .datetime({ message: 'Invalid date format' })
31
+ .transform((str) => new Date(str))
32
+ .refine((date) => date > new Date(), {
33
+ message: 'Expiration date cannot be in the past',
34
+ })
35
+ .describe('Expiration date: 2025-01-17T15:38:45.065Z')),
36
+ description: zod_1.z.optional(zod_1.z.string()),
37
+ telegramId: zod_1.z.optional(zod_1.z.number()),
38
+ email: zod_1.z.optional(zod_1.z.string().email('Invalid email format')),
39
+ }),
40
+ });
41
+ BulkUpdateUsersCommand.ResponseSchema = zod_1.z.object({
42
+ response: zod_1.z.object({
43
+ affectedRows: zod_1.z.number(),
44
+ }),
45
+ });
46
+ })(BulkUpdateUsersCommand || (exports.BulkUpdateUsersCommand = BulkUpdateUsersCommand = {}));
@@ -15,3 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./bulk-delete-users-by-status.command"), exports);
18
+ __exportStar(require("./bulk-delete-users.command"), exports);
19
+ __exportStar(require("./bulk-reset-traffic-users.command"), exports);
20
+ __exportStar(require("./bulk-revoke-users-subscription.command"), exports);
21
+ __exportStar(require("./bulk-update-users.command"), exports);
@@ -410,4 +410,24 @@ exports.ERRORS = {
410
410
  message: 'Set port to hosts error',
411
411
  httpCode: 500,
412
412
  },
413
+ BULK_DELETE_USERS_BY_UUID_ERROR: {
414
+ code: 'A084',
415
+ message: 'Bulk delete users by UUID error',
416
+ httpCode: 500,
417
+ },
418
+ BULK_REVOKE_USERS_SUBSCRIPTION_ERROR: {
419
+ code: 'A085',
420
+ message: 'Bulk revoke users subscription error',
421
+ httpCode: 500,
422
+ },
423
+ BULK_RESET_USER_TRAFFIC_ERROR: {
424
+ code: 'A086',
425
+ message: 'Bulk reset user traffic error',
426
+ httpCode: 500,
427
+ },
428
+ BULK_UPDATE_USERS_ERROR: {
429
+ code: 'A087',
430
+ message: 'Bulk update users error',
431
+ httpCode: 500,
432
+ },
413
433
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnawave/backend-contract",
3
- "version": "0.3.37",
3
+ "version": "0.3.39",
4
4
  "public": true,
5
5
  "license": "AGPL-3.0-only",
6
6
  "description": "A contract library for Remnawave Backend. It can be used in backend and frontend.",