@metamask-previews/kyc-controller 0.0.0-preview-e0510042f → 0.0.0-preview-fe4b3be11

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 +5 -0
  2. package/dist/KycController.cjs +31 -17
  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 +31 -17
  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 +23 -6
  12. package/dist/KycService-method-action-types.d.cts.map +1 -1
  13. package/dist/KycService-method-action-types.d.mts +23 -6
  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 +91 -118
  17. package/dist/KycService.cjs.map +1 -1
  18. package/dist/KycService.d.cts +38 -12
  19. package/dist/KycService.d.cts.map +1 -1
  20. package/dist/KycService.d.mts +38 -12
  21. package/dist/KycService.d.mts.map +1 -1
  22. package/dist/KycService.mjs +91 -118
  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/logger.cjs +9 -0
  31. package/dist/logger.cjs.map +1 -0
  32. package/dist/logger.d.cts +6 -0
  33. package/dist/logger.d.cts.map +1 -0
  34. package/dist/logger.d.mts +6 -0
  35. package/dist/logger.d.mts.map +1 -0
  36. package/dist/logger.mjs +6 -0
  37. package/dist/logger.mjs.map +1 -0
  38. package/dist/types.cjs.map +1 -1
  39. package/dist/types.d.cts +15 -6
  40. package/dist/types.d.cts.map +1 -1
  41. package/dist/types.d.mts +15 -6
  42. package/dist/types.d.mts.map +1 -1
  43. package/dist/types.mjs.map +1 -1
  44. package/dist/ukyc/wrapEncryptionKey.cjs +4 -9
  45. package/dist/ukyc/wrapEncryptionKey.cjs.map +1 -1
  46. package/dist/ukyc/wrapEncryptionKey.d.cts +8 -10
  47. package/dist/ukyc/wrapEncryptionKey.d.cts.map +1 -1
  48. package/dist/ukyc/wrapEncryptionKey.d.mts +8 -10
  49. package/dist/ukyc/wrapEncryptionKey.d.mts.map +1 -1
  50. package/dist/ukyc/wrapEncryptionKey.mjs +4 -9
  51. package/dist/ukyc/wrapEncryptionKey.mjs.map +1 -1
  52. package/package.json +1 -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 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"]}
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"]}
@@ -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 KycServiceFetchDisclaimersAction = {
27
- type: `KycService:fetchDisclaimers`;
28
- handler: KycService['fetchDisclaimers'];
26
+ export type KycServiceFetchVendorDisclaimersAction = {
27
+ type: `KycService:fetchVendorDisclaimers`;
28
+ handler: KycService['fetchVendorDisclaimers'];
29
29
  };
30
30
  /**
31
31
  * Creates a vendor session via the UKYC backend.
@@ -79,10 +79,27 @@ 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
+ };
82
97
  /**
83
98
  * Fetches the session-scoped idOS + KYC-provider disclaimer catalog
84
- * (`GET /sessions/{sessionId}/disclaimers`). Requires an existing UKYC
85
- * session; vendor T&Cs continue to come from {@link fetchDisclaimers}.
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}.
86
103
  *
87
104
  * @param params - The parameters.
88
105
  * @param params.sessionId - The UKYC session id.
@@ -199,5 +216,5 @@ export type KycServiceGetSessionStatusAction = {
199
216
  /**
200
217
  * Union of all KycService action types.
201
218
  */
202
- export type KycServiceMethodActions = KycServiceGetGeoCountryAction | KycServiceFetchDisclaimersAction | KycServiceCreateSessionAction | KycServiceCheckKycRequiredAction | KycServiceCreateVendorCustomerAction | KycServiceSubmitVendorDisclaimersAction | KycServiceFetchSessionDisclaimersAction | KycServiceSubmitSessionDisclaimersAction | KycServiceFetchKycStatusAction | KycServiceFetchIdosEnclaveJwksAction | KycServiceFetchIdosRelayJwksAction | KycServiceCreateUkycSessionAction | KycServiceSetAuthorizationsAction | KycServiceCreateJourneyAction | KycServiceGetSessionStatusAction;
219
+ export type KycServiceMethodActions = KycServiceGetGeoCountryAction | KycServiceFetchVendorDisclaimersAction | KycServiceCreateSessionAction | KycServiceCheckKycRequiredAction | KycServiceCreateVendorCustomerAction | KycServiceSubmitVendorDisclaimersAction | KycServiceFetchDisclaimersCatalogAction | KycServiceFetchSessionDisclaimersAction | KycServiceSubmitSessionDisclaimersAction | KycServiceFetchKycStatusAction | KycServiceFetchIdosEnclaveJwksAction | KycServiceFetchIdosRelayJwksAction | KycServiceCreateUkycSessionAction | KycServiceSetAuthorizationsAction | KycServiceCreateJourneyAction | KycServiceGetSessionStatusAction;
203
220
  //# 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,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;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,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AC;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
+ {"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;IAC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,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,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"}
@@ -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 KycServiceFetchDisclaimersAction = {
27
- type: `KycService:fetchDisclaimers`;
28
- handler: KycService['fetchDisclaimers'];
26
+ export type KycServiceFetchVendorDisclaimersAction = {
27
+ type: `KycService:fetchVendorDisclaimers`;
28
+ handler: KycService['fetchVendorDisclaimers'];
29
29
  };
30
30
  /**
31
31
  * Creates a vendor session via the UKYC backend.
@@ -79,10 +79,27 @@ 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
+ };
82
97
  /**
83
98
  * Fetches the session-scoped idOS + KYC-provider disclaimer catalog
84
- * (`GET /sessions/{sessionId}/disclaimers`). Requires an existing UKYC
85
- * session; vendor T&Cs continue to come from {@link fetchDisclaimers}.
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}.
86
103
  *
87
104
  * @param params - The parameters.
88
105
  * @param params.sessionId - The UKYC session id.
@@ -199,5 +216,5 @@ export type KycServiceGetSessionStatusAction = {
199
216
  /**
200
217
  * Union of all KycService action types.
201
218
  */
202
- export type KycServiceMethodActions = KycServiceGetGeoCountryAction | KycServiceFetchDisclaimersAction | KycServiceCreateSessionAction | KycServiceCheckKycRequiredAction | KycServiceCreateVendorCustomerAction | KycServiceSubmitVendorDisclaimersAction | KycServiceFetchSessionDisclaimersAction | KycServiceSubmitSessionDisclaimersAction | KycServiceFetchKycStatusAction | KycServiceFetchIdosEnclaveJwksAction | KycServiceFetchIdosRelayJwksAction | KycServiceCreateUkycSessionAction | KycServiceSetAuthorizationsAction | KycServiceCreateJourneyAction | KycServiceGetSessionStatusAction;
219
+ export type KycServiceMethodActions = KycServiceGetGeoCountryAction | KycServiceFetchVendorDisclaimersAction | KycServiceCreateSessionAction | KycServiceCheckKycRequiredAction | KycServiceCreateVendorCustomerAction | KycServiceSubmitVendorDisclaimersAction | KycServiceFetchDisclaimersCatalogAction | KycServiceFetchSessionDisclaimersAction | KycServiceSubmitSessionDisclaimersAction | KycServiceFetchKycStatusAction | KycServiceFetchIdosEnclaveJwksAction | KycServiceFetchIdosRelayJwksAction | KycServiceCreateUkycSessionAction | KycServiceSetAuthorizationsAction | KycServiceCreateJourneyAction | KycServiceGetSessionStatusAction;
203
220
  //# 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,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;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,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0B,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
+ {"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;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C,IAAI,EAAE,8BAA8B,CAAC;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,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 +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 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"]}
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"]}
@@ -27,11 +27,12 @@ exports.serviceName = 'KycService';
27
27
  // === MESSENGER ===
28
28
  const MESSENGER_EXPOSED_METHODS = [
29
29
  'getGeoCountry',
30
- 'fetchDisclaimers',
30
+ 'fetchVendorDisclaimers',
31
31
  'createSession',
32
32
  'checkKycRequired',
33
33
  'createVendorCustomer',
34
34
  'submitVendorDisclaimers',
35
+ 'fetchDisclaimersCatalog',
35
36
  'fetchSessionDisclaimers',
36
37
  'submitSessionDisclaimers',
37
38
  'fetchKycStatus',
@@ -128,9 +129,15 @@ const ConsentDocumentStruct = (0, superstruct_1.type)({
128
129
  url: (0, superstruct_1.string)(),
129
130
  consented: (0, superstruct_1.boolean)(),
130
131
  });
131
- const SessionDisclaimersResponseStruct = (0, superstruct_1.type)({
132
+ const DisclaimersCatalogFields = {
132
133
  idOS: (0, superstruct_1.array)(ConsentDocumentStruct),
133
134
  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,
134
141
  credentialReusabilityConsentGiven: (0, superstruct_1.boolean)(),
135
142
  });
136
143
  // === SERVICE DEFINITION ===
@@ -141,13 +148,21 @@ const SessionDisclaimersResponseStruct = (0, superstruct_1.type)({
141
148
  * `fetch` when provided), and the auth bearer token and geolocation come from
142
149
  * other controllers via the messenger.
143
150
  *
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
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
150
156
  * (`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.
151
166
  */
152
167
  class KycService extends base_data_service_1.BaseDataService {
153
168
  /**
@@ -232,11 +247,11 @@ class KycService extends base_data_service_1.BaseDataService {
232
247
  * @param params.country - ISO 3166-1 alpha-3 country code.
233
248
  * @returns The disclaimers.
234
249
  */
235
- async fetchDisclaimers({ vendor = 'moonpay', country, }) {
250
+ async fetchVendorDisclaimers({ vendor = 'moonpay', country, }) {
236
251
  const url = new URL(`/vendors/${vendor}/disclaimers`, __classPrivateFieldGet(this, _KycService_baseUrl, "f"));
237
252
  url.searchParams.set('country', country);
238
253
  const data = await this.fetchQuery({
239
- queryKey: [`${this.name}:fetchDisclaimers`, vendor, country],
254
+ queryKey: [`${this.name}:fetchVendorDisclaimers`, vendor, country],
240
255
  queryFn: async () => __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_requestJson).call(this, url, { method: 'GET' }),
241
256
  staleTime: (0, utils_1.inMilliseconds)(5, utils_1.Duration.Minute),
242
257
  });
@@ -250,20 +265,9 @@ class KycService extends base_data_service_1.BaseDataService {
250
265
  */
251
266
  async createSession(params) {
252
267
  const url = new URL('/vendors/moonpay/sessions', __classPrivateFieldGet(this, _KycService_baseUrl, "f"));
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,
268
+ const data = await __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_requestJson).call(this, url, {
269
+ method: 'POST',
270
+ body: JSON.stringify(params),
267
271
  });
268
272
  return __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_validateResponse).call(this, data, CreateSessionResponseStruct, 'sessions');
269
273
  }
@@ -294,21 +298,9 @@ class KycService extends base_data_service_1.BaseDataService {
294
298
  throw new Error('checkKycRequired: country is required for vendor "moonpay".');
295
299
  }
296
300
  }
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,
301
+ const data = await __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_requestJson).call(this, url, {
302
+ method: 'POST',
303
+ body: JSON.stringify(body),
312
304
  });
313
305
  const { required } = __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_validateResponse).call(this, data, KycRequiredResponseStruct, 'kyc-required');
314
306
  return { kycRequired: required };
@@ -326,19 +318,9 @@ class KycService extends base_data_service_1.BaseDataService {
326
318
  */
327
319
  async createVendorCustomer(params) {
328
320
  const url = new URL(`/vendors/${params.vendor}/customers`, __classPrivateFieldGet(this, _KycService_baseUrl, "f"));
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,
321
+ const data = await __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_requestJson).call(this, url, {
322
+ method: 'POST',
323
+ body: JSON.stringify({ email: params.email }),
342
324
  });
343
325
  return __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_validateResponse).call(this, data, VendorCustomerResponseStruct, 'vendor customers');
344
326
  }
@@ -356,34 +338,52 @@ class KycService extends base_data_service_1.BaseDataService {
356
338
  */
357
339
  async submitVendorDisclaimers(params) {
358
340
  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);
359
364
  const data = await this.fetchQuery({
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
- }),
365
+ queryKey: [`${this.name}:fetchDisclaimersCatalog`, country],
366
+ queryFn: async () => __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_requestJson).call(this, url, { method: 'GET' }),
369
367
  staleTime: 0,
370
368
  gcTime: 0,
371
369
  });
372
- return __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_validateResponse).call(this, data, VendorSigningsResponseStruct, 'vendor disclaimers');
370
+ return __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_validateResponse).call(this, data, GlobalDisclaimersResponseStruct, 'disclaimers');
373
371
  }
374
372
  /**
375
373
  * Fetches the session-scoped idOS + KYC-provider disclaimer catalog
376
- * (`GET /sessions/{sessionId}/disclaimers`). Requires an existing UKYC
377
- * session; vendor T&Cs continue to come from {@link fetchDisclaimers}.
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}.
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(params) {
384
- const url = new URL(`/sessions/${encodeURIComponent(params.sessionId)}/disclaimers`, __classPrivateFieldGet(this, _KycService_baseUrl, "f"));
383
+ async fetchSessionDisclaimers({ sessionId, }) {
384
+ const url = new URL(`/sessions/${encodeURIComponent(sessionId)}/disclaimers`, __classPrivateFieldGet(this, _KycService_baseUrl, "f"));
385
385
  const data = await this.fetchQuery({
386
- queryKey: [`${this.name}:fetchSessionDisclaimers`, params.sessionId],
386
+ queryKey: [`${this.name}:fetchSessionDisclaimers`, 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,24 +402,13 @@ 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 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
- }),
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,
420
411
  }),
421
- staleTime: 0,
422
- gcTime: 0,
423
412
  });
424
413
  return __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_validateResponse).call(this, data, SessionDisclaimersResponseStruct, 'session disclaimers');
425
414
  }
@@ -481,22 +470,16 @@ class KycService extends base_data_service_1.BaseDataService {
481
470
  */
482
471
  async createUkycSession(params) {
483
472
  const url = new URL('/sessions', __classPrivateFieldGet(this, _KycService_baseUrl, "f"));
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
- }),
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 ?? {},
496
482
  }),
497
- // A session-creating mutation must never serve a stale/cached result.
498
- staleTime: 0,
499
- gcTime: 0,
500
483
  });
501
484
  return __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_validateResponse).call(this, data, UkycSessionResponseStruct, 'UKYC sessions');
502
485
  }
@@ -511,17 +494,12 @@ class KycService extends base_data_service_1.BaseDataService {
511
494
  */
512
495
  async setAuthorizations(params) {
513
496
  const url = new URL(`/sessions/${encodeURIComponent(params.sessionId)}/authorizations`, __classPrivateFieldGet(this, _KycService_baseUrl, "f"));
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
- }),
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,
522
502
  }),
523
- staleTime: 0,
524
- gcTime: 0,
525
503
  });
526
504
  return __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_validateResponse).call(this, data, SessionStatusResponseStruct, 'authorizations');
527
505
  }
@@ -534,13 +512,7 @@ class KycService extends base_data_service_1.BaseDataService {
534
512
  */
535
513
  async createJourney(sessionId) {
536
514
  const url = new URL(`/sessions/${encodeURIComponent(sessionId)}/journey`, __classPrivateFieldGet(this, _KycService_baseUrl, "f"));
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
- });
515
+ const data = await __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_requestJson).call(this, url, { method: 'POST' });
544
516
  return __classPrivateFieldGet(this, _KycService_instances, "m", _KycService_validateResponse).call(this, data, ApplicantAccessTokenResponseStruct, 'journey');
545
517
  }
546
518
  /**
@@ -603,8 +575,9 @@ async function _KycService_fetchWellKnownJwks(baseUrl, queryName, responseLabel,
603
575
  /**
604
576
  * Performs a single JSON request.
605
577
  *
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
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
608
581
  * are authenticated with the wallet bearer token by default; pass
609
582
  * `{ authenticated: false }` for calls to services that do not expect it
610
583
  * (e.g. the idOS enclave or idOS relay JWKS endpoints).