@remnawave/backend-contract 2.2.2 → 2.2.5
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/subscription-template.d.ts +4 -1
- package/build/backend/api/controllers/subscription-template.d.ts.map +1 -1
- package/build/backend/api/controllers/subscription-template.js +5 -2
- 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 +15 -1
- package/build/backend/api/routes.d.ts.map +1 -1
- package/build/backend/api/routes.js +15 -1
- 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 +33 -22
- package/build/backend/commands/subscription-settings/get-subscription-settings.command.d.ts.map +1 -1
- package/build/backend/commands/subscription-settings/update-subscription-settings.command.d.ts +60 -40
- package/build/backend/commands/subscription-settings/update-subscription-settings.command.d.ts.map +1 -1
- package/build/backend/commands/subscription-template/create-template.command.d.ts +70 -0
- package/build/backend/commands/subscription-template/create-template.command.d.ts.map +1 -0
- package/build/backend/commands/subscription-template/create-template.command.js +30 -0
- package/build/backend/commands/subscription-template/delete-subscription-template.command.d.ts +33 -0
- package/build/backend/commands/subscription-template/delete-subscription-template.command.d.ts.map +1 -0
- package/build/backend/commands/subscription-template/delete-subscription-template.command.js +20 -0
- package/build/backend/commands/subscription-template/get-template.command.d.ts +9 -11
- package/build/backend/commands/subscription-template/get-template.command.d.ts.map +1 -1
- package/build/backend/commands/subscription-template/get-template.command.js +4 -3
- package/build/backend/commands/subscription-template/get-templates.command.d.ts +79 -0
- package/build/backend/commands/subscription-template/get-templates.command.d.ts.map +1 -0
- package/build/backend/commands/subscription-template/get-templates.command.js +25 -0
- package/build/backend/commands/subscription-template/index.d.ts +3 -0
- package/build/backend/commands/subscription-template/index.d.ts.map +1 -1
- package/build/backend/commands/subscription-template/index.js +3 -0
- package/build/backend/commands/subscription-template/update-template.command.d.ts +11 -10
- package/build/backend/commands/subscription-template/update-template.command.d.ts.map +1 -1
- package/build/backend/commands/subscription-template/update-template.command.js +8 -2
- 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 +54 -36
- package/build/backend/commands/system/testers/test-srr-matcher.command.d.ts.map +1 -1
- 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/cache-keys/cache-keys.constants.d.ts +2 -0
- package/build/backend/constants/cache-keys/cache-keys.constants.d.ts.map +1 -1
- package/build/backend/constants/cache-keys/cache-keys.constants.js +1 -0
- package/build/backend/constants/errors/errors.d.ts +115 -0
- package/build/backend/constants/errors/errors.d.ts.map +1 -1
- package/build/backend/constants/errors/errors.js +115 -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 +9 -6
- package/build/backend/models/response-rules/response-rule-modifications.schema.d.ts.map +1 -1
- package/build/backend/models/response-rules/response-rule-modifications.schema.js +8 -0
- package/build/backend/models/response-rules/response-rule.schema.d.ts +30 -20
- package/build/backend/models/response-rules/response-rule.schema.d.ts.map +1 -1
- package/build/backend/models/response-rules/response-rules-config.schema.d.ts +21 -14
- package/build/backend/models/response-rules/response-rules-config.schema.d.ts.map +1 -1
- package/build/backend/models/subscription-settings.schema.d.ts +27 -18
- package/build/backend/models/subscription-settings.schema.d.ts.map +1 -1
- 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/subscription-template.js +5 -2
- package/build/frontend/api/controllers-info.js +4 -0
- package/build/frontend/api/routes.js +15 -1
- 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 +30 -0
- package/build/frontend/commands/subscription-template/delete-subscription-template.command.js +20 -0
- package/build/frontend/commands/subscription-template/get-template.command.js +4 -3
- package/build/frontend/commands/subscription-template/get-templates.command.js +25 -0
- package/build/frontend/commands/subscription-template/index.js +3 -0
- package/build/frontend/commands/subscription-template/update-template.command.js +8 -2
- 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/cache-keys/cache-keys.constants.js +1 -0
- package/build/frontend/constants/errors/errors.js +115 -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 +8 -0
- package/build/frontend/models/users.schema.js +1 -0
- package/package.json +1 -1
|
@@ -835,4 +835,119 @@ exports.ERRORS = {
|
|
|
835
835
|
message: 'Snippet cannot contain empty objects',
|
|
836
836
|
httpCode: 400,
|
|
837
837
|
},
|
|
838
|
+
GET_ALL_SUBSCRIPTION_TEMPLATES_ERROR: {
|
|
839
|
+
code: 'A168',
|
|
840
|
+
message: 'Get all subscription templates error',
|
|
841
|
+
httpCode: 500,
|
|
842
|
+
},
|
|
843
|
+
GET_SUBSCRIPTION_TEMPLATE_BY_UUID_ERROR: {
|
|
844
|
+
code: 'A169',
|
|
845
|
+
message: 'Get subscription template by UUID error',
|
|
846
|
+
httpCode: 500,
|
|
847
|
+
},
|
|
848
|
+
SUBSCRIPTION_TEMPLATE_NOT_FOUND: {
|
|
849
|
+
code: 'A170',
|
|
850
|
+
message: 'Subscription template not found',
|
|
851
|
+
httpCode: 404,
|
|
852
|
+
},
|
|
853
|
+
UPDATE_SUBSCRIPTION_TEMPLATE_ERROR: {
|
|
854
|
+
code: 'A171',
|
|
855
|
+
message: 'Update subscription template error',
|
|
856
|
+
httpCode: 500,
|
|
857
|
+
},
|
|
858
|
+
RESERVED_TEMPLATE_NAME: {
|
|
859
|
+
code: 'A172',
|
|
860
|
+
message: 'This name is reserved. Please use a different name.',
|
|
861
|
+
httpCode: 400,
|
|
862
|
+
},
|
|
863
|
+
TEMPLATE_JSON_NOT_ALLOWED_FOR_YAML_TEMPLATE: {
|
|
864
|
+
code: 'A173',
|
|
865
|
+
message: 'Template JSON is not allowed for YAML template',
|
|
866
|
+
httpCode: 400,
|
|
867
|
+
},
|
|
868
|
+
TEMPLATE_YAML_NOT_ALLOWED_FOR_JSON_TEMPLATE: {
|
|
869
|
+
code: 'A174',
|
|
870
|
+
message: 'Template YAML is not allowed for JSON template',
|
|
871
|
+
httpCode: 400,
|
|
872
|
+
},
|
|
873
|
+
TEMPLATE_JSON_AND_YAML_CANNOT_BE_UPDATED_SIMULTANEOUSLY: {
|
|
874
|
+
code: 'A175',
|
|
875
|
+
message: 'Template JSON and YAML cannot be updated simultaneously',
|
|
876
|
+
httpCode: 400,
|
|
877
|
+
},
|
|
878
|
+
TEMPLATE_NAME_ALREADY_EXISTS_FOR_THIS_TYPE: {
|
|
879
|
+
code: 'A176',
|
|
880
|
+
message: 'Template name already exists for this type',
|
|
881
|
+
httpCode: 400,
|
|
882
|
+
},
|
|
883
|
+
DELETE_SUBSCRIPTION_TEMPLATE_ERROR: {
|
|
884
|
+
code: 'A177',
|
|
885
|
+
message: 'Delete subscription template error',
|
|
886
|
+
httpCode: 500,
|
|
887
|
+
},
|
|
888
|
+
RESERVED_TEMPLATE_CANNOT_BE_DELETED: {
|
|
889
|
+
code: 'A178',
|
|
890
|
+
message: 'Reserved template cannot be deleted',
|
|
891
|
+
httpCode: 400,
|
|
892
|
+
},
|
|
893
|
+
CREATE_SUBSCRIPTION_TEMPLATE_ERROR: {
|
|
894
|
+
code: 'A179',
|
|
895
|
+
message: 'Create subscription template error',
|
|
896
|
+
httpCode: 500,
|
|
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
|
+
},
|
|
838
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);
|
|
@@ -40,6 +40,14 @@ exports.ResponseRuleModificationsSchema = zod_1.default
|
|
|
40
40
|
},
|
|
41
41
|
],
|
|
42
42
|
markdownDescription: 'Array of headers to be added when the rule is matched.',
|
|
43
|
+
}))
|
|
44
|
+
.optional(),
|
|
45
|
+
subscriptionTemplate: zod_1.default
|
|
46
|
+
.string()
|
|
47
|
+
.min(1, 'Subscription template name is required')
|
|
48
|
+
.optional()
|
|
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. **This modification have higher priority than settings from External Squads.**',
|
|
43
51
|
})),
|
|
44
52
|
})
|
|
45
53
|
.optional()
|