rehive 4.3.0 → 4.4.0

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 (186) hide show
  1. package/dist/admin.d.mts +14445 -5452
  2. package/dist/admin.d.ts +14445 -5452
  3. package/dist/admin.js +1 -1
  4. package/dist/admin.mjs +1 -1
  5. package/dist/auth.d.mts +2 -2
  6. package/dist/auth.d.ts +2 -2
  7. package/dist/auth.js +1 -1
  8. package/dist/auth.mjs +1 -1
  9. package/dist/{chunk-MAMZSYFF.js → chunk-3BG2PD7X.js} +1 -1
  10. package/dist/chunk-4FVXXRGV.mjs +6 -0
  11. package/dist/chunk-AIKSGC2F.js +6 -0
  12. package/dist/chunk-BLPR7LRO.mjs +6 -0
  13. package/dist/{chunk-KOUIKOXX.mjs → chunk-HAVKMJEY.mjs} +1 -1
  14. package/dist/{chunk-QKHQP5JT.mjs → chunk-JZVYT324.mjs} +1 -1
  15. package/dist/chunk-K5GNAPOS.js +6 -0
  16. package/dist/{chunk-OP7MQ6KX.js → chunk-Y7BCC5TX.js} +1 -1
  17. package/dist/{create-api-client-DvXFNRl7.d.mts → create-api-client-BY6W7Qz9.d.mts} +1 -1
  18. package/dist/{create-api-client-C02JVdcx.d.ts → create-api-client-CBNjHT-x.d.ts} +1 -1
  19. package/dist/{create-auth-9l3wfvKL.d.mts → create-auth-CROjq_cP.d.mts} +9193 -2388
  20. package/dist/{create-auth-9l3wfvKL.d.ts → create-auth-CROjq_cP.d.ts} +9193 -2388
  21. package/dist/extensions/alchemy.d.mts +84 -6
  22. package/dist/extensions/alchemy.d.ts +84 -6
  23. package/dist/extensions/alchemy.js +3 -3
  24. package/dist/extensions/alchemy.mjs +3 -3
  25. package/dist/extensions/app.d.mts +8 -3
  26. package/dist/extensions/app.d.ts +8 -3
  27. package/dist/extensions/app.js +3 -3
  28. package/dist/extensions/app.mjs +3 -3
  29. package/dist/extensions/billing.d.mts +8 -3
  30. package/dist/extensions/billing.d.ts +8 -3
  31. package/dist/extensions/billing.js +3 -3
  32. package/dist/extensions/billing.mjs +3 -3
  33. package/dist/extensions/bridge.d.mts +165 -5
  34. package/dist/extensions/bridge.d.ts +165 -5
  35. package/dist/extensions/bridge.js +3 -3
  36. package/dist/extensions/bridge.mjs +3 -3
  37. package/dist/extensions/builder.d.mts +8 -3
  38. package/dist/extensions/builder.d.ts +8 -3
  39. package/dist/extensions/builder.js +4 -4
  40. package/dist/extensions/builder.mjs +4 -4
  41. package/dist/extensions/business.d.mts +8 -3
  42. package/dist/extensions/business.d.ts +8 -3
  43. package/dist/extensions/business.js +5 -5
  44. package/dist/extensions/business.mjs +5 -5
  45. package/dist/extensions/conversion.d.mts +8 -3
  46. package/dist/extensions/conversion.d.ts +8 -3
  47. package/dist/extensions/mass-send.d.mts +8 -3
  48. package/dist/extensions/mass-send.d.ts +8 -3
  49. package/dist/extensions/mukuru.d.mts +207 -55
  50. package/dist/extensions/mukuru.d.ts +207 -55
  51. package/dist/extensions/mukuru.js +5 -5
  52. package/dist/extensions/mukuru.mjs +5 -5
  53. package/dist/extensions/notifications.d.mts +9 -3
  54. package/dist/extensions/notifications.d.ts +9 -3
  55. package/dist/extensions/payment-requests.d.mts +8 -3
  56. package/dist/extensions/payment-requests.d.ts +8 -3
  57. package/dist/extensions/payment-requests.js +4 -4
  58. package/dist/extensions/payment-requests.mjs +4 -4
  59. package/dist/extensions/products.d.mts +8 -3
  60. package/dist/extensions/products.d.ts +8 -3
  61. package/dist/extensions/rain.d.mts +8 -3
  62. package/dist/extensions/rain.d.ts +8 -3
  63. package/dist/extensions/rain.js +2 -2
  64. package/dist/extensions/rain.mjs +2 -2
  65. package/dist/extensions/rewards.d.mts +8 -3
  66. package/dist/extensions/rewards.d.ts +8 -3
  67. package/dist/extensions/rewards.js +2 -2
  68. package/dist/extensions/rewards.mjs +2 -2
  69. package/dist/extensions/stellar-testnet.d.mts +8 -3
  70. package/dist/extensions/stellar-testnet.d.ts +8 -3
  71. package/dist/extensions/stellar-testnet.js +4 -4
  72. package/dist/extensions/stellar-testnet.mjs +4 -4
  73. package/dist/extensions/stellar.d.mts +8 -3
  74. package/dist/extensions/stellar.d.ts +8 -3
  75. package/dist/extensions/stellar.js +4 -4
  76. package/dist/extensions/stellar.mjs +4 -4
  77. package/dist/extensions/sumsub.d.mts +54 -27
  78. package/dist/extensions/sumsub.d.ts +54 -27
  79. package/dist/extensions/sumsub.js +2 -2
  80. package/dist/extensions/sumsub.mjs +2 -2
  81. package/dist/index.d.mts +2 -2
  82. package/dist/index.d.ts +2 -2
  83. package/dist/index.js +1 -1
  84. package/dist/index.mjs +1 -1
  85. package/dist/react.d.mts +2 -2
  86. package/dist/react.d.ts +2 -2
  87. package/dist/react.js +1 -1
  88. package/dist/react.mjs +1 -1
  89. package/dist/user.d.mts +17 -6
  90. package/dist/user.d.ts +17 -6
  91. package/dist/user.js +1 -1
  92. package/dist/user.mjs +1 -1
  93. package/package.json +1 -1
  94. package/src/extensions/alchemy/openapi-ts/client/index.ts +1 -0
  95. package/src/extensions/alchemy/openapi-ts/core/params.gen.ts +18 -11
  96. package/src/extensions/alchemy/openapi-ts/core/types.gen.ts +6 -0
  97. package/src/extensions/alchemy/openapi-ts/index.ts +2 -2
  98. package/src/extensions/alchemy/openapi-ts/sdk.gen.ts +29 -3
  99. package/src/extensions/alchemy/openapi-ts/types.gen.ts +82 -1
  100. package/src/extensions/app/openapi-ts/client/index.ts +1 -0
  101. package/src/extensions/app/openapi-ts/core/params.gen.ts +18 -11
  102. package/src/extensions/app/openapi-ts/core/types.gen.ts +6 -0
  103. package/src/extensions/app/openapi-ts/sdk.gen.ts +2 -2
  104. package/src/extensions/billing/openapi-ts/client/index.ts +1 -0
  105. package/src/extensions/billing/openapi-ts/core/params.gen.ts +18 -11
  106. package/src/extensions/billing/openapi-ts/core/types.gen.ts +6 -0
  107. package/src/extensions/billing/openapi-ts/sdk.gen.ts +2 -2
  108. package/src/extensions/bridge/openapi-ts/client/index.ts +1 -0
  109. package/src/extensions/bridge/openapi-ts/core/params.gen.ts +18 -11
  110. package/src/extensions/bridge/openapi-ts/core/types.gen.ts +6 -0
  111. package/src/extensions/bridge/openapi-ts/index.ts +2 -2
  112. package/src/extensions/bridge/openapi-ts/sdk.gen.ts +35 -3
  113. package/src/extensions/bridge/openapi-ts/types.gen.ts +171 -0
  114. package/src/extensions/builder/openapi-ts/client/index.ts +1 -0
  115. package/src/extensions/builder/openapi-ts/core/params.gen.ts +18 -11
  116. package/src/extensions/builder/openapi-ts/core/types.gen.ts +6 -0
  117. package/src/extensions/builder/openapi-ts/sdk.gen.ts +2 -2
  118. package/src/extensions/business/openapi-ts/client/index.ts +1 -0
  119. package/src/extensions/business/openapi-ts/core/params.gen.ts +18 -11
  120. package/src/extensions/business/openapi-ts/core/types.gen.ts +6 -0
  121. package/src/extensions/business/openapi-ts/sdk.gen.ts +2 -2
  122. package/src/extensions/conversion/openapi-ts/client/index.ts +1 -0
  123. package/src/extensions/conversion/openapi-ts/core/params.gen.ts +18 -11
  124. package/src/extensions/conversion/openapi-ts/core/types.gen.ts +6 -0
  125. package/src/extensions/conversion/openapi-ts/sdk.gen.ts +2 -2
  126. package/src/extensions/mass-send/openapi-ts/client/index.ts +1 -0
  127. package/src/extensions/mass-send/openapi-ts/core/params.gen.ts +18 -11
  128. package/src/extensions/mass-send/openapi-ts/core/types.gen.ts +6 -0
  129. package/src/extensions/mass-send/openapi-ts/sdk.gen.ts +2 -2
  130. package/src/extensions/mukuru/openapi-ts/client/index.ts +1 -0
  131. package/src/extensions/mukuru/openapi-ts/client.gen.ts +1 -1
  132. package/src/extensions/mukuru/openapi-ts/core/params.gen.ts +18 -11
  133. package/src/extensions/mukuru/openapi-ts/core/types.gen.ts +6 -0
  134. package/src/extensions/mukuru/openapi-ts/index.ts +2 -2
  135. package/src/extensions/mukuru/openapi-ts/sdk.gen.ts +21 -3
  136. package/src/extensions/mukuru/openapi-ts/types.gen.ts +204 -52
  137. package/src/extensions/notifications/openapi-ts/client/index.ts +1 -0
  138. package/src/extensions/notifications/openapi-ts/core/params.gen.ts +18 -11
  139. package/src/extensions/notifications/openapi-ts/core/types.gen.ts +6 -0
  140. package/src/extensions/notifications/openapi-ts/sdk.gen.ts +2 -2
  141. package/src/extensions/notifications/openapi-ts/types.gen.ts +1 -0
  142. package/src/extensions/payment-requests/openapi-ts/client/index.ts +1 -0
  143. package/src/extensions/payment-requests/openapi-ts/core/params.gen.ts +18 -11
  144. package/src/extensions/payment-requests/openapi-ts/core/types.gen.ts +6 -0
  145. package/src/extensions/payment-requests/openapi-ts/sdk.gen.ts +2 -2
  146. package/src/extensions/products/openapi-ts/client/index.ts +1 -0
  147. package/src/extensions/products/openapi-ts/core/params.gen.ts +18 -11
  148. package/src/extensions/products/openapi-ts/core/types.gen.ts +6 -0
  149. package/src/extensions/products/openapi-ts/sdk.gen.ts +2 -2
  150. package/src/extensions/rain/openapi-ts/client/index.ts +1 -0
  151. package/src/extensions/rain/openapi-ts/core/params.gen.ts +18 -11
  152. package/src/extensions/rain/openapi-ts/core/types.gen.ts +6 -0
  153. package/src/extensions/rain/openapi-ts/sdk.gen.ts +2 -2
  154. package/src/extensions/rewards/openapi-ts/client/index.ts +1 -0
  155. package/src/extensions/rewards/openapi-ts/core/params.gen.ts +18 -11
  156. package/src/extensions/rewards/openapi-ts/core/types.gen.ts +6 -0
  157. package/src/extensions/rewards/openapi-ts/sdk.gen.ts +2 -2
  158. package/src/extensions/stellar/openapi-ts/client/index.ts +1 -0
  159. package/src/extensions/stellar/openapi-ts/core/params.gen.ts +18 -11
  160. package/src/extensions/stellar/openapi-ts/core/types.gen.ts +6 -0
  161. package/src/extensions/stellar/openapi-ts/sdk.gen.ts +2 -2
  162. package/src/extensions/stellar-testnet/openapi-ts/client/index.ts +1 -0
  163. package/src/extensions/stellar-testnet/openapi-ts/core/params.gen.ts +18 -11
  164. package/src/extensions/stellar-testnet/openapi-ts/core/types.gen.ts +6 -0
  165. package/src/extensions/stellar-testnet/openapi-ts/sdk.gen.ts +2 -2
  166. package/src/extensions/sumsub/openapi-ts/client/index.ts +1 -0
  167. package/src/extensions/sumsub/openapi-ts/core/params.gen.ts +18 -11
  168. package/src/extensions/sumsub/openapi-ts/core/types.gen.ts +6 -0
  169. package/src/extensions/sumsub/openapi-ts/sdk.gen.ts +2 -2
  170. package/src/extensions/sumsub/openapi-ts/types.gen.ts +46 -24
  171. package/src/platform/admin/openapi-ts/client/index.ts +1 -0
  172. package/src/platform/admin/openapi-ts/core/params.gen.ts +18 -11
  173. package/src/platform/admin/openapi-ts/core/types.gen.ts +6 -0
  174. package/src/platform/admin/openapi-ts/index.ts +2 -2
  175. package/src/platform/admin/openapi-ts/sdk.gen.ts +51 -3
  176. package/src/platform/admin/openapi-ts/types.gen.ts +13012 -4000
  177. package/src/platform/user/openapi-ts/client/index.ts +1 -0
  178. package/src/platform/user/openapi-ts/core/params.gen.ts +18 -11
  179. package/src/platform/user/openapi-ts/core/types.gen.ts +6 -0
  180. package/src/platform/user/openapi-ts/index.ts +2 -2
  181. package/src/platform/user/openapi-ts/sdk.gen.ts +37 -3
  182. package/src/platform/user/openapi-ts/types.gen.ts +11236 -4408
  183. package/dist/chunk-HSNZ57ET.mjs +0 -6
  184. package/dist/chunk-M6Z3PA5D.js +0 -6
  185. package/dist/chunk-WNBM6WBC.mjs +0 -6
  186. package/dist/chunk-YPGO2Y5R.js +0 -6
@@ -1,5 +1,5 @@
1
- import { A as ApiFactoryConfig, B as BoundSdk } from '../create-api-client-C02JVdcx.js';
2
- import '../create-auth-9l3wfvKL.js';
1
+ import { A as ApiFactoryConfig, B as BoundSdk } from '../create-api-client-CBNjHT-x.js';
2
+ import '../create-auth-CROjq_cP.js';
3
3
 
4
4
  type AuthToken = string | undefined;
5
5
  interface Auth {
@@ -122,6 +122,11 @@ interface Config$1 {
122
122
  */
123
123
  responseValidator?: (data: unknown) => Promise<unknown>;
124
124
  }
125
+ /**
126
+ * Arbitrary metadata passed through the `meta` request option.
127
+ */
128
+ interface ClientMeta {
129
+ }
125
130
 
126
131
  type ServerSentEventsOptions<TData = unknown> = Omit<RequestInit, 'method'> & Pick<Config$1, 'method' | 'responseTransformer' | 'responseValidator'> & {
127
132
  /**
@@ -400,28 +405,35 @@ type AdminDocumentType = {
400
405
  * * `PASSPORT` - Passport
401
406
  * * `DRIVERS` - Drivers
402
407
  * * `RESIDENCE_PERMIT` - Residence Permit
408
+ * * `VISA` - Visa
403
409
  * * `UTILITY_BILL` - Utility Bill
410
+ * * `UTILITY_BILL2` - Utility Bill2
404
411
  * * `SELFIE` - Selfie
405
412
  * * `VIDEO_SELFIE` - Video Selfie
413
+ * * `IDENTITY_VIDEO` - Identity Video
406
414
  * * `PROFILE_IMAGE` - Profile Image
407
415
  * * `ID_DOC_PHOTO` - Id Doc Photo
416
+ * * `EXTERNAL_DB_DOC` - External Db Doc
408
417
  * * `AGREEMENT` - Agreement
409
418
  * * `CONTRACT` - Contract
419
+ * * `SIGNED_CONTRACT` - Signed Contract
410
420
  * * `DRIVERS_TRANSLATION` - Drivers Translation
411
421
  * * `INVESTOR_DOC` - Investor Doc
412
422
  * * `VEHICLE_REGISTRATION_CERTIFICATE` - Vehicle Registration Certificate
413
423
  * * `INCOME_SOURCE` - Income Source
414
424
  * * `PAYMENT_METHOD` - Payment Method
425
+ * * `PAYMENT_SOURCE` - Payment Source
415
426
  * * `BANK_CARD` - Bank Card
416
427
  * * `ARBITRARY_DOC` - Arbitrary Doc
417
428
  * * `OTHER` - Other
429
+ * * `COMPANY_DOC` - Company Doc
430
+ * * `POWER_OF_ATTORNEY` - Power Of Attorney
431
+ * * `TRANSPARENCY_REGISTRY_EXTRACT` - Transparency Registry Extract
418
432
  */
419
- sumsub_type: 'ID_CARD' | 'PASSPORT' | 'DRIVERS' | 'RESIDENCE_PERMIT' | 'UTILITY_BILL' | 'SELFIE' | 'VIDEO_SELFIE' | 'PROFILE_IMAGE' | 'ID_DOC_PHOTO' | 'AGREEMENT' | 'CONTRACT' | 'DRIVERS_TRANSLATION' | 'INVESTOR_DOC' | 'VEHICLE_REGISTRATION_CERTIFICATE' | 'INCOME_SOURCE' | 'PAYMENT_METHOD' | 'BANK_CARD' | 'ARBITRARY_DOC' | 'OTHER';
420
- /**
421
- * * `single` - Single
422
- * * `double` - Double
423
- */
424
- kind?: 'single' | 'double';
433
+ sumsub_type: 'ID_CARD' | 'PASSPORT' | 'DRIVERS' | 'RESIDENCE_PERMIT' | 'VISA' | 'UTILITY_BILL' | 'UTILITY_BILL2' | 'SELFIE' | 'VIDEO_SELFIE' | 'IDENTITY_VIDEO' | 'PROFILE_IMAGE' | 'ID_DOC_PHOTO' | 'EXTERNAL_DB_DOC' | 'AGREEMENT' | 'CONTRACT' | 'SIGNED_CONTRACT' | 'DRIVERS_TRANSLATION' | 'INVESTOR_DOC' | 'VEHICLE_REGISTRATION_CERTIFICATE' | 'INCOME_SOURCE' | 'PAYMENT_METHOD' | 'PAYMENT_SOURCE' | 'BANK_CARD' | 'ARBITRARY_DOC' | 'OTHER' | 'COMPANY_DOC' | 'POWER_OF_ATTORNEY' | 'TRANSPARENCY_REGISTRY_EXTRACT';
434
+ readonly file_rules: {
435
+ [key: string]: unknown;
436
+ };
425
437
  readonly created: number;
426
438
  readonly updated: number;
427
439
  };
@@ -575,28 +587,35 @@ type PatchedAdminDocumentType = {
575
587
  * * `PASSPORT` - Passport
576
588
  * * `DRIVERS` - Drivers
577
589
  * * `RESIDENCE_PERMIT` - Residence Permit
590
+ * * `VISA` - Visa
578
591
  * * `UTILITY_BILL` - Utility Bill
592
+ * * `UTILITY_BILL2` - Utility Bill2
579
593
  * * `SELFIE` - Selfie
580
594
  * * `VIDEO_SELFIE` - Video Selfie
595
+ * * `IDENTITY_VIDEO` - Identity Video
581
596
  * * `PROFILE_IMAGE` - Profile Image
582
597
  * * `ID_DOC_PHOTO` - Id Doc Photo
598
+ * * `EXTERNAL_DB_DOC` - External Db Doc
583
599
  * * `AGREEMENT` - Agreement
584
600
  * * `CONTRACT` - Contract
601
+ * * `SIGNED_CONTRACT` - Signed Contract
585
602
  * * `DRIVERS_TRANSLATION` - Drivers Translation
586
603
  * * `INVESTOR_DOC` - Investor Doc
587
604
  * * `VEHICLE_REGISTRATION_CERTIFICATE` - Vehicle Registration Certificate
588
605
  * * `INCOME_SOURCE` - Income Source
589
606
  * * `PAYMENT_METHOD` - Payment Method
607
+ * * `PAYMENT_SOURCE` - Payment Source
590
608
  * * `BANK_CARD` - Bank Card
591
609
  * * `ARBITRARY_DOC` - Arbitrary Doc
592
610
  * * `OTHER` - Other
611
+ * * `COMPANY_DOC` - Company Doc
612
+ * * `POWER_OF_ATTORNEY` - Power Of Attorney
613
+ * * `TRANSPARENCY_REGISTRY_EXTRACT` - Transparency Registry Extract
593
614
  */
594
- sumsub_type?: 'ID_CARD' | 'PASSPORT' | 'DRIVERS' | 'RESIDENCE_PERMIT' | 'UTILITY_BILL' | 'SELFIE' | 'VIDEO_SELFIE' | 'PROFILE_IMAGE' | 'ID_DOC_PHOTO' | 'AGREEMENT' | 'CONTRACT' | 'DRIVERS_TRANSLATION' | 'INVESTOR_DOC' | 'VEHICLE_REGISTRATION_CERTIFICATE' | 'INCOME_SOURCE' | 'PAYMENT_METHOD' | 'BANK_CARD' | 'ARBITRARY_DOC' | 'OTHER';
595
- /**
596
- * * `single` - Single
597
- * * `double` - Double
598
- */
599
- kind?: 'single' | 'double';
615
+ sumsub_type?: 'ID_CARD' | 'PASSPORT' | 'DRIVERS' | 'RESIDENCE_PERMIT' | 'VISA' | 'UTILITY_BILL' | 'UTILITY_BILL2' | 'SELFIE' | 'VIDEO_SELFIE' | 'IDENTITY_VIDEO' | 'PROFILE_IMAGE' | 'ID_DOC_PHOTO' | 'EXTERNAL_DB_DOC' | 'AGREEMENT' | 'CONTRACT' | 'SIGNED_CONTRACT' | 'DRIVERS_TRANSLATION' | 'INVESTOR_DOC' | 'VEHICLE_REGISTRATION_CERTIFICATE' | 'INCOME_SOURCE' | 'PAYMENT_METHOD' | 'PAYMENT_SOURCE' | 'BANK_CARD' | 'ARBITRARY_DOC' | 'OTHER' | 'COMPANY_DOC' | 'POWER_OF_ATTORNEY' | 'TRANSPARENCY_REGISTRY_EXTRACT';
616
+ readonly file_rules?: {
617
+ [key: string]: unknown;
618
+ };
600
619
  readonly created?: number;
601
620
  readonly updated?: number;
602
621
  };
@@ -782,28 +801,32 @@ type AdminDocumentTypeWritable = {
782
801
  * * `PASSPORT` - Passport
783
802
  * * `DRIVERS` - Drivers
784
803
  * * `RESIDENCE_PERMIT` - Residence Permit
804
+ * * `VISA` - Visa
785
805
  * * `UTILITY_BILL` - Utility Bill
806
+ * * `UTILITY_BILL2` - Utility Bill2
786
807
  * * `SELFIE` - Selfie
787
808
  * * `VIDEO_SELFIE` - Video Selfie
809
+ * * `IDENTITY_VIDEO` - Identity Video
788
810
  * * `PROFILE_IMAGE` - Profile Image
789
811
  * * `ID_DOC_PHOTO` - Id Doc Photo
812
+ * * `EXTERNAL_DB_DOC` - External Db Doc
790
813
  * * `AGREEMENT` - Agreement
791
814
  * * `CONTRACT` - Contract
815
+ * * `SIGNED_CONTRACT` - Signed Contract
792
816
  * * `DRIVERS_TRANSLATION` - Drivers Translation
793
817
  * * `INVESTOR_DOC` - Investor Doc
794
818
  * * `VEHICLE_REGISTRATION_CERTIFICATE` - Vehicle Registration Certificate
795
819
  * * `INCOME_SOURCE` - Income Source
796
820
  * * `PAYMENT_METHOD` - Payment Method
821
+ * * `PAYMENT_SOURCE` - Payment Source
797
822
  * * `BANK_CARD` - Bank Card
798
823
  * * `ARBITRARY_DOC` - Arbitrary Doc
799
824
  * * `OTHER` - Other
825
+ * * `COMPANY_DOC` - Company Doc
826
+ * * `POWER_OF_ATTORNEY` - Power Of Attorney
827
+ * * `TRANSPARENCY_REGISTRY_EXTRACT` - Transparency Registry Extract
800
828
  */
801
- sumsub_type: 'ID_CARD' | 'PASSPORT' | 'DRIVERS' | 'RESIDENCE_PERMIT' | 'UTILITY_BILL' | 'SELFIE' | 'VIDEO_SELFIE' | 'PROFILE_IMAGE' | 'ID_DOC_PHOTO' | 'AGREEMENT' | 'CONTRACT' | 'DRIVERS_TRANSLATION' | 'INVESTOR_DOC' | 'VEHICLE_REGISTRATION_CERTIFICATE' | 'INCOME_SOURCE' | 'PAYMENT_METHOD' | 'BANK_CARD' | 'ARBITRARY_DOC' | 'OTHER';
802
- /**
803
- * * `single` - Single
804
- * * `double` - Double
805
- */
806
- kind?: 'single' | 'double';
829
+ sumsub_type: 'ID_CARD' | 'PASSPORT' | 'DRIVERS' | 'RESIDENCE_PERMIT' | 'VISA' | 'UTILITY_BILL' | 'UTILITY_BILL2' | 'SELFIE' | 'VIDEO_SELFIE' | 'IDENTITY_VIDEO' | 'PROFILE_IMAGE' | 'ID_DOC_PHOTO' | 'EXTERNAL_DB_DOC' | 'AGREEMENT' | 'CONTRACT' | 'SIGNED_CONTRACT' | 'DRIVERS_TRANSLATION' | 'INVESTOR_DOC' | 'VEHICLE_REGISTRATION_CERTIFICATE' | 'INCOME_SOURCE' | 'PAYMENT_METHOD' | 'PAYMENT_SOURCE' | 'BANK_CARD' | 'ARBITRARY_DOC' | 'OTHER' | 'COMPANY_DOC' | 'POWER_OF_ATTORNEY' | 'TRANSPARENCY_REGISTRY_EXTRACT';
807
830
  };
808
831
  type AdminDocumentTypeResponseWritable = {
809
832
  status: string;
@@ -870,28 +893,32 @@ type PatchedAdminDocumentTypeWritable = {
870
893
  * * `PASSPORT` - Passport
871
894
  * * `DRIVERS` - Drivers
872
895
  * * `RESIDENCE_PERMIT` - Residence Permit
896
+ * * `VISA` - Visa
873
897
  * * `UTILITY_BILL` - Utility Bill
898
+ * * `UTILITY_BILL2` - Utility Bill2
874
899
  * * `SELFIE` - Selfie
875
900
  * * `VIDEO_SELFIE` - Video Selfie
901
+ * * `IDENTITY_VIDEO` - Identity Video
876
902
  * * `PROFILE_IMAGE` - Profile Image
877
903
  * * `ID_DOC_PHOTO` - Id Doc Photo
904
+ * * `EXTERNAL_DB_DOC` - External Db Doc
878
905
  * * `AGREEMENT` - Agreement
879
906
  * * `CONTRACT` - Contract
907
+ * * `SIGNED_CONTRACT` - Signed Contract
880
908
  * * `DRIVERS_TRANSLATION` - Drivers Translation
881
909
  * * `INVESTOR_DOC` - Investor Doc
882
910
  * * `VEHICLE_REGISTRATION_CERTIFICATE` - Vehicle Registration Certificate
883
911
  * * `INCOME_SOURCE` - Income Source
884
912
  * * `PAYMENT_METHOD` - Payment Method
913
+ * * `PAYMENT_SOURCE` - Payment Source
885
914
  * * `BANK_CARD` - Bank Card
886
915
  * * `ARBITRARY_DOC` - Arbitrary Doc
887
916
  * * `OTHER` - Other
917
+ * * `COMPANY_DOC` - Company Doc
918
+ * * `POWER_OF_ATTORNEY` - Power Of Attorney
919
+ * * `TRANSPARENCY_REGISTRY_EXTRACT` - Transparency Registry Extract
888
920
  */
889
- sumsub_type?: 'ID_CARD' | 'PASSPORT' | 'DRIVERS' | 'RESIDENCE_PERMIT' | 'UTILITY_BILL' | 'SELFIE' | 'VIDEO_SELFIE' | 'PROFILE_IMAGE' | 'ID_DOC_PHOTO' | 'AGREEMENT' | 'CONTRACT' | 'DRIVERS_TRANSLATION' | 'INVESTOR_DOC' | 'VEHICLE_REGISTRATION_CERTIFICATE' | 'INCOME_SOURCE' | 'PAYMENT_METHOD' | 'BANK_CARD' | 'ARBITRARY_DOC' | 'OTHER';
890
- /**
891
- * * `single` - Single
892
- * * `double` - Double
893
- */
894
- kind?: 'single' | 'double';
921
+ sumsub_type?: 'ID_CARD' | 'PASSPORT' | 'DRIVERS' | 'RESIDENCE_PERMIT' | 'VISA' | 'UTILITY_BILL' | 'UTILITY_BILL2' | 'SELFIE' | 'VIDEO_SELFIE' | 'IDENTITY_VIDEO' | 'PROFILE_IMAGE' | 'ID_DOC_PHOTO' | 'EXTERNAL_DB_DOC' | 'AGREEMENT' | 'CONTRACT' | 'SIGNED_CONTRACT' | 'DRIVERS_TRANSLATION' | 'INVESTOR_DOC' | 'VEHICLE_REGISTRATION_CERTIFICATE' | 'INCOME_SOURCE' | 'PAYMENT_METHOD' | 'PAYMENT_SOURCE' | 'BANK_CARD' | 'ARBITRARY_DOC' | 'OTHER' | 'COMPANY_DOC' | 'POWER_OF_ATTORNEY' | 'TRANSPARENCY_REGISTRY_EXTRACT';
895
922
  };
896
923
  /**
897
924
  * A ModelSerializer that takes additional arguments for
@@ -1245,7 +1272,7 @@ type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean
1245
1272
  * You can pass arbitrary values through the `meta` object. This can be
1246
1273
  * used to access values that aren't defined as part of the SDK function.
1247
1274
  */
1248
- meta?: Record<string, unknown>;
1275
+ meta?: keyof ClientMeta extends never ? Record<string, unknown> : ClientMeta;
1249
1276
  };
1250
1277
  declare const activateCreate: <ThrowOnError extends boolean = false>(options: Options<ActivateCreateData, ThrowOnError>) => RequestResult<ActivateCreateResponses, unknown, ThrowOnError>;
1251
1278
  declare const adminCompanyRetrieve: <ThrowOnError extends boolean = false>(options?: Options<AdminCompanyRetrieveData, ThrowOnError>) => RequestResult<AdminCompanyRetrieveResponses, unknown, ThrowOnError>;
@@ -1,6 +1,6 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkGR5TETAUjs = require('../chunk-GR5TETAU.js');var _chunkOEIQFP6Tjs = require('../chunk-OEIQFP6T.js');var K={};_chunkOEIQFP6Tjs.a.call(void 0, K,{activateCreate:()=>he,adminCompanyPartialUpdate:()=>we,adminCompanyRetrieve:()=>Re,adminCompanyUpdate:()=>Oe,adminCurrenciesList:()=>be,adminCurrenciesPartialUpdate:()=>ge,adminCurrenciesRetrieve:()=>Te,adminCurrenciesUpdate:()=>Ce,adminDocumentTypesCreate:()=>Ae,adminDocumentTypesDestroy:()=>xe,adminDocumentTypesList:()=>Se,adminDocumentTypesPartialUpdate:()=>Ee,adminDocumentTypesRetrieve:()=>ke,adminDocumentTypesUpdate:()=>De,adminUserShareCreate:()=>Ue,adminUsersList:()=>qe,adminUsersRetrieve:()=>ze,deactivateCreate:()=>Pe,sumsubWebhookCreate:()=>je,userAccessTokenCreate:()=>Le,userCompanyRetrieve:()=>$e,userPartialUpdate:()=>Ie,userRetrieve:()=>ve,userUpdate:()=>Be,webhookCreate:()=>Ke});var I={bodySerializer:e=>JSON.stringify(e,(r,t)=>typeof t=="bigint"?t.toString():t)};var ae={$body_:"body",$headers_:"headers",$path_:"path",$query_:"query"},He=Object.entries(ae);function Q({onRequest:e,onSseError:r,onSseEvent:t,responseTransformer:s,responseValidator:i,sseDefaultRetryDelay:p,sseMaxRetryAttempts:o,sseMaxRetryDelay:n,sseSleepFn:a,url:w,...c}){let u,b=_nullishCoalesce(a, () => ((l=>new Promise(f=>setTimeout(f,l)))));return{stream:async function*(){let l=_nullishCoalesce(p, () => (3e3)),f=0,O=_nullishCoalesce(c.signal, () => (new AbortController().signal));for(;!O.aborted;){f++;let U=c.headers instanceof Headers?c.headers:new Headers(c.headers);u!==void 0&&U.set("Last-Event-ID",u);try{let C={redirect:"follow",...c,body:c.serializedBody,headers:U,signal:O},S=new Request(w,C);e&&(S=await e(w,C));let m=await(_nullishCoalesce(c.fetch, () => (globalThis.fetch)))(S);if(!m.ok)throw new Error(`SSE failed: ${m.status} ${m.statusText}`);if(!m.body)throw new Error("No body in SSE response");let T=m.body.pipeThrough(new TextDecoderStream).getReader(),h="",W=()=>{try{T.cancel()}catch (e2){}};O.addEventListener("abort",W);try{for(;;){let{done:re,value:te}=await T.read();if(re)break;h+=te,h=h.replace(/\r\n?/g,`
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkGR5TETAUjs = require('../chunk-GR5TETAU.js');var _chunkOEIQFP6Tjs = require('../chunk-OEIQFP6T.js');var K={};_chunkOEIQFP6Tjs.a.call(void 0, K,{activateCreate:()=>he,adminCompanyPartialUpdate:()=>we,adminCompanyRetrieve:()=>Re,adminCompanyUpdate:()=>Oe,adminCurrenciesList:()=>be,adminCurrenciesPartialUpdate:()=>ge,adminCurrenciesRetrieve:()=>Te,adminCurrenciesUpdate:()=>Ce,adminDocumentTypesCreate:()=>Ae,adminDocumentTypesDestroy:()=>xe,adminDocumentTypesList:()=>Se,adminDocumentTypesPartialUpdate:()=>ke,adminDocumentTypesRetrieve:()=>Ee,adminDocumentTypesUpdate:()=>De,adminUserShareCreate:()=>Ue,adminUsersList:()=>qe,adminUsersRetrieve:()=>ze,deactivateCreate:()=>Pe,sumsubWebhookCreate:()=>je,userAccessTokenCreate:()=>Le,userCompanyRetrieve:()=>$e,userPartialUpdate:()=>Ie,userRetrieve:()=>ve,userUpdate:()=>Be,webhookCreate:()=>Ke});var I={bodySerializer:e=>JSON.stringify(e,(r,t)=>typeof t=="bigint"?t.toString():t)};var ie={$body_:"body",$headers_:"headers",$path_:"path",$query_:"query"},He=Object.entries(ie);function Q({onRequest:e,onSseError:r,onSseEvent:t,responseTransformer:s,responseValidator:a,sseDefaultRetryDelay:p,sseMaxRetryAttempts:o,sseMaxRetryDelay:n,sseSleepFn:i,url:w,...c}){let u,b=_nullishCoalesce(i, () => ((l=>new Promise(f=>setTimeout(f,l)))));return{stream:async function*(){let l=_nullishCoalesce(p, () => (3e3)),f=0,O=_nullishCoalesce(c.signal, () => (new AbortController().signal));for(;!O.aborted;){f++;let U=c.headers instanceof Headers?c.headers:new Headers(c.headers);u!==void 0&&U.set("Last-Event-ID",u);try{let C={redirect:"follow",...c,body:c.serializedBody,headers:U,signal:O},S=new Request(w,C);e&&(S=await e(w,C));let m=await(_nullishCoalesce(c.fetch, () => (globalThis.fetch)))(S);if(!m.ok)throw new Error(`SSE failed: ${m.status} ${m.statusText}`);if(!m.body)throw new Error("No body in SSE response");let T=m.body.pipeThrough(new TextDecoderStream).getReader(),h="",W=()=>{try{T.cancel()}catch (e2){}};O.addEventListener("abort",W);try{for(;;){let{done:re,value:te}=await T.read();if(re)break;h+=te,h=h.replace(/\r\n?/g,`
2
2
  `);let N=h.split(`
3
3
 
4
4
  `);h=_nullishCoalesce(N.pop(), () => (""));for(let ne of N){let se=ne.split(`
5
5
  `),q=[],H;for(let g of se)if(g.startsWith("data:"))q.push(g.replace(/^data:\s*/,""));else if(g.startsWith("event:"))H=g.replace(/^event:\s*/,"");else if(g.startsWith("id:"))u=g.replace(/^id:\s*/,"");else if(g.startsWith("retry:")){let V=Number.parseInt(g.replace(/^retry:\s*/,""),10);Number.isNaN(V)||(l=V)}let A,M=!1;if(q.length){let g=q.join(`
6
- `);try{A=JSON.parse(g),M=!0}catch (e3){A=g}}M&&(i&&await i(A),s&&(A=await s(A))),_optionalChain([t, 'optionalCall', _2 => _2({data:A,event:H,id:u,retry:l})]),q.length&&(yield A)}}}finally{O.removeEventListener("abort",W),T.releaseLock()}break}catch(C){if(_optionalChain([r, 'optionalCall', _3 => _3(C)]),o!==void 0&&f>=o)break;let S=Math.min(l*2**(f-1),_nullishCoalesce(n, () => (3e4)));await b(S)}}}()}}var ie=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},pe=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},ue=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},z=({allowReserved:e,explode:r,name:t,style:s,value:i})=>{if(!r){let n=(e?i:i.map(a=>encodeURIComponent(a))).join(pe(s));switch(s){case"label":return`.${n}`;case"matrix":return`;${t}=${n}`;case"simple":return n;default:return`${t}=${n}`}}let p=ie(s),o=i.map(n=>s==="label"||s==="simple"?e?n:encodeURIComponent(n):x({allowReserved:e,name:t,value:n})).join(p);return s==="label"||s==="matrix"?p+o:o},x=({allowReserved:e,name:r,value:t})=>{if(t==null)return"";if(typeof t=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${r}=${e?t:encodeURIComponent(t)}`},P=({allowReserved:e,explode:r,name:t,style:s,value:i,valueOnly:p})=>{if(i instanceof Date)return p?i.toISOString():`${t}=${i.toISOString()}`;if(s!=="deepObject"&&!r){let a=[];Object.entries(i).forEach(([c,u])=>{a=[...a,c,e?u:encodeURIComponent(u)]});let w=a.join(",");switch(s){case"form":return`${t}=${w}`;case"label":return`.${w}`;case"matrix":return`;${t}=${w}`;default:return w}}let o=ue(s),n=Object.entries(i).map(([a,w])=>x({allowReserved:e,name:s==="deepObject"?`${t}[${a}]`:a,value:w})).join(o);return s==="label"||s==="matrix"?o+n:n};var ce=/\{[^{}]+\}/g,de=({path:e,url:r})=>{let t=r,s=r.match(ce);if(s)for(let i of s){let p=!1,o=i.substring(1,i.length-1),n="simple";o.endsWith("*")&&(p=!0,o=o.substring(0,o.length-1)),o.startsWith(".")?(o=o.substring(1),n="label"):o.startsWith(";")&&(o=o.substring(1),n="matrix");let a=e[o];if(a==null)continue;if(Array.isArray(a)){t=t.replace(i,z({explode:p,name:o,style:n,value:a}));continue}if(typeof a=="object"){t=t.replace(i,P({explode:p,name:o,style:n,value:a,valueOnly:!0}));continue}if(n==="matrix"){t=t.replace(i,`;${x({name:o,value:a})}`);continue}let w=encodeURIComponent(n==="label"?`.${a}`:a);t=t.replace(i,w)}return t},_=({baseUrl:e,path:r,query:t,querySerializer:s,url:i})=>{let p=i.startsWith("/")?i:`/${i}`,o=(_nullishCoalesce(e, () => ("")))+p;r&&(o=de({path:r,url:o}));let n=t?s(t):"";return n.startsWith("?")&&(n=n.substring(1)),n&&(o+=`?${n}`),o};function B(e){let r=e.body!==void 0;if(r&&e.bodySerializer)return"serializedBody"in e?e.serializedBody!==void 0&&e.serializedBody!==""?e.serializedBody:null:e.body!==""?e.body:null;if(r)return e.body}var G=async(e,r)=>{let t=typeof r=="function"?await r(e):r;if(t)return e.scheme==="bearer"?`Bearer ${t}`:e.scheme==="basic"?`Basic ${btoa(t)}`:t};var X=({parameters:e={},...r}={})=>s=>{let i=[];if(s&&typeof s=="object")for(let p in s){let o=s[p];if(o==null)continue;let n=e[p]||r;if(Array.isArray(o)){let a=z({allowReserved:n.allowReserved,explode:!0,name:p,style:"form",value:o,...n.array});a&&i.push(a)}else if(typeof o=="object"){let a=P({allowReserved:n.allowReserved,explode:!0,name:p,style:"deepObject",value:o,...n.object});a&&i.push(a)}else{let a=x({allowReserved:n.allowReserved,name:p,value:o});a&&i.push(a)}}return i.join("&")},Y=e=>{if(!e)return"stream";let r=_optionalChain([e, 'access', _4 => _4.split, 'call', _5 => _5(";"), 'access', _6 => _6[0], 'optionalAccess', _7 => _7.trim, 'call', _8 => _8()]);if(r){if(r.startsWith("application/json")||r.endsWith("+json"))return"json";if(r==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(t=>r.startsWith(t)))return"blob";if(r.startsWith("text/"))return"text"}},le=(e,r)=>r?!!(e.headers.has(r)||_optionalChain([e, 'access', _9 => _9.query, 'optionalAccess', _10 => _10[r]])||_optionalChain([e, 'access', _11 => _11.headers, 'access', _12 => _12.get, 'call', _13 => _13("Cookie"), 'optionalAccess', _14 => _14.includes, 'call', _15 => _15(`${r}=`)])):!1;async function Z(e){for(let r of _nullishCoalesce(e.security, () => ([]))){if(le(e,r.name))continue;let t=await G(r,e.auth);if(!t)continue;let s=_nullishCoalesce(r.name, () => ("Authorization"));switch(r.in){case"query":e.query||(e.query={}),e.query[s]=t;break;case"cookie":e.headers.append("Cookie",`${s}=${t}`);break;case"header":default:e.headers.set(s,t);break}}}var L=e=>_({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:X(e.querySerializer),url:e.url}),$=(e,r)=>{let t={...e,...r};return _optionalChain([t, 'access', _16 => _16.baseUrl, 'optionalAccess', _17 => _17.endsWith, 'call', _18 => _18("/")])&&(t.baseUrl=t.baseUrl.substring(0,t.baseUrl.length-1)),t.headers=j(e.headers,r.headers),t},ye=e=>{let r=[];return e.forEach((t,s)=>{r.push([s,t])}),r},j=(...e)=>{let r=new Headers;for(let t of e){if(!t)continue;let s=t instanceof Headers?ye(t):Object.entries(t);for(let[i,p]of s)if(p===null)r.delete(i);else if(Array.isArray(p))for(let o of p)r.append(i,o);else p!==void 0&&r.set(i,typeof p=="object"?JSON.stringify(p):p)}return r},k=class{constructor(){this.fns=[]}clear(){this.fns=[]}eject(r){let t=this.getInterceptorIndex(r);this.fns[t]&&(this.fns[t]=null)}exists(r){let t=this.getInterceptorIndex(r);return!!this.fns[t]}getInterceptorIndex(r){return typeof r=="number"?this.fns[r]?r:-1:this.fns.indexOf(r)}update(r,t){let s=this.getInterceptorIndex(r);return this.fns[s]?(this.fns[s]=t,r):!1}use(r){return this.fns.push(r),this.fns.length-1}},ee=()=>({error:new k,request:new k,response:new k}),fe=X({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),me={"Content-Type":"application/json"},E=(e={})=>({...I,headers:me,parseAs:"auto",querySerializer:fe,...e});var D=(e={})=>{let r=$(E(),e),t=()=>({...r}),s=c=>(r=$(r,c),t()),i=ee(),p=async c=>{let u={...r,...c,fetch:_nullishCoalesce(_nullishCoalesce(c.fetch, () => (r.fetch)), () => (globalThis.fetch)),headers:j(r.headers,c.headers),serializedBody:void 0};u.security&&await Z(u),u.requestValidator&&await u.requestValidator(u),u.body!==void 0&&u.bodySerializer&&(u.serializedBody=u.bodySerializer(u.body)),(u.body===void 0||u.serializedBody==="")&&u.headers.delete("Content-Type");let b=u,R=L(b);return{opts:b,url:R}},o=async c=>{let u=_nullishCoalesce(c.throwOnError, () => (r.throwOnError)),b=_nullishCoalesce(c.responseStyle, () => (r.responseStyle)),R,y;try{let{opts:l,url:f}=await p(c),O={redirect:"follow",...l,body:B(l)};R=new Request(f,O);for(let m of i.request.fns)m&&(R=await m(R,l));let U=l.fetch;y=await U(R);for(let m of i.response.fns)m&&(y=await m(y,R,l));let C={request:R,response:y};if(y.ok){let m=_nullishCoalesce((l.parseAs==="auto"?Y(y.headers.get("Content-Type")):l.parseAs), () => ("json"));if(y.status===204||y.headers.get("Content-Length")==="0"){let h;switch(m){case"arrayBuffer":case"blob":case"text":h=await y[m]();break;case"formData":h=new FormData;break;case"stream":h=y.body;break;case"json":default:h={};break}return l.responseStyle==="data"?h:{data:h,...C}}let T;switch(m){case"arrayBuffer":case"blob":case"formData":case"text":T=await y[m]();break;case"json":{let h=await y.text();T=h?JSON.parse(h):{};break}case"stream":return l.responseStyle==="data"?y.body:{data:y.body,...C}}return m==="json"&&(l.responseValidator&&await l.responseValidator(T),l.responseTransformer&&(T=await l.responseTransformer(T))),l.responseStyle==="data"?T:{data:T,...C}}let S=await y.text(),v;try{v=JSON.parse(S)}catch (e4){}throw _nullishCoalesce(v, () => (S))}catch(l){let f=l;for(let O of i.error.fns)O&&(f=await O(f,y,R,c));if(f=f||{},u)throw f;return b==="data"?void 0:{error:f,request:R,response:y}}},n=c=>u=>o({...u,method:c}),a=c=>async u=>{let{opts:b,url:R}=await p(u);return Q({...b,body:b.body,method:c,onRequest:async(y,l)=>{let f=new Request(y,l);for(let O of i.request.fns)O&&(f=await O(f,b));return f},serializedBody:B(b),url:R})};return{buildUrl:c=>L({...r,...c}),connect:n("CONNECT"),delete:n("DELETE"),get:n("GET"),getConfig:t,head:n("HEAD"),interceptors:i,options:n("OPTIONS"),patch:n("PATCH"),post:n("POST"),put:n("PUT"),request:o,setConfig:s,sse:{connect:a("CONNECT"),delete:a("DELETE"),get:a("GET"),head:a("HEAD"),options:a("OPTIONS"),patch:a("PATCH"),post:a("POST"),put:a("PUT"),trace:a("TRACE")},trace:n("TRACE")}};var d=D(E({baseUrl:"https://sumsub.services.rehive.com/api/"}));var he=e=>(_nullishCoalesce(e.client, () => (d))).post({url:"/activate/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Re=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _19 => _19.client]), () => (d))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e}),we=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _20 => _20.client]), () => (d))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e,headers:{"Content-Type":"application/json",..._optionalChain([e, 'optionalAccess', _21 => _21.headers])}}),Oe=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _22 => _22.client]), () => (d))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e,headers:{"Content-Type":"application/json",..._optionalChain([e, 'optionalAccess', _23 => _23.headers])}}),be=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _24 => _24.client]), () => (d))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/",...e}),Te=e=>(_nullishCoalesce(e.client, () => (d))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/{code}/",...e}),ge=e=>(_nullishCoalesce(e.client, () => (d))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/{code}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ce=e=>(_nullishCoalesce(e.client, () => (d))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/{code}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Se=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _25 => _25.client]), () => (d))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/document-types/",...e}),Ae=e=>(_nullishCoalesce(e.client, () => (d))).post({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/document-types/",...e,headers:{"Content-Type":"application/json",...e.headers}}),xe=e=>(_nullishCoalesce(e.client, () => (d))).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/document-types/{identifier}/",...e}),ke=e=>(_nullishCoalesce(e.client, () => (d))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/document-types/{identifier}/",...e}),Ee=e=>(_nullishCoalesce(e.client, () => (d))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/document-types/{identifier}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),De=e=>(_nullishCoalesce(e.client, () => (d))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/document-types/{identifier}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ue=e=>(_nullishCoalesce(e.client, () => (d))).post({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/user/{identifier}/share/",...e,headers:{"Content-Type":"application/json",...e.headers}}),qe=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _26 => _26.client]), () => (d))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/users/",...e}),ze=e=>(_nullishCoalesce(e.client, () => (d))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/users/{identifier}/",...e}),Pe=e=>(_nullishCoalesce(e.client, () => (d))).post({url:"/deactivate/",...e,headers:{"Content-Type":"application/json",...e.headers}}),je=e=>(_nullishCoalesce(e.client, () => (d))).post({url:"/sumsub/webhook/{company_id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),ve=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _27 => _27.client]), () => (d))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/",...e}),Ie=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _28 => _28.client]), () => (d))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/user/",...e,headers:{"Content-Type":"application/json",..._optionalChain([e, 'optionalAccess', _29 => _29.headers])}}),Be=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _30 => _30.client]), () => (d))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/user/",...e,headers:{"Content-Type":"application/json",..._optionalChain([e, 'optionalAccess', _31 => _31.headers])}}),Le=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _32 => _32.client]), () => (d))).post({security:[{name:"Authorization",type:"apiKey"}],url:"/user/access-token/",...e,headers:{"Content-Type":"application/json",..._optionalChain([e, 'optionalAccess', _33 => _33.headers])}}),$e=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _34 => _34.client]), () => (d))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/company/",...e}),Ke=e=>(_nullishCoalesce(e.client, () => (d))).post({url:"/webhook/",...e,headers:{"Content-Type":"application/json",...e.headers}});function We(e){let r=D(_chunkGR5TETAUjs.c.call(void 0, e,"https://sumsub.services.rehive.com/api/"));return _chunkGR5TETAUjs.a.call(void 0, K,r)}exports.createSumsubApi = We;
6
+ `);try{A=JSON.parse(g),M=!0}catch (e3){A=g}}M&&(a&&await a(A),s&&(A=await s(A))),_optionalChain([t, 'optionalCall', _2 => _2({data:A,event:H,id:u,retry:l})]),q.length&&(yield A)}}}finally{O.removeEventListener("abort",W),T.releaseLock()}break}catch(C){if(_optionalChain([r, 'optionalCall', _3 => _3(C)]),o!==void 0&&f>=o)break;let S=Math.min(l*2**(f-1),_nullishCoalesce(n, () => (3e4)));await b(S)}}}()}}var ae=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},pe=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},ue=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},z=({allowReserved:e,explode:r,name:t,style:s,value:a})=>{if(!r){let n=(e?a:a.map(i=>encodeURIComponent(i))).join(pe(s));switch(s){case"label":return`.${n}`;case"matrix":return`;${t}=${n}`;case"simple":return n;default:return`${t}=${n}`}}let p=ae(s),o=a.map(n=>s==="label"||s==="simple"?e?n:encodeURIComponent(n):x({allowReserved:e,name:t,value:n})).join(p);return s==="label"||s==="matrix"?p+o:o},x=({allowReserved:e,name:r,value:t})=>{if(t==null)return"";if(typeof t=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${r}=${e?t:encodeURIComponent(t)}`},P=({allowReserved:e,explode:r,name:t,style:s,value:a,valueOnly:p})=>{if(a instanceof Date)return p?a.toISOString():`${t}=${a.toISOString()}`;if(s!=="deepObject"&&!r){let i=[];Object.entries(a).forEach(([c,u])=>{i=[...i,c,e?u:encodeURIComponent(u)]});let w=i.join(",");switch(s){case"form":return`${t}=${w}`;case"label":return`.${w}`;case"matrix":return`;${t}=${w}`;default:return w}}let o=ue(s),n=Object.entries(a).map(([i,w])=>x({allowReserved:e,name:s==="deepObject"?`${t}[${i}]`:i,value:w})).join(o);return s==="label"||s==="matrix"?o+n:n};var ce=/\{[^{}]+\}/g,de=({path:e,url:r})=>{let t=r,s=r.match(ce);if(s)for(let a of s){let p=!1,o=a.substring(1,a.length-1),n="simple";o.endsWith("*")&&(p=!0,o=o.substring(0,o.length-1)),o.startsWith(".")?(o=o.substring(1),n="label"):o.startsWith(";")&&(o=o.substring(1),n="matrix");let i=e[o];if(i==null)continue;if(Array.isArray(i)){t=t.replace(a,z({explode:p,name:o,style:n,value:i}));continue}if(typeof i=="object"){t=t.replace(a,P({explode:p,name:o,style:n,value:i,valueOnly:!0}));continue}if(n==="matrix"){t=t.replace(a,`;${x({name:o,value:i})}`);continue}let w=encodeURIComponent(n==="label"?`.${i}`:i);t=t.replace(a,w)}return t},_=({baseUrl:e,path:r,query:t,querySerializer:s,url:a})=>{let p=a.startsWith("/")?a:`/${a}`,o=(_nullishCoalesce(e, () => ("")))+p;r&&(o=de({path:r,url:o}));let n=t?s(t):"";return n.startsWith("?")&&(n=n.substring(1)),n&&(o+=`?${n}`),o};function B(e){let r=e.body!==void 0;if(r&&e.bodySerializer)return"serializedBody"in e?e.serializedBody!==void 0&&e.serializedBody!==""?e.serializedBody:null:e.body!==""?e.body:null;if(r)return e.body}var G=async(e,r)=>{let t=typeof r=="function"?await r(e):r;if(t)return e.scheme==="bearer"?`Bearer ${t}`:e.scheme==="basic"?`Basic ${btoa(t)}`:t};var X=({parameters:e={},...r}={})=>s=>{let a=[];if(s&&typeof s=="object")for(let p in s){let o=s[p];if(o==null)continue;let n=e[p]||r;if(Array.isArray(o)){let i=z({allowReserved:n.allowReserved,explode:!0,name:p,style:"form",value:o,...n.array});i&&a.push(i)}else if(typeof o=="object"){let i=P({allowReserved:n.allowReserved,explode:!0,name:p,style:"deepObject",value:o,...n.object});i&&a.push(i)}else{let i=x({allowReserved:n.allowReserved,name:p,value:o});i&&a.push(i)}}return a.join("&")},Y=e=>{if(!e)return"stream";let r=_optionalChain([e, 'access', _4 => _4.split, 'call', _5 => _5(";"), 'access', _6 => _6[0], 'optionalAccess', _7 => _7.trim, 'call', _8 => _8()]);if(r){if(r.startsWith("application/json")||r.endsWith("+json"))return"json";if(r==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(t=>r.startsWith(t)))return"blob";if(r.startsWith("text/"))return"text"}},le=(e,r)=>r?!!(e.headers.has(r)||_optionalChain([e, 'access', _9 => _9.query, 'optionalAccess', _10 => _10[r]])||_optionalChain([e, 'access', _11 => _11.headers, 'access', _12 => _12.get, 'call', _13 => _13("Cookie"), 'optionalAccess', _14 => _14.includes, 'call', _15 => _15(`${r}=`)])):!1;async function Z(e){for(let r of _nullishCoalesce(e.security, () => ([]))){if(le(e,r.name))continue;let t=await G(r,e.auth);if(!t)continue;let s=_nullishCoalesce(r.name, () => ("Authorization"));switch(r.in){case"query":e.query||(e.query={}),e.query[s]=t;break;case"cookie":e.headers.append("Cookie",`${s}=${t}`);break;case"header":default:e.headers.set(s,t);break}}}var L=e=>_({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:X(e.querySerializer),url:e.url}),$=(e,r)=>{let t={...e,...r};return _optionalChain([t, 'access', _16 => _16.baseUrl, 'optionalAccess', _17 => _17.endsWith, 'call', _18 => _18("/")])&&(t.baseUrl=t.baseUrl.substring(0,t.baseUrl.length-1)),t.headers=j(e.headers,r.headers),t},ye=e=>{let r=[];return e.forEach((t,s)=>{r.push([s,t])}),r},j=(...e)=>{let r=new Headers;for(let t of e){if(!t)continue;let s=t instanceof Headers?ye(t):Object.entries(t);for(let[a,p]of s)if(p===null)r.delete(a);else if(Array.isArray(p))for(let o of p)r.append(a,o);else p!==void 0&&r.set(a,typeof p=="object"?JSON.stringify(p):p)}return r},E=class{constructor(){this.fns=[]}clear(){this.fns=[]}eject(r){let t=this.getInterceptorIndex(r);this.fns[t]&&(this.fns[t]=null)}exists(r){let t=this.getInterceptorIndex(r);return!!this.fns[t]}getInterceptorIndex(r){return typeof r=="number"?this.fns[r]?r:-1:this.fns.indexOf(r)}update(r,t){let s=this.getInterceptorIndex(r);return this.fns[s]?(this.fns[s]=t,r):!1}use(r){return this.fns.push(r),this.fns.length-1}},ee=()=>({error:new E,request:new E,response:new E}),fe=X({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),me={"Content-Type":"application/json"},k=(e={})=>({...I,headers:me,parseAs:"auto",querySerializer:fe,...e});var D=(e={})=>{let r=$(k(),e),t=()=>({...r}),s=c=>(r=$(r,c),t()),a=ee(),p=async c=>{let u={...r,...c,fetch:_nullishCoalesce(_nullishCoalesce(c.fetch, () => (r.fetch)), () => (globalThis.fetch)),headers:j(r.headers,c.headers),serializedBody:void 0};u.security&&await Z(u),u.requestValidator&&await u.requestValidator(u),u.body!==void 0&&u.bodySerializer&&(u.serializedBody=u.bodySerializer(u.body)),(u.body===void 0||u.serializedBody==="")&&u.headers.delete("Content-Type");let b=u,R=L(b);return{opts:b,url:R}},o=async c=>{let u=_nullishCoalesce(c.throwOnError, () => (r.throwOnError)),b=_nullishCoalesce(c.responseStyle, () => (r.responseStyle)),R,y;try{let{opts:l,url:f}=await p(c),O={redirect:"follow",...l,body:B(l)};R=new Request(f,O);for(let m of a.request.fns)m&&(R=await m(R,l));let U=l.fetch;y=await U(R);for(let m of a.response.fns)m&&(y=await m(y,R,l));let C={request:R,response:y};if(y.ok){let m=_nullishCoalesce((l.parseAs==="auto"?Y(y.headers.get("Content-Type")):l.parseAs), () => ("json"));if(y.status===204||y.headers.get("Content-Length")==="0"){let h;switch(m){case"arrayBuffer":case"blob":case"text":h=await y[m]();break;case"formData":h=new FormData;break;case"stream":h=y.body;break;case"json":default:h={};break}return l.responseStyle==="data"?h:{data:h,...C}}let T;switch(m){case"arrayBuffer":case"blob":case"formData":case"text":T=await y[m]();break;case"json":{let h=await y.text();T=h?JSON.parse(h):{};break}case"stream":return l.responseStyle==="data"?y.body:{data:y.body,...C}}return m==="json"&&(l.responseValidator&&await l.responseValidator(T),l.responseTransformer&&(T=await l.responseTransformer(T))),l.responseStyle==="data"?T:{data:T,...C}}let S=await y.text(),v;try{v=JSON.parse(S)}catch (e4){}throw _nullishCoalesce(v, () => (S))}catch(l){let f=l;for(let O of a.error.fns)O&&(f=await O(f,y,R,c));if(f=f||{},u)throw f;return b==="data"?void 0:{error:f,request:R,response:y}}},n=c=>u=>o({...u,method:c}),i=c=>async u=>{let{opts:b,url:R}=await p(u);return Q({...b,body:b.body,method:c,onRequest:async(y,l)=>{let f=new Request(y,l);for(let O of a.request.fns)O&&(f=await O(f,b));return f},serializedBody:B(b),url:R})};return{buildUrl:c=>L({...r,...c}),connect:n("CONNECT"),delete:n("DELETE"),get:n("GET"),getConfig:t,head:n("HEAD"),interceptors:a,options:n("OPTIONS"),patch:n("PATCH"),post:n("POST"),put:n("PUT"),request:o,setConfig:s,sse:{connect:i("CONNECT"),delete:i("DELETE"),get:i("GET"),head:i("HEAD"),options:i("OPTIONS"),patch:i("PATCH"),post:i("POST"),put:i("PUT"),trace:i("TRACE")},trace:n("TRACE")}};var d=D(k({baseUrl:"https://sumsub.services.rehive.com/api/"}));var he=e=>(_nullishCoalesce(e.client, () => (d))).post({url:"/activate/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Re=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _19 => _19.client]), () => (d))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e}),we=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _20 => _20.client]), () => (d))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e,headers:{"Content-Type":"application/json",..._optionalChain([e, 'optionalAccess', _21 => _21.headers])}}),Oe=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _22 => _22.client]), () => (d))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e,headers:{"Content-Type":"application/json",..._optionalChain([e, 'optionalAccess', _23 => _23.headers])}}),be=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _24 => _24.client]), () => (d))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/",...e}),Te=e=>(_nullishCoalesce(e.client, () => (d))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/{code}/",...e}),ge=e=>(_nullishCoalesce(e.client, () => (d))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/{code}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ce=e=>(_nullishCoalesce(e.client, () => (d))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/{code}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Se=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _25 => _25.client]), () => (d))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/document-types/",...e}),Ae=e=>(_nullishCoalesce(e.client, () => (d))).post({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/document-types/",...e,headers:{"Content-Type":"application/json",...e.headers}}),xe=e=>(_nullishCoalesce(e.client, () => (d))).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/document-types/{identifier}/",...e}),Ee=e=>(_nullishCoalesce(e.client, () => (d))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/document-types/{identifier}/",...e}),ke=e=>(_nullishCoalesce(e.client, () => (d))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/document-types/{identifier}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),De=e=>(_nullishCoalesce(e.client, () => (d))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/document-types/{identifier}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ue=e=>(_nullishCoalesce(e.client, () => (d))).post({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/user/{identifier}/share/",...e,headers:{"Content-Type":"application/json",...e.headers}}),qe=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _26 => _26.client]), () => (d))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/users/",...e}),ze=e=>(_nullishCoalesce(e.client, () => (d))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/users/{identifier}/",...e}),Pe=e=>(_nullishCoalesce(e.client, () => (d))).post({url:"/deactivate/",...e,headers:{"Content-Type":"application/json",...e.headers}}),je=e=>(_nullishCoalesce(e.client, () => (d))).post({url:"/sumsub/webhook/{company_id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),ve=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _27 => _27.client]), () => (d))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/",...e}),Ie=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _28 => _28.client]), () => (d))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/user/",...e,headers:{"Content-Type":"application/json",..._optionalChain([e, 'optionalAccess', _29 => _29.headers])}}),Be=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _30 => _30.client]), () => (d))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/user/",...e,headers:{"Content-Type":"application/json",..._optionalChain([e, 'optionalAccess', _31 => _31.headers])}}),Le=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _32 => _32.client]), () => (d))).post({security:[{name:"Authorization",type:"apiKey"}],url:"/user/access-token/",...e,headers:{"Content-Type":"application/json",..._optionalChain([e, 'optionalAccess', _33 => _33.headers])}}),$e=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _34 => _34.client]), () => (d))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/company/",...e}),Ke=e=>(_nullishCoalesce(e.client, () => (d))).post({url:"/webhook/",...e,headers:{"Content-Type":"application/json",...e.headers}});function We(e){let r=D(_chunkGR5TETAUjs.c.call(void 0, e,"https://sumsub.services.rehive.com/api/"));return _chunkGR5TETAUjs.a.call(void 0, K,r)}exports.createSumsubApi = We;
@@ -1,6 +1,6 @@
1
- import{a as F,c as J}from"../chunk-S5UXBHRU.mjs";import{a as oe}from"../chunk-S4QKN5WW.mjs";var K={};oe(K,{activateCreate:()=>he,adminCompanyPartialUpdate:()=>we,adminCompanyRetrieve:()=>Re,adminCompanyUpdate:()=>Oe,adminCurrenciesList:()=>be,adminCurrenciesPartialUpdate:()=>ge,adminCurrenciesRetrieve:()=>Te,adminCurrenciesUpdate:()=>Ce,adminDocumentTypesCreate:()=>Ae,adminDocumentTypesDestroy:()=>xe,adminDocumentTypesList:()=>Se,adminDocumentTypesPartialUpdate:()=>Ee,adminDocumentTypesRetrieve:()=>ke,adminDocumentTypesUpdate:()=>De,adminUserShareCreate:()=>Ue,adminUsersList:()=>qe,adminUsersRetrieve:()=>ze,deactivateCreate:()=>Pe,sumsubWebhookCreate:()=>je,userAccessTokenCreate:()=>Le,userCompanyRetrieve:()=>$e,userPartialUpdate:()=>Ie,userRetrieve:()=>ve,userUpdate:()=>Be,webhookCreate:()=>Ke});var I={bodySerializer:e=>JSON.stringify(e,(r,t)=>typeof t=="bigint"?t.toString():t)};var ae={$body_:"body",$headers_:"headers",$path_:"path",$query_:"query"},He=Object.entries(ae);function Q({onRequest:e,onSseError:r,onSseEvent:t,responseTransformer:s,responseValidator:i,sseDefaultRetryDelay:p,sseMaxRetryAttempts:o,sseMaxRetryDelay:n,sseSleepFn:a,url:w,...c}){let u,b=a??(l=>new Promise(f=>setTimeout(f,l)));return{stream:async function*(){let l=p??3e3,f=0,O=c.signal??new AbortController().signal;for(;!O.aborted;){f++;let U=c.headers instanceof Headers?c.headers:new Headers(c.headers);u!==void 0&&U.set("Last-Event-ID",u);try{let C={redirect:"follow",...c,body:c.serializedBody,headers:U,signal:O},S=new Request(w,C);e&&(S=await e(w,C));let m=await(c.fetch??globalThis.fetch)(S);if(!m.ok)throw new Error(`SSE failed: ${m.status} ${m.statusText}`);if(!m.body)throw new Error("No body in SSE response");let T=m.body.pipeThrough(new TextDecoderStream).getReader(),h="",W=()=>{try{T.cancel()}catch{}};O.addEventListener("abort",W);try{for(;;){let{done:re,value:te}=await T.read();if(re)break;h+=te,h=h.replace(/\r\n?/g,`
1
+ import{a as F,c as J}from"../chunk-S5UXBHRU.mjs";import{a as oe}from"../chunk-S4QKN5WW.mjs";var K={};oe(K,{activateCreate:()=>he,adminCompanyPartialUpdate:()=>we,adminCompanyRetrieve:()=>Re,adminCompanyUpdate:()=>Oe,adminCurrenciesList:()=>be,adminCurrenciesPartialUpdate:()=>ge,adminCurrenciesRetrieve:()=>Te,adminCurrenciesUpdate:()=>Ce,adminDocumentTypesCreate:()=>Ae,adminDocumentTypesDestroy:()=>xe,adminDocumentTypesList:()=>Se,adminDocumentTypesPartialUpdate:()=>ke,adminDocumentTypesRetrieve:()=>Ee,adminDocumentTypesUpdate:()=>De,adminUserShareCreate:()=>Ue,adminUsersList:()=>qe,adminUsersRetrieve:()=>ze,deactivateCreate:()=>Pe,sumsubWebhookCreate:()=>je,userAccessTokenCreate:()=>Le,userCompanyRetrieve:()=>$e,userPartialUpdate:()=>Ie,userRetrieve:()=>ve,userUpdate:()=>Be,webhookCreate:()=>Ke});var I={bodySerializer:e=>JSON.stringify(e,(r,t)=>typeof t=="bigint"?t.toString():t)};var ie={$body_:"body",$headers_:"headers",$path_:"path",$query_:"query"},He=Object.entries(ie);function Q({onRequest:e,onSseError:r,onSseEvent:t,responseTransformer:s,responseValidator:a,sseDefaultRetryDelay:p,sseMaxRetryAttempts:o,sseMaxRetryDelay:n,sseSleepFn:i,url:w,...c}){let u,b=i??(l=>new Promise(f=>setTimeout(f,l)));return{stream:async function*(){let l=p??3e3,f=0,O=c.signal??new AbortController().signal;for(;!O.aborted;){f++;let U=c.headers instanceof Headers?c.headers:new Headers(c.headers);u!==void 0&&U.set("Last-Event-ID",u);try{let C={redirect:"follow",...c,body:c.serializedBody,headers:U,signal:O},S=new Request(w,C);e&&(S=await e(w,C));let m=await(c.fetch??globalThis.fetch)(S);if(!m.ok)throw new Error(`SSE failed: ${m.status} ${m.statusText}`);if(!m.body)throw new Error("No body in SSE response");let T=m.body.pipeThrough(new TextDecoderStream).getReader(),h="",W=()=>{try{T.cancel()}catch{}};O.addEventListener("abort",W);try{for(;;){let{done:re,value:te}=await T.read();if(re)break;h+=te,h=h.replace(/\r\n?/g,`
2
2
  `);let N=h.split(`
3
3
 
4
4
  `);h=N.pop()??"";for(let ne of N){let se=ne.split(`
5
5
  `),q=[],H;for(let g of se)if(g.startsWith("data:"))q.push(g.replace(/^data:\s*/,""));else if(g.startsWith("event:"))H=g.replace(/^event:\s*/,"");else if(g.startsWith("id:"))u=g.replace(/^id:\s*/,"");else if(g.startsWith("retry:")){let V=Number.parseInt(g.replace(/^retry:\s*/,""),10);Number.isNaN(V)||(l=V)}let A,M=!1;if(q.length){let g=q.join(`
6
- `);try{A=JSON.parse(g),M=!0}catch{A=g}}M&&(i&&await i(A),s&&(A=await s(A))),t?.({data:A,event:H,id:u,retry:l}),q.length&&(yield A)}}}finally{O.removeEventListener("abort",W),T.releaseLock()}break}catch(C){if(r?.(C),o!==void 0&&f>=o)break;let S=Math.min(l*2**(f-1),n??3e4);await b(S)}}}()}}var ie=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},pe=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},ue=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},z=({allowReserved:e,explode:r,name:t,style:s,value:i})=>{if(!r){let n=(e?i:i.map(a=>encodeURIComponent(a))).join(pe(s));switch(s){case"label":return`.${n}`;case"matrix":return`;${t}=${n}`;case"simple":return n;default:return`${t}=${n}`}}let p=ie(s),o=i.map(n=>s==="label"||s==="simple"?e?n:encodeURIComponent(n):x({allowReserved:e,name:t,value:n})).join(p);return s==="label"||s==="matrix"?p+o:o},x=({allowReserved:e,name:r,value:t})=>{if(t==null)return"";if(typeof t=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${r}=${e?t:encodeURIComponent(t)}`},P=({allowReserved:e,explode:r,name:t,style:s,value:i,valueOnly:p})=>{if(i instanceof Date)return p?i.toISOString():`${t}=${i.toISOString()}`;if(s!=="deepObject"&&!r){let a=[];Object.entries(i).forEach(([c,u])=>{a=[...a,c,e?u:encodeURIComponent(u)]});let w=a.join(",");switch(s){case"form":return`${t}=${w}`;case"label":return`.${w}`;case"matrix":return`;${t}=${w}`;default:return w}}let o=ue(s),n=Object.entries(i).map(([a,w])=>x({allowReserved:e,name:s==="deepObject"?`${t}[${a}]`:a,value:w})).join(o);return s==="label"||s==="matrix"?o+n:n};var ce=/\{[^{}]+\}/g,de=({path:e,url:r})=>{let t=r,s=r.match(ce);if(s)for(let i of s){let p=!1,o=i.substring(1,i.length-1),n="simple";o.endsWith("*")&&(p=!0,o=o.substring(0,o.length-1)),o.startsWith(".")?(o=o.substring(1),n="label"):o.startsWith(";")&&(o=o.substring(1),n="matrix");let a=e[o];if(a==null)continue;if(Array.isArray(a)){t=t.replace(i,z({explode:p,name:o,style:n,value:a}));continue}if(typeof a=="object"){t=t.replace(i,P({explode:p,name:o,style:n,value:a,valueOnly:!0}));continue}if(n==="matrix"){t=t.replace(i,`;${x({name:o,value:a})}`);continue}let w=encodeURIComponent(n==="label"?`.${a}`:a);t=t.replace(i,w)}return t},_=({baseUrl:e,path:r,query:t,querySerializer:s,url:i})=>{let p=i.startsWith("/")?i:`/${i}`,o=(e??"")+p;r&&(o=de({path:r,url:o}));let n=t?s(t):"";return n.startsWith("?")&&(n=n.substring(1)),n&&(o+=`?${n}`),o};function B(e){let r=e.body!==void 0;if(r&&e.bodySerializer)return"serializedBody"in e?e.serializedBody!==void 0&&e.serializedBody!==""?e.serializedBody:null:e.body!==""?e.body:null;if(r)return e.body}var G=async(e,r)=>{let t=typeof r=="function"?await r(e):r;if(t)return e.scheme==="bearer"?`Bearer ${t}`:e.scheme==="basic"?`Basic ${btoa(t)}`:t};var X=({parameters:e={},...r}={})=>s=>{let i=[];if(s&&typeof s=="object")for(let p in s){let o=s[p];if(o==null)continue;let n=e[p]||r;if(Array.isArray(o)){let a=z({allowReserved:n.allowReserved,explode:!0,name:p,style:"form",value:o,...n.array});a&&i.push(a)}else if(typeof o=="object"){let a=P({allowReserved:n.allowReserved,explode:!0,name:p,style:"deepObject",value:o,...n.object});a&&i.push(a)}else{let a=x({allowReserved:n.allowReserved,name:p,value:o});a&&i.push(a)}}return i.join("&")},Y=e=>{if(!e)return"stream";let r=e.split(";")[0]?.trim();if(r){if(r.startsWith("application/json")||r.endsWith("+json"))return"json";if(r==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(t=>r.startsWith(t)))return"blob";if(r.startsWith("text/"))return"text"}},le=(e,r)=>r?!!(e.headers.has(r)||e.query?.[r]||e.headers.get("Cookie")?.includes(`${r}=`)):!1;async function Z(e){for(let r of e.security??[]){if(le(e,r.name))continue;let t=await G(r,e.auth);if(!t)continue;let s=r.name??"Authorization";switch(r.in){case"query":e.query||(e.query={}),e.query[s]=t;break;case"cookie":e.headers.append("Cookie",`${s}=${t}`);break;case"header":default:e.headers.set(s,t);break}}}var L=e=>_({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:X(e.querySerializer),url:e.url}),$=(e,r)=>{let t={...e,...r};return t.baseUrl?.endsWith("/")&&(t.baseUrl=t.baseUrl.substring(0,t.baseUrl.length-1)),t.headers=j(e.headers,r.headers),t},ye=e=>{let r=[];return e.forEach((t,s)=>{r.push([s,t])}),r},j=(...e)=>{let r=new Headers;for(let t of e){if(!t)continue;let s=t instanceof Headers?ye(t):Object.entries(t);for(let[i,p]of s)if(p===null)r.delete(i);else if(Array.isArray(p))for(let o of p)r.append(i,o);else p!==void 0&&r.set(i,typeof p=="object"?JSON.stringify(p):p)}return r},k=class{constructor(){this.fns=[]}clear(){this.fns=[]}eject(r){let t=this.getInterceptorIndex(r);this.fns[t]&&(this.fns[t]=null)}exists(r){let t=this.getInterceptorIndex(r);return!!this.fns[t]}getInterceptorIndex(r){return typeof r=="number"?this.fns[r]?r:-1:this.fns.indexOf(r)}update(r,t){let s=this.getInterceptorIndex(r);return this.fns[s]?(this.fns[s]=t,r):!1}use(r){return this.fns.push(r),this.fns.length-1}},ee=()=>({error:new k,request:new k,response:new k}),fe=X({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),me={"Content-Type":"application/json"},E=(e={})=>({...I,headers:me,parseAs:"auto",querySerializer:fe,...e});var D=(e={})=>{let r=$(E(),e),t=()=>({...r}),s=c=>(r=$(r,c),t()),i=ee(),p=async c=>{let u={...r,...c,fetch:c.fetch??r.fetch??globalThis.fetch,headers:j(r.headers,c.headers),serializedBody:void 0};u.security&&await Z(u),u.requestValidator&&await u.requestValidator(u),u.body!==void 0&&u.bodySerializer&&(u.serializedBody=u.bodySerializer(u.body)),(u.body===void 0||u.serializedBody==="")&&u.headers.delete("Content-Type");let b=u,R=L(b);return{opts:b,url:R}},o=async c=>{let u=c.throwOnError??r.throwOnError,b=c.responseStyle??r.responseStyle,R,y;try{let{opts:l,url:f}=await p(c),O={redirect:"follow",...l,body:B(l)};R=new Request(f,O);for(let m of i.request.fns)m&&(R=await m(R,l));let U=l.fetch;y=await U(R);for(let m of i.response.fns)m&&(y=await m(y,R,l));let C={request:R,response:y};if(y.ok){let m=(l.parseAs==="auto"?Y(y.headers.get("Content-Type")):l.parseAs)??"json";if(y.status===204||y.headers.get("Content-Length")==="0"){let h;switch(m){case"arrayBuffer":case"blob":case"text":h=await y[m]();break;case"formData":h=new FormData;break;case"stream":h=y.body;break;case"json":default:h={};break}return l.responseStyle==="data"?h:{data:h,...C}}let T;switch(m){case"arrayBuffer":case"blob":case"formData":case"text":T=await y[m]();break;case"json":{let h=await y.text();T=h?JSON.parse(h):{};break}case"stream":return l.responseStyle==="data"?y.body:{data:y.body,...C}}return m==="json"&&(l.responseValidator&&await l.responseValidator(T),l.responseTransformer&&(T=await l.responseTransformer(T))),l.responseStyle==="data"?T:{data:T,...C}}let S=await y.text(),v;try{v=JSON.parse(S)}catch{}throw v??S}catch(l){let f=l;for(let O of i.error.fns)O&&(f=await O(f,y,R,c));if(f=f||{},u)throw f;return b==="data"?void 0:{error:f,request:R,response:y}}},n=c=>u=>o({...u,method:c}),a=c=>async u=>{let{opts:b,url:R}=await p(u);return Q({...b,body:b.body,method:c,onRequest:async(y,l)=>{let f=new Request(y,l);for(let O of i.request.fns)O&&(f=await O(f,b));return f},serializedBody:B(b),url:R})};return{buildUrl:c=>L({...r,...c}),connect:n("CONNECT"),delete:n("DELETE"),get:n("GET"),getConfig:t,head:n("HEAD"),interceptors:i,options:n("OPTIONS"),patch:n("PATCH"),post:n("POST"),put:n("PUT"),request:o,setConfig:s,sse:{connect:a("CONNECT"),delete:a("DELETE"),get:a("GET"),head:a("HEAD"),options:a("OPTIONS"),patch:a("PATCH"),post:a("POST"),put:a("PUT"),trace:a("TRACE")},trace:n("TRACE")}};var d=D(E({baseUrl:"https://sumsub.services.rehive.com/api/"}));var he=e=>(e.client??d).post({url:"/activate/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Re=e=>(e?.client??d).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e}),we=e=>(e?.client??d).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e,headers:{"Content-Type":"application/json",...e?.headers}}),Oe=e=>(e?.client??d).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e,headers:{"Content-Type":"application/json",...e?.headers}}),be=e=>(e?.client??d).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/",...e}),Te=e=>(e.client??d).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/{code}/",...e}),ge=e=>(e.client??d).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/{code}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ce=e=>(e.client??d).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/{code}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Se=e=>(e?.client??d).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/document-types/",...e}),Ae=e=>(e.client??d).post({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/document-types/",...e,headers:{"Content-Type":"application/json",...e.headers}}),xe=e=>(e.client??d).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/document-types/{identifier}/",...e}),ke=e=>(e.client??d).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/document-types/{identifier}/",...e}),Ee=e=>(e.client??d).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/document-types/{identifier}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),De=e=>(e.client??d).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/document-types/{identifier}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ue=e=>(e.client??d).post({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/user/{identifier}/share/",...e,headers:{"Content-Type":"application/json",...e.headers}}),qe=e=>(e?.client??d).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/users/",...e}),ze=e=>(e.client??d).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/users/{identifier}/",...e}),Pe=e=>(e.client??d).post({url:"/deactivate/",...e,headers:{"Content-Type":"application/json",...e.headers}}),je=e=>(e.client??d).post({url:"/sumsub/webhook/{company_id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),ve=e=>(e?.client??d).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/",...e}),Ie=e=>(e?.client??d).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/user/",...e,headers:{"Content-Type":"application/json",...e?.headers}}),Be=e=>(e?.client??d).put({security:[{name:"Authorization",type:"apiKey"}],url:"/user/",...e,headers:{"Content-Type":"application/json",...e?.headers}}),Le=e=>(e?.client??d).post({security:[{name:"Authorization",type:"apiKey"}],url:"/user/access-token/",...e,headers:{"Content-Type":"application/json",...e?.headers}}),$e=e=>(e?.client??d).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/company/",...e}),Ke=e=>(e.client??d).post({url:"/webhook/",...e,headers:{"Content-Type":"application/json",...e.headers}});function We(e){let r=D(J(e,"https://sumsub.services.rehive.com/api/"));return F(K,r)}export{We as createSumsubApi};
6
+ `);try{A=JSON.parse(g),M=!0}catch{A=g}}M&&(a&&await a(A),s&&(A=await s(A))),t?.({data:A,event:H,id:u,retry:l}),q.length&&(yield A)}}}finally{O.removeEventListener("abort",W),T.releaseLock()}break}catch(C){if(r?.(C),o!==void 0&&f>=o)break;let S=Math.min(l*2**(f-1),n??3e4);await b(S)}}}()}}var ae=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},pe=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},ue=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},z=({allowReserved:e,explode:r,name:t,style:s,value:a})=>{if(!r){let n=(e?a:a.map(i=>encodeURIComponent(i))).join(pe(s));switch(s){case"label":return`.${n}`;case"matrix":return`;${t}=${n}`;case"simple":return n;default:return`${t}=${n}`}}let p=ae(s),o=a.map(n=>s==="label"||s==="simple"?e?n:encodeURIComponent(n):x({allowReserved:e,name:t,value:n})).join(p);return s==="label"||s==="matrix"?p+o:o},x=({allowReserved:e,name:r,value:t})=>{if(t==null)return"";if(typeof t=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${r}=${e?t:encodeURIComponent(t)}`},P=({allowReserved:e,explode:r,name:t,style:s,value:a,valueOnly:p})=>{if(a instanceof Date)return p?a.toISOString():`${t}=${a.toISOString()}`;if(s!=="deepObject"&&!r){let i=[];Object.entries(a).forEach(([c,u])=>{i=[...i,c,e?u:encodeURIComponent(u)]});let w=i.join(",");switch(s){case"form":return`${t}=${w}`;case"label":return`.${w}`;case"matrix":return`;${t}=${w}`;default:return w}}let o=ue(s),n=Object.entries(a).map(([i,w])=>x({allowReserved:e,name:s==="deepObject"?`${t}[${i}]`:i,value:w})).join(o);return s==="label"||s==="matrix"?o+n:n};var ce=/\{[^{}]+\}/g,de=({path:e,url:r})=>{let t=r,s=r.match(ce);if(s)for(let a of s){let p=!1,o=a.substring(1,a.length-1),n="simple";o.endsWith("*")&&(p=!0,o=o.substring(0,o.length-1)),o.startsWith(".")?(o=o.substring(1),n="label"):o.startsWith(";")&&(o=o.substring(1),n="matrix");let i=e[o];if(i==null)continue;if(Array.isArray(i)){t=t.replace(a,z({explode:p,name:o,style:n,value:i}));continue}if(typeof i=="object"){t=t.replace(a,P({explode:p,name:o,style:n,value:i,valueOnly:!0}));continue}if(n==="matrix"){t=t.replace(a,`;${x({name:o,value:i})}`);continue}let w=encodeURIComponent(n==="label"?`.${i}`:i);t=t.replace(a,w)}return t},_=({baseUrl:e,path:r,query:t,querySerializer:s,url:a})=>{let p=a.startsWith("/")?a:`/${a}`,o=(e??"")+p;r&&(o=de({path:r,url:o}));let n=t?s(t):"";return n.startsWith("?")&&(n=n.substring(1)),n&&(o+=`?${n}`),o};function B(e){let r=e.body!==void 0;if(r&&e.bodySerializer)return"serializedBody"in e?e.serializedBody!==void 0&&e.serializedBody!==""?e.serializedBody:null:e.body!==""?e.body:null;if(r)return e.body}var G=async(e,r)=>{let t=typeof r=="function"?await r(e):r;if(t)return e.scheme==="bearer"?`Bearer ${t}`:e.scheme==="basic"?`Basic ${btoa(t)}`:t};var X=({parameters:e={},...r}={})=>s=>{let a=[];if(s&&typeof s=="object")for(let p in s){let o=s[p];if(o==null)continue;let n=e[p]||r;if(Array.isArray(o)){let i=z({allowReserved:n.allowReserved,explode:!0,name:p,style:"form",value:o,...n.array});i&&a.push(i)}else if(typeof o=="object"){let i=P({allowReserved:n.allowReserved,explode:!0,name:p,style:"deepObject",value:o,...n.object});i&&a.push(i)}else{let i=x({allowReserved:n.allowReserved,name:p,value:o});i&&a.push(i)}}return a.join("&")},Y=e=>{if(!e)return"stream";let r=e.split(";")[0]?.trim();if(r){if(r.startsWith("application/json")||r.endsWith("+json"))return"json";if(r==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(t=>r.startsWith(t)))return"blob";if(r.startsWith("text/"))return"text"}},le=(e,r)=>r?!!(e.headers.has(r)||e.query?.[r]||e.headers.get("Cookie")?.includes(`${r}=`)):!1;async function Z(e){for(let r of e.security??[]){if(le(e,r.name))continue;let t=await G(r,e.auth);if(!t)continue;let s=r.name??"Authorization";switch(r.in){case"query":e.query||(e.query={}),e.query[s]=t;break;case"cookie":e.headers.append("Cookie",`${s}=${t}`);break;case"header":default:e.headers.set(s,t);break}}}var L=e=>_({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:X(e.querySerializer),url:e.url}),$=(e,r)=>{let t={...e,...r};return t.baseUrl?.endsWith("/")&&(t.baseUrl=t.baseUrl.substring(0,t.baseUrl.length-1)),t.headers=j(e.headers,r.headers),t},ye=e=>{let r=[];return e.forEach((t,s)=>{r.push([s,t])}),r},j=(...e)=>{let r=new Headers;for(let t of e){if(!t)continue;let s=t instanceof Headers?ye(t):Object.entries(t);for(let[a,p]of s)if(p===null)r.delete(a);else if(Array.isArray(p))for(let o of p)r.append(a,o);else p!==void 0&&r.set(a,typeof p=="object"?JSON.stringify(p):p)}return r},E=class{constructor(){this.fns=[]}clear(){this.fns=[]}eject(r){let t=this.getInterceptorIndex(r);this.fns[t]&&(this.fns[t]=null)}exists(r){let t=this.getInterceptorIndex(r);return!!this.fns[t]}getInterceptorIndex(r){return typeof r=="number"?this.fns[r]?r:-1:this.fns.indexOf(r)}update(r,t){let s=this.getInterceptorIndex(r);return this.fns[s]?(this.fns[s]=t,r):!1}use(r){return this.fns.push(r),this.fns.length-1}},ee=()=>({error:new E,request:new E,response:new E}),fe=X({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),me={"Content-Type":"application/json"},k=(e={})=>({...I,headers:me,parseAs:"auto",querySerializer:fe,...e});var D=(e={})=>{let r=$(k(),e),t=()=>({...r}),s=c=>(r=$(r,c),t()),a=ee(),p=async c=>{let u={...r,...c,fetch:c.fetch??r.fetch??globalThis.fetch,headers:j(r.headers,c.headers),serializedBody:void 0};u.security&&await Z(u),u.requestValidator&&await u.requestValidator(u),u.body!==void 0&&u.bodySerializer&&(u.serializedBody=u.bodySerializer(u.body)),(u.body===void 0||u.serializedBody==="")&&u.headers.delete("Content-Type");let b=u,R=L(b);return{opts:b,url:R}},o=async c=>{let u=c.throwOnError??r.throwOnError,b=c.responseStyle??r.responseStyle,R,y;try{let{opts:l,url:f}=await p(c),O={redirect:"follow",...l,body:B(l)};R=new Request(f,O);for(let m of a.request.fns)m&&(R=await m(R,l));let U=l.fetch;y=await U(R);for(let m of a.response.fns)m&&(y=await m(y,R,l));let C={request:R,response:y};if(y.ok){let m=(l.parseAs==="auto"?Y(y.headers.get("Content-Type")):l.parseAs)??"json";if(y.status===204||y.headers.get("Content-Length")==="0"){let h;switch(m){case"arrayBuffer":case"blob":case"text":h=await y[m]();break;case"formData":h=new FormData;break;case"stream":h=y.body;break;case"json":default:h={};break}return l.responseStyle==="data"?h:{data:h,...C}}let T;switch(m){case"arrayBuffer":case"blob":case"formData":case"text":T=await y[m]();break;case"json":{let h=await y.text();T=h?JSON.parse(h):{};break}case"stream":return l.responseStyle==="data"?y.body:{data:y.body,...C}}return m==="json"&&(l.responseValidator&&await l.responseValidator(T),l.responseTransformer&&(T=await l.responseTransformer(T))),l.responseStyle==="data"?T:{data:T,...C}}let S=await y.text(),v;try{v=JSON.parse(S)}catch{}throw v??S}catch(l){let f=l;for(let O of a.error.fns)O&&(f=await O(f,y,R,c));if(f=f||{},u)throw f;return b==="data"?void 0:{error:f,request:R,response:y}}},n=c=>u=>o({...u,method:c}),i=c=>async u=>{let{opts:b,url:R}=await p(u);return Q({...b,body:b.body,method:c,onRequest:async(y,l)=>{let f=new Request(y,l);for(let O of a.request.fns)O&&(f=await O(f,b));return f},serializedBody:B(b),url:R})};return{buildUrl:c=>L({...r,...c}),connect:n("CONNECT"),delete:n("DELETE"),get:n("GET"),getConfig:t,head:n("HEAD"),interceptors:a,options:n("OPTIONS"),patch:n("PATCH"),post:n("POST"),put:n("PUT"),request:o,setConfig:s,sse:{connect:i("CONNECT"),delete:i("DELETE"),get:i("GET"),head:i("HEAD"),options:i("OPTIONS"),patch:i("PATCH"),post:i("POST"),put:i("PUT"),trace:i("TRACE")},trace:n("TRACE")}};var d=D(k({baseUrl:"https://sumsub.services.rehive.com/api/"}));var he=e=>(e.client??d).post({url:"/activate/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Re=e=>(e?.client??d).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e}),we=e=>(e?.client??d).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e,headers:{"Content-Type":"application/json",...e?.headers}}),Oe=e=>(e?.client??d).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e,headers:{"Content-Type":"application/json",...e?.headers}}),be=e=>(e?.client??d).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/",...e}),Te=e=>(e.client??d).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/{code}/",...e}),ge=e=>(e.client??d).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/{code}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ce=e=>(e.client??d).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/{code}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Se=e=>(e?.client??d).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/document-types/",...e}),Ae=e=>(e.client??d).post({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/document-types/",...e,headers:{"Content-Type":"application/json",...e.headers}}),xe=e=>(e.client??d).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/document-types/{identifier}/",...e}),Ee=e=>(e.client??d).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/document-types/{identifier}/",...e}),ke=e=>(e.client??d).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/document-types/{identifier}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),De=e=>(e.client??d).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/document-types/{identifier}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ue=e=>(e.client??d).post({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/user/{identifier}/share/",...e,headers:{"Content-Type":"application/json",...e.headers}}),qe=e=>(e?.client??d).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/users/",...e}),ze=e=>(e.client??d).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/users/{identifier}/",...e}),Pe=e=>(e.client??d).post({url:"/deactivate/",...e,headers:{"Content-Type":"application/json",...e.headers}}),je=e=>(e.client??d).post({url:"/sumsub/webhook/{company_id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),ve=e=>(e?.client??d).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/",...e}),Ie=e=>(e?.client??d).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/user/",...e,headers:{"Content-Type":"application/json",...e?.headers}}),Be=e=>(e?.client??d).put({security:[{name:"Authorization",type:"apiKey"}],url:"/user/",...e,headers:{"Content-Type":"application/json",...e?.headers}}),Le=e=>(e?.client??d).post({security:[{name:"Authorization",type:"apiKey"}],url:"/user/access-token/",...e,headers:{"Content-Type":"application/json",...e?.headers}}),$e=e=>(e?.client??d).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/company/",...e}),Ke=e=>(e.client??d).post({url:"/webhook/",...e,headers:{"Content-Type":"application/json",...e.headers}});function We(e){let r=D(J(e,"https://sumsub.services.rehive.com/api/"));return F(K,r)}export{We as createSumsubApi};
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
- export { A as Auth, a as AuthConfig, i as AuthEvent, m as AuthEventListener, j as AuthEventType, g as AuthRecoveryState, d as AuthSession, h as AuthSnapshot, e as AuthState, l as AuthStateListener, f as AuthStatus, E as ErrorListener, I as ImportTokenOptions, L as LoginParams, b as RegisterCompanyParams, R as RegisterParams, k as SessionListener, S as SessionPatch, n as StorageAdapter, U as UserSession, V as ValidateSessionOptions, c as createAuth } from './create-auth-9l3wfvKL.mjs';
1
+ export { A as Auth, a as AuthConfig, i as AuthEvent, m as AuthEventListener, j as AuthEventType, g as AuthRecoveryState, d as AuthSession, h as AuthSnapshot, e as AuthState, l as AuthStateListener, f as AuthStatus, E as ErrorListener, I as ImportTokenOptions, L as LoginParams, b as RegisterCompanyParams, R as RegisterParams, k as SessionListener, S as SessionPatch, n as StorageAdapter, U as UserSession, V as ValidateSessionOptions, c as createAuth } from './create-auth-CROjq_cP.mjs';
2
2
  export { createUserApi } from './user.mjs';
3
3
  export { createAdminApi } from './admin.mjs';
4
- export { c as createAuthenticatedFetch } from './create-api-client-DvXFNRl7.mjs';
4
+ export { c as createAuthenticatedFetch } from './create-api-client-BY6W7Qz9.mjs';
5
5
  export { AsyncStorageAdapter, MemoryStorageAdapter, WebStorageAdapter } from './auth.mjs';
6
6
 
7
7
  declare class ApiError extends Error {
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- export { A as Auth, a as AuthConfig, i as AuthEvent, m as AuthEventListener, j as AuthEventType, g as AuthRecoveryState, d as AuthSession, h as AuthSnapshot, e as AuthState, l as AuthStateListener, f as AuthStatus, E as ErrorListener, I as ImportTokenOptions, L as LoginParams, b as RegisterCompanyParams, R as RegisterParams, k as SessionListener, S as SessionPatch, n as StorageAdapter, U as UserSession, V as ValidateSessionOptions, c as createAuth } from './create-auth-9l3wfvKL.js';
1
+ export { A as Auth, a as AuthConfig, i as AuthEvent, m as AuthEventListener, j as AuthEventType, g as AuthRecoveryState, d as AuthSession, h as AuthSnapshot, e as AuthState, l as AuthStateListener, f as AuthStatus, E as ErrorListener, I as ImportTokenOptions, L as LoginParams, b as RegisterCompanyParams, R as RegisterParams, k as SessionListener, S as SessionPatch, n as StorageAdapter, U as UserSession, V as ValidateSessionOptions, c as createAuth } from './create-auth-CROjq_cP.js';
2
2
  export { createUserApi } from './user.js';
3
3
  export { createAdminApi } from './admin.js';
4
- export { c as createAuthenticatedFetch } from './create-api-client-C02JVdcx.js';
4
+ export { c as createAuthenticatedFetch } from './create-api-client-CBNjHT-x.js';
5
5
  export { AsyncStorageAdapter, MemoryStorageAdapter, WebStorageAdapter } from './auth.js';
6
6
 
7
7
  declare class ApiError extends Error {
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkOP7MQ6KXjs = require('./chunk-OP7MQ6KX.js');var _chunkMAMZSYFFjs = require('./chunk-MAMZSYFF.js');require('./chunk-M6Z3PA5D.js');var _chunkYPGO2Y5Rjs = require('./chunk-YPGO2Y5R.js');var _chunkGR5TETAUjs = require('./chunk-GR5TETAU.js');var _chunkOEIQFP6Tjs = require('./chunk-OEIQFP6T.js');exports.ApiError = _chunkOEIQFP6Tjs.b; exports.AsyncStorageAdapter = _chunkOP7MQ6KXjs.c; exports.MemoryStorageAdapter = _chunkOP7MQ6KXjs.b; exports.WebStorageAdapter = _chunkOP7MQ6KXjs.a; exports.createAdminApi = _chunkYPGO2Y5Rjs.a; exports.createAuth = _chunkOP7MQ6KXjs.d; exports.createAuthenticatedFetch = _chunkGR5TETAUjs.b; exports.createUserApi = _chunkMAMZSYFFjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkY7BCC5TXjs = require('./chunk-Y7BCC5TX.js');var _chunk3BG2PD7Xjs = require('./chunk-3BG2PD7X.js');require('./chunk-AIKSGC2F.js');var _chunkK5GNAPOSjs = require('./chunk-K5GNAPOS.js');var _chunkGR5TETAUjs = require('./chunk-GR5TETAU.js');var _chunkOEIQFP6Tjs = require('./chunk-OEIQFP6T.js');exports.ApiError = _chunkOEIQFP6Tjs.b; exports.AsyncStorageAdapter = _chunkY7BCC5TXjs.c; exports.MemoryStorageAdapter = _chunkY7BCC5TXjs.b; exports.WebStorageAdapter = _chunkY7BCC5TXjs.a; exports.createAdminApi = _chunkK5GNAPOSjs.a; exports.createAuth = _chunkY7BCC5TXjs.d; exports.createAuthenticatedFetch = _chunkGR5TETAUjs.b; exports.createUserApi = _chunk3BG2PD7Xjs.a;
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{a as t,b as e,c as r,d as a}from"./chunk-KOUIKOXX.mjs";import{a as p}from"./chunk-QKHQP5JT.mjs";import"./chunk-WNBM6WBC.mjs";import{a as n}from"./chunk-HSNZ57ET.mjs";import{b as s}from"./chunk-S5UXBHRU.mjs";import{b as o}from"./chunk-S4QKN5WW.mjs";export{o as ApiError,r as AsyncStorageAdapter,e as MemoryStorageAdapter,t as WebStorageAdapter,n as createAdminApi,a as createAuth,s as createAuthenticatedFetch,p as createUserApi};
1
+ import{a as t,b as e,c as r,d as a}from"./chunk-HAVKMJEY.mjs";import{a as p}from"./chunk-JZVYT324.mjs";import"./chunk-4FVXXRGV.mjs";import{a as n}from"./chunk-BLPR7LRO.mjs";import{b as s}from"./chunk-S5UXBHRU.mjs";import{b as o}from"./chunk-S4QKN5WW.mjs";export{o as ApiError,r as AsyncStorageAdapter,e as MemoryStorageAdapter,t as WebStorageAdapter,n as createAdminApi,a as createAuth,s as createAuthenticatedFetch,p as createUserApi};
package/dist/react.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
- import { a as AuthConfig, d as AuthSession, f as AuthStatus, h as AuthSnapshot, g as AuthRecoveryState, L as LoginParams, R as RegisterParams, b as RegisterCompanyParams, I as ImportTokenOptions, V as ValidateSessionOptions, S as SessionPatch, A as Auth } from './create-auth-9l3wfvKL.mjs';
4
- export { i as AuthEvent, m as AuthEventListener, l as AuthStateListener, E as ErrorListener, k as SessionListener, U as UserSession } from './create-auth-9l3wfvKL.mjs';
3
+ import { a as AuthConfig, d as AuthSession, f as AuthStatus, h as AuthSnapshot, g as AuthRecoveryState, L as LoginParams, R as RegisterParams, b as RegisterCompanyParams, I as ImportTokenOptions, V as ValidateSessionOptions, S as SessionPatch, A as Auth } from './create-auth-CROjq_cP.mjs';
4
+ export { i as AuthEvent, m as AuthEventListener, l as AuthStateListener, E as ErrorListener, k as SessionListener, U as UserSession } from './create-auth-CROjq_cP.mjs';
5
5
 
6
6
  interface AuthContextType {
7
7
  authUser: AuthSession | null | undefined;
package/dist/react.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
- import { a as AuthConfig, d as AuthSession, f as AuthStatus, h as AuthSnapshot, g as AuthRecoveryState, L as LoginParams, R as RegisterParams, b as RegisterCompanyParams, I as ImportTokenOptions, V as ValidateSessionOptions, S as SessionPatch, A as Auth } from './create-auth-9l3wfvKL.js';
4
- export { i as AuthEvent, m as AuthEventListener, l as AuthStateListener, E as ErrorListener, k as SessionListener, U as UserSession } from './create-auth-9l3wfvKL.js';
3
+ import { a as AuthConfig, d as AuthSession, f as AuthStatus, h as AuthSnapshot, g as AuthRecoveryState, L as LoginParams, R as RegisterParams, b as RegisterCompanyParams, I as ImportTokenOptions, V as ValidateSessionOptions, S as SessionPatch, A as Auth } from './create-auth-CROjq_cP.js';
4
+ export { i as AuthEvent, m as AuthEventListener, l as AuthStateListener, E as ErrorListener, k as SessionListener, U as UserSession } from './create-auth-CROjq_cP.js';
5
5
 
6
6
  interface AuthContextType {
7
7
  authUser: AuthSession | null | undefined;
package/dist/react.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkOP7MQ6KXjs = require('./chunk-OP7MQ6KX.js');require('./chunk-M6Z3PA5D.js');require('./chunk-OEIQFP6T.js');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var l=_react.createContext.call(void 0, null),j= exports.AuthProvider =({children:r,config:S})=>{let[e]=_react.useState.call(void 0, ()=>_chunkOP7MQ6KXjs.d.call(void 0, S)),[p,a]=_react.useState.call(void 0, 0),A=_react.useCallback.call(void 0, s=>e.subscribeToState(()=>s()),[e]),u=_react.useCallback.call(void 0, ()=>e.getState(),[e]),i=_react.useSyncExternalStore.call(void 0, A,u,u),t=_react.useCallback.call(void 0, async function(s){a(n=>n+1);try{return await s()}finally{a(n=>Math.max(0,n-1))}},[]),h=_react.useCallback.call(void 0, ()=>e.refresh(),[e]),d=_react.useCallback.call(void 0, s=>t(()=>e.login(s)),[e,t]),g=_react.useCallback.call(void 0, s=>t(()=>e.register(s)),[e,t]),P=_react.useCallback.call(void 0, s=>t(()=>e.registerCompany(s)),[e,t]),y=_react.useCallback.call(void 0, ()=>t(()=>e.logout()),[e,t]),v=_react.useCallback.call(void 0, async s=>{s&&await t(()=>e.deleteChallenge(s))},[e,t]),f=_react.useCallback.call(void 0, (s,n)=>t(()=>e.switchToSession(s,n)),[e,t]),C=_react.useCallback.call(void 0, ()=>t(()=>e.clearAllSessions()),[e,t]),x=_react.useCallback.call(void 0, ()=>t(()=>e.logoutAll()),[e,t]),T=_react.useCallback.call(void 0, (s,n)=>t(()=>e.importToken(s,n)),[e,t]),R=_react.useCallback.call(void 0, s=>e.validateActiveSession(s),[e]),b=_react.useCallback.call(void 0, ()=>t(()=>e.syncActiveSessionUser()),[e,t]),k=_react.useCallback.call(void 0, (s,n,O)=>t(()=>e.updateSession(s,n,O)),[e,t]),L=_react.useCallback.call(void 0, ()=>t(()=>e.expireActiveSession()),[e,t]),w=p>0||i.status==="loading"||i.status==="refreshing",E={authUser:i.initialized?i.session:void 0,authStatus:i.status,authState:i,authRecovery:i.recovery,refreshCallback:h,login:d,register:g,registerCompany:P,logout:y,refresh:h,authLoading:w,authError:i.error,deleteChallenge:v,getSessions:e.getSessions,getSessionsByCompany:e.getSessionsByCompany,switchToSession:f,clearAllSessions:C,logoutAll:x,importToken:T,validateActiveSession:R,syncActiveSessionUser:b,updateSession:k,expireActiveSession:L,auth:e};return _jsxruntime.jsx.call(void 0, l.Provider,{value:E,children:r})},B= exports.useAuth =()=>{let r=_react.useContext.call(void 0, l);if(!r)throw new Error("useAuth must be used within an AuthProvider");return r};exports.AuthProvider = j; exports.useAuth = B;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkY7BCC5TXjs = require('./chunk-Y7BCC5TX.js');require('./chunk-AIKSGC2F.js');require('./chunk-OEIQFP6T.js');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var l=_react.createContext.call(void 0, null),j= exports.AuthProvider =({children:r,config:S})=>{let[e]=_react.useState.call(void 0, ()=>_chunkY7BCC5TXjs.d.call(void 0, S)),[p,a]=_react.useState.call(void 0, 0),A=_react.useCallback.call(void 0, s=>e.subscribeToState(()=>s()),[e]),u=_react.useCallback.call(void 0, ()=>e.getState(),[e]),i=_react.useSyncExternalStore.call(void 0, A,u,u),t=_react.useCallback.call(void 0, async function(s){a(n=>n+1);try{return await s()}finally{a(n=>Math.max(0,n-1))}},[]),h=_react.useCallback.call(void 0, ()=>e.refresh(),[e]),d=_react.useCallback.call(void 0, s=>t(()=>e.login(s)),[e,t]),g=_react.useCallback.call(void 0, s=>t(()=>e.register(s)),[e,t]),P=_react.useCallback.call(void 0, s=>t(()=>e.registerCompany(s)),[e,t]),y=_react.useCallback.call(void 0, ()=>t(()=>e.logout()),[e,t]),v=_react.useCallback.call(void 0, async s=>{s&&await t(()=>e.deleteChallenge(s))},[e,t]),f=_react.useCallback.call(void 0, (s,n)=>t(()=>e.switchToSession(s,n)),[e,t]),C=_react.useCallback.call(void 0, ()=>t(()=>e.clearAllSessions()),[e,t]),x=_react.useCallback.call(void 0, ()=>t(()=>e.logoutAll()),[e,t]),T=_react.useCallback.call(void 0, (s,n)=>t(()=>e.importToken(s,n)),[e,t]),R=_react.useCallback.call(void 0, s=>e.validateActiveSession(s),[e]),b=_react.useCallback.call(void 0, ()=>t(()=>e.syncActiveSessionUser()),[e,t]),k=_react.useCallback.call(void 0, (s,n,O)=>t(()=>e.updateSession(s,n,O)),[e,t]),L=_react.useCallback.call(void 0, ()=>t(()=>e.expireActiveSession()),[e,t]),w=p>0||i.status==="loading"||i.status==="refreshing",E={authUser:i.initialized?i.session:void 0,authStatus:i.status,authState:i,authRecovery:i.recovery,refreshCallback:h,login:d,register:g,registerCompany:P,logout:y,refresh:h,authLoading:w,authError:i.error,deleteChallenge:v,getSessions:e.getSessions,getSessionsByCompany:e.getSessionsByCompany,switchToSession:f,clearAllSessions:C,logoutAll:x,importToken:T,validateActiveSession:R,syncActiveSessionUser:b,updateSession:k,expireActiveSession:L,auth:e};return _jsxruntime.jsx.call(void 0, l.Provider,{value:E,children:r})},B= exports.useAuth =()=>{let r=_react.useContext.call(void 0, l);if(!r)throw new Error("useAuth must be used within an AuthProvider");return r};exports.AuthProvider = j; exports.useAuth = B;
package/dist/react.mjs CHANGED
@@ -1 +1 @@
1
- import{d as c}from"./chunk-KOUIKOXX.mjs";import"./chunk-WNBM6WBC.mjs";import"./chunk-S4QKN5WW.mjs";import{createContext as I,useContext as U,useState as m,useCallback as o,useSyncExternalStore as V}from"react";import{jsx as N}from"react/jsx-runtime";var l=I(null),j=({children:r,config:S})=>{let[e]=m(()=>c(S)),[p,a]=m(0),A=o(s=>e.subscribeToState(()=>s()),[e]),u=o(()=>e.getState(),[e]),i=V(A,u,u),t=o(async function(s){a(n=>n+1);try{return await s()}finally{a(n=>Math.max(0,n-1))}},[]),h=o(()=>e.refresh(),[e]),d=o(s=>t(()=>e.login(s)),[e,t]),g=o(s=>t(()=>e.register(s)),[e,t]),P=o(s=>t(()=>e.registerCompany(s)),[e,t]),y=o(()=>t(()=>e.logout()),[e,t]),v=o(async s=>{s&&await t(()=>e.deleteChallenge(s))},[e,t]),f=o((s,n)=>t(()=>e.switchToSession(s,n)),[e,t]),C=o(()=>t(()=>e.clearAllSessions()),[e,t]),x=o(()=>t(()=>e.logoutAll()),[e,t]),T=o((s,n)=>t(()=>e.importToken(s,n)),[e,t]),R=o(s=>e.validateActiveSession(s),[e]),b=o(()=>t(()=>e.syncActiveSessionUser()),[e,t]),k=o((s,n,O)=>t(()=>e.updateSession(s,n,O)),[e,t]),L=o(()=>t(()=>e.expireActiveSession()),[e,t]),w=p>0||i.status==="loading"||i.status==="refreshing",E={authUser:i.initialized?i.session:void 0,authStatus:i.status,authState:i,authRecovery:i.recovery,refreshCallback:h,login:d,register:g,registerCompany:P,logout:y,refresh:h,authLoading:w,authError:i.error,deleteChallenge:v,getSessions:e.getSessions,getSessionsByCompany:e.getSessionsByCompany,switchToSession:f,clearAllSessions:C,logoutAll:x,importToken:T,validateActiveSession:R,syncActiveSessionUser:b,updateSession:k,expireActiveSession:L,auth:e};return N(l.Provider,{value:E,children:r})},B=()=>{let r=U(l);if(!r)throw new Error("useAuth must be used within an AuthProvider");return r};export{j as AuthProvider,B as useAuth};
1
+ import{d as c}from"./chunk-HAVKMJEY.mjs";import"./chunk-4FVXXRGV.mjs";import"./chunk-S4QKN5WW.mjs";import{createContext as I,useContext as U,useState as m,useCallback as o,useSyncExternalStore as V}from"react";import{jsx as N}from"react/jsx-runtime";var l=I(null),j=({children:r,config:S})=>{let[e]=m(()=>c(S)),[p,a]=m(0),A=o(s=>e.subscribeToState(()=>s()),[e]),u=o(()=>e.getState(),[e]),i=V(A,u,u),t=o(async function(s){a(n=>n+1);try{return await s()}finally{a(n=>Math.max(0,n-1))}},[]),h=o(()=>e.refresh(),[e]),d=o(s=>t(()=>e.login(s)),[e,t]),g=o(s=>t(()=>e.register(s)),[e,t]),P=o(s=>t(()=>e.registerCompany(s)),[e,t]),y=o(()=>t(()=>e.logout()),[e,t]),v=o(async s=>{s&&await t(()=>e.deleteChallenge(s))},[e,t]),f=o((s,n)=>t(()=>e.switchToSession(s,n)),[e,t]),C=o(()=>t(()=>e.clearAllSessions()),[e,t]),x=o(()=>t(()=>e.logoutAll()),[e,t]),T=o((s,n)=>t(()=>e.importToken(s,n)),[e,t]),R=o(s=>e.validateActiveSession(s),[e]),b=o(()=>t(()=>e.syncActiveSessionUser()),[e,t]),k=o((s,n,O)=>t(()=>e.updateSession(s,n,O)),[e,t]),L=o(()=>t(()=>e.expireActiveSession()),[e,t]),w=p>0||i.status==="loading"||i.status==="refreshing",E={authUser:i.initialized?i.session:void 0,authStatus:i.status,authState:i,authRecovery:i.recovery,refreshCallback:h,login:d,register:g,registerCompany:P,logout:y,refresh:h,authLoading:w,authError:i.error,deleteChallenge:v,getSessions:e.getSessions,getSessionsByCompany:e.getSessionsByCompany,switchToSession:f,clearAllSessions:C,logoutAll:x,importToken:T,validateActiveSession:R,syncActiveSessionUser:b,updateSession:k,expireActiveSession:L,auth:e};return N(l.Provider,{value:E,children:r})},B=()=>{let r=U(l);if(!r)throw new Error("useAuth must be used within an AuthProvider");return r};export{j as AuthProvider,B as useAuth};