@tonysamperi/ts-mapi-core 1.8.0 → 2.0.0-beta.1

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 (239) hide show
  1. package/dist/cjs/dynamo.cjs +2 -0
  2. package/dist/cjs/dynamo.cjs.map +1 -0
  3. package/dist/cjs/firebase.cjs +2 -0
  4. package/dist/cjs/firebase.cjs.map +1 -0
  5. package/dist/cjs/firebase.d.cts +61 -0
  6. package/dist/cjs/index.cjs +1 -1
  7. package/dist/cjs/index.cjs.map +1 -1
  8. package/dist/cjs/index.d.cts +8 -291
  9. package/dist/cjs/rxjs.cjs +2 -0
  10. package/dist/cjs/rxjs.cjs.map +1 -0
  11. package/dist/cjs/rxjs.d.cts +106 -0
  12. package/dist/{esm/shared/utils/cache/smp-abstract-cache-strategy.class.d.ts → cjs/smp-cached-value.interface-BdPg-J7L.d.cts} +6 -1
  13. package/dist/cjs/smp-generic-response-base.interface-D0jHrkjw.d.cts +27 -0
  14. package/dist/cjs/smp-social-sign-in-ux-modes.enum-Cw9H3EqT.d.cts +12 -0
  15. package/dist/cjs/zod.cjs +2 -0
  16. package/dist/cjs/zod.cjs.map +1 -0
  17. package/dist/cjs/zod.d.cts +45 -0
  18. package/dist/esm/chunk-DIVAYUSN.js +1 -0
  19. package/dist/esm/chunk-VBEMFJKM.js +1 -0
  20. package/dist/esm/dynamo.d.ts +39 -0
  21. package/dist/esm/{chunk-XF457SYA.js → dynamo.js} +1 -1
  22. package/dist/esm/{services/firebase/smp-firebase.service.d.ts → firebase.d.ts} +9 -4
  23. package/dist/esm/firebase.js +1 -0
  24. package/dist/esm/index.d.ts +999 -62
  25. package/dist/esm/index.js +1 -1
  26. package/dist/esm/rxjs.d.ts +106 -0
  27. package/dist/esm/rxjs.js +1 -0
  28. package/dist/esm/smp-cached-value.interface-BdPg-J7L.d.ts +21 -0
  29. package/dist/esm/smp-generic-response-base.interface-D0jHrkjw.d.ts +27 -0
  30. package/dist/esm/smp-social-sign-in-ux-modes.enum-Cw9H3EqT.d.ts +12 -0
  31. package/dist/esm/zod.d.ts +45 -0
  32. package/dist/esm/zod.js +1 -0
  33. package/package.json +60 -1
  34. package/dist/esm/chunk-2JBVVJ2E.js +0 -0
  35. package/dist/esm/chunk-2UDNZC5A.js +0 -1
  36. package/dist/esm/chunk-2YYH6VGI.js +0 -1
  37. package/dist/esm/chunk-3HRZ6R3F.js +0 -1
  38. package/dist/esm/chunk-4LYXZUNL.js +0 -0
  39. package/dist/esm/chunk-4TNTWTMN.js +0 -1
  40. package/dist/esm/chunk-4UTF5FWK.js +0 -1
  41. package/dist/esm/chunk-553CS7VH.js +0 -0
  42. package/dist/esm/chunk-5VCNTUI6.js +0 -1
  43. package/dist/esm/chunk-5WULAY6L.js +0 -1
  44. package/dist/esm/chunk-7CWGJ3NF.js +0 -1
  45. package/dist/esm/chunk-AV6X4R7W.js +0 -0
  46. package/dist/esm/chunk-BHFFGFHY.js +0 -0
  47. package/dist/esm/chunk-CFV5G67M.js +0 -1
  48. package/dist/esm/chunk-D2XOH6K4.js +0 -1
  49. package/dist/esm/chunk-D66G2KIE.js +0 -0
  50. package/dist/esm/chunk-DADFHUII.js +0 -1
  51. package/dist/esm/chunk-DGUMFWCQ.js +0 -0
  52. package/dist/esm/chunk-DOKJQH4K.js +0 -1
  53. package/dist/esm/chunk-EB55SS67.js +0 -0
  54. package/dist/esm/chunk-ELQKTQ6W.js +0 -0
  55. package/dist/esm/chunk-ET5LYR3A.js +0 -1
  56. package/dist/esm/chunk-FLTR4ZY6.js +0 -1
  57. package/dist/esm/chunk-FTXCYY5S.js +0 -1
  58. package/dist/esm/chunk-G7PUYG2K.js +0 -1
  59. package/dist/esm/chunk-GRXWCGMW.js +0 -1
  60. package/dist/esm/chunk-HM7F3YYW.js +0 -0
  61. package/dist/esm/chunk-HOM5S5W3.js +0 -0
  62. package/dist/esm/chunk-I3CNDIWD.js +0 -0
  63. package/dist/esm/chunk-JXSMI3MI.js +0 -1
  64. package/dist/esm/chunk-L7KNFRNV.js +0 -1
  65. package/dist/esm/chunk-LD5COSFG.js +0 -1
  66. package/dist/esm/chunk-MLBCWEB4.js +0 -1
  67. package/dist/esm/chunk-MRKAFTDG.js +0 -1
  68. package/dist/esm/chunk-NQICKEAS.js +0 -0
  69. package/dist/esm/chunk-O7TJDNO6.js +0 -0
  70. package/dist/esm/chunk-OUSY7GMI.js +0 -1
  71. package/dist/esm/chunk-PKEW426R.js +0 -0
  72. package/dist/esm/chunk-Q77KUWBZ.js +0 -0
  73. package/dist/esm/chunk-QK6DPGU6.js +0 -1
  74. package/dist/esm/chunk-QPKVVZUA.js +0 -1
  75. package/dist/esm/chunk-QRCMHI3B.js +0 -1
  76. package/dist/esm/chunk-QW43DOPY.js +0 -1
  77. package/dist/esm/chunk-QWZP25QT.js +0 -1
  78. package/dist/esm/chunk-R6VG4656.js +0 -1
  79. package/dist/esm/chunk-RAJGA43T.js +0 -1
  80. package/dist/esm/chunk-RAVJJJYE.js +0 -1
  81. package/dist/esm/chunk-RGLXAD7B.js +0 -1
  82. package/dist/esm/chunk-RJBWCWAE.js +0 -1
  83. package/dist/esm/chunk-SDQLEPBS.js +0 -0
  84. package/dist/esm/chunk-SJOEBOGG.js +0 -1
  85. package/dist/esm/chunk-SPPRTVHH.js +0 -1
  86. package/dist/esm/chunk-STU5GUNH.js +0 -1
  87. package/dist/esm/chunk-SXISZIFJ.js +0 -0
  88. package/dist/esm/chunk-SZM4WHQJ.js +0 -0
  89. package/dist/esm/chunk-TGY6ZSQU.js +0 -1
  90. package/dist/esm/chunk-U5DBFRKV.js +0 -0
  91. package/dist/esm/chunk-V6NBH54E.js +0 -1
  92. package/dist/esm/chunk-VHMV4QQT.js +0 -1
  93. package/dist/esm/chunk-WTEJYEK2.js +0 -0
  94. package/dist/esm/chunk-WTLVPDI2.js +0 -1
  95. package/dist/esm/chunk-XZEYUIQ6.js +0 -1
  96. package/dist/esm/chunk-YEQJ4M3P.js +0 -1
  97. package/dist/esm/chunk-ZKODHJSY.js +0 -1
  98. package/dist/esm/chunk-ZTDFA2UA.js +0 -1
  99. package/dist/esm/chunk-ZYPNYJVE.js +0 -0
  100. package/dist/esm/services/firebase/index.d.ts +0 -7
  101. package/dist/esm/services/firebase/index.js +0 -1
  102. package/dist/esm/services/firebase/smp-firebase-service-config.interface.d.ts +0 -12
  103. package/dist/esm/services/firebase/smp-firebase-service-config.interface.js +0 -0
  104. package/dist/esm/services/firebase/smp-firebase.service.js +0 -1
  105. package/dist/esm/services/http/index.d.ts +0 -12
  106. package/dist/esm/services/http/index.js +0 -1
  107. package/dist/esm/services/http/smp-dynamic-fetch-return.type.d.ts +0 -3
  108. package/dist/esm/services/http/smp-dynamic-fetch-return.type.js +0 -0
  109. package/dist/esm/services/http/smp-http-config.interface.d.ts +0 -16
  110. package/dist/esm/services/http/smp-http-config.interface.js +0 -1
  111. package/dist/esm/services/http/smp-http-session-storage-cache.class.d.ts +0 -11
  112. package/dist/esm/services/http/smp-http-session-storage-cache.class.js +0 -1
  113. package/dist/esm/services/http/smp-http-status-code.enum.d.ts +0 -70
  114. package/dist/esm/services/http/smp-http-status-code.enum.js +0 -1
  115. package/dist/esm/services/http/smp-http.service.d.ts +0 -46
  116. package/dist/esm/services/http/smp-http.service.js +0 -1
  117. package/dist/esm/services/index.d.ts +0 -22
  118. package/dist/esm/services/index.js +0 -1
  119. package/dist/esm/services/smp-dynamo.service.js +0 -1
  120. package/dist/esm/shared/api/index.d.ts +0 -11
  121. package/dist/esm/shared/api/index.js +0 -1
  122. package/dist/esm/shared/api/smp-api-common-utils.class.d.ts +0 -15
  123. package/dist/esm/shared/api/smp-api-common-utils.class.js +0 -1
  124. package/dist/esm/shared/api/smp-error-response-create-opts.interface.d.ts +0 -13
  125. package/dist/esm/shared/api/smp-error-response-create-opts.interface.js +0 -1
  126. package/dist/esm/shared/api/smp-error-response.class.d.ts +0 -25
  127. package/dist/esm/shared/api/smp-error-response.class.js +0 -1
  128. package/dist/esm/shared/api/smp-generic-response-base.interface.d.ts +0 -9
  129. package/dist/esm/shared/api/smp-generic-response-base.interface.js +0 -1
  130. package/dist/esm/shared/api/smp-generic-response.class.d.ts +0 -20
  131. package/dist/esm/shared/api/smp-generic-response.class.js +0 -1
  132. package/dist/esm/shared/api/smp-healtz.const.d.ts +0 -5
  133. package/dist/esm/shared/api/smp-healtz.const.js +0 -1
  134. package/dist/esm/shared/api/smp-response-message-base.interface.d.ts +0 -8
  135. package/dist/esm/shared/api/smp-response-message-base.interface.js +0 -1
  136. package/dist/esm/shared/api/smp-response-message-types.enum.d.ts +0 -8
  137. package/dist/esm/shared/api/smp-response-message-types.enum.js +0 -1
  138. package/dist/esm/shared/api/smp-response-message.class.d.ts +0 -13
  139. package/dist/esm/shared/api/smp-response-message.class.js +0 -1
  140. package/dist/esm/shared/api/smp-rest-verbs.enum.d.ts +0 -9
  141. package/dist/esm/shared/api/smp-rest-verbs.enum.js +0 -1
  142. package/dist/esm/shared/common/index.d.ts +0 -6
  143. package/dist/esm/shared/common/index.js +0 -1
  144. package/dist/esm/shared/common/smp-base-jwt-token-plain.interface.d.ts +0 -7
  145. package/dist/esm/shared/common/smp-base-jwt-token-plain.interface.js +0 -1
  146. package/dist/esm/shared/common/smp-base-jwt-token.class.d.ts +0 -14
  147. package/dist/esm/shared/common/smp-base-jwt-token.class.js +0 -1
  148. package/dist/esm/shared/common/smp-generic-constructor.type.d.ts +0 -3
  149. package/dist/esm/shared/common/smp-generic-constructor.type.js +0 -1
  150. package/dist/esm/shared/common/smp-primitive.type.d.ts +0 -3
  151. package/dist/esm/shared/common/smp-primitive.type.js +0 -1
  152. package/dist/esm/shared/common/smp-social-sign-in-keys.enum.d.ts +0 -7
  153. package/dist/esm/shared/common/smp-social-sign-in-keys.enum.js +0 -1
  154. package/dist/esm/shared/common/smp-social-sign-in-ux-modes.enum.d.ts +0 -6
  155. package/dist/esm/shared/common/smp-social-sign-in-ux-modes.enum.js +0 -1
  156. package/dist/esm/shared/crypto/index.d.ts +0 -3
  157. package/dist/esm/shared/crypto/index.js +0 -1
  158. package/dist/esm/shared/crypto/smp-aes-crypt.class.d.ts +0 -1
  159. package/dist/esm/shared/crypto/smp-aes-crypt.class.js +0 -1
  160. package/dist/esm/shared/crypto/smp-crypto.class.d.ts +0 -10
  161. package/dist/esm/shared/crypto/smp-crypto.class.js +0 -1
  162. package/dist/esm/shared/crypto/smp-secure-code.class.d.ts +0 -20
  163. package/dist/esm/shared/crypto/smp-secure-code.class.js +0 -1
  164. package/dist/esm/shared/firebase/index.d.ts +0 -1
  165. package/dist/esm/shared/firebase/index.js +0 -1
  166. package/dist/esm/shared/firebase/smp-firebase-errors.enum.d.ts +0 -14
  167. package/dist/esm/shared/firebase/smp-firebase-errors.enum.js +0 -1
  168. package/dist/esm/shared/giftcard/index.d.ts +0 -8
  169. package/dist/esm/shared/giftcard/index.js +0 -1
  170. package/dist/esm/shared/giftcard/smp-giftcard-transaction-config.interface.d.ts +0 -11
  171. package/dist/esm/shared/giftcard/smp-giftcard-transaction-config.interface.js +0 -1
  172. package/dist/esm/shared/giftcard/smp-giftcard-transaction-hash-strategies.enum.d.ts +0 -8
  173. package/dist/esm/shared/giftcard/smp-giftcard-transaction-hash-strategies.enum.js +0 -1
  174. package/dist/esm/shared/giftcard/smp-giftcard-transaction-ops.enum.d.ts +0 -16
  175. package/dist/esm/shared/giftcard/smp-giftcard-transaction-ops.enum.js +0 -1
  176. package/dist/esm/shared/giftcard/smp-giftcard-transaction-plain.interface.d.ts +0 -8
  177. package/dist/esm/shared/giftcard/smp-giftcard-transaction-plain.interface.js +0 -1
  178. package/dist/esm/shared/giftcard/smp-giftcard-transaction.class.d.ts +0 -56
  179. package/dist/esm/shared/giftcard/smp-giftcard-transaction.class.js +0 -1
  180. package/dist/esm/shared/marketing-cloud/index.d.ts +0 -2
  181. package/dist/esm/shared/marketing-cloud/index.js +0 -1
  182. package/dist/esm/shared/marketing-cloud/smp-marketing-cloud-validation-response.interface.d.ts +0 -14
  183. package/dist/esm/shared/marketing-cloud/smp-marketing-cloud-validation-response.interface.js +0 -1
  184. package/dist/esm/shared/marketing-cloud/smp-marketing-cloud-validators.enum.d.ts +0 -7
  185. package/dist/esm/shared/marketing-cloud/smp-marketing-cloud-validators.enum.js +0 -1
  186. package/dist/esm/shared/rxjs/index.d.ts +0 -10
  187. package/dist/esm/shared/rxjs/index.js +0 -1
  188. package/dist/esm/shared/rxjs/smp-abstract-rxjs-ttl-cache-strategy.class.d.ts +0 -17
  189. package/dist/esm/shared/rxjs/smp-abstract-rxjs-ttl-cache-strategy.class.js +0 -1
  190. package/dist/esm/shared/rxjs/smp-rxjs-catch-only.function.d.ts +0 -5
  191. package/dist/esm/shared/rxjs/smp-rxjs-catch-only.function.js +0 -1
  192. package/dist/esm/shared/rxjs/smp-rxjs-in-memory-cache.class.d.ts +0 -15
  193. package/dist/esm/shared/rxjs/smp-rxjs-in-memory-cache.class.js +0 -1
  194. package/dist/esm/shared/rxjs/smp-rxjs-queue.function.d.ts +0 -11
  195. package/dist/esm/shared/rxjs/smp-rxjs-queue.function.js +0 -1
  196. package/dist/esm/shared/rxjs/smp-rxjs-sequence.function.d.ts +0 -12
  197. package/dist/esm/shared/rxjs/smp-rxjs-sequence.function.js +0 -1
  198. package/dist/esm/shared/rxjs/smp-rxjs-throw-if-empty.function.d.ts +0 -38
  199. package/dist/esm/shared/rxjs/smp-rxjs-throw-if-empty.function.js +0 -1
  200. package/dist/esm/shared/rxjs/smp-rxjs-throw-on-condition.function.d.ts +0 -30
  201. package/dist/esm/shared/rxjs/smp-rxjs-throw-on-condition.function.js +0 -1
  202. package/dist/esm/shared/utils/cache/index.d.ts +0 -7
  203. package/dist/esm/shared/utils/cache/index.js +0 -1
  204. package/dist/esm/shared/utils/cache/smp-abstract-cache-strategy.class.js +0 -1
  205. package/dist/esm/shared/utils/cache/smp-abstract-ttl-cache-strategy.class.d.ts +0 -17
  206. package/dist/esm/shared/utils/cache/smp-abstract-ttl-cache-strategy.class.js +0 -1
  207. package/dist/esm/shared/utils/cache/smp-browser-cache.class.d.ts +0 -16
  208. package/dist/esm/shared/utils/cache/smp-browser-cache.class.js +0 -1
  209. package/dist/esm/shared/utils/cache/smp-cached-value.interface.d.ts +0 -6
  210. package/dist/esm/shared/utils/cache/smp-cached-value.interface.js +0 -1
  211. package/dist/esm/shared/utils/cache/smp-in-memory-cache.class.d.ts +0 -15
  212. package/dist/esm/shared/utils/cache/smp-in-memory-cache.class.js +0 -1
  213. package/dist/esm/shared/utils/cache/smp-is-smp-cached-value.function.d.ts +0 -9
  214. package/dist/esm/shared/utils/cache/smp-is-smp-cached-value.function.js +0 -1
  215. package/dist/esm/shared/utils/index.d.ts +0 -15
  216. package/dist/esm/shared/utils/index.js +0 -1
  217. package/dist/esm/shared/utils/smp-apply-mixin.function.d.ts +0 -5
  218. package/dist/esm/shared/utils/smp-apply-mixin.function.js +0 -1
  219. package/dist/esm/shared/utils/smp-ascii-words.function.d.ts +0 -3
  220. package/dist/esm/shared/utils/smp-ascii-words.function.js +0 -1
  221. package/dist/esm/shared/utils/smp-common-utils.class.d.ts +0 -101
  222. package/dist/esm/shared/utils/smp-common-utils.class.js +0 -1
  223. package/dist/esm/shared/utils/smp-filter-exception.class.d.ts +0 -7
  224. package/dist/esm/shared/utils/smp-filter-exception.class.js +0 -1
  225. package/dist/esm/shared/utils/smp-noop.function.d.ts +0 -1
  226. package/dist/esm/shared/utils/smp-noop.function.js +0 -1
  227. package/dist/esm/shared/utils/smp-regular-expressions.class.d.ts +0 -16
  228. package/dist/esm/shared/utils/smp-regular-expressions.class.js +0 -1
  229. package/dist/esm/shared/utils/smp-sid.class.d.ts +0 -18
  230. package/dist/esm/shared/utils/smp-sid.class.js +0 -1
  231. package/dist/esm/shared/utils/smp-unicode-words.class.d.ts +0 -15
  232. package/dist/esm/shared/utils/smp-unicode-words.class.js +0 -1
  233. package/dist/esm/shared/zod/index.d.ts +0 -3
  234. package/dist/esm/shared/zod/index.js +0 -1
  235. package/dist/esm/shared/zod/smp-zod-date-time.definition.d.ts +0 -28
  236. package/dist/esm/shared/zod/smp-zod-date-time.definition.js +0 -1
  237. package/dist/esm/smp-aes-crypt.class-CI82T7GV.d.ts +0 -470
  238. /package/dist/{esm/services/smp-dynamo.service.d.ts → cjs/dynamo.d.cts} +0 -0
  239. /package/dist/esm/{chunk-QYDMV6LH.js → chunk-F3OJMKBL.js} +0 -0
@@ -1,66 +1,1003 @@
1
- export { SmpHttpService } from './services/http/smp-http.service.js';
2
- export { SmpHttpSessionStorageCache } from './services/http/smp-http-session-storage-cache.class.js';
3
- export { SmpHttpConfig } from './services/http/smp-http-config.interface.js';
4
- export { SmpHttpStatusCodes } from './services/http/smp-http-status-code.enum.js';
5
- export { SmpApiCommonUtils } from './shared/api/smp-api-common-utils.class.js';
6
- export { SmpErrorResponse } from './shared/api/smp-error-response.class.js';
7
- export { SmpErrorResponseCreateOpts } from './shared/api/smp-error-response-create-opts.interface.js';
8
- export { SmpGenericResponse } from './shared/api/smp-generic-response.class.js';
9
- export { SmpGenericResponseBase } from './shared/api/smp-generic-response-base.interface.js';
10
- export { SMP_HEALTHZ } from './shared/api/smp-healtz.const.js';
11
- export { SmpResponseMessage } from './shared/api/smp-response-message.class.js';
12
- export { SmpResponseMessageBase } from './shared/api/smp-response-message-base.interface.js';
13
- export { SmpResponseMessageTypes } from './shared/api/smp-response-message-types.enum.js';
14
- export { SmpRestVerbs } from './shared/api/smp-rest-verbs.enum.js';
15
- export { SmpBaseJwtToken } from './shared/common/smp-base-jwt-token.class.js';
16
- export { SmpBaseJwtTokenPlain } from './shared/common/smp-base-jwt-token-plain.interface.js';
17
- export { SmpGenericConstructor } from './shared/common/smp-generic-constructor.type.js';
18
- export { SmpPrimitive } from './shared/common/smp-primitive.type.js';
19
- export { SmpSocialSignInKeys } from './shared/common/smp-social-sign-in-keys.enum.js';
20
- export { SmpSocialSignInUxModes } from './shared/common/smp-social-sign-in-ux-modes.enum.js';
21
- export { S as SmpAesCrypt } from './smp-aes-crypt.class-CI82T7GV.js';
22
- export { SmpCrypto } from './shared/crypto/smp-crypto.class.js';
23
- export { SmpSecureCode } from './shared/crypto/smp-secure-code.class.js';
24
- export { SmpFirebaseErrors } from './shared/firebase/smp-firebase-errors.enum.js';
25
- export { SmpGiftcardTransaction } from './shared/giftcard/smp-giftcard-transaction.class.js';
26
- export { SmpGiftcardTransactionConfig } from './shared/giftcard/smp-giftcard-transaction-config.interface.js';
27
- export { SmpGiftcardTransactionHashStrategies } from './shared/giftcard/smp-giftcard-transaction-hash-strategies.enum.js';
28
- export { SmpGiftcardTransactionOps } from './shared/giftcard/smp-giftcard-transaction-ops.enum.js';
29
- export { SmpGiftcardTransactionPlain } from './shared/giftcard/smp-giftcard-transaction-plain.interface.js';
30
- export { SmpMarketingCloudValidationResponse, SmpMarketingCloudValidationResponseKo, SmpMarketingCloudValidationResponseOk } from './shared/marketing-cloud/smp-marketing-cloud-validation-response.interface.js';
31
- export { SmpMarketingCloudValidators } from './shared/marketing-cloud/smp-marketing-cloud-validators.enum.js';
32
- export { SmpAbstractRxjsTtlCacheStrategy } from './shared/rxjs/smp-abstract-rxjs-ttl-cache-strategy.class.js';
33
- export { smpRxjsCatchOnly } from './shared/rxjs/smp-rxjs-catch-only.function.js';
34
- export { SmpRxjsInMemoryCache } from './shared/rxjs/smp-rxjs-in-memory-cache.class.js';
35
- export { smpRxjsQueue } from './shared/rxjs/smp-rxjs-queue.function.js';
36
- export { smpRxjsSequence } from './shared/rxjs/smp-rxjs-sequence.function.js';
37
- export { smpRxjsThrowIfEmpty } from './shared/rxjs/smp-rxjs-throw-if-empty.function.js';
38
- export { smpRxjsThrowOnCondition } from './shared/rxjs/smp-rxjs-throw-on-condition.function.js';
39
- export { smpApplyMixin } from './shared/utils/smp-apply-mixin.function.js';
40
- export { SmpCommonUtils } from './shared/utils/smp-common-utils.class.js';
41
- export { SmpFilterException } from './shared/utils/smp-filter-exception.class.js';
42
- export { SmpSid } from './shared/utils/smp-sid.class.js';
1
+ import { S as SmpAbstractCacheStrategy, a as SmpCachedValue } from './smp-cached-value.interface-BdPg-J7L.js';
2
+ import { SmpLoggerMethods } from '@tonysamperi/logger';
43
3
  export { smpNoop } from '@tonysamperi/logger';
44
- export { SmpRegularExpressions } from './shared/utils/smp-regular-expressions.class.js';
45
- export { SmpAbstractCacheStrategy } from './shared/utils/cache/smp-abstract-cache-strategy.class.js';
46
- export { SmpAbstractTtlCacheStrategy } from './shared/utils/cache/smp-abstract-ttl-cache-strategy.class.js';
47
- export { SmpBrowserCache } from './shared/utils/cache/smp-browser-cache.class.js';
48
- export { SmpCachedValue } from './shared/utils/cache/smp-cached-value.interface.js';
49
- export { SmpInMemoryCache } from './shared/utils/cache/smp-in-memory-cache.class.js';
50
- export { smpIsSmpCachedValue } from './shared/utils/cache/smp-is-smp-cached-value.function.js';
51
- export { SmpZodDateTime, smpZodDateTime } from './shared/zod/smp-zod-date-time.definition.js';
52
- export { SmpDynamoService } from './services/smp-dynamo.service.js';
53
- export { SmpFirebaseService } from './services/firebase/smp-firebase.service.js';
54
- export { SmpFirebaseServiceConfig } from './services/firebase/smp-firebase-service-config.interface.js';
55
- import './services/http/smp-dynamic-fetch-return.type.js';
56
- import 'ts-luxon';
4
+ import { S as SmpResponseMessage, a as SmpGenericResponseBase } from './smp-generic-response-base.interface-D0jHrkjw.js';
5
+ export { b as SmpResponseMessageBase, c as SmpResponseMessageTypes } from './smp-generic-response-base.interface-D0jHrkjw.js';
6
+ export { S as SmpSocialSignInKeys, a as SmpSocialSignInUxModes } from './smp-social-sign-in-ux-modes.enum-Cw9H3EqT.js';
7
+ import { DateTime } from 'ts-luxon';
57
8
  import 'rxjs';
58
- import 'zod';
59
- import '@aws-sdk/util-dynamodb';
60
- import '@aws-sdk/client-dynamodb';
61
- import 'firebase/app';
62
- import 'firebase/auth';
63
9
 
64
- declare const VERSION: "1.8.0";
10
+ declare abstract class SmpAbstractTtlCacheStrategy extends SmpAbstractCacheStrategy {
11
+ protected abstract _flushRaw(): void;
12
+ protected abstract _readRaw(key: string): unknown | undefined;
13
+ protected abstract _removeRaw(key: string): void;
14
+ protected abstract _writeRaw(key: string, value: unknown, ttl?: number): void;
15
+ flush(): void;
16
+ read<T = unknown>(key: string): T | undefined;
17
+ remove(key: string): void;
18
+ write<T = unknown>(key: string, value: T, ttl?: number): void;
19
+ protected _isSmpCachedValue<T>(value: unknown): value is SmpCachedValue<T>;
20
+ }
65
21
 
66
- export { VERSION };
22
+ type SmpDynamicFetchReturn<T, U> = T extends "blob" ? Blob : T extends "arraybuffer" ? ArrayBuffer : T extends "text" ? string : T extends "json" ? U : T;
23
+
24
+ type SmpGenericConstructor<T = any, U = any> = new (...args: U[]) => T;
25
+
26
+ declare class SmpApiCommonUtils {
27
+ protected static _javascriptVariablePattern: string;
28
+ protected static _logger: SmpLoggerMethods;
29
+ protected static _pathParamRegex: RegExp;
30
+ static credentialsToBasicAuth(user: string, password: string): string;
31
+ static fromBearer(header?: string): string;
32
+ static getCountryFromReferer(referer: string): string | void;
33
+ static getLanguageFromReferer(referer: string): string | void;
34
+ static getLocaleFromReferer(referer: string): string | void;
35
+ static interpolateParams(urlTemplate: string, params: Record<string, string | number | boolean>): string;
36
+ }
37
+
38
+ type ResponseMessageUnion = string | SmpResponseMessage;
39
+ interface SmpErrorResponseCreateOpts<T> {
40
+ messages: ResponseMessageUnion | ResponseMessageUnion[];
41
+ errorCode: number | string;
42
+ status: number;
43
+ data: T;
44
+ }
45
+
46
+ declare class SmpGenericResponse<T, U = SmpGenericResponseBase> implements SmpGenericResponseBase<T> {
47
+ protected _messages: SmpResponseMessage[];
48
+ data?: T | undefined;
49
+ set messages(newValue: string | SmpResponseMessage | (SmpResponseMessage | string)[]);
50
+ get messages(): SmpResponseMessage[] | void;
51
+ constructor(_messages?: SmpResponseMessage[], data?: T | undefined);
52
+ static buildInfo<T = any>(msg: string | string[], data?: T): SmpGenericResponse<T>;
53
+ static buildSuccess<T = any>(msg: string | string[], data?: T): SmpGenericResponse<T>;
54
+ static fromPlain(plain: unknown): SmpGenericResponse<any, SmpGenericResponseBase<any>>;
55
+ isError(): boolean;
56
+ isSuccess(): boolean;
57
+ serialize(): U;
58
+ }
59
+
60
+ declare class SmpErrorResponse<T = any> extends SmpGenericResponse<T, SmpGenericResponseBase & Pick<SmpErrorResponse, "errorCode" | "timestamp" | "status">> {
61
+ protected _errorCode: number | string;
62
+ protected _status: number;
63
+ static get DEFAULT_MESSAGES(): SmpResponseMessage[];
64
+ get errorCode(): number | string;
65
+ get status(): number;
66
+ get timestamp(): number;
67
+ protected _timestamp: number;
68
+ constructor(messages?: SmpResponseMessage[], _errorCode?: number | string, _status?: number, data?: T);
69
+ static create<T>({ messages, ...opts }?: Partial<SmpErrorResponseCreateOpts<T>>): SmpErrorResponse;
70
+ /**
71
+ * This shouldn't be necessary, but it's a workaround for this bug https://github.com/typestack/class-transformer/issues/1807
72
+ * @param plain
73
+ */
74
+ static fromPlain(plain: unknown): SmpErrorResponse<any>;
75
+ }
76
+
77
+ declare const SMP_HEALTHZ: {
78
+ status: string;
79
+ };
80
+
81
+ declare enum SmpRestVerbs {
82
+ GET = "GET",
83
+ POST = "POST",
84
+ PUT = "PUT",
85
+ DELETE = "DELETE",
86
+ PATCH = "PATCH"
87
+ }
88
+
89
+ interface SmpHttpConfig<T = any> {
90
+ cacheKey?: string;
91
+ clearCache?: boolean;
92
+ url: string;
93
+ method?: SmpRestVerbs | string;
94
+ useCredentials?: boolean;
95
+ body?: T;
96
+ headers?: Record<string, string>;
97
+ queryParams?: Record<string, string | number>;
98
+ transform?: boolean;
99
+ responseType?: "blob" | "arraybuffer" | "text" | "json" | "jsonp";
100
+ }
101
+
102
+ interface ParseableErrorClass<T> {
103
+ fromPlain(plain: unknown): T;
104
+ }
105
+ declare class SmpHttpService {
106
+ protected static _cachePrefix: string;
107
+ protected static _cacheStrategy: SmpAbstractTtlCacheStrategy;
108
+ protected static _config: {
109
+ cachePrefix: string;
110
+ shared: Map<string, Promise<any>>;
111
+ };
112
+ protected static _errorClass: SmpGenericConstructor & ParseableErrorClass<any>;
113
+ protected static _mergeParamsFallbackBaseUrl: string;
114
+ static $http(config: SmpHttpConfig): Promise<SmpDynamicFetchReturn<SmpHttpConfig["responseType"], any>>;
115
+ static $http<T = any>(config: SmpHttpConfig): Promise<T>;
116
+ static $http(config: SmpHttpConfig): Promise<SmpDynamicFetchReturn<SmpHttpConfig["responseType"], Blob>>;
117
+ static $http(config: SmpHttpConfig): Promise<SmpDynamicFetchReturn<SmpHttpConfig["responseType"], ArrayBuffer>>;
118
+ static $http(config: SmpHttpConfig): Promise<SmpDynamicFetchReturn<SmpHttpConfig["responseType"], string>>;
119
+ static $http<T, U, V>(config: SmpHttpConfig): Promise<SmpDynamicFetchReturn<SmpHttpConfig["responseType"], U>>;
120
+ /**
121
+ * Internal method to generate ajax config
122
+ * @param config
123
+ * @protected
124
+ */
125
+ static _generateAjax<T, U, V = unknown>(config: SmpHttpConfig<T>): Promise<SmpDynamicFetchReturn<typeof config.responseType, U>>;
126
+ static _generateAjaxBase<T, U, V = unknown>(config: SmpHttpConfig<T>): Promise<SmpDynamicFetchReturn<typeof config.responseType, U>>;
127
+ static cacheFlush(): void;
128
+ static mergeQueryParams(url: string, queryParams: SmpHttpConfig["queryParams"]): string;
129
+ protected static _cacheKey(key: string): string;
130
+ protected static _cachePop<T = unknown>(key: string): T | void;
131
+ protected static _cacheRead<T>(key: string): T | void;
132
+ protected static _cacheRemove(key: string): void;
133
+ protected static _cacheWrite<T>(key: string, value: T): void;
134
+ protected static _preprocessRequest<T>(config: SmpHttpConfig<T>): Promise<SmpHttpConfig<T>>;
135
+ protected static _preprocessResponse<T>(_config_: SmpHttpConfig<T>, res: Response): Promise<Response>;
136
+ }
137
+
138
+ declare class SmpBrowserCache extends SmpAbstractTtlCacheStrategy {
139
+ protected _storage: typeof localStorage | typeof sessionStorage;
140
+ protected _prefix: string;
141
+ constructor(_storage: typeof localStorage | typeof sessionStorage, _prefix: string);
142
+ protected _flushRaw(): void;
143
+ protected _readRaw(key: string): unknown | undefined;
144
+ protected _removeRaw(key: string): void;
145
+ protected _writeRaw(key: string, value: unknown): void;
146
+ }
147
+
148
+ declare class SmpHttpSessionStorageCache extends SmpBrowserCache {
149
+ constructor();
150
+ }
151
+
152
+ /**
153
+ * This is basically a clone from axios, to avoid having the lib as dependency, while only this was used
154
+ */
155
+ declare enum SmpHttpStatusCodes {
156
+ Continue = 100,
157
+ SwitchingProtocols = 101,
158
+ Processing = 102,
159
+ EarlyHints = 103,
160
+ Ok = 200,
161
+ Created = 201,
162
+ Accepted = 202,
163
+ NonAuthoritativeInformation = 203,
164
+ NoContent = 204,
165
+ ResetContent = 205,
166
+ PartialContent = 206,
167
+ MultiStatus = 207,
168
+ AlreadyReported = 208,
169
+ ImUsed = 226,
170
+ MultipleChoices = 300,
171
+ MovedPermanently = 301,
172
+ Found = 302,
173
+ SeeOther = 303,
174
+ NotModified = 304,
175
+ UseProxy = 305,
176
+ Unused = 306,
177
+ TemporaryRedirect = 307,
178
+ PermanentRedirect = 308,
179
+ BadRequest = 400,
180
+ Unauthorized = 401,
181
+ PaymentRequired = 402,
182
+ Forbidden = 403,
183
+ NotFound = 404,
184
+ MethodNotAllowed = 405,
185
+ NotAcceptable = 406,
186
+ ProxyAuthenticationRequired = 407,
187
+ RequestTimeout = 408,
188
+ Conflict = 409,
189
+ Gone = 410,
190
+ LengthRequired = 411,
191
+ PreconditionFailed = 412,
192
+ PayloadTooLarge = 413,
193
+ UriTooLong = 414,
194
+ UnsupportedMediaType = 415,
195
+ RangeNotSatisfiable = 416,
196
+ ExpectationFailed = 417,
197
+ ImATeapot = 418,
198
+ MisdirectedRequest = 421,
199
+ UnprocessableEntity = 422,
200
+ Locked = 423,
201
+ FailedDependency = 424,
202
+ TooEarly = 425,
203
+ UpgradeRequired = 426,
204
+ PreconditionRequired = 428,
205
+ TooManyRequests = 429,
206
+ RequestHeaderFieldsTooLarge = 431,
207
+ UnavailableForLegalReasons = 451,
208
+ InternalServerError = 500,
209
+ NotImplemented = 501,
210
+ BadGateway = 502,
211
+ ServiceUnavailable = 503,
212
+ GatewayTimeout = 504,
213
+ HttpVersionNotSupported = 505,
214
+ VariantAlsoNegotiates = 506,
215
+ InsufficientStorage = 507,
216
+ LoopDetected = 508,
217
+ NotExtended = 510,
218
+ NetworkAuthenticationRequired = 511
219
+ }
220
+
221
+ declare class SmpBaseJwtTokenPlain {
222
+ access_token: string;
223
+ exp: number;
224
+ iss?: string;
225
+ }
226
+
227
+ declare class SmpBaseJwtToken {
228
+ protected _access_token: string;
229
+ protected _exp: number;
230
+ protected _iss?: string | undefined;
231
+ get access_token(): string;
232
+ get exp(): number;
233
+ get iss(): string | undefined;
234
+ constructor(_access_token: string, _exp: number, _iss?: string | undefined);
235
+ serialize(): SmpBaseJwtTokenPlain;
236
+ }
237
+
238
+ type SmpPrimitive = string | number | boolean | symbol;
239
+
240
+ declare class WordArray {
241
+ sigBytes: number;
242
+ words: number[];
243
+ /**
244
+ * Initializes a newly created word array.
245
+ *
246
+ * @param words (Optional) An array of 32-bit words.
247
+ * @param sigBytes (Optional) The number of significant bytes in the words.
248
+ *
249
+ * @example
250
+ *
251
+ * let wordArray = new WordArray();
252
+ * let wordArray = new WordArray([0x00010203, 0x04050607]);
253
+ * let wordArray = new WordArray([0x00010203, 0x04050607], 6);
254
+ */
255
+ constructor(words?: number[], sigBytes?: number);
256
+ /**
257
+ * Creates a word array filled with random bytes.
258
+ *
259
+ * @param nBytes The number of random bytes to generate.
260
+ *
261
+ * @return The random word array.
262
+ *
263
+ * @example
264
+ *
265
+ * let wordArray = WordArray.random(16);
266
+ */
267
+ static random(nBytes: number): WordArray;
268
+ /**
269
+ * Removes insignificant bits.
270
+ *
271
+ * @example
272
+ *
273
+ * wordArray.clamp();
274
+ */
275
+ clamp(): void;
276
+ /**
277
+ * Creates a copy of this word array.
278
+ *
279
+ * @return The clone.
280
+ *
281
+ * @example
282
+ *
283
+ * let clone = wordArray.clone();
284
+ */
285
+ clone(): WordArray;
286
+ /**
287
+ * Concatenates a word array to this word array.
288
+ *
289
+ * @param wordArray The word array to append.
290
+ *
291
+ * @return This word array.
292
+ *
293
+ * @example
294
+ *
295
+ * wordArray1.concat(wordArray2);
296
+ */
297
+ concat(wordArray: WordArray): WordArray;
298
+ /**
299
+ * Converts this word array to a string.
300
+ *
301
+ * @param encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
302
+ *
303
+ * @return The stringified word array.
304
+ *
305
+ * @example
306
+ *
307
+ * let string = wordArray + '';
308
+ * let string = wordArray.toString();
309
+ * let string = wordArray.toString(CryptoJS.enc.Utf8);
310
+ */
311
+ toString<T extends {
312
+ stringify: (arg: WordArray) => string;
313
+ }>(encoder?: T): string;
314
+ }
315
+
316
+ declare abstract class BlockCipherModeAlgorithm {
317
+ __creator: ((cipher: BlockCipher, iv: number[]) => BlockCipherMode) | undefined;
318
+ protected _cipher: BlockCipher;
319
+ protected _iv: number[] | undefined;
320
+ constructor(cipher: BlockCipher, iv: number[]);
321
+ abstract processBlock(words: number[], offset: number): void;
322
+ /**
323
+ * Initializes a newly created mode.
324
+ *
325
+ * @param cipher A block cipher instance.
326
+ * @param iv The IV words.
327
+ *
328
+ * @example
329
+ *
330
+ * var mode = CBC.Encryptor.create(cipher, iv.words);
331
+ */
332
+ init(cipher: BlockCipher, iv?: number[]): void;
333
+ }
334
+
335
+ declare abstract class BlockCipherMode {
336
+ static Decryptor: any;
337
+ static Encryptor: any;
338
+ /**
339
+ * Creates this mode for decryption.
340
+ *
341
+ * @param cipher A block cipher instance.
342
+ * @param iv The IV words.
343
+ *
344
+ * @example
345
+ *
346
+ * const mode = CBC.createDecryptor(cipher, iv.words);
347
+ */
348
+ static createDecryptor(cipher: BlockCipher, iv: number[]): BlockCipherModeAlgorithm;
349
+ /**
350
+ * Creates this mode for encryption.
351
+ *
352
+ * @param cipher A block cipher instance.
353
+ * @param iv The IV words.
354
+ *
355
+ * @example
356
+ *
357
+ * var mode = CBC.createEncryptor(cipher, iv.words);
358
+ */
359
+ static createEncryptor(cipher: BlockCipher, iv: number[]): BlockCipherModeAlgorithm;
360
+ }
361
+
362
+ declare abstract class AbstractPadding {
363
+ static pad: (data: WordArray, blockSize: number) => void;
364
+ static unpad: (data: WordArray) => void;
365
+ }
366
+ type Padding = typeof AbstractPadding;
367
+
368
+ declare class CipherParams {
369
+ algorithm?: typeof Cipher;
370
+ blockSize?: number;
371
+ ciphertext?: WordArray;
372
+ formatter?: Formatter;
373
+ iv?: WordArray;
374
+ key?: WordArray | string;
375
+ mode?: typeof BlockCipherMode;
376
+ padding?: Padding;
377
+ salt?: WordArray | string;
378
+ /**
379
+ * Initializes a newly created cipher params object.
380
+ *
381
+ * @param cipherParams An object with any of the possible cipher parameters.
382
+ *
383
+ * @example
384
+ *
385
+ * let cipherParams = CipherParams.create({
386
+ * ciphertext: ciphertextWordArray,
387
+ * key: keyWordArray,
388
+ * iv: ivWordArray,
389
+ * salt: saltWordArray,
390
+ * algorithm: AES,
391
+ * mode: CBC,
392
+ * padding: PKCS7,
393
+ * blockSize: 4,
394
+ * formatter: OpenSSLFormatter
395
+ * });
396
+ */
397
+ constructor(cipherParams: Omit<CipherParams, "extend" | "toString">);
398
+ extend(additionalParams: CipherParams): CipherParams;
399
+ /**
400
+ * Converts this cipher params object to a string.
401
+ *
402
+ * @param formatter (Optional) The formatting strategy to use.
403
+ *
404
+ * @return The stringified cipher params.
405
+ *
406
+ * @throws Error If neither the formatter nor the default formatter is set.
407
+ *
408
+ * @example
409
+ *
410
+ * let string = cipherParams + '';
411
+ * let string = cipherParams.toString();
412
+ * let string = cipherParams.toString(CryptoJS.format.OpenSSL);
413
+ */
414
+ toString(formatter?: Formatter): string;
415
+ }
416
+
417
+ interface Formatter {
418
+ stringify: (cipherParams: CipherParams) => string;
419
+ parse: (paramsStr: string) => CipherParams;
420
+ }
421
+
422
+ declare abstract class AbstractKDF {
423
+ static execute: (password: string, keySize: number, ivSize: number, salt?: WordArray | string) => CipherParams;
424
+ abstract compute?(password: WordArray | string, salt: WordArray | string): WordArray;
425
+ }
426
+ type KDF = typeof AbstractKDF;
427
+
428
+ interface BufferedBlockAlgorithmConfig {
429
+ blockSize?: number;
430
+ iv?: WordArray;
431
+ format?: Formatter;
432
+ kdf?: KDF;
433
+ mode?: typeof BlockCipherMode;
434
+ padding?: Padding;
435
+ }
436
+
437
+ declare abstract class BufferedBlockAlgorithm {
438
+ cfg: BufferedBlockAlgorithmConfig;
439
+ protected _data: WordArray;
440
+ protected _minBufferSize: number;
441
+ protected _nDataBytes: number;
442
+ protected abstract _doProcessBlock(wordArray: number[], offset: number): void;
443
+ constructor(cfg?: BufferedBlockAlgorithmConfig);
444
+ /**
445
+ * Creates a copy of this object.
446
+ *
447
+ * @return The clone.
448
+ *
449
+ * @example
450
+ *
451
+ * let clone = bufferedBlockAlgorithm.clone();
452
+ */
453
+ clone(): BufferedBlockAlgorithm;
454
+ /**
455
+ * Resets this block algorithm's data buffer to its initial state.
456
+ *
457
+ * @example
458
+ *
459
+ * bufferedBlockAlgorithm.reset();
460
+ */
461
+ reset(): void;
462
+ /**
463
+ * Adds new data to this block algorithm's buffer.
464
+ *
465
+ * @param data The data to append. Strings are converted to a WordArray using UTF-8.
466
+ *
467
+ * @example
468
+ *
469
+ * bufferedBlockAlgorithm._append('data');
470
+ * bufferedBlockAlgorithm._append(wordArray);
471
+ */
472
+ protected _append(data: string | WordArray): void;
473
+ /**
474
+ * Processes available data blocks.
475
+ *
476
+ * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
477
+ *
478
+ * @param doFlush Whether all blocks and partial blocks should be processed.
479
+ *
480
+ * @return The processed data.
481
+ *
482
+ * @example
483
+ *
484
+ * let processedData = bufferedBlockAlgorithm._process();
485
+ * let processedData = bufferedBlockAlgorithm._process(!!'flush');
486
+ */
487
+ protected _process(doFlush?: boolean): WordArray;
488
+ }
489
+
490
+ declare class CipherHelper {
491
+ private readonly _cipher;
492
+ constructor(_cipher: typeof Cipher);
493
+ decrypt(ciphertext: CipherParams | string, key: WordArray | string, cfg?: BufferedBlockAlgorithmConfig): WordArray;
494
+ encrypt(message: WordArray | string, key: WordArray | string, cfg?: BufferedBlockAlgorithmConfig): CipherParams;
495
+ }
496
+
497
+ declare abstract class Cipher extends BufferedBlockAlgorithm {
498
+ /**
499
+ * This cipher's IV size. Default: 4 (128 bits / 32 Bits)
500
+ */
501
+ static ivSize: number;
502
+ /**
503
+ * This cipher's key size. Default: 4 (128 bits / 32 Bits)
504
+ */
505
+ static keySize: number;
506
+ /**
507
+ * A constant representing decryption mode.
508
+ */
509
+ protected static readonly _DEC_XFORM_MODE = 2;
510
+ /**
511
+ * A constant representing encryption mode.
512
+ */
513
+ protected static readonly _ENC_XFORM_MODE = 1;
514
+ /**
515
+ * The key.
516
+ */
517
+ protected _key: WordArray;
518
+ /**
519
+ * Either the encryption or decryption transformation mode constant.
520
+ */
521
+ protected _xformMode: number;
522
+ /**
523
+ * Initializes a newly created cipher.
524
+ *
525
+ * @param xformMode Either the encryption or decryption transormation mode constant.
526
+ * @param key The key.
527
+ * @param cfg (Optional) The configuration options to use for this operation.
528
+ *
529
+ * @example
530
+ *
531
+ * let cipher = AES.create(AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray });
532
+ */
533
+ constructor(xformMode: number, key: WordArray, cfg?: BufferedBlockAlgorithmConfig);
534
+ /**
535
+ * Creates shortcut functions to a cipher's object interface.
536
+ *
537
+ * @param cipher The cipher to create a helper for.
538
+ *
539
+ * @return An object with encrypt and decrypt shortcut functions.
540
+ *
541
+ * @example
542
+ *
543
+ * const AES = Cipher._createHelper(AESAlgorithm);
544
+ */
545
+ static _createHelper(cipher: typeof Cipher): CipherHelper;
546
+ /**
547
+ * Creates this cipher in decryption mode.
548
+ *
549
+ * @param key The key.
550
+ * @param cfg (Optional) The configuration options to use for this operation.
551
+ *
552
+ * @return A cipher instance.
553
+ *
554
+ * @example
555
+ *
556
+ * let cipher = AES.createDecryptor(keyWordArray, { iv: ivWordArray });
557
+ */
558
+ static createDecryptor(key: WordArray | string, cfg?: BufferedBlockAlgorithmConfig): Cipher;
559
+ /**
560
+ * Creates this cipher in encryption mode.
561
+ *
562
+ * @param key The key.
563
+ * @param cfg (Optional) The configuration options to use for this operation.
564
+ *
565
+ * @return A cipher instance.
566
+ *
567
+ * @example
568
+ *
569
+ * let cipher = AES.createEncryptor(keyWordArray, { iv: ivWordArray });
570
+ */
571
+ static createEncryptor(key: WordArray | string, cfg?: BufferedBlockAlgorithmConfig): Cipher;
572
+ /**
573
+ * Finalizes the encryption or decryption process.
574
+ * Note that the finalize operation is effectively a destructive, read-once operation.
575
+ *
576
+ * @param dataUpdate The final data to encrypt or decrypt.
577
+ *
578
+ * @return The data after final processing.
579
+ *
580
+ * @example
581
+ *
582
+ * var encrypted = cipher.finalize();
583
+ * var encrypted = cipher.finalize('data');
584
+ * var encrypted = cipher.finalize(wordArray);
585
+ */
586
+ finalize(dataUpdate?: WordArray | string): WordArray;
587
+ /**
588
+ * Adds data to be encrypted or decrypted.
589
+ *
590
+ * @param dataUpdate The data to encrypt or decrypt.
591
+ *
592
+ * @return The data after processing.
593
+ *
594
+ * @example
595
+ *
596
+ * let encrypted = cipher.process('data');
597
+ * let encrypted = cipher.process(wordArray);
598
+ */
599
+ process(dataUpdate: WordArray | string): WordArray;
600
+ /**
601
+ * Cipher specific finalize function explicitly implemented in the derived class.
602
+ */
603
+ protected abstract _doFinalize(): WordArray;
604
+ }
605
+
606
+ declare abstract class BlockCipher extends Cipher {
607
+ protected _mode: BlockCipherModeAlgorithm;
608
+ constructor(xformMode: number, key: WordArray, cfg?: BufferedBlockAlgorithmConfig);
609
+ abstract decryptBlock(M: number[], offset: number): void;
610
+ abstract encryptBlock(M: number[], offset: number): void;
611
+ reset(): void;
612
+ protected _doFinalize(): WordArray;
613
+ protected _doProcessBlock(words: number[], offset: number): void;
614
+ }
615
+
616
+ declare class CBCEncryptor extends BlockCipherModeAlgorithm {
617
+ get prevBlock(): number[];
618
+ protected _prevBlock: number[] | undefined;
619
+ /**
620
+ * Processes the data block at offset.
621
+ *
622
+ * @param words The data words to operate on.
623
+ * @param offset The offset where the block starts.
624
+ *
625
+ * @example
626
+ *
627
+ * mode.processBlock(data.words, offset);
628
+ */
629
+ processBlock(words: number[], offset: number): void;
630
+ xorBlock(words: number[], offset: number, blockSize: number): void;
631
+ }
632
+
633
+ declare class CBCDecryptor extends BlockCipherModeAlgorithm {
634
+ get prevBlock(): number[];
635
+ protected _prevBlock: number[] | undefined;
636
+ /**
637
+ * Processes the data block at offset.
638
+ *
639
+ * @param words The data words to operate on.
640
+ * @param offset The offset where the block starts.
641
+ *
642
+ * @example
643
+ *
644
+ * mode.processBlock(data.words, offset);
645
+ */
646
+ processBlock(words: number[], offset: number): void;
647
+ xorBlock(words: number[], offset: number, blockSize: number): void;
648
+ }
649
+
650
+ /**
651
+ * Cipher Block Chaining mode.
652
+ */
653
+ declare abstract class CBC extends BlockCipherMode {
654
+ static Decryptor: typeof CBCDecryptor;
655
+ static Encryptor: typeof CBCEncryptor;
656
+ }
657
+
658
+ declare class PKCS7 implements AbstractPadding {
659
+ /**
660
+ * Pads data using the algorithm defined in PKCS #5/7.
661
+ *
662
+ * @param data The data to pad.
663
+ * @param blockSize The multiple that the data should be padded to.
664
+ *
665
+ * @example
666
+ *
667
+ * PKCS7.pad(wordArray, 4);
668
+ */
669
+ static pad(data: WordArray, blockSize: number): void;
670
+ /**
671
+ * Unpads data that had been padded using the algorithm defined in PKCS #5/7.
672
+ *
673
+ * @param data The data to unpad.
674
+ *
675
+ * @example
676
+ *
677
+ * PKCS7.unpad(wordArray);
678
+ */
679
+ static unpad(data: WordArray): void;
680
+ }
681
+
682
+ declare class SmpAesCrypt {
683
+ protected _password: string;
684
+ protected _salt: string;
685
+ protected _initVector?: string | undefined;
686
+ protected get _iv(): WordArray | undefined;
687
+ protected _mode: typeof CBC;
688
+ protected _padding: typeof PKCS7;
689
+ constructor(_password: string, _salt: string, _initVector?: string | undefined);
690
+ /**
691
+ * Decodes some data from a symmetric AES encryption
692
+ * @param {string} data
693
+ * @returns {string}
694
+ */
695
+ decryptAES(data: string): string;
696
+ /**
697
+ * Encodes some data with a symmetric AES encryption
698
+ * @param {string} data
699
+ * @returns {string}
700
+ */
701
+ encryptAES(data: string): string;
702
+ /**
703
+ * This is the default password generation used by Marketing Cloud in their AMPScript
704
+ * @protected
705
+ */
706
+ protected _buildKey(): WordArray;
707
+ }
708
+
709
+ declare class SmpCrypto {
710
+ static base64Decode(str: string): string;
711
+ static base64Encode(str: string): string;
712
+ static md5(data: string): string;
713
+ static sha1(data: string): string;
714
+ static sha256(data: string): string;
715
+ static sha512(data: string): string;
716
+ }
717
+
718
+ /**
719
+ * Util to generate predictable secure codes based on a base serial
720
+ */
721
+ declare class SmpSecureCode {
722
+ protected _baseCode: string;
723
+ get baseCode(): string;
724
+ get secureCode(): string;
725
+ protected _crcLength: number;
726
+ protected _seed: string;
727
+ constructor(_baseCode: string);
728
+ /**
729
+ * Checks secure code, throws a 400 error on failure
730
+ * @param giftcardCode
731
+ * @param pinToVerify
732
+ */
733
+ static check<T extends string>(giftcardCode: string, pinToVerify: T): asserts giftcardCode is T;
734
+ protected _encode(): string;
735
+ }
736
+
737
+ declare enum SmpFirebaseErrors {
738
+ DIFFERENT_CREDENTIAL = "auth/account-exists-with-different-credential",
739
+ DIFFERENT_CREDENTIAL_APPLE = "auth/account-exists-with-different-credential/apple",
740
+ DIFFERENT_CREDENTIAL_FACEBOOK = "auth/account-exists-with-different-credential/facebook",
741
+ DIFFERENT_CREDENTIAL_GOOGLE = "auth/account-exists-with-different-credential/google",
742
+ EMAIL_EXISTS = "auth/email-already-exists",
743
+ INVALID_ACTION_CODE = "auth/invalid-action-code",
744
+ POPUP_BLOCKED = "auth/popup-blocked",
745
+ POPUP_CLOSED_BY_USER = "auth/popup-closed-by-user",
746
+ USER_NOT_FOUND = "auth/user-not-found",
747
+ WRONG_PASSWORD = "auth/wrong-password"
748
+ }
749
+
750
+ declare enum SmpGiftcardTransactionOps {
751
+ ACTIVATE = "ACTIVATE",
752
+ BLOCK = "BLOCK",
753
+ CHECK = "CHECK",
754
+ DIGITAL_ACTIVATE = "DIGITAL_ACTIVATE",
755
+ FREEZE = "FREEZE",
756
+ PURCHASE = "PURCHASE",
757
+ RECHARGE = "RECHARGE",
758
+ ROLLBACK = "ROLLBACK",
759
+ TRANSACTION = "TRANSACTION",
760
+ TRANSACTION_DETAIL = "TRANSACTION_DETAIL",
761
+ UNFREEZE = "UNFREEZE",
762
+ XREFUND = "XREFUND"
763
+ }
764
+
765
+ interface SmpGiftcardTransactionPlain {
766
+ gc: string;
767
+ op: string;
768
+ ot?: string;
769
+ ts: number;
770
+ }
771
+
772
+ interface SmpGiftcardTransactionConfig {
773
+ gc?: string;
774
+ op: SmpGiftcardTransactionOps;
775
+ ot?: string;
776
+ dto?: DateTime;
777
+ }
778
+
779
+ declare enum SmpGiftcardTransactionHashStrategies {
780
+ MD5 = "MD5",
781
+ MD5_HMAC = "MD5_HMAC",
782
+ SHA1 = "SHA1",
783
+ SHA1_HMAC = "SHA1_HMAC"
784
+ }
785
+
786
+ /**
787
+ * Base implementation that you can extend, even customizing the static parts like #SmpGiftcardTransaction._AES_ENCODER.
788
+ * You can create your own instance of KikAesCrypt to override it.
789
+ */
790
+ declare class SmpGiftcardTransaction implements SmpGiftcardTransactionPlain {
791
+ readonly gc: string;
792
+ readonly op: SmpGiftcardTransactionOps;
793
+ readonly ot?: string | undefined;
794
+ protected static _AES_ENCODER: SmpAesCrypt;
795
+ protected static _LOGGER: SmpLoggerMethods;
796
+ protected static _OP_CODES: Record<SmpGiftcardTransactionOps, string>;
797
+ protected static readonly _SEP: string;
798
+ get dto(): DateTime;
799
+ get hash(): string;
800
+ get iso(): string;
801
+ get ts(): number;
802
+ /**
803
+ * A DateTime with second precision
804
+ * @protected
805
+ */
806
+ protected _dto: DateTime;
807
+ protected _hashStrategies: Record<SmpGiftcardTransactionHashStrategies, any>;
808
+ protected _hashStrategy: (str: string) => WordArray;
809
+ /**
810
+ *
811
+ * @param gc giftcard code
812
+ * @param op operation
813
+ * @param ot original transaction in case of refund
814
+ * @param unixTimestampOrMilliseconds
815
+ */
816
+ constructor(gc: string | undefined, // If we're issuing a digital giftcard we won't have the gc code
817
+ op: SmpGiftcardTransactionOps, ot?: string | undefined, unixTimestampOrMilliseconds?: number);
818
+ static build({ gc, op, ot, dto }: SmpGiftcardTransactionConfig): SmpGiftcardTransaction;
819
+ /**
820
+ * @deprecated this method is related to the old transactionId format and will be removed in a few months
821
+ * (around September 2024, since we can safely assume that you can refund those transactions for around 1 month,
822
+ * which means by then all new payment transactions will have the new format)
823
+ * @param transactionId
824
+ */
825
+ static explode(transactionId: string): SmpGiftcardTransaction;
826
+ static isBase64(str: string): boolean;
827
+ static parse(transactionId: string): SmpGiftcardTransaction;
828
+ static prefixToOperation(prefix: string): SmpGiftcardTransactionOps;
829
+ serialize(): SmpGiftcardTransactionPlain;
830
+ toString(): string;
831
+ }
832
+
833
+ declare enum SmpMarketingCloudValidators {
834
+ ListDetectiveValidator = "ListDetectiveValidator",
835
+ MXValidator = "MXValidator",
836
+ SyntaxValidator = "SyntaxValidator"
837
+ }
838
+
839
+ interface SmpMarketingCloudValidationResponseOk {
840
+ email: string;
841
+ valid: true;
842
+ }
843
+ interface SmpMarketingCloudValidationResponseKo {
844
+ email: string;
845
+ valid: boolean;
846
+ failedValidation: SmpMarketingCloudValidators;
847
+ }
848
+ type SmpMarketingCloudValidationResponse = SmpMarketingCloudValidationResponseOk | SmpMarketingCloudValidationResponseKo;
849
+
850
+ declare function smpApplyMixin<T extends SmpGenericConstructor>(derivedCtor: T, baseCtors: SmpGenericConstructor[]): void;
851
+
852
+ declare class SmpCommonUtils {
853
+ /**
854
+ * Removes items the predicate returns truthy for from the source array and returns them
855
+ */
856
+ static arrayRemove<T = any>(array: T[], iteratee: (item: T, index: number) => any): T[];
857
+ static assertIsArray<T>(entity: T[], withMessage?: string): asserts entity is T[];
858
+ static assertIsBoolean(entity: any, withMessage?: string): asserts entity is boolean;
859
+ static assertIsFunction(entity: any, withMessage?: string): asserts entity is Function;
860
+ static assertIsInstance(entity: any, klass: new (...args: any[]) => any, withMessage?: string): asserts entity is typeof klass;
861
+ static assertIsNotEmpty(val: any, withMessage?: string): void;
862
+ static assertIsNumber(entity: any, withMessage?: string): asserts entity is number;
863
+ static assertIsNumeric(entity: any, withMessage?: string): void;
864
+ static assertIsObject(entity: any, withMessage?: string): asserts entity is object;
865
+ static assertIsString(entity: any, withMessage?: string): asserts entity is string;
866
+ static assertIsTruthy<T>(condition: T, withMessage?: string): asserts condition;
867
+ static buildPath(...args: any[]): string;
868
+ static downloadBlob(blob: Blob, filename: string): void;
869
+ static generateRandomHexString(length?: number): string;
870
+ static generateUUID(): string;
871
+ static getDecimalPrecision(val: number | string): number;
872
+ /**
873
+ * More accurately check the type of JavaScript object
874
+ * @param {Object} entity The object
875
+ * @return {String} The object type
876
+ */
877
+ static getType(entity: any): string;
878
+ static isBoolean(value: any): value is boolean;
879
+ /**
880
+ * Returns true if string is a valid CSS color
881
+ * @param str
882
+ */
883
+ static isColor(str: string): boolean;
884
+ static isEmpty(entity: any): boolean;
885
+ /**
886
+ *
887
+ * @param value1 {any} first term of comparison
888
+ * @param value2 {any} second term of comparison
889
+ *
890
+ * @returns boolean
891
+ */
892
+ static isEqual(value1: any, value2: any): boolean;
893
+ static isFormField(el: HTMLElement): boolean;
894
+ static isFunction(entity: any): entity is Function;
895
+ static isNotEmpty(entity: any): boolean;
896
+ /**
897
+ * Returns true if the entity is a number
898
+ * @param entity
899
+ */
900
+ static isNumber(entity: any): entity is number;
901
+ /**
902
+ * Returns true whether you're dealing with a numeric entity. Use isNumber if you want exact type check
903
+ * @param entity
904
+ */
905
+ static isNumeric(entity: any): boolean;
906
+ static isObject(entity: any): entity is object;
907
+ /**
908
+ * This one is from underscore.js 1.13.6
909
+ * It basically checks if a value is generically an object (meaning Array, Date, Map).
910
+ * If you want a strict check use SmpCommonUtils.isObject instead.
911
+ * [TS] TODO: It would be nice to exclude String, Number, Boolean and Symbol, but for now, this will do
912
+ * @param entity
913
+ * @returns {boolean}
914
+ */
915
+ static isPrimitive(entity: any): boolean;
916
+ static isString(entity: any): entity is string;
917
+ static isWindows(): boolean;
918
+ /**
919
+ *
920
+ * @param objLike object or array
921
+ * @param iteratee the map fn
922
+ */
923
+ static mapObject<T = any>(objLike: any, iteratee: (v: any, indexOrKey: string | number, arr?: string[]) => any): T[];
924
+ static mapObjectKeys<T extends string = string>(obj: Record<T, any>, callback: (key: string, value: any) => any): Record<string, any>;
925
+ static mapObjectValues<T extends string = string>(obj: Partial<Record<T, any>>, callback: (value: any, key: string) => any): Record<string, any>;
926
+ static noop(): void;
927
+ static objectHasValue<T extends object>(obj: T, value: any): boolean;
928
+ static omit<T extends object, K extends keyof T>(obj: T, keys: K[]): Omit<T, K>;
929
+ static parseBoolean(str?: string): boolean;
930
+ static parseJsonSafely<T = any>(str: string): T | void;
931
+ static pick<T extends object, K extends keyof T>(obj: T, keys: K[]): Pick<T, K>;
932
+ static runSafely<V = any, U = any, T extends Function = (...args: V[]) => U>(fn?: T, thisArg?: null, params?: V[]): U | void;
933
+ static sleep(timeToDelay: number): Promise<unknown>;
934
+ static sprintf(str: string, ...argv: (string | number | symbol)[]): string;
935
+ static stripComments(html: string): string;
936
+ static submitFakeForm<T extends object = object>({ action, method, data, target }: {
937
+ action: string;
938
+ method: SmpRestVerbs;
939
+ data?: T;
940
+ target?: "_blank" | "_self";
941
+ }): void;
942
+ static toCamelCase(s: string): string;
943
+ static toKebabCase(s: string): string;
944
+ static toPascalCase(s: string): string;
945
+ static toSnakeCase(s: string): string;
946
+ static toUpperSnakeCase(s: string): string;
947
+ static words(string: string, pattern?: RegExp): string[];
948
+ }
949
+
950
+ declare class SmpFilterException extends Error {
951
+ message: string;
952
+ data?: any | undefined;
953
+ constructor(message?: string, data?: any | undefined);
954
+ }
955
+
956
+ /**
957
+ * A util to generate session ids
958
+ */
959
+ declare class SmpSid implements SmpCachedValue<string> {
960
+ value: string;
961
+ expiry: number;
962
+ get active(): boolean;
963
+ get expired(): boolean;
964
+ get valid(): boolean;
965
+ protected _controlSuffix: string;
966
+ constructor(value?: string, expiry?: number);
967
+ static parse(raw: SmpCachedValue<string>): SmpSid;
968
+ toPlain(): SmpCachedValue<string>;
969
+ }
970
+
971
+ declare class SmpRegularExpressions {
972
+ static get COUNTRY(): RegExp;
973
+ static get DOMAIN(): RegExp;
974
+ static get EMAIL(): RegExp;
975
+ static get LANGUAGE(): RegExp;
976
+ static get LATIN_CHARS(): RegExp;
977
+ static get LOCALE(): RegExp;
978
+ static get NO_EMOJI_NO_PUNCTUATION(): RegExp;
979
+ static get PHONE_NUMBER(): RegExp;
980
+ static get PHONE_NUMBER_BY_PREFIX(): Record<string, Record<string, RegExp>>;
981
+ static get TAXCODE_BY_COUNTRY(): Record<string, Record<string, RegExp>>;
982
+ protected static _country: RegExp;
983
+ protected static _language: RegExp;
984
+ }
985
+
986
+ declare class SmpInMemoryCache extends SmpAbstractTtlCacheStrategy {
987
+ private static _storage;
988
+ protected get _staticSelf(): typeof SmpInMemoryCache;
989
+ protected _flushRaw(): void;
990
+ protected _readRaw(key: string): unknown | undefined;
991
+ protected _removeRaw(key: string): void;
992
+ protected _writeRaw(key: string, value: unknown): void;
993
+ }
994
+
995
+ /**
996
+ * Tells you if a value is a SmpCachedValue
997
+ * @param value
998
+ */
999
+ declare function smpIsSmpCachedValue<T>(value: unknown): value is SmpCachedValue<T>;
1000
+
1001
+ declare const VERSION: "2.0.0-beta.1";
1002
+
1003
+ export { SMP_HEALTHZ, SmpAbstractCacheStrategy, SmpAbstractTtlCacheStrategy, SmpAesCrypt, SmpApiCommonUtils, SmpBaseJwtToken, SmpBaseJwtTokenPlain, SmpBrowserCache, SmpCachedValue, SmpCommonUtils, SmpCrypto, SmpErrorResponse, type SmpErrorResponseCreateOpts, SmpFilterException, SmpFirebaseErrors, type SmpGenericConstructor, SmpGenericResponse, SmpGenericResponseBase, SmpGiftcardTransaction, type SmpGiftcardTransactionConfig, SmpGiftcardTransactionHashStrategies, SmpGiftcardTransactionOps, type SmpGiftcardTransactionPlain, type SmpHttpConfig, SmpHttpService, SmpHttpSessionStorageCache, SmpHttpStatusCodes, SmpInMemoryCache, type SmpMarketingCloudValidationResponse, type SmpMarketingCloudValidationResponseKo, type SmpMarketingCloudValidationResponseOk, SmpMarketingCloudValidators, type SmpPrimitive, SmpRegularExpressions, SmpResponseMessage, SmpRestVerbs, SmpSecureCode, SmpSid, VERSION, smpApplyMixin, smpIsSmpCachedValue };