@remnawave/backend-contract 2.2.4 → 2.2.6
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/api/controllers/external-squads.d.ts +13 -0
- package/build/backend/api/controllers/external-squads.d.ts.map +1 -0
- package/build/backend/api/controllers/external-squads.js +16 -0
- package/build/backend/api/controllers/index.d.ts +1 -0
- package/build/backend/api/controllers/index.d.ts.map +1 -1
- package/build/backend/api/controllers/index.js +1 -0
- package/build/backend/api/controllers-info.d.ts +4 -0
- package/build/backend/api/controllers-info.d.ts.map +1 -1
- package/build/backend/api/controllers-info.js +4 -0
- package/build/backend/api/routes.d.ts +11 -0
- package/build/backend/api/routes.d.ts.map +1 -1
- package/build/backend/api/routes.js +11 -0
- package/build/backend/commands/external-squads/bulk-actions/add-users-to-external-squad.command.d.ts +33 -0
- package/build/backend/commands/external-squads/bulk-actions/add-users-to-external-squad.command.d.ts.map +1 -0
- package/build/backend/commands/external-squads/bulk-actions/add-users-to-external-squad.command.js +20 -0
- package/build/backend/commands/external-squads/bulk-actions/delete-users-from-external-squad.command.d.ts +33 -0
- package/build/backend/commands/external-squads/bulk-actions/delete-users-from-external-squad.command.d.ts.map +1 -0
- package/build/backend/commands/external-squads/bulk-actions/delete-users-from-external-squad.command.js +20 -0
- package/build/backend/commands/external-squads/bulk-actions/index.d.ts +3 -0
- package/build/backend/commands/external-squads/bulk-actions/index.d.ts.map +1 -0
- package/build/backend/commands/external-squads/bulk-actions/index.js +18 -0
- package/build/backend/commands/external-squads/create-external-squad.command.d.ts +100 -0
- package/build/backend/commands/external-squads/create-external-squad.command.d.ts.map +1 -0
- package/build/backend/commands/external-squads/create-external-squad.command.js +23 -0
- package/build/backend/commands/external-squads/delete-external-squad.command.d.ts +33 -0
- package/build/backend/commands/external-squads/delete-external-squad.command.d.ts.map +1 -0
- package/build/backend/commands/external-squads/delete-external-squad.command.js +20 -0
- package/build/backend/commands/external-squads/get-external-squad-by-uuid.d.ts +100 -0
- package/build/backend/commands/external-squads/get-external-squad-by-uuid.d.ts.map +1 -0
- package/build/backend/commands/external-squads/get-external-squad-by-uuid.js +19 -0
- package/build/backend/commands/external-squads/get-external-squads.command.d.ts +131 -0
- package/build/backend/commands/external-squads/get-external-squads.command.d.ts.map +1 -0
- package/build/backend/commands/external-squads/get-external-squads.command.js +19 -0
- package/build/backend/commands/external-squads/index.d.ts +7 -0
- package/build/backend/commands/external-squads/index.d.ts.map +1 -0
- package/build/backend/commands/external-squads/index.js +22 -0
- package/build/backend/commands/external-squads/update-external-squad.command.d.ts +128 -0
- package/build/backend/commands/external-squads/update-external-squad.command.d.ts.map +1 -0
- package/build/backend/commands/external-squads/update-external-squad.command.js +31 -0
- package/build/backend/commands/index.d.ts +1 -0
- package/build/backend/commands/index.d.ts.map +1 -1
- package/build/backend/commands/index.js +1 -0
- package/build/backend/commands/subscription-settings/get-subscription-settings.command.d.ts +11 -11
- package/build/backend/commands/subscription-settings/update-subscription-settings.command.d.ts +20 -20
- package/build/backend/commands/subscription-template/create-template.command.d.ts.map +1 -1
- package/build/backend/commands/subscription-template/create-template.command.js +5 -1
- package/build/backend/commands/subscription-template/get-templates.command.d.ts +4 -4
- package/build/backend/commands/subscription-template/update-template.command.d.ts.map +1 -1
- package/build/backend/commands/subscription-template/update-template.command.js +6 -1
- package/build/backend/commands/subscriptions/get-by/get-raw-subscription-by-short-uuid.command.d.ts +7 -0
- package/build/backend/commands/subscriptions/get-by/get-raw-subscription-by-short-uuid.command.d.ts.map +1 -1
- package/build/backend/commands/system/testers/test-srr-matcher.command.d.ts +18 -18
- package/build/backend/commands/users/actions/disable-user.command.d.ts +5 -0
- package/build/backend/commands/users/actions/disable-user.command.d.ts.map +1 -1
- package/build/backend/commands/users/actions/enable-user.command.d.ts +5 -0
- package/build/backend/commands/users/actions/enable-user.command.d.ts.map +1 -1
- package/build/backend/commands/users/actions/reset-user-traffic.command.d.ts +5 -0
- package/build/backend/commands/users/actions/reset-user-traffic.command.d.ts.map +1 -1
- package/build/backend/commands/users/actions/revoke-user-subscription.command.d.ts +5 -0
- package/build/backend/commands/users/actions/revoke-user-subscription.command.d.ts.map +1 -1
- package/build/backend/commands/users/bulk/bulk-update-users.command.d.ts +5 -0
- package/build/backend/commands/users/bulk/bulk-update-users.command.d.ts.map +1 -1
- package/build/backend/commands/users/bulk/bulk-update-users.command.js +3 -0
- package/build/backend/commands/users/create-user.command.d.ts +8 -0
- package/build/backend/commands/users/create-user.command.d.ts.map +1 -1
- package/build/backend/commands/users/create-user.command.js +3 -0
- package/build/backend/commands/users/get-all-users.command.d.ts +7 -0
- package/build/backend/commands/users/get-all-users.command.d.ts.map +1 -1
- package/build/backend/commands/users/get-by/get-user-by-email.command.d.ts +5 -0
- package/build/backend/commands/users/get-by/get-user-by-email.command.d.ts.map +1 -1
- package/build/backend/commands/users/get-by/get-user-by-short-uuid.command.d.ts +5 -0
- package/build/backend/commands/users/get-by/get-user-by-short-uuid.command.d.ts.map +1 -1
- package/build/backend/commands/users/get-by/get-user-by-tag.command.d.ts +5 -0
- package/build/backend/commands/users/get-by/get-user-by-tag.command.d.ts.map +1 -1
- package/build/backend/commands/users/get-by/get-user-by-telegram-id.command.d.ts +5 -0
- package/build/backend/commands/users/get-by/get-user-by-telegram-id.command.d.ts.map +1 -1
- package/build/backend/commands/users/get-by/get-user-by-username.command.d.ts +5 -0
- package/build/backend/commands/users/get-by/get-user-by-username.command.d.ts.map +1 -1
- package/build/backend/commands/users/get-user-by-uuid.command.d.ts +5 -0
- package/build/backend/commands/users/get-user-by-uuid.command.d.ts.map +1 -1
- package/build/backend/commands/users/update-user.command.d.ts +10 -0
- package/build/backend/commands/users/update-user.command.d.ts.map +1 -1
- package/build/backend/commands/users/update-user.command.js +3 -0
- package/build/backend/constants/errors/errors.d.ts +55 -0
- package/build/backend/constants/errors/errors.d.ts.map +1 -1
- package/build/backend/constants/errors/errors.js +55 -0
- package/build/backend/models/extended-users.schema.d.ts +3 -0
- package/build/backend/models/extended-users.schema.d.ts.map +1 -1
- package/build/backend/models/external-squad.schema.d.ts +56 -0
- package/build/backend/models/external-squad.schema.d.ts.map +1 -0
- package/build/backend/models/external-squad.schema.js +24 -0
- package/build/backend/models/index.d.ts +1 -0
- package/build/backend/models/index.d.ts.map +1 -1
- package/build/backend/models/index.js +1 -0
- package/build/backend/models/response-rules/response-rule-modifications.schema.d.ts +3 -3
- package/build/backend/models/response-rules/response-rule-modifications.schema.js +3 -3
- package/build/backend/models/response-rules/response-rule.schema.d.ts +10 -10
- package/build/backend/models/response-rules/response-rules-config.schema.d.ts +7 -7
- package/build/backend/models/subscription-settings.schema.d.ts +9 -9
- package/build/backend/models/users.schema.d.ts +3 -0
- package/build/backend/models/users.schema.d.ts.map +1 -1
- package/build/backend/models/users.schema.js +1 -0
- package/build/frontend/api/controllers/external-squads.js +16 -0
- package/build/frontend/api/controllers/index.js +1 -0
- package/build/frontend/api/controllers-info.js +4 -0
- package/build/frontend/api/routes.js +11 -0
- package/build/frontend/commands/external-squads/bulk-actions/add-users-to-external-squad.command.js +20 -0
- package/build/frontend/commands/external-squads/bulk-actions/delete-users-from-external-squad.command.js +20 -0
- package/build/frontend/commands/external-squads/bulk-actions/index.js +18 -0
- package/build/frontend/commands/external-squads/create-external-squad.command.js +23 -0
- package/build/frontend/commands/external-squads/delete-external-squad.command.js +20 -0
- package/build/frontend/commands/external-squads/get-external-squad-by-uuid.js +19 -0
- package/build/frontend/commands/external-squads/get-external-squads.command.js +19 -0
- package/build/frontend/commands/external-squads/index.js +22 -0
- package/build/frontend/commands/external-squads/update-external-squad.command.js +31 -0
- package/build/frontend/commands/index.js +1 -0
- package/build/frontend/commands/subscription-template/create-template.command.js +5 -1
- package/build/frontend/commands/subscription-template/update-template.command.js +6 -1
- package/build/frontend/commands/users/bulk/bulk-update-users.command.js +3 -0
- package/build/frontend/commands/users/create-user.command.js +3 -0
- package/build/frontend/commands/users/update-user.command.js +3 -0
- package/build/frontend/constants/errors/errors.js +55 -0
- package/build/frontend/models/external-squad.schema.js +24 -0
- package/build/frontend/models/index.js +1 -0
- package/build/frontend/models/response-rules/response-rule-modifications.schema.js +3 -3
- package/build/frontend/models/users.schema.js +1 -0
- package/package.json +1 -1
|
@@ -44,6 +44,9 @@ var BulkUpdateUsersCommand;
|
|
|
44
44
|
.max(16, 'Tag must be less than 16 characters')
|
|
45
45
|
.nullable()),
|
|
46
46
|
hwidDeviceLimit: zod_1.z.optional(zod_1.z.number().int().min(0, 'Device limit must be non-negative').nullable()),
|
|
47
|
+
externalSquadUuid: zod_1.z
|
|
48
|
+
.optional(zod_1.z.nullable(zod_1.z.string().uuid()))
|
|
49
|
+
.describe('Optional. External squad UUID.'),
|
|
47
50
|
}),
|
|
48
51
|
});
|
|
49
52
|
BulkUpdateUsersCommand.ResponseSchema = zod_1.z.object({
|
|
@@ -130,6 +130,9 @@ var CreateUserCommand;
|
|
|
130
130
|
.string()
|
|
131
131
|
.uuid()
|
|
132
132
|
.describe('Optional. Pass UUID to create user with specific UUID, otherwise it will be generated automatically.')),
|
|
133
|
+
externalSquadUuid: zod_1.z
|
|
134
|
+
.optional(zod_1.z.nullable(zod_1.z.string().uuid()))
|
|
135
|
+
.describe('Optional. External squad UUID.'),
|
|
133
136
|
});
|
|
134
137
|
CreateUserCommand.ResponseSchema = zod_1.z.object({
|
|
135
138
|
response: models_1.ExtendedUsersSchema,
|
|
@@ -69,6 +69,9 @@ var UpdateUserCommand;
|
|
|
69
69
|
invalid_type_error: 'Enabled internal squads must be an array of UUIDs',
|
|
70
70
|
})
|
|
71
71
|
.optional(),
|
|
72
|
+
externalSquadUuid: zod_1.z
|
|
73
|
+
.optional(zod_1.z.nullable(zod_1.z.string().uuid()))
|
|
74
|
+
.describe('Optional. External squad UUID.'),
|
|
72
75
|
})
|
|
73
76
|
.refine((data) => data.uuid || data.username, {
|
|
74
77
|
message: 'Either uuid or username must be provided',
|
|
@@ -895,4 +895,59 @@ exports.ERRORS = {
|
|
|
895
895
|
message: 'Create subscription template error',
|
|
896
896
|
httpCode: 500,
|
|
897
897
|
},
|
|
898
|
+
TEMPLATE_TYPE_NOT_ALLOWED: {
|
|
899
|
+
code: 'A180',
|
|
900
|
+
message: 'Template type not allowed',
|
|
901
|
+
httpCode: 400,
|
|
902
|
+
},
|
|
903
|
+
GET_EXTERNAL_SQUADS_ERROR: {
|
|
904
|
+
code: 'A181',
|
|
905
|
+
message: 'Get external squads error',
|
|
906
|
+
httpCode: 500,
|
|
907
|
+
},
|
|
908
|
+
EXTERNAL_SQUAD_NOT_FOUND: {
|
|
909
|
+
code: 'A182',
|
|
910
|
+
message: 'External squad not found',
|
|
911
|
+
httpCode: 404,
|
|
912
|
+
},
|
|
913
|
+
CREATE_EXTERNAL_SQUAD_ERROR: {
|
|
914
|
+
code: 'A183',
|
|
915
|
+
message: 'Create external squad error',
|
|
916
|
+
httpCode: 500,
|
|
917
|
+
},
|
|
918
|
+
UPDATE_EXTERNAL_SQUAD_ERROR: {
|
|
919
|
+
code: 'A184',
|
|
920
|
+
message: 'Update external squad error',
|
|
921
|
+
httpCode: 500,
|
|
922
|
+
},
|
|
923
|
+
DELETE_EXTERNAL_SQUAD_ERROR: {
|
|
924
|
+
code: 'A185',
|
|
925
|
+
message: 'Delete external squad error',
|
|
926
|
+
httpCode: 500,
|
|
927
|
+
},
|
|
928
|
+
ADD_USERS_TO_EXTERNAL_SQUAD_ERROR: {
|
|
929
|
+
code: 'A186',
|
|
930
|
+
message: 'Add users to external squad error',
|
|
931
|
+
httpCode: 500,
|
|
932
|
+
},
|
|
933
|
+
REMOVE_USERS_FROM_EXTERNAL_SQUAD_ERROR: {
|
|
934
|
+
code: 'A187',
|
|
935
|
+
message: 'Remove users from external squad error',
|
|
936
|
+
httpCode: 500,
|
|
937
|
+
},
|
|
938
|
+
GET_EXTERNAL_SQUAD_BY_UUID_ERROR: {
|
|
939
|
+
code: 'A188',
|
|
940
|
+
message: 'Get external squad by UUID error',
|
|
941
|
+
httpCode: 500,
|
|
942
|
+
},
|
|
943
|
+
EXTERNAL_SQUAD_NAME_ALREADY_EXISTS: {
|
|
944
|
+
code: 'A189',
|
|
945
|
+
message: 'External squad name already exists',
|
|
946
|
+
httpCode: 400,
|
|
947
|
+
},
|
|
948
|
+
NAME_OR_TEMPLATES_REQUIRED: {
|
|
949
|
+
code: 'A190',
|
|
950
|
+
message: 'Name or templates are required',
|
|
951
|
+
httpCode: 400,
|
|
952
|
+
},
|
|
898
953
|
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExternalSquadSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("../constants");
|
|
6
|
+
exports.ExternalSquadSchema = zod_1.z.object({
|
|
7
|
+
uuid: zod_1.z.string().uuid(),
|
|
8
|
+
name: zod_1.z.string(),
|
|
9
|
+
info: zod_1.z.object({
|
|
10
|
+
membersCount: zod_1.z.number(),
|
|
11
|
+
}),
|
|
12
|
+
templates: zod_1.z.array(zod_1.z.object({
|
|
13
|
+
templateUuid: zod_1.z.string().uuid(),
|
|
14
|
+
templateType: zod_1.z.nativeEnum(constants_1.SUBSCRIPTION_TEMPLATE_TYPE),
|
|
15
|
+
})),
|
|
16
|
+
createdAt: zod_1.z
|
|
17
|
+
.string()
|
|
18
|
+
.datetime()
|
|
19
|
+
.transform((str) => new Date(str)),
|
|
20
|
+
updatedAt: zod_1.z
|
|
21
|
+
.string()
|
|
22
|
+
.datetime()
|
|
23
|
+
.transform((str) => new Date(str)),
|
|
24
|
+
});
|
|
@@ -21,6 +21,7 @@ __exportStar(require("./base-stat.schema"), exports);
|
|
|
21
21
|
__exportStar(require("./config-profile-inbounds.schema"), exports);
|
|
22
22
|
__exportStar(require("./config-profile.schema"), exports);
|
|
23
23
|
__exportStar(require("./extended-users.schema"), exports);
|
|
24
|
+
__exportStar(require("./external-squad.schema"), exports);
|
|
24
25
|
__exportStar(require("./happ.schema"), exports);
|
|
25
26
|
__exportStar(require("./hosts.schema"), exports);
|
|
26
27
|
__exportStar(require("./hwid-user-device.schema"), exports);
|
|
@@ -42,12 +42,12 @@ exports.ResponseRuleModificationsSchema = zod_1.default
|
|
|
42
42
|
markdownDescription: 'Array of headers to be added when the rule is matched.',
|
|
43
43
|
}))
|
|
44
44
|
.optional(),
|
|
45
|
-
|
|
45
|
+
subscriptionTemplate: zod_1.default
|
|
46
46
|
.string()
|
|
47
|
-
.min(1, '
|
|
47
|
+
.min(1, 'Subscription template name is required')
|
|
48
48
|
.optional()
|
|
49
49
|
.describe(JSON.stringify({
|
|
50
|
-
markdownDescription: 'Override the subscription template with the given name. If not provided, the default subscription template will be used. If the template name is not found, the default subscription template for this type will be used.',
|
|
50
|
+
markdownDescription: 'Override the subscription template with the given name. If not provided, the default subscription template will be used. If the template name is not found, the default subscription template for this type will be used. **This modification have higher priority than settings from External Squads.**',
|
|
51
51
|
})),
|
|
52
52
|
})
|
|
53
53
|
.optional()
|