@remnawave/backend-contract 0.2.7 → 0.3.0

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 (53) hide show
  1. package/build/backend/api/controllers/index.d.ts +1 -0
  2. package/build/backend/api/controllers/index.d.ts.map +1 -1
  3. package/build/backend/api/controllers/index.js +1 -0
  4. package/build/backend/api/controllers/subscription-template.d.ts +6 -0
  5. package/build/backend/api/controllers/subscription-template.d.ts.map +1 -0
  6. package/build/backend/api/controllers/subscription-template.js +8 -0
  7. package/build/backend/api/routes.d.ts +4 -0
  8. package/build/backend/api/routes.d.ts.map +1 -1
  9. package/build/backend/api/routes.js +4 -0
  10. package/build/backend/commands/index.d.ts +1 -0
  11. package/build/backend/commands/index.d.ts.map +1 -1
  12. package/build/backend/commands/index.js +1 -0
  13. package/build/backend/commands/subscription-template/get-template.command.d.ts +43 -0
  14. package/build/backend/commands/subscription-template/get-template.command.d.ts.map +1 -0
  15. package/build/backend/commands/subscription-template/get-template.command.js +20 -0
  16. package/build/backend/commands/subscription-template/index.d.ts +3 -0
  17. package/build/backend/commands/subscription-template/index.d.ts.map +1 -0
  18. package/build/backend/commands/subscription-template/index.js +18 -0
  19. package/build/backend/commands/subscription-template/update-template.command.d.ts +43 -0
  20. package/build/backend/commands/subscription-template/update-template.command.d.ts.map +1 -0
  21. package/build/backend/commands/subscription-template/update-template.command.js +21 -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/backend/constants/subscription-template/index.d.ts +3 -0
  26. package/build/backend/constants/subscription-template/index.d.ts.map +1 -0
  27. package/build/backend/constants/subscription-template/index.js +18 -0
  28. package/build/backend/constants/subscription-template/subscription-type/index.d.ts +2 -0
  29. package/build/backend/constants/subscription-template/subscription-type/index.d.ts.map +1 -0
  30. package/build/backend/constants/subscription-template/subscription-type/index.js +17 -0
  31. package/build/backend/constants/subscription-template/subscription-type/subscription-type.constant.d.ts +10 -0
  32. package/build/backend/constants/subscription-template/subscription-type/subscription-type.constant.d.ts.map +1 -0
  33. package/build/backend/constants/subscription-template/subscription-type/subscription-type.constant.js +11 -0
  34. package/build/backend/constants/subscription-template/template-type/index.d.ts +2 -0
  35. package/build/backend/constants/subscription-template/template-type/index.d.ts.map +1 -0
  36. package/build/backend/constants/subscription-template/template-type/index.js +17 -0
  37. package/build/backend/constants/subscription-template/template-type/template-type.constant.d.ts +7 -0
  38. package/build/backend/constants/subscription-template/template-type/template-type.constant.d.ts.map +1 -0
  39. package/build/backend/constants/subscription-template/template-type/template-type.constant.js +8 -0
  40. package/build/frontend/api/controllers/index.js +1 -0
  41. package/build/frontend/api/controllers/subscription-template.js +8 -0
  42. package/build/frontend/api/routes.js +4 -0
  43. package/build/frontend/commands/index.js +1 -0
  44. package/build/frontend/commands/subscription-template/get-template.command.js +20 -0
  45. package/build/frontend/commands/subscription-template/index.js +18 -0
  46. package/build/frontend/commands/subscription-template/update-template.command.js +21 -0
  47. package/build/frontend/constants/index.js +1 -0
  48. package/build/frontend/constants/subscription-template/index.js +18 -0
  49. package/build/frontend/constants/subscription-template/subscription-type/index.js +17 -0
  50. package/build/frontend/constants/subscription-template/subscription-type/subscription-type.constant.js +11 -0
  51. package/build/frontend/constants/subscription-template/template-type/index.js +17 -0
  52. package/build/frontend/constants/subscription-template/template-type/template-type.constant.js +8 -0
  53. package/package.json +1 -1
@@ -5,6 +5,7 @@ export * from './inbounds';
5
5
  export * from './keygen';
6
6
  export * from './nodes';
7
7
  export * from './subscription';
8
+ export * from './subscription-template';
8
9
  export * from './system';
9
10
  export * from './users';
10
11
  export * from './xray';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../api/controllers/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../api/controllers/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC"}
@@ -21,6 +21,7 @@ __exportStar(require("./inbounds"), exports);
21
21
  __exportStar(require("./keygen"), exports);
22
22
  __exportStar(require("./nodes"), exports);
23
23
  __exportStar(require("./subscription"), exports);
24
+ __exportStar(require("./subscription-template"), exports);
24
25
  __exportStar(require("./system"), exports);
25
26
  __exportStar(require("./users"), exports);
26
27
  __exportStar(require("./xray"), exports);
@@ -0,0 +1,6 @@
1
+ export declare const SUBSCRIPTION_TEMPLATE_CONTROLLER: "subscription-templates";
2
+ export declare const SUBSCRIPTION_TEMPLATE_ROUTES: {
3
+ readonly GET_TEMPLATE: "get-template";
4
+ readonly UPDATE_TEMPLATE: "update-template";
5
+ };
6
+ //# sourceMappingURL=subscription-template.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscription-template.d.ts","sourceRoot":"","sources":["../../../../api/controllers/subscription-template.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gCAAgC,EAAG,wBAAiC,CAAC;AAElF,eAAO,MAAM,4BAA4B;;;CAG/B,CAAC"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SUBSCRIPTION_TEMPLATE_ROUTES = exports.SUBSCRIPTION_TEMPLATE_CONTROLLER = void 0;
4
+ exports.SUBSCRIPTION_TEMPLATE_CONTROLLER = 'subscription-templates';
5
+ exports.SUBSCRIPTION_TEMPLATE_ROUTES = {
6
+ GET_TEMPLATE: 'get-template',
7
+ UPDATE_TEMPLATE: 'update-template',
8
+ };
@@ -73,5 +73,9 @@ export declare const REST_API: {
73
73
  readonly BANDWIDTH: "/api/system/bandwidth";
74
74
  readonly NODES_STATISTIC: "/api/system/statistics/nodes";
75
75
  };
76
+ readonly SUBSCRIPTION_TEMPLATE: {
77
+ readonly GET_INFO: (subscriptionType: string) => string;
78
+ readonly UPDATE_TEMPLATE: "/api/subscription-templates/update-template";
79
+ };
76
80
  };
77
81
  //# sourceMappingURL=routes.d.ts.map
@@ -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;;;;;;;;;;;;;;;;qCAiBD,MAAM;gDAEK,MAAM;6CAET,MAAM;8DAEW,MAAM;6CAEvB,MAAM;sCAEb,MAAM;qCAEP,MAAM;qCAEN,MAAM;;;4CAIC,MAAM;;;;kDAKA,MAAM;uCAEjB,MAAM;;;kCAIX,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;AAChD,eAAO,MAAM,cAAc,EAAG,SAAkB,CAAC;AAEjD,eAAO,MAAM,QAAQ;;;;;;;;gCAQE,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;;;;kDAKA,MAAM;uCAEjB,MAAM;;;kCAIX,MAAM;uCAED,MAAM;;;;;;;;gCASb,MAAM;;;;;;;;8CASQ,MAAM;;;CAIjC,CAAC"}
@@ -110,4 +110,8 @@ exports.REST_API = {
110
110
  BANDWIDTH: `${exports.ROOT}/${CONTROLLERS.SYSTEM_CONTROLLER}/${CONTROLLERS.SYSTEM_ROUTES.BANDWIDTH}`,
111
111
  NODES_STATISTIC: `${exports.ROOT}/${CONTROLLERS.SYSTEM_CONTROLLER}/${CONTROLLERS.SYSTEM_ROUTES.STATISTIC.NODES}`,
112
112
  },
113
+ SUBSCRIPTION_TEMPLATE: {
114
+ GET_INFO: (subscriptionType) => `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_TEMPLATE_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_TEMPLATE_ROUTES.GET_TEMPLATE}/${subscriptionType}`,
115
+ UPDATE_TEMPLATE: `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_TEMPLATE_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_TEMPLATE_ROUTES.UPDATE_TEMPLATE}`,
116
+ },
113
117
  };
@@ -5,6 +5,7 @@ export * from './inbounds';
5
5
  export * from './keygen';
6
6
  export * from './nodes';
7
7
  export * from './subscription';
8
+ export * from './subscription-template';
8
9
  export * from './system';
9
10
  export * from './users';
10
11
  export * from './xray';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../commands/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../commands/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC"}
@@ -21,6 +21,7 @@ __exportStar(require("./inbounds"), exports);
21
21
  __exportStar(require("./keygen"), exports);
22
22
  __exportStar(require("./nodes"), exports);
23
23
  __exportStar(require("./subscription"), exports);
24
+ __exportStar(require("./subscription-template"), exports);
24
25
  __exportStar(require("./system"), exports);
25
26
  __exportStar(require("./users"), exports);
26
27
  __exportStar(require("./xray"), exports);
@@ -0,0 +1,43 @@
1
+ import { z } from 'zod';
2
+ export declare namespace GetSubscriptionTemplateCommand {
3
+ const url: (subscriptionType: string) => string;
4
+ const TSQ_url: (subscriptionType: string) => string;
5
+ const RequestSchema: z.ZodObject<{
6
+ subscriptionType: z.ZodNativeEnum<{
7
+ readonly CLASH: "clash";
8
+ readonly STASH: "stash";
9
+ readonly SINGBOX: "singbox";
10
+ readonly SINGBOX_LEGACY: "singbox_legacy";
11
+ readonly MIHOMO: "mihomo";
12
+ }>;
13
+ }, "strip", z.ZodTypeAny, {
14
+ subscriptionType: "clash" | "stash" | "singbox" | "singbox_legacy" | "mihomo";
15
+ }, {
16
+ subscriptionType: "clash" | "stash" | "singbox" | "singbox_legacy" | "mihomo";
17
+ }>;
18
+ type Request = z.infer<typeof RequestSchema>;
19
+ const ResponseSchema: z.ZodObject<{
20
+ response: z.ZodObject<{
21
+ templateJson: z.ZodNullable<z.ZodUnknown>;
22
+ encodedTemplateYaml: z.ZodNullable<z.ZodString>;
23
+ }, "strip", z.ZodTypeAny, {
24
+ encodedTemplateYaml: string | null;
25
+ templateJson?: unknown;
26
+ }, {
27
+ encodedTemplateYaml: string | null;
28
+ templateJson?: unknown;
29
+ }>;
30
+ }, "strip", z.ZodTypeAny, {
31
+ response: {
32
+ encodedTemplateYaml: string | null;
33
+ templateJson?: unknown;
34
+ };
35
+ }, {
36
+ response: {
37
+ encodedTemplateYaml: string | null;
38
+ templateJson?: unknown;
39
+ };
40
+ }>;
41
+ type Response = z.infer<typeof ResponseSchema>;
42
+ }
43
+ //# sourceMappingURL=get-template.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-template.command.d.ts","sourceRoot":"","sources":["../../../../commands/subscription-template/get-template.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,yBAAiB,8BAA8B,CAAC;IACrC,MAAM,GAAG,sCAA0C,CAAC;IACpD,MAAM,OAAO,sCAAM,CAAC;IAEpB,MAAM,aAAa;;;;;;;;;;;;MAExB,CAAC;IAEH,KAAY,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;IAE7C,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;MAKzB,CAAC;IAEH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetSubscriptionTemplateCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const constants_1 = require("../../constants");
6
+ const api_1 = require("../../api");
7
+ var GetSubscriptionTemplateCommand;
8
+ (function (GetSubscriptionTemplateCommand) {
9
+ GetSubscriptionTemplateCommand.url = api_1.REST_API.SUBSCRIPTION_TEMPLATE.GET_INFO;
10
+ GetSubscriptionTemplateCommand.TSQ_url = GetSubscriptionTemplateCommand.url;
11
+ GetSubscriptionTemplateCommand.RequestSchema = zod_1.z.object({
12
+ subscriptionType: zod_1.z.nativeEnum(constants_1.SUBSCRIPTION_TYPE),
13
+ });
14
+ GetSubscriptionTemplateCommand.ResponseSchema = zod_1.z.object({
15
+ response: zod_1.z.object({
16
+ templateJson: zod_1.z.nullable(zod_1.z.unknown()),
17
+ encodedTemplateYaml: zod_1.z.nullable(zod_1.z.string()),
18
+ }),
19
+ });
20
+ })(GetSubscriptionTemplateCommand || (exports.GetSubscriptionTemplateCommand = GetSubscriptionTemplateCommand = {}));
@@ -0,0 +1,3 @@
1
+ export * from './get-template.command';
2
+ export * from './update-template.command';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../commands/subscription-template/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC"}
@@ -0,0 +1,18 @@
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("./get-template.command"), exports);
18
+ __exportStar(require("./update-template.command"), exports);
@@ -0,0 +1,43 @@
1
+ import { z } from 'zod';
2
+ export declare namespace UpdateSubscriptionTemplateCommand {
3
+ const url: "/api/subscription-templates/update-template";
4
+ const TSQ_url: "/api/subscription-templates/update-template";
5
+ const RequestSchema: z.ZodObject<{
6
+ subscriptionTemplateUuid: z.ZodString;
7
+ templateJson: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
8
+ encodedTemplateYaml: z.ZodOptional<z.ZodString>;
9
+ }, "strip", z.ZodTypeAny, {
10
+ subscriptionTemplateUuid: string;
11
+ templateJson?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
12
+ encodedTemplateYaml?: string | undefined;
13
+ }, {
14
+ subscriptionTemplateUuid: string;
15
+ templateJson?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
16
+ encodedTemplateYaml?: string | undefined;
17
+ }>;
18
+ type Request = z.infer<typeof RequestSchema>;
19
+ const ResponseSchema: z.ZodObject<{
20
+ response: z.ZodObject<{
21
+ templateJson: z.ZodNullable<z.ZodUnknown>;
22
+ encodedTemplateYaml: z.ZodNullable<z.ZodString>;
23
+ }, "strip", z.ZodTypeAny, {
24
+ encodedTemplateYaml: string | null;
25
+ templateJson?: unknown;
26
+ }, {
27
+ encodedTemplateYaml: string | null;
28
+ templateJson?: unknown;
29
+ }>;
30
+ }, "strip", z.ZodTypeAny, {
31
+ response: {
32
+ encodedTemplateYaml: string | null;
33
+ templateJson?: unknown;
34
+ };
35
+ }, {
36
+ response: {
37
+ encodedTemplateYaml: string | null;
38
+ templateJson?: unknown;
39
+ };
40
+ }>;
41
+ type Response = z.infer<typeof ResponseSchema>;
42
+ }
43
+ //# sourceMappingURL=update-template.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-template.command.d.ts","sourceRoot":"","sources":["../../../../commands/subscription-template/update-template.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,yBAAiB,iCAAiC,CAAC;IACxC,MAAM,GAAG,+CAAiD,CAAC;IAC3D,MAAM,OAAO,+CAAM,CAAC;IAEpB,MAAM,aAAa;;;;;;;;;;;;MAIxB,CAAC;IAEH,KAAY,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;IAE7C,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;MAKzB,CAAC;IAEH,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.UpdateSubscriptionTemplateCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../api");
6
+ var UpdateSubscriptionTemplateCommand;
7
+ (function (UpdateSubscriptionTemplateCommand) {
8
+ UpdateSubscriptionTemplateCommand.url = api_1.REST_API.SUBSCRIPTION_TEMPLATE.UPDATE_TEMPLATE;
9
+ UpdateSubscriptionTemplateCommand.TSQ_url = UpdateSubscriptionTemplateCommand.url;
10
+ UpdateSubscriptionTemplateCommand.RequestSchema = zod_1.z.object({
11
+ subscriptionTemplateUuid: zod_1.z.string().uuid(),
12
+ templateJson: zod_1.z.optional(zod_1.z.object({}).passthrough()),
13
+ encodedTemplateYaml: zod_1.z.optional(zod_1.z.string()),
14
+ });
15
+ UpdateSubscriptionTemplateCommand.ResponseSchema = zod_1.z.object({
16
+ response: zod_1.z.object({
17
+ templateJson: zod_1.z.nullable(zod_1.z.unknown()),
18
+ encodedTemplateYaml: zod_1.z.nullable(zod_1.z.string()),
19
+ }),
20
+ });
21
+ })(UpdateSubscriptionTemplateCommand || (exports.UpdateSubscriptionTemplateCommand = UpdateSubscriptionTemplateCommand = {}));
@@ -4,6 +4,7 @@ export * from './hosts';
4
4
  export * from './metrics';
5
5
  export * from './nodes';
6
6
  export * from './roles';
7
+ export * from './subscription-template';
7
8
  export * from './templates';
8
9
  export * from './users';
9
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"}
@@ -20,5 +20,6 @@ __exportStar(require("./hosts"), exports);
20
20
  __exportStar(require("./metrics"), exports);
21
21
  __exportStar(require("./nodes"), exports);
22
22
  __exportStar(require("./roles"), exports);
23
+ __exportStar(require("./subscription-template"), exports);
23
24
  __exportStar(require("./templates"), exports);
24
25
  __exportStar(require("./users"), exports);
@@ -0,0 +1,3 @@
1
+ export * from './subscription-type';
2
+ export * from './template-type';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../constants/subscription-template/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,18 @@
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("./subscription-type"), exports);
18
+ __exportStar(require("./template-type"), exports);
@@ -0,0 +1,2 @@
1
+ export * from './subscription-type.constant';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../constants/subscription-template/subscription-type/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,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("./subscription-type.constant"), exports);
@@ -0,0 +1,10 @@
1
+ export declare const SUBSCRIPTION_TYPE: {
2
+ readonly CLASH: "clash";
3
+ readonly STASH: "stash";
4
+ readonly SINGBOX: "singbox";
5
+ readonly SINGBOX_LEGACY: "singbox_legacy";
6
+ readonly MIHOMO: "mihomo";
7
+ };
8
+ export type TSubscriptionType = [keyof typeof SUBSCRIPTION_TYPE][number];
9
+ export declare const SUBSCRIPTION_TYPE_VALUES: ("clash" | "stash" | "singbox" | "singbox_legacy" | "mihomo")[];
10
+ //# sourceMappingURL=subscription-type.constant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscription-type.constant.d.ts","sourceRoot":"","sources":["../../../../../constants/subscription-template/subscription-type/subscription-type.constant.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB;;;;;;CAMpB,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AACzE,eAAO,MAAM,wBAAwB,iEAAmC,CAAC"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SUBSCRIPTION_TYPE_VALUES = exports.SUBSCRIPTION_TYPE = void 0;
4
+ exports.SUBSCRIPTION_TYPE = {
5
+ CLASH: 'clash',
6
+ STASH: 'stash',
7
+ SINGBOX: 'singbox',
8
+ SINGBOX_LEGACY: 'singbox_legacy',
9
+ MIHOMO: 'mihomo',
10
+ };
11
+ exports.SUBSCRIPTION_TYPE_VALUES = Object.values(exports.SUBSCRIPTION_TYPE);
@@ -0,0 +1,2 @@
1
+ export * from './template-type.constant';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../constants/subscription-template/template-type/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,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("./template-type.constant"), exports);
@@ -0,0 +1,7 @@
1
+ export declare const SUBSCRIPTION_TEMPLATE_TYPE: {
2
+ readonly YAML: "yaml";
3
+ readonly JSON: "json";
4
+ };
5
+ export type TSubscriptionTemplateType = [keyof typeof SUBSCRIPTION_TEMPLATE_TYPE][number];
6
+ export declare const SUBSCRIPTION_TEMPLATE_TYPE_VALUES: ("yaml" | "json")[];
7
+ //# sourceMappingURL=template-type.constant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template-type.constant.d.ts","sourceRoot":"","sources":["../../../../../constants/subscription-template/template-type/template-type.constant.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,0BAA0B;;;CAG7B,CAAC;AAEX,MAAM,MAAM,yBAAyB,GAAG,CAAC,MAAM,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;AAC1F,eAAO,MAAM,iCAAiC,qBAA4C,CAAC"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SUBSCRIPTION_TEMPLATE_TYPE_VALUES = exports.SUBSCRIPTION_TEMPLATE_TYPE = void 0;
4
+ exports.SUBSCRIPTION_TEMPLATE_TYPE = {
5
+ YAML: 'yaml',
6
+ JSON: 'json',
7
+ };
8
+ exports.SUBSCRIPTION_TEMPLATE_TYPE_VALUES = Object.values(exports.SUBSCRIPTION_TEMPLATE_TYPE);
@@ -21,6 +21,7 @@ __exportStar(require("./inbounds"), exports);
21
21
  __exportStar(require("./keygen"), exports);
22
22
  __exportStar(require("./nodes"), exports);
23
23
  __exportStar(require("./subscription"), exports);
24
+ __exportStar(require("./subscription-template"), exports);
24
25
  __exportStar(require("./system"), exports);
25
26
  __exportStar(require("./users"), exports);
26
27
  __exportStar(require("./xray"), exports);
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SUBSCRIPTION_TEMPLATE_ROUTES = exports.SUBSCRIPTION_TEMPLATE_CONTROLLER = void 0;
4
+ exports.SUBSCRIPTION_TEMPLATE_CONTROLLER = 'subscription-templates';
5
+ exports.SUBSCRIPTION_TEMPLATE_ROUTES = {
6
+ GET_TEMPLATE: 'get-template',
7
+ UPDATE_TEMPLATE: 'update-template',
8
+ };
@@ -110,4 +110,8 @@ exports.REST_API = {
110
110
  BANDWIDTH: `${exports.ROOT}/${CONTROLLERS.SYSTEM_CONTROLLER}/${CONTROLLERS.SYSTEM_ROUTES.BANDWIDTH}`,
111
111
  NODES_STATISTIC: `${exports.ROOT}/${CONTROLLERS.SYSTEM_CONTROLLER}/${CONTROLLERS.SYSTEM_ROUTES.STATISTIC.NODES}`,
112
112
  },
113
+ SUBSCRIPTION_TEMPLATE: {
114
+ GET_INFO: (subscriptionType) => `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_TEMPLATE_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_TEMPLATE_ROUTES.GET_TEMPLATE}/${subscriptionType}`,
115
+ UPDATE_TEMPLATE: `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_TEMPLATE_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_TEMPLATE_ROUTES.UPDATE_TEMPLATE}`,
116
+ },
113
117
  };
@@ -21,6 +21,7 @@ __exportStar(require("./inbounds"), exports);
21
21
  __exportStar(require("./keygen"), exports);
22
22
  __exportStar(require("./nodes"), exports);
23
23
  __exportStar(require("./subscription"), exports);
24
+ __exportStar(require("./subscription-template"), exports);
24
25
  __exportStar(require("./system"), exports);
25
26
  __exportStar(require("./users"), exports);
26
27
  __exportStar(require("./xray"), exports);
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetSubscriptionTemplateCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const constants_1 = require("../../constants");
6
+ const api_1 = require("../../api");
7
+ var GetSubscriptionTemplateCommand;
8
+ (function (GetSubscriptionTemplateCommand) {
9
+ GetSubscriptionTemplateCommand.url = api_1.REST_API.SUBSCRIPTION_TEMPLATE.GET_INFO;
10
+ GetSubscriptionTemplateCommand.TSQ_url = GetSubscriptionTemplateCommand.url;
11
+ GetSubscriptionTemplateCommand.RequestSchema = zod_1.z.object({
12
+ subscriptionType: zod_1.z.nativeEnum(constants_1.SUBSCRIPTION_TYPE),
13
+ });
14
+ GetSubscriptionTemplateCommand.ResponseSchema = zod_1.z.object({
15
+ response: zod_1.z.object({
16
+ templateJson: zod_1.z.nullable(zod_1.z.unknown()),
17
+ encodedTemplateYaml: zod_1.z.nullable(zod_1.z.string()),
18
+ }),
19
+ });
20
+ })(GetSubscriptionTemplateCommand || (exports.GetSubscriptionTemplateCommand = GetSubscriptionTemplateCommand = {}));
@@ -0,0 +1,18 @@
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("./get-template.command"), exports);
18
+ __exportStar(require("./update-template.command"), exports);
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdateSubscriptionTemplateCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../api");
6
+ var UpdateSubscriptionTemplateCommand;
7
+ (function (UpdateSubscriptionTemplateCommand) {
8
+ UpdateSubscriptionTemplateCommand.url = api_1.REST_API.SUBSCRIPTION_TEMPLATE.UPDATE_TEMPLATE;
9
+ UpdateSubscriptionTemplateCommand.TSQ_url = UpdateSubscriptionTemplateCommand.url;
10
+ UpdateSubscriptionTemplateCommand.RequestSchema = zod_1.z.object({
11
+ subscriptionTemplateUuid: zod_1.z.string().uuid(),
12
+ templateJson: zod_1.z.optional(zod_1.z.object({}).passthrough()),
13
+ encodedTemplateYaml: zod_1.z.optional(zod_1.z.string()),
14
+ });
15
+ UpdateSubscriptionTemplateCommand.ResponseSchema = zod_1.z.object({
16
+ response: zod_1.z.object({
17
+ templateJson: zod_1.z.nullable(zod_1.z.unknown()),
18
+ encodedTemplateYaml: zod_1.z.nullable(zod_1.z.string()),
19
+ }),
20
+ });
21
+ })(UpdateSubscriptionTemplateCommand || (exports.UpdateSubscriptionTemplateCommand = UpdateSubscriptionTemplateCommand = {}));
@@ -20,5 +20,6 @@ __exportStar(require("./hosts"), exports);
20
20
  __exportStar(require("./metrics"), exports);
21
21
  __exportStar(require("./nodes"), exports);
22
22
  __exportStar(require("./roles"), exports);
23
+ __exportStar(require("./subscription-template"), exports);
23
24
  __exportStar(require("./templates"), exports);
24
25
  __exportStar(require("./users"), exports);
@@ -0,0 +1,18 @@
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("./subscription-type"), exports);
18
+ __exportStar(require("./template-type"), exports);
@@ -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("./subscription-type.constant"), exports);
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SUBSCRIPTION_TYPE_VALUES = exports.SUBSCRIPTION_TYPE = void 0;
4
+ exports.SUBSCRIPTION_TYPE = {
5
+ CLASH: 'clash',
6
+ STASH: 'stash',
7
+ SINGBOX: 'singbox',
8
+ SINGBOX_LEGACY: 'singbox_legacy',
9
+ MIHOMO: 'mihomo',
10
+ };
11
+ exports.SUBSCRIPTION_TYPE_VALUES = Object.values(exports.SUBSCRIPTION_TYPE);
@@ -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("./template-type.constant"), exports);
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SUBSCRIPTION_TEMPLATE_TYPE_VALUES = exports.SUBSCRIPTION_TEMPLATE_TYPE = void 0;
4
+ exports.SUBSCRIPTION_TEMPLATE_TYPE = {
5
+ YAML: 'yaml',
6
+ JSON: 'json',
7
+ };
8
+ exports.SUBSCRIPTION_TEMPLATE_TYPE_VALUES = Object.values(exports.SUBSCRIPTION_TEMPLATE_TYPE);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnawave/backend-contract",
3
- "version": "0.2.7",
3
+ "version": "0.3.0",
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.",