@velocitycareerlabs/server-webwallet 1.25.0-dev-build.12642c864

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.
Files changed (193) hide show
  1. package/.localdev.env +57 -0
  2. package/.standalone.env +22 -0
  3. package/LICENSE +248 -0
  4. package/README.md +11 -0
  5. package/jest.config.js +20 -0
  6. package/migrate-mongo.config.js +23 -0
  7. package/package.json +72 -0
  8. package/src/config/config.js +74 -0
  9. package/src/controllers/accounts/autohooks.js +28 -0
  10. package/src/controllers/accounts/controller.js +209 -0
  11. package/src/controllers/accounts/schemas/index.js +6 -0
  12. package/src/controllers/accounts/schemas/webwallet-accounts-request.schema.js +25 -0
  13. package/src/controllers/accounts/schemas/webwallet-accounts-response.schema.js +72 -0
  14. package/src/controllers/accounts/schemas/webwallet-accounts-update-request.schema.js +23 -0
  15. package/src/controllers/accounts/schemas/webwallet-test-personas-response.schema.js +110 -0
  16. package/src/controllers/consent/autohooks.js +14 -0
  17. package/src/controllers/consent/controller.js +91 -0
  18. package/src/controllers/consent/schemas/index.js +3 -0
  19. package/src/controllers/consent/schemas/webwallet-consent-response.schema.js +23 -0
  20. package/src/controllers/credentials/autohooks.js +36 -0
  21. package/src/controllers/credentials/controller.js +92 -0
  22. package/src/controllers/credentials/schemas/index.js +4 -0
  23. package/src/controllers/credentials/schemas/webwallet-credential-categories-response.schema.js +21 -0
  24. package/src/controllers/credentials/schemas/webwallet-credentials-response.schema.js +29 -0
  25. package/src/controllers/disclosures/autohooks.js +21 -0
  26. package/src/controllers/disclosures/controller.js +168 -0
  27. package/src/controllers/disclosures/schemas/index.js +7 -0
  28. package/src/controllers/disclosures/schemas/webwallet-accept-presentation-request-body.schema.js +28 -0
  29. package/src/controllers/disclosures/schemas/webwallet-accept-presentation-response.schema.js +16 -0
  30. package/src/controllers/disclosures/schemas/webwallet-get-disclosures-response.schema.js +18 -0
  31. package/src/controllers/disclosures/schemas/webwallet-get-presentation-request-query.schema.js +21 -0
  32. package/src/controllers/disclosures/schemas/webwallet-get-presentation-request-response.schema.js +16 -0
  33. package/src/controllers/feedback/autohooks.js +11 -0
  34. package/src/controllers/feedback/controller.js +48 -0
  35. package/src/controllers/issuing/common-schemas/index.js +10 -0
  36. package/src/controllers/issuing/common-schemas/webwallet-get-credential-manifest-query.schema.js +27 -0
  37. package/src/controllers/issuing/common-schemas/webwallet-get-credential-manifest-response.schema.js +31 -0
  38. package/src/controllers/issuing/deep-link/autohooks.js +51 -0
  39. package/src/controllers/issuing/deep-link/controller.js +192 -0
  40. package/src/controllers/issuing/deep-link/schemas/index.js +6 -0
  41. package/src/controllers/issuing/deep-link/schemas/webwallet-deep-link-accept-offers-request.schema.js +30 -0
  42. package/src/controllers/issuing/deep-link/schemas/webwallet-deep-link-accept-offers-response.schema.js +36 -0
  43. package/src/controllers/issuing/deep-link/schemas/webwallet-deep-link-offers-request.schema.js +28 -0
  44. package/src/controllers/issuing/deep-link/schemas/webwallet-deep-link-offers-response.schema.js +48 -0
  45. package/src/controllers/issuing/identity-credentials/autohooks.js +42 -0
  46. package/src/controllers/issuing/identity-credentials/controller.js +188 -0
  47. package/src/controllers/issuing/identity-credentials/schemas/index.js +6 -0
  48. package/src/controllers/issuing/identity-credentials/schemas/webwallet-identity-credentials-confirm-body.schema.js +20 -0
  49. package/src/controllers/issuing/identity-credentials/schemas/webwallet-identity-credentials-confirm-response.schema.js +37 -0
  50. package/src/controllers/issuing/identity-credentials/schemas/webwallet-identity-credentials-request-code-body.schema.js +14 -0
  51. package/src/controllers/issuing/identity-credentials/schemas/webwallet-identity-credentials-request-code-params.schema.js +19 -0
  52. package/src/controllers/linkedin/autohooks.js +16 -0
  53. package/src/controllers/linkedin/controller.js +276 -0
  54. package/src/controllers/linkedin/schemas/index.js +3 -0
  55. package/src/controllers/linkedin/schemas/webwallet-linkedin-me-response.schema.js +14 -0
  56. package/src/controllers/root/controller.js +29 -0
  57. package/src/entities/.gitkeep +0 -0
  58. package/src/entities/accounts/constants.js +5 -0
  59. package/src/entities/accounts/domains/extract-auth0-id-token-or-access-token.js +22 -0
  60. package/src/entities/accounts/domains/index.js +5 -0
  61. package/src/entities/accounts/domains/validate-account-permissions.js +36 -0
  62. package/src/entities/accounts/domains/validate-logo-size.js +25 -0
  63. package/src/entities/accounts/index.js +5 -0
  64. package/src/entities/accounts/repos/accounts.repo.js +63 -0
  65. package/src/entities/credentials/domains/index.js +3 -0
  66. package/src/entities/credentials/domains/offer-to-credential-mongo-dto.js +43 -0
  67. package/src/entities/credentials/index.js +6 -0
  68. package/src/entities/credentials/orchestrators/index.js +3 -0
  69. package/src/entities/credentials/orchestrators/load-additional-render-info.js +65 -0
  70. package/src/entities/credentials/repos/credentials.repo.js +132 -0
  71. package/src/entities/credentials/schemas/index.js +4 -0
  72. package/src/entities/credentials/schemas/webwallet-credential-response.schema.js +138 -0
  73. package/src/entities/credentials/schemas/webwallet-credentials-response.schemas.js +95 -0
  74. package/src/entities/credentials/schemas/webwallet-display-descriptor-response.schema.js +106 -0
  75. package/src/entities/disclosures/index.js +4 -0
  76. package/src/entities/disclosures/repos/disclosures.repo.js +31 -0
  77. package/src/entities/disclosures/schemas/index.js +10 -0
  78. package/src/entities/disclosures/schemas/webwallet-disclosure.schema.js +39 -0
  79. package/src/entities/disclosures/schemas/webwallet-presentation-request-field.schema.js +45 -0
  80. package/src/entities/disclosures/schemas/webwallet-presentation-request-filter.schema.js +30 -0
  81. package/src/entities/disclosures/schemas/webwallet-presentation-request-format.schema.js +36 -0
  82. package/src/entities/disclosures/schemas/webwallet-presentation-request-input-descriptors.schema.js +111 -0
  83. package/src/entities/disclosures/schemas/webwallet-presentation-request-schema.schema.js +14 -0
  84. package/src/entities/disclosures/schemas/webwallet-presentation-request-submission-requirements.schema.js +37 -0
  85. package/src/entities/disclosures/schemas/webwallet-presentation-request.schema.js +79 -0
  86. package/src/entities/index.js +6 -0
  87. package/src/entities/issuing/domain/constants.js +8 -0
  88. package/src/entities/issuing/domain/does-user-have-fresh-pending-verification.js +26 -0
  89. package/src/entities/issuing/domain/get-credentials-from-offers.js +18 -0
  90. package/src/entities/issuing/domain/index.js +5 -0
  91. package/src/entities/issuing/index.js +5 -0
  92. package/src/entities/issuing/orchestrators/build-issuing-input-credentials.js +35 -0
  93. package/src/entities/issuing/orchestrators/generate-offers-by-deep-link.js +74 -0
  94. package/src/entities/issuing/orchestrators/get-identity-issuer.js +35 -0
  95. package/src/entities/issuing/orchestrators/get-identity-offers-by-deeplink.js +74 -0
  96. package/src/entities/issuing/orchestrators/index.js +6 -0
  97. package/src/entities/issuing/schemas/index.js +9 -0
  98. package/src/entities/issuing/schemas/webwallet-credential-manifest.schema.js +198 -0
  99. package/src/errors/error-codes.js +12 -0
  100. package/src/fetchers/career-wallet/create-account-fetcher.js +7 -0
  101. package/src/fetchers/career-wallet/create-did-fetcher.js +17 -0
  102. package/src/fetchers/career-wallet/get-app-config.js +11 -0
  103. package/src/fetchers/career-wallet/get-consents.js +13 -0
  104. package/src/fetchers/career-wallet/get-credential-categories.js +7 -0
  105. package/src/fetchers/career-wallet/get-personas.js +7 -0
  106. package/src/fetchers/career-wallet/index.js +12 -0
  107. package/src/fetchers/career-wallet/post-consent.js +9 -0
  108. package/src/fetchers/career-wallet/send-feedback.js +14 -0
  109. package/src/fetchers/career-wallet/sign-fetcher.js +14 -0
  110. package/src/fetchers/career-wallet/verify-id-credential-confirm-code.js +19 -0
  111. package/src/fetchers/career-wallet/verify-id-credential-request-code.js +20 -0
  112. package/src/fetchers/index.js +4 -0
  113. package/src/fetchers/lib-api/get-credential-display-schema.js +12 -0
  114. package/src/fetchers/lib-api/index.js +3 -0
  115. package/src/fetchers/linkedin/create-linkedin-post.js +45 -0
  116. package/src/fetchers/linkedin/get-access-token.js +26 -0
  117. package/src/fetchers/linkedin/get-linkedin-user-email.js +13 -0
  118. package/src/fetchers/linkedin/get-linkedin-user-id.js +16 -0
  119. package/src/fetchers/linkedin/index.js +9 -0
  120. package/src/fetchers/linkedin/register-image-to-upload.js +30 -0
  121. package/src/fetchers/linkedin/revoke-linkedin-access.js +20 -0
  122. package/src/fetchers/linkedin/upload-image-to-linkedin.js +16 -0
  123. package/src/index.js +15 -0
  124. package/src/init-server.js +108 -0
  125. package/src/plugins/crypto-services/index.js +5 -0
  126. package/src/plugins/crypto-services/jwt-sign-service-impl.js +72 -0
  127. package/src/plugins/crypto-services/jwt-verify-service-impl.js +21 -0
  128. package/src/plugins/crypto-services/key-service-impl.js +28 -0
  129. package/src/plugins/fetch-errors-handler-plugin.js +64 -0
  130. package/src/plugins/index.js +4 -0
  131. package/src/plugins/vnf-sdk-plugin.js +53 -0
  132. package/src/standalone.js +8 -0
  133. package/test/accounts-controller.test.js +618 -0
  134. package/test/consent-controller.test.js +185 -0
  135. package/test/credentials-controller.test.js +307 -0
  136. package/test/crypro-services/jwt-sign-service-impl.test.js +83 -0
  137. package/test/crypro-services/jwt-verify-service-impl.test.js +27 -0
  138. package/test/crypro-services/key-service-impl.test.js +76 -0
  139. package/test/crypro-services/mocks/index.js +4 -0
  140. package/test/crypro-services/mocks/jwt-mock.js +15 -0
  141. package/test/crypro-services/mocks/public-jwk.js +14 -0
  142. package/test/disclosures-controller/disclosure-credentials.test.js +428 -0
  143. package/test/disclosures-controller/get-disclosures.test.js +169 -0
  144. package/test/disclosures-controller/mocks/get-credential-manifest.js +20 -0
  145. package/test/disclosures-controller/mocks/index.js +6 -0
  146. package/test/disclosures-controller/mocks/presentation-request.js +32 -0
  147. package/test/disclosures-controller/mocks/presentation-submission.js +21 -0
  148. package/test/disclosures-controller/mocks/submission-result.js +19 -0
  149. package/test/factories/accounts.js +25 -0
  150. package/test/factories/credentials.js +66 -0
  151. package/test/factories/disclosures.js +106 -0
  152. package/test/feedback-controller.test.js +125 -0
  153. package/test/fetch-errors-handler-plugin.test.js +97 -0
  154. package/test/filter-deleted-credentials-extension.test.js +82 -0
  155. package/test/helpers/.env.test +10 -0
  156. package/test/helpers/nock-consent-add.js +16 -0
  157. package/test/helpers/nock-consents-get.js +15 -0
  158. package/test/helpers/nock-feedback.js +9 -0
  159. package/test/helpers/nock-linkedin-access-token.js +9 -0
  160. package/test/helpers/nock-linkedin-email.js +15 -0
  161. package/test/helpers/nock-linkedin-image-register.js +28 -0
  162. package/test/helpers/nock-linkedin-me.js +13 -0
  163. package/test/helpers/nock-linkedin-post.js +37 -0
  164. package/test/helpers/nock-linkedin-revoke.js +9 -0
  165. package/test/helpers/nock-test-personas.js +13 -0
  166. package/test/helpers/webwallet-build-fastify.js +17 -0
  167. package/test/issuing-controller/issuing-by-deeplink-empty-offers.test.js +142 -0
  168. package/test/issuing-controller/issuing-by-deeplink-failed-offers.test.js +142 -0
  169. package/test/issuing-controller/issuing-by-deeplink.test.js +492 -0
  170. package/test/issuing-controller/issuing-identity-credentials.test.js +377 -0
  171. package/test/issuing-controller/mocks/accept-offers-response.js +90 -0
  172. package/test/issuing-controller/mocks/accepted-credentials.js +47 -0
  173. package/test/issuing-controller/mocks/credential-manifest-presentation.js +72 -0
  174. package/test/issuing-controller/mocks/credential-manifest.js +45 -0
  175. package/test/issuing-controller/mocks/identity-issuing/accept-offers.js +22 -0
  176. package/test/issuing-controller/mocks/identity-issuing/confirm-verification-code.js +5 -0
  177. package/test/issuing-controller/mocks/identity-issuing/get-app-config.js +52 -0
  178. package/test/issuing-controller/mocks/identity-issuing/get-organization.js +118 -0
  179. package/test/issuing-controller/mocks/identity-issuing/index.js +6 -0
  180. package/test/issuing-controller/mocks/index.js +6 -0
  181. package/test/issuing-controller/mocks/issuers.js +126 -0
  182. package/test/issuing-controller/mocks/offers.js +48 -0
  183. package/test/issuing-controller/mocks/schema.js +107 -0
  184. package/test/linkedin-controller.test.js +452 -0
  185. package/test/mocks/credential-categories.js +115 -0
  186. package/test/mocks/credentials.js +15 -0
  187. package/test/mocks/didjwk.js +25 -0
  188. package/test/mocks/index.js +7 -0
  189. package/test/mocks/issuers.js +88 -0
  190. package/test/mocks/jwk.js +53 -0
  191. package/test/mocks/schema.js +107 -0
  192. package/test/root.test.js +42 -0
  193. package/test/vcl-sdk-plugin.test.js +86 -0
@@ -0,0 +1,22 @@
1
+ /* eslint-disable max-len */
2
+ const acceptOffersMock = {
3
+ passedCredentials: [
4
+ {
5
+ signedJwt: {
6
+ header:
7
+ 'eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NksiLCJraWQiOiJkaWQ6dmVsb2NpdHk6djI6MHg2MjU2YjE4OTIxZWFiZDM5MzUxZWMyM2YxYzk0Zjg4MDYwNGU3MGU3OjIwMjk1MjY3MDA3NDYxMDo5MjMzI2tleS0xIn0',
8
+ payload:
9
+ 'eyJ2YyI6eyJ0eXBlIjpbIkVtYWlsVjEuMCIsIlZlcmlmaWFibGVDcmVkZW50aWFsIl0sImlkIjoiZGlkOnZlbG9jaXR5OnYyOjB4NjI1NmIxODkyMWVhYmQzOTM1MWVjMjNmMWM5NGY4ODA2MDRlNzBlNzoyMDI5NTI2NzAwNzQ2MTA6OTIzMyIsImNyZWRlbnRpYWxTdGF0dXMiOnsidHlwZSI6IlZlbG9jaXR5UmV2b2NhdGlvbkxpc3RKYW4yMDIxIiwiaWQiOiJldGhlcmV1bToweEQ4OTBGMkQ2MEI0MjlmOWUyNTdGQzBCYzU4RWYyMjM3Nzc2REQ5MUIvZ2V0UmV2b2tlZFN0YXR1cz9hZGRyZXNzPTB4NjI1NmIxODkyMUVhQkQzOTM1MWVDMjNGMUM5NGY4ODA2MDRlNzBFNyZsaXN0SWQ9MjQxMjQ2OTI4OTc3Nzk3JmluZGV4PTMzMzUiLCJzdGF0dXNMaXN0SW5kZXgiOjMzMzUsInN0YXR1c0xpc3RDcmVkZW50aWFsIjoiZXRoZXJldW06MHhEODkwRjJENjBCNDI5ZjllMjU3RkMwQmM1OEVmMjIzNzc3NkREOTFCL2dldFJldm9rZWRTdGF0dXM_YWRkcmVzcz0weDYyNTZiMTg5MjFFYUJEMzkzNTFlQzIzRjFDOTRmODgwNjA0ZTcwRTcmbGlzdEl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RzL2NyZWRlbnRpYWwtZXh0ZW5zaW9ucy0yMDIyLmpzb25sZC5qc29uIl0sImNyZWRlbnRpYWxTdWJqZWN0Ijp7ImVtYWlsIjoidmFsZXJha3l6bUBnbWFpbC5jb20iLCJ0eXBlIjoiRW1haWwiLCJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSIsImh0dHBzOi8vZGV2bGliLnZlbG9jaXR5bmV0d29yay5mb3VuZGF0aW9uL2NvbnRleHRzL2xheWVyMS12MS4wLmpzb25sZC5qc29uIl19fSwibmJmIjoxNzA0MjgxNzg0LCJqdGkiOiJkaWQ6dmVsb2NpdHk6djI6MHg2MjU2YjE4OTIxZWFiZDM5MzUxZWMyM2YxYzk0Zjg4MDYwNGU3MGU3OjIwMjk1MjY3MDA3NDYxMDo5MjMzIiwiaXNzIjoiZGlkOmlvbjpFaUFlaFdtcFg1bUhCdWM5M1NJaFBYRjhic0V4NjhHNm1QY2RJYUxOR2JvelBBIiwiaWF0IjoxNzA0MjgxNzg0fQ.Od7NkhThQgBaCGjR0ZpJ05ZIFmGVaEm8RPSzHlzGYG9nkX0QeYhKDEYllvXjLBkZv50MZdNpLhhtpJF55pUGAw',
15
+ },
16
+ ],
17
+ failedCredentials: [],
18
+ };
19
+
20
+ module.exports = {
21
+ acceptOffersMock,
22
+ };
@@ -0,0 +1,5 @@
1
+ const confirmVerificationCodeMock = { token: '3ozF14srt3drS_9lL3p1e' };
2
+
3
+ module.exports = {
4
+ confirmVerificationCodeMock,
5
+ };
@@ -0,0 +1,52 @@
1
+ /* eslint-disable max-len */
2
+ const getAppConfigMock = {
3
+ ios: {
4
+ isWalletAvailable: true,
5
+ },
6
+ android: {
7
+ isWalletAvailable: true,
8
+ },
9
+ yotiIDV: true,
10
+ latestAndroidVersion: '1.15.0',
11
+ latestIOSVersion: '1.15.0',
12
+ minAndroidVersion: '1.15.0',
13
+ minIOSVersion: '1.15.0',
14
+ pushUrl: 'https://devwalletapi.velocitycareerlabs.io/api/v0.6/push',
15
+ verificationServiceDeepLink:
16
+ 'velocity-network-devnet://inspect?request_uri=https%3A%2F%2Fdevcredverifyagent.velocitycareerlabs.io%2Fapi%2Fholder%2Fv0.6%2Forg%2Fdid%3Aion%3AEiAehWmpX5mHBuc93SIhPXF8bsEx68G6mPcdIaLNGbozPA%2Finspect%2Fget-presentation-request%3Fid%3D63639cbc2ef4ceb24a5adf8e&inspectorDid=did%3Aion%3AEiAehWmpX5mHBuc93SIhPXF8bsEx68G6mPcdIaLNGbozPA',
17
+ verificationServicePresentationLinkTemplate:
18
+ 'https://devapp.prove.bio/presentations/{linkCode}',
19
+ emailVerifierDid: 'did:ion:EiAehWmpX5mHBuc93SIhPXF8bsEx68G6mPcdIaLNGbozPA',
20
+ idVerifierDid: 'did:ion:EiAehWmpX5mHBuc93SIhPXF8bsEx68G6mPcdIaLNGbozPA',
21
+ phoneVerifierDid: 'did:ion:EiAehWmpX5mHBuc93SIhPXF8bsEx68G6mPcdIaLNGbozPA',
22
+ yotiNewSessionUrl: 'https://devverifierapi.velocitycareerlabs.io',
23
+ baseUrls: {
24
+ walletApi: 'https://devwalletapi.velocitycareerlabs.io',
25
+ verificationApi: 'https://devverifierapi.velocitycareerlabs.io',
26
+ verificationServiceActionBaseUrl:
27
+ 'https://devapi.prove.bio/holder-api/org/did:ion:EiAehWmpX5mHBuc93SIhPXF8bsEx68G6mPcdIaLNGbozPA',
28
+ presentationExtensionPeriodURL:
29
+ 'https://devapi.prove.bio/holder-api/org/get-extension-period',
30
+ libVnfUrl: 'https://devlib.velocitynetwork.foundation',
31
+ registrarVnfUrl: 'https://devregistrar.velocitynetwork.foundation',
32
+ },
33
+ sdk: { cacheSequence: 5, isDirectIssuerCheckOn: false },
34
+ oauth: {
35
+ oauthAudience: 'walletapi.velocitycareerlabs.io',
36
+ clientId: 'ZK2VKezjWNuRVUEMBXjpcp12T46Q91sb',
37
+ },
38
+ commonUrls: {
39
+ supportLink: 'https://www.velocitycareerlabs.com/faq',
40
+ termsAndConditionsLink: 'https://app.prove.bio/privacy-policy',
41
+ },
42
+ linkedinEndpoints: {
43
+ authUrl: 'https://www.linkedin.com/oauth/v2',
44
+ apiUrl: 'https://api.linkedin.com/v2',
45
+ addToProfileUrl: 'https://www.linkedin.com/profile/add',
46
+ addToFeed: 'https://www.linkedin.com/feed/update',
47
+ },
48
+ };
49
+
50
+ module.exports = {
51
+ getAppConfigMock,
52
+ };
@@ -0,0 +1,118 @@
1
+ /* eslint-disable max-len */
2
+ const getOrganizationMock = {
3
+ all: [
4
+ {
5
+ serviceCredentialAgentIssuers: [
6
+ {
7
+ type: 'VlcCredentialAgentOperator_v1',
8
+ id: '#credential-agent-operator-1',
9
+ serviceEndpoint: 'https://devagent.velocitycareerlabs.io',
10
+ },
11
+ {
12
+ type: 'VlcNotaryIdDocumentIssuer_v1',
13
+ id: '#identity-credentials-issuer-1',
14
+ serviceEndpoint:
15
+ 'https://devidverifagent.velocitycareerlabs.io/api/holder/v0.6/org/did:ion:EiAehWmpX5mHBuc93SIhPXF8bsEx68G6mPcdIaLNGbozPA/issue/get-credential-manifest',
16
+ credentialTypes: [
17
+ 'IdDocumentV1.0',
18
+ 'DriversLicenseV1.0',
19
+ 'NationalIdCardV1.0',
20
+ 'PassportV1.0',
21
+ 'ResidentPermitV1.0',
22
+ 'ProofOfAgeV1.0',
23
+ ],
24
+ },
25
+ {
26
+ type: 'VlcNotaryContactIssuer_v1',
27
+ id: '#email-phone-issuer',
28
+ serviceEndpoint:
29
+ 'https://devverifagent.velocitycareerlabs.io/api/holder/v0.6/org/did:ion:EiAehWmpX5mHBuc93SIhPXF8bsEx68G6mPcdIaLNGbozPA/issue/get-credential-manifest',
30
+ credentialTypes: ['EmailV1.0', 'PhoneV1.0'],
31
+ },
32
+ {
33
+ type: 'VlcInspector_v1',
34
+ id: '#vlc-inspector-v-1',
35
+ serviceEndpoint: 'https://devagent.velocitycareerlabs.io',
36
+ },
37
+ {
38
+ type: 'VlcHolderAppProvider_v1',
39
+ id: '#vlc-holder-app-provider-v-1-1',
40
+ serviceEndpoint: 'https://devwalletapi.velocitycareerlabs.io',
41
+ },
42
+ ],
43
+ payload: {
44
+ name: 'Velocity Career Labs',
45
+ location: { countryCode: 'IL', regionCode: 'IL' },
46
+ logo: 'https://media-exp1.licdn.com/dms/image/C4E0BAQGb2hBaIfTLMw/company-logo_200_200/0/1579081568902?e=2147483647&v=beta&t=MOjIM-esL1fgn8sq-Sb-m_FpkMQ1nKoKDoUfObsghgA',
47
+ founded: '2018',
48
+ type: 'company',
49
+ physicalAddress: {
50
+ line1: 'xxxx',
51
+ line2: 'xxxx',
52
+ line3: 'xxxx',
53
+ regionCode: 'XX-XX',
54
+ countryCode: 'XX',
55
+ postcode: 'xxxx',
56
+ },
57
+ linkedInProfile: 'https://xxxx.xxx',
58
+ id: 'did:ion:EiAehWmpX5mHBuc93SIhPXF8bsEx68G6mPcdIaLNGbozPA',
59
+ verifiableCredentialJwt:
60
+ 'https://devregistrar.velocitynetwork.foundation/api/v0.6/organizations/did:ion:EiAehWmpX5mHBuc93SIhPXF8bsEx68G6mPcdIaLNGbozPA/resolve-vc/84b12428-9b9c-4fba-bc17-ebe33d2b18ba',
61
+ service: [
62
+ {
63
+ type: 'VlcCredentialAgentOperator_v1',
64
+ id: '#credential-agent-operator-1',
65
+ serviceEndpoint: 'https://devagent.velocitycareerlabs.io',
66
+ },
67
+ {
68
+ type: 'VlcNotaryIdDocumentIssuer_v1',
69
+ id: '#identity-credentials-issuer-1',
70
+ serviceEndpoint:
71
+ 'https://devidverifagent.velocitycareerlabs.io/api/holder/v0.6/org/did:ion:EiAehWmpX5mHBuc93SIhPXF8bsEx68G6mPcdIaLNGbozPA/issue/get-credential-manifest',
72
+ credentialTypes: [
73
+ 'IdDocumentV1.0',
74
+ 'DriversLicenseV1.0',
75
+ 'NationalIdCardV1.0',
76
+ 'PassportV1.0',
77
+ 'ResidentPermitV1.0',
78
+ 'ProofOfAgeV1.0',
79
+ ],
80
+ },
81
+ {
82
+ type: 'VlcNotaryContactIssuer_v1',
83
+ id: '#email-phone-issuer',
84
+ serviceEndpoint:
85
+ 'https://devverifagent.velocitycareerlabs.io/api/holder/v0.6/org/did:ion:EiAehWmpX5mHBuc93SIhPXF8bsEx68G6mPcdIaLNGbozPA/issue/get-credential-manifest',
86
+ credentialTypes: ['EmailV1.0', 'PhoneV1.0'],
87
+ },
88
+ {
89
+ type: 'VlcInspector_v1',
90
+ id: '#vlc-inspector-v-1',
91
+ serviceEndpoint: 'https://devagent.velocitycareerlabs.io',
92
+ },
93
+ {
94
+ type: 'VlcHolderAppProvider_v1',
95
+ id: '#vlc-holder-app-provider-v-1-1',
96
+ serviceEndpoint: 'https://devwalletapi.velocitycareerlabs.io',
97
+ },
98
+ ],
99
+ permittedVelocityServiceCategory: [
100
+ 'CredentialAgentOperator',
101
+ 'NotaryIdDocumentIssuer',
102
+ 'NotaryContactIssuer',
103
+ 'Inspector',
104
+ 'HolderAppProvider',
105
+ 'IdentityIssuer',
106
+ ],
107
+ createdAt: '2022-01-31T12:31:15.493Z',
108
+ updatedAt: '2023-02-13T13:43:59.317Z',
109
+ supportsSecureMessages: false,
110
+ },
111
+ TAG: 'VCLOrganization',
112
+ },
113
+ ],
114
+ };
115
+
116
+ module.exports = {
117
+ getOrganizationMock,
118
+ };
@@ -0,0 +1,6 @@
1
+ module.exports = {
2
+ ...require('./accept-offers'),
3
+ ...require('./confirm-verification-code'),
4
+ ...require('./get-app-config'),
5
+ ...require('./get-organization'),
6
+ };
@@ -0,0 +1,6 @@
1
+ module.exports = {
2
+ ...require('./offers'),
3
+ ...require('./credential-manifest'),
4
+ ...require('./accepted-credentials'),
5
+ ...require('./accept-offers-response'),
6
+ };
@@ -0,0 +1,126 @@
1
+ /* eslint-disable max-len */
2
+ const mockIssuers = {
3
+ all: [
4
+ {
5
+ serviceCredentialAgentIssuers: [
6
+ {
7
+ type: 'VlcCredentialAgentOperator_v1',
8
+ id: '#credential-agent-operator-1',
9
+ serviceEndpoint: 'https://devagent.velocitycareerlabs.io',
10
+ },
11
+ {
12
+ type: 'VlcNotaryIdDocumentIssuer_v1',
13
+ id: '#identity-credentials-issuer-1',
14
+ serviceEndpoint:
15
+ 'https://devidverifagent.velocitycareerlabs.io/api/holder/v0.6/org/did:ion:EiAehWmpX5mHBuc93SIhPXF8bsEx68G6mPcdIaLNGbozPA/issue/get-credential-manifest',
16
+ credentialTypes: [
17
+ 'IdDocumentV1.0',
18
+ 'DriversLicenseV1.0',
19
+ 'NationalIdCardV1.0',
20
+ 'PassportV1.0',
21
+ 'ResidentPermitV1.0',
22
+ 'ProofOfAgeV1.0',
23
+ ],
24
+ },
25
+ {
26
+ type: 'VlcNotaryContactIssuer_v1',
27
+ id: '#email-phone-issuer',
28
+ serviceEndpoint:
29
+ 'https://devverifagent.velocitycareerlabs.io/api/holder/v0.6/org/did:ion:EiAehWmpX5mHBuc93SIhPXF8bsEx68G6mPcdIaLNGbozPA/issue/get-credential-manifest',
30
+ credentialTypes: ['EmailV1.0', 'PhoneV1.0'],
31
+ },
32
+ {
33
+ type: 'VlcInspector_v1',
34
+ id: '#vlc-inspector-v-1',
35
+ serviceEndpoint: 'https://devagent.velocitycareerlabs.io',
36
+ },
37
+ {
38
+ type: 'VlcHolderAppProvider_v1',
39
+ id: '#vlc-holder-app-provider-v-1-1',
40
+ serviceEndpoint: 'https://devwalletapi.velocitycareerlabs.io',
41
+ },
42
+ ],
43
+ payload: {
44
+ name: 'University of Massachusetts Amherst',
45
+ location: {
46
+ countryCode: 'US',
47
+ regionCode: 'MA',
48
+ },
49
+ logo: 'https://upload.wikimedia.org/wikipedia/commons/4/4f/UMass_Seal_Medium_PMS_202.png',
50
+ website: 'https://www.umass.edu/',
51
+ contactEmail: 'test@test.com',
52
+ technicalEmail: 'test@test.com',
53
+ description:
54
+ 'Test org, primarily for Issuing Education and Cource credentials',
55
+ founded: '2023-04-04',
56
+ type: 'company',
57
+ physicalAddress: {
58
+ line1: 'xxxx',
59
+ line2: 'xxxx',
60
+ line3: 'xxxx',
61
+ regionCode: 'XX-XX',
62
+ countryCode: 'XX',
63
+ postcode: 'xxxx',
64
+ },
65
+ linkedInProfile: 'https://xxxx.xxx',
66
+ id: 'did:ion:EiApMLdMb4NPb8sae9-hXGHP79W1gisApVSE80USPEbtJA',
67
+ verifiableCredentialJwt:
68
+ 'https://devregistrar.velocitynetwork.foundation/api/v0.6/organizations/did:ion:EiApMLdMb4NPb8sae9-hXGHP79W1gisApVSE80USPEbtJA/resolve-vc/a78a9c37-0345-4eb4-83da-53ad4322500e',
69
+ service: [
70
+ {
71
+ type: 'VlcCareerIssuer_v1',
72
+ id: '#velocity-issuer-1',
73
+ serviceEndpoint:
74
+ 'https://devagent.velocitycareerlabs.io/api/holder/v0.6/org/did:ion:EiApMLdMb4NPb8sae9-hXGHP79W1gisApVSE80USPEbtJA/issue/get-credential-manifest',
75
+ credentialTypes: [
76
+ 'EducationDegree',
77
+ 'EducationDegreeRegistrationV1.0',
78
+ 'EducationDegreeStudyV1.0',
79
+ 'EducationDegreeGraduationV1.0',
80
+ 'EducationDegreeRegistrationV1.1',
81
+ 'EducationDegreeStudyV1.1',
82
+ 'EducationDegreeGraduationV1.1',
83
+ 'PastEmploymentPosition',
84
+ 'CurrentEmploymentPosition',
85
+ 'EmploymentCurrentV1.0',
86
+ 'EmploymentPastV1.0',
87
+ 'EmploymentCurrentV1.1',
88
+ 'EmploymentPastV1.1',
89
+ 'Certification',
90
+ 'CertificationV1.0',
91
+ 'LicenseV1.0',
92
+ 'CertificationV1.1',
93
+ 'LicenseV1.1',
94
+ 'Course',
95
+ 'CourseRegistrationV1.0',
96
+ 'CourseCompletionV1.0',
97
+ 'CourseAttendanceV1.0',
98
+ 'CourseRegistrationV1.1',
99
+ 'CourseCompletionV1.1',
100
+ 'CourseAttendanceV1.1',
101
+ 'AssessmentDec2020',
102
+ 'AssessmentV1.0',
103
+ 'AssessmentV1.1',
104
+ 'Badge',
105
+ 'OpenBadgeV1.0',
106
+ ],
107
+ },
108
+ {
109
+ type: 'VlcInspector_v1',
110
+ id: '#velocity-inspector-1',
111
+ serviceEndpoint: 'https://devagent.velocitycareerlabs.io',
112
+ },
113
+ ],
114
+ permittedVelocityServiceCategory: ['Issuer', 'Inspector'],
115
+ createdAt: '2022-03-01T10:17:38.542Z',
116
+ updatedAt: '2023-06-26T13:36:05.180Z',
117
+ supportsSecureMessages: false,
118
+ },
119
+ TAG: 'VCLOrganization',
120
+ },
121
+ ],
122
+ };
123
+
124
+ module.exports = {
125
+ mockIssuers,
126
+ };
@@ -0,0 +1,48 @@
1
+ const {
2
+ VCLToken,
3
+ VCLOffers,
4
+ } = require('@velocitycareerlabs/vnf-nodejs-wallet-sdk');
5
+ const {
6
+ VCLOffer,
7
+ } = require('@velocitycareerlabs/vnf-nodejs-wallet-sdk/dist/api/entities/VCLOffer');
8
+
9
+ const mockOffer = new VCLOffer({
10
+ type: ['OpenBadgeV2.0'],
11
+ issuer: { id: 'did:ion:EiApMLdMb4NPb8sae9-hXGHP79W1gisApVSE80USPEbtJA' },
12
+ credentialSubject: {
13
+ hasCredential: {
14
+ id: 'https://example.com/velocity-badge.json',
15
+ type: 'BadgeClass',
16
+ name: 'Velocity Badge',
17
+ description: 'For issuing a Badge on the Velocity Network',
18
+ image:
19
+ 'https://www.velocitynetwork.foundation/wp-content/uploads/2020/02/fb.jpg',
20
+ criteria: 'https://example.com/velocity-badge.html',
21
+ issuer: 'did:ion:EiApMLdMb4NPb8sae9-hXGHP79W1gisApVSE80USPEbtJA',
22
+ },
23
+ type: 'Badge',
24
+ },
25
+ credentialSchema: {
26
+ type: 'JsonSchemaValidator2018',
27
+ id: 'https://devregistrar.velocitynetwork.foundation/schemas/open-badge-v2.0.schema.json',
28
+ },
29
+ offerCreationDate: '2020-08-04T21:13:32.019Z',
30
+ offerExpirationDate: '2024-08-04T21:13:32.019Z',
31
+ offerId: 'ptIQrgxaicFX0QPVf_Z1L',
32
+ id: '650c2a93cea3b3a53b1bb1f0',
33
+ exchangeId: '650c2a58cea3b3a53b1bb1ef',
34
+ hash: 'e6111d72559b84448ee3c844d4d3dafaa63cf97091ee203c68e257fab9cf0337',
35
+ });
36
+ const sessionToken = new VCLToken(
37
+ // eslint-disable-next-line max-len
38
+ 'eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NksifQ.eyJqdGkiOiI2NTBjMmE1OGNlYTNiM2E1M2IxYmIxZWYiLCJpc3MiOiJkaWQ6aW9uOkVpQXBNTGRNYjROUGI4c2FlOS1oWEdIUDc5VzFnaXNBcFZTRTgwVVNQRWJ0SkEiLCJhdWQiOiJkaWQ6aW9uOkVpQXBNTGRNYjROUGI4c2FlOS1oWEdIUDc5VzFnaXNBcFZTRTgwVVNQRWJ0SkEiLCJleHAiOjE2OTgzOTU1OTIsInN1YiI6IjY1MGM1ZGYwMmRlYTdjZWRjZDIyZmU1YyIsImlhdCI6MTY5NTgwMzU5Mn0.5p6p6aT5WnZo41_i-Gv77XT1wuOBC4EhUPXYWyV77b81yFRRzBj09BPEg9OJ1rOCaoJ3eh8Vyts4IboVn3GA6Q'
39
+ );
40
+
41
+ const mockOffers = new VCLOffers({}, [mockOffer], 200, sessionToken);
42
+
43
+ const mockEmptyOffers = new VCLOffers({}, [], 200, sessionToken);
44
+
45
+ module.exports = {
46
+ mockOffers,
47
+ mockEmptyOffers,
48
+ };
@@ -0,0 +1,107 @@
1
+ const mockSchema = {
2
+ title: {
3
+ path: [
4
+ '$.hasCredential.issuer.name',
5
+ '$.hasCredential.issuer.id',
6
+ '$.hasCredential.issuer',
7
+ ],
8
+ schema: {
9
+ type: 'string',
10
+ },
11
+ fallback: '-',
12
+ },
13
+ subtitle: {
14
+ text: 'Open Badge',
15
+ },
16
+ summary_detail: {
17
+ path: ['$.hasCredential.name'],
18
+ schema: {
19
+ type: 'string',
20
+ },
21
+ fallback: '-',
22
+ },
23
+ description: {
24
+ text: 'Open badge',
25
+ },
26
+ logo: {
27
+ path: ['$.hasCredential.image'],
28
+ schema: {
29
+ type: 'string',
30
+ format: 'uri',
31
+ },
32
+ },
33
+ properties: [
34
+ {
35
+ label: 'Badge name',
36
+ path: ['$.hasCredential.name'],
37
+ schema: {
38
+ type: 'string',
39
+ },
40
+ fallback: '-',
41
+ },
42
+ {
43
+ label: '',
44
+ path: ['$.hasCredential.image'],
45
+ schema: {
46
+ type: 'string',
47
+ },
48
+ },
49
+ {
50
+ label: 'Description',
51
+ path: ['$.hasCredential.description'],
52
+ schema: {
53
+ type: 'string',
54
+ },
55
+ },
56
+ {
57
+ label: 'Type',
58
+ path: ['$.hasCredential.type'],
59
+ schema: {
60
+ type: 'string',
61
+ },
62
+ },
63
+ {
64
+ label: 'Criteria',
65
+ path: ['$.hasCredential.criteria', '$.hasCredential.criteria.narrative'],
66
+ schema: {
67
+ type: 'string',
68
+ },
69
+ },
70
+ {
71
+ label: 'Tags',
72
+ path: ['$.hasCredential.tags'],
73
+ schema: {
74
+ type: 'array',
75
+ items: {
76
+ type: 'string',
77
+ },
78
+ },
79
+ },
80
+ {
81
+ label: 'Alignment',
82
+ path: ['$.hasCredential.alignment[0].targetName'],
83
+ schema: {
84
+ type: 'string',
85
+ },
86
+ },
87
+ {
88
+ label: 'Alignment URL',
89
+ path: ['$.hasCredential.alignment[0].targetUrl'],
90
+ schema: {
91
+ type: 'string',
92
+ format: 'uri',
93
+ },
94
+ },
95
+ {
96
+ label: 'Alignment framework',
97
+ path: ['$.hasCredential.alignment[0].targetFramework'],
98
+ schema: {
99
+ type: 'string',
100
+ },
101
+ },
102
+ ],
103
+ };
104
+
105
+ module.exports = {
106
+ mockSchema,
107
+ };