@remnawave/backend-contract 3.4.13 → 3.4.15

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.
@@ -8,6 +8,7 @@ export declare const HOSTS_ROUTES: {
8
8
  readonly DELETE: (uuid: string) => string;
9
9
  readonly ACTIONS: {
10
10
  readonly REORDER: "actions/reorder";
11
+ readonly CLONE: "actions/clone";
11
12
  };
12
13
  readonly BULK: {
13
14
  readonly ENABLE_HOSTS: "bulk/enable";
@@ -1 +1 @@
1
- {"version":3,"file":"hosts.d.ts","sourceRoot":"","sources":["../../../../api/controllers/hosts.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,EAAG,OAAgB,CAAC;AAEjD,eAAO,MAAM,kBAAkB,EAAG,SAAkB,CAAC;AAErD,eAAO,MAAM,YAAY;;;;iCAID,MAAM;4BACX,MAAM;;;;;;;;;;;;;CAgBf,CAAC"}
1
+ {"version":3,"file":"hosts.d.ts","sourceRoot":"","sources":["../../../../api/controllers/hosts.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,EAAG,OAAgB,CAAC;AAEjD,eAAO,MAAM,kBAAkB,EAAG,SAAkB,CAAC;AAErD,eAAO,MAAM,YAAY;;;;iCAID,MAAM;4BACX,MAAM;;;;;;;;;;;;;;CAiBf,CAAC"}
@@ -11,6 +11,7 @@ exports.HOSTS_ROUTES = {
11
11
  DELETE: (uuid) => `${uuid}`, // delete by UUID
12
12
  ACTIONS: {
13
13
  REORDER: `${exports.HOST_ACTIONS_ROUTE}/reorder`,
14
+ CLONE: `${exports.HOST_ACTIONS_ROUTE}/clone`,
14
15
  },
15
16
  BULK: {
16
17
  ENABLE_HOSTS: 'bulk/enable',
@@ -111,6 +111,7 @@ export declare const REST_API: {
111
111
  readonly DELETE: (uuid: string) => string;
112
112
  readonly ACTIONS: {
113
113
  readonly REORDER: "/api/hosts/actions/reorder";
114
+ readonly CLONE: "/api/hosts/actions/clone";
114
115
  };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,
149
149
  ACTIONS: {
150
150
  REORDER: `${exports.ROOT}/${CONTROLLERS.HOSTS_CONTROLLER}/${CONTROLLERS.HOSTS_ROUTES.ACTIONS.REORDER}`,
151
+ CLONE: `${exports.ROOT}/${CONTROLLERS.HOSTS_CONTROLLER}/${CONTROLLERS.HOSTS_ROUTES.ACTIONS.CLONE}`,
151
152
  },
152
153
  BULK: {
153
154
  ENABLE_HOSTS: `${exports.ROOT}/${CONTROLLERS.HOSTS_CONTROLLER}/${CONTROLLERS.HOSTS_ROUTES.BULK.ENABLE_HOSTS}`,
@@ -0,0 +1,131 @@
1
+ import { z } from 'zod';
2
+ export declare namespace CloneHostCommand {
3
+ const url: "/api/hosts/actions/clone";
4
+ const TSQ_url: "/api/hosts/actions/clone";
5
+ const endpointDetails: import("../../constants").EndpointDetails;
6
+ const RequestBodySchema: z.ZodObject<{
7
+ cloneFromUuid: z.ZodUUID;
8
+ }, z.core.$strip>;
9
+ const ResponseSchema: z.ZodObject<{
10
+ response: z.ZodObject<{
11
+ uuid: z.ZodUUID;
12
+ viewPosition: z.ZodInt;
13
+ remark: z.ZodString;
14
+ address: z.ZodString;
15
+ port: z.ZodInt;
16
+ path: z.ZodNullable<z.ZodString>;
17
+ sni: z.ZodNullable<z.ZodString>;
18
+ host: z.ZodNullable<z.ZodString>;
19
+ alpn: z.ZodNullable<z.ZodEnum<{
20
+ readonly H3: "h3";
21
+ readonly H2: "h2";
22
+ readonly HTTP_1_1: "http/1.1";
23
+ readonly H_COMBINED: "h2,http/1.1";
24
+ readonly H3_H2_H1_COMBINED: "h3,h2,http/1.1";
25
+ readonly H3_H2_COMBINED: "h3,h2";
26
+ }>>;
27
+ fingerprint: z.ZodNullable<z.ZodString>;
28
+ isDisabled: z.ZodBoolean;
29
+ securityLayer: z.ZodDefault<z.ZodEnum<{
30
+ readonly DEFAULT: "DEFAULT";
31
+ readonly TLS: "TLS";
32
+ readonly NONE: "NONE";
33
+ }>>;
34
+ xhttpExtraParams: z.ZodNullable<z.ZodUnknown>;
35
+ muxParams: z.ZodNullable<z.ZodUnknown>;
36
+ sockoptParams: z.ZodNullable<z.ZodUnknown>;
37
+ finalMask: z.ZodNullable<z.ZodUnknown>;
38
+ inbound: z.ZodObject<{
39
+ configProfileUuid: z.ZodNullable<z.ZodUUID>;
40
+ configProfileInboundUuid: z.ZodNullable<z.ZodUUID>;
41
+ }, z.core.$strip>;
42
+ serverDescription: z.ZodNullable<z.ZodString>;
43
+ tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
44
+ isHidden: z.ZodDefault<z.ZodBoolean>;
45
+ overrideSniFromAddress: z.ZodDefault<z.ZodBoolean>;
46
+ keepSniBlank: z.ZodDefault<z.ZodBoolean>;
47
+ vlessRouteId: z.ZodNullable<z.ZodInt>;
48
+ pinnedPeerCertSha256: z.ZodNullable<z.ZodString>;
49
+ verifyPeerCertByName: z.ZodNullable<z.ZodString>;
50
+ shuffleHost: z.ZodBoolean;
51
+ mihomoX25519: z.ZodBoolean;
52
+ mihomoIpVersion: z.ZodNullable<z.ZodEnum<{
53
+ readonly DUAL: "dual";
54
+ readonly IPV4: "ipv4";
55
+ readonly IPV6: "ipv6";
56
+ readonly IPV4_PREFER: "ipv4-prefer";
57
+ readonly IPV6_PREFER: "ipv6-prefer";
58
+ }>>;
59
+ nodes: z.ZodArray<z.ZodUUID>;
60
+ xrayJsonTemplateUuid: z.ZodNullable<z.ZodUUID>;
61
+ excludeFromSubscriptionTypes: z.ZodArray<z.ZodEnum<{
62
+ readonly XRAY_JSON: "XRAY_JSON";
63
+ readonly XRAY_BASE64: "XRAY_BASE64";
64
+ readonly MIHOMO: "MIHOMO";
65
+ readonly STASH: "STASH";
66
+ readonly CLASH: "CLASH";
67
+ readonly SINGBOX: "SINGBOX";
68
+ }>>;
69
+ mapper: z.ZodObject<{
70
+ xrayJson: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
71
+ op: z.ZodLiteral<"copy">;
72
+ from: z.ZodString;
73
+ to: z.ZodString;
74
+ }, z.core.$strip>, z.ZodObject<{
75
+ op: z.ZodLiteral<"set">;
76
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodJSONSchema>, z.ZodRecord<z.ZodString, z.ZodJSONSchema>]>;
77
+ to: z.ZodString;
78
+ }, z.core.$strip>, z.ZodObject<{
79
+ op: z.ZodLiteral<"unset">;
80
+ to: z.ZodString;
81
+ }, z.core.$strip>], "op">>>;
82
+ mihomo: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
83
+ op: z.ZodLiteral<"copy">;
84
+ from: z.ZodString;
85
+ to: z.ZodString;
86
+ }, z.core.$strip>, z.ZodObject<{
87
+ op: z.ZodLiteral<"set">;
88
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodJSONSchema>, z.ZodRecord<z.ZodString, z.ZodJSONSchema>]>;
89
+ to: z.ZodString;
90
+ }, z.core.$strip>, z.ZodObject<{
91
+ op: z.ZodLiteral<"unset">;
92
+ to: z.ZodString;
93
+ }, z.core.$strip>], "op">>>;
94
+ base64: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
95
+ op: z.ZodLiteral<"copy">;
96
+ from: z.ZodString;
97
+ to: z.ZodString;
98
+ }, z.core.$strip>, z.ZodObject<{
99
+ op: z.ZodLiteral<"set">;
100
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodJSONSchema>, z.ZodRecord<z.ZodString, z.ZodJSONSchema>]>;
101
+ to: z.ZodString;
102
+ }, z.core.$strip>, z.ZodObject<{
103
+ op: z.ZodLiteral<"unset">;
104
+ to: z.ZodString;
105
+ }, z.core.$strip>], "op">>>;
106
+ singbox: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
107
+ op: z.ZodLiteral<"copy">;
108
+ from: z.ZodString;
109
+ to: z.ZodString;
110
+ }, z.core.$strip>, z.ZodObject<{
111
+ op: z.ZodLiteral<"set">;
112
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodJSONSchema>, z.ZodRecord<z.ZodString, z.ZodJSONSchema>]>;
113
+ to: z.ZodString;
114
+ }, z.core.$strip>, z.ZodObject<{
115
+ op: z.ZodLiteral<"unset">;
116
+ to: z.ZodString;
117
+ }, z.core.$strip>], "op">>>;
118
+ }, z.core.$strip>;
119
+ internalSquads: z.ZodObject<{
120
+ mode: z.ZodEnum<{
121
+ readonly EXCLUDE: "EXCLUDE";
122
+ readonly ALLOW_ONLY: "ALLOW_ONLY";
123
+ }>;
124
+ squads: z.ZodArray<z.ZodUUID>;
125
+ }, z.core.$strip>;
126
+ }, z.core.$strip>;
127
+ }, z.core.$strip>;
128
+ type RequestBody = z.infer<typeof RequestBodySchema>;
129
+ type Response = z.infer<typeof ResponseSchema>;
130
+ }
131
+ //# sourceMappingURL=clone.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clone.command.d.ts","sourceRoot":"","sources":["../../../../commands/hosts/clone.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,yBAAiB,gBAAgB,CAAC;IACvB,MAAM,GAAG,4BAA+B,CAAC;IACzC,MAAM,OAAO,4BAAM,CAAC;IAEpB,MAAM,eAAe,2CAK3B,CAAC;IAEK,MAAM,iBAAiB;;qBAE5B,CAAC;IAEI,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAqB,CAAC;IAEjD,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,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CloneHostCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../api");
6
+ const constants_1 = require("../../constants");
7
+ const host_response_1 = require("./host.response");
8
+ var CloneHostCommand;
9
+ (function (CloneHostCommand) {
10
+ CloneHostCommand.url = api_1.REST_API.HOSTS.ACTIONS.CLONE;
11
+ CloneHostCommand.TSQ_url = CloneHostCommand.url;
12
+ CloneHostCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.HOSTS_ROUTES.ACTIONS.CLONE, 'post', 'Clone host', { scope: 'clone', kind: 'write' });
13
+ CloneHostCommand.RequestBodySchema = zod_1.z.object({
14
+ cloneFromUuid: zod_1.z.uuid(),
15
+ });
16
+ CloneHostCommand.ResponseSchema = host_response_1.HostResponseSchema;
17
+ })(CloneHostCommand || (exports.CloneHostCommand = CloneHostCommand = {}));
@@ -1,4 +1,5 @@
1
1
  export * from './bulk';
2
+ export * from './clone.command';
2
3
  export * from './create.command';
3
4
  export * from './delete.command';
4
5
  export * from './get-hosts.command';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../commands/hosts/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../commands/hosts/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC"}
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./bulk"), exports);
18
+ __exportStar(require("./clone.command"), exports);
18
19
  __exportStar(require("./create.command"), exports);
19
20
  __exportStar(require("./delete.command"), exports);
20
21
  __exportStar(require("./get-hosts.command"), exports);
@@ -1319,5 +1319,10 @@ export declare const ERRORS: {
1319
1319
  readonly message: "Set tags error";
1320
1320
  readonly httpCode: 500;
1321
1321
  };
1322
+ readonly CLONE_HOST_ERROR: {
1323
+ readonly code: "A258";
1324
+ readonly message: "Clone host error";
1325
+ readonly httpCode: 500;
1326
+ };
1322
1327
  };
1323
1328
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../constants/errors/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAwJY,MAAM;;;;;;;;;;wCAUN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCA4IN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAsqBN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCA6HN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAkDN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCA8GN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+B3B,CAAC"}
@@ -1290,4 +1290,9 @@ exports.ERRORS = {
1290
1290
  message: 'Set tags error',
1291
1291
  httpCode: 500,
1292
1292
  },
1293
+ CLONE_HOST_ERROR: {
1294
+ code: 'A258',
1295
+ message: 'Clone host error',
1296
+ httpCode: 500,
1297
+ },
1293
1298
  };
@@ -1,3 +1,3 @@
1
- export declare const TEMPLATE_KEYS: readonly ["DAYS_LEFT", "TRAFFIC_USED", "TRAFFIC_LEFT", "STATUS", "TOTAL_TRAFFIC", "USERNAME", "EMAIL", "TELEGRAM_ID", "SUBSCRIPTION_URL", "TAG", "EXPIRE_UNIX", "SHORT_UUID", "ID", "TRAFFIC_USED_BYTES", "TRAFFIC_LEFT_BYTES", "TOTAL_TRAFFIC_BYTES", "RESET_STRATEGY", "LIFETIME_USED_BYTES", "CREATED_AT_UNIX", "LAST_TRAFFIC_RESET_AT_UNIX", "SS_HWID_LIMIT", "DESCRIPTION"];
1
+ export declare const TEMPLATE_KEYS: readonly ["DAYS_LEFT", "TRAFFIC_USED", "TRAFFIC_LEFT", "STATUS", "TOTAL_TRAFFIC", "USERNAME", "EMAIL", "TELEGRAM_ID", "SUBSCRIPTION_URL", "TAG", "EXPIRE_UNIX", "SHORT_UUID", "ID", "TRAFFIC_USED_BYTES", "TRAFFIC_LEFT_BYTES", "TOTAL_TRAFFIC_BYTES", "RESET_STRATEGY", "LIFETIME_USED_BYTES", "CREATED_AT_UNIX", "LAST_TRAFFIC_RESET_AT_UNIX", "LAST_TRAFFIC_RESET_AT", "NEXT_TRAFFIC_RESET_AT_UNIX", "NEXT_TRAFFIC_RESET_AT", "SS_HWID_LIMIT", "DESCRIPTION"];
2
2
  export type TemplateKeys = (typeof TEMPLATE_KEYS)[number];
3
3
  //# sourceMappingURL=template-keys.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"template-keys.d.ts","sourceRoot":"","sources":["../../../../constants/templates/template-keys.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,kXAuBhB,CAAC;AACX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC"}
1
+ {"version":3,"file":"template-keys.d.ts","sourceRoot":"","sources":["../../../../constants/templates/template-keys.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,kcA0BhB,CAAC;AACX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC"}
@@ -22,6 +22,9 @@ exports.TEMPLATE_KEYS = [
22
22
  'LIFETIME_USED_BYTES',
23
23
  'CREATED_AT_UNIX',
24
24
  'LAST_TRAFFIC_RESET_AT_UNIX',
25
+ 'LAST_TRAFFIC_RESET_AT',
26
+ 'NEXT_TRAFFIC_RESET_AT_UNIX',
27
+ 'NEXT_TRAFFIC_RESET_AT',
25
28
  'SS_HWID_LIMIT',
26
29
  'DESCRIPTION',
27
30
  ];
@@ -11,6 +11,7 @@ exports.HOSTS_ROUTES = {
11
11
  DELETE: (uuid) => `${uuid}`, // delete by UUID
12
12
  ACTIONS: {
13
13
  REORDER: `${exports.HOST_ACTIONS_ROUTE}/reorder`,
14
+ CLONE: `${exports.HOST_ACTIONS_ROUTE}/clone`,
14
15
  },
15
16
  BULK: {
16
17
  ENABLE_HOSTS: 'bulk/enable',
@@ -148,6 +148,7 @@ exports.REST_API = {
148
148
  DELETE: (uuid) => `${exports.ROOT}/${CONTROLLERS.HOSTS_CONTROLLER}/${CONTROLLERS.HOSTS_ROUTES.DELETE(uuid)}`,
149
149
  ACTIONS: {
150
150
  REORDER: `${exports.ROOT}/${CONTROLLERS.HOSTS_CONTROLLER}/${CONTROLLERS.HOSTS_ROUTES.ACTIONS.REORDER}`,
151
+ CLONE: `${exports.ROOT}/${CONTROLLERS.HOSTS_CONTROLLER}/${CONTROLLERS.HOSTS_ROUTES.ACTIONS.CLONE}`,
151
152
  },
152
153
  BULK: {
153
154
  ENABLE_HOSTS: `${exports.ROOT}/${CONTROLLERS.HOSTS_CONTROLLER}/${CONTROLLERS.HOSTS_ROUTES.BULK.ENABLE_HOSTS}`,
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CloneHostCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const api_1 = require("../../api");
6
+ const constants_1 = require("../../constants");
7
+ const host_response_1 = require("./host.response");
8
+ var CloneHostCommand;
9
+ (function (CloneHostCommand) {
10
+ CloneHostCommand.url = api_1.REST_API.HOSTS.ACTIONS.CLONE;
11
+ CloneHostCommand.TSQ_url = CloneHostCommand.url;
12
+ CloneHostCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.HOSTS_ROUTES.ACTIONS.CLONE, 'post', 'Clone host', { scope: 'clone', kind: 'write' });
13
+ CloneHostCommand.RequestBodySchema = zod_1.z.object({
14
+ cloneFromUuid: zod_1.z.uuid(),
15
+ });
16
+ CloneHostCommand.ResponseSchema = host_response_1.HostResponseSchema;
17
+ })(CloneHostCommand || (exports.CloneHostCommand = CloneHostCommand = {}));
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./bulk"), exports);
18
+ __exportStar(require("./clone.command"), exports);
18
19
  __exportStar(require("./create.command"), exports);
19
20
  __exportStar(require("./delete.command"), exports);
20
21
  __exportStar(require("./get-hosts.command"), exports);
@@ -1290,4 +1290,9 @@ exports.ERRORS = {
1290
1290
  message: 'Set tags error',
1291
1291
  httpCode: 500,
1292
1292
  },
1293
+ CLONE_HOST_ERROR: {
1294
+ code: 'A258',
1295
+ message: 'Clone host error',
1296
+ httpCode: 500,
1297
+ },
1293
1298
  };
@@ -22,6 +22,9 @@ exports.TEMPLATE_KEYS = [
22
22
  'LIFETIME_USED_BYTES',
23
23
  'CREATED_AT_UNIX',
24
24
  'LAST_TRAFFIC_RESET_AT_UNIX',
25
+ 'LAST_TRAFFIC_RESET_AT',
26
+ 'NEXT_TRAFFIC_RESET_AT_UNIX',
27
+ 'NEXT_TRAFFIC_RESET_AT',
25
28
  'SS_HWID_LIMIT',
26
29
  'DESCRIPTION',
27
30
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnawave/backend-contract",
3
- "version": "3.4.13",
3
+ "version": "3.4.15",
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",