@metamask-previews/kyc-controller 0.0.0-preview-8bfa290fb → 0.0.0-preview-ec24abb79

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 (52) hide show
  1. package/CHANGELOG.md +0 -6
  2. package/dist/KycController.cjs +17 -31
  3. package/dist/KycController.cjs.map +1 -1
  4. package/dist/KycController.d.cts +3 -3
  5. package/dist/KycController.d.cts.map +1 -1
  6. package/dist/KycController.d.mts +3 -3
  7. package/dist/KycController.d.mts.map +1 -1
  8. package/dist/KycController.mjs +17 -31
  9. package/dist/KycController.mjs.map +1 -1
  10. package/dist/KycService-method-action-types.cjs.map +1 -1
  11. package/dist/KycService-method-action-types.d.cts +6 -23
  12. package/dist/KycService-method-action-types.d.cts.map +1 -1
  13. package/dist/KycService-method-action-types.d.mts +6 -23
  14. package/dist/KycService-method-action-types.d.mts.map +1 -1
  15. package/dist/KycService-method-action-types.mjs.map +1 -1
  16. package/dist/KycService.cjs +118 -91
  17. package/dist/KycService.cjs.map +1 -1
  18. package/dist/KycService.d.cts +12 -38
  19. package/dist/KycService.d.cts.map +1 -1
  20. package/dist/KycService.d.mts +12 -38
  21. package/dist/KycService.d.mts.map +1 -1
  22. package/dist/KycService.mjs +118 -91
  23. package/dist/KycService.mjs.map +1 -1
  24. package/dist/index.cjs.map +1 -1
  25. package/dist/index.d.cts +3 -3
  26. package/dist/index.d.cts.map +1 -1
  27. package/dist/index.d.mts +3 -3
  28. package/dist/index.d.mts.map +1 -1
  29. package/dist/index.mjs.map +1 -1
  30. package/dist/types.cjs.map +1 -1
  31. package/dist/types.d.cts +6 -15
  32. package/dist/types.d.cts.map +1 -1
  33. package/dist/types.d.mts +6 -15
  34. package/dist/types.d.mts.map +1 -1
  35. package/dist/types.mjs.map +1 -1
  36. package/dist/ukyc/wrapEncryptionKey.cjs +9 -4
  37. package/dist/ukyc/wrapEncryptionKey.cjs.map +1 -1
  38. package/dist/ukyc/wrapEncryptionKey.d.cts +10 -8
  39. package/dist/ukyc/wrapEncryptionKey.d.cts.map +1 -1
  40. package/dist/ukyc/wrapEncryptionKey.d.mts +10 -8
  41. package/dist/ukyc/wrapEncryptionKey.d.mts.map +1 -1
  42. package/dist/ukyc/wrapEncryptionKey.mjs +9 -4
  43. package/dist/ukyc/wrapEncryptionKey.mjs.map +1 -1
  44. package/package.json +2 -2
  45. package/dist/logger.cjs +0 -9
  46. package/dist/logger.cjs.map +0 -1
  47. package/dist/logger.d.cts +0 -6
  48. package/dist/logger.d.cts.map +0 -1
  49. package/dist/logger.d.mts +0 -6
  50. package/dist/logger.d.mts.map +0 -1
  51. package/dist/logger.mjs +0 -6
  52. package/dist/logger.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"KycService-method-action-types.cjs","sourceRoot":"","sources":["../src/KycService-method-action-types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { KycService } from './KycService.js';\n\n/**\n * Resolves the customer's country from the geolocation source and converts it\n * to an ISO 3166-1 alpha-3 code.\n *\n * @returns The alpha-3 country code.\n * @throws If the country cannot be determined or mapped.\n */\nexport type KycServiceGetGeoCountryAction = {\n type: `KycService:getGeoCountry`;\n handler: KycService['getGeoCountry'];\n};\n\n/**\n * Fetches the disclaimers the customer must accept before a session is\n * created.\n *\n * @param params - The parameters.\n * @param params.vendor - Identity vendor. Defaults to `moonpay`.\n * @param params.country - ISO 3166-1 alpha-3 country code.\n * @returns The disclaimers.\n */\nexport type KycServiceFetchVendorDisclaimersAction = {\n type: `KycService:fetchVendorDisclaimers`;\n handler: KycService['fetchVendorDisclaimers'];\n};\n\n/**\n * Creates a vendor session via the UKYC backend.\n *\n * @param params - The session parameters.\n * @returns The created session token.\n */\nexport type KycServiceCreateSessionAction = {\n type: `KycService:createSession`;\n handler: KycService['createSession'];\n};\n\n/**\n * Checks whether KYC is required for the given vendor, country, and\n * capabilities.\n *\n * @param params - The check parameters.\n * @returns Whether KYC is required.\n */\nexport type KycServiceCheckKycRequiredAction = {\n type: `KycService:checkKycRequired`;\n handler: KycService['checkKycRequired'];\n};\n\n/**\n * Creates (or resumes) an empty-shell customer for the authenticated\n * canonical user on the given identity vendor. Must run before showing\n * vendor T&C so the customer exists and resume logic can key off vendor\n * status.\n *\n * @param params - The parameters.\n * @param params.vendor - Identity vendor (e.g. `iron` for Money/VBA).\n * @param params.email - Email associated with the customer.\n * @returns The vendor customer record (subset validated for controller use).\n */\nexport type KycServiceCreateVendorCustomerAction = {\n type: `KycService:createVendorCustomer`;\n handler: KycService['createVendorCustomer'];\n};\n\n/**\n * Records vendor T&C acceptance (`POST /vendors/{vendor}/disclaimers`).\n * For Iron this creates content signings from the disclaimer ids the\n * customer accepted. Session-scoped idOS / KYC-provider consents are\n * recorded separately via {@link submitSessionDisclaimers}. Retries re-POST\n * the same ids, matching the legacy `POST /consents` signing step.\n *\n * @param params - The parameters.\n * @param params.vendor - Identity vendor (e.g. `iron`).\n * @param params.disclaimerIds - Accepted vendor T&C ids.\n * @returns The vendor signing records.\n */\nexport type KycServiceSubmitVendorDisclaimersAction = {\n type: `KycService:submitVendorDisclaimers`;\n handler: KycService['submitVendorDisclaimers'];\n};\n\n/**\n * Fetches the global idOS + KYC-provider disclaimer catalog\n * (`GET /disclaimers?country=`). Does not include\n * `credentialReusabilityConsentGiven` — that is session-scoped via\n * {@link fetchSessionDisclaimers}. Vendor T&Cs continue to come from\n * {@link fetchVendorDisclaimers}.\n *\n * @param params - The parameters.\n * @param params.country - ISO 3166-1 alpha-3 country code.\n * @returns The catalog documents.\n */\nexport type KycServiceFetchDisclaimersCatalogAction = {\n type: `KycService:fetchDisclaimersCatalog`;\n handler: KycService['fetchDisclaimersCatalog'];\n};\n\n/**\n * Fetches the session-scoped idOS + KYC-provider disclaimer catalog\n * (`GET /sessions/{sessionId}/disclaimers`), including per-session\n * `consented` flags and `credentialReusabilityConsentGiven`. For the\n * pre-session global catalog use {@link fetchDisclaimersCatalog}. Vendor\n * T&Cs continue to come from {@link fetchVendorDisclaimers}.\n *\n * @param params - The parameters.\n * @param params.sessionId - The UKYC session id.\n * @returns The catalog, including which documents are already consented.\n */\nexport type KycServiceFetchSessionDisclaimersAction = {\n type: `KycService:fetchSessionDisclaimers`;\n handler: KycService['fetchSessionDisclaimers'];\n};\n\n/**\n * Records idOS + KYC-provider consents for a UKYC session\n * (`POST /sessions/{sessionId}/disclaimers`). `key`/`version` pairs must\n * match the current catalog from {@link fetchSessionDisclaimers}. A 409\n * means those document versions were already recorded for the session.\n *\n * @param params - The consent parameters.\n * @returns The updated catalog after recording.\n */\nexport type KycServiceSubmitSessionDisclaimersAction = {\n type: `KycService:submitSessionDisclaimers`;\n handler: KycService['submitSessionDisclaimers'];\n};\n\n/**\n * Fetches the user-keyed simplified KYC status used by Money toast / banner\n * surfaces (`GET /kyc/status`).\n *\n * @returns The simplified status payload.\n */\nexport type KycServiceFetchKycStatusAction = {\n type: `KycService:fetchKycStatus`;\n handler: KycService['fetchKycStatus'];\n};\n\n/**\n * Fetches the idOS enclave JWKS used to verify the\n * `encryptionDataKey` schema's `jwtChain` from\n * {@link KycService.createUkycSession}.\n *\n * This is an unauthenticated request to a well-known path on the idOS enclave\n * host, distinct from the UKYC base URL.\n *\n * @returns The JWKS keys.\n */\nexport type KycServiceFetchIdosEnclaveJwksAction = {\n type: `KycService:fetchIdosEnclaveJwks`;\n handler: KycService['fetchIdosEnclaveJwks'];\n};\n\n/**\n * Fetches the idOS relay JWKS used to verify the `ukycCapabilityToken`\n * schema's `jwtChain` from {@link KycService.createUkycSession}.\n *\n * This is an unauthenticated request to a well-known path on the idOS relay\n * host, distinct from both the UKYC base URL and the idOS enclave.\n *\n * @returns The JWKS keys.\n */\nexport type KycServiceFetchIdosRelayJwksAction = {\n type: `KycService:fetchIdosRelayJwks`;\n handler: KycService['fetchIdosRelayJwks'];\n};\n\n/**\n * Creates a UKYC session for the SumSub document-verification sub-flow.\n *\n * The client registers its per-session X25519 public key so the server can\n * later open boxes sealed with the matching private key, and supplies the\n * customer's ISO 3166-1 alpha-3 country of residence. The response\n * carries per-secret encryption schemas (`encryptionDataKey` and\n * `ukycCapabilityToken`) so the client can wrap the `data_encryption_key` and\n * the read-only `ukyc_capability_token` and submit them via\n * {@link KycService.setAuthorizations}.\n *\n * @param params - The session parameters.\n * @returns The UKYC session id and encryption schemas.\n */\nexport type KycServiceCreateUkycSessionAction = {\n type: `KycService:createUkycSession`;\n handler: KycService['createUkycSession'];\n};\n\n/**\n * Submits the wrapped `data_encryption_key` and wrapped\n * `ukyc_capability_token` for a UKYC session. Both secrets are sealed with\n * `wrapEncryptionKey` against the encryption schemas returned by\n * {@link KycService.createUkycSession}.\n *\n * @param params - The wrapped authorizations.\n * @returns The session status after the authorizations are applied.\n */\nexport type KycServiceSetAuthorizationsAction = {\n type: `KycService:setAuthorizations`;\n handler: KycService['setAuthorizations'];\n};\n\n/**\n * Creates (or refreshes) the SumSub verification journey for a UKYC session,\n * returning the applicant access token used to launch the SDK.\n *\n * @param sessionId - The UKYC session id from `createUkycSession`.\n * @returns The applicant access token and status.\n */\nexport type KycServiceCreateJourneyAction = {\n type: `KycService:createJourney`;\n handler: KycService['createJourney'];\n};\n\n/**\n * Fetches the current status of a UKYC session. Polled after the SumSub SDK\n * completes to determine the final verification decision.\n *\n * @param params - The parameters.\n * @param params.sessionId - The UKYC session id.\n * @returns The session status.\n */\nexport type KycServiceGetSessionStatusAction = {\n type: `KycService:getSessionStatus`;\n handler: KycService['getSessionStatus'];\n};\n\n/**\n * Union of all KycService action types.\n */\nexport type KycServiceMethodActions =\n | KycServiceGetGeoCountryAction\n | KycServiceFetchVendorDisclaimersAction\n | KycServiceCreateSessionAction\n | KycServiceCheckKycRequiredAction\n | KycServiceCreateVendorCustomerAction\n | KycServiceSubmitVendorDisclaimersAction\n | KycServiceFetchDisclaimersCatalogAction\n | KycServiceFetchSessionDisclaimersAction\n | KycServiceSubmitSessionDisclaimersAction\n | KycServiceFetchKycStatusAction\n | KycServiceFetchIdosEnclaveJwksAction\n | KycServiceFetchIdosRelayJwksAction\n | KycServiceCreateUkycSessionAction\n | KycServiceSetAuthorizationsAction\n | KycServiceCreateJourneyAction\n | KycServiceGetSessionStatusAction;\n"]}
1
+ {"version":3,"file":"KycService-method-action-types.cjs","sourceRoot":"","sources":["../src/KycService-method-action-types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { KycService } from './KycService.js';\n\n/**\n * Resolves the customer's country from the geolocation source and converts it\n * to an ISO 3166-1 alpha-3 code.\n *\n * @returns The alpha-3 country code.\n * @throws If the country cannot be determined or mapped.\n */\nexport type KycServiceGetGeoCountryAction = {\n type: `KycService:getGeoCountry`;\n handler: KycService['getGeoCountry'];\n};\n\n/**\n * Fetches the disclaimers the customer must accept before a session is\n * created.\n *\n * @param params - The parameters.\n * @param params.vendor - Identity vendor. Defaults to `moonpay`.\n * @param params.country - ISO 3166-1 alpha-3 country code.\n * @returns The disclaimers.\n */\nexport type KycServiceFetchDisclaimersAction = {\n type: `KycService:fetchDisclaimers`;\n handler: KycService['fetchDisclaimers'];\n};\n\n/**\n * Creates a vendor session via the UKYC backend.\n *\n * @param params - The session parameters.\n * @returns The created session token.\n */\nexport type KycServiceCreateSessionAction = {\n type: `KycService:createSession`;\n handler: KycService['createSession'];\n};\n\n/**\n * Checks whether KYC is required for the given vendor, country, and\n * capabilities.\n *\n * @param params - The check parameters.\n * @returns Whether KYC is required.\n */\nexport type KycServiceCheckKycRequiredAction = {\n type: `KycService:checkKycRequired`;\n handler: KycService['checkKycRequired'];\n};\n\n/**\n * Creates (or resumes) an empty-shell customer for the authenticated\n * canonical user on the given identity vendor. Must run before showing\n * vendor T&C so the customer exists and resume logic can key off vendor\n * status.\n *\n * @param params - The parameters.\n * @param params.vendor - Identity vendor (e.g. `iron` for Money/VBA).\n * @param params.email - Email associated with the customer.\n * @returns The vendor customer record (subset validated for controller use).\n */\nexport type KycServiceCreateVendorCustomerAction = {\n type: `KycService:createVendorCustomer`;\n handler: KycService['createVendorCustomer'];\n};\n\n/**\n * Records vendor T&C acceptance (`POST /vendors/{vendor}/disclaimers`).\n * For Iron this creates content signings from the disclaimer ids the\n * customer accepted. Session-scoped idOS / KYC-provider consents are\n * recorded separately via {@link submitSessionDisclaimers}. Retries re-POST\n * the same ids, matching the legacy `POST /consents` signing step.\n *\n * @param params - The parameters.\n * @param params.vendor - Identity vendor (e.g. `iron`).\n * @param params.disclaimerIds - Accepted vendor T&C ids.\n * @returns The vendor signing records.\n */\nexport type KycServiceSubmitVendorDisclaimersAction = {\n type: `KycService:submitVendorDisclaimers`;\n handler: KycService['submitVendorDisclaimers'];\n};\n\n/**\n * Fetches the session-scoped idOS + KYC-provider disclaimer catalog\n * (`GET /sessions/{sessionId}/disclaimers`). Requires an existing UKYC\n * session; vendor T&Cs continue to come from {@link fetchDisclaimers}.\n *\n * @param params - The parameters.\n * @param params.sessionId - The UKYC session id.\n * @returns The catalog, including which documents are already consented.\n */\nexport type KycServiceFetchSessionDisclaimersAction = {\n type: `KycService:fetchSessionDisclaimers`;\n handler: KycService['fetchSessionDisclaimers'];\n};\n\n/**\n * Records idOS + KYC-provider consents for a UKYC session\n * (`POST /sessions/{sessionId}/disclaimers`). `key`/`version` pairs must\n * match the current catalog from {@link fetchSessionDisclaimers}. A 409\n * means those document versions were already recorded for the session.\n *\n * @param params - The consent parameters.\n * @returns The updated catalog after recording.\n */\nexport type KycServiceSubmitSessionDisclaimersAction = {\n type: `KycService:submitSessionDisclaimers`;\n handler: KycService['submitSessionDisclaimers'];\n};\n\n/**\n * Fetches the user-keyed simplified KYC status used by Money toast / banner\n * surfaces (`GET /kyc/status`).\n *\n * @returns The simplified status payload.\n */\nexport type KycServiceFetchKycStatusAction = {\n type: `KycService:fetchKycStatus`;\n handler: KycService['fetchKycStatus'];\n};\n\n/**\n * Fetches the idOS enclave JWKS used to verify the\n * `encryptionDataKey` schema's `jwtChain` from\n * {@link KycService.createUkycSession}.\n *\n * This is an unauthenticated request to a well-known path on the idOS enclave\n * host, distinct from the UKYC base URL.\n *\n * @returns The JWKS keys.\n */\nexport type KycServiceFetchIdosEnclaveJwksAction = {\n type: `KycService:fetchIdosEnclaveJwks`;\n handler: KycService['fetchIdosEnclaveJwks'];\n};\n\n/**\n * Fetches the idOS relay JWKS used to verify the `ukycCapabilityToken`\n * schema's `jwtChain` from {@link KycService.createUkycSession}.\n *\n * This is an unauthenticated request to a well-known path on the idOS relay\n * host, distinct from both the UKYC base URL and the idOS enclave.\n *\n * @returns The JWKS keys.\n */\nexport type KycServiceFetchIdosRelayJwksAction = {\n type: `KycService:fetchIdosRelayJwks`;\n handler: KycService['fetchIdosRelayJwks'];\n};\n\n/**\n * Creates a UKYC session for the SumSub document-verification sub-flow.\n *\n * The client registers its per-session X25519 public key so the server can\n * later open boxes sealed with the matching private key, and supplies the\n * customer's ISO 3166-1 alpha-3 country of residence. The response\n * carries per-secret encryption schemas (`encryptionDataKey` and\n * `ukycCapabilityToken`) so the client can wrap the `data_encryption_key` and\n * the read-only `ukyc_capability_token` and submit them via\n * {@link KycService.setAuthorizations}.\n *\n * @param params - The session parameters.\n * @returns The UKYC session id and encryption schemas.\n */\nexport type KycServiceCreateUkycSessionAction = {\n type: `KycService:createUkycSession`;\n handler: KycService['createUkycSession'];\n};\n\n/**\n * Submits the wrapped `data_encryption_key` and wrapped\n * `ukyc_capability_token` for a UKYC session. Both secrets are sealed with\n * `wrapEncryptionKey` against the encryption schemas returned by\n * {@link KycService.createUkycSession}.\n *\n * @param params - The wrapped authorizations.\n * @returns The session status after the authorizations are applied.\n */\nexport type KycServiceSetAuthorizationsAction = {\n type: `KycService:setAuthorizations`;\n handler: KycService['setAuthorizations'];\n};\n\n/**\n * Creates (or refreshes) the SumSub verification journey for a UKYC session,\n * returning the applicant access token used to launch the SDK.\n *\n * @param sessionId - The UKYC session id from `createUkycSession`.\n * @returns The applicant access token and status.\n */\nexport type KycServiceCreateJourneyAction = {\n type: `KycService:createJourney`;\n handler: KycService['createJourney'];\n};\n\n/**\n * Fetches the current status of a UKYC session. Polled after the SumSub SDK\n * completes to determine the final verification decision.\n *\n * @param params - The parameters.\n * @param params.sessionId - The UKYC session id.\n * @returns The session status.\n */\nexport type KycServiceGetSessionStatusAction = {\n type: `KycService:getSessionStatus`;\n handler: KycService['getSessionStatus'];\n};\n\n/**\n * Union of all KycService action types.\n */\nexport type KycServiceMethodActions =\n | KycServiceGetGeoCountryAction\n | KycServiceFetchDisclaimersAction\n | KycServiceCreateSessionAction\n | KycServiceCheckKycRequiredAction\n | KycServiceCreateVendorCustomerAction\n | KycServiceSubmitVendorDisclaimersAction\n | KycServiceFetchSessionDisclaimersAction\n | KycServiceSubmitSessionDisclaimersAction\n | KycServiceFetchKycStatusAction\n | KycServiceFetchIdosEnclaveJwksAction\n | KycServiceFetchIdosRelayJwksAction\n | KycServiceCreateUkycSessionAction\n | KycServiceSetAuthorizationsAction\n | KycServiceCreateJourneyAction\n | KycServiceGetSessionStatusAction;\n"]}
@@ -23,9 +23,9 @@ export type KycServiceGetGeoCountryAction = {
23
23
  * @param params.country - ISO 3166-1 alpha-3 country code.
24
24
  * @returns The disclaimers.
25
25
  */
26
- export type KycServiceFetchVendorDisclaimersAction = {
27
- type: `KycService:fetchVendorDisclaimers`;
28
- handler: KycService['fetchVendorDisclaimers'];
26
+ export type KycServiceFetchDisclaimersAction = {
27
+ type: `KycService:fetchDisclaimers`;
28
+ handler: KycService['fetchDisclaimers'];
29
29
  };
30
30
  /**
31
31
  * Creates a vendor session via the UKYC backend.
@@ -79,27 +79,10 @@ export type KycServiceSubmitVendorDisclaimersAction = {
79
79
  type: `KycService:submitVendorDisclaimers`;
80
80
  handler: KycService['submitVendorDisclaimers'];
81
81
  };
82
- /**
83
- * Fetches the global idOS + KYC-provider disclaimer catalog
84
- * (`GET /disclaimers?country=`). Does not include
85
- * `credentialReusabilityConsentGiven` — that is session-scoped via
86
- * {@link fetchSessionDisclaimers}. Vendor T&Cs continue to come from
87
- * {@link fetchVendorDisclaimers}.
88
- *
89
- * @param params - The parameters.
90
- * @param params.country - ISO 3166-1 alpha-3 country code.
91
- * @returns The catalog documents.
92
- */
93
- export type KycServiceFetchDisclaimersCatalogAction = {
94
- type: `KycService:fetchDisclaimersCatalog`;
95
- handler: KycService['fetchDisclaimersCatalog'];
96
- };
97
82
  /**
98
83
  * Fetches the session-scoped idOS + KYC-provider disclaimer catalog
99
- * (`GET /sessions/{sessionId}/disclaimers`), including per-session
100
- * `consented` flags and `credentialReusabilityConsentGiven`. For the
101
- * pre-session global catalog use {@link fetchDisclaimersCatalog}. Vendor
102
- * T&Cs continue to come from {@link fetchVendorDisclaimers}.
84
+ * (`GET /sessions/{sessionId}/disclaimers`). Requires an existing UKYC
85
+ * session; vendor T&Cs continue to come from {@link fetchDisclaimers}.
103
86
  *
104
87
  * @param params - The parameters.
105
88
  * @param params.sessionId - The UKYC session id.
@@ -216,5 +199,5 @@ export type KycServiceGetSessionStatusAction = {
216
199
  /**
217
200
  * Union of all KycService action types.
218
201
  */
219
- export type KycServiceMethodActions = KycServiceGetGeoCountryAction | KycServiceFetchVendorDisclaimersAction | KycServiceCreateSessionAction | KycServiceCheckKycRequiredAction | KycServiceCreateVendorCustomerAction | KycServiceSubmitVendorDisclaimersAction | KycServiceFetchDisclaimersCatalogAction | KycServiceFetchSessionDisclaimersAction | KycServiceSubmitSessionDisclaimersAction | KycServiceFetchKycStatusAction | KycServiceFetchIdosEnclaveJwksAction | KycServiceFetchIdosRelayJwksAction | KycServiceCreateUkycSessionAction | KycServiceSetAuthorizationsAction | KycServiceCreateJourneyAction | KycServiceGetSessionStatusAction;
202
+ export type KycServiceMethodActions = KycServiceGetGeoCountryAction | KycServiceFetchDisclaimersAction | KycServiceCreateSessionAction | KycServiceCheckKycRequiredAction | KycServiceCreateVendorCustomerAction | KycServiceSubmitVendorDisclaimersAction | KycServiceFetchSessionDisclaimersAction | KycServiceSubmitSessionDisclaimersAction | KycServiceFetchKycStatusAction | KycServiceFetchIdosEnclaveJwksAction | KycServiceFetchIdosRelayJwksAction | KycServiceCreateUkycSessionAction | KycServiceSetAuthorizationsAction | KycServiceCreateJourneyAction | KycServiceGetSessionStatusAction;
220
203
  //# sourceMappingURL=KycService-method-action-types.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"KycService-method-action-types.d.cts","sourceRoot":"","sources":["../src/KycService-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,yBAAwB;AAElD;;;;;;GAMG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAC1C,IAAI,EAAE,0BAA0B,CAAC;IACjC,OAAO,EAAE,UAAU,CAAC,eAAe,CAAC,CAAC;CACtC,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,sCAAsC,GAAG;IACnD,IAAI,EAAE,mCAAmC,CAAC;IAC1C,OAAO,EAAE,UAAU,CAAC,wBAAwB,CAAC,CAAC;CAC/C,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAC1C,IAAI,EAAE,0BAA0B,CAAC;IACjC,OAAO,EAAE,UAAU,CAAC,eAAe,CAAC,CAAC;CACtC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,gCAAgC,GAAG;IAC7C,IAAI,EAAE,6BAA6B,CAAC;IACpC,OAAO,EAAE,UAAU,CAAC,kBAAkB,CAAC,CAAC;CACzC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,oCAAoC,GAAG;IACjD,IAAI,EAAE,iCAAiC,CAAC;IACxC,OAAO,EAAE,UAAU,CAAC,sBAAsB,CAAC,CAAC;CAC7C,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,uCAAuC,GAAG;IACpD,IAAI,EAAE,oCAAoC,CAAC;IAC3C,OAAO,EAAE,UAAU,CAAC,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;;;;;;GAMG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAC1C,IAAI,EAAE,0BAA0B,CAAC;IACjC,OAAO,EAAE,UAAU,CAAC,eAAe,CAAC,CAAC;CACtC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,gCAAgC,GAAG;IAC7C,IAAI,EAAE,6BAA6B,CAAC;IACpC,OAAO,EAAE,UAAU,CAAC,kBAAkB,CAAC,CAAC;CACzC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAC/B,6BAA6B,GAC7B,sCAAsC,GACtC,6BAA6B,GAC7B,gCAAgC,GAChC,oCAAoC,GACpC,uCAAuC,GACvC,uCAAuC,GACvC,uCAAuC,GACvC,wCAAwC,GACxC,8BAA8B,GAC9B,oCAAoC,GACpC,kCAAkC,GAClC,iCAAiC,GACjC,iCAAiC,GACjC,6BAA6B,GAC7B,gCAAgC,CAAC"}
1
+ {"version":3,"file":"KycService-method-action-types.d.cts","sourceRoot":"","sources":["../src/KycService-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,yBAAwB;AAElD;;;;;;GAMG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAC1C,IAAI,EAAE,0BAA0B,CAAC;IACjC,OAAO,EAAE,UAAU,CAAC,eAAe,CAAC,CAAC;CACtC,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,gCAAgC,GAAG;IAC7C,IAAI,EAAE,6BAA6B,CAAC;IACpC,OAAO,EAAE,UAAU,CAAC,kBAAkB,CAAC,CAAC;CACzC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAC1C,IAAI,EAAE,0BAA0B,CAAC;IACjC,OAAO,EAAE,UAAU,CAAC,eAAe,CAAC,CAAC;CACtC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,gCAAgC,GAAG;IAC7C,IAAI,EAAE,6BAA6B,CAAC;IACp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C,CAAC;CAC1C,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,iCAAiC,GAAG;IAC9C,IAAI,EAAE,8BAA8B,CAAC;IACrC,OAAO,EAAE,UAAU,CAAC,mBAAmB,CAAC,CAAC;CAC1C,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAC1C,IAAI,EAAE,0BAA0B,CAAC;IACjC,OAAO,EAAE,UAAU,CAAC,eAAe,CAAC,CAAC;CACtC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,gCAAgC,GAAG;IAC7C,IAAI,EAAE,6BAA6B,CAAC;IACpC,OAAO,EAAE,UAAU,CAAC,kBAAkB,CAAC,CAAC;CACzC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAC/B,6BAA6B,GAC7B,gCAAgC,GAChC,6BAA6B,GAC7B,gCAAgC,GAChC,oCAAoC,GACpC,uCAAuC,GACvC,uCAAuC,GACvC,wCAAwC,GACxC,8BAA8B,GAC9B,oCAAoC,GACpC,kCAAkC,GAClC,iCAAiC,GACjC,iCAAiC,GACjC,6BAA6B,GAC7B,gCAAgC,CAAC"}
@@ -23,9 +23,9 @@ export type KycServiceGetGeoCountryAction = {
23
23
  * @param params.country - ISO 3166-1 alpha-3 country code.
24
24
  * @returns The disclaimers.
25
25
  */
26
- export type KycServiceFetchVendorDisclaimersAction = {
27
- type: `KycService:fetchVendorDisclaimers`;
28
- handler: KycService['fetchVendorDisclaimers'];
26
+ export type KycServiceFetchDisclaimersAction = {
27
+ type: `KycService:fetchDisclaimers`;
28
+ handler: KycService['fetchDisclaimers'];
29
29
  };
30
30
  /**
31
31
  * Creates a vendor session via the UKYC backend.
@@ -79,27 +79,10 @@ export type KycServiceSubmitVendorDisclaimersAction = {
79
79
  type: `KycService:submitVendorDisclaimers`;
80
80
  handler: KycService['submitVendorDisclaimers'];
81
81
  };
82
- /**
83
- * Fetches the global idOS + KYC-provider disclaimer catalog
84
- * (`GET /disclaimers?country=`). Does not include
85
- * `credentialReusabilityConsentGiven` — that is session-scoped via
86
- * {@link fetchSessionDisclaimers}. Vendor T&Cs continue to come from
87
- * {@link fetchVendorDisclaimers}.
88
- *
89
- * @param params - The parameters.
90
- * @param params.country - ISO 3166-1 alpha-3 country code.
91
- * @returns The catalog documents.
92
- */
93
- export type KycServiceFetchDisclaimersCatalogAction = {
94
- type: `KycService:fetchDisclaimersCatalog`;
95
- handler: KycService['fetchDisclaimersCatalog'];
96
- };
97
82
  /**
98
83
  * Fetches the session-scoped idOS + KYC-provider disclaimer catalog
99
- * (`GET /sessions/{sessionId}/disclaimers`), including per-session
100
- * `consented` flags and `credentialReusabilityConsentGiven`. For the
101
- * pre-session global catalog use {@link fetchDisclaimersCatalog}. Vendor
102
- * T&Cs continue to come from {@link fetchVendorDisclaimers}.
84
+ * (`GET /sessions/{sessionId}/disclaimers`). Requires an existing UKYC
85
+ * session; vendor T&Cs continue to come from {@link fetchDisclaimers}.
103
86
  *
104
87
  * @param params - The parameters.
105
88
  * @param params.sessionId - The UKYC session id.
@@ -216,5 +199,5 @@ export type KycServiceGetSessionStatusAction = {
216
199
  /**
217
200
  * Union of all KycService action types.
218
201
  */
219
- export type KycServiceMethodActions = KycServiceGetGeoCountryAction | KycServiceFetchVendorDisclaimersAction | KycServiceCreateSessionAction | KycServiceCheckKycRequiredAction | KycServiceCreateVendorCustomerAction | KycServiceSubmitVendorDisclaimersAction | KycServiceFetchDisclaimersCatalogAction | KycServiceFetchSessionDisclaimersAction | KycServiceSubmitSessionDisclaimersAction | KycServiceFetchKycStatusAction | KycServiceFetchIdosEnclaveJwksAction | KycServiceFetchIdosRelayJwksAction | KycServiceCreateUkycSessionAction | KycServiceSetAuthorizationsAction | KycServiceCreateJourneyAction | KycServiceGetSessionStatusAction;
202
+ export type KycServiceMethodActions = KycServiceGetGeoCountryAction | KycServiceFetchDisclaimersAction | KycServiceCreateSessionAction | KycServiceCheckKycRequiredAction | KycServiceCreateVendorCustomerAction | KycServiceSubmitVendorDisclaimersAction | KycServiceFetchSessionDisclaimersAction | KycServiceSubmitSessionDisclaimersAction | KycServiceFetchKycStatusAction | KycServiceFetchIdosEnclaveJwksAction | KycServiceFetchIdosRelayJwksAction | KycServiceCreateUkycSessionAction | KycServiceSetAuthorizationsAction | KycServiceCreateJourneyAction | KycServiceGetSessionStatusAction;
220
203
  //# sourceMappingURL=KycService-method-action-types.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"KycService-method-action-types.d.mts","sourceRoot":"","sources":["../src/KycService-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,yBAAwB;AAElD;;;;;;GAMG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAC1C,IAAI,EAAE,0BAA0B,CAAC;IACjC,OAAO,EAAE,UAAU,CAAC,eAAe,CAAC,CAAC;CACtC,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,sCAAsC,GAAG;IACnD,IAAI,EAAE,mCAAmC,CAAC;IAC1C,OAAO,EAAE,UAAU,CAAC,wBAAwB,CAAC,CAAC;CAC/C,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAC1C,IAAI,EAAE,0BAA0B,CAAC;IACjC,OAAO,EAAE,UAAU,CAAC,eAAe,CAAC,CAAC;CACtC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,gCAAgC,GAAG;IAC7C,IAAI,EAAE,6BAA6B,CAAC;IACpC,OAAO,EAAE,UAAU,CAAC,kBAAkB,CAAC,CAAC;CACzC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,oCAAoC,GAAG;IACjD,IAAI,EAAE,iCAAiC,CAAC;IACxC,OAAO,EAAE,UAAU,CAAC,sBAAsB,CAAC,CAAC;CAC7C,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,uCAAuC,GAAG;IACpD,IAAI,EAAE,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,CAAC,mBAAmB,CAAC,CAAC;CAC1C,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAC1C,IAAI,EAAE,0BAA0B,CAAC;IACjC,OAAO,EAAE,UAAU,CAAC,eAAe,CAAC,CAAC;CACtC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,gCAAgC,GAAG;IAC7C,IAAI,EAAE,6BAA6B,CAAC;IACpC,OAAO,EAAE,UAAU,CAAC,kBAAkB,CAAC,CAAC;CACzC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAC/B,6BAA6B,GAC7B,sCAAsC,GACtC,6BAA6B,GAC7B,gCAAgC,GAChC,oCAAoC,GACpC,uCAAuC,GACvC,uCAAuC,GACvC,uCAAuC,GACvC,wCAAwC,GACxC,8BAA8B,GAC9B,oCAAoC,GACpC,kCAAkC,GAClC,iCAAiC,GACjC,iCAAiC,GACjC,6BAA6B,GAC7B,gCAAgC,CAAC"}
1
+ {"version":3,"file":"KycService-method-action-types.d.mts","sourceRoot":"","sources":["../src/KycService-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,yBAAwB;AAElD;;;;;;GAMG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAC1C,IAAI,EAAE,0BAA0B,CAAC;IACjC,OAAO,EAAE,UAAU,CAAC,eAAe,CAAC,CAAC;CACtC,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,gCAAgC,GAAG;IAC7C,IAAI,EAAE,6BAA6B,CAAC;IACpC,OAAO,EAAE,UAAU,CAAC,kBAAkB,CAAC,CAAC;CACzC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAC1C,IAAI,EAAE,0BAA0B,CAAC;IACjC,OAAO,EAAE,UAAU,CAAC,eAAe,CAAC,CAAC;CACtC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,gCAAg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AC;IACrC,OAAO,EAAE,UAAU,CAAC,mBAAmB,CAAC,CAAC;CAC1C,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,iCAAiC,GAAG;IAC9C,IAAI,EAAE,8BAA8B,CAAC;IACrC,OAAO,EAAE,UAAU,CAAC,mBAAmB,CAAC,CAAC;CAC1C,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAC1C,IAAI,EAAE,0BAA0B,CAAC;IACjC,OAAO,EAAE,UAAU,CAAC,eAAe,CAAC,CAAC;CACtC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,gCAAgC,GAAG;IAC7C,IAAI,EAAE,6BAA6B,CAAC;IACpC,OAAO,EAAE,UAAU,CAAC,kBAAkB,CAAC,CAAC;CACzC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAC/B,6BAA6B,GAC7B,gCAAgC,GAChC,6BAA6B,GAC7B,gCAAgC,GAChC,oCAAoC,GACpC,uCAAuC,GACvC,uCAAuC,GACvC,wCAAwC,GACxC,8BAA8B,GAC9B,oCAAoC,GACpC,kCAAkC,GAClC,iCAAiC,GACjC,iCAAiC,GACjC,6BAA6B,GAC7B,gCAAgC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"KycService-method-action-types.mjs","sourceRoot":"","sources":["../src/KycService-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { KycService } from './KycService.js';\n\n/**\n * Resolves the customer's country from the geolocation source and converts it\n * to an ISO 3166-1 alpha-3 code.\n *\n * @returns The alpha-3 country code.\n * @throws If the country cannot be determined or mapped.\n */\nexport type KycServiceGetGeoCountryAction = {\n type: `KycService:getGeoCountry`;\n handler: KycService['getGeoCountry'];\n};\n\n/**\n * Fetches the disclaimers the customer must accept before a session is\n * created.\n *\n * @param params - The parameters.\n * @param params.vendor - Identity vendor. Defaults to `moonpay`.\n * @param params.country - ISO 3166-1 alpha-3 country code.\n * @returns The disclaimers.\n */\nexport type KycServiceFetchVendorDisclaimersAction = {\n type: `KycService:fetchVendorDisclaimers`;\n handler: KycService['fetchVendorDisclaimers'];\n};\n\n/**\n * Creates a vendor session via the UKYC backend.\n *\n * @param params - The session parameters.\n * @returns The created session token.\n */\nexport type KycServiceCreateSessionAction = {\n type: `KycService:createSession`;\n handler: KycService['createSession'];\n};\n\n/**\n * Checks whether KYC is required for the given vendor, country, and\n * capabilities.\n *\n * @param params - The check parameters.\n * @returns Whether KYC is required.\n */\nexport type KycServiceCheckKycRequiredAction = {\n type: `KycService:checkKycRequired`;\n handler: KycService['checkKycRequired'];\n};\n\n/**\n * Creates (or resumes) an empty-shell customer for the authenticated\n * canonical user on the given identity vendor. Must run before showing\n * vendor T&C so the customer exists and resume logic can key off vendor\n * status.\n *\n * @param params - The parameters.\n * @param params.vendor - Identity vendor (e.g. `iron` for Money/VBA).\n * @param params.email - Email associated with the customer.\n * @returns The vendor customer record (subset validated for controller use).\n */\nexport type KycServiceCreateVendorCustomerAction = {\n type: `KycService:createVendorCustomer`;\n handler: KycService['createVendorCustomer'];\n};\n\n/**\n * Records vendor T&C acceptance (`POST /vendors/{vendor}/disclaimers`).\n * For Iron this creates content signings from the disclaimer ids the\n * customer accepted. Session-scoped idOS / KYC-provider consents are\n * recorded separately via {@link submitSessionDisclaimers}. Retries re-POST\n * the same ids, matching the legacy `POST /consents` signing step.\n *\n * @param params - The parameters.\n * @param params.vendor - Identity vendor (e.g. `iron`).\n * @param params.disclaimerIds - Accepted vendor T&C ids.\n * @returns The vendor signing records.\n */\nexport type KycServiceSubmitVendorDisclaimersAction = {\n type: `KycService:submitVendorDisclaimers`;\n handler: KycService['submitVendorDisclaimers'];\n};\n\n/**\n * Fetches the global idOS + KYC-provider disclaimer catalog\n * (`GET /disclaimers?country=`). Does not include\n * `credentialReusabilityConsentGiven` — that is session-scoped via\n * {@link fetchSessionDisclaimers}. Vendor T&Cs continue to come from\n * {@link fetchVendorDisclaimers}.\n *\n * @param params - The parameters.\n * @param params.country - ISO 3166-1 alpha-3 country code.\n * @returns The catalog documents.\n */\nexport type KycServiceFetchDisclaimersCatalogAction = {\n type: `KycService:fetchDisclaimersCatalog`;\n handler: KycService['fetchDisclaimersCatalog'];\n};\n\n/**\n * Fetches the session-scoped idOS + KYC-provider disclaimer catalog\n * (`GET /sessions/{sessionId}/disclaimers`), including per-session\n * `consented` flags and `credentialReusabilityConsentGiven`. For the\n * pre-session global catalog use {@link fetchDisclaimersCatalog}. Vendor\n * T&Cs continue to come from {@link fetchVendorDisclaimers}.\n *\n * @param params - The parameters.\n * @param params.sessionId - The UKYC session id.\n * @returns The catalog, including which documents are already consented.\n */\nexport type KycServiceFetchSessionDisclaimersAction = {\n type: `KycService:fetchSessionDisclaimers`;\n handler: KycService['fetchSessionDisclaimers'];\n};\n\n/**\n * Records idOS + KYC-provider consents for a UKYC session\n * (`POST /sessions/{sessionId}/disclaimers`). `key`/`version` pairs must\n * match the current catalog from {@link fetchSessionDisclaimers}. A 409\n * means those document versions were already recorded for the session.\n *\n * @param params - The consent parameters.\n * @returns The updated catalog after recording.\n */\nexport type KycServiceSubmitSessionDisclaimersAction = {\n type: `KycService:submitSessionDisclaimers`;\n handler: KycService['submitSessionDisclaimers'];\n};\n\n/**\n * Fetches the user-keyed simplified KYC status used by Money toast / banner\n * surfaces (`GET /kyc/status`).\n *\n * @returns The simplified status payload.\n */\nexport type KycServiceFetchKycStatusAction = {\n type: `KycService:fetchKycStatus`;\n handler: KycService['fetchKycStatus'];\n};\n\n/**\n * Fetches the idOS enclave JWKS used to verify the\n * `encryptionDataKey` schema's `jwtChain` from\n * {@link KycService.createUkycSession}.\n *\n * This is an unauthenticated request to a well-known path on the idOS enclave\n * host, distinct from the UKYC base URL.\n *\n * @returns The JWKS keys.\n */\nexport type KycServiceFetchIdosEnclaveJwksAction = {\n type: `KycService:fetchIdosEnclaveJwks`;\n handler: KycService['fetchIdosEnclaveJwks'];\n};\n\n/**\n * Fetches the idOS relay JWKS used to verify the `ukycCapabilityToken`\n * schema's `jwtChain` from {@link KycService.createUkycSession}.\n *\n * This is an unauthenticated request to a well-known path on the idOS relay\n * host, distinct from both the UKYC base URL and the idOS enclave.\n *\n * @returns The JWKS keys.\n */\nexport type KycServiceFetchIdosRelayJwksAction = {\n type: `KycService:fetchIdosRelayJwks`;\n handler: KycService['fetchIdosRelayJwks'];\n};\n\n/**\n * Creates a UKYC session for the SumSub document-verification sub-flow.\n *\n * The client registers its per-session X25519 public key so the server can\n * later open boxes sealed with the matching private key, and supplies the\n * customer's ISO 3166-1 alpha-3 country of residence. The response\n * carries per-secret encryption schemas (`encryptionDataKey` and\n * `ukycCapabilityToken`) so the client can wrap the `data_encryption_key` and\n * the read-only `ukyc_capability_token` and submit them via\n * {@link KycService.setAuthorizations}.\n *\n * @param params - The session parameters.\n * @returns The UKYC session id and encryption schemas.\n */\nexport type KycServiceCreateUkycSessionAction = {\n type: `KycService:createUkycSession`;\n handler: KycService['createUkycSession'];\n};\n\n/**\n * Submits the wrapped `data_encryption_key` and wrapped\n * `ukyc_capability_token` for a UKYC session. Both secrets are sealed with\n * `wrapEncryptionKey` against the encryption schemas returned by\n * {@link KycService.createUkycSession}.\n *\n * @param params - The wrapped authorizations.\n * @returns The session status after the authorizations are applied.\n */\nexport type KycServiceSetAuthorizationsAction = {\n type: `KycService:setAuthorizations`;\n handler: KycService['setAuthorizations'];\n};\n\n/**\n * Creates (or refreshes) the SumSub verification journey for a UKYC session,\n * returning the applicant access token used to launch the SDK.\n *\n * @param sessionId - The UKYC session id from `createUkycSession`.\n * @returns The applicant access token and status.\n */\nexport type KycServiceCreateJourneyAction = {\n type: `KycService:createJourney`;\n handler: KycService['createJourney'];\n};\n\n/**\n * Fetches the current status of a UKYC session. Polled after the SumSub SDK\n * completes to determine the final verification decision.\n *\n * @param params - The parameters.\n * @param params.sessionId - The UKYC session id.\n * @returns The session status.\n */\nexport type KycServiceGetSessionStatusAction = {\n type: `KycService:getSessionStatus`;\n handler: KycService['getSessionStatus'];\n};\n\n/**\n * Union of all KycService action types.\n */\nexport type KycServiceMethodActions =\n | KycServiceGetGeoCountryAction\n | KycServiceFetchVendorDisclaimersAction\n | KycServiceCreateSessionAction\n | KycServiceCheckKycRequiredAction\n | KycServiceCreateVendorCustomerAction\n | KycServiceSubmitVendorDisclaimersAction\n | KycServiceFetchDisclaimersCatalogAction\n | KycServiceFetchSessionDisclaimersAction\n | KycServiceSubmitSessionDisclaimersAction\n | KycServiceFetchKycStatusAction\n | KycServiceFetchIdosEnclaveJwksAction\n | KycServiceFetchIdosRelayJwksAction\n | KycServiceCreateUkycSessionAction\n | KycServiceSetAuthorizationsAction\n | KycServiceCreateJourneyAction\n | KycServiceGetSessionStatusAction;\n"]}
1
+ {"version":3,"file":"KycService-method-action-types.mjs","sourceRoot":"","sources":["../src/KycService-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { KycService } from './KycService.js';\n\n/**\n * Resolves the customer's country from the geolocation source and converts it\n * to an ISO 3166-1 alpha-3 code.\n *\n * @returns The alpha-3 country code.\n * @throws If the country cannot be determined or mapped.\n */\nexport type KycServiceGetGeoCountryAction = {\n type: `KycService:getGeoCountry`;\n handler: KycService['getGeoCountry'];\n};\n\n/**\n * Fetches the disclaimers the customer must accept before a session is\n * created.\n *\n * @param params - The parameters.\n * @param params.vendor - Identity vendor. Defaults to `moonpay`.\n * @param params.country - ISO 3166-1 alpha-3 country code.\n * @returns The disclaimers.\n */\nexport type KycServiceFetchDisclaimersAction = {\n type: `KycService:fetchDisclaimers`;\n handler: KycService['fetchDisclaimers'];\n};\n\n/**\n * Creates a vendor session via the UKYC backend.\n *\n * @param params - The session parameters.\n * @returns The created session token.\n */\nexport type KycServiceCreateSessionAction = {\n type: `KycService:createSession`;\n handler: KycService['createSession'];\n};\n\n/**\n * Checks whether KYC is required for the given vendor, country, and\n * capabilities.\n *\n * @param params - The check parameters.\n * @returns Whether KYC is required.\n */\nexport type KycServiceCheckKycRequiredAction = {\n type: `KycService:checkKycRequired`;\n handler: KycService['checkKycRequired'];\n};\n\n/**\n * Creates (or resumes) an empty-shell customer for the authenticated\n * canonical user on the given identity vendor. Must run before showing\n * vendor T&C so the customer exists and resume logic can key off vendor\n * status.\n *\n * @param params - The parameters.\n * @param params.vendor - Identity vendor (e.g. `iron` for Money/VBA).\n * @param params.email - Email associated with the customer.\n * @returns The vendor customer record (subset validated for controller use).\n */\nexport type KycServiceCreateVendorCustomerAction = {\n type: `KycService:createVendorCustomer`;\n handler: KycService['createVendorCustomer'];\n};\n\n/**\n * Records vendor T&C acceptance (`POST /vendors/{vendor}/disclaimers`).\n * For Iron this creates content signings from the disclaimer ids the\n * customer accepted. Session-scoped idOS / KYC-provider consents are\n * recorded separately via {@link submitSessionDisclaimers}. Retries re-POST\n * the same ids, matching the legacy `POST /consents` signing step.\n *\n * @param params - The parameters.\n * @param params.vendor - Identity vendor (e.g. `iron`).\n * @param params.disclaimerIds - Accepted vendor T&C ids.\n * @returns The vendor signing records.\n */\nexport type KycServiceSubmitVendorDisclaimersAction = {\n type: `KycService:submitVendorDisclaimers`;\n handler: KycService['submitVendorDisclaimers'];\n};\n\n/**\n * Fetches the session-scoped idOS + KYC-provider disclaimer catalog\n * (`GET /sessions/{sessionId}/disclaimers`). Requires an existing UKYC\n * session; vendor T&Cs continue to come from {@link fetchDisclaimers}.\n *\n * @param params - The parameters.\n * @param params.sessionId - The UKYC session id.\n * @returns The catalog, including which documents are already consented.\n */\nexport type KycServiceFetchSessionDisclaimersAction = {\n type: `KycService:fetchSessionDisclaimers`;\n handler: KycService['fetchSessionDisclaimers'];\n};\n\n/**\n * Records idOS + KYC-provider consents for a UKYC session\n * (`POST /sessions/{sessionId}/disclaimers`). `key`/`version` pairs must\n * match the current catalog from {@link fetchSessionDisclaimers}. A 409\n * means those document versions were already recorded for the session.\n *\n * @param params - The consent parameters.\n * @returns The updated catalog after recording.\n */\nexport type KycServiceSubmitSessionDisclaimersAction = {\n type: `KycService:submitSessionDisclaimers`;\n handler: KycService['submitSessionDisclaimers'];\n};\n\n/**\n * Fetches the user-keyed simplified KYC status used by Money toast / banner\n * surfaces (`GET /kyc/status`).\n *\n * @returns The simplified status payload.\n */\nexport type KycServiceFetchKycStatusAction = {\n type: `KycService:fetchKycStatus`;\n handler: KycService['fetchKycStatus'];\n};\n\n/**\n * Fetches the idOS enclave JWKS used to verify the\n * `encryptionDataKey` schema's `jwtChain` from\n * {@link KycService.createUkycSession}.\n *\n * This is an unauthenticated request to a well-known path on the idOS enclave\n * host, distinct from the UKYC base URL.\n *\n * @returns The JWKS keys.\n */\nexport type KycServiceFetchIdosEnclaveJwksAction = {\n type: `KycService:fetchIdosEnclaveJwks`;\n handler: KycService['fetchIdosEnclaveJwks'];\n};\n\n/**\n * Fetches the idOS relay JWKS used to verify the `ukycCapabilityToken`\n * schema's `jwtChain` from {@link KycService.createUkycSession}.\n *\n * This is an unauthenticated request to a well-known path on the idOS relay\n * host, distinct from both the UKYC base URL and the idOS enclave.\n *\n * @returns The JWKS keys.\n */\nexport type KycServiceFetchIdosRelayJwksAction = {\n type: `KycService:fetchIdosRelayJwks`;\n handler: KycService['fetchIdosRelayJwks'];\n};\n\n/**\n * Creates a UKYC session for the SumSub document-verification sub-flow.\n *\n * The client registers its per-session X25519 public key so the server can\n * later open boxes sealed with the matching private key, and supplies the\n * customer's ISO 3166-1 alpha-3 country of residence. The response\n * carries per-secret encryption schemas (`encryptionDataKey` and\n * `ukycCapabilityToken`) so the client can wrap the `data_encryption_key` and\n * the read-only `ukyc_capability_token` and submit them via\n * {@link KycService.setAuthorizations}.\n *\n * @param params - The session parameters.\n * @returns The UKYC session id and encryption schemas.\n */\nexport type KycServiceCreateUkycSessionAction = {\n type: `KycService:createUkycSession`;\n handler: KycService['createUkycSession'];\n};\n\n/**\n * Submits the wrapped `data_encryption_key` and wrapped\n * `ukyc_capability_token` for a UKYC session. Both secrets are sealed with\n * `wrapEncryptionKey` against the encryption schemas returned by\n * {@link KycService.createUkycSession}.\n *\n * @param params - The wrapped authorizations.\n * @returns The session status after the authorizations are applied.\n */\nexport type KycServiceSetAuthorizationsAction = {\n type: `KycService:setAuthorizations`;\n handler: KycService['setAuthorizations'];\n};\n\n/**\n * Creates (or refreshes) the SumSub verification journey for a UKYC session,\n * returning the applicant access token used to launch the SDK.\n *\n * @param sessionId - The UKYC session id from `createUkycSession`.\n * @returns The applicant access token and status.\n */\nexport type KycServiceCreateJourneyAction = {\n type: `KycService:createJourney`;\n handler: KycService['createJourney'];\n};\n\n/**\n * Fetches the current status of a UKYC session. Polled after the SumSub SDK\n * completes to determine the final verification decision.\n *\n * @param params - The parameters.\n * @param params.sessionId - The UKYC session id.\n * @returns The session status.\n */\nexport type KycServiceGetSessionStatusAction = {\n type: `KycService:getSessionStatus`;\n handler: KycService['getSessionStatus'];\n};\n\n/**\n * Union of all KycService action types.\n */\nexport type KycServiceMethodActions =\n | KycServiceGetGeoCountryAction\n | KycServiceFetchDisclaimersAction\n | KycServiceCreateSessionAction\n | KycServiceCheckKycRequiredAction\n | KycServiceCreateVendorCustomerAction\n | KycServiceSubmitVendorDisclaimersAction\n | KycServiceFetchSessionDisclaimersAction\n | KycServiceSubmitSessionDisclaimersAction\n | KycServiceFetchKycStatusAction\n | KycServiceFetchIdosEnclaveJwksAction\n | KycServiceFetchIdosRelayJwksAction\n | KycServiceCreateUkycSessionAction\n | KycServiceSetAuthorizationsAction\n | KycServiceCreateJourneyAction\n | KycServiceGetSessionStatusAction;\n"]}
@@ -27,12 +27,11 @@ exports.serviceName = 'KycService';
27
27
  // === MESSENGER ===
28
28
  const MESSENGER_EXPOSED_METHODS = [
29
29
  'getGeoCountry',
30
- 'fetchVendorDisclaimers',
30
+ 'fetchDisclaimers',
31
31
  'createSession',
32
32
  'checkKycRequired',
33
33
  'createVendorCustomer',
34
34
  'submitVendorDisclaimers',
35
- 'fetchDisclaimersCatalog',
36
35
  'fetchSessionDisclaimers',
37
36
  'submitSessionDisclaimers',
38
37
  'fetchKycStatus',
@@ -129,15 +128,9 @@ const ConsentDocumentStruct = (0, superstruct_1.type)({
129
128
  url: (0, superstruct_1.string)(),
130
129
  consented: (0, superstruct_1.boolean)(),
131
130
  });
132
- const DisclaimersCatalogFields = {
131
+ const SessionDisclaimersResponseStruct = (0, superstruct_1.type)({
133
132
  idOS: (0, superstruct_1.array)(ConsentDocumentStruct),
134
133
  kycProvider: (0, superstruct_1.array)(ConsentDocumentStruct),
135
- };
136
- /** Global catalog from `GET /disclaimers` (no credential-reuse flag). */
137
- const GlobalDisclaimersResponseStruct = (0, superstruct_1.type)(DisclaimersCatalogFields);
138
- /** Session catalog from `GET`/`POST /sessions/{id}/disclaimers`. */
139
- const SessionDisclaimersResponseStruct = (0, superstruct_1.type)({
140
- ...DisclaimersCatalogFields,
141
134
  credentialReusabilityConsentGiven: (0, superstruct_1.boolean)(),
142
135
  });
143
136
  // === SERVICE DEFINITION ===
@@ -148,21 +141,13 @@ const SessionDisclaimersResponseStruct = (0, superstruct_1.type)({
148
141
  * `fetch` when provided), and the auth bearer token and geolocation come from
149
142
  * other controllers via the messenger.
150
143
  *
151
- * It extends {@link BaseDataService}, so read-only endpoints are routed through
152
- * `fetchQuery`: they are wrapped in the shared service policy (retries, circuit
153
- * breaker) and their results are exposed via the service's `QueryClient`.
154
- * `fetchDisclaimers` and `fetchJwks` are cached with a `staleTime`;
155
- * session-scoped disclaimer and status-polling reads opt out of caching
144
+ * It extends {@link BaseDataService}, so every request is routed through
145
+ * `fetchQuery`: it is wrapped in the shared service policy (retries, circuit
146
+ * breaker) and its result is exposed via the service's `QueryClient`. Read-only
147
+ * endpoints (`fetchDisclaimers`, `fetchIdosEnclaveJwks`, `fetchIdosRelayJwks`) are cached
148
+ * with a `staleTime`; vendor-disclaimer, session-scoped disclaimer,
149
+ * session-creating, and status-polling endpoints opt out of caching
156
150
  * (`staleTime`/`gcTime` of `0`) so they never serve a stale result.
157
- *
158
- * Write endpoints (every `POST`) deliberately bypass `fetchQuery`. The query
159
- * cache is built for idempotent reads: it deduplicates concurrent requests
160
- * sharing a `queryKey`, retains responses for replay, and publishes them on the
161
- * messenger via `cacheUpdated`. None of that is safe for calls that create
162
- * sessions, customers, or consents — two overlapping `createVendorCustomer`
163
- * calls would collapse into a single `POST`, and session tokens would be
164
- * broadcast as cache payloads. Writes therefore call `#requestJson` directly,
165
- * which also means they are not retried by the service policy.
166
151
  */
167
152
  class KycService extends base_data_service_1.BaseDataService {
168
153
  /**
@@ -247,11 +232,11 @@ class KycService extends base_data_service_1.BaseDataService {
247
232
  * @param params.country - ISO 3166-1 alpha-3 country code.
248
233
  * @returns The disclaimers.
249
234
  */
250
- async fetchVendorDisclaimers({ vendor = 'moonpay', country, }) {
235
+ async fetchDisclaimers({ vendor = 'moonpay', country, }) {
251
236
  const url = new URL(`/vendors/${vendor}/disclaimers`, __classPrivateFieldGet(this, _KycService_baseUrl, "f"));
252
237
  url.searchParams.set('country', country);
253
238
  const data = await this.fetchQuery({
254
- queryKey: [`${this.name}:fetchVendorDisclaimers`, vendor, country],
239
+ queryKey: [`${this.name}:fetchDisclaimers`, vendor, country],
255
240
  queryFn: async () => __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_requestJson).call(this, url, { method: 'GET' }),
256
241
  staleTime: (0, utils_1.inMilliseconds)(5, utils_1.Duration.Minute),
257
242
  });
@@ -265,9 +250,20 @@ class KycService extends base_data_service_1.BaseDataService {
265
250
  */
266
251
  async createSession(params) {
267
252
  const url = new URL('/vendors/moonpay/sessions', __classPrivateFieldGet(this, _KycService_baseUrl, "f"));
268
- const data = await __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_requestJson).call(this, url, {
269
- method: 'POST',
270
- body: JSON.stringify(params),
253
+ const data = await this.fetchQuery({
254
+ queryKey: [
255
+ `${this.name}:createSession`,
256
+ params.email,
257
+ params.termsAcceptedAt,
258
+ params.disclaimerIds,
259
+ ],
260
+ queryFn: async () => __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_requestJson).call(this, url, {
261
+ method: 'POST',
262
+ body: JSON.stringify(params),
263
+ }),
264
+ // A session-creating mutation must never serve a stale/cached result.
265
+ staleTime: 0,
266
+ gcTime: 0,
271
267
  });
272
268
  return __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_validateResponse).call(this, data, CreateSessionResponseStruct, 'sessions');
273
269
  }
@@ -298,9 +294,21 @@ class KycService extends base_data_service_1.BaseDataService {
298
294
  throw new Error('checkKycRequired: country is required for vendor "moonpay".');
299
295
  }
300
296
  }
301
- const data = await __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_requestJson).call(this, url, {
302
- method: 'POST',
303
- body: JSON.stringify(body),
297
+ const data = await this.fetchQuery({
298
+ queryKey: [
299
+ `${this.name}:checkKycRequired`,
300
+ vendor,
301
+ params.accessToken ?? null,
302
+ params.country ?? null,
303
+ capabilities,
304
+ ],
305
+ queryFn: async () => __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_requestJson).call(this, url, {
306
+ method: 'POST',
307
+ body: JSON.stringify(body),
308
+ }),
309
+ // The requirement can change server-side, so always re-check.
310
+ staleTime: 0,
311
+ gcTime: 0,
304
312
  });
305
313
  const { required } = __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_validateResponse).call(this, data, KycRequiredResponseStruct, 'kyc-required');
306
314
  return { kycRequired: required };
@@ -318,9 +326,19 @@ class KycService extends base_data_service_1.BaseDataService {
318
326
  */
319
327
  async createVendorCustomer(params) {
320
328
  const url = new URL(`/vendors/${params.vendor}/customers`, __classPrivateFieldGet(this, _KycService_baseUrl, "f"));
321
- const data = await __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_requestJson).call(this, url, {
322
- method: 'POST',
323
- body: JSON.stringify({ email: params.email }),
329
+ const data = await this.fetchQuery({
330
+ queryKey: [
331
+ `${this.name}:createVendorCustomer`,
332
+ params.vendor,
333
+ params.email,
334
+ ],
335
+ queryFn: async () => __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_requestJson).call(this, url, {
336
+ method: 'POST',
337
+ body: JSON.stringify({ email: params.email }),
338
+ }),
339
+ // Customer creation/resume must never serve a stale/cached result.
340
+ staleTime: 0,
341
+ gcTime: 0,
324
342
  });
325
343
  return __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_validateResponse).call(this, data, VendorCustomerResponseStruct, 'vendor customers');
326
344
  }
@@ -338,52 +356,34 @@ class KycService extends base_data_service_1.BaseDataService {
338
356
  */
339
357
  async submitVendorDisclaimers(params) {
340
358
  const url = new URL(`/vendors/${encodeURIComponent(params.vendor)}/disclaimers`, __classPrivateFieldGet(this, _KycService_baseUrl, "f"));
341
- const data = await __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_requestJson).call(this, url, {
342
- method: 'POST',
343
- body: JSON.stringify({ disclaimerIds: params.disclaimerIds }),
344
- });
345
- return __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_validateResponse).call(this, data, VendorSigningsResponseStruct, 'vendor disclaimers');
346
- }
347
- /**
348
- * Fetches the global idOS + KYC-provider disclaimer catalog
349
- * (`GET /disclaimers?country=`). Does not include
350
- * `credentialReusabilityConsentGiven` — that is session-scoped via
351
- * {@link fetchSessionDisclaimers}. Vendor T&Cs continue to come from
352
- * {@link fetchVendorDisclaimers}.
353
- *
354
- * @param params - The parameters.
355
- * @param params.country - ISO 3166-1 alpha-3 country code.
356
- * @returns The catalog documents.
357
- */
358
- async fetchDisclaimersCatalog({ country, }) {
359
- if (country.length !== 3) {
360
- throw new Error(`KycService.fetchDisclaimersCatalog: country must be an ISO 3166-1 alpha-3 code (received "${country}").`);
361
- }
362
- const url = new URL('/disclaimers', __classPrivateFieldGet(this, _KycService_baseUrl, "f"));
363
- url.searchParams.set('country', country);
364
359
  const data = await this.fetchQuery({
365
- queryKey: [`${this.name}:fetchDisclaimersCatalog`, country],
366
- queryFn: async () => __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_requestJson).call(this, url, { method: 'GET' }),
360
+ queryKey: [
361
+ `${this.name}:submitVendorDisclaimers`,
362
+ params.vendor,
363
+ params.disclaimerIds,
364
+ ],
365
+ queryFn: async () => __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_requestJson).call(this, url, {
366
+ method: 'POST',
367
+ body: JSON.stringify({ disclaimerIds: params.disclaimerIds }),
368
+ }),
367
369
  staleTime: 0,
368
370
  gcTime: 0,
369
371
  });
370
- return __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_validateResponse).call(this, data, GlobalDisclaimersResponseStruct, 'disclaimers');
372
+ return __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_validateResponse).call(this, data, VendorSigningsResponseStruct, 'vendor disclaimers');
371
373
  }
372
374
  /**
373
375
  * Fetches the session-scoped idOS + KYC-provider disclaimer catalog
374
- * (`GET /sessions/{sessionId}/disclaimers`), including per-session
375
- * `consented` flags and `credentialReusabilityConsentGiven`. For the
376
- * pre-session global catalog use {@link fetchDisclaimersCatalog}. Vendor
377
- * T&Cs continue to come from {@link fetchVendorDisclaimers}.
376
+ * (`GET /sessions/{sessionId}/disclaimers`). Requires an existing UKYC
377
+ * session; vendor T&Cs continue to come from {@link fetchDisclaimers}.
378
378
  *
379
379
  * @param params - The parameters.
380
380
  * @param params.sessionId - The UKYC session id.
381
381
  * @returns The catalog, including which documents are already consented.
382
382
  */
383
- async fetchSessionDisclaimers({ sessionId, }) {
384
- const url = new URL(`/sessions/${encodeURIComponent(sessionId)}/disclaimers`, __classPrivateFieldGet(this, _KycService_baseUrl, "f"));
383
+ async fetchSessionDisclaimers(params) {
384
+ const url = new URL(`/sessions/${encodeURIComponent(params.sessionId)}/disclaimers`, __classPrivateFieldGet(this, _KycService_baseUrl, "f"));
385
385
  const data = await this.fetchQuery({
386
- queryKey: [`${this.name}:fetchSessionDisclaimers`, sessionId],
386
+ queryKey: [`${this.name}:fetchSessionDisclaimers`, params.sessionId],
387
387
  queryFn: async () => __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_requestJson).call(this, url, { method: 'GET' }),
388
388
  // Consent state can change after a POST, so always re-fetch.
389
389
  staleTime: 0,
@@ -402,13 +402,24 @@ class KycService extends base_data_service_1.BaseDataService {
402
402
  */
403
403
  async submitSessionDisclaimers(params) {
404
404
  const url = new URL(`/sessions/${encodeURIComponent(params.sessionId)}/disclaimers`, __classPrivateFieldGet(this, _KycService_baseUrl, "f"));
405
- const data = await __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_requestJson).call(this, url, {
406
- method: 'POST',
407
- body: JSON.stringify({
408
- idOS: params.idOS,
409
- kycProvider: params.kycProvider,
410
- credentialReusabilityConsentGiven: params.credentialReusabilityConsentGiven,
405
+ const data = await this.fetchQuery({
406
+ queryKey: [
407
+ `${this.name}:submitSessionDisclaimers`,
408
+ params.sessionId,
409
+ params.idOS,
410
+ params.kycProvider,
411
+ params.credentialReusabilityConsentGiven,
412
+ ],
413
+ queryFn: async () => __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_requestJson).call(this, url, {
414
+ method: 'POST',
415
+ body: JSON.stringify({
416
+ idOS: params.idOS,
417
+ kycProvider: params.kycProvider,
418
+ credentialReusabilityConsentGiven: params.credentialReusabilityConsentGiven,
419
+ }),
411
420
  }),
421
+ staleTime: 0,
422
+ gcTime: 0,
412
423
  });
413
424
  return __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_validateResponse).call(this, data, SessionDisclaimersResponseStruct, 'session disclaimers');
414
425
  }
@@ -470,16 +481,22 @@ class KycService extends base_data_service_1.BaseDataService {
470
481
  */
471
482
  async createUkycSession(params) {
472
483
  const url = new URL('/sessions', __classPrivateFieldGet(this, _KycService_baseUrl, "f"));
473
- const data = await __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_requestJson).call(this, url, {
474
- method: 'POST',
475
- body: JSON.stringify({
476
- vendorId: params.vendor ?? 'moonpay',
477
- vendorUserId: 'mockedId',
478
- jwtToken: params.jwtToken,
479
- sessionClientPublicKey: params.sessionClientPublicKey,
480
- residenceCountry: params.residenceCountry,
481
- vendorMetadata: params.vendorMetadata ?? {},
484
+ const data = await this.fetchQuery({
485
+ queryKey: [`${this.name}:createUkycSession`, params.jwtToken],
486
+ queryFn: async () => __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_requestJson).call(this, url, {
487
+ method: 'POST',
488
+ body: JSON.stringify({
489
+ vendorId: params.vendor ?? 'moonpay',
490
+ vendorUserId: 'mockedId',
491
+ jwtToken: params.jwtToken,
492
+ sessionClientPublicKey: params.sessionClientPublicKey,
493
+ residenceCountry: params.residenceCountry,
494
+ vendorMetadata: params.vendorMetadata ?? {},
495
+ }),
482
496
  }),
497
+ // A session-creating mutation must never serve a stale/cached result.
498
+ staleTime: 0,
499
+ gcTime: 0,
483
500
  });
484
501
  return __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_validateResponse).call(this, data, UkycSessionResponseStruct, 'UKYC sessions');
485
502
  }
@@ -494,12 +511,17 @@ class KycService extends base_data_service_1.BaseDataService {
494
511
  */
495
512
  async setAuthorizations(params) {
496
513
  const url = new URL(`/sessions/${encodeURIComponent(params.sessionId)}/authorizations`, __classPrivateFieldGet(this, _KycService_baseUrl, "f"));
497
- const data = await __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_requestJson).call(this, url, {
498
- method: 'POST',
499
- body: JSON.stringify({
500
- wrappedEncryptionDataKey: params.wrappedEncryptionDataKey,
501
- wrappedUkycCapabilityToken: params.wrappedUkycCapabilityToken,
514
+ const data = await this.fetchQuery({
515
+ queryKey: [`${this.name}:setAuthorizations`, params.sessionId],
516
+ queryFn: async () => __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_requestJson).call(this, url, {
517
+ method: 'POST',
518
+ body: JSON.stringify({
519
+ wrappedEncryptionDataKey: params.wrappedEncryptionDataKey,
520
+ wrappedUkycCapabilityToken: params.wrappedUkycCapabilityToken,
521
+ }),
502
522
  }),
523
+ staleTime: 0,
524
+ gcTime: 0,
503
525
  });
504
526
  return __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_validateResponse).call(this, data, SessionStatusResponseStruct, 'authorizations');
505
527
  }
@@ -512,7 +534,13 @@ class KycService extends base_data_service_1.BaseDataService {
512
534
  */
513
535
  async createJourney(sessionId) {
514
536
  const url = new URL(`/sessions/${encodeURIComponent(sessionId)}/journey`, __classPrivateFieldGet(this, _KycService_baseUrl, "f"));
515
- const data = await __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_requestJson).call(this, url, { method: 'POST' });
537
+ const data = await this.fetchQuery({
538
+ queryKey: [`${this.name}:createJourney`, sessionId],
539
+ queryFn: async () => __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_requestJson).call(this, url, { method: 'POST' }),
540
+ // Journeys are (re)created on demand; do not reuse a cached token.
541
+ staleTime: 0,
542
+ gcTime: 0,
543
+ });
516
544
  return __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_validateResponse).call(this, data, ApplicantAccessTokenResponseStruct, 'journey');
517
545
  }
518
546
  /**
@@ -575,9 +603,8 @@ async function _KycService_fetchWellKnownJwks(baseUrl, queryName, responseLabel,
575
603
  /**
576
604
  * Performs a single JSON request.
577
605
  *
578
- * Read endpoints pass this as the `queryFn` to {@link fetchQuery}, which
579
- * wraps it in the shared service policy (retries, circuit breaker). Write
580
- * endpoints call it directly, so they are executed exactly once. Requests
606
+ * This is meant to be used as the `queryFn` for {@link fetchQuery}, which
607
+ * wraps it in the shared service policy (retries, circuit breaker). Requests
581
608
  * are authenticated with the wallet bearer token by default; pass
582
609
  * `{ authenticated: false }` for calls to services that do not expect it
583
610
  * (e.g. the idOS enclave or idOS relay JWKS endpoints).