@remnawave/backend-contract 2.9.20 → 2.9.21

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 (28) hide show
  1. package/build/backend/api/controllers/remnawave-settings.d.ts +2 -2
  2. package/build/backend/api/controllers/remnawave-settings.d.ts.map +1 -1
  3. package/build/backend/api/controllers/remnawave-settings.js +3 -3
  4. package/build/backend/api/controllers/users.d.ts +1 -0
  5. package/build/backend/api/controllers/users.d.ts.map +1 -1
  6. package/build/backend/api/controllers/users.js +1 -0
  7. package/build/backend/api/routes.d.ts +1 -0
  8. package/build/backend/api/routes.d.ts.map +1 -1
  9. package/build/backend/api/routes.js +3 -2
  10. package/build/backend/commands/remnawave-settings/get-remnawave-settings.command.js +1 -1
  11. package/build/backend/commands/remnawave-settings/update-remnawave-settings.command.js +1 -1
  12. package/build/backend/commands/users/actions/extend-user.command.d.ts +64 -0
  13. package/build/backend/commands/users/actions/extend-user.command.d.ts.map +1 -0
  14. package/build/backend/commands/users/actions/extend-user.command.js +21 -0
  15. package/build/backend/commands/users/actions/index.d.ts +1 -0
  16. package/build/backend/commands/users/actions/index.d.ts.map +1 -1
  17. package/build/backend/commands/users/actions/index.js +1 -0
  18. package/build/backend/constants/errors/errors.d.ts +3 -3
  19. package/build/backend/constants/errors/errors.js +3 -3
  20. package/build/frontend/api/controllers/remnawave-settings.js +3 -3
  21. package/build/frontend/api/controllers/users.js +1 -0
  22. package/build/frontend/api/routes.js +3 -2
  23. package/build/frontend/commands/remnawave-settings/get-remnawave-settings.command.js +1 -1
  24. package/build/frontend/commands/remnawave-settings/update-remnawave-settings.command.js +1 -1
  25. package/build/frontend/commands/users/actions/extend-user.command.js +21 -0
  26. package/build/frontend/commands/users/actions/index.js +1 -0
  27. package/build/frontend/constants/errors/errors.js +3 -3
  28. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
- export declare const REMNAAWAVE_SETTINGS_CONTROLLER: "remnawave-settings";
2
- export declare const REMNAAWAVE_SETTINGS_ROUTES: {
1
+ export declare const REMNAWAVE_SETTINGS_CONTROLLER: "remnawave-settings";
2
+ export declare const REMNAWAVE_SETTINGS_ROUTES: {
3
3
  readonly GET: "";
4
4
  readonly UPDATE: "";
5
5
  };
@@ -1 +1 @@
1
- {"version":3,"file":"remnawave-settings.d.ts","sourceRoot":"","sources":["../../../../api/controllers/remnawave-settings.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,8BAA8B,EAAG,oBAA6B,CAAC;AAE5E,eAAO,MAAM,0BAA0B;;;CAG7B,CAAC"}
1
+ {"version":3,"file":"remnawave-settings.d.ts","sourceRoot":"","sources":["../../../../api/controllers/remnawave-settings.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B,EAAG,oBAA6B,CAAC;AAE3E,eAAO,MAAM,yBAAyB;;;CAG5B,CAAC"}
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.REMNAAWAVE_SETTINGS_ROUTES = exports.REMNAAWAVE_SETTINGS_CONTROLLER = void 0;
4
- exports.REMNAAWAVE_SETTINGS_CONTROLLER = 'remnawave-settings';
5
- exports.REMNAAWAVE_SETTINGS_ROUTES = {
3
+ exports.REMNAWAVE_SETTINGS_ROUTES = exports.REMNAWAVE_SETTINGS_CONTROLLER = void 0;
4
+ exports.REMNAWAVE_SETTINGS_CONTROLLER = 'remnawave-settings';
5
+ exports.REMNAWAVE_SETTINGS_ROUTES = {
6
6
  GET: '', // get
7
7
  UPDATE: '', // patch
8
8
  };
@@ -14,6 +14,7 @@ export declare const USERS_ROUTES: {
14
14
  readonly DISABLE: (userId: string) => string;
15
15
  readonly RESET_TRAFFIC: (userId: string) => string;
16
16
  readonly REVOKE_SUBSCRIPTION: (userId: string) => string;
17
+ readonly EXTEND_EXPIRATION_DATE: (userId: string) => string;
17
18
  };
18
19
  readonly GET_BY: {
19
20
  readonly SHORT_UUID: (shortUuid: string) => string;
@@ -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;;;;;8BAKJ,MAAM;iCACH,MAAM;wCACC,MAAM;oDACM,MAAM;;kCAExB,MAAM;mCACL,MAAM;yCACA,MAAM;+CACA,MAAM;;;yCAGZ,MAAM;sCACT,MAAM;;;;;;;;;;;;;;;;;;;;CAsBzB,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,mBAAmB,EAAG,SAAkB,CAAC;AAEtD,eAAO,MAAM,YAAY;;;;;8BAKJ,MAAM;iCACH,MAAM;wCACC,MAAM;oDACM,MAAM;;kCAExB,MAAM;mCACL,MAAM;yCACA,MAAM;+CACA,MAAM;kDACH,MAAM;;;yCAGf,MAAM;sCACT,MAAM;;;;;;;;;;;;;;;;;;;;CAsBzB,CAAC"}
@@ -17,6 +17,7 @@ exports.USERS_ROUTES = {
17
17
  DISABLE: (userId) => `${userId}/${exports.USERS_ACTIONS_ROUTE}/disable`,
18
18
  RESET_TRAFFIC: (userId) => `${userId}/${exports.USERS_ACTIONS_ROUTE}/reset-traffic`,
19
19
  REVOKE_SUBSCRIPTION: (userId) => `${userId}/${exports.USERS_ACTIONS_ROUTE}/revoke`,
20
+ EXTEND_EXPIRATION_DATE: (userId) => `${userId}/${exports.USERS_ACTIONS_ROUTE}/extend`,
20
21
  },
21
22
  GET_BY: {
22
23
  SHORT_UUID: (shortUuid) => `by-short-uuid/${shortUuid}`,
@@ -74,6 +74,7 @@ export declare const REST_API: {
74
74
  readonly ENABLE: (userId: string) => string;
75
75
  readonly RESET_TRAFFIC: (userId: string) => string;
76
76
  readonly REVOKE_SUBSCRIPTION: (userId: string) => string;
77
+ readonly EXTEND_EXPIRATION_DATE: (userId: string) => string;
77
78
  };
78
79
  readonly GET_BY: {
79
80
  readonly SHORT_UUID: (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;AAChD,eAAO,MAAM,WAAW,EAAG,SAAkB,CAAC;AAE9C,eAAO,MAAM,kBAAkB,EAAG,gBAAyB,CAAC;AAC5D,eAAO,MAAM,cAAc,EAAG,uBAAgC,CAAC;AAC/D,eAAO,MAAM,YAAY,EAAG,wBAAiC,CAAC;AAC9D,eAAO,MAAM,WAAW,EAAG,uBAAgC,CAAC;AAE5D,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;gCAyBE,MAAM;;;;;;;;;;;qCAcD,MAAM;;gCAGX,MAAM;;;;;oCAOF,MAAM;qCAIL,MAAM;qCAIN,MAAM;;2CAKA,MAAM;;;;;;;;;;;;;;kCAkBf,MAAM;qCAGH,MAAM;4CAEC,MAAM;wDAEM,MAAM;;uCAMvB,MAAM;sCAIP,MAAM;6CAIC,MAAM;mDAIA,MAAM;;;6CAMZ,MAAM;0CAIT,MAAM;;;;;;;;;;;;;;;;;;;;;;kCAyBd,MAAM;uCAED,MAAM;;;;;;qCASR,MAAM;gCAEX,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAoCT,MAAM;;gCAKH,MAAM;;;;;;;;;;;;;;iDAiBW,MAAM;;;;;;;;;0CAYb,MAAM;6CAIH,MAAM;iDAIF,MAAM;kCAIrB,MAAM;;;6CAMK,MAAM;;0DAKO,MAAM;;;;;;qCAS3B,MAAM;gCAIX,MAAM;sDAIgB,MAAM;6DAIC,MAAM;;;;;;;;;;qCAa9B,MAAM;gCAIX,MAAM;0CAII,MAAM;;uCAKT,MAAM;0CAEH,MAAM;4CAEJ,MAAM;+CAEH,MAAM;;;;;;;;;;yCAWZ,MAAM;8CAED,MAAM;;;;6CAMP,MAAM;;;gDAKH,MAAM;;;;;;;;;;;;;;;;qCAiBjB,MAAM;gCAIX,MAAM;;uCAKC,MAAM;0CAEH,MAAM;;;;;;;;;;;6BAYnB,MAAM;;;gCAIH,MAAM;;;;;;;;6BAST,MAAM;;;gCAIH,MAAM;;;;;;;;;;;;;;;;;uCAkBC,MAAM;;;;;yCAMJ,MAAM;;;uCAIR,MAAM;6CAEA,MAAM,UAAU,MAAM;;;;+CAKpB,MAAM;qDAEA,MAAM;6CAEd,MAAM;qDAEE,MAAM;;;;;iCAM1B,MAAM;oCAEH,MAAM;;;mCAIP,MAAM;sCAEH,MAAM;;;CAIzB,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,WAAW,EAAG,SAAkB,CAAC;AAE9C,eAAO,MAAM,kBAAkB,EAAG,gBAAyB,CAAC;AAC5D,eAAO,MAAM,cAAc,EAAG,uBAAgC,CAAC;AAC/D,eAAO,MAAM,YAAY,EAAG,wBAAiC,CAAC;AAC9D,eAAO,MAAM,WAAW,EAAG,uBAAgC,CAAC;AAE5D,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;gCAyBE,MAAM;;;;;;;;;;;qCAcD,MAAM;;gCAGX,MAAM;;;;;oCAOF,MAAM;qCAIL,MAAM;qCAIN,MAAM;;2CAKA,MAAM;;;;;;;;;;;;;;kCAkBf,MAAM;qCAGH,MAAM;4CAEC,MAAM;wDAEM,MAAM;;uCAMvB,MAAM;sCAIP,MAAM;6CAIC,MAAM;mDAIA,MAAM;sDAIH,MAAM;;;6CAMf,MAAM;0CAIT,MAAM;;;;;;;;;;;;;;;;;;;;;;kCAyBd,MAAM;uCAED,MAAM;;;;;;qCASR,MAAM;gCAEX,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAoCT,MAAM;;gCAKH,MAAM;;;;;;;;;;;;;;iDAiBW,MAAM;;;;;;;;;0CAYb,MAAM;6CAIH,MAAM;iDAIF,MAAM;kCAIrB,MAAM;;;6CAMK,MAAM;;0DAKO,MAAM;;;;;;qCAS3B,MAAM;gCAIX,MAAM;sDAIgB,MAAM;6DAIC,MAAM;;;;;;;;;;qCAa9B,MAAM;gCAIX,MAAM;0CAII,MAAM;;uCAKT,MAAM;0CAEH,MAAM;4CAEJ,MAAM;+CAEH,MAAM;;;;;;;;;;yCAWZ,MAAM;8CAED,MAAM;;;;6CAMP,MAAM;;;gDAKH,MAAM;;;;;;;;;;;;;;;;qCAiBjB,MAAM;gCAIX,MAAM;;uCAKC,MAAM;0CAEH,MAAM;;;;;;;;;;;6BAYnB,MAAM;;;gCAIH,MAAM;;;;;;;;6BAST,MAAM;;;gCAIH,MAAM;;;;;;;;;;;;;;;;;uCAkBC,MAAM;;;;;yCAMJ,MAAM;;;uCAIR,MAAM;6CAEA,MAAM,UAAU,MAAM;;;;+CAKpB,MAAM;qDAEA,MAAM;6CAEd,MAAM;qDAEE,MAAM;;;;;iCAM1B,MAAM;oCAEH,MAAM;;;mCAIP,MAAM;sCAEH,MAAM;;;CAIzB,CAAC"}
@@ -111,6 +111,7 @@ exports.REST_API = {
111
111
  ENABLE: (userId) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.ACTIONS.ENABLE(userId)}`,
112
112
  RESET_TRAFFIC: (userId) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.ACTIONS.RESET_TRAFFIC(userId)}`,
113
113
  REVOKE_SUBSCRIPTION: (userId) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.ACTIONS.REVOKE_SUBSCRIPTION(userId)}`,
114
+ EXTEND_EXPIRATION_DATE: (userId) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.ACTIONS.EXTEND_EXPIRATION_DATE(userId)}`,
114
115
  },
115
116
  GET_BY: {
116
117
  SHORT_UUID: (shortUuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY.SHORT_UUID(shortUuid)}`,
@@ -281,8 +282,8 @@ exports.REST_API = {
281
282
  },
282
283
  },
283
284
  REMNAAWAVE_SETTINGS: {
284
- GET: `${exports.ROOT}/${CONTROLLERS.REMNAAWAVE_SETTINGS_CONTROLLER}/${CONTROLLERS.REMNAAWAVE_SETTINGS_ROUTES.GET}`,
285
- UPDATE: `${exports.ROOT}/${CONTROLLERS.REMNAAWAVE_SETTINGS_CONTROLLER}/${CONTROLLERS.REMNAAWAVE_SETTINGS_ROUTES.UPDATE}`,
285
+ GET: `${exports.ROOT}/${CONTROLLERS.REMNAWAVE_SETTINGS_CONTROLLER}/${CONTROLLERS.REMNAWAVE_SETTINGS_ROUTES.GET}`,
286
+ UPDATE: `${exports.ROOT}/${CONTROLLERS.REMNAWAVE_SETTINGS_CONTROLLER}/${CONTROLLERS.REMNAWAVE_SETTINGS_ROUTES.UPDATE}`,
286
287
  },
287
288
  SUBSCRIPTION_PAGE_CONFIGS: {
288
289
  GET: (uuid) => `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_PAGE_CONFIGS_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_PAGE_CONFIGS_ROUTES.GET(uuid)}`,
@@ -9,7 +9,7 @@ var GetRemnawaveSettingsCommand;
9
9
  (function (GetRemnawaveSettingsCommand) {
10
10
  GetRemnawaveSettingsCommand.url = api_1.REST_API.REMNAAWAVE_SETTINGS.GET;
11
11
  GetRemnawaveSettingsCommand.TSQ_url = GetRemnawaveSettingsCommand.url;
12
- GetRemnawaveSettingsCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.REMNAAWAVE_SETTINGS_ROUTES.GET, 'get', 'Get Remnawave settings', { scope: 'get', kind: 'read' });
12
+ GetRemnawaveSettingsCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.REMNAWAVE_SETTINGS_ROUTES.GET, 'get', 'Get Remnawave settings', { scope: 'get', kind: 'read' });
13
13
  GetRemnawaveSettingsCommand.ResponseSchema = zod_1.z.object({
14
14
  response: models_1.RemnawaveSettingsSchema,
15
15
  });
@@ -9,7 +9,7 @@ var UpdateRemnawaveSettingsCommand;
9
9
  (function (UpdateRemnawaveSettingsCommand) {
10
10
  UpdateRemnawaveSettingsCommand.url = api_1.REST_API.REMNAAWAVE_SETTINGS.UPDATE;
11
11
  UpdateRemnawaveSettingsCommand.TSQ_url = UpdateRemnawaveSettingsCommand.url;
12
- UpdateRemnawaveSettingsCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.REMNAAWAVE_SETTINGS_ROUTES.UPDATE, 'patch', 'Update Remnawave settings', { scope: 'update', kind: 'write' });
12
+ UpdateRemnawaveSettingsCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.REMNAWAVE_SETTINGS_ROUTES.UPDATE, 'patch', 'Update Remnawave settings', { scope: 'update', kind: 'write' });
13
13
  UpdateRemnawaveSettingsCommand.RequestBodySchema = zod_1.z.object({
14
14
  passkeySettings: models_1.PasskeySettingsSchema.optional(),
15
15
  oauth2Settings: models_1.Oauth2SettingsSchema.optional(),
@@ -0,0 +1,64 @@
1
+ import { z } from 'zod';
2
+ export declare namespace ExtendUserCommand {
3
+ const url: (userId: string) => string;
4
+ const TSQ_url: string;
5
+ const endpointDetails: import("../../../constants").EndpointDetails;
6
+ const RequestParamSchema: z.ZodObject<{
7
+ userId: z.ZodCoercedNumber<unknown>;
8
+ }, z.core.$strip>;
9
+ const RequestBodySchema: z.ZodObject<{
10
+ days: z.ZodNumber;
11
+ }, z.core.$strip>;
12
+ const ResponseSchema: z.ZodObject<{
13
+ response: z.ZodObject<{
14
+ id: z.ZodNumber;
15
+ shortUuid: z.ZodString;
16
+ username: z.ZodString;
17
+ status: z.ZodEnum<{
18
+ readonly ACTIVE: "ACTIVE";
19
+ readonly DISABLED: "DISABLED";
20
+ readonly LIMITED: "LIMITED";
21
+ readonly EXPIRED: "EXPIRED";
22
+ }>;
23
+ trafficLimitBytes: z.ZodNumber;
24
+ trafficLimitStrategy: z.ZodEnum<{
25
+ readonly NO_RESET: "NO_RESET";
26
+ readonly DAY: "DAY";
27
+ readonly WEEK: "WEEK";
28
+ readonly MONTH: "MONTH";
29
+ readonly MONTH_ROLLING: "MONTH_ROLLING";
30
+ }>;
31
+ expireAt: z.ZodPipe<z.ZodISODateTime, z.ZodTransform<Date, string>>;
32
+ telegramId: z.ZodNullable<z.ZodNumber>;
33
+ email: z.ZodNullable<z.ZodEmail>;
34
+ description: z.ZodNullable<z.ZodString>;
35
+ tag: z.ZodNullable<z.ZodString>;
36
+ hwidDeviceLimit: z.ZodNullable<z.ZodInt>;
37
+ externalSquadUuid: z.ZodNullable<z.ZodUUID>;
38
+ trojanPassword: z.ZodString;
39
+ vlessUuid: z.ZodUUID;
40
+ ssPassword: z.ZodString;
41
+ lastTriggeredThreshold: z.ZodInt;
42
+ subRevokedAt: z.ZodNullable<z.ZodPipe<z.ZodISODateTime, z.ZodTransform<Date, string>>>;
43
+ lastTrafficResetAt: z.ZodNullable<z.ZodPipe<z.ZodISODateTime, z.ZodTransform<Date, string>>>;
44
+ createdAt: z.ZodPipe<z.ZodISODateTime, z.ZodTransform<Date, string>>;
45
+ updatedAt: z.ZodPipe<z.ZodISODateTime, z.ZodTransform<Date, string>>;
46
+ subscriptionUrl: z.ZodString;
47
+ activeInternalSquads: z.ZodArray<z.ZodObject<{
48
+ uuid: z.ZodUUID;
49
+ name: z.ZodString;
50
+ }, z.core.$strip>>;
51
+ userTraffic: z.ZodObject<{
52
+ usedTrafficBytes: z.ZodNumber;
53
+ lifetimeUsedTrafficBytes: z.ZodNumber;
54
+ onlineAt: z.ZodNullable<z.ZodPipe<z.ZodISODateTime, z.ZodTransform<Date, string>>>;
55
+ firstConnectedAt: z.ZodNullable<z.ZodPipe<z.ZodISODateTime, z.ZodTransform<Date, string>>>;
56
+ lastConnectedNodeUuid: z.ZodNullable<z.ZodUUID>;
57
+ }, z.core.$strip>;
58
+ }, z.core.$strip>;
59
+ }, z.core.$strip>;
60
+ type RequestParam = z.infer<typeof RequestParamSchema>;
61
+ type RequestBody = z.infer<typeof RequestBodySchema>;
62
+ type Response = z.infer<typeof ResponseSchema>;
63
+ }
64
+ //# sourceMappingURL=extend-user.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extend-user.command.d.ts","sourceRoot":"","sources":["../../../../../commands/users/actions/extend-user.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,yBAAiB,iBAAiB,CAAC;IACxB,MAAM,GAAG,4BAAgD,CAAC;IAC1D,MAAM,OAAO,QAAiB,CAAC;IAE/B,MAAM,eAAe,8CAM3B,CAAC;IAEK,MAAM,kBAAkB;;qBAE7B,CAAC;IAEI,MAAM,iBAAiB;;qBAE5B,CAAC;IAEI,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAqB,CAAC;IAEjD,KAAY,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAC9D,KAAY,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;IAC5D,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ExtendUserCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../../api");
6
+ const constants_1 = require("../../../constants");
7
+ const models_1 = require("../../../models");
8
+ const user_response_1 = require("../user.response");
9
+ var ExtendUserCommand;
10
+ (function (ExtendUserCommand) {
11
+ ExtendUserCommand.url = api_1.REST_API.USERS.ACTIONS.EXTEND_EXPIRATION_DATE;
12
+ ExtendUserCommand.TSQ_url = ExtendUserCommand.url(':userId');
13
+ ExtendUserCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.ACTIONS.EXTEND_EXPIRATION_DATE(':userId'), 'post', 'Extend user expiration date', { scope: 'extend', kind: 'write' }, 'If user status is EXPIRED, the new expiration date is calculated from the current date and the user becomes ACTIVE. If user status is ACTIVE, the given number of days is added to the existing expiration date. DISABLED and LIMITED users will be extended, but their status will not change.');
14
+ ExtendUserCommand.RequestParamSchema = zod_1.z.object({
15
+ userId: models_1.numberParamSchema,
16
+ });
17
+ ExtendUserCommand.RequestBodySchema = zod_1.z.object({
18
+ days: zod_1.z.number().min(1).describe('The number of days to extend the expiration date.'),
19
+ });
20
+ ExtendUserCommand.ResponseSchema = user_response_1.UserResponseSchema;
21
+ })(ExtendUserCommand || (exports.ExtendUserCommand = ExtendUserCommand = {}));
@@ -2,4 +2,5 @@ export * from './disable-user.command';
2
2
  export * from './enable-user.command';
3
3
  export * from './reset-user-traffic.command';
4
4
  export * from './revoke-user-subscription.command';
5
+ export * from './extend-user.command';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../commands/users/actions/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oCAAoC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../commands/users/actions/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oCAAoC,CAAC;AACnD,cAAc,uBAAuB,CAAC"}
@@ -18,3 +18,4 @@ __exportStar(require("./disable-user.command"), exports);
18
18
  __exportStar(require("./enable-user.command"), exports);
19
19
  __exportStar(require("./reset-user-traffic.command"), exports);
20
20
  __exportStar(require("./revoke-user-subscription.command"), exports);
21
+ __exportStar(require("./extend-user.command"), exports);
@@ -964,12 +964,12 @@ export declare const ERRORS: {
964
964
  readonly message: "Passkey not found";
965
965
  readonly httpCode: 404;
966
966
  };
967
- readonly GET_REMNAAWAVE_SETTINGS_ERROR: {
967
+ readonly GET_REMNAWAVE_SETTINGS_ERROR: {
968
968
  readonly code: "A192";
969
969
  readonly message: "Get Remnawave settings error";
970
970
  readonly httpCode: 500;
971
971
  };
972
- readonly UPDATE_REMNAAWAVE_SETTINGS_ERROR: {
972
+ readonly UPDATE_REMNAWAVE_SETTINGS_ERROR: {
973
973
  readonly code: "A193";
974
974
  readonly message: "Update Remnawave settings error";
975
975
  readonly httpCode: 500;
@@ -1004,7 +1004,7 @@ export declare const ERRORS: {
1004
1004
  readonly message: "Delete passkey error";
1005
1005
  readonly httpCode: 500;
1006
1006
  };
1007
- readonly VALIDATE_REMNAAWAVE_SETTINGS_ERROR: {
1007
+ readonly VALIDATE_REMNAWAVE_SETTINGS_ERROR: {
1008
1008
  readonly code: "A199";
1009
1009
  readonly message: "Validate Remnawave settings error";
1010
1010
  readonly httpCode: 500;
@@ -935,12 +935,12 @@ exports.ERRORS = {
935
935
  message: 'Passkey not found',
936
936
  httpCode: 404,
937
937
  },
938
- GET_REMNAAWAVE_SETTINGS_ERROR: {
938
+ GET_REMNAWAVE_SETTINGS_ERROR: {
939
939
  code: 'A192',
940
940
  message: 'Get Remnawave settings error',
941
941
  httpCode: 500,
942
942
  },
943
- UPDATE_REMNAAWAVE_SETTINGS_ERROR: {
943
+ UPDATE_REMNAWAVE_SETTINGS_ERROR: {
944
944
  code: 'A193',
945
945
  message: 'Update Remnawave settings error',
946
946
  httpCode: 500,
@@ -975,7 +975,7 @@ exports.ERRORS = {
975
975
  message: 'Delete passkey error',
976
976
  httpCode: 500,
977
977
  },
978
- VALIDATE_REMNAAWAVE_SETTINGS_ERROR: {
978
+ VALIDATE_REMNAWAVE_SETTINGS_ERROR: {
979
979
  code: 'A199',
980
980
  message: 'Validate Remnawave settings error',
981
981
  httpCode: 500,
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.REMNAAWAVE_SETTINGS_ROUTES = exports.REMNAAWAVE_SETTINGS_CONTROLLER = void 0;
4
- exports.REMNAAWAVE_SETTINGS_CONTROLLER = 'remnawave-settings';
5
- exports.REMNAAWAVE_SETTINGS_ROUTES = {
3
+ exports.REMNAWAVE_SETTINGS_ROUTES = exports.REMNAWAVE_SETTINGS_CONTROLLER = void 0;
4
+ exports.REMNAWAVE_SETTINGS_CONTROLLER = 'remnawave-settings';
5
+ exports.REMNAWAVE_SETTINGS_ROUTES = {
6
6
  GET: '', // get
7
7
  UPDATE: '', // patch
8
8
  };
@@ -17,6 +17,7 @@ exports.USERS_ROUTES = {
17
17
  DISABLE: (userId) => `${userId}/${exports.USERS_ACTIONS_ROUTE}/disable`,
18
18
  RESET_TRAFFIC: (userId) => `${userId}/${exports.USERS_ACTIONS_ROUTE}/reset-traffic`,
19
19
  REVOKE_SUBSCRIPTION: (userId) => `${userId}/${exports.USERS_ACTIONS_ROUTE}/revoke`,
20
+ EXTEND_EXPIRATION_DATE: (userId) => `${userId}/${exports.USERS_ACTIONS_ROUTE}/extend`,
20
21
  },
21
22
  GET_BY: {
22
23
  SHORT_UUID: (shortUuid) => `by-short-uuid/${shortUuid}`,
@@ -111,6 +111,7 @@ exports.REST_API = {
111
111
  ENABLE: (userId) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.ACTIONS.ENABLE(userId)}`,
112
112
  RESET_TRAFFIC: (userId) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.ACTIONS.RESET_TRAFFIC(userId)}`,
113
113
  REVOKE_SUBSCRIPTION: (userId) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.ACTIONS.REVOKE_SUBSCRIPTION(userId)}`,
114
+ EXTEND_EXPIRATION_DATE: (userId) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.ACTIONS.EXTEND_EXPIRATION_DATE(userId)}`,
114
115
  },
115
116
  GET_BY: {
116
117
  SHORT_UUID: (shortUuid) => `${exports.ROOT}/${CONTROLLERS.USERS_CONTROLLER}/${CONTROLLERS.USERS_ROUTES.GET_BY.SHORT_UUID(shortUuid)}`,
@@ -281,8 +282,8 @@ exports.REST_API = {
281
282
  },
282
283
  },
283
284
  REMNAAWAVE_SETTINGS: {
284
- GET: `${exports.ROOT}/${CONTROLLERS.REMNAAWAVE_SETTINGS_CONTROLLER}/${CONTROLLERS.REMNAAWAVE_SETTINGS_ROUTES.GET}`,
285
- UPDATE: `${exports.ROOT}/${CONTROLLERS.REMNAAWAVE_SETTINGS_CONTROLLER}/${CONTROLLERS.REMNAAWAVE_SETTINGS_ROUTES.UPDATE}`,
285
+ GET: `${exports.ROOT}/${CONTROLLERS.REMNAWAVE_SETTINGS_CONTROLLER}/${CONTROLLERS.REMNAWAVE_SETTINGS_ROUTES.GET}`,
286
+ UPDATE: `${exports.ROOT}/${CONTROLLERS.REMNAWAVE_SETTINGS_CONTROLLER}/${CONTROLLERS.REMNAWAVE_SETTINGS_ROUTES.UPDATE}`,
286
287
  },
287
288
  SUBSCRIPTION_PAGE_CONFIGS: {
288
289
  GET: (uuid) => `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_PAGE_CONFIGS_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_PAGE_CONFIGS_ROUTES.GET(uuid)}`,
@@ -9,7 +9,7 @@ var GetRemnawaveSettingsCommand;
9
9
  (function (GetRemnawaveSettingsCommand) {
10
10
  GetRemnawaveSettingsCommand.url = api_1.REST_API.REMNAAWAVE_SETTINGS.GET;
11
11
  GetRemnawaveSettingsCommand.TSQ_url = GetRemnawaveSettingsCommand.url;
12
- GetRemnawaveSettingsCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.REMNAAWAVE_SETTINGS_ROUTES.GET, 'get', 'Get Remnawave settings', { scope: 'get', kind: 'read' });
12
+ GetRemnawaveSettingsCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.REMNAWAVE_SETTINGS_ROUTES.GET, 'get', 'Get Remnawave settings', { scope: 'get', kind: 'read' });
13
13
  GetRemnawaveSettingsCommand.ResponseSchema = zod_1.z.object({
14
14
  response: models_1.RemnawaveSettingsSchema,
15
15
  });
@@ -9,7 +9,7 @@ var UpdateRemnawaveSettingsCommand;
9
9
  (function (UpdateRemnawaveSettingsCommand) {
10
10
  UpdateRemnawaveSettingsCommand.url = api_1.REST_API.REMNAAWAVE_SETTINGS.UPDATE;
11
11
  UpdateRemnawaveSettingsCommand.TSQ_url = UpdateRemnawaveSettingsCommand.url;
12
- UpdateRemnawaveSettingsCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.REMNAAWAVE_SETTINGS_ROUTES.UPDATE, 'patch', 'Update Remnawave settings', { scope: 'update', kind: 'write' });
12
+ UpdateRemnawaveSettingsCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.REMNAWAVE_SETTINGS_ROUTES.UPDATE, 'patch', 'Update Remnawave settings', { scope: 'update', kind: 'write' });
13
13
  UpdateRemnawaveSettingsCommand.RequestBodySchema = zod_1.z.object({
14
14
  passkeySettings: models_1.PasskeySettingsSchema.optional(),
15
15
  oauth2Settings: models_1.Oauth2SettingsSchema.optional(),
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ExtendUserCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../../api");
6
+ const constants_1 = require("../../../constants");
7
+ const models_1 = require("../../../models");
8
+ const user_response_1 = require("../user.response");
9
+ var ExtendUserCommand;
10
+ (function (ExtendUserCommand) {
11
+ ExtendUserCommand.url = api_1.REST_API.USERS.ACTIONS.EXTEND_EXPIRATION_DATE;
12
+ ExtendUserCommand.TSQ_url = ExtendUserCommand.url(':userId');
13
+ ExtendUserCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.USERS_ROUTES.ACTIONS.EXTEND_EXPIRATION_DATE(':userId'), 'post', 'Extend user expiration date', { scope: 'extend', kind: 'write' }, 'If user status is EXPIRED, the new expiration date is calculated from the current date and the user becomes ACTIVE. If user status is ACTIVE, the given number of days is added to the existing expiration date. DISABLED and LIMITED users will be extended, but their status will not change.');
14
+ ExtendUserCommand.RequestParamSchema = zod_1.z.object({
15
+ userId: models_1.numberParamSchema,
16
+ });
17
+ ExtendUserCommand.RequestBodySchema = zod_1.z.object({
18
+ days: zod_1.z.number().min(1).describe('The number of days to extend the expiration date.'),
19
+ });
20
+ ExtendUserCommand.ResponseSchema = user_response_1.UserResponseSchema;
21
+ })(ExtendUserCommand || (exports.ExtendUserCommand = ExtendUserCommand = {}));
@@ -18,3 +18,4 @@ __exportStar(require("./disable-user.command"), exports);
18
18
  __exportStar(require("./enable-user.command"), exports);
19
19
  __exportStar(require("./reset-user-traffic.command"), exports);
20
20
  __exportStar(require("./revoke-user-subscription.command"), exports);
21
+ __exportStar(require("./extend-user.command"), exports);
@@ -935,12 +935,12 @@ exports.ERRORS = {
935
935
  message: 'Passkey not found',
936
936
  httpCode: 404,
937
937
  },
938
- GET_REMNAAWAVE_SETTINGS_ERROR: {
938
+ GET_REMNAWAVE_SETTINGS_ERROR: {
939
939
  code: 'A192',
940
940
  message: 'Get Remnawave settings error',
941
941
  httpCode: 500,
942
942
  },
943
- UPDATE_REMNAAWAVE_SETTINGS_ERROR: {
943
+ UPDATE_REMNAWAVE_SETTINGS_ERROR: {
944
944
  code: 'A193',
945
945
  message: 'Update Remnawave settings error',
946
946
  httpCode: 500,
@@ -975,7 +975,7 @@ exports.ERRORS = {
975
975
  message: 'Delete passkey error',
976
976
  httpCode: 500,
977
977
  },
978
- VALIDATE_REMNAAWAVE_SETTINGS_ERROR: {
978
+ VALIDATE_REMNAWAVE_SETTINGS_ERROR: {
979
979
  code: 'A199',
980
980
  message: 'Validate Remnawave settings error',
981
981
  httpCode: 500,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnawave/backend-contract",
3
- "version": "2.9.20",
3
+ "version": "2.9.21",
4
4
  "description": "A contract library for Remnawave Backend. It can be used in backend and frontend.",
5
5
  "keywords": [],
6
6
  "homepage": "https://github.com/remnawave",