@remnawave/backend-contract 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,5 +12,8 @@ export declare const USERS_ROUTES: {
12
12
  readonly DELETE_USER: "delete";
13
13
  readonly UPDATE: "update";
14
14
  readonly RESET_USER_TRAFFIC: "reset-traffic";
15
+ readonly BULK: {
16
+ readonly DELETE_BY_STATUS: "bulk/delete-by-status";
17
+ };
15
18
  };
16
19
  //# sourceMappingURL=users.d.ts.map
@@ -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;;;;;;;;;;;;;CAaf,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;;;;;;;;;;;;;;;;CAgBf,CAAC"}
@@ -15,4 +15,7 @@ exports.USERS_ROUTES = {
15
15
  DELETE_USER: 'delete',
16
16
  UPDATE: 'update',
17
17
  RESET_USER_TRAFFIC: 'reset-traffic',
18
+ BULK: {
19
+ DELETE_BY_STATUS: 'bulk/delete-by-status',
20
+ },
18
21
  };
@@ -47,6 +47,9 @@ export declare const REST_API: {
47
47
  readonly UPDATE: "/api/users/update";
48
48
  readonly GET_ALL_V2: "/api/users/v2";
49
49
  readonly RESET_USER_TRAFFIC: (uuid: string) => string;
50
+ readonly BULK: {
51
+ readonly DELETE_BY_STATUS: "/api/users/bulk/delete-by-status";
52
+ };
50
53
  };
51
54
  readonly SUBSCRIPTION: {
52
55
  readonly GET: (shortUuid: 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;AAEhD,eAAO,MAAM,QAAQ;;;;;;gCAME,MAAM;;;;;;;;gCASN,MAAM;;;iCAIL,MAAM;iCAEN,MAAM;iCAEN,MAAM;gCAEP,MAAM;;;;;;;;;;;;;;;;qCAiBD,MAAM;gDAEK,MAAM;6CAET,MAAM;8DAEW,MAAM;6CAEvB,MAAM;sCAEb,MAAM;qCAEP,MAAM;qCAEN,MAAM;;;4CAIC,MAAM;;;kCAIhB,MAAM;uCAED,MAAM;;;;;;;;gCASb,MAAM;;;;;;;CAQnB,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;AAEhD,eAAO,MAAM,QAAQ;;;;;;gCAME,MAAM;;;;;;;;gCASN,MAAM;;;iCAIL,MAAM;iCAEN,MAAM;iCAEN,MAAM;gCAEP,MAAM;;;;;;;;;;;;;;;;qCAiBD,MAAM;gDAEK,MAAM;6CAET,MAAM;8DAEW,MAAM;6CAEvB,MAAM;sCAEb,MAAM;qCAEP,MAAM;qCAEN,MAAM;;;4CAIC,MAAM;;;;;;kCAOhB,MAAM;uCAED,MAAM;;;;;;;;gCASb,MAAM;;;;;;;CAQnB,CAAC"}
@@ -84,6 +84,9 @@ exports.REST_API = {
84
84
  UPDATE: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.UPDATE}`,
85
85
  GET_ALL_V2: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_ALL_V2}`,
86
86
  RESET_USER_TRAFFIC: (uuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.RESET_USER_TRAFFIC}/${uuid}`,
87
+ BULK: {
88
+ DELETE_BY_STATUS: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.BULK.DELETE_BY_STATUS}`,
89
+ },
87
90
  },
88
91
  SUBSCRIPTION: {
89
92
  GET: (shortUuid) => `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.GET}/${shortUuid}`,
@@ -0,0 +1,37 @@
1
+ import { z } from 'zod';
2
+ export declare namespace BulkDeleteUsersByStatusCommand {
3
+ const url: "/api/users/bulk/delete-by-status";
4
+ const TSQ_url: "/api/users/bulk/delete-by-status";
5
+ const RequestSchema: z.ZodObject<{
6
+ status: z.ZodDefault<z.ZodNativeEnum<{
7
+ readonly ACTIVE: "ACTIVE";
8
+ readonly DISABLED: "DISABLED";
9
+ readonly LIMITED: "LIMITED";
10
+ readonly EXPIRED: "EXPIRED";
11
+ }>>;
12
+ }, "strip", z.ZodTypeAny, {
13
+ status: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE";
14
+ }, {
15
+ status?: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE" | undefined;
16
+ }>;
17
+ type Request = z.infer<typeof RequestSchema>;
18
+ const ResponseSchema: z.ZodObject<{
19
+ response: z.ZodObject<{
20
+ affectedRows: z.ZodNumber;
21
+ }, "strip", z.ZodTypeAny, {
22
+ affectedRows: number;
23
+ }, {
24
+ affectedRows: number;
25
+ }>;
26
+ }, "strip", z.ZodTypeAny, {
27
+ response: {
28
+ affectedRows: number;
29
+ };
30
+ }, {
31
+ response: {
32
+ affectedRows: number;
33
+ };
34
+ }>;
35
+ type Response = z.infer<typeof ResponseSchema>;
36
+ }
37
+ //# sourceMappingURL=bulk-delete-users-by-status.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bulk-delete-users-by-status.command.d.ts","sourceRoot":"","sources":["../../../../../commands/users/bulk/bulk-delete-users-by-status.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,yBAAiB,8BAA8B,CAAC;IACrC,MAAM,GAAG,oCAAuC,CAAC;IACjD,MAAM,OAAO,oCAAM,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,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BulkDeleteUsersByStatusCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../../models");
6
+ const api_1 = require("../../../api");
7
+ var BulkDeleteUsersByStatusCommand;
8
+ (function (BulkDeleteUsersByStatusCommand) {
9
+ BulkDeleteUsersByStatusCommand.url = api_1.REST_API.USERS.BULK.DELETE_BY_STATUS;
10
+ BulkDeleteUsersByStatusCommand.TSQ_url = BulkDeleteUsersByStatusCommand.url;
11
+ BulkDeleteUsersByStatusCommand.RequestSchema = zod_1.z.object({
12
+ status: models_1.UsersSchema.shape.status,
13
+ });
14
+ BulkDeleteUsersByStatusCommand.ResponseSchema = zod_1.z.object({
15
+ response: zod_1.z.object({
16
+ affectedRows: zod_1.z.number(),
17
+ }),
18
+ });
19
+ })(BulkDeleteUsersByStatusCommand || (exports.BulkDeleteUsersByStatusCommand = BulkDeleteUsersByStatusCommand = {}));
@@ -0,0 +1,2 @@
1
+ export * from './bulk-delete-users-by-status.command';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../commands/users/bulk/index.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,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("./bulk-delete-users-by-status.command"), exports);
@@ -10,4 +10,5 @@ export * from './get-user-by-uuid.command';
10
10
  export * from './reset-user-traffic.command';
11
11
  export * from './revoke-user-subscription.command';
12
12
  export * from './update-user.command';
13
+ export * from './bulk';
13
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../commands/users/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kCAAkC,CAAC;AACjD,cAAc,yCAAyC,CAAC;AACxD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oCAAoC,CAAC;AACnD,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../commands/users/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kCAAkC,CAAC;AACjD,cAAc,yCAAyC,CAAC;AACxD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oCAAoC,CAAC;AACnD,cAAc,uBAAuB,CAAC;AACtC,cAAc,QAAQ,CAAC"}
@@ -26,3 +26,4 @@ __exportStar(require("./get-user-by-uuid.command"), exports);
26
26
  __exportStar(require("./reset-user-traffic.command"), exports);
27
27
  __exportStar(require("./revoke-user-subscription.command"), exports);
28
28
  __exportStar(require("./update-user.command"), exports);
29
+ __exportStar(require("./bulk"), exports);
@@ -309,5 +309,10 @@ export declare const ERRORS: {
309
309
  readonly message: "Get all inbounds error";
310
310
  readonly httpCode: 500;
311
311
  };
312
+ readonly BULK_DELETE_USERS_BY_STATUS_ERROR: {
313
+ readonly code: "A059";
314
+ readonly message: "Bulk delete users by status error";
315
+ readonly httpCode: 500;
316
+ };
312
317
  };
313
318
  //# 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8H3B,CAAC"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../constants/errors/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAwJY,MAAM;;;;;;;;;;wCAUN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmI3B,CAAC"}
@@ -288,4 +288,9 @@ exports.ERRORS = {
288
288
  message: 'Get all inbounds error',
289
289
  httpCode: 500,
290
290
  },
291
+ BULK_DELETE_USERS_BY_STATUS_ERROR: {
292
+ code: 'A059',
293
+ message: 'Bulk delete users by status error',
294
+ httpCode: 500,
295
+ },
291
296
  };
@@ -15,4 +15,7 @@ exports.USERS_ROUTES = {
15
15
  DELETE_USER: 'delete',
16
16
  UPDATE: 'update',
17
17
  RESET_USER_TRAFFIC: 'reset-traffic',
18
+ BULK: {
19
+ DELETE_BY_STATUS: 'bulk/delete-by-status',
20
+ },
18
21
  };
@@ -84,6 +84,9 @@ exports.REST_API = {
84
84
  UPDATE: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.UPDATE}`,
85
85
  GET_ALL_V2: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_ALL_V2}`,
86
86
  RESET_USER_TRAFFIC: (uuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.RESET_USER_TRAFFIC}/${uuid}`,
87
+ BULK: {
88
+ DELETE_BY_STATUS: `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.BULK.DELETE_BY_STATUS}`,
89
+ },
87
90
  },
88
91
  SUBSCRIPTION: {
89
92
  GET: (shortUuid) => `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.GET}/${shortUuid}`,
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BulkDeleteUsersByStatusCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../../models");
6
+ const api_1 = require("../../../api");
7
+ var BulkDeleteUsersByStatusCommand;
8
+ (function (BulkDeleteUsersByStatusCommand) {
9
+ BulkDeleteUsersByStatusCommand.url = api_1.REST_API.USERS.BULK.DELETE_BY_STATUS;
10
+ BulkDeleteUsersByStatusCommand.TSQ_url = BulkDeleteUsersByStatusCommand.url;
11
+ BulkDeleteUsersByStatusCommand.RequestSchema = zod_1.z.object({
12
+ status: models_1.UsersSchema.shape.status,
13
+ });
14
+ BulkDeleteUsersByStatusCommand.ResponseSchema = zod_1.z.object({
15
+ response: zod_1.z.object({
16
+ affectedRows: zod_1.z.number(),
17
+ }),
18
+ });
19
+ })(BulkDeleteUsersByStatusCommand || (exports.BulkDeleteUsersByStatusCommand = BulkDeleteUsersByStatusCommand = {}));
@@ -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("./bulk-delete-users-by-status.command"), exports);
@@ -26,3 +26,4 @@ __exportStar(require("./get-user-by-uuid.command"), exports);
26
26
  __exportStar(require("./reset-user-traffic.command"), exports);
27
27
  __exportStar(require("./revoke-user-subscription.command"), exports);
28
28
  __exportStar(require("./update-user.command"), exports);
29
+ __exportStar(require("./bulk"), exports);
@@ -288,4 +288,9 @@ exports.ERRORS = {
288
288
  message: 'Get all inbounds error',
289
289
  httpCode: 500,
290
290
  },
291
+ BULK_DELETE_USERS_BY_STATUS_ERROR: {
292
+ code: 'A059',
293
+ message: 'Bulk delete users by status error',
294
+ httpCode: 500,
295
+ },
291
296
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnawave/backend-contract",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
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.",