@stamhoofd/backend 2.81.0 → 2.83.0
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/package.json +10 -10
- package/src/audit-logs/GroupLogger.ts +3 -3
- package/src/audit-logs/MemberResponsibilityRecordLogger.ts +1 -1
- package/src/audit-logs/OrderLogger.ts +1 -1
- package/src/audit-logs/RegistrationLogger.ts +1 -1
- package/src/endpoints/admin/members/ChargeMembersEndpoint.ts +4 -4
- package/src/endpoints/admin/memberships/ChargeMembershipsEndpoint.ts +1 -1
- package/src/endpoints/admin/organizations/ChargeOrganizationsEndpoint.ts +5 -5
- package/src/endpoints/admin/organizations/GetOrganizationsEndpoint.ts +1 -1
- package/src/endpoints/admin/organizations/PatchOrganizationsEndpoint.ts +8 -8
- package/src/endpoints/auth/CreateAdminEndpoint.ts +2 -2
- package/src/endpoints/auth/CreateTokenEndpoint.ts +10 -10
- package/src/endpoints/auth/ForgotPasswordEndpoint.ts +2 -2
- package/src/endpoints/auth/PatchUserEndpoint.ts +9 -9
- package/src/endpoints/auth/SignupEndpoint.ts +2 -2
- package/src/endpoints/auth/VerifyEmailEndpoint.ts +3 -3
- package/src/endpoints/global/audit-logs/GetAuditLogsEndpoint.ts +1 -1
- package/src/endpoints/global/email/GetEmailAddressEndpoint.ts +1 -1
- package/src/endpoints/global/email/GetEmailEndpoint.ts +1 -1
- package/src/endpoints/global/email/ManageEmailAddressEndpoint.ts +1 -1
- package/src/endpoints/global/email/PatchEmailEndpoint.test.ts +139 -0
- package/src/endpoints/global/email/PatchEmailEndpoint.ts +30 -7
- package/src/endpoints/global/events/GetEventNotificationsEndpoint.ts +1 -1
- package/src/endpoints/global/events/PatchEventNotificationsEndpoint.test.ts +16 -35
- package/src/endpoints/global/events/PatchEventNotificationsEndpoint.ts +1 -1
- package/src/endpoints/global/events/PatchEventsEndpoint.ts +22 -16
- package/src/endpoints/global/files/ExportToExcelEndpoint.ts +1 -1
- package/src/endpoints/global/files/UploadFile.ts +14 -2
- package/src/endpoints/global/files/UploadImage.ts +2 -2
- package/src/endpoints/global/members/GetMemberFamilyEndpoint.ts +2 -2
- package/src/endpoints/global/members/GetMembersEndpoint.ts +1 -1
- package/src/endpoints/global/members/PatchOrganizationMembersEndpoint.test.ts +19 -19
- package/src/endpoints/global/members/PatchOrganizationMembersEndpoint.ts +34 -34
- package/src/endpoints/global/organizations/CheckRegisterCodeEndpoint.ts +1 -1
- package/src/endpoints/global/organizations/CreateOrganizationEndpoint.ts +5 -5
- package/src/endpoints/global/payments/StripeWebhookEndpoint.ts +5 -1
- package/src/endpoints/global/platform/GetPlatformEndpoint.test.ts +68 -0
- package/src/endpoints/global/platform/PatchPlatformEnpoint.ts +1 -1
- package/src/endpoints/global/registration/GetPaymentRegistrations.ts +2 -2
- package/src/endpoints/global/registration/PatchUserMembersEndpoint.test.ts +15 -17
- package/src/endpoints/global/registration/PatchUserMembersEndpoint.ts +4 -4
- package/src/endpoints/global/registration/RegisterMembersEndpoint.ts +37 -37
- package/src/endpoints/global/registration-periods/PatchRegistrationPeriodsEndpoint.ts +2 -2
- package/src/endpoints/global/webshops/GetWebshopFromDomainEndpoint.ts +2 -2
- package/src/endpoints/organization/dashboard/documents/GetDocumentTemplateXML.ts +1 -1
- package/src/endpoints/organization/dashboard/documents/PatchDocumentEndpoint.ts +5 -5
- package/src/endpoints/organization/dashboard/documents/PatchDocumentTemplateEndpoint.ts +2 -2
- package/src/endpoints/organization/dashboard/email/CheckEmailBouncesEndpoint.ts +1 -1
- package/src/endpoints/organization/dashboard/email-templates/PatchEmailTemplatesEndpoint.ts +3 -3
- package/src/endpoints/organization/dashboard/organization/PatchOrganizationEndpoint.ts +9 -9
- package/src/endpoints/organization/dashboard/organization/SetOrganizationDomainEndpoint.ts +4 -4
- package/src/endpoints/organization/dashboard/payments/GetMemberBalanceEndpoint.ts +1 -1
- package/src/endpoints/organization/dashboard/payments/GetPaymentsEndpoint.ts +1 -1
- package/src/endpoints/organization/dashboard/payments/PatchBalanceItemsEndpoint.ts +11 -11
- package/src/endpoints/organization/dashboard/payments/PatchPaymentsEndpoint.ts +13 -13
- package/src/endpoints/organization/dashboard/registration-periods/PatchOrganizationRegistrationPeriodsEndpoint.ts +16 -16
- package/src/endpoints/organization/dashboard/stripe/ConnectStripeEndpoint.ts +1 -1
- package/src/endpoints/organization/dashboard/stripe/DeleteStripeAccountEndpoint.ts +2 -2
- package/src/endpoints/organization/dashboard/stripe/GetStripeAccountLinkEndpoint.ts +1 -1
- package/src/endpoints/organization/dashboard/stripe/GetStripeLoginLinkEndpoint.ts +1 -1
- package/src/endpoints/organization/dashboard/stripe/UpdateStripeAccountEndpoint.ts +1 -1
- package/src/endpoints/organization/dashboard/users/CreateApiUserEndpoint.test.ts +106 -0
- package/src/endpoints/organization/dashboard/users/CreateApiUserEndpoint.ts +16 -3
- package/src/endpoints/organization/dashboard/users/DeleteUserEndpoint.ts +2 -2
- package/src/endpoints/organization/dashboard/users/PatchApiUserEndpoint.test.ts +247 -0
- package/src/endpoints/{auth → organization/dashboard/users}/PatchApiUserEndpoint.ts +25 -6
- package/src/endpoints/organization/dashboard/webshops/CreateWebshopEndpoint.ts +4 -4
- package/src/endpoints/organization/dashboard/webshops/PatchDiscountCodesEndpoint.ts +2 -2
- package/src/endpoints/organization/dashboard/webshops/PatchWebshopEndpoint.ts +8 -8
- package/src/endpoints/organization/dashboard/webshops/PatchWebshopTicketsEndpoint.ts +1 -1
- package/src/endpoints/organization/shared/ExchangePaymentEndpoint.ts +1 -1
- package/src/endpoints/organization/shared/GetDocumentHtml.ts +2 -2
- package/src/endpoints/organization/shared/GetPaymentEndpoint.ts +1 -1
- package/src/endpoints/organization/shared/auth/GetOrganizationEndpoint.test.ts +5 -0
- package/src/endpoints/organization/webshops/CheckWebshopDiscountCodesEndpoint.ts +1 -1
- package/src/endpoints/organization/webshops/GetOrderByPaymentEndpoint.ts +2 -2
- package/src/endpoints/organization/webshops/GetOrderEndpoint.ts +1 -1
- package/src/endpoints/organization/webshops/GetTicketsEndpoint.ts +3 -3
- package/src/endpoints/organization/webshops/GetWebshopEndpoint.test.ts +6 -1
- package/src/endpoints/organization/webshops/GetWebshopEndpoint.ts +1 -1
- package/src/endpoints/organization/webshops/PlaceOrderEndpoint.ts +10 -8
- package/src/excel-loaders/event-notifications.ts +11 -11
- package/src/excel-loaders/members.ts +34 -34
- package/src/excel-loaders/organizations.ts +23 -23
- package/src/excel-loaders/payments.ts +39 -39
- package/src/excel-loaders/receivable-balances.ts +21 -21
- package/src/helpers/AddressValidator.ts +6 -6
- package/src/helpers/AdminPermissionChecker.ts +7 -4
- package/src/helpers/AuthenticatedStructures.ts +16 -8
- package/src/helpers/BuckarooHelper.ts +1 -1
- package/src/helpers/CheckSettlements.ts +1 -1
- package/src/helpers/Context.ts +31 -15
- package/src/helpers/FileCache.ts +7 -7
- package/src/helpers/ForwardHandler.ts +1 -1
- package/src/helpers/GlobalHelper.ts +6 -4
- package/src/helpers/MembershipCharger.ts +2 -2
- package/src/helpers/SetupStepUpdater.ts +1 -1
- package/src/helpers/StripeHelper.ts +18 -7
- package/src/helpers/XlsxTransformerColumnHelper.ts +18 -18
- package/src/services/DocumentService.ts +1 -1
- package/src/services/EventNotificationService.ts +1 -1
- package/src/services/MemberNumberService.ts +3 -3
- package/src/services/SSOService.ts +5 -5
- package/src/sql-filters/members.ts +1 -1
- package/tests/e2e/api-rate-limits.test.ts +188 -0
- package/tests/e2e/private-files.test.ts +3 -3
- package/tests/helpers/StripeMocker.ts +7 -1
- /package/src/endpoints/global/platform/{GetPlatformEnpoint.ts → GetPlatformEndpoint.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stamhoofd/backend",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.83.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -38,14 +38,14 @@
|
|
|
38
38
|
"@simonbackx/simple-encoding": "2.22.0",
|
|
39
39
|
"@simonbackx/simple-endpoints": "1.19.1",
|
|
40
40
|
"@simonbackx/simple-logging": "^1.0.1",
|
|
41
|
-
"@stamhoofd/backend-i18n": "2.
|
|
42
|
-
"@stamhoofd/backend-middleware": "2.
|
|
43
|
-
"@stamhoofd/email": "2.
|
|
44
|
-
"@stamhoofd/models": "2.
|
|
45
|
-
"@stamhoofd/queues": "2.
|
|
46
|
-
"@stamhoofd/sql": "2.
|
|
47
|
-
"@stamhoofd/structures": "2.
|
|
48
|
-
"@stamhoofd/utility": "2.
|
|
41
|
+
"@stamhoofd/backend-i18n": "2.83.0",
|
|
42
|
+
"@stamhoofd/backend-middleware": "2.83.0",
|
|
43
|
+
"@stamhoofd/email": "2.83.0",
|
|
44
|
+
"@stamhoofd/models": "2.83.0",
|
|
45
|
+
"@stamhoofd/queues": "2.83.0",
|
|
46
|
+
"@stamhoofd/sql": "2.83.0",
|
|
47
|
+
"@stamhoofd/structures": "2.83.0",
|
|
48
|
+
"@stamhoofd/utility": "2.83.0",
|
|
49
49
|
"archiver": "^7.0.1",
|
|
50
50
|
"aws-sdk": "^2.885.0",
|
|
51
51
|
"axios": "1.6.8",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"publishConfig": {
|
|
66
66
|
"access": "public"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "5f116184aad8965d9deda1902e73af7feefa5721"
|
|
69
69
|
}
|
|
@@ -70,7 +70,7 @@ export const GroupLogger = new ModelLogger(Group, {
|
|
|
70
70
|
return new Map([
|
|
71
71
|
['e', AuditLogReplacement.create({
|
|
72
72
|
id: model.settings.eventId,
|
|
73
|
-
value: model.settings.name,
|
|
73
|
+
value: model.settings.name.toString(),
|
|
74
74
|
type: AuditLogReplacementType.Event,
|
|
75
75
|
})],
|
|
76
76
|
]);
|
|
@@ -78,7 +78,7 @@ export const GroupLogger = new ModelLogger(Group, {
|
|
|
78
78
|
return new Map([
|
|
79
79
|
['e', AuditLogReplacement.create({
|
|
80
80
|
id: model.id,
|
|
81
|
-
value: model.settings.name,
|
|
81
|
+
value: model.settings.name.toString(),
|
|
82
82
|
type: AuditLogReplacementType.Group,
|
|
83
83
|
})],
|
|
84
84
|
]);
|
|
@@ -87,7 +87,7 @@ export const GroupLogger = new ModelLogger(Group, {
|
|
|
87
87
|
return new Map([
|
|
88
88
|
['g', AuditLogReplacement.create({
|
|
89
89
|
id: model.id,
|
|
90
|
-
value: model.settings.name,
|
|
90
|
+
value: model.settings.name.toString(),
|
|
91
91
|
type: AuditLogReplacementType.Group,
|
|
92
92
|
})],
|
|
93
93
|
]);
|
|
@@ -59,7 +59,7 @@ export const MemberResponsibilityRecordLogger = new ModelLogger(MemberResponsibi
|
|
|
59
59
|
if (options.data.group) {
|
|
60
60
|
map.set('g', AuditLogReplacement.create({
|
|
61
61
|
id: options.data.group.id,
|
|
62
|
-
value: options.data.group.settings.name,
|
|
62
|
+
value: options.data.group.settings.name.toString(),
|
|
63
63
|
type: AuditLogReplacementType.Group,
|
|
64
64
|
}));
|
|
65
65
|
}
|
|
@@ -50,7 +50,7 @@ export const OrderLogger = new ModelLogger(Order, {
|
|
|
50
50
|
id: model.id,
|
|
51
51
|
value: model.number ? `bestelling #${model.number}` : `bestelling van ${model.data.customer.name}`,
|
|
52
52
|
type: AuditLogReplacementType.Order,
|
|
53
|
-
description: model.number ? model.data.customer.name :
|
|
53
|
+
description: model.number ? model.data.customer.name : $t(`4597a3f5-6a6a-44a3-85da-5240ab08447a`),
|
|
54
54
|
})],
|
|
55
55
|
]);
|
|
56
56
|
},
|
|
@@ -39,7 +39,7 @@ export const RegistrationLogger = new ModelLogger(Registration, {
|
|
|
39
39
|
})],
|
|
40
40
|
['g', AuditLogReplacement.create({
|
|
41
41
|
id: data.group.id,
|
|
42
|
-
value: data.group.settings.name,
|
|
42
|
+
value: data.group.settings.name.toString(),
|
|
43
43
|
type: AuditLogReplacementType.Group,
|
|
44
44
|
})],
|
|
45
45
|
]);
|
|
@@ -36,7 +36,7 @@ export class ChargeMembersEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
36
36
|
throw new SimpleError({
|
|
37
37
|
code: 'invalid_field',
|
|
38
38
|
message: 'Invalid description',
|
|
39
|
-
human:
|
|
39
|
+
human: $t(`2449fba5-99dc-496f-a9d6-a67263d56616`),
|
|
40
40
|
field: 'description',
|
|
41
41
|
});
|
|
42
42
|
}
|
|
@@ -45,7 +45,7 @@ export class ChargeMembersEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
45
45
|
throw new SimpleError({
|
|
46
46
|
code: 'invalid_field',
|
|
47
47
|
message: 'Invalid price',
|
|
48
|
-
human:
|
|
48
|
+
human: $t(`1e165aac-8a58-45c5-bdd8-c58131a7b7f5`),
|
|
49
49
|
field: 'price',
|
|
50
50
|
});
|
|
51
51
|
}
|
|
@@ -54,7 +54,7 @@ export class ChargeMembersEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
54
54
|
throw new SimpleError({
|
|
55
55
|
code: 'invalid_field',
|
|
56
56
|
message: 'Invalid amount',
|
|
57
|
-
human:
|
|
57
|
+
human: $t(`0bdf4953-1eae-41fd-b142-5ad3287f17a7`),
|
|
58
58
|
field: 'amount',
|
|
59
59
|
});
|
|
60
60
|
}
|
|
@@ -78,7 +78,7 @@ export class ChargeMembersEndpoint extends Endpoint<Params, Query, Body, Respons
|
|
|
78
78
|
throw new SimpleError({
|
|
79
79
|
code: 'charge_pending',
|
|
80
80
|
message: 'Charge members already pending',
|
|
81
|
-
human:
|
|
81
|
+
human: $t(`d2b84fdd-035b-4307-a897-000081aa814f`),
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
|
|
@@ -34,7 +34,7 @@ export class ChargeMembershipsEndpoint extends Endpoint<Params, Query, Body, Res
|
|
|
34
34
|
throw new SimpleError({
|
|
35
35
|
code: 'charge_pending',
|
|
36
36
|
message: 'Charge already pending',
|
|
37
|
-
human:
|
|
37
|
+
human: $t(`d2b84fdd-035b-4307-a897-000081aa814f`),
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
|
|
@@ -36,7 +36,7 @@ export class ChargeOrganizationsEndpoint extends Endpoint<Params, Query, Body, R
|
|
|
36
36
|
throw new SimpleError({
|
|
37
37
|
code: 'invalid_field',
|
|
38
38
|
message: 'Invalid description',
|
|
39
|
-
human:
|
|
39
|
+
human: $t(`2449fba5-99dc-496f-a9d6-a67263d56616`),
|
|
40
40
|
field: 'description',
|
|
41
41
|
});
|
|
42
42
|
}
|
|
@@ -45,7 +45,7 @@ export class ChargeOrganizationsEndpoint extends Endpoint<Params, Query, Body, R
|
|
|
45
45
|
throw new SimpleError({
|
|
46
46
|
code: 'invalid_field',
|
|
47
47
|
message: 'Invalid price',
|
|
48
|
-
human:
|
|
48
|
+
human: $t(`1e165aac-8a58-45c5-bdd8-c58131a7b7f5`),
|
|
49
49
|
field: 'price',
|
|
50
50
|
});
|
|
51
51
|
}
|
|
@@ -54,7 +54,7 @@ export class ChargeOrganizationsEndpoint extends Endpoint<Params, Query, Body, R
|
|
|
54
54
|
throw new SimpleError({
|
|
55
55
|
code: 'invalid_field',
|
|
56
56
|
message: 'Invalid amount',
|
|
57
|
-
human:
|
|
57
|
+
human: $t(`0bdf4953-1eae-41fd-b142-5ad3287f17a7`),
|
|
58
58
|
field: 'amount',
|
|
59
59
|
});
|
|
60
60
|
}
|
|
@@ -63,7 +63,7 @@ export class ChargeOrganizationsEndpoint extends Endpoint<Params, Query, Body, R
|
|
|
63
63
|
throw new SimpleError({
|
|
64
64
|
code: 'invalid_field',
|
|
65
65
|
message: 'Invalid organization id',
|
|
66
|
-
human:
|
|
66
|
+
human: $t(`ae7ac6ab-bb02-4cd6-823f-7076e4ce6f6c`),
|
|
67
67
|
field: 'organizationId',
|
|
68
68
|
});
|
|
69
69
|
}
|
|
@@ -85,7 +85,7 @@ export class ChargeOrganizationsEndpoint extends Endpoint<Params, Query, Body, R
|
|
|
85
85
|
throw new SimpleError({
|
|
86
86
|
code: 'charge_pending',
|
|
87
87
|
message: 'Charge organizations already pending',
|
|
88
|
-
human:
|
|
88
|
+
human: $t(`d2b84fdd-035b-4307-a897-000081aa814f`),
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
91
|
|
|
@@ -127,7 +127,7 @@ export class GetOrganizationsEndpoint extends Endpoint<Params, Query, Body, Resp
|
|
|
127
127
|
throw new SimpleError({
|
|
128
128
|
code: 'timeout',
|
|
129
129
|
message: 'Query took too long',
|
|
130
|
-
human:
|
|
130
|
+
human: $t(`dce51638-6129-448b-8a15-e6d778f3a76a`),
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
133
|
throw error;
|
|
@@ -43,7 +43,7 @@ export class PatchOrganizationsEndpoint extends Endpoint<Params, Query, Body, Re
|
|
|
43
43
|
|
|
44
44
|
for (const id of request.body.getDeletes()) {
|
|
45
45
|
if (!Context.auth.hasPlatformFullAccess()) {
|
|
46
|
-
throw Context.auth.error(
|
|
46
|
+
throw Context.auth.error($t(`d01932d9-e958-4b29-98f2-cc5ff6be29d3`));
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
const organization = await Organization.getByID(id);
|
|
@@ -55,7 +55,7 @@ export class PatchOrganizationsEndpoint extends Endpoint<Params, Query, Body, Re
|
|
|
55
55
|
throw new SimpleError({
|
|
56
56
|
code: 'cannot_delete_membership_organization',
|
|
57
57
|
message: 'Cannot delete membership organization',
|
|
58
|
-
human:
|
|
58
|
+
human: $t(`a1f57ce7-a96a-4c8d-b43f-79a07a78114f`),
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
|
|
@@ -65,7 +65,7 @@ export class PatchOrganizationsEndpoint extends Endpoint<Params, Query, Body, Re
|
|
|
65
65
|
// Organization creation
|
|
66
66
|
for (const { put } of request.body.getPuts()) {
|
|
67
67
|
if (!Context.auth.hasPlatformFullAccess()) {
|
|
68
|
-
throw Context.auth.error(
|
|
68
|
+
throw Context.auth.error($t(`83826ae8-fd89-46c2-ad3f-8f77aadd65b2`));
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
if (put.name.length < 4) {
|
|
@@ -73,7 +73,7 @@ export class PatchOrganizationsEndpoint extends Endpoint<Params, Query, Body, Re
|
|
|
73
73
|
throw new SimpleError({
|
|
74
74
|
code: 'invalid_field',
|
|
75
75
|
message: 'Should not be empty',
|
|
76
|
-
human:
|
|
76
|
+
human: $t(`3f37782a-c07f-457d-994f-f1cc075cff44`),
|
|
77
77
|
field: 'organization.name',
|
|
78
78
|
});
|
|
79
79
|
}
|
|
@@ -81,7 +81,7 @@ export class PatchOrganizationsEndpoint extends Endpoint<Params, Query, Body, Re
|
|
|
81
81
|
throw new SimpleError({
|
|
82
82
|
code: 'invalid_field',
|
|
83
83
|
message: 'Field is too short',
|
|
84
|
-
human:
|
|
84
|
+
human: $t(`0e82abec-5467-45d8-ba89-9b9fd10c085d`),
|
|
85
85
|
field: 'organization.name',
|
|
86
86
|
});
|
|
87
87
|
}
|
|
@@ -92,7 +92,7 @@ export class PatchOrganizationsEndpoint extends Endpoint<Params, Query, Body, Re
|
|
|
92
92
|
throw new SimpleError({
|
|
93
93
|
code: 'invalid_field',
|
|
94
94
|
message: 'Field is too long',
|
|
95
|
-
human:
|
|
95
|
+
human: $t(`c4d225ea-8e41-4829-bf0c-bc04755492de`),
|
|
96
96
|
field: 'organization.name',
|
|
97
97
|
});
|
|
98
98
|
}
|
|
@@ -102,7 +102,7 @@ export class PatchOrganizationsEndpoint extends Endpoint<Params, Query, Body, Re
|
|
|
102
102
|
throw new SimpleError({
|
|
103
103
|
code: 'name_taken',
|
|
104
104
|
message: 'An organization with the same name already exists',
|
|
105
|
-
human:
|
|
105
|
+
human: $t(`6e675a7d-b124-4507-bf0c-9b70013e98ca`),
|
|
106
106
|
field: 'name',
|
|
107
107
|
});
|
|
108
108
|
}
|
|
@@ -113,7 +113,7 @@ export class PatchOrganizationsEndpoint extends Endpoint<Params, Query, Body, Re
|
|
|
113
113
|
throw new SimpleError({
|
|
114
114
|
code: 'name_taken',
|
|
115
115
|
message: 'An organization with the same name already exists',
|
|
116
|
-
human:
|
|
116
|
+
human: $t(`19e5262f-9dc1-40d9-b905-bda8462b6046`),
|
|
117
117
|
field: 'name',
|
|
118
118
|
});
|
|
119
119
|
}
|
|
@@ -59,7 +59,7 @@ export class CreateAdminEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
59
59
|
throw new SimpleError({
|
|
60
60
|
code: 'internal_error',
|
|
61
61
|
message: 'Something went wrong while creating the admin',
|
|
62
|
-
human:
|
|
62
|
+
human: $t(`f298a54a-ee0f-462c-a80a-8d8c967dfda3`),
|
|
63
63
|
statusCode: 500,
|
|
64
64
|
});
|
|
65
65
|
}
|
|
@@ -123,7 +123,7 @@ export class CreateAdminEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
123
123
|
}),
|
|
124
124
|
Replacement.create({
|
|
125
125
|
token: 'inviterName',
|
|
126
|
-
value: user.firstName ??
|
|
126
|
+
value: user.firstName ?? $t(`afc47996-7028-43ad-b7d0-8b5bb2979883`),
|
|
127
127
|
}),
|
|
128
128
|
Replacement.create({
|
|
129
129
|
token: 'validUntil',
|
|
@@ -71,7 +71,7 @@ export class CreateTokenEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
71
71
|
throw new SimpleError({
|
|
72
72
|
code: 'error',
|
|
73
73
|
message: 'Could not generate token',
|
|
74
|
-
human:
|
|
74
|
+
human: $t(`f40ddd3d-a986-4ec1-9db8-32ec1376c4e8`),
|
|
75
75
|
statusCode: 500,
|
|
76
76
|
});
|
|
77
77
|
}
|
|
@@ -91,7 +91,7 @@ export class CreateTokenEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
91
91
|
throw new SimpleError({
|
|
92
92
|
code: 'not_supported',
|
|
93
93
|
message: 'This platform does not support password login',
|
|
94
|
-
human:
|
|
94
|
+
human: $t(`4af15b54-0bbb-4112-adf2-26dd14e8675a`),
|
|
95
95
|
statusCode: 400,
|
|
96
96
|
});
|
|
97
97
|
}
|
|
@@ -100,7 +100,7 @@ export class CreateTokenEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
100
100
|
throw new SimpleError({
|
|
101
101
|
code: 'not_supported',
|
|
102
102
|
message: 'Login method not supported',
|
|
103
|
-
human:
|
|
103
|
+
human: $t(`ca4ca221-2ce9-4472-b8c7-1a5b2e2fdfa9`),
|
|
104
104
|
statusCode: 400,
|
|
105
105
|
});
|
|
106
106
|
}
|
|
@@ -111,7 +111,7 @@ export class CreateTokenEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
111
111
|
const errBody = {
|
|
112
112
|
code: 'invalid_username_or_password',
|
|
113
113
|
message: 'Invalid username or password',
|
|
114
|
-
human:
|
|
114
|
+
human: $t(`ef53eb8d-b0ba-4e84-b0e3-1865729aeaa8`),
|
|
115
115
|
statusCode: 400,
|
|
116
116
|
};
|
|
117
117
|
|
|
@@ -130,7 +130,7 @@ export class CreateTokenEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
130
130
|
throw new SimpleError({
|
|
131
131
|
code: 'verify_email',
|
|
132
132
|
message: 'Your email address needs verification',
|
|
133
|
-
human:
|
|
133
|
+
human: $t(`0da8cd34-d33e-4b54-94f2-531919f3cae1`),
|
|
134
134
|
meta: SignupResponse.create({
|
|
135
135
|
token: code.token,
|
|
136
136
|
}).encode({ version: request.request.getVersion() }),
|
|
@@ -144,7 +144,7 @@ export class CreateTokenEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
144
144
|
throw new SimpleError({
|
|
145
145
|
code: 'error',
|
|
146
146
|
message: 'Could not generate token',
|
|
147
|
-
human:
|
|
147
|
+
human: $t(`f40ddd3d-a986-4ec1-9db8-32ec1376c4e8`),
|
|
148
148
|
statusCode: 500,
|
|
149
149
|
});
|
|
150
150
|
}
|
|
@@ -159,7 +159,7 @@ export class CreateTokenEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
159
159
|
throw new SimpleError({
|
|
160
160
|
code: 'invalid_token',
|
|
161
161
|
message: 'Invalid token',
|
|
162
|
-
human:
|
|
162
|
+
human: $t(`dc03dd54-96e9-42b8-811b-3f8cf2b8534f`),
|
|
163
163
|
statusCode: 400,
|
|
164
164
|
});
|
|
165
165
|
}
|
|
@@ -170,7 +170,7 @@ export class CreateTokenEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
170
170
|
throw new SimpleError({
|
|
171
171
|
code: 'invalid_token',
|
|
172
172
|
message: 'Invalid token',
|
|
173
|
-
human:
|
|
173
|
+
human: $t(`dc03dd54-96e9-42b8-811b-3f8cf2b8534f`),
|
|
174
174
|
statusCode: 400,
|
|
175
175
|
});
|
|
176
176
|
}
|
|
@@ -180,7 +180,7 @@ export class CreateTokenEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
180
180
|
throw new SimpleError({
|
|
181
181
|
code: 'invalid_token',
|
|
182
182
|
message: 'Invalid token',
|
|
183
|
-
human:
|
|
183
|
+
human: $t(`dc03dd54-96e9-42b8-811b-3f8cf2b8534f`),
|
|
184
184
|
statusCode: 400,
|
|
185
185
|
});
|
|
186
186
|
}
|
|
@@ -194,7 +194,7 @@ export class CreateTokenEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
194
194
|
throw new SimpleError({
|
|
195
195
|
code: 'error',
|
|
196
196
|
message: 'Could not generate token',
|
|
197
|
-
human:
|
|
197
|
+
human: $t(`b75bc5af-7711-4905-a324-3dca313bbfc2`),
|
|
198
198
|
statusCode: 500,
|
|
199
199
|
});
|
|
200
200
|
}
|
|
@@ -37,7 +37,7 @@ export class ForgotPasswordEndpoint extends Endpoint<Params, Query, Body, Respon
|
|
|
37
37
|
throw new SimpleError({
|
|
38
38
|
code: 'not_supported',
|
|
39
39
|
message: 'This platform does not support password login',
|
|
40
|
-
human:
|
|
40
|
+
human: $t(`4af15b54-0bbb-4112-adf2-26dd14e8675a`),
|
|
41
41
|
statusCode: 400,
|
|
42
42
|
});
|
|
43
43
|
}
|
|
@@ -46,7 +46,7 @@ export class ForgotPasswordEndpoint extends Endpoint<Params, Query, Body, Respon
|
|
|
46
46
|
throw new SimpleError({
|
|
47
47
|
code: 'not_supported',
|
|
48
48
|
message: 'Login method not supported',
|
|
49
|
-
human:
|
|
49
|
+
human: $t(`52bddf7d-e494-4bdf-9b75-b5e9f9bcb427`),
|
|
50
50
|
statusCode: 400,
|
|
51
51
|
});
|
|
52
52
|
}
|
|
@@ -44,7 +44,7 @@ export class PatchUserEndpoint extends Endpoint<Params, Query, Body, ResponseBod
|
|
|
44
44
|
const editUser = request.body.id === user.id ? user : await User.getByID(request.body.id);
|
|
45
45
|
|
|
46
46
|
if (!editUser || !await Context.auth.canAccessUser(editUser, PermissionLevel.Write) || editUser.isApiUser) {
|
|
47
|
-
throw Context.auth.notFoundOrNoAccess(
|
|
47
|
+
throw Context.auth.notFoundOrNoAccess($t(`75c10aef-cdce-4171-b1a1-59dfdec5087c`));
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
if (await Context.auth.canEditUserName(editUser)) {
|
|
@@ -72,7 +72,7 @@ export class PatchUserEndpoint extends Endpoint<Params, Query, Body, ResponseBod
|
|
|
72
72
|
if (!await Context.auth.canAccessUser(editUser, PermissionLevel.Full)) {
|
|
73
73
|
throw new SimpleError({
|
|
74
74
|
code: 'permission_denied',
|
|
75
|
-
message:
|
|
75
|
+
message: $t(`75bf8ddd-48f3-44b6-bd57-0b9838c322d9`),
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
78
|
|
|
@@ -83,7 +83,7 @@ export class PatchUserEndpoint extends Endpoint<Params, Query, Body, ResponseBod
|
|
|
83
83
|
if (editUser.id === user.id && (!editUser.permissions || !editUser.permissions.forOrganization(organization)?.hasFullAccess()) && STAMHOOFD.environment !== 'development') {
|
|
84
84
|
throw new SimpleError({
|
|
85
85
|
code: 'permission_denied',
|
|
86
|
-
message:
|
|
86
|
+
message: $t(`e0dcbc2f-0881-409b-bb1e-6a19d0a2081c`),
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
89
|
}
|
|
@@ -102,7 +102,7 @@ export class PatchUserEndpoint extends Endpoint<Params, Query, Body, ResponseBod
|
|
|
102
102
|
if (editUser.id === user.id && !editUser.permissions?.platform?.hasFullAccess() && STAMHOOFD.environment !== 'development') {
|
|
103
103
|
throw new SimpleError({
|
|
104
104
|
code: 'permission_denied',
|
|
105
|
-
message:
|
|
105
|
+
message: $t(`e0dcbc2f-0881-409b-bb1e-6a19d0a2081c`),
|
|
106
106
|
});
|
|
107
107
|
}
|
|
108
108
|
}
|
|
@@ -124,7 +124,7 @@ export class PatchUserEndpoint extends Endpoint<Params, Query, Body, ResponseBod
|
|
|
124
124
|
throw new SimpleError({
|
|
125
125
|
code: 'invalid_request',
|
|
126
126
|
message: 'You cannot remove the last login provider',
|
|
127
|
-
human:
|
|
127
|
+
human: $t(`15e37a03-07ec-4299-8b9e-d54b7142a045`),
|
|
128
128
|
statusCode: 400,
|
|
129
129
|
});
|
|
130
130
|
}
|
|
@@ -142,7 +142,7 @@ export class PatchUserEndpoint extends Endpoint<Params, Query, Body, ResponseBod
|
|
|
142
142
|
throw new SimpleError({
|
|
143
143
|
code: 'not_supported',
|
|
144
144
|
message: 'This platform does not support password login',
|
|
145
|
-
human:
|
|
145
|
+
human: $t(`4af15b54-0bbb-4112-adf2-26dd14e8675a`),
|
|
146
146
|
statusCode: 400,
|
|
147
147
|
});
|
|
148
148
|
}
|
|
@@ -151,7 +151,7 @@ export class PatchUserEndpoint extends Endpoint<Params, Query, Body, ResponseBod
|
|
|
151
151
|
throw new SimpleError({
|
|
152
152
|
code: 'not_supported',
|
|
153
153
|
message: 'Login method not supported',
|
|
154
|
-
human:
|
|
154
|
+
human: $t(`52bddf7d-e494-4bdf-9b75-b5e9f9bcb427`),
|
|
155
155
|
statusCode: 400,
|
|
156
156
|
});
|
|
157
157
|
}
|
|
@@ -170,7 +170,7 @@ export class PatchUserEndpoint extends Endpoint<Params, Query, Body, ResponseBod
|
|
|
170
170
|
throw new SimpleError({
|
|
171
171
|
code: 'invalid_request',
|
|
172
172
|
message: 'You cannot remove the last login provider',
|
|
173
|
-
human:
|
|
173
|
+
human: $t(`e4b9b541-a029-47e7-97ca-4aa1bfa2137e`),
|
|
174
174
|
statusCode: 400,
|
|
175
175
|
});
|
|
176
176
|
}
|
|
@@ -192,7 +192,7 @@ export class PatchUserEndpoint extends Endpoint<Params, Query, Body, ResponseBod
|
|
|
192
192
|
throw new SimpleError({
|
|
193
193
|
code: 'verify_email',
|
|
194
194
|
message: 'Your email address needs verification',
|
|
195
|
-
human: editUser.id === user.id ?
|
|
195
|
+
human: editUser.id === user.id ? $t(`2a53e6f7-a6eb-4adf-a218-f28de686d188`) : $t(`919a83c6-c128-4d1c-bd5d-edb8c0106454`) + ' ' + request.body.email + ' ' + $t(`779c7d08-6db2-400c-95f8-af0f327109f8`),
|
|
196
196
|
meta: SignupResponse.create({
|
|
197
197
|
token: code.token,
|
|
198
198
|
}).encode({ version: request.request.getVersion() }),
|
|
@@ -36,7 +36,7 @@ export class SignupEndpoint extends Endpoint<Params, Query, Body, ResponseBody>
|
|
|
36
36
|
throw new SimpleError({
|
|
37
37
|
code: 'not_supported',
|
|
38
38
|
message: 'This platform does not support password login',
|
|
39
|
-
human:
|
|
39
|
+
human: $t(`4af15b54-0bbb-4112-adf2-26dd14e8675a`),
|
|
40
40
|
statusCode: 400,
|
|
41
41
|
});
|
|
42
42
|
}
|
|
@@ -62,7 +62,7 @@ export class SignupEndpoint extends Endpoint<Params, Query, Body, ResponseBody>
|
|
|
62
62
|
throw new SimpleError({
|
|
63
63
|
code: 'unexpected_error',
|
|
64
64
|
message: 'Something went wrong',
|
|
65
|
-
human:
|
|
65
|
+
human: $t(`44e0c667-07c5-4ff9-8bf2-623d9aa91219`),
|
|
66
66
|
statusCode: 500,
|
|
67
67
|
});
|
|
68
68
|
}
|
|
@@ -36,7 +36,7 @@ export class VerifyEmailEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
36
36
|
throw new SimpleError({
|
|
37
37
|
code: 'invalid_code',
|
|
38
38
|
message: 'This code is invalid',
|
|
39
|
-
human:
|
|
39
|
+
human: $t(`6dfd3a88-1de2-4462-b2a4-625026f9a62f`),
|
|
40
40
|
statusCode: 400,
|
|
41
41
|
});
|
|
42
42
|
}
|
|
@@ -47,7 +47,7 @@ export class VerifyEmailEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
47
47
|
throw new SimpleError({
|
|
48
48
|
code: 'invalid_code',
|
|
49
49
|
message: 'This code is invalid',
|
|
50
|
-
human:
|
|
50
|
+
human: $t(`6dfd3a88-1de2-4462-b2a4-625026f9a62f`),
|
|
51
51
|
statusCode: 400,
|
|
52
52
|
});
|
|
53
53
|
}
|
|
@@ -77,7 +77,7 @@ export class VerifyEmailEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
77
77
|
throw new SimpleError({
|
|
78
78
|
code: 'email_in_use',
|
|
79
79
|
message: 'This e-mail is already in use, we cannot set it',
|
|
80
|
-
human:
|
|
80
|
+
human: $t(`3073cc35-f434-4c2c-8347-34db10fc9940`, { email: code.email, contactEmail: request.$t('59b85264-c4c3-4cf6-8923-9b43282b2787') }),
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
83
|
throw e;
|
|
@@ -81,7 +81,7 @@ export class GetAuditLogsEndpoint extends Endpoint<Params, Query, Body, Response
|
|
|
81
81
|
throw new SimpleError({
|
|
82
82
|
code: 'not_supported',
|
|
83
83
|
message: 'Search is not possible in audit logs',
|
|
84
|
-
human:
|
|
84
|
+
human: $t(`540b9c7e-635f-48b7-a661-cd0700b3c602`),
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
87
|
|
|
@@ -40,7 +40,7 @@ export class GetEmailAddressEndpoint extends Endpoint<Params, Query, Body, Respo
|
|
|
40
40
|
throw new SimpleError({
|
|
41
41
|
code: 'invalid_fields',
|
|
42
42
|
message: 'Invalid token or id',
|
|
43
|
-
human:
|
|
43
|
+
human: $t(`ceacb5a8-7777-4366-abcb-9dd90ffb832e`),
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -41,7 +41,7 @@ export class GetEmailEndpoint extends Endpoint<Params, Query, Body, ResponseBody
|
|
|
41
41
|
throw new SimpleError({
|
|
42
42
|
code: 'not_found',
|
|
43
43
|
human: 'Email not found',
|
|
44
|
-
message:
|
|
44
|
+
message: $t(`9ddb6616-f62d-4c91-82a9-e5cf398e4c4a`),
|
|
45
45
|
statusCode: 404,
|
|
46
46
|
});
|
|
47
47
|
}
|
|
@@ -44,7 +44,7 @@ export class ManageEmailAddressEndpoint extends Endpoint<Params, Query, Body, Re
|
|
|
44
44
|
throw new SimpleError({
|
|
45
45
|
code: 'invalid_fields',
|
|
46
46
|
message: 'Invalid token or id',
|
|
47
|
-
human:
|
|
47
|
+
human: $t(`ceacb5a8-7777-4366-abcb-9dd90ffb832e`),
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
|