@remnawave/backend-contract 2.9.11 → 2.9.13

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/api-tokens.d.ts +1 -0
  2. package/build/backend/api/controllers/api-tokens.d.ts.map +1 -1
  3. package/build/backend/api/controllers/api-tokens.js +1 -0
  4. package/build/backend/api/routes.d.ts +5 -1
  5. package/build/backend/api/routes.d.ts.map +1 -1
  6. package/build/backend/api/routes.js +6 -2
  7. package/build/backend/commands/api-tokens/get-api-tokens.command.d.ts +0 -5
  8. package/build/backend/commands/api-tokens/get-api-tokens.command.d.ts.map +1 -1
  9. package/build/backend/commands/api-tokens/get-api-tokens.command.js +0 -5
  10. package/build/backend/commands/api-tokens/get-ott.command.d.ts +13 -0
  11. package/build/backend/commands/api-tokens/get-ott.command.d.ts.map +1 -0
  12. package/build/backend/commands/api-tokens/get-ott.command.js +17 -0
  13. package/build/backend/commands/api-tokens/index.d.ts +1 -0
  14. package/build/backend/commands/api-tokens/index.d.ts.map +1 -1
  15. package/build/backend/commands/api-tokens/index.js +1 -0
  16. package/build/backend/constants/backend-tools/backend-tools.constants.d.ts +9 -0
  17. package/build/backend/constants/backend-tools/backend-tools.constants.d.ts.map +1 -0
  18. package/build/backend/constants/backend-tools/backend-tools.constants.js +10 -0
  19. package/build/backend/constants/backend-tools/index.d.ts +2 -0
  20. package/build/backend/constants/backend-tools/index.d.ts.map +1 -0
  21. package/build/backend/constants/backend-tools/index.js +17 -0
  22. package/build/backend/constants/index.d.ts +1 -0
  23. package/build/backend/constants/index.d.ts.map +1 -1
  24. package/build/backend/constants/index.js +1 -0
  25. package/build/frontend/api/controllers/api-tokens.js +1 -0
  26. package/build/frontend/api/routes.js +6 -2
  27. package/build/frontend/commands/api-tokens/get-api-tokens.command.js +0 -5
  28. package/build/frontend/commands/api-tokens/get-ott.command.js +17 -0
  29. package/build/frontend/commands/api-tokens/index.js +1 -0
  30. package/build/frontend/constants/backend-tools/backend-tools.constants.js +10 -0
  31. package/build/frontend/constants/backend-tools/index.js +17 -0
  32. package/build/frontend/constants/index.js +1 -0
  33. package/package.json +1 -1
@@ -4,5 +4,6 @@ export declare const API_TOKENS_ROUTES: {
4
4
  readonly DELETE: (uuid: string) => string;
5
5
  readonly GET: "";
6
6
  readonly GET_SCOPES: "scopes";
7
+ readonly OTT: "ott";
7
8
  };
8
9
  //# sourceMappingURL=api-tokens.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"api-tokens.d.ts","sourceRoot":"","sources":["../../../../api/controllers/api-tokens.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,EAAG,QAAiB,CAAC;AAEvD,eAAO,MAAM,iBAAiB;;4BAEX,MAAM;;;CAGf,CAAC"}
1
+ {"version":3,"file":"api-tokens.d.ts","sourceRoot":"","sources":["../../../../api/controllers/api-tokens.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,EAAG,QAAiB,CAAC;AAEvD,eAAO,MAAM,iBAAiB;;4BAEX,MAAM;;;;CAIf,CAAC"}
@@ -7,4 +7,5 @@ exports.API_TOKENS_ROUTES = {
7
7
  DELETE: (uuid) => `${uuid}`,
8
8
  GET: '',
9
9
  GET_SCOPES: 'scopes',
10
+ OTT: 'ott',
10
11
  };
@@ -1,7 +1,10 @@
1
1
  export declare const ROOT: "/api";
2
2
  export declare const METRICS_ROOT: "/metrics";
3
3
  export declare const HEALTH_ROOT: "/health";
4
- export declare const BULLBOARD_ROOT: "/queues";
4
+ export declare const BACKEND_TOOLS_ROOT: "/backend-tools";
5
+ export declare const BULLBOARD_ROOT: "/backend-tools/queues";
6
+ export declare const SWAGGER_ROOT: "/backend-tools/swagger";
7
+ export declare const SCALAR_ROOT: "/backend-tools/scalar";
5
8
  export declare const REST_API: {
6
9
  readonly AUTH: {
7
10
  readonly LOGIN: "/api/auth/login";
@@ -29,6 +32,7 @@ export declare const REST_API: {
29
32
  readonly DELETE: (uuid: string) => string;
30
33
  readonly GET: "/api/tokens/";
31
34
  readonly GET_SCOPES: "/api/tokens/scopes";
35
+ readonly OTT: "/api/tokens/ott";
32
36
  };
33
37
  readonly KEYGEN: {
34
38
  readonly GET: "/api/keygen/";
@@ -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;AAC9C,eAAO,MAAM,cAAc,EAAG,SAAkB,CAAC;AAEjD,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;gCAyBE,MAAM;;;;;;;;;;qCAaD,MAAM;;gCAGX,MAAM;;;;;oCAOF,MAAM;qCAIL,MAAM;qCAIN,MAAM;;2CAKA,MAAM;;;;;;;;;;;;;;gCAkBjB,MAAM;qCAGD,MAAM;0CAED,MAAM;sDAEM,MAAM;;qCAMvB,MAAM;oCAIP,MAAM;2CAIC,MAAM;iDAIA,MAAM;;;8BAOzB,MAAM;6CAES,MAAM;0CAIT,MAAM;;;;;;;;;;;;;;;;;;;;;;kCAyBd,MAAM;uCAED,MAAM;;;;;;qCASR,MAAM;gCAEX,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAmCT,MAAM;;gCAKH,MAAM;;;;;;;;;;;;;;mDAiBa,MAAM;;;;;;;;;0CAYf,MAAM;kCAId,MAAM;6CAIK,MAAM;iDAIF,MAAM;;;6CAMV,MAAM;;qDAKE,MAAM;;;;;;qCAStB,MAAM;gCAIX,MAAM;sDAIgB,MAAM;6DAIC,MAAM;;;;;;;;;;qCAa9B,MAAM;gCAIX,MAAM;0CAII,MAAM;;uCAKT,MAAM;0CAEH,MAAM;;;;;;;;;;yCAWP,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;;;;yCAKJ,MAAM;;;;2CAKJ,MAAM;;;6CAIJ,MAAM;;;;;6CAMN,MAAM;qDAEE,MAAM;6CAEd,MAAM;qDAEE,MAAM;;;;;iCAM1B,MAAM;oCAEH,MAAM;;;iCAIT,MAAM;oCAEH,MAAM;;;CAIvB,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;;;;;;;;;;;;;;gCAkBjB,MAAM;qCAGD,MAAM;0CAED,MAAM;sDAEM,MAAM;;qCAMvB,MAAM;oCAIP,MAAM;2CAIC,MAAM;iDAIA,MAAM;;;8BAOzB,MAAM;6CAES,MAAM;0CAIT,MAAM;;;;;;;;;;;;;;;;;;;;;;kCAyBd,MAAM;uCAED,MAAM;;;;;;qCASR,MAAM;gCAEX,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAmCT,MAAM;;gCAKH,MAAM;;;;;;;;;;;;;;mDAiBa,MAAM;;;;;;;;;0CAYf,MAAM;kCAId,MAAM;6CAIK,MAAM;iDAIF,MAAM;;;6CAMV,MAAM;;qDAKE,MAAM;;;;;;qCAStB,MAAM;gCAIX,MAAM;sDAIgB,MAAM;6DAIC,MAAM;;;;;;;;;;qCAa9B,MAAM;gCAIX,MAAM;0CAII,MAAM;;uCAKT,MAAM;0CAEH,MAAM;;;;;;;;;;yCAWP,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;;;;yCAKJ,MAAM;;;;2CAKJ,MAAM;;;6CAIJ,MAAM;;;;;6CAMN,MAAM;qDAEE,MAAM;6CAEd,MAAM;qDAEE,MAAM;;;;;iCAM1B,MAAM;oCAEH,MAAM;;;iCAIT,MAAM;oCAEH,MAAM;;;CAIvB,CAAC"}
@@ -33,12 +33,15 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.REST_API = exports.BULLBOARD_ROOT = exports.HEALTH_ROOT = exports.METRICS_ROOT = exports.ROOT = void 0;
36
+ exports.REST_API = exports.SCALAR_ROOT = exports.SWAGGER_ROOT = exports.BULLBOARD_ROOT = exports.BACKEND_TOOLS_ROOT = exports.HEALTH_ROOT = exports.METRICS_ROOT = exports.ROOT = void 0;
37
37
  const CONTROLLERS = __importStar(require("./controllers"));
38
38
  exports.ROOT = '/api';
39
39
  exports.METRICS_ROOT = '/metrics';
40
40
  exports.HEALTH_ROOT = '/health';
41
- exports.BULLBOARD_ROOT = '/queues';
41
+ exports.BACKEND_TOOLS_ROOT = '/backend-tools';
42
+ exports.BULLBOARD_ROOT = '/backend-tools/queues';
43
+ exports.SWAGGER_ROOT = '/backend-tools/swagger';
44
+ exports.SCALAR_ROOT = '/backend-tools/scalar';
42
45
  exports.REST_API = {
43
46
  AUTH: {
44
47
  LOGIN: `${exports.ROOT}/${CONTROLLERS.AUTH_CONTROLLER}/${CONTROLLERS.AUTH_ROUTES.LOGIN}`,
@@ -66,6 +69,7 @@ exports.REST_API = {
66
69
  DELETE: (uuid) => `${exports.ROOT}/${CONTROLLERS.API_TOKENS_CONTROLLER}/${CONTROLLERS.API_TOKENS_ROUTES.DELETE(uuid)}`,
67
70
  GET: `${exports.ROOT}/${CONTROLLERS.API_TOKENS_CONTROLLER}/${CONTROLLERS.API_TOKENS_ROUTES.GET}`,
68
71
  GET_SCOPES: `${exports.ROOT}/${CONTROLLERS.API_TOKENS_CONTROLLER}/${CONTROLLERS.API_TOKENS_ROUTES.GET_SCOPES}`,
72
+ OTT: `${exports.ROOT}/${CONTROLLERS.API_TOKENS_CONTROLLER}/${CONTROLLERS.API_TOKENS_ROUTES.OTT}`,
69
73
  },
70
74
  KEYGEN: {
71
75
  GET: `${exports.ROOT}/${CONTROLLERS.KEYGEN_CONTROLLER}/${CONTROLLERS.KEYGEN_ROUTES.GET}`,
@@ -13,11 +13,6 @@ export declare namespace GetApiTokensCommand {
13
13
  createdAt: z.ZodPipe<z.ZodISODateTime, z.ZodTransform<Date, string>>;
14
14
  updatedAt: z.ZodPipe<z.ZodISODateTime, z.ZodTransform<Date, string>>;
15
15
  }, z.core.$strip>>;
16
- docs: z.ZodObject<{
17
- enabled: z.ZodBoolean;
18
- scalarPath: z.ZodNullable<z.ZodString>;
19
- swaggerPath: z.ZodNullable<z.ZodString>;
20
- }, z.core.$strip>;
21
16
  }, z.core.$strip>;
22
17
  }, z.core.$strip>;
23
18
  type Response = z.infer<typeof ResponseSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"get-api-tokens.command.d.ts","sourceRoot":"","sources":["../../../../commands/api-tokens/get-api-tokens.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,yBAAiB,mBAAmB,CAAC;IAC1B,MAAM,GAAG,gBAA0B,CAAC;IACpC,MAAM,OAAO,gBAAM,CAAC;IAEpB,MAAM,eAAe,2CAM3B,CAAC;IAEK,MAAM,cAAc;;;;;;;;;;;;;;;;qBASzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
1
+ {"version":3,"file":"get-api-tokens.command.d.ts","sourceRoot":"","sources":["../../../../commands/api-tokens/get-api-tokens.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,yBAAiB,mBAAmB,CAAC;IAC1B,MAAM,GAAG,gBAA0B,CAAC;IACpC,MAAM,OAAO,gBAAM,CAAC;IAEpB,MAAM,eAAe,2CAM3B,CAAC;IAEK,MAAM,cAAc;;;;;;;;;;;qBAIzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -13,11 +13,6 @@ var GetApiTokensCommand;
13
13
  GetApiTokensCommand.ResponseSchema = zod_1.z.object({
14
14
  response: zod_1.z.object({
15
15
  tokens: zod_1.z.array(api_tokens_schema_1.ApiTokensSchema),
16
- docs: zod_1.z.object({
17
- enabled: zod_1.z.boolean(),
18
- scalarPath: zod_1.z.string().nullable(),
19
- swaggerPath: zod_1.z.string().nullable(),
20
- }),
21
16
  }),
22
17
  });
23
18
  })(GetApiTokensCommand || (exports.GetApiTokensCommand = GetApiTokensCommand = {}));
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+ export declare namespace GetOttCommand {
3
+ const url: "/api/tokens/ott";
4
+ const TSQ_url: "/api/tokens/ott";
5
+ const endpointDetails: import("../../constants").EndpointDetails;
6
+ const ResponseSchema: z.ZodObject<{
7
+ response: z.ZodObject<{
8
+ ott: z.ZodString;
9
+ }, z.core.$strip>;
10
+ }, z.core.$strip>;
11
+ type Response = z.infer<typeof ResponseSchema>;
12
+ }
13
+ //# sourceMappingURL=get-ott.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-ott.command.d.ts","sourceRoot":"","sources":["../../../../commands/api-tokens/get-ott.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,yBAAiB,aAAa,CAAC;IACpB,MAAM,GAAG,mBAA0B,CAAC;IACpC,MAAM,OAAO,mBAAM,CAAC;IAEpB,MAAM,eAAe,2CAK3B,CAAC;IAEK,MAAM,cAAc;;;;qBAIzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetOttCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../api");
6
+ const constants_1 = require("../../constants");
7
+ var GetOttCommand;
8
+ (function (GetOttCommand) {
9
+ GetOttCommand.url = api_1.REST_API.API_TOKENS.OTT;
10
+ GetOttCommand.TSQ_url = GetOttCommand.url;
11
+ GetOttCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.API_TOKENS_ROUTES.OTT, 'post', 'Get short-lived token for accessing backend tools (Swagger, Scalar, Bull Board)', { scope: 'ott', kind: 'write' });
12
+ GetOttCommand.ResponseSchema = zod_1.z.object({
13
+ response: zod_1.z.object({
14
+ ott: zod_1.z.string(),
15
+ }),
16
+ });
17
+ })(GetOttCommand || (exports.GetOttCommand = GetOttCommand = {}));
@@ -2,4 +2,5 @@ export * from './create.command';
2
2
  export * from './delete.command';
3
3
  export * from './get-api-tokens.command';
4
4
  export * from './get-scopes.command';
5
+ export * from './get-ott.command';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../commands/api-tokens/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../commands/api-tokens/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC"}
@@ -18,3 +18,4 @@ __exportStar(require("./create.command"), exports);
18
18
  __exportStar(require("./delete.command"), exports);
19
19
  __exportStar(require("./get-api-tokens.command"), exports);
20
20
  __exportStar(require("./get-scopes.command"), exports);
21
+ __exportStar(require("./get-ott.command"), exports);
@@ -0,0 +1,9 @@
1
+ export declare const BACKEND_TOOLS_AUTH_COOKIE_NAME = "rw-tools";
2
+ export declare const BACKEND_TOOLS_JWT_ISSUER = "Remnawave";
3
+ export declare const BACKEND_TOOLS_JWT_LIFETIME_HOURS = 2;
4
+ export declare const BACKEND_TOOLS_JWT_SCOPES: {
5
+ readonly ACCESS: "access";
6
+ readonly OTT: "ott";
7
+ };
8
+ export type TBackendToolsJwtScope = (typeof BACKEND_TOOLS_JWT_SCOPES)[keyof typeof BACKEND_TOOLS_JWT_SCOPES];
9
+ //# sourceMappingURL=backend-tools.constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"backend-tools.constants.d.ts","sourceRoot":"","sources":["../../../../constants/backend-tools/backend-tools.constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,8BAA8B,aAAa,CAAC;AACzD,eAAO,MAAM,wBAAwB,cAAc,CAAC;AACpD,eAAO,MAAM,gCAAgC,IAAI,CAAC;AAClD,eAAO,MAAM,wBAAwB;;;CAG3B,CAAC;AACX,MAAM,MAAM,qBAAqB,GAC7B,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,OAAO,wBAAwB,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BACKEND_TOOLS_JWT_SCOPES = exports.BACKEND_TOOLS_JWT_LIFETIME_HOURS = exports.BACKEND_TOOLS_JWT_ISSUER = exports.BACKEND_TOOLS_AUTH_COOKIE_NAME = void 0;
4
+ exports.BACKEND_TOOLS_AUTH_COOKIE_NAME = 'rw-tools';
5
+ exports.BACKEND_TOOLS_JWT_ISSUER = 'Remnawave';
6
+ exports.BACKEND_TOOLS_JWT_LIFETIME_HOURS = 2;
7
+ exports.BACKEND_TOOLS_JWT_SCOPES = {
8
+ ACCESS: 'access',
9
+ OTT: 'ott',
10
+ };
@@ -0,0 +1,2 @@
1
+ export * from './backend-tools.constants';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../constants/backend-tools/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,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("./backend-tools.constants"), exports);
@@ -14,4 +14,5 @@ export * from './scopes';
14
14
  export * from './subscription-template';
15
15
  export * from './templates';
16
16
  export * from './users';
17
+ export * from './backend-tools';
17
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC"}
@@ -30,3 +30,4 @@ __exportStar(require("./scopes"), exports);
30
30
  __exportStar(require("./subscription-template"), exports);
31
31
  __exportStar(require("./templates"), exports);
32
32
  __exportStar(require("./users"), exports);
33
+ __exportStar(require("./backend-tools"), exports);
@@ -7,4 +7,5 @@ exports.API_TOKENS_ROUTES = {
7
7
  DELETE: (uuid) => `${uuid}`,
8
8
  GET: '',
9
9
  GET_SCOPES: 'scopes',
10
+ OTT: 'ott',
10
11
  };
@@ -33,12 +33,15 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.REST_API = exports.BULLBOARD_ROOT = exports.HEALTH_ROOT = exports.METRICS_ROOT = exports.ROOT = void 0;
36
+ exports.REST_API = exports.SCALAR_ROOT = exports.SWAGGER_ROOT = exports.BULLBOARD_ROOT = exports.BACKEND_TOOLS_ROOT = exports.HEALTH_ROOT = exports.METRICS_ROOT = exports.ROOT = void 0;
37
37
  const CONTROLLERS = __importStar(require("./controllers"));
38
38
  exports.ROOT = '/api';
39
39
  exports.METRICS_ROOT = '/metrics';
40
40
  exports.HEALTH_ROOT = '/health';
41
- exports.BULLBOARD_ROOT = '/queues';
41
+ exports.BACKEND_TOOLS_ROOT = '/backend-tools';
42
+ exports.BULLBOARD_ROOT = '/backend-tools/queues';
43
+ exports.SWAGGER_ROOT = '/backend-tools/swagger';
44
+ exports.SCALAR_ROOT = '/backend-tools/scalar';
42
45
  exports.REST_API = {
43
46
  AUTH: {
44
47
  LOGIN: `${exports.ROOT}/${CONTROLLERS.AUTH_CONTROLLER}/${CONTROLLERS.AUTH_ROUTES.LOGIN}`,
@@ -66,6 +69,7 @@ exports.REST_API = {
66
69
  DELETE: (uuid) => `${exports.ROOT}/${CONTROLLERS.API_TOKENS_CONTROLLER}/${CONTROLLERS.API_TOKENS_ROUTES.DELETE(uuid)}`,
67
70
  GET: `${exports.ROOT}/${CONTROLLERS.API_TOKENS_CONTROLLER}/${CONTROLLERS.API_TOKENS_ROUTES.GET}`,
68
71
  GET_SCOPES: `${exports.ROOT}/${CONTROLLERS.API_TOKENS_CONTROLLER}/${CONTROLLERS.API_TOKENS_ROUTES.GET_SCOPES}`,
72
+ OTT: `${exports.ROOT}/${CONTROLLERS.API_TOKENS_CONTROLLER}/${CONTROLLERS.API_TOKENS_ROUTES.OTT}`,
69
73
  },
70
74
  KEYGEN: {
71
75
  GET: `${exports.ROOT}/${CONTROLLERS.KEYGEN_CONTROLLER}/${CONTROLLERS.KEYGEN_ROUTES.GET}`,
@@ -13,11 +13,6 @@ var GetApiTokensCommand;
13
13
  GetApiTokensCommand.ResponseSchema = zod_1.z.object({
14
14
  response: zod_1.z.object({
15
15
  tokens: zod_1.z.array(api_tokens_schema_1.ApiTokensSchema),
16
- docs: zod_1.z.object({
17
- enabled: zod_1.z.boolean(),
18
- scalarPath: zod_1.z.string().nullable(),
19
- swaggerPath: zod_1.z.string().nullable(),
20
- }),
21
16
  }),
22
17
  });
23
18
  })(GetApiTokensCommand || (exports.GetApiTokensCommand = GetApiTokensCommand = {}));
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetOttCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../api");
6
+ const constants_1 = require("../../constants");
7
+ var GetOttCommand;
8
+ (function (GetOttCommand) {
9
+ GetOttCommand.url = api_1.REST_API.API_TOKENS.OTT;
10
+ GetOttCommand.TSQ_url = GetOttCommand.url;
11
+ GetOttCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.API_TOKENS_ROUTES.OTT, 'post', 'Get short-lived token for accessing backend tools (Swagger, Scalar, Bull Board)', { scope: 'ott', kind: 'write' });
12
+ GetOttCommand.ResponseSchema = zod_1.z.object({
13
+ response: zod_1.z.object({
14
+ ott: zod_1.z.string(),
15
+ }),
16
+ });
17
+ })(GetOttCommand || (exports.GetOttCommand = GetOttCommand = {}));
@@ -18,3 +18,4 @@ __exportStar(require("./create.command"), exports);
18
18
  __exportStar(require("./delete.command"), exports);
19
19
  __exportStar(require("./get-api-tokens.command"), exports);
20
20
  __exportStar(require("./get-scopes.command"), exports);
21
+ __exportStar(require("./get-ott.command"), exports);
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BACKEND_TOOLS_JWT_SCOPES = exports.BACKEND_TOOLS_JWT_LIFETIME_HOURS = exports.BACKEND_TOOLS_JWT_ISSUER = exports.BACKEND_TOOLS_AUTH_COOKIE_NAME = void 0;
4
+ exports.BACKEND_TOOLS_AUTH_COOKIE_NAME = 'rw-tools';
5
+ exports.BACKEND_TOOLS_JWT_ISSUER = 'Remnawave';
6
+ exports.BACKEND_TOOLS_JWT_LIFETIME_HOURS = 2;
7
+ exports.BACKEND_TOOLS_JWT_SCOPES = {
8
+ ACCESS: 'access',
9
+ OTT: 'ott',
10
+ };
@@ -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("./backend-tools.constants"), exports);
@@ -30,3 +30,4 @@ __exportStar(require("./scopes"), exports);
30
30
  __exportStar(require("./subscription-template"), exports);
31
31
  __exportStar(require("./templates"), exports);
32
32
  __exportStar(require("./users"), exports);
33
+ __exportStar(require("./backend-tools"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnawave/backend-contract",
3
- "version": "2.9.11",
3
+ "version": "2.9.13",
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",