@verii/endpoints-organizations-registrar 1.0.0-pre.1752076816
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/LICENSE +202 -0
- package/NOTICE +1 -0
- package/README.md +3 -0
- package/package.json +86 -0
- package/src/config/abi.json +1 -0
- package/src/config/config.js +261 -0
- package/src/controllers/consents/autohooks.js +6 -0
- package/src/controllers/consents/controller.js +106 -0
- package/src/controllers/consents/schemas/consent-response.schema.js +45 -0
- package/src/controllers/did-web-host/controller.js +64 -0
- package/src/controllers/groups/autohooks.js +10 -0
- package/src/controllers/groups/controller.js +172 -0
- package/src/controllers/groups/schemas/group.schema.json +22 -0
- package/src/controllers/groups/schemas/index.js +7 -0
- package/src/controllers/groups/schemas/modify-group.schema.json +25 -0
- package/src/controllers/image_upload/controller.js +48 -0
- package/src/controllers/invitations/controller.js +79 -0
- package/src/controllers/organizations/_did/autohooks.js +16 -0
- package/src/controllers/organizations/_did/controller.js +617 -0
- package/src/controllers/organizations/_did/invitations/_invitationId/autohooks.js +16 -0
- package/src/controllers/organizations/_did/invitations/_invitationId/controller.js +217 -0
- package/src/controllers/organizations/_did/invitations/controller.js +197 -0
- package/src/controllers/organizations/_did/keys/controller.js +141 -0
- package/src/controllers/organizations/_did/services/controller.js +195 -0
- package/src/controllers/organizations/_did/signatories/controller.js +63 -0
- package/src/controllers/organizations/autohooks.js +65 -0
- package/src/controllers/organizations/controller.js +322 -0
- package/src/controllers/organizations/full/controller.js +285 -0
- package/src/controllers/organizations/plugins.js +21 -0
- package/src/controllers/organizations/schemas/add-key-body.schema.json +35 -0
- package/src/controllers/organizations/schemas/create-did-service.schema.json +70 -0
- package/src/controllers/organizations/schemas/did-key.schema.json +178 -0
- package/src/controllers/organizations/schemas/full-organization.schema.json +35 -0
- package/src/controllers/organizations/schemas/index.js +33 -0
- package/src/controllers/organizations/schemas/invitationCodeProperty.schema.json +3 -0
- package/src/controllers/organizations/schemas/organization-ids.schema.json +34 -0
- package/src/controllers/organizations/schemas/organization-kyb-profile-creation.schema.json +26 -0
- package/src/controllers/organizations/schemas/organization-profile-creation.schema.json +20 -0
- package/src/controllers/organizations/schemas/organization-profile-update.schema.json +19 -0
- package/src/controllers/organizations/schemas/organization-profile-verifiable-credential.schema.json +25 -0
- package/src/controllers/organizations/schemas/organization-registry-service-response.schema.json +26 -0
- package/src/controllers/organizations/schemas/organization-service.schema.json +34 -0
- package/src/controllers/organizations/schemas/organization-verified-profile.schema.json +123 -0
- package/src/controllers/organizations/schemas/organization.search-profile.query-params.schema.json +50 -0
- package/src/controllers/organizations/schemas/organization.search.query-params.schema.json +42 -0
- package/src/controllers/reference/controller.js +103 -0
- package/src/controllers/resolve-did/controller.js +45 -0
- package/src/controllers/resolve-did/resolve-did.js +30 -0
- package/src/controllers/resolve-did/schemas/did-doc.schema.json +155 -0
- package/src/controllers/resolve-did/schemas/did-proof.schema.json +44 -0
- package/src/controllers/resolve-did/schemas/index.js +26 -0
- package/src/controllers/resolve-did/schemas/public-key.schema.json +173 -0
- package/src/controllers/resolve-kid/controller.js +76 -0
- package/src/controllers/resolve-kid/public-key-formats.js +8 -0
- package/src/controllers/service-types/controller.js +81 -0
- package/src/controllers/setup_image_upload/controller.js +99 -0
- package/src/controllers/signatories/controller.js +43 -0
- package/src/controllers/users/autohooks.js +10 -0
- package/src/controllers/users/controller.js +221 -0
- package/src/controllers/users/schemas/base-user.schema.json +55 -0
- package/src/controllers/users/schemas/index.js +4 -0
- package/src/controllers/users/schemas/modify-user.schema.js +17 -0
- package/src/controllers/users/schemas/user.schema.js +20 -0
- package/src/entities/groups/domain/constants.js +21 -0
- package/src/entities/groups/domain/index.js +19 -0
- package/src/entities/groups/factories/groups-factory.js +48 -0
- package/src/entities/groups/factories/index.js +17 -0
- package/src/entities/groups/index.js +19 -0
- package/src/entities/groups/repo.js +122 -0
- package/src/entities/images/domain/constant.js +11 -0
- package/src/entities/images/domain/index.js +3 -0
- package/src/entities/images/extension/activate.extension.js +35 -0
- package/src/entities/images/extension/deactivate.extension.js +27 -0
- package/src/entities/images/extension/find-by-url.extension.js +24 -0
- package/src/entities/images/extension/index.js +5 -0
- package/src/entities/images/factories/images-factory.js +43 -0
- package/src/entities/images/factories/index.js +17 -0
- package/src/entities/images/index.js +5 -0
- package/src/entities/images/repo.js +43 -0
- package/src/entities/images/schema/image-metadata.schema.js +58 -0
- package/src/entities/images/schema/index.js +3 -0
- package/src/entities/index.js +31 -0
- package/src/entities/invitations/domains/build-invitation-url.js +14 -0
- package/src/entities/invitations/domains/get-given-family-name-from-name.js +20 -0
- package/src/entities/invitations/domains/index.js +7 -0
- package/src/entities/invitations/domains/init-invitation-emails.js +17 -0
- package/src/entities/invitations/domains/is-invitation-expired.js +5 -0
- package/src/entities/invitations/domains/validate-invitee-email.js +18 -0
- package/src/entities/invitations/factories/index.js +17 -0
- package/src/entities/invitations/factories/invitations-factory.js +51 -0
- package/src/entities/invitations/index.js +6 -0
- package/src/entities/invitations/orchestrators/accept-invitation.js +24 -0
- package/src/entities/invitations/orchestrators/index.js +4 -0
- package/src/entities/invitations/orchestrators/send-email-invitee.js +36 -0
- package/src/entities/invitations/repo.js +37 -0
- package/src/entities/invitations/schemas/add-invitation-body.js +122 -0
- package/src/entities/invitations/schemas/get-invitation-response-body.js +20 -0
- package/src/entities/invitations/schemas/index.js +5 -0
- package/src/entities/invitations/schemas/invitation-response-item-body.js +61 -0
- package/src/entities/kms/factories/index.js +17 -0
- package/src/entities/kms/factories/kms-factory.js +31 -0
- package/src/entities/monitors/index.js +17 -0
- package/src/entities/monitors/orchestrators/index.js +17 -0
- package/src/entities/monitors/orchestrators/monitors.js +230 -0
- package/src/entities/oauth/domain/constants.js +23 -0
- package/src/entities/oauth/domain/index.js +5 -0
- package/src/entities/oauth/domain/roles.js +92 -0
- package/src/entities/oauth/domain/scopes.js +35 -0
- package/src/entities/oauth/index.js +4 -0
- package/src/entities/oauth/orchestrators/auth0-provisioner.js +293 -0
- package/src/entities/oauth/orchestrators/index.js +3 -0
- package/src/entities/organization-keys/domains/build-organization-key.js +50 -0
- package/src/entities/organization-keys/domains/constants.js +30 -0
- package/src/entities/organization-keys/domains/extract-verification-method-from-byo-did-document.js +38 -0
- package/src/entities/organization-keys/domains/find-key-by-purpose.js +6 -0
- package/src/entities/organization-keys/domains/index.js +10 -0
- package/src/entities/organization-keys/domains/jwk-to-hex-key-transformer.js +13 -0
- package/src/entities/organization-keys/domains/map-key-response.js +29 -0
- package/src/entities/organization-keys/domains/validate-non-custodial-key.js +11 -0
- package/src/entities/organization-keys/domains/validate-organization-key.js +42 -0
- package/src/entities/organization-keys/factories/index.js +17 -0
- package/src/entities/organization-keys/factories/organization-keys-factory.js +55 -0
- package/src/entities/organization-keys/index.js +5 -0
- package/src/entities/organization-keys/orchestrators/add-key-to-did-doc.js +19 -0
- package/src/entities/organization-keys/orchestrators/add-key.js +155 -0
- package/src/entities/organization-keys/orchestrators/add-operator-keys.js +46 -0
- package/src/entities/organization-keys/orchestrators/delete-key.js +93 -0
- package/src/entities/organization-keys/orchestrators/get-key.js +39 -0
- package/src/entities/organization-keys/orchestrators/index.js +24 -0
- package/src/entities/organization-keys/orchestrators/resolve-verification-method-byo-did.js +28 -0
- package/src/entities/organization-keys/repos/repo.js +48 -0
- package/src/entities/organization-services/adapters/index.js +21 -0
- package/src/entities/organization-services/adapters/init-provision-auth0-client-grants.js +44 -0
- package/src/entities/organization-services/adapters/init-provision-auth0-clients.js +56 -0
- package/src/entities/organization-services/adapters/update-blockchain-permissions-from-permitted-services.js +118 -0
- package/src/entities/organization-services/domains/activate-services.js +12 -0
- package/src/entities/organization-services/domains/build-organizations-services.js +38 -0
- package/src/entities/organization-services/domains/build-public-services.js +19 -0
- package/src/entities/organization-services/domains/constants.js +32 -0
- package/src/entities/organization-services/domains/extract-cao-service-refs.js +10 -0
- package/src/entities/organization-services/domains/extract-service-endpoint-did.js +10 -0
- package/src/entities/organization-services/domains/get-service-consent-type.js +16 -0
- package/src/entities/organization-services/domains/get-service-types-from-categories.js +18 -0
- package/src/entities/organization-services/domains/index.js +17 -0
- package/src/entities/organization-services/domains/is-new-node-operator-service.js +25 -0
- package/src/entities/organization-services/domains/is-service-category.js +31 -0
- package/src/entities/organization-services/domains/normalize-service-endpoint.js +6 -0
- package/src/entities/organization-services/domains/select-activated-services.js +8 -0
- package/src/entities/organization-services/domains/transform-profile-service.js +88 -0
- package/src/entities/organization-services/domains/validate-cao-service-refs.js +25 -0
- package/src/entities/organization-services/domains/validate-service-credential-type.js +47 -0
- package/src/entities/organization-services/domains/validate-service-endpoint.js +35 -0
- package/src/entities/organization-services/domains/validate-service-fields-by-service-type.js +37 -0
- package/src/entities/organization-services/domains/validate-service-id-uniqueness.js +19 -0
- package/src/entities/organization-services/domains/validate-service-key-purposes.js +56 -0
- package/src/entities/organization-services/domains/validate-service-type.js +12 -0
- package/src/entities/organization-services/domains/validate-service.js +80 -0
- package/src/entities/organization-services/domains/validate-services-for-delete.js +32 -0
- package/src/entities/organization-services/index.js +5 -0
- package/src/entities/organization-services/orchestrators/add-service.js +106 -0
- package/src/entities/organization-services/orchestrators/delete-service.js +142 -0
- package/src/entities/organization-services/orchestrators/get-service.js +36 -0
- package/src/entities/organization-services/orchestrators/index.js +8 -0
- package/src/entities/organization-services/orchestrators/init-add-service-to-organization.js +141 -0
- package/src/entities/organization-services/orchestrators/load-cao-service-refs.js +56 -0
- package/src/entities/organization-services/orchestrators/update-service.js +103 -0
- package/src/entities/organizations/adapters/index.js +6 -0
- package/src/entities/organizations/adapters/init-organization-registrar-emails.js +215 -0
- package/src/entities/organizations/adapters/init-send-activation-emails-to-caos.js +89 -0
- package/src/entities/organizations/adapters/send-email-invitation-accepted-to-inviter.js +70 -0
- package/src/entities/organizations/adapters/send-email-notifications.js +212 -0
- package/src/entities/organizations/domains/build-custodied-did-web.js +12 -0
- package/src/entities/organizations/domains/build-full-organization-response.js +40 -0
- package/src/entities/organizations/domains/build-organization-modifications-on-service-change.js +82 -0
- package/src/entities/organizations/domains/build-profile-vc-url.js +8 -0
- package/src/entities/organizations/domains/build-profile-verifiable-credential.js +36 -0
- package/src/entities/organizations/domains/build-public-profile.js +9 -0
- package/src/entities/organizations/domains/constants.js +54 -0
- package/src/entities/organizations/domains/index.js +17 -0
- package/src/entities/organizations/domains/organization-vc-checks.js +49 -0
- package/src/entities/organizations/domains/parse-profile-to-csv.js +41 -0
- package/src/entities/organizations/domains/prepare-profile-vc.js +28 -0
- package/src/entities/organizations/domains/profile-name-normalization.js +5 -0
- package/src/entities/organizations/domains/validate-byo-did-keys.js +28 -0
- package/src/entities/organizations/domains/validate-profile-name.js +48 -0
- package/src/entities/organizations/domains/validate-profile-website.js +17 -0
- package/src/entities/organizations/domains/validate-update-profile.js +11 -0
- package/src/entities/organizations/factories/index.js +17 -0
- package/src/entities/organizations/factories/organizations-factory.js +180 -0
- package/src/entities/organizations/index.js +6 -0
- package/src/entities/organizations/orchestrators/add-primary-permissions.js +28 -0
- package/src/entities/organizations/orchestrators/build-custodied-organization.js +92 -0
- package/src/entities/organizations/orchestrators/build-non-custodied-organization.js +83 -0
- package/src/entities/organizations/orchestrators/index.js +6 -0
- package/src/entities/organizations/orchestrators/init-create-organization.js +221 -0
- package/src/entities/organizations/orchestrators/init-provision-group.js +48 -0
- package/src/entities/organizations/orchestrators/verify-profile-website-unique.js +15 -0
- package/src/entities/organizations/repos/find-caos-extension.js +49 -0
- package/src/entities/organizations/repos/index.js +17 -0
- package/src/entities/organizations/repos/repo.js +156 -0
- package/src/entities/organizations/repos/search-by-aggregation-extension.js +128 -0
- package/src/entities/organizations/repos/transform-did-filter.js +13 -0
- package/src/entities/organizations/repos/transform-organization-filter.js +106 -0
- package/src/entities/registrar-consents/constants.js +10 -0
- package/src/entities/registrar-consents/factories/index.js +17 -0
- package/src/entities/registrar-consents/factories/registrar-consents-factory.js +38 -0
- package/src/entities/registrar-consents/index.js +3 -0
- package/src/entities/registrar-consents/repos/registrar-consent-repo-extension.js +55 -0
- package/src/entities/registrar-consents/repos/repo.js +31 -0
- package/src/entities/signatories/domain/constants.js +12 -0
- package/src/entities/signatories/domain/index.js +4 -0
- package/src/entities/signatories/domain/organization-emails.js +29 -0
- package/src/entities/signatories/factories/index.js +17 -0
- package/src/entities/signatories/factories/signatory-status-factory.js +53 -0
- package/src/entities/signatories/index.js +5 -0
- package/src/entities/signatories/orchestrators/approve-reminder.js +24 -0
- package/src/entities/signatories/orchestrators/index.js +6 -0
- package/src/entities/signatories/orchestrators/reject-reminder.js +17 -0
- package/src/entities/signatories/orchestrators/send-reminders.js +102 -0
- package/src/entities/signatories/orchestrators/validate-auth-code.js +56 -0
- package/src/entities/signatories/repos/index.js +3 -0
- package/src/entities/signatories/repos/repo.js +35 -0
- package/src/entities/signatories/repos/signatory-status-state-repo-extension.js +124 -0
- package/src/entities/users/domains/constants.js +40 -0
- package/src/entities/users/domains/index.js +4 -0
- package/src/entities/users/domains/user-registrar-emails.js +52 -0
- package/src/entities/users/index.js +4 -0
- package/src/entities/users/orchestrators/create-auth0-user.js +60 -0
- package/src/entities/users/orchestrators/get-or-create-auth0-user.js +63 -0
- package/src/entities/users/orchestrators/index.js +22 -0
- package/src/entities/users/orchestrators/user-management.js +157 -0
- package/src/fetchers/index.js +19 -0
- package/src/fetchers/monitoring/index.js +9 -0
- package/src/fetchers/monitoring/monitor-add-to-page-fetcher.js +18 -0
- package/src/fetchers/monitoring/monitor-create-fetcher.js +23 -0
- package/src/fetchers/monitoring/monitor-delete-fetcher.js +6 -0
- package/src/fetchers/monitoring/monitor-get-all-fetcher.js +6 -0
- package/src/fetchers/monitoring/section-create-fetcher.js +16 -0
- package/src/fetchers/monitoring/section-get-all-fetcher.js +6 -0
- package/src/fetchers/monitoring/service-version-fetcher.js +6 -0
- package/src/helpers/init-permissions-contract.js +48 -0
- package/src/index.js +23 -0
- package/src/init-server.js +91 -0
- package/src/organizations-registrar-endpoints.js +68 -0
- package/src/plugins/authorization.js +233 -0
- package/src/plugins/index.js +4 -0
- package/src/plugins/pubsub-plugin.js +82 -0
- package/src/subscribers/notify-caos.js +63 -0
- package/src/subscribers/notify-inviters.js +42 -0
- package/src/subscribers/notify-monitoring.js +40 -0
- package/src/subscribers/notify-signatory.js +51 -0
- package/src/subscribers/notify-support-and-groups.js +95 -0
- package/src/templates/invitee-invitation-email-body.hbs +13 -0
- package/src/templates/invitee-invitation-email-subject.hbs +1 -0
- package/src/templates/signatory-approval-email-body.hbs +92 -0
- package/src/templates/support-organization-created-body.hbs +17 -0
- package/src/templates/support-organization-created-subject.hbs +1 -0
- package/src/templates/support-signatory-max-reminders-reached-email-body.hbs +6 -0
- package/src/templates/support-signatory-max-reminders-reached-email-subject.hbs +1 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Velocity Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
const { initSendEmailInvitationAcceptedToInviter } = require('../entities');
|
|
18
|
+
|
|
19
|
+
const notifyInviters = async (fastify) => {
|
|
20
|
+
const sendEmailInvitationAcceptedToInviter =
|
|
21
|
+
initSendEmailInvitationAcceptedToInviter(fastify);
|
|
22
|
+
|
|
23
|
+
const eventHandler = (
|
|
24
|
+
{ payload: { organization, invitation, addedServices, caoServiceRefs } },
|
|
25
|
+
context
|
|
26
|
+
) =>
|
|
27
|
+
sendEmailInvitationAcceptedToInviter(
|
|
28
|
+
{
|
|
29
|
+
organization,
|
|
30
|
+
invitation,
|
|
31
|
+
addedServices,
|
|
32
|
+
caoServiceRefs,
|
|
33
|
+
},
|
|
34
|
+
context
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
fastify
|
|
38
|
+
.pubsub('notifyInviters')
|
|
39
|
+
.subscribe('organizations', 'created', eventHandler)
|
|
40
|
+
.subscribe('services', 'added', eventHandler);
|
|
41
|
+
};
|
|
42
|
+
module.exports = notifyInviters;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Velocity Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
const { addMonitors } = require('../entities');
|
|
19
|
+
|
|
20
|
+
const notifyMonitoring = async (fastify) => {
|
|
21
|
+
const eventHandler = (
|
|
22
|
+
{ payload: { organization, addedServices } },
|
|
23
|
+
context
|
|
24
|
+
) =>
|
|
25
|
+
addMonitors(
|
|
26
|
+
{
|
|
27
|
+
orgId: organization.didDoc.id,
|
|
28
|
+
orgName: organization.profile.name,
|
|
29
|
+
orgServices: addedServices,
|
|
30
|
+
},
|
|
31
|
+
context
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
fastify
|
|
35
|
+
.pubsub('notifyMonitoring')
|
|
36
|
+
.subscribe('organizations', 'created', eventHandler)
|
|
37
|
+
.subscribe('services', 'added', eventHandler);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
module.exports = notifyMonitoring;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Velocity Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
const { nanoid } = require('nanoid');
|
|
18
|
+
const {
|
|
19
|
+
initSendEmailNotifications,
|
|
20
|
+
SignatoryEventStatus,
|
|
21
|
+
} = require('../entities');
|
|
22
|
+
|
|
23
|
+
const notifySignatory = async (fastify) => {
|
|
24
|
+
const { sendEmailToSignatoryForOrganizationApproval } =
|
|
25
|
+
initSendEmailNotifications(fastify);
|
|
26
|
+
|
|
27
|
+
fastify
|
|
28
|
+
.pubsub('notifySignatory')
|
|
29
|
+
.subscribe(
|
|
30
|
+
'organizations',
|
|
31
|
+
'created',
|
|
32
|
+
async ({ payload: { organization } }, context) => {
|
|
33
|
+
const authCode = nanoid();
|
|
34
|
+
|
|
35
|
+
await context.repos.signatoryStatus.insertWithState({
|
|
36
|
+
organizationId: organization._id,
|
|
37
|
+
states: [SignatoryEventStatus.LINK_SENT],
|
|
38
|
+
authCode,
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
await sendEmailToSignatoryForOrganizationApproval(
|
|
42
|
+
{
|
|
43
|
+
organization,
|
|
44
|
+
authCode,
|
|
45
|
+
},
|
|
46
|
+
context
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
module.exports = notifySignatory;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Velocity Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
const { map } = require('lodash/fp');
|
|
18
|
+
const {
|
|
19
|
+
initSendEmailNotifications,
|
|
20
|
+
initAuth0Provisioner,
|
|
21
|
+
} = require('../entities');
|
|
22
|
+
|
|
23
|
+
const notifySupportAndGroups = async (fastify) => {
|
|
24
|
+
const {
|
|
25
|
+
sendOrganizationCreatedNotification,
|
|
26
|
+
sendServiceNotificationToGroup,
|
|
27
|
+
sendServiceNotification,
|
|
28
|
+
} = initSendEmailNotifications(fastify);
|
|
29
|
+
const { getUsersByIds } = initAuth0Provisioner(fastify.config);
|
|
30
|
+
|
|
31
|
+
fastify
|
|
32
|
+
.pubsub('notifySupportAndGroups')
|
|
33
|
+
.subscribe(
|
|
34
|
+
'organizations',
|
|
35
|
+
'created',
|
|
36
|
+
async (
|
|
37
|
+
{ payload: { organization, addedServices, activatedServiceIds } },
|
|
38
|
+
context
|
|
39
|
+
) => {
|
|
40
|
+
return Promise.all([
|
|
41
|
+
sendOrganizationCreatedNotification({ organization }, context),
|
|
42
|
+
sendServiceNotificationToGroup(
|
|
43
|
+
{
|
|
44
|
+
organization,
|
|
45
|
+
addedServices,
|
|
46
|
+
activatedServiceIds,
|
|
47
|
+
isCreateOrganization: true,
|
|
48
|
+
},
|
|
49
|
+
context
|
|
50
|
+
),
|
|
51
|
+
]);
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
.subscribe(
|
|
55
|
+
'services',
|
|
56
|
+
'added',
|
|
57
|
+
async (
|
|
58
|
+
{ payload: { organization, addedServices, activatedServiceIds } },
|
|
59
|
+
context
|
|
60
|
+
) => {
|
|
61
|
+
await sendServiceNotificationToGroup(
|
|
62
|
+
{
|
|
63
|
+
organization,
|
|
64
|
+
addedServices,
|
|
65
|
+
activatedServiceIds,
|
|
66
|
+
isCreateOrganization: false,
|
|
67
|
+
},
|
|
68
|
+
context
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
.subscribe(
|
|
73
|
+
'services',
|
|
74
|
+
'activated',
|
|
75
|
+
async ({ payload: { organization, activatedServiceIds } }, context) => {
|
|
76
|
+
const { clientAdminIds } = await context.repos.groups.findGroupByDid(
|
|
77
|
+
organization.didDoc.id
|
|
78
|
+
);
|
|
79
|
+
const userEmails = map(
|
|
80
|
+
'email',
|
|
81
|
+
await getUsersByIds({ userIds: clientAdminIds })
|
|
82
|
+
);
|
|
83
|
+
await sendServiceNotification(
|
|
84
|
+
{
|
|
85
|
+
organization,
|
|
86
|
+
userEmails,
|
|
87
|
+
activatedServiceIds,
|
|
88
|
+
},
|
|
89
|
+
context
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
module.exports = notifySupportAndGroups;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
You've received an invitation from {{inviterOrganization.profile.name}} to join Velocity Network™.
|
|
2
|
+
<br>
|
|
3
|
+
<br>
|
|
4
|
+
For more information about Velocity Network™ and self-sovereign credentials, <a href="https://www.velocitynetwork.foundation/">visit the Velocity Network Foundation® website.</a>.
|
|
5
|
+
<br>
|
|
6
|
+
<br>
|
|
7
|
+
Click the button below to accept the invitation and finish registering your organization.
|
|
8
|
+
<br>
|
|
9
|
+
<br>
|
|
10
|
+
Click the button below to accept the invitation and complete your organization’s registration. This will include setting up your account and creating your organization's profile with a logo, website, company description, LinkedIn company page ID, and more.
|
|
11
|
+
<br>
|
|
12
|
+
<br>
|
|
13
|
+
<a href="{{{uri}}}" target="_blank">ACCEPT INVITATION</a>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Invitation by {{inviterOrganization.profile.name}} to Join Velocity Network™
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<p>Dear {{organization.profile.signatoryGivenName}} {{organization.profile.signatoryFamilyName}},
|
|
2
|
+
</p>
|
|
3
|
+
<p>
|
|
4
|
+
As part of ongoing service enhancements for {{organization.profile.name}},
|
|
5
|
+
{{#if inviterOrganization}}
|
|
6
|
+
{{inviterOrganization.profile.name}}
|
|
7
|
+
{{else}}
|
|
8
|
+
{{organization.profile.adminGivenName}} {{organization.profile.adminFamilyName}}
|
|
9
|
+
{{/if}}
|
|
10
|
+
has registered your organization to the Velocity Network to enable expanded functionality.
|
|
11
|
+
<br />
|
|
12
|
+
To learn more about Velocity Network, please visit
|
|
13
|
+
<a href="https://www.velocitynetwork.foundation/" target="_blank">
|
|
14
|
+
https://www.velocitynetwork.foundation/
|
|
15
|
+
</a>.
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
<p>
|
|
19
|
+
{{#if organization.services.length}}
|
|
20
|
+
{{organization.profile.name}} has been assigned the following role(s) on Velocity Network:
|
|
21
|
+
{{else}}
|
|
22
|
+
{{organization.profile.name}} has not yet been assigned a role on Velocity Network:
|
|
23
|
+
{{/if}}
|
|
24
|
+
</p>
|
|
25
|
+
|
|
26
|
+
<ul>
|
|
27
|
+
{{#each organization.services}}
|
|
28
|
+
<li>
|
|
29
|
+
<span style="border: none; cursor: pointer;">
|
|
30
|
+
{{lookup ../ServiceTypeLabels [type]}}
|
|
31
|
+
</span>
|
|
32
|
+
</li>
|
|
33
|
+
{{else}}
|
|
34
|
+
{{/each}}
|
|
35
|
+
</ul>
|
|
36
|
+
<br/>
|
|
37
|
+
<p>Please confirm your approval of the following:</p>
|
|
38
|
+
<ul>
|
|
39
|
+
<li>You are the authorized signatory for your organization.</li>
|
|
40
|
+
<li>
|
|
41
|
+
{{organization.profile.adminGivenName}}
|
|
42
|
+
{{organization.profile.adminFamilyName}}
|
|
43
|
+
({{organization.profile.adminEmail}})
|
|
44
|
+
has been nominated as the administrator of
|
|
45
|
+
{{organization.profile.name}}
|
|
46
|
+
on the Velocity Network.
|
|
47
|
+
</li>
|
|
48
|
+
<li>
|
|
49
|
+
{{organization.profile.adminGivenName}}
|
|
50
|
+
{{organization.profile.adminFamilyName}}
|
|
51
|
+
({{organization.profile.adminEmail}})
|
|
52
|
+
is authorized to accept the applicable
|
|
53
|
+
<a href="https://www.velocitynetwork.foundation/main2/participation-agreements" target="_blank">
|
|
54
|
+
terms of participation
|
|
55
|
+
</a>.
|
|
56
|
+
</li>
|
|
57
|
+
</ul>
|
|
58
|
+
<div style="display: inline-block">
|
|
59
|
+
<a href="{{config.registrarAppUiUrl}}/signatories/approve?authCode={{authCode}}&did={{organization.didDoc.id}}"
|
|
60
|
+
target="_blank"
|
|
61
|
+
style="border: none; color: white; background-color: #0277ff; text-decoration: none; padding: 5px 15px; text-align:
|
|
62
|
+
center; display: inline-block; font-size: 16px; margin: 4px 2px; cursor: pointer;">
|
|
63
|
+
Approve
|
|
64
|
+
</a>
|
|
65
|
+
<span> </span>
|
|
66
|
+
<a href="{{config.registrarAppUiUrl}}/signatories/reject?authCode={{authCode}}&did={{organization.didDoc.id}}"
|
|
67
|
+
target="_blank"
|
|
68
|
+
style=" border: none; color: white; background-color: #0277ff; text-decoration: none; padding: 5px 15px; text-align:
|
|
69
|
+
center; display: inline-block; font-size: 16px; margin: 4px 2px; cursor: pointer; "
|
|
70
|
+
>
|
|
71
|
+
Reject
|
|
72
|
+
</a>
|
|
73
|
+
</div>
|
|
74
|
+
<br/>
|
|
75
|
+
<p>
|
|
76
|
+
<strong>If the buttons above do not work, please copy and paste the appropriate link into your browser:</strong>
|
|
77
|
+
</p>
|
|
78
|
+
<p>
|
|
79
|
+
<strong>Approve:</strong>
|
|
80
|
+
<br/>
|
|
81
|
+
<span>
|
|
82
|
+
{{config.registrarAppUiUrl}}/signatories/approve?authCode={{authCode}}&did={{organization.didDoc.id}}
|
|
83
|
+
</span>
|
|
84
|
+
</p>
|
|
85
|
+
<p>
|
|
86
|
+
<strong>Reject:</strong>
|
|
87
|
+
<br/>
|
|
88
|
+
<span>
|
|
89
|
+
{{config.registrarAppUiUrl}}/signatories/reject?authCode={{authCode}}&did={{organization.didDoc.id}}
|
|
90
|
+
</span>
|
|
91
|
+
</p>
|
|
92
|
+
<br/>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Organization {{organization.profile.name}} was created by
|
|
2
|
+
{{organization.profile.adminGivenName}} {{organization.profile.adminFamilyName}}
|
|
3
|
+
and an approval request was sent to
|
|
4
|
+
{{organization.profile.signatoryGivenName}} {{organization.profile.signatoryFamilyName}}.
|
|
5
|
+
|
|
6
|
+
The organization was registered by:
|
|
7
|
+
Given name: {{organization.profile.adminGivenName}}
|
|
8
|
+
Family name: {{organization.profile.adminFamilyName}}
|
|
9
|
+
Job title: {{organization.profile.adminTitle}}
|
|
10
|
+
Email: {{organization.profile.adminEmail}}
|
|
11
|
+
|
|
12
|
+
Signatory details:
|
|
13
|
+
Given name: {{organization.profile.signatoryGivenName}}
|
|
14
|
+
Family name: {{organization.profile.signatoryFamilyName}}
|
|
15
|
+
Job title: {{organization.profile.signatoryTitle}}
|
|
16
|
+
Email: {{organization.profile.signatoryEmail}}
|
|
17
|
+
`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Organization {{organization.profile.name}} created
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<p>
|
|
2
|
+
The Velocity Network has sent the maximum number of reminder emails to {{organization.profile.name}}
|
|
3
|
+
signatory, {{organization.profile.signatoryGivenName}} {{organization.profile.signatoryFamilyName}}.
|
|
4
|
+
<br>
|
|
5
|
+
They will not receive any more automatic emails regarding signatory duties.
|
|
6
|
+
</p>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Maximum signatory reminder alert for {{organization.profile.name}}
|