@remnawave/backend-contract 0.0.84 → 0.0.85

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.
@@ -40,16 +40,16 @@ export declare namespace UpdateUserCommand {
40
40
  }, "uuid">, {
41
41
  status: z.ZodOptional<z.ZodDefault<z.ZodEnum<["DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE", ...("DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE")[]]>>>;
42
42
  trafficLimitBytes: z.ZodOptional<z.ZodNumber>;
43
- trafficLimitStrategy: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodDefault<z.ZodEnum<["MONTH" | "YEAR" | "NO_RESET" | "DAY" | "WEEK" | "CALENDAR_MONTH", ...("MONTH" | "YEAR" | "NO_RESET" | "DAY" | "WEEK" | "CALENDAR_MONTH")[]]>>>>, "MONTH" | "YEAR" | "NO_RESET" | "DAY" | "WEEK" | "CALENDAR_MONTH", "MONTH" | "YEAR" | "NO_RESET" | "DAY" | "WEEK" | "CALENDAR_MONTH" | undefined>;
43
+ trafficLimitStrategy: z.ZodOptional<z.ZodEffects<z.ZodDefault<z.ZodEnum<["MONTH" | "YEAR" | "NO_RESET" | "DAY" | "WEEK" | "CALENDAR_MONTH", ...("MONTH" | "YEAR" | "NO_RESET" | "DAY" | "WEEK" | "CALENDAR_MONTH")[]]>>, "MONTH" | "YEAR" | "NO_RESET" | "DAY" | "WEEK" | "CALENDAR_MONTH", "MONTH" | "YEAR" | "NO_RESET" | "DAY" | "WEEK" | "CALENDAR_MONTH" | undefined>>;
44
44
  activeUserInbounds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
45
45
  expireAt: z.ZodOptional<z.ZodEffects<z.ZodDate, Date, Date>>;
46
46
  description: z.ZodOptional<z.ZodString>;
47
47
  }>, "strip", z.ZodTypeAny, {
48
48
  uuid: string;
49
- trafficLimitStrategy: "MONTH" | "YEAR" | "NO_RESET" | "DAY" | "WEEK" | "CALENDAR_MONTH";
50
49
  status?: "DISABLED" | "LIMITED" | "EXPIRED" | "ACTIVE" | undefined;
51
50
  trafficLimitBytes?: number | undefined;
52
51
  description?: string | undefined;
52
+ trafficLimitStrategy?: "MONTH" | "YEAR" | "NO_RESET" | "DAY" | "WEEK" | "CALENDAR_MONTH" | undefined;
53
53
  expireAt?: Date | undefined;
54
54
  activeUserInbounds?: string[] | undefined;
55
55
  }, {
@@ -23,8 +23,6 @@ var UpdateUserCommand;
23
23
  .optional(),
24
24
  trafficLimitStrategy: models_1.UsersSchema.shape.trafficLimitStrategy
25
25
  .describe('Traffic limit reset strategy')
26
- .optional()
27
- .default(constants_1.RESET_PERIODS.NO_RESET)
28
26
  .superRefine((val, ctx) => {
29
27
  if (val && !Object.values(constants_1.RESET_PERIODS).includes(val)) {
30
28
  ctx.addIssue({
@@ -35,7 +33,8 @@ var UpdateUserCommand;
35
33
  options: Object.values(constants_1.RESET_PERIODS),
36
34
  });
37
35
  }
38
- }),
36
+ })
37
+ .optional(),
39
38
  activeUserInbounds: zod_1.z
40
39
  .array(zod_1.z.string().uuid(), {
41
40
  invalid_type_error: 'Enabled inbounds must be an array of UUIDs',
@@ -49,6 +48,7 @@ var UpdateUserCommand;
49
48
  .refine((date) => date > new Date(), {
50
49
  message: 'Expiration date cannot be in the past',
51
50
  })
51
+ .describe('Expiration date: 2025-01-17T15:38:45.065Z')
52
52
  .optional(),
53
53
  description: zod_1.z.string().optional(),
54
54
  });
@@ -5,4 +5,5 @@ export * from './nodes';
5
5
  export * from './roles';
6
6
  export * from './templates';
7
7
  export * from './users';
8
+ export * from './metrics';
8
9
  //# 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,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,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC"}
@@ -21,3 +21,4 @@ __exportStar(require("./nodes"), exports);
21
21
  __exportStar(require("./roles"), exports);
22
22
  __exportStar(require("./templates"), exports);
23
23
  __exportStar(require("./users"), exports);
24
+ __exportStar(require("./metrics"), exports);
@@ -0,0 +1,2 @@
1
+ export * from './metric-names.constant';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../constants/metrics/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,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("./metric-names.constant"), exports);
@@ -0,0 +1,9 @@
1
+ export declare const METRIC_NAMES: {
2
+ readonly NODE_ONLINE_USERS: "node_online_users";
3
+ readonly NODE_STATUS: "node_status";
4
+ readonly USERS_STATUS: "users_status";
5
+ readonly USERS_TOTAL: "users_total";
6
+ };
7
+ export type TMetricNames = typeof METRIC_NAMES;
8
+ export type TMetricNamesKeys = (typeof METRIC_NAMES)[keyof typeof METRIC_NAMES];
9
+ //# sourceMappingURL=metric-names.constant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metric-names.constant.d.ts","sourceRoot":"","sources":["../../../../constants/metrics/metric-names.constant.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY;;;;;CAKf,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,CAAC;AAC/C,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.METRIC_NAMES = void 0;
4
+ exports.METRIC_NAMES = {
5
+ NODE_ONLINE_USERS: 'node_online_users',
6
+ NODE_STATUS: 'node_status',
7
+ USERS_STATUS: 'users_status',
8
+ USERS_TOTAL: 'users_total',
9
+ };
@@ -23,8 +23,6 @@ var UpdateUserCommand;
23
23
  .optional(),
24
24
  trafficLimitStrategy: models_1.UsersSchema.shape.trafficLimitStrategy
25
25
  .describe('Traffic limit reset strategy')
26
- .optional()
27
- .default(constants_1.RESET_PERIODS.NO_RESET)
28
26
  .superRefine((val, ctx) => {
29
27
  if (val && !Object.values(constants_1.RESET_PERIODS).includes(val)) {
30
28
  ctx.addIssue({
@@ -35,7 +33,8 @@ var UpdateUserCommand;
35
33
  options: Object.values(constants_1.RESET_PERIODS),
36
34
  });
37
35
  }
38
- }),
36
+ })
37
+ .optional(),
39
38
  activeUserInbounds: zod_1.z
40
39
  .array(zod_1.z.string().uuid(), {
41
40
  invalid_type_error: 'Enabled inbounds must be an array of UUIDs',
@@ -49,6 +48,7 @@ var UpdateUserCommand;
49
48
  .refine((date) => date > new Date(), {
50
49
  message: 'Expiration date cannot be in the past',
51
50
  })
51
+ .describe('Expiration date: 2025-01-17T15:38:45.065Z')
52
52
  .optional(),
53
53
  description: zod_1.z.string().optional(),
54
54
  });
@@ -21,3 +21,4 @@ __exportStar(require("./nodes"), exports);
21
21
  __exportStar(require("./roles"), exports);
22
22
  __exportStar(require("./templates"), exports);
23
23
  __exportStar(require("./users"), exports);
24
+ __exportStar(require("./metrics"), 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("./metric-names.constant"), exports);
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.METRIC_NAMES = void 0;
4
+ exports.METRIC_NAMES = {
5
+ NODE_ONLINE_USERS: 'node_online_users',
6
+ NODE_STATUS: 'node_status',
7
+ USERS_STATUS: 'users_status',
8
+ USERS_TOTAL: 'users_total',
9
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnawave/backend-contract",
3
- "version": "0.0.84",
3
+ "version": "0.0.85",
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.",