@stamhoofd/backend 2.78.4 → 2.79.1
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/index.ts +1 -1
- package/package.json +13 -12
- package/src/endpoints/admin/organizations/PatchOrganizationsEndpoint.ts +1 -1
- package/src/endpoints/auth/CreateAdminEndpoint.ts +1 -1
- package/src/endpoints/auth/CreateTokenEndpoint.ts +1 -1
- package/src/endpoints/auth/ForgotPasswordEndpoint.ts +1 -1
- package/src/endpoints/auth/PatchUserEndpoint.ts +1 -1
- package/src/endpoints/global/members/PatchOrganizationMembersEndpoint.test.ts +1964 -4
- package/src/endpoints/global/members/PatchOrganizationMembersEndpoint.ts +175 -2
- package/src/endpoints/global/platform/PatchPlatformEnpoint.ts +1 -1
- package/src/endpoints/global/registration/PatchUserMembersEndpoint.test.ts +2 -2
- package/src/endpoints/global/registration/PatchUserMembersEndpoint.ts +7 -1
- package/src/endpoints/global/registration/RegisterMembersEndpoint.test.ts +3 -23
- package/src/endpoints/global/registration/RegisterMembersEndpoint.ts +12 -0
- package/src/endpoints/organization/dashboard/organization/PatchOrganizationEndpoint.ts +2 -3
- package/src/endpoints/organization/dashboard/registration-periods/GetOrganizationRegistrationPeriodsEndpoint.test.ts +164 -0
- package/src/helpers/AdminPermissionChecker.ts +22 -1
- package/src/helpers/AuthenticatedStructures.ts +77 -20
- package/src/helpers/ForwardHandler.test.ts +16 -5
- package/src/helpers/ForwardHandler.ts +21 -9
- package/src/helpers/MemberUserSyncer.test.ts +822 -0
- package/src/helpers/MemberUserSyncer.ts +137 -108
- package/src/helpers/TagHelper.ts +3 -3
- package/src/seeds/1734596144-fill-previous-period-id.ts +1 -1
- package/src/seeds/1741008870-fix-auditlog-description.ts +50 -0
- package/src/seeds/1741011468-fix-auditlog-description-uft16.ts +88 -0
- package/src/services/PlatformMembershipService.ts +7 -2
- package/src/services/SSOService.ts +1 -1
- package/tests/e2e/register.test.ts +2 -2
package/index.ts
CHANGED
|
@@ -61,7 +61,7 @@ const start = async () => {
|
|
|
61
61
|
|
|
62
62
|
// Init platform shared struct: otherwise permissions won't work with missing responsibilities
|
|
63
63
|
console.log('Loading platform...');
|
|
64
|
-
await Platform.
|
|
64
|
+
await Platform.loadCaches();
|
|
65
65
|
|
|
66
66
|
const router = new Router();
|
|
67
67
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stamhoofd/backend",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.79.1",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"clear": "rm -rf ./dist",
|
|
17
17
|
"start": "yarn build && node --enable-source-maps ./dist/index.js",
|
|
18
18
|
"test": "jest --runInBand",
|
|
19
|
+
"test:build": "yarn -s build:full && yarn -s test",
|
|
19
20
|
"test:reset": "yarn build:full && jest --runInBand",
|
|
20
21
|
"migrations": "yarn build:full && node ./dist/migrations.js",
|
|
21
22
|
"lint": "eslint"
|
|
@@ -33,18 +34,18 @@
|
|
|
33
34
|
"dependencies": {
|
|
34
35
|
"@bwip-js/node": "^4.5.1",
|
|
35
36
|
"@mollie/api-client": "3.7.0",
|
|
36
|
-
"@simonbackx/simple-database": "1.29.
|
|
37
|
-
"@simonbackx/simple-encoding": "2.
|
|
37
|
+
"@simonbackx/simple-database": "1.29.1",
|
|
38
|
+
"@simonbackx/simple-encoding": "2.21.0",
|
|
38
39
|
"@simonbackx/simple-endpoints": "1.19.1",
|
|
39
40
|
"@simonbackx/simple-logging": "^1.0.1",
|
|
40
|
-
"@stamhoofd/backend-i18n": "2.
|
|
41
|
-
"@stamhoofd/backend-middleware": "2.
|
|
42
|
-
"@stamhoofd/email": "2.
|
|
43
|
-
"@stamhoofd/models": "2.
|
|
44
|
-
"@stamhoofd/queues": "2.
|
|
45
|
-
"@stamhoofd/sql": "2.
|
|
46
|
-
"@stamhoofd/structures": "2.
|
|
47
|
-
"@stamhoofd/utility": "2.
|
|
41
|
+
"@stamhoofd/backend-i18n": "2.79.1",
|
|
42
|
+
"@stamhoofd/backend-middleware": "2.79.1",
|
|
43
|
+
"@stamhoofd/email": "2.79.1",
|
|
44
|
+
"@stamhoofd/models": "2.79.1",
|
|
45
|
+
"@stamhoofd/queues": "2.79.1",
|
|
46
|
+
"@stamhoofd/sql": "2.79.1",
|
|
47
|
+
"@stamhoofd/structures": "2.79.1",
|
|
48
|
+
"@stamhoofd/utility": "2.79.1",
|
|
48
49
|
"archiver": "^7.0.1",
|
|
49
50
|
"aws-sdk": "^2.885.0",
|
|
50
51
|
"axios": "1.6.8",
|
|
@@ -64,5 +65,5 @@
|
|
|
64
65
|
"publishConfig": {
|
|
65
66
|
"access": "public"
|
|
66
67
|
},
|
|
67
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "88ae0a3e4edb57d36151c551a4c4e3ed59447e05"
|
|
68
69
|
}
|
|
@@ -51,7 +51,7 @@ export class PatchOrganizationsEndpoint extends Endpoint<Params, Query, Body, Re
|
|
|
51
51
|
throw new SimpleError({ code: 'not_found', message: 'Organization not found', statusCode: 404 });
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
if (organization.id === (await Platform.
|
|
54
|
+
if (organization.id === (await Platform.getSharedPrivateStruct()).membershipOrganizationId) {
|
|
55
55
|
throw new SimpleError({
|
|
56
56
|
code: 'cannot_delete_membership_organization',
|
|
57
57
|
message: 'Cannot delete membership organization',
|
|
@@ -101,7 +101,7 @@ export class CreateAdminEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
101
101
|
const platformName = ((await Platform.getSharedStruct()).config.name);
|
|
102
102
|
|
|
103
103
|
const name = organization?.name ?? platformName;
|
|
104
|
-
const what = organization ?
|
|
104
|
+
const what = organization ? $t('de vereniging {name} op {platform}', { name, platform: platformName }) : platformName;
|
|
105
105
|
|
|
106
106
|
const emailTo = admin.getEmailTo();
|
|
107
107
|
const email: string = typeof emailTo === 'string' ? emailTo : emailTo[0]?.email;
|
|
@@ -85,7 +85,7 @@ export class CreateTokenEndpoint extends Endpoint<Params, Query, Body, ResponseB
|
|
|
85
85
|
request.request.request?.setTimeout(30 * 1000);
|
|
86
86
|
|
|
87
87
|
if (STAMHOOFD.userMode === 'platform') {
|
|
88
|
-
const platform = await Platform.
|
|
88
|
+
const platform = await Platform.getSharedPrivateStruct();
|
|
89
89
|
const config = platform.config.loginMethods.get(LoginMethod.Password);
|
|
90
90
|
if (!config) {
|
|
91
91
|
throw new SimpleError({
|
|
@@ -31,7 +31,7 @@ export class ForgotPasswordEndpoint extends Endpoint<Params, Query, Body, Respon
|
|
|
31
31
|
const organization = await Context.setOptionalOrganizationScope();
|
|
32
32
|
|
|
33
33
|
if (STAMHOOFD.userMode === 'platform') {
|
|
34
|
-
const platform = await Platform.
|
|
34
|
+
const platform = await Platform.getSharedPrivateStruct();
|
|
35
35
|
const config = platform.config.loginMethods.get(LoginMethod.Password);
|
|
36
36
|
if (!config) {
|
|
37
37
|
throw new SimpleError({
|
|
@@ -136,7 +136,7 @@ export class PatchUserEndpoint extends Endpoint<Params, Query, Body, ResponseBod
|
|
|
136
136
|
|
|
137
137
|
if (editUser.id === user.id && request.body.password) {
|
|
138
138
|
if (STAMHOOFD.userMode === 'platform') {
|
|
139
|
-
const platform = await Platform.
|
|
139
|
+
const platform = await Platform.getSharedPrivateStruct();
|
|
140
140
|
const config = platform.config.loginMethods.get(LoginMethod.Password);
|
|
141
141
|
if (!config) {
|
|
142
142
|
throw new SimpleError({
|