@remnawave/backend-contract 2.6.21 → 2.6.23
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.
- package/build/backend/commands/ip-control/fetch-ips-result.command.d.ts +6 -6
- package/build/backend/commands/subscriptions/get-by/get-raw-subscription-by-short-uuid.command.d.ts +6 -6
- package/build/backend/constants/events/events.d.ts +7 -1
- package/build/backend/constants/events/events.d.ts.map +1 -1
- package/build/backend/constants/events/events.js +5 -0
- package/build/backend/models/webhook/webhook.schema.d.ts +2030 -136
- package/build/backend/models/webhook/webhook.schema.d.ts.map +1 -1
- package/build/backend/models/webhook/webhook.schema.js +45 -1
- package/build/frontend/constants/events/events.js +5 -0
- package/build/frontend/models/webhook/webhook.schema.js +45 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhook.schema.d.ts","sourceRoot":"","sources":["../../../../models/webhook/webhook.schema.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAOpB,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAarC,CAAC;AAEH,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAQtC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEjF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AACpF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AACpF,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAC1F,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AACxF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAClF,MAAM,MAAM,qCAAqC,GAAG,CAAC,CAAC,KAAK,CACvD,OAAO,qCAAqC,CAC/C,CAAC;AACF,MAAM,MAAM,oCAAoC,GAAG,CAAC,CAAC,KAAK,CACtD,OAAO,oCAAoC,CAC9C,CAAC"}
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.RemnawaveWebhookEventSchema = exports.RemnawaveWebhookCrmEvents = exports.RemnawaveWebhookErrorsEvents = exports.RemnawaveWebhookServiceEvents = exports.RemnawaveWebhookNodeEvents = exports.RemnawaveWebhookUserHwidDevicesEvents = exports.RemnawaveWebhookUserEvents = void 0;
|
|
6
|
+
exports.RemnawaveWebhookEventSchema = exports.RemnawaveWebhookTorrentBlockerEvents = exports.RemnawaveWebhookCrmEvents = exports.RemnawaveWebhookErrorsEvents = exports.RemnawaveWebhookServiceEvents = exports.RemnawaveWebhookNodeEvents = exports.RemnawaveWebhookUserHwidDevicesEvents = exports.RemnawaveWebhookUserEvents = void 0;
|
|
7
7
|
const zod_1 = __importDefault(require("zod"));
|
|
8
8
|
const constants_1 = require("../../constants");
|
|
9
9
|
const hwid_user_device_schema_1 = require("../hwid-user-device.schema");
|
|
@@ -98,6 +98,49 @@ exports.RemnawaveWebhookCrmEvents = zod_1.default.object({
|
|
|
98
98
|
loginUrl: zod_1.default.string(),
|
|
99
99
|
}),
|
|
100
100
|
});
|
|
101
|
+
exports.RemnawaveWebhookTorrentBlockerEvents = zod_1.default.object({
|
|
102
|
+
scope: zod_1.default.literal(constants_1.EVENTS_SCOPES.TORRENT_BLOCKER),
|
|
103
|
+
event: zod_1.default.enum((0, constants_1.toZodEnum)(constants_1.EVENTS.TORRENT_BLOCKER)),
|
|
104
|
+
timestamp: zod_1.default
|
|
105
|
+
.string()
|
|
106
|
+
.datetime()
|
|
107
|
+
.transform((str) => new Date(str)),
|
|
108
|
+
data: zod_1.default.object({
|
|
109
|
+
node: nodes_schema_1.NodesSchema,
|
|
110
|
+
user: extended_users_schema_1.ExtendedUsersSchema,
|
|
111
|
+
report: zod_1.default.object({
|
|
112
|
+
actionReport: zod_1.default.object({
|
|
113
|
+
blocked: zod_1.default.boolean(),
|
|
114
|
+
ip: zod_1.default.string(),
|
|
115
|
+
blockDuration: zod_1.default.number(),
|
|
116
|
+
willUnblockAt: zod_1.default
|
|
117
|
+
.string()
|
|
118
|
+
.datetime({ offset: true, local: true })
|
|
119
|
+
.transform((str) => new Date(str)),
|
|
120
|
+
userId: zod_1.default.string(),
|
|
121
|
+
processedAt: zod_1.default
|
|
122
|
+
.string()
|
|
123
|
+
.datetime({ offset: true, local: true })
|
|
124
|
+
.transform((str) => new Date(str)),
|
|
125
|
+
}),
|
|
126
|
+
xrayReport: zod_1.default.object({
|
|
127
|
+
email: zod_1.default.string().nullable(),
|
|
128
|
+
level: zod_1.default.number().nullable(),
|
|
129
|
+
protocol: zod_1.default.string().nullable(),
|
|
130
|
+
network: zod_1.default.string(),
|
|
131
|
+
source: zod_1.default.string().nullable(),
|
|
132
|
+
destination: zod_1.default.string(),
|
|
133
|
+
routeTarget: zod_1.default.string().nullable(),
|
|
134
|
+
originalTarget: zod_1.default.string().nullable(),
|
|
135
|
+
inboundTag: zod_1.default.string().nullable(),
|
|
136
|
+
inboundName: zod_1.default.string().nullable(),
|
|
137
|
+
inboundLocal: zod_1.default.string().nullable(),
|
|
138
|
+
outboundTag: zod_1.default.string().nullable(),
|
|
139
|
+
ts: zod_1.default.number(),
|
|
140
|
+
}),
|
|
141
|
+
}),
|
|
142
|
+
}),
|
|
143
|
+
});
|
|
101
144
|
exports.RemnawaveWebhookEventSchema = zod_1.default.discriminatedUnion('scope', [
|
|
102
145
|
exports.RemnawaveWebhookUserEvents,
|
|
103
146
|
exports.RemnawaveWebhookUserHwidDevicesEvents,
|
|
@@ -105,4 +148,5 @@ exports.RemnawaveWebhookEventSchema = zod_1.default.discriminatedUnion('scope',
|
|
|
105
148
|
exports.RemnawaveWebhookServiceEvents,
|
|
106
149
|
exports.RemnawaveWebhookErrorsEvents,
|
|
107
150
|
exports.RemnawaveWebhookCrmEvents,
|
|
151
|
+
exports.RemnawaveWebhookTorrentBlockerEvents,
|
|
108
152
|
]);
|
|
@@ -65,12 +65,16 @@ exports.EVENTS = {
|
|
|
65
65
|
INFRA_BILLING_NODE_PAYMENT_OVERDUE_48HRS: 'crm.infra_billing_node_payment_overdue_48hrs',
|
|
66
66
|
INFRA_BILLING_NODE_PAYMENT_OVERDUE_7_DAYS: 'crm.infra_billing_node_payment_overdue_7_days',
|
|
67
67
|
},
|
|
68
|
+
TORRENT_BLOCKER: {
|
|
69
|
+
REPORT: 'torrent_blocker.report',
|
|
70
|
+
},
|
|
68
71
|
CATCH_ALL_USER_EVENTS: 'user.*',
|
|
69
72
|
CATCH_ALL_USER_HWID_DEVICES_EVENTS: 'user_hwid_devices.*',
|
|
70
73
|
CATCH_ALL_NODE_EVENTS: 'node.*',
|
|
71
74
|
CATCH_ALL_SERVICE_EVENTS: 'service.*',
|
|
72
75
|
CATCH_ALL_ERRORS_EVENTS: 'errors.*',
|
|
73
76
|
CATCH_ALL_CRM_EVENTS: 'crm.*',
|
|
77
|
+
CATCH_ALL_TORRENT_BLOCKER_EVENTS: 'torrent_blocker.*',
|
|
74
78
|
};
|
|
75
79
|
exports.EVENTS_SCOPES = {
|
|
76
80
|
USER: 'user',
|
|
@@ -79,6 +83,7 @@ exports.EVENTS_SCOPES = {
|
|
|
79
83
|
SERVICE: 'service',
|
|
80
84
|
ERRORS: 'errors',
|
|
81
85
|
CRM: 'crm',
|
|
86
|
+
TORRENT_BLOCKER: 'torrent_blocker',
|
|
82
87
|
};
|
|
83
88
|
const toZodEnum = (obj) => Object.values(obj);
|
|
84
89
|
exports.toZodEnum = toZodEnum;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.RemnawaveWebhookEventSchema = exports.RemnawaveWebhookCrmEvents = exports.RemnawaveWebhookErrorsEvents = exports.RemnawaveWebhookServiceEvents = exports.RemnawaveWebhookNodeEvents = exports.RemnawaveWebhookUserHwidDevicesEvents = exports.RemnawaveWebhookUserEvents = void 0;
|
|
6
|
+
exports.RemnawaveWebhookEventSchema = exports.RemnawaveWebhookTorrentBlockerEvents = exports.RemnawaveWebhookCrmEvents = exports.RemnawaveWebhookErrorsEvents = exports.RemnawaveWebhookServiceEvents = exports.RemnawaveWebhookNodeEvents = exports.RemnawaveWebhookUserHwidDevicesEvents = exports.RemnawaveWebhookUserEvents = void 0;
|
|
7
7
|
const zod_1 = __importDefault(require("zod"));
|
|
8
8
|
const constants_1 = require("../../constants");
|
|
9
9
|
const hwid_user_device_schema_1 = require("../hwid-user-device.schema");
|
|
@@ -98,6 +98,49 @@ exports.RemnawaveWebhookCrmEvents = zod_1.default.object({
|
|
|
98
98
|
loginUrl: zod_1.default.string(),
|
|
99
99
|
}),
|
|
100
100
|
});
|
|
101
|
+
exports.RemnawaveWebhookTorrentBlockerEvents = zod_1.default.object({
|
|
102
|
+
scope: zod_1.default.literal(constants_1.EVENTS_SCOPES.TORRENT_BLOCKER),
|
|
103
|
+
event: zod_1.default.enum((0, constants_1.toZodEnum)(constants_1.EVENTS.TORRENT_BLOCKER)),
|
|
104
|
+
timestamp: zod_1.default
|
|
105
|
+
.string()
|
|
106
|
+
.datetime()
|
|
107
|
+
.transform((str) => new Date(str)),
|
|
108
|
+
data: zod_1.default.object({
|
|
109
|
+
node: nodes_schema_1.NodesSchema,
|
|
110
|
+
user: extended_users_schema_1.ExtendedUsersSchema,
|
|
111
|
+
report: zod_1.default.object({
|
|
112
|
+
actionReport: zod_1.default.object({
|
|
113
|
+
blocked: zod_1.default.boolean(),
|
|
114
|
+
ip: zod_1.default.string(),
|
|
115
|
+
blockDuration: zod_1.default.number(),
|
|
116
|
+
willUnblockAt: zod_1.default
|
|
117
|
+
.string()
|
|
118
|
+
.datetime({ offset: true, local: true })
|
|
119
|
+
.transform((str) => new Date(str)),
|
|
120
|
+
userId: zod_1.default.string(),
|
|
121
|
+
processedAt: zod_1.default
|
|
122
|
+
.string()
|
|
123
|
+
.datetime({ offset: true, local: true })
|
|
124
|
+
.transform((str) => new Date(str)),
|
|
125
|
+
}),
|
|
126
|
+
xrayReport: zod_1.default.object({
|
|
127
|
+
email: zod_1.default.string().nullable(),
|
|
128
|
+
level: zod_1.default.number().nullable(),
|
|
129
|
+
protocol: zod_1.default.string().nullable(),
|
|
130
|
+
network: zod_1.default.string(),
|
|
131
|
+
source: zod_1.default.string().nullable(),
|
|
132
|
+
destination: zod_1.default.string(),
|
|
133
|
+
routeTarget: zod_1.default.string().nullable(),
|
|
134
|
+
originalTarget: zod_1.default.string().nullable(),
|
|
135
|
+
inboundTag: zod_1.default.string().nullable(),
|
|
136
|
+
inboundName: zod_1.default.string().nullable(),
|
|
137
|
+
inboundLocal: zod_1.default.string().nullable(),
|
|
138
|
+
outboundTag: zod_1.default.string().nullable(),
|
|
139
|
+
ts: zod_1.default.number(),
|
|
140
|
+
}),
|
|
141
|
+
}),
|
|
142
|
+
}),
|
|
143
|
+
});
|
|
101
144
|
exports.RemnawaveWebhookEventSchema = zod_1.default.discriminatedUnion('scope', [
|
|
102
145
|
exports.RemnawaveWebhookUserEvents,
|
|
103
146
|
exports.RemnawaveWebhookUserHwidDevicesEvents,
|
|
@@ -105,4 +148,5 @@ exports.RemnawaveWebhookEventSchema = zod_1.default.discriminatedUnion('scope',
|
|
|
105
148
|
exports.RemnawaveWebhookServiceEvents,
|
|
106
149
|
exports.RemnawaveWebhookErrorsEvents,
|
|
107
150
|
exports.RemnawaveWebhookCrmEvents,
|
|
151
|
+
exports.RemnawaveWebhookTorrentBlockerEvents,
|
|
108
152
|
]);
|