From b55485ce300d056fec6bc4ccab5160ae246cc1df Mon Sep 17 00:00:00 2001 From: Svetoslav Petkov Date: Fri, 21 Jan 2022 10:07:03 +0200 Subject: [PATCH 1/4] skipped a group check --- .../application.created.notification.builder.ts | 1 - .../communication.discussion.created.notification.builder.ts | 1 - .../communication.updated.notification.builder.ts | 1 - .../user-registered/user.registered.notification.builder.ts | 1 - 4 files changed, 4 deletions(-) diff --git a/src/services/domain/builders/application-created/application.created.notification.builder.ts b/src/services/domain/builders/application-created/application.created.notification.builder.ts index fdb958ee..9dc6764e 100644 --- a/src/services/domain/builders/application-created/application.created.notification.builder.ts +++ b/src/services/domain/builders/application-created/application.created.notification.builder.ts @@ -92,7 +92,6 @@ export class ApplicationCreatedNotificationBuilder { if ( recipient.preferences.find( preference => - preference.definition.group === 'Notification' && preference.definition.type === preferenceType && preference.value === 'true' ) diff --git a/src/services/domain/builders/communication-discussion-created/communication.discussion.created.notification.builder.ts b/src/services/domain/builders/communication-discussion-created/communication.discussion.created.notification.builder.ts index ea69d79c..76254e94 100644 --- a/src/services/domain/builders/communication-discussion-created/communication.discussion.created.notification.builder.ts +++ b/src/services/domain/builders/communication-discussion-created/communication.discussion.created.notification.builder.ts @@ -111,7 +111,6 @@ export class CommunicationDiscussionCreatedNotificationBuilder { !preferenceType || recipient.preferences.find( preference => - preference.definition.group === 'Notification' && preference.definition.type === preferenceType && preference.value === 'true' ) diff --git a/src/services/domain/builders/communication-updated/communication.updated.notification.builder.ts b/src/services/domain/builders/communication-updated/communication.updated.notification.builder.ts index 6a8a54d6..299eeea6 100644 --- a/src/services/domain/builders/communication-updated/communication.updated.notification.builder.ts +++ b/src/services/domain/builders/communication-updated/communication.updated.notification.builder.ts @@ -106,7 +106,6 @@ export class CommunicationUpdateNotificationBuilder { !preferenceType || recipient.preferences.find( preference => - preference.definition.group === 'Notification' && preference.definition.type === preferenceType && preference.value === 'true' ) diff --git a/src/services/domain/builders/user-registered/user.registered.notification.builder.ts b/src/services/domain/builders/user-registered/user.registered.notification.builder.ts index 1fa815e2..9b1b8ee3 100644 --- a/src/services/domain/builders/user-registered/user.registered.notification.builder.ts +++ b/src/services/domain/builders/user-registered/user.registered.notification.builder.ts @@ -95,7 +95,6 @@ export class UserRegisteredNotificationBuilder { !preferenceType || recipient.preferences.find( preference => - preference.definition.group === 'Notification' && preference.definition.type === preferenceType && preference.value === 'true' ) From 0b66a9eb6953e8f1bdb15d5fa416b3b05637dadd Mon Sep 17 00:00:00 2001 From: Evgeni Dimitrov Date: Tue, 1 Feb 2022 17:57:36 +0200 Subject: [PATCH 2/4] Update client-lib version --- package-lock.json | 37 +++++++++++++++++-------------------- package.json | 2 +- 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9bc3e25c..9b5558a4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.4.6", "license": "EUPL-1.2", "dependencies": { - "@alkemio/client-lib": "^0.10.4", + "@alkemio/client-lib": "^0.11.2", "@nestjs/axios": "^0.0.1", "@nestjs/common": "^8.0.5", "@nestjs/config": "^1.0.1", @@ -74,9 +74,9 @@ } }, "node_modules/@alkemio/client-lib": { - "version": "0.10.4", - "resolved": "https://registry.npmjs.org/@alkemio/client-lib/-/client-lib-0.10.4.tgz", - "integrity": "sha512-XWVIgcBMDRtR4n955rs/trdw+kZE2Zs4yhXcaVdr2o1l78lqyccDdlKhGcf4L3OLDDdVm9aQOpUUckkeX+fiSQ==", + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/@alkemio/client-lib/-/client-lib-0.11.2.tgz", + "integrity": "sha512-lX2AU5LcCJ6dQGBpXMVaVnvMoaq0aj/qKOtA83dYWzlcoTSmx9UR54XN/jzFDX/P6yyHO/2PedH6uFyDR86xbA==", "dependencies": { "axios": "^0.21.1", "dotenv": "^8.2.0", @@ -3600,8 +3600,6 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.2.tgz", "integrity": "sha512-9807RlWAgT564wT+DjeyU5OFMPjmzxVobvDFmNAhY+5zD6A2ly3jDp6sgnfyDtlIQ+7H97oc/DGCzzfu9rjw9w==", "dev": true, - "optional": true, - "peer": true, "dependencies": { "fast-deep-equal": "^3.1.1", "json-schema-traverse": "^1.0.0", @@ -3617,9 +3615,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true, - "optional": true, - "peer": true + "dev": true }, "node_modules/ajv-keywords": { "version": "3.5.2", @@ -17355,9 +17351,9 @@ }, "dependencies": { "@alkemio/client-lib": { - "version": "0.10.4", - "resolved": "https://registry.npmjs.org/@alkemio/client-lib/-/client-lib-0.10.4.tgz", - "integrity": "sha512-XWVIgcBMDRtR4n955rs/trdw+kZE2Zs4yhXcaVdr2o1l78lqyccDdlKhGcf4L3OLDDdVm9aQOpUUckkeX+fiSQ==", + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/@alkemio/client-lib/-/client-lib-0.11.2.tgz", + "integrity": "sha512-lX2AU5LcCJ6dQGBpXMVaVnvMoaq0aj/qKOtA83dYWzlcoTSmx9UR54XN/jzFDX/P6yyHO/2PedH6uFyDR86xbA==", "requires": { "axios": "^0.21.1", "dotenv": "^8.2.0", @@ -19198,7 +19194,9 @@ "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.0.2.tgz", "integrity": "sha512-Brah4Uo5/U8v76c6euTwtjVFFaVishwnJrQBYpev1JRh4vjA1F4HY3UzQez41YUCszUCXKagG8v6eVRBHV1gkw==", "dev": true, - "requires": {} + "requires": { + "ajv": "^8.0.0" + } }, "chalk": { "version": "4.1.1", @@ -20124,14 +20122,15 @@ "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.0.tgz", "integrity": "sha512-USH2jBb+C/hIpwD2iRjp0pe0k+MvzG0mlSn/FIdCgQhUb9ALPRjt2KIQdfZDS9r0ZIeUAg7gOu9KL0PFqGqr5Q==", "dev": true, - "requires": {}, + "requires": { + "ajv": "^8.0.0" + }, "dependencies": { "ajv": { - "version": "https://registry.npmjs.org/ajv/-/ajv-8.6.2.tgz", + "version": "8.6.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.2.tgz", "integrity": "sha512-9807RlWAgT564wT+DjeyU5OFMPjmzxVobvDFmNAhY+5zD6A2ly3jDp6sgnfyDtlIQ+7H97oc/DGCzzfu9rjw9w==", "dev": true, - "optional": true, - "peer": true, "requires": { "fast-deep-equal": "^3.1.1", "json-schema-traverse": "^1.0.0", @@ -20143,9 +20142,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true, - "optional": true, - "peer": true + "dev": true } } }, diff --git a/package.json b/package.json index 1467615a..5204fc40 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "validate-connection": "ts-node src/utils/validate-connection.ts" }, "dependencies": { - "@alkemio/client-lib": "^0.10.4", + "@alkemio/client-lib": "^0.11.2", "@nestjs/axios": "^0.0.1", "@nestjs/common": "^8.0.5", "@nestjs/config": "^1.0.1", From ac70359719edee19ffd697bf3e170cddcca10a93 Mon Sep 17 00:00:00 2001 From: Evgeni Dimitrov Date: Tue, 1 Feb 2022 18:37:28 +0200 Subject: [PATCH 3/4] Endpoints update --- src/common/constants/defaults.ts | 2 +- .../external/alkemio-client/alkemio.client.factory.ts | 2 +- src/utils/validate-connection.ts | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/common/constants/defaults.ts b/src/common/constants/defaults.ts index d70a47d6..e4ef0e7d 100644 --- a/src/common/constants/defaults.ts +++ b/src/common/constants/defaults.ts @@ -1,5 +1,5 @@ export const DEFAULT_ENDPOINTS = { - alkemioServer: 'http://localhost:3000/admin/graphql', + alkemioServer: 'http://localhost:3000/api/private/non-interactive/graphql', kratosApiEndpoint: 'http://localhost:3000/identity/ory/kratos/public', }; diff --git a/src/services/external/alkemio-client/alkemio.client.factory.ts b/src/services/external/alkemio-client/alkemio.client.factory.ts index ecebde8a..1646418c 100644 --- a/src/services/external/alkemio-client/alkemio.client.factory.ts +++ b/src/services/external/alkemio-client/alkemio.client.factory.ts @@ -14,7 +14,7 @@ export async function alkemioClientFactory( )?.public_endpoint; const alkemioClientConfig = { - graphqlEndpoint: server, + apiEndpointPrivateGraphql: server, authInfo: { credentials: { email: configService.get(ConfigurationTypes.ALKEMIO)?.service_account diff --git a/src/utils/validate-connection.ts b/src/utils/validate-connection.ts index d03d15cd..8a0363cf 100644 --- a/src/utils/validate-connection.ts +++ b/src/utils/validate-connection.ts @@ -7,10 +7,10 @@ import * as dotenv from 'dotenv'; const main = async () => { dotenv.config(); - + const server = + process.env.API_ENDPOINT_PRIVATE_GRAPHQL || DEFAULT_ENDPOINTS.alkemioServer; const alkemioClient = new AlkemioClient({ - graphqlEndpoint: - process.env.ALKEMIO_SERVER_ENDPOINT ?? DEFAULT_ENDPOINTS.alkemioServer, + apiEndpointPrivateGraphql: server, authInfo: { credentials: { email: From 8f1043efb536704a58fcc54fa1bb089559fc1ed7 Mon Sep 17 00:00:00 2001 From: Evgeni Dimitrov Date: Tue, 1 Feb 2022 18:53:36 +0200 Subject: [PATCH 4/4] Addressed feedback --- src/utils/validate-connection.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/validate-connection.ts b/src/utils/validate-connection.ts index 8a0363cf..67c9e0a6 100644 --- a/src/utils/validate-connection.ts +++ b/src/utils/validate-connection.ts @@ -8,7 +8,7 @@ import * as dotenv from 'dotenv'; const main = async () => { dotenv.config(); const server = - process.env.API_ENDPOINT_PRIVATE_GRAPHQL || DEFAULT_ENDPOINTS.alkemioServer; + process.env.ALKEMIO_SERVER_ENDPOINT || DEFAULT_ENDPOINTS.alkemioServer; const alkemioClient = new AlkemioClient({ apiEndpointPrivateGraphql: server, authInfo: {