Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@remnawave/backend-contract

Package Overview
Dependencies
Maintainers
0
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@remnawave/backend-contract - npm Package Compare versions

Comparing version 0.0.49 to 0.0.50

14

build/commands/nodes/update.command.js

@@ -13,4 +13,3 @@ "use strict";

uuid: true,
})
.extend({
}).extend({
name: zod_1.z.optional(zod_1.z.string().min(5, 'Min. 5 characters')),

@@ -29,13 +28,2 @@ address: zod_1.z.optional(zod_1.z.string().min(2, 'Min. 2 characters')),

.max(31, 'Traffic reset day must be less than 31')),
})
.refine((data) => {
if (data.isTrafficTrackingActive) {
return (data.trafficLimitBytes != null &&
data.notifyPercent != null &&
data.trafficResetDay != null);
}
return true;
}, {
message: 'Traffic tracking fields are required when isTrafficTrackingActive is true',
path: ['trafficLimitBytes', 'notifyPercent', 'trafficResetDay'],
});

@@ -42,0 +30,0 @@ UpdateNodeCommand.ResponseSchema = zod_1.z.object({

58

commands/nodes/update.command.ts

@@ -11,41 +11,21 @@ import { z } from 'zod';

uuid: true,
})
.extend({
name: z.optional(z.string().min(5, 'Min. 5 characters')),
address: z.optional(z.string().min(2, 'Min. 2 characters')),
port: z.optional(z.number()),
isTrafficTrackingActive: z.optional(z.boolean()),
trafficLimitBytes: z.optional(
z.number().min(0, 'Traffic limit must be greater than 0'),
),
notifyPercent: z.optional(
z
.number()
.min(0, 'Notify percent must be greater than 0')
.max(100, 'Notify percent must be less than 100'),
),
trafficResetDay: z.optional(
z
.number()
.min(1, 'Traffic reset day must be greater than 0')
.max(31, 'Traffic reset day must be less than 31'),
),
})
.refine(
(data) => {
if (data.isTrafficTrackingActive) {
return (
data.trafficLimitBytes != null &&
data.notifyPercent != null &&
data.trafficResetDay != null
);
}
return true;
},
{
message:
'Traffic tracking fields are required when isTrafficTrackingActive is true',
path: ['trafficLimitBytes', 'notifyPercent', 'trafficResetDay'],
},
);
}).extend({
name: z.optional(z.string().min(5, 'Min. 5 characters')),
address: z.optional(z.string().min(2, 'Min. 2 characters')),
port: z.optional(z.number()),
isTrafficTrackingActive: z.optional(z.boolean()),
trafficLimitBytes: z.optional(z.number().min(0, 'Traffic limit must be greater than 0')),
notifyPercent: z.optional(
z
.number()
.min(0, 'Notify percent must be greater than 0')
.max(100, 'Notify percent must be less than 100'),
),
trafficResetDay: z.optional(
z
.number()
.min(1, 'Traffic reset day must be greater than 0')
.max(31, 'Traffic reset day must be less than 31'),
),
});

@@ -52,0 +32,0 @@ export type Request = z.infer<typeof RequestSchema>;

{
"name": "@remnawave/backend-contract",
"version": "0.0.49",
"version": "0.0.50",
"description": "A contract library for Remnawave",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc