@tonysamperi/ts-mapi-core 1.8.0-next.0 → 1.8.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 (255) hide show
  1. package/changelog.md +0 -1
  2. package/dist/cjs/index.cjs +1 -1
  3. package/dist/cjs/index.cjs.map +1 -1
  4. package/dist/cjs/index.d.cts +1273 -66
  5. package/dist/esm/{chunk-JE3FPJGV.js → chunk-D2XOH6K4.js} +1 -1
  6. package/dist/esm/chunk-LD5COSFG.js +1 -0
  7. package/dist/esm/{chunk-QTWLHW3D.js → chunk-STU5GUNH.js} +1 -1
  8. package/dist/esm/chunk-V6NBH54E.js +1 -0
  9. package/dist/esm/chunk-WTLVPDI2.js +1 -0
  10. package/dist/esm/chunk-XF457SYA.js +1 -0
  11. package/dist/esm/index.d.ts +2 -3
  12. package/dist/esm/index.js +1 -1
  13. package/dist/esm/services/firebase/index.d.ts +1 -1
  14. package/dist/esm/services/firebase/index.js +1 -1
  15. package/dist/esm/services/firebase/smp-firebase-service-config.interface.d.ts +1 -1
  16. package/dist/esm/services/firebase/smp-firebase.service.d.ts +1 -1
  17. package/dist/esm/services/firebase/smp-firebase.service.js +1 -1
  18. package/dist/esm/services/http/index.js +1 -1
  19. package/dist/esm/services/http/smp-http.service.js +1 -1
  20. package/dist/esm/services/index.d.ts +1 -1
  21. package/dist/esm/services/index.js +1 -1
  22. package/dist/esm/services/smp-dynamo.service.d.ts +1 -1
  23. package/dist/esm/services/smp-dynamo.service.js +1 -1
  24. package/dist/esm/shared/api/index.d.ts +1 -1
  25. package/dist/esm/shared/api/index.js +1 -1
  26. package/dist/esm/shared/api/smp-api-common-utils.class.d.ts +1 -1
  27. package/dist/esm/shared/api/smp-api-common-utils.class.js +1 -1
  28. package/dist/esm/shared/crypto/index.js +1 -1
  29. package/dist/esm/shared/crypto/smp-secure-code.class.js +1 -1
  30. package/dist/esm/shared/giftcard/index.d.ts +1 -1
  31. package/dist/esm/shared/giftcard/smp-giftcard-transaction.class.d.ts +1 -1
  32. package/dist/esm/shared/utils/index.d.ts +1 -1
  33. package/dist/esm/shared/utils/index.js +1 -1
  34. package/dist/esm/shared/utils/smp-noop.function.d.ts +1 -3
  35. package/dist/esm/shared/utils/smp-noop.function.js +1 -1
  36. package/package.json +2 -1
  37. package/dist/cjs/services/firebase/index.cjs +0 -2
  38. package/dist/cjs/services/firebase/index.cjs.map +0 -1
  39. package/dist/cjs/services/firebase/index.d.cts +0 -7
  40. package/dist/cjs/services/firebase/smp-firebase-service-config.interface.cjs +0 -2
  41. package/dist/cjs/services/firebase/smp-firebase-service-config.interface.cjs.map +0 -1
  42. package/dist/cjs/services/firebase/smp-firebase-service-config.interface.d.cts +0 -12
  43. package/dist/cjs/services/firebase/smp-firebase.service.cjs +0 -2
  44. package/dist/cjs/services/firebase/smp-firebase.service.cjs.map +0 -1
  45. package/dist/cjs/services/firebase/smp-firebase.service.d.cts +0 -56
  46. package/dist/cjs/services/http/index.cjs +0 -2
  47. package/dist/cjs/services/http/index.cjs.map +0 -1
  48. package/dist/cjs/services/http/index.d.cts +0 -12
  49. package/dist/cjs/services/http/smp-dynamic-fetch-return.type.cjs +0 -2
  50. package/dist/cjs/services/http/smp-dynamic-fetch-return.type.cjs.map +0 -1
  51. package/dist/cjs/services/http/smp-dynamic-fetch-return.type.d.cts +0 -3
  52. package/dist/cjs/services/http/smp-http-config.interface.cjs +0 -2
  53. package/dist/cjs/services/http/smp-http-config.interface.cjs.map +0 -1
  54. package/dist/cjs/services/http/smp-http-config.interface.d.cts +0 -16
  55. package/dist/cjs/services/http/smp-http-session-storage-cache.class.cjs +0 -2
  56. package/dist/cjs/services/http/smp-http-session-storage-cache.class.cjs.map +0 -1
  57. package/dist/cjs/services/http/smp-http-session-storage-cache.class.d.cts +0 -11
  58. package/dist/cjs/services/http/smp-http-status-code.enum.cjs +0 -2
  59. package/dist/cjs/services/http/smp-http-status-code.enum.cjs.map +0 -1
  60. package/dist/cjs/services/http/smp-http-status-code.enum.d.cts +0 -70
  61. package/dist/cjs/services/http/smp-http.service.cjs +0 -2
  62. package/dist/cjs/services/http/smp-http.service.cjs.map +0 -1
  63. package/dist/cjs/services/http/smp-http.service.d.cts +0 -46
  64. package/dist/cjs/services/index.cjs +0 -2
  65. package/dist/cjs/services/index.cjs.map +0 -1
  66. package/dist/cjs/services/index.d.cts +0 -22
  67. package/dist/cjs/services/smp-dynamo.service.cjs +0 -2
  68. package/dist/cjs/services/smp-dynamo.service.cjs.map +0 -1
  69. package/dist/cjs/services/smp-dynamo.service.d.cts +0 -39
  70. package/dist/cjs/shared/api/index.cjs +0 -2
  71. package/dist/cjs/shared/api/index.cjs.map +0 -1
  72. package/dist/cjs/shared/api/index.d.cts +0 -11
  73. package/dist/cjs/shared/api/smp-api-common-utils.class.cjs +0 -2
  74. package/dist/cjs/shared/api/smp-api-common-utils.class.cjs.map +0 -1
  75. package/dist/cjs/shared/api/smp-api-common-utils.class.d.cts +0 -15
  76. package/dist/cjs/shared/api/smp-error-response-create-opts.interface.cjs +0 -2
  77. package/dist/cjs/shared/api/smp-error-response-create-opts.interface.cjs.map +0 -1
  78. package/dist/cjs/shared/api/smp-error-response-create-opts.interface.d.cts +0 -13
  79. package/dist/cjs/shared/api/smp-error-response.class.cjs +0 -2
  80. package/dist/cjs/shared/api/smp-error-response.class.cjs.map +0 -1
  81. package/dist/cjs/shared/api/smp-error-response.class.d.cts +0 -25
  82. package/dist/cjs/shared/api/smp-generic-response-base.interface.cjs +0 -2
  83. package/dist/cjs/shared/api/smp-generic-response-base.interface.cjs.map +0 -1
  84. package/dist/cjs/shared/api/smp-generic-response-base.interface.d.cts +0 -9
  85. package/dist/cjs/shared/api/smp-generic-response.class.cjs +0 -2
  86. package/dist/cjs/shared/api/smp-generic-response.class.cjs.map +0 -1
  87. package/dist/cjs/shared/api/smp-generic-response.class.d.cts +0 -20
  88. package/dist/cjs/shared/api/smp-healtz.const.cjs +0 -2
  89. package/dist/cjs/shared/api/smp-healtz.const.cjs.map +0 -1
  90. package/dist/cjs/shared/api/smp-healtz.const.d.cts +0 -5
  91. package/dist/cjs/shared/api/smp-response-message-base.interface.cjs +0 -2
  92. package/dist/cjs/shared/api/smp-response-message-base.interface.cjs.map +0 -1
  93. package/dist/cjs/shared/api/smp-response-message-base.interface.d.cts +0 -8
  94. package/dist/cjs/shared/api/smp-response-message-types.enum.cjs +0 -2
  95. package/dist/cjs/shared/api/smp-response-message-types.enum.cjs.map +0 -1
  96. package/dist/cjs/shared/api/smp-response-message-types.enum.d.cts +0 -8
  97. package/dist/cjs/shared/api/smp-response-message.class.cjs +0 -2
  98. package/dist/cjs/shared/api/smp-response-message.class.cjs.map +0 -1
  99. package/dist/cjs/shared/api/smp-response-message.class.d.cts +0 -13
  100. package/dist/cjs/shared/api/smp-rest-verbs.enum.cjs +0 -2
  101. package/dist/cjs/shared/api/smp-rest-verbs.enum.cjs.map +0 -1
  102. package/dist/cjs/shared/api/smp-rest-verbs.enum.d.cts +0 -9
  103. package/dist/cjs/shared/common/index.cjs +0 -2
  104. package/dist/cjs/shared/common/index.cjs.map +0 -1
  105. package/dist/cjs/shared/common/index.d.cts +0 -6
  106. package/dist/cjs/shared/common/smp-base-jwt-token-plain.interface.cjs +0 -2
  107. package/dist/cjs/shared/common/smp-base-jwt-token-plain.interface.cjs.map +0 -1
  108. package/dist/cjs/shared/common/smp-base-jwt-token-plain.interface.d.cts +0 -7
  109. package/dist/cjs/shared/common/smp-base-jwt-token.class.cjs +0 -2
  110. package/dist/cjs/shared/common/smp-base-jwt-token.class.cjs.map +0 -1
  111. package/dist/cjs/shared/common/smp-base-jwt-token.class.d.cts +0 -14
  112. package/dist/cjs/shared/common/smp-generic-constructor.type.cjs +0 -2
  113. package/dist/cjs/shared/common/smp-generic-constructor.type.cjs.map +0 -1
  114. package/dist/cjs/shared/common/smp-generic-constructor.type.d.cts +0 -3
  115. package/dist/cjs/shared/common/smp-primitive.type.cjs +0 -2
  116. package/dist/cjs/shared/common/smp-primitive.type.cjs.map +0 -1
  117. package/dist/cjs/shared/common/smp-primitive.type.d.cts +0 -3
  118. package/dist/cjs/shared/common/smp-social-sign-in-keys.enum.cjs +0 -2
  119. package/dist/cjs/shared/common/smp-social-sign-in-keys.enum.cjs.map +0 -1
  120. package/dist/cjs/shared/common/smp-social-sign-in-keys.enum.d.cts +0 -7
  121. package/dist/cjs/shared/common/smp-social-sign-in-ux-modes.enum.cjs +0 -2
  122. package/dist/cjs/shared/common/smp-social-sign-in-ux-modes.enum.cjs.map +0 -1
  123. package/dist/cjs/shared/common/smp-social-sign-in-ux-modes.enum.d.cts +0 -6
  124. package/dist/cjs/shared/crypto/index.cjs +0 -2
  125. package/dist/cjs/shared/crypto/index.cjs.map +0 -1
  126. package/dist/cjs/shared/crypto/index.d.cts +0 -3
  127. package/dist/cjs/shared/crypto/smp-aes-crypt.class.cjs +0 -2
  128. package/dist/cjs/shared/crypto/smp-aes-crypt.class.cjs.map +0 -1
  129. package/dist/cjs/shared/crypto/smp-aes-crypt.class.d.cts +0 -1
  130. package/dist/cjs/shared/crypto/smp-crypto.class.cjs +0 -2
  131. package/dist/cjs/shared/crypto/smp-crypto.class.cjs.map +0 -1
  132. package/dist/cjs/shared/crypto/smp-crypto.class.d.cts +0 -10
  133. package/dist/cjs/shared/crypto/smp-secure-code.class.cjs +0 -2
  134. package/dist/cjs/shared/crypto/smp-secure-code.class.cjs.map +0 -1
  135. package/dist/cjs/shared/crypto/smp-secure-code.class.d.cts +0 -20
  136. package/dist/cjs/shared/firebase/index.cjs +0 -2
  137. package/dist/cjs/shared/firebase/index.cjs.map +0 -1
  138. package/dist/cjs/shared/firebase/index.d.cts +0 -1
  139. package/dist/cjs/shared/firebase/smp-firebase-errors.enum.cjs +0 -2
  140. package/dist/cjs/shared/firebase/smp-firebase-errors.enum.cjs.map +0 -1
  141. package/dist/cjs/shared/firebase/smp-firebase-errors.enum.d.cts +0 -14
  142. package/dist/cjs/shared/giftcard/index.cjs +0 -2
  143. package/dist/cjs/shared/giftcard/index.cjs.map +0 -1
  144. package/dist/cjs/shared/giftcard/index.d.cts +0 -8
  145. package/dist/cjs/shared/giftcard/smp-giftcard-transaction-config.interface.cjs +0 -2
  146. package/dist/cjs/shared/giftcard/smp-giftcard-transaction-config.interface.cjs.map +0 -1
  147. package/dist/cjs/shared/giftcard/smp-giftcard-transaction-config.interface.d.cts +0 -11
  148. package/dist/cjs/shared/giftcard/smp-giftcard-transaction-hash-strategies.enum.cjs +0 -2
  149. package/dist/cjs/shared/giftcard/smp-giftcard-transaction-hash-strategies.enum.cjs.map +0 -1
  150. package/dist/cjs/shared/giftcard/smp-giftcard-transaction-hash-strategies.enum.d.cts +0 -8
  151. package/dist/cjs/shared/giftcard/smp-giftcard-transaction-ops.enum.cjs +0 -2
  152. package/dist/cjs/shared/giftcard/smp-giftcard-transaction-ops.enum.cjs.map +0 -1
  153. package/dist/cjs/shared/giftcard/smp-giftcard-transaction-ops.enum.d.cts +0 -16
  154. package/dist/cjs/shared/giftcard/smp-giftcard-transaction-plain.interface.cjs +0 -2
  155. package/dist/cjs/shared/giftcard/smp-giftcard-transaction-plain.interface.cjs.map +0 -1
  156. package/dist/cjs/shared/giftcard/smp-giftcard-transaction-plain.interface.d.cts +0 -8
  157. package/dist/cjs/shared/giftcard/smp-giftcard-transaction.class.cjs +0 -2
  158. package/dist/cjs/shared/giftcard/smp-giftcard-transaction.class.cjs.map +0 -1
  159. package/dist/cjs/shared/giftcard/smp-giftcard-transaction.class.d.cts +0 -56
  160. package/dist/cjs/shared/marketing-cloud/index.cjs +0 -2
  161. package/dist/cjs/shared/marketing-cloud/index.cjs.map +0 -1
  162. package/dist/cjs/shared/marketing-cloud/index.d.cts +0 -2
  163. package/dist/cjs/shared/marketing-cloud/smp-marketing-cloud-validation-response.interface.cjs +0 -2
  164. package/dist/cjs/shared/marketing-cloud/smp-marketing-cloud-validation-response.interface.cjs.map +0 -1
  165. package/dist/cjs/shared/marketing-cloud/smp-marketing-cloud-validation-response.interface.d.cts +0 -14
  166. package/dist/cjs/shared/marketing-cloud/smp-marketing-cloud-validators.enum.cjs +0 -2
  167. package/dist/cjs/shared/marketing-cloud/smp-marketing-cloud-validators.enum.cjs.map +0 -1
  168. package/dist/cjs/shared/marketing-cloud/smp-marketing-cloud-validators.enum.d.cts +0 -7
  169. package/dist/cjs/shared/rxjs/index.cjs +0 -2
  170. package/dist/cjs/shared/rxjs/index.cjs.map +0 -1
  171. package/dist/cjs/shared/rxjs/index.d.cts +0 -10
  172. package/dist/cjs/shared/rxjs/smp-abstract-rxjs-ttl-cache-strategy.class.cjs +0 -2
  173. package/dist/cjs/shared/rxjs/smp-abstract-rxjs-ttl-cache-strategy.class.cjs.map +0 -1
  174. package/dist/cjs/shared/rxjs/smp-abstract-rxjs-ttl-cache-strategy.class.d.cts +0 -17
  175. package/dist/cjs/shared/rxjs/smp-rxjs-catch-only.function.cjs +0 -2
  176. package/dist/cjs/shared/rxjs/smp-rxjs-catch-only.function.cjs.map +0 -1
  177. package/dist/cjs/shared/rxjs/smp-rxjs-catch-only.function.d.cts +0 -5
  178. package/dist/cjs/shared/rxjs/smp-rxjs-in-memory-cache.class.cjs +0 -2
  179. package/dist/cjs/shared/rxjs/smp-rxjs-in-memory-cache.class.cjs.map +0 -1
  180. package/dist/cjs/shared/rxjs/smp-rxjs-in-memory-cache.class.d.cts +0 -15
  181. package/dist/cjs/shared/rxjs/smp-rxjs-queue.function.cjs +0 -2
  182. package/dist/cjs/shared/rxjs/smp-rxjs-queue.function.cjs.map +0 -1
  183. package/dist/cjs/shared/rxjs/smp-rxjs-queue.function.d.cts +0 -11
  184. package/dist/cjs/shared/rxjs/smp-rxjs-sequence.function.cjs +0 -2
  185. package/dist/cjs/shared/rxjs/smp-rxjs-sequence.function.cjs.map +0 -1
  186. package/dist/cjs/shared/rxjs/smp-rxjs-sequence.function.d.cts +0 -12
  187. package/dist/cjs/shared/rxjs/smp-rxjs-throw-if-empty.function.cjs +0 -2
  188. package/dist/cjs/shared/rxjs/smp-rxjs-throw-if-empty.function.cjs.map +0 -1
  189. package/dist/cjs/shared/rxjs/smp-rxjs-throw-if-empty.function.d.cts +0 -38
  190. package/dist/cjs/shared/rxjs/smp-rxjs-throw-on-condition.function.cjs +0 -2
  191. package/dist/cjs/shared/rxjs/smp-rxjs-throw-on-condition.function.cjs.map +0 -1
  192. package/dist/cjs/shared/rxjs/smp-rxjs-throw-on-condition.function.d.cts +0 -30
  193. package/dist/cjs/shared/utils/cache/index.cjs +0 -2
  194. package/dist/cjs/shared/utils/cache/index.cjs.map +0 -1
  195. package/dist/cjs/shared/utils/cache/index.d.cts +0 -7
  196. package/dist/cjs/shared/utils/cache/smp-abstract-cache-strategy.class.cjs +0 -2
  197. package/dist/cjs/shared/utils/cache/smp-abstract-cache-strategy.class.cjs.map +0 -1
  198. package/dist/cjs/shared/utils/cache/smp-abstract-cache-strategy.class.d.cts +0 -16
  199. package/dist/cjs/shared/utils/cache/smp-abstract-ttl-cache-strategy.class.cjs +0 -2
  200. package/dist/cjs/shared/utils/cache/smp-abstract-ttl-cache-strategy.class.cjs.map +0 -1
  201. package/dist/cjs/shared/utils/cache/smp-abstract-ttl-cache-strategy.class.d.cts +0 -17
  202. package/dist/cjs/shared/utils/cache/smp-browser-cache.class.cjs +0 -2
  203. package/dist/cjs/shared/utils/cache/smp-browser-cache.class.cjs.map +0 -1
  204. package/dist/cjs/shared/utils/cache/smp-browser-cache.class.d.cts +0 -16
  205. package/dist/cjs/shared/utils/cache/smp-cached-value.interface.cjs +0 -2
  206. package/dist/cjs/shared/utils/cache/smp-cached-value.interface.cjs.map +0 -1
  207. package/dist/cjs/shared/utils/cache/smp-cached-value.interface.d.cts +0 -6
  208. package/dist/cjs/shared/utils/cache/smp-in-memory-cache.class.cjs +0 -2
  209. package/dist/cjs/shared/utils/cache/smp-in-memory-cache.class.cjs.map +0 -1
  210. package/dist/cjs/shared/utils/cache/smp-in-memory-cache.class.d.cts +0 -15
  211. package/dist/cjs/shared/utils/cache/smp-is-smp-cached-value.function.cjs +0 -2
  212. package/dist/cjs/shared/utils/cache/smp-is-smp-cached-value.function.cjs.map +0 -1
  213. package/dist/cjs/shared/utils/cache/smp-is-smp-cached-value.function.d.cts +0 -9
  214. package/dist/cjs/shared/utils/index.cjs +0 -2
  215. package/dist/cjs/shared/utils/index.cjs.map +0 -1
  216. package/dist/cjs/shared/utils/index.d.cts +0 -15
  217. package/dist/cjs/shared/utils/smp-apply-mixin.function.cjs +0 -2
  218. package/dist/cjs/shared/utils/smp-apply-mixin.function.cjs.map +0 -1
  219. package/dist/cjs/shared/utils/smp-apply-mixin.function.d.cts +0 -5
  220. package/dist/cjs/shared/utils/smp-ascii-words.function.cjs +0 -2
  221. package/dist/cjs/shared/utils/smp-ascii-words.function.cjs.map +0 -1
  222. package/dist/cjs/shared/utils/smp-ascii-words.function.d.cts +0 -3
  223. package/dist/cjs/shared/utils/smp-common-utils.class.cjs +0 -2
  224. package/dist/cjs/shared/utils/smp-common-utils.class.cjs.map +0 -1
  225. package/dist/cjs/shared/utils/smp-common-utils.class.d.cts +0 -101
  226. package/dist/cjs/shared/utils/smp-filter-exception.class.cjs +0 -2
  227. package/dist/cjs/shared/utils/smp-filter-exception.class.cjs.map +0 -1
  228. package/dist/cjs/shared/utils/smp-filter-exception.class.d.cts +0 -7
  229. package/dist/cjs/shared/utils/smp-noop.function.cjs +0 -2
  230. package/dist/cjs/shared/utils/smp-noop.function.cjs.map +0 -1
  231. package/dist/cjs/shared/utils/smp-noop.function.d.cts +0 -3
  232. package/dist/cjs/shared/utils/smp-regular-expressions.class.cjs +0 -2
  233. package/dist/cjs/shared/utils/smp-regular-expressions.class.cjs.map +0 -1
  234. package/dist/cjs/shared/utils/smp-regular-expressions.class.d.cts +0 -16
  235. package/dist/cjs/shared/utils/smp-sid.class.cjs +0 -2
  236. package/dist/cjs/shared/utils/smp-sid.class.cjs.map +0 -1
  237. package/dist/cjs/shared/utils/smp-sid.class.d.cts +0 -18
  238. package/dist/cjs/shared/utils/smp-unicode-words.class.cjs +0 -2
  239. package/dist/cjs/shared/utils/smp-unicode-words.class.cjs.map +0 -1
  240. package/dist/cjs/shared/utils/smp-unicode-words.class.d.cts +0 -15
  241. package/dist/cjs/shared/zod/index.cjs +0 -2
  242. package/dist/cjs/shared/zod/index.cjs.map +0 -1
  243. package/dist/cjs/shared/zod/index.d.cts +0 -3
  244. package/dist/cjs/shared/zod/smp-zod-date-time.definition.cjs +0 -2
  245. package/dist/cjs/shared/zod/smp-zod-date-time.definition.cjs.map +0 -1
  246. package/dist/cjs/shared/zod/smp-zod-date-time.definition.d.cts +0 -28
  247. package/dist/cjs/smp-aes-crypt.class-CI82T7GV.d.cts +0 -470
  248. package/dist/cjs/smp-logger-methods.class-F7p-lMeQ.d.cts +0 -66
  249. package/dist/esm/chunk-C3LKT6AF.js +0 -1
  250. package/dist/esm/chunk-FUHGPBNJ.js +0 -1
  251. package/dist/esm/chunk-NIN4PUZX.js +0 -0
  252. package/dist/esm/chunk-RCI7NEJO.js +0 -1
  253. package/dist/esm/chunk-TSC2BSSL.js +0 -1
  254. package/dist/esm/chunk-ZNC4KYAS.js +0 -1
  255. package/dist/esm/smp-logger-methods.class-F7p-lMeQ.d.ts +0 -66
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/shared/zod/index.ts","../../../../src/shared/zod/smp-zod-date-time.definition.ts"],"sourcesContent":["export * from \"./smp-zod-date-time.definition.js\";\n","import z, {ZodTypeDef, ZodIssueCode, ParseInput, ParseContext, ParseReturnType, ZodParsedType} from \"zod\";\nimport {DateTime} from \"ts-luxon\";\n\ninterface SmpZodDateTimeCheck {\n kind: \"min\" | \"max\" | \"between\";\n min?: DateTime;\n max?: DateTime;\n message?: string;\n}\n\ninterface SmpZodDateTimeDef extends ZodTypeDef {\n coerce: boolean;\n checks: SmpZodDateTimeCheck[];\n typeName: \"SmpZodDateTime\";\n}\n\nexport class SmpZodDateTime extends z.ZodType<DateTime, SmpZodDateTimeDef> {\n // Constructor and other methods (between, coerce, max, min, _coerceToDateTime) remain the same as your latest version or my previous suggestions.\n // For brevity, only _parse is shown fully modified here. Ensure other parts of the class are consistent.\n\n constructor(def?: Partial<SmpZodDateTimeDef>) {\n super({\n typeName: \"SmpZodDateTime\",\n coerce: def?.coerce ?? false,\n checks: def?.checks ?? []\n });\n }\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n _parse(input: ParseInput): ParseReturnType<DateTime> {\n const ctx = this._getOrReturnCtx(input);\n let val = ctx.data;\n\n if (this._def.coerce) {\n val = this._coerceToDateTime(val); // Assuming _coerceToDateTime is implemented\n if (!(val instanceof DateTime) || !val.isValid) {\n z.addIssueToContext(ctx, { // Changed from ctx.addIssue\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.date, // Using ZodParsedType.date\n received: ZodParsedType.unknown,\n path: ctx.path,\n message: \"Invalid date format\"\n });\n return z.INVALID;\n }\n }\n\n // Ensure val is a DateTime object before proceeding with checks if not coercing\n // or if coercion failed to produce a DateTime (though the above check should catch it)\n if (!(val instanceof DateTime) || !val.isValid) {\n // If not coercing, and it's not a valid DateTime, this is an invalid type.\n // This specific case might be implicitly handled if !this._def.coerce means val must already be DateTime.\n // However, adding an explicit check if not coercing can be safer.\n if (!this._def.coerce) {\n z.addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.date, // Or a custom type name if you prefer\n received: ZodParsedType.unknown, // Or more specific if possible\n path: ctx.path,\n message: \"Input must be a valid DateTime object\"\n });\n return z.INVALID;\n }\n // If coercion was supposed to happen, and we still don't have a valid DateTime,\n // the earlier check inside the `if (this._def.coerce)` block should have caught it.\n }\n\n\n const checkMap: Record<SmpZodDateTimeCheck[\"kind\"], (check: SmpZodDateTimeCheck, dateTimeVal: DateTime, parseCtx: ParseContext) => z.ZodIssue | undefined> = {\n min: (check, dateTimeVal, parseCtx) => {\n if (check.min && dateTimeVal < check.min) {\n return {\n code: ZodIssueCode.too_small,\n minimum: check.min.toMillis(), // Changed to number (milliseconds)\n type: \"date\", // Added type\n inclusive: true,\n message: check.message ?? `Date must be ≥ ${check.min.toISODate()}`,\n path: parseCtx.path\n };\n }\n return undefined;\n },\n max: (check, dateTimeVal, parseCtx) => {\n if (check.max && dateTimeVal > check.max) {\n return {\n code: ZodIssueCode.too_big,\n maximum: check.max.toMillis(), // Changed to number (milliseconds)\n type: \"date\", // Added type\n inclusive: true, // Added inclusive\n message: check.message ?? `Date must be ≤ ${check.max.toISODate()}`,\n path: parseCtx.path\n };\n }\n return undefined;\n },\n between: (check, dateTimeVal, parseCtx) => {\n if (check.min && check.max && (dateTimeVal < check.min || dateTimeVal > check.max)) {\n return {\n code: ZodIssueCode.custom,\n message: check.message ?? `Date must be between ${check.min.toISODate()} and ${check.max.toISODate()}`,\n path: parseCtx.path\n // Optionally, add params for more structured error data:\n // params: { min: check.min.toISO(), max: check.max.toISO() }\n };\n }\n return undefined;\n }\n };\n\n for (const check of this._def.checks) {\n // Ensure val is a DateTime before passing to checkMap functions\n // This is crucial if coercion didn't happen or didn't result in a DateTime.\n // The earlier checks should ideally ensure 'val' is a valid DateTime if it reached this point.\n if (val instanceof DateTime && val.isValid) {\n const issueData = checkMap[check.kind](check, val, ctx);\n if (issueData) {\n z.addIssueToContext(ctx, issueData); // Changed from ctx.addIssue\n }\n }\n else {\n // This case should ideally be caught earlier (e.g., if not coercing, or if coercion failed)\n // If it reaches here, it implies a logic flaw or an unexpected state.\n // For robustness, you might add a generic invalid_type issue here if 'val' is not a DateTime.\n // However, the checks at the beginning of _parse should prevent this.\n }\n }\n\n if (ctx.common.issues.length > 0) { // Check ctx.common.issues.length\n return z.INVALID;\n }\n\n return z.OK(val as DateTime); // Ensure the 'val' returned by OK is typed as DateTime\n }\n\n between(min: DateTime, max: DateTime, message?: string): this {\n return new SmpZodDateTime({\n ...this._def,\n checks: [...this._def.checks, {kind: \"between\", min: min.toUTC(), max: max.toUTC(), message}]\n }) as this;\n }\n\n coerce(): this {\n return new SmpZodDateTime({\n ...this._def,\n coerce: true\n }) as this;\n }\n\n max(max: DateTime, message?: string): this {\n return new SmpZodDateTime({\n ...this._def,\n checks: [...this._def.checks, {kind: \"max\", max: max.toUTC(), message}]\n }) as this;\n }\n\n min(min: DateTime, message?: string): this {\n return new SmpZodDateTime({\n ...this._def,\n checks: [...this._def.checks, {kind: \"min\", min: min.toUTC(), message}]\n }) as this;\n }\n\n // Coercion helper function (ensure it's robust as discussed previously)\n private _coerceToDateTime(val: any): DateTime | null {\n if (val instanceof DateTime && val.isValid) {\n return val; // Already valid DateTime\n }\n\n const coercionMap: Record<string, () => DateTime | null> = {\n string: () => DateTime.fromJSDate(new Date(val)),\n number: () => DateTime.fromMillis(val),\n object: () => DateTime.fromJSDate(val),\n default: () => null\n };\n\n return (coercionMap[typeof val] || coercionMap.default)();\n }\n}\n\nexport const smpZodDateTime = (opts: { coerce?: boolean } = {}) => {\n return new SmpZodDateTime({\n coerce: opts.coerce ?? false,\n checks: []\n });\n};\n"],"mappings":"6mBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oBAAAE,EAAA,mBAAAC,IAAA,eAAAC,EAAAJ,GCAA,IAAAK,EAAoG,oBACpGC,EAAuB,oBAehB,IAAMC,EAAN,MAAMA,UAAuBC,EAAAA,QAAEC,OAAO,CAhB7C,MAgB6C,CAAAC,EAAA,uBAIzC,YAAYC,EAAkC,CAC1C,MAAM,CACFC,SAAU,iBACVC,OAAQF,GAAKE,QAAU,GACvBC,OAAQH,GAAKG,QAAU,CAAA,CAC3B,CAAA,CACJ,CAGAC,OAAOC,EAA8C,CACjD,IAAMC,EAAM,KAAKC,gBAAgBF,CAAAA,EAC7BG,EAAMF,EAAIG,KAEd,GAAI,KAAKC,KAAKR,SACVM,EAAM,KAAKG,kBAAkBH,CAAAA,EACzB,EAAEA,aAAeI,aAAa,CAACJ,EAAIK,SACnChB,SAAAA,QAAEiB,kBAAkBR,EAAK,CACrBS,KAAMC,eAAaC,aACnBC,SAAUC,gBAAc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C,CAAAA,CAAAA,EAAnC,UACR6C,OAAQtD,EAAA,IAAMa,WAAS0C,WAAW9C,CAAAA,EAA1B,UACR+C,OAAQxD,EAAA,IAAMa,WAASuC,WAAW3C,CAAAA,EAA1B,UACRgD,QAASzD,EAAA,IAAM,KAAN,UACb,EAEA,OAAQkD,EAAY,OAAOzC,CAAAA,GAAQyC,EAAYO,SAAM,CACzD,CACJ,EAEaC,EAAiB1D,EAAA,CAAC2D,EAA6B,CAAC,IAClD,IAAI9D,EAAe,CACtBM,OAAQwD,EAAKxD,QAAU,GACvBC,OAAQ,CAAA,CACZ,CAAA,EAJ0B","names":["zod_exports","__export","SmpZodDateTime","smpZodDateTime","__toCommonJS","import_zod","import_ts_luxon","SmpZodDateTime","z","ZodType","__name","def","typeName","coerce","checks","_parse","input","ctx","_getOrReturnCtx","val","data","_def","_coerceToDateTime","DateTime","isValid","addIssueToContext","code","ZodIssueCode","invalid_type","expected","ZodParsedType","date","received","unknown","path","message","INVALID","checkMap","min","check","dateTimeVal","parseCtx","too_small","minimum","toMillis","type","inclusive","toISODate","max","too_big","maximum","between","custom","issueData","kind","common","issues","length","OK","toUTC","coercionMap","string","fromJSDate","Date","number","fromMillis","object","default","smpZodDateTime","opts"]}
@@ -1,3 +0,0 @@
1
- export { SmpZodDateTime, smpZodDateTime } from './smp-zod-date-time.definition.cjs';
2
- import 'zod';
3
- import 'ts-luxon';
@@ -1,2 +0,0 @@
1
- "use strict";var x=Object.create;var c=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var D=Object.getPrototypeOf,I=Object.prototype.hasOwnProperty;var o=(n,e)=>c(n,"name",{value:e,configurable:!0});var T=(n,e)=>{for(var t in e)c(n,t,{get:e[t],enumerable:!0})},p=(n,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let d of h(e))!I.call(n,d)&&d!==t&&c(n,d,{get:()=>e[d],enumerable:!(a=l(e,d))||a.enumerable});return n};var _=(n,e,t)=>(t=n!=null?x(D(n)):{},p(e||!n||!n.__esModule?c(t,"default",{value:n,enumerable:!0}):t,n)),b=n=>p(c({},"__esModule",{value:!0}),n);var w={};T(w,{SmpZodDateTime:()=>f,smpZodDateTime:()=>g});module.exports=b(w);var i=_(require("zod"),1),m=require("ts-luxon");var f=class n extends i.default.ZodType{static{o(this,"SmpZodDateTime")}constructor(e){super({typeName:"SmpZodDateTime",coerce:e?.coerce??!1,checks:e?.checks??[]})}_parse(e){let t=this._getOrReturnCtx(e),a=t.data;if(this._def.coerce&&(a=this._coerceToDateTime(a),!(a instanceof m.DateTime)||!a.isValid))return i.default.addIssueToContext(t,{code:i.ZodIssueCode.invalid_type,expected:i.ZodParsedType.date,received:i.ZodParsedType.unknown,path:t.path,message:"Invalid date format"}),i.default.INVALID;if((!(a instanceof m.DateTime)||!a.isValid)&&!this._def.coerce)return i.default.addIssueToContext(t,{code:i.ZodIssueCode.invalid_type,expected:i.ZodParsedType.date,received:i.ZodParsedType.unknown,path:t.path,message:"Input must be a valid DateTime object"}),i.default.INVALID;let d={min:o((s,r,u)=>{if(s.min&&r<s.min)return{code:i.ZodIssueCode.too_small,minimum:s.min.toMillis(),type:"date",inclusive:!0,message:s.message??`Date must be \u2265 ${s.min.toISODate()}`,path:u.path}},"min"),max:o((s,r,u)=>{if(s.max&&r>s.max)return{code:i.ZodIssueCode.too_big,maximum:s.max.toMillis(),type:"date",inclusive:!0,message:s.message??`Date must be \u2264 ${s.max.toISODate()}`,path:u.path}},"max"),between:o((s,r,u)=>{if(s.min&&s.max&&(r<s.min||r>s.max))return{code:i.ZodIssueCode.custom,message:s.message??`Date must be between ${s.min.toISODate()} and ${s.max.toISODate()}`,path:u.path}},"between")};for(let s of this._def.checks)if(a instanceof m.DateTime&&a.isValid){let r=d[s.kind](s,a,t);r&&i.default.addIssueToContext(t,r)}return t.common.issues.length>0?i.default.INVALID:i.default.OK(a)}between(e,t,a){return new n({...this._def,checks:[...this._def.checks,{kind:"between",min:e.toUTC(),max:t.toUTC(),message:a}]})}coerce(){return new n({...this._def,coerce:!0})}max(e,t){return new n({...this._def,checks:[...this._def.checks,{kind:"max",max:e.toUTC(),message:t}]})}min(e,t){return new n({...this._def,checks:[...this._def.checks,{kind:"min",min:e.toUTC(),message:t}]})}_coerceToDateTime(e){if(e instanceof m.DateTime&&e.isValid)return e;let t={string:o(()=>m.DateTime.fromJSDate(new Date(e)),"string"),number:o(()=>m.DateTime.fromMillis(e),"number"),object:o(()=>m.DateTime.fromJSDate(e),"object"),default:o(()=>null,"default")};return(t[typeof e]||t.default)()}},g=o((n={})=>new f({coerce:n.coerce??!1,checks:[]}),"smpZodDateTime");0&&(module.exports={SmpZodDateTime,smpZodDateTime});
2
- //# sourceMappingURL=smp-zod-date-time.definition.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/shared/zod/smp-zod-date-time.definition.ts"],"sourcesContent":["import z, {ZodTypeDef, ZodIssueCode, ParseInput, ParseContext, ParseReturnType, ZodParsedType} from \"zod\";\nimport {DateTime} from \"ts-luxon\";\n\ninterface SmpZodDateTimeCheck {\n kind: \"min\" | \"max\" | \"between\";\n min?: DateTime;\n max?: DateTime;\n message?: string;\n}\n\ninterface SmpZodDateTimeDef extends ZodTypeDef {\n coerce: boolean;\n checks: SmpZodDateTimeCheck[];\n typeName: \"SmpZodDateTime\";\n}\n\nexport class SmpZodDateTime extends z.ZodType<DateTime, SmpZodDateTimeDef> {\n // Constructor and other methods (between, coerce, max, min, _coerceToDateTime) remain the same as your latest version or my previous suggestions.\n // For brevity, only _parse is shown fully modified here. Ensure other parts of the class are consistent.\n\n constructor(def?: Partial<SmpZodDateTimeDef>) {\n super({\n typeName: \"SmpZodDateTime\",\n coerce: def?.coerce ?? false,\n checks: def?.checks ?? []\n });\n }\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n _parse(input: ParseInput): ParseReturnType<DateTime> {\n const ctx = this._getOrReturnCtx(input);\n let val = ctx.data;\n\n if (this._def.coerce) {\n val = this._coerceToDateTime(val); // Assuming _coerceToDateTime is implemented\n if (!(val instanceof DateTime) || !val.isValid) {\n z.addIssueToContext(ctx, { // Changed from ctx.addIssue\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.date, // Using ZodParsedType.date\n received: ZodParsedType.unknown,\n path: ctx.path,\n message: \"Invalid date format\"\n });\n return z.INVALID;\n }\n }\n\n // Ensure val is a DateTime object before proceeding with checks if not coercing\n // or if coercion failed to produce a DateTime (though the above check should catch it)\n if (!(val instanceof DateTime) || !val.isValid) {\n // If not coercing, and it's not a valid DateTime, this is an invalid type.\n // This specific case might be implicitly handled if !this._def.coerce means val must already be DateTime.\n // However, adding an explicit check if not coercing can be safer.\n if (!this._def.coerce) {\n z.addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.date, // Or a custom type name if you prefer\n received: ZodParsedType.unknown, // Or more specific if possible\n path: ctx.path,\n message: \"Input must be a valid DateTime object\"\n });\n return z.INVALID;\n }\n // If coercion was supposed to happen, and we still don't have a valid DateTime,\n // the earlier check inside the `if (this._def.coerce)` block should have caught it.\n }\n\n\n const checkMap: Record<SmpZodDateTimeCheck[\"kind\"], (check: SmpZodDateTimeCheck, dateTimeVal: DateTime, parseCtx: ParseContext) => z.ZodIssue | undefined> = {\n min: (check, dateTimeVal, parseCtx) => {\n if (check.min && dateTimeVal < check.min) {\n return {\n code: ZodIssueCode.too_small,\n minimum: check.min.toMillis(), // Changed to number (milliseconds)\n type: \"date\", // Added type\n inclusive: true,\n message: check.message ?? `Date must be ≥ ${check.min.toISODate()}`,\n path: parseCtx.path\n };\n }\n return undefined;\n },\n max: (check, dateTimeVal, parseCtx) => {\n if (check.max && dateTimeVal > check.max) {\n return {\n code: ZodIssueCode.too_big,\n maximum: check.max.toMillis(), // Changed to number (milliseconds)\n type: \"date\", // Added type\n inclusive: true, // Added inclusive\n message: check.message ?? `Date must be ≤ ${check.max.toISODate()}`,\n path: parseCtx.path\n };\n }\n return undefined;\n },\n between: (check, dateTimeVal, parseCtx) => {\n if (check.min && check.max && (dateTimeVal < check.min || dateTimeVal > check.max)) {\n return {\n code: ZodIssueCode.custom,\n message: check.message ?? `Date must be between ${check.min.toISODate()} and ${check.max.toISODate()}`,\n path: parseCtx.path\n // Optionally, add params for more structured error data:\n // params: { min: check.min.toISO(), max: check.max.toISO() }\n };\n }\n return undefined;\n }\n };\n\n for (const check of this._def.checks) {\n // Ensure val is a DateTime before passing to checkMap functions\n // This is crucial if coercion didn't happen or didn't result in a DateTime.\n // The earlier checks should ideally ensure 'val' is a valid DateTime if it reached this point.\n if (val instanceof DateTime && val.isValid) {\n const issueData = checkMap[check.kind](check, val, ctx);\n if (issueData) {\n z.addIssueToContext(ctx, issueData); // Changed from ctx.addIssue\n }\n }\n else {\n // This case should ideally be caught earlier (e.g., if not coercing, or if coercion failed)\n // If it reaches here, it implies a logic flaw or an unexpected state.\n // For robustness, you might add a generic invalid_type issue here if 'val' is not a DateTime.\n // However, the checks at the beginning of _parse should prevent this.\n }\n }\n\n if (ctx.common.issues.length > 0) { // Check ctx.common.issues.length\n return z.INVALID;\n }\n\n return z.OK(val as DateTime); // Ensure the 'val' returned by OK is typed as DateTime\n }\n\n between(min: DateTime, max: DateTime, message?: string): this {\n return new SmpZodDateTime({\n ...this._def,\n checks: [...this._def.checks, {kind: \"between\", min: min.toUTC(), max: max.toUTC(), message}]\n }) as this;\n }\n\n coerce(): this {\n return new SmpZodDateTime({\n ...this._def,\n coerce: true\n }) as this;\n }\n\n max(max: DateTime, message?: string): this {\n return new SmpZodDateTime({\n ...this._def,\n checks: [...this._def.checks, {kind: \"max\", max: max.toUTC(), message}]\n }) as this;\n }\n\n min(min: DateTime, message?: string): this {\n return new SmpZodDateTime({\n ...this._def,\n checks: [...this._def.checks, {kind: \"min\", min: min.toUTC(), message}]\n }) as this;\n }\n\n // Coercion helper function (ensure it's robust as discussed previously)\n private _coerceToDateTime(val: any): DateTime | null {\n if (val instanceof DateTime && val.isValid) {\n return val; // Already valid DateTime\n }\n\n const coercionMap: Record<string, () => DateTime | null> = {\n string: () => DateTime.fromJSDate(new Date(val)),\n number: () => DateTime.fromMillis(val),\n object: () => DateTime.fromJSDate(val),\n default: () => null\n };\n\n return (coercionMap[typeof val] || coercionMap.default)();\n }\n}\n\nexport const smpZodDateTime = (opts: { coerce?: boolean } = {}) => {\n return new SmpZodDateTime({\n coerce: opts.coerce ?? false,\n checks: []\n });\n};\n"],"mappings":"6mBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oBAAAE,EAAA,mBAAAC,IAAA,eAAAC,EAAAJ,GAAA,IAAAK,EAAoG,oBACpGC,EAAuB,oBAehB,IAAMC,EAAN,MAAMA,UAAuBC,EAAAA,QAAEC,OAAO,CAhB7C,MAgB6C,CAAAC,EAAA,uBAIzC,YAAYC,EAAkC,CAC1C,MAAM,CACFC,SAAU,iBACVC,OAAQF,GAAKE,QAAU,GACvBC,OAAQH,GAAKG,QAAU,CAAA,CAC3B,CAAA,CACJ,CAGAC,OAAOC,EAA8C,CACjD,IAAMC,EAAM,KAAKC,gBAAgBF,CAAAA,EAC7BG,EAAMF,EAAIG,KAEd,GAAI,KAAKC,KAAKR,SACVM,EAAM,KAAKG,kBAAkBH,CAAAA,EACzB,EAAEA,aAAeI,aAAa,CAACJ,EAAIK,SACnChB,SAAAA,QAAEiB,kBAAkBR,EAAK,CACrBS,KAAMC,eAAaC,aACnBC,SAAUC,gBAAcC,KACxBC,SAAUF,gBAAcG,QACxBC,KAAMjB,EAAIiB,KACVC,QAAS,qBACb,CAAA,EACO3B,EAAAA,QAAE4B,QAMjB,IAAI,EAAEjB,aAAeI,aAAa,CAACJ,EAAIK,UAI/B,CAAC,KAAKH,KAAKR,OACXL,SAAAA,QAAEiB,kBAAkBR,EAAK,CACrBS,KAAMC,eAAaC,aACnBC,SAAUC,gBAAcC,KACxBC,SAAUF,gBAAcG,QACxBC,KAAMjB,EAAIiB,KACVC,QAAS,uCACb,CAAA,EACO3B,EAAAA,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AAU,GACvBC,OAAQ,CAAA,CACZ,CAAA,EAJ0B","names":["smp_zod_date_time_definition_exports","__export","SmpZodDateTime","smpZodDateTime","__toCommonJS","import_zod","import_ts_luxon","SmpZodDateTime","z","ZodType","__name","def","typeName","coerce","checks","_parse","input","ctx","_getOrReturnCtx","val","data","_def","_coerceToDateTime","DateTime","isValid","addIssueToContext","code","ZodIssueCode","invalid_type","expected","ZodParsedType","date","received","unknown","path","message","INVALID","checkMap","min","check","dateTimeVal","parseCtx","too_small","minimum","toMillis","type","inclusive","toISODate","max","too_big","maximum","between","custom","issueData","kind","common","issues","length","OK","toUTC","coercionMap","string","fromJSDate","Date","number","fromMillis","object","default","smpZodDateTime","opts"]}
@@ -1,28 +0,0 @@
1
- import z, { ZodTypeDef, ParseInput, ParseReturnType } from 'zod';
2
- import { DateTime } from 'ts-luxon';
3
-
4
- interface SmpZodDateTimeCheck {
5
- kind: "min" | "max" | "between";
6
- min?: DateTime;
7
- max?: DateTime;
8
- message?: string;
9
- }
10
- interface SmpZodDateTimeDef extends ZodTypeDef {
11
- coerce: boolean;
12
- checks: SmpZodDateTimeCheck[];
13
- typeName: "SmpZodDateTime";
14
- }
15
- declare class SmpZodDateTime extends z.ZodType<DateTime, SmpZodDateTimeDef> {
16
- constructor(def?: Partial<SmpZodDateTimeDef>);
17
- _parse(input: ParseInput): ParseReturnType<DateTime>;
18
- between(min: DateTime, max: DateTime, message?: string): this;
19
- coerce(): this;
20
- max(max: DateTime, message?: string): this;
21
- min(min: DateTime, message?: string): this;
22
- private _coerceToDateTime;
23
- }
24
- declare const smpZodDateTime: (opts?: {
25
- coerce?: boolean;
26
- }) => SmpZodDateTime;
27
-
28
- export { SmpZodDateTime, smpZodDateTime };
@@ -1,470 +0,0 @@
1
- declare class WordArray {
2
- sigBytes: number;
3
- words: number[];
4
- /**
5
- * Initializes a newly created word array.
6
- *
7
- * @param words (Optional) An array of 32-bit words.
8
- * @param sigBytes (Optional) The number of significant bytes in the words.
9
- *
10
- * @example
11
- *
12
- * let wordArray = new WordArray();
13
- * let wordArray = new WordArray([0x00010203, 0x04050607]);
14
- * let wordArray = new WordArray([0x00010203, 0x04050607], 6);
15
- */
16
- constructor(words?: number[], sigBytes?: number);
17
- /**
18
- * Creates a word array filled with random bytes.
19
- *
20
- * @param nBytes The number of random bytes to generate.
21
- *
22
- * @return The random word array.
23
- *
24
- * @example
25
- *
26
- * let wordArray = WordArray.random(16);
27
- */
28
- static random(nBytes: number): WordArray;
29
- /**
30
- * Removes insignificant bits.
31
- *
32
- * @example
33
- *
34
- * wordArray.clamp();
35
- */
36
- clamp(): void;
37
- /**
38
- * Creates a copy of this word array.
39
- *
40
- * @return The clone.
41
- *
42
- * @example
43
- *
44
- * let clone = wordArray.clone();
45
- */
46
- clone(): WordArray;
47
- /**
48
- * Concatenates a word array to this word array.
49
- *
50
- * @param wordArray The word array to append.
51
- *
52
- * @return This word array.
53
- *
54
- * @example
55
- *
56
- * wordArray1.concat(wordArray2);
57
- */
58
- concat(wordArray: WordArray): WordArray;
59
- /**
60
- * Converts this word array to a string.
61
- *
62
- * @param encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
63
- *
64
- * @return The stringified word array.
65
- *
66
- * @example
67
- *
68
- * let string = wordArray + '';
69
- * let string = wordArray.toString();
70
- * let string = wordArray.toString(CryptoJS.enc.Utf8);
71
- */
72
- toString<T extends {
73
- stringify: (arg: WordArray) => string;
74
- }>(encoder?: T): string;
75
- }
76
-
77
- declare abstract class BlockCipherModeAlgorithm {
78
- __creator: ((cipher: BlockCipher, iv: number[]) => BlockCipherMode) | undefined;
79
- protected _cipher: BlockCipher;
80
- protected _iv: number[] | undefined;
81
- constructor(cipher: BlockCipher, iv: number[]);
82
- abstract processBlock(words: number[], offset: number): void;
83
- /**
84
- * Initializes a newly created mode.
85
- *
86
- * @param cipher A block cipher instance.
87
- * @param iv The IV words.
88
- *
89
- * @example
90
- *
91
- * var mode = CBC.Encryptor.create(cipher, iv.words);
92
- */
93
- init(cipher: BlockCipher, iv?: number[]): void;
94
- }
95
-
96
- declare abstract class BlockCipherMode {
97
- static Decryptor: any;
98
- static Encryptor: any;
99
- /**
100
- * Creates this mode for decryption.
101
- *
102
- * @param cipher A block cipher instance.
103
- * @param iv The IV words.
104
- *
105
- * @example
106
- *
107
- * const mode = CBC.createDecryptor(cipher, iv.words);
108
- */
109
- static createDecryptor(cipher: BlockCipher, iv: number[]): BlockCipherModeAlgorithm;
110
- /**
111
- * Creates this mode for encryption.
112
- *
113
- * @param cipher A block cipher instance.
114
- * @param iv The IV words.
115
- *
116
- * @example
117
- *
118
- * var mode = CBC.createEncryptor(cipher, iv.words);
119
- */
120
- static createEncryptor(cipher: BlockCipher, iv: number[]): BlockCipherModeAlgorithm;
121
- }
122
-
123
- declare abstract class AbstractPadding {
124
- static pad: (data: WordArray, blockSize: number) => void;
125
- static unpad: (data: WordArray) => void;
126
- }
127
- type Padding = typeof AbstractPadding;
128
-
129
- declare class CipherParams {
130
- algorithm?: typeof Cipher;
131
- blockSize?: number;
132
- ciphertext?: WordArray;
133
- formatter?: Formatter;
134
- iv?: WordArray;
135
- key?: WordArray | string;
136
- mode?: typeof BlockCipherMode;
137
- padding?: Padding;
138
- salt?: WordArray | string;
139
- /**
140
- * Initializes a newly created cipher params object.
141
- *
142
- * @param cipherParams An object with any of the possible cipher parameters.
143
- *
144
- * @example
145
- *
146
- * let cipherParams = CipherParams.create({
147
- * ciphertext: ciphertextWordArray,
148
- * key: keyWordArray,
149
- * iv: ivWordArray,
150
- * salt: saltWordArray,
151
- * algorithm: AES,
152
- * mode: CBC,
153
- * padding: PKCS7,
154
- * blockSize: 4,
155
- * formatter: OpenSSLFormatter
156
- * });
157
- */
158
- constructor(cipherParams: Omit<CipherParams, "extend" | "toString">);
159
- extend(additionalParams: CipherParams): CipherParams;
160
- /**
161
- * Converts this cipher params object to a string.
162
- *
163
- * @param formatter (Optional) The formatting strategy to use.
164
- *
165
- * @return The stringified cipher params.
166
- *
167
- * @throws Error If neither the formatter nor the default formatter is set.
168
- *
169
- * @example
170
- *
171
- * let string = cipherParams + '';
172
- * let string = cipherParams.toString();
173
- * let string = cipherParams.toString(CryptoJS.format.OpenSSL);
174
- */
175
- toString(formatter?: Formatter): string;
176
- }
177
-
178
- interface Formatter {
179
- stringify: (cipherParams: CipherParams) => string;
180
- parse: (paramsStr: string) => CipherParams;
181
- }
182
-
183
- declare abstract class AbstractKDF {
184
- static execute: (password: string, keySize: number, ivSize: number, salt?: WordArray | string) => CipherParams;
185
- abstract compute?(password: WordArray | string, salt: WordArray | string): WordArray;
186
- }
187
- type KDF = typeof AbstractKDF;
188
-
189
- interface BufferedBlockAlgorithmConfig {
190
- blockSize?: number;
191
- iv?: WordArray;
192
- format?: Formatter;
193
- kdf?: KDF;
194
- mode?: typeof BlockCipherMode;
195
- padding?: Padding;
196
- }
197
-
198
- declare abstract class BufferedBlockAlgorithm {
199
- cfg: BufferedBlockAlgorithmConfig;
200
- protected _data: WordArray;
201
- protected _minBufferSize: number;
202
- protected _nDataBytes: number;
203
- protected abstract _doProcessBlock(wordArray: number[], offset: number): void;
204
- constructor(cfg?: BufferedBlockAlgorithmConfig);
205
- /**
206
- * Creates a copy of this object.
207
- *
208
- * @return The clone.
209
- *
210
- * @example
211
- *
212
- * let clone = bufferedBlockAlgorithm.clone();
213
- */
214
- clone(): BufferedBlockAlgorithm;
215
- /**
216
- * Resets this block algorithm's data buffer to its initial state.
217
- *
218
- * @example
219
- *
220
- * bufferedBlockAlgorithm.reset();
221
- */
222
- reset(): void;
223
- /**
224
- * Adds new data to this block algorithm's buffer.
225
- *
226
- * @param data The data to append. Strings are converted to a WordArray using UTF-8.
227
- *
228
- * @example
229
- *
230
- * bufferedBlockAlgorithm._append('data');
231
- * bufferedBlockAlgorithm._append(wordArray);
232
- */
233
- protected _append(data: string | WordArray): void;
234
- /**
235
- * Processes available data blocks.
236
- *
237
- * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
238
- *
239
- * @param doFlush Whether all blocks and partial blocks should be processed.
240
- *
241
- * @return The processed data.
242
- *
243
- * @example
244
- *
245
- * let processedData = bufferedBlockAlgorithm._process();
246
- * let processedData = bufferedBlockAlgorithm._process(!!'flush');
247
- */
248
- protected _process(doFlush?: boolean): WordArray;
249
- }
250
-
251
- declare class CipherHelper {
252
- private readonly _cipher;
253
- constructor(_cipher: typeof Cipher);
254
- decrypt(ciphertext: CipherParams | string, key: WordArray | string, cfg?: BufferedBlockAlgorithmConfig): WordArray;
255
- encrypt(message: WordArray | string, key: WordArray | string, cfg?: BufferedBlockAlgorithmConfig): CipherParams;
256
- }
257
-
258
- declare abstract class Cipher extends BufferedBlockAlgorithm {
259
- /**
260
- * This cipher's IV size. Default: 4 (128 bits / 32 Bits)
261
- */
262
- static ivSize: number;
263
- /**
264
- * This cipher's key size. Default: 4 (128 bits / 32 Bits)
265
- */
266
- static keySize: number;
267
- /**
268
- * A constant representing decryption mode.
269
- */
270
- protected static readonly _DEC_XFORM_MODE = 2;
271
- /**
272
- * A constant representing encryption mode.
273
- */
274
- protected static readonly _ENC_XFORM_MODE = 1;
275
- /**
276
- * The key.
277
- */
278
- protected _key: WordArray;
279
- /**
280
- * Either the encryption or decryption transformation mode constant.
281
- */
282
- protected _xformMode: number;
283
- /**
284
- * Initializes a newly created cipher.
285
- *
286
- * @param xformMode Either the encryption or decryption transormation mode constant.
287
- * @param key The key.
288
- * @param cfg (Optional) The configuration options to use for this operation.
289
- *
290
- * @example
291
- *
292
- * let cipher = AES.create(AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray });
293
- */
294
- constructor(xformMode: number, key: WordArray, cfg?: BufferedBlockAlgorithmConfig);
295
- /**
296
- * Creates shortcut functions to a cipher's object interface.
297
- *
298
- * @param cipher The cipher to create a helper for.
299
- *
300
- * @return An object with encrypt and decrypt shortcut functions.
301
- *
302
- * @example
303
- *
304
- * const AES = Cipher._createHelper(AESAlgorithm);
305
- */
306
- static _createHelper(cipher: typeof Cipher): CipherHelper;
307
- /**
308
- * Creates this cipher in decryption mode.
309
- *
310
- * @param key The key.
311
- * @param cfg (Optional) The configuration options to use for this operation.
312
- *
313
- * @return A cipher instance.
314
- *
315
- * @example
316
- *
317
- * let cipher = AES.createDecryptor(keyWordArray, { iv: ivWordArray });
318
- */
319
- static createDecryptor(key: WordArray | string, cfg?: BufferedBlockAlgorithmConfig): Cipher;
320
- /**
321
- * Creates this cipher in encryption mode.
322
- *
323
- * @param key The key.
324
- * @param cfg (Optional) The configuration options to use for this operation.
325
- *
326
- * @return A cipher instance.
327
- *
328
- * @example
329
- *
330
- * let cipher = AES.createEncryptor(keyWordArray, { iv: ivWordArray });
331
- */
332
- static createEncryptor(key: WordArray | string, cfg?: BufferedBlockAlgorithmConfig): Cipher;
333
- /**
334
- * Finalizes the encryption or decryption process.
335
- * Note that the finalize operation is effectively a destructive, read-once operation.
336
- *
337
- * @param dataUpdate The final data to encrypt or decrypt.
338
- *
339
- * @return The data after final processing.
340
- *
341
- * @example
342
- *
343
- * var encrypted = cipher.finalize();
344
- * var encrypted = cipher.finalize('data');
345
- * var encrypted = cipher.finalize(wordArray);
346
- */
347
- finalize(dataUpdate?: WordArray | string): WordArray;
348
- /**
349
- * Adds data to be encrypted or decrypted.
350
- *
351
- * @param dataUpdate The data to encrypt or decrypt.
352
- *
353
- * @return The data after processing.
354
- *
355
- * @example
356
- *
357
- * let encrypted = cipher.process('data');
358
- * let encrypted = cipher.process(wordArray);
359
- */
360
- process(dataUpdate: WordArray | string): WordArray;
361
- /**
362
- * Cipher specific finalize function explicitly implemented in the derived class.
363
- */
364
- protected abstract _doFinalize(): WordArray;
365
- }
366
-
367
- declare abstract class BlockCipher extends Cipher {
368
- protected _mode: BlockCipherModeAlgorithm;
369
- constructor(xformMode: number, key: WordArray, cfg?: BufferedBlockAlgorithmConfig);
370
- abstract decryptBlock(M: number[], offset: number): void;
371
- abstract encryptBlock(M: number[], offset: number): void;
372
- reset(): void;
373
- protected _doFinalize(): WordArray;
374
- protected _doProcessBlock(words: number[], offset: number): void;
375
- }
376
-
377
- declare class CBCEncryptor extends BlockCipherModeAlgorithm {
378
- get prevBlock(): number[];
379
- protected _prevBlock: number[] | undefined;
380
- /**
381
- * Processes the data block at offset.
382
- *
383
- * @param words The data words to operate on.
384
- * @param offset The offset where the block starts.
385
- *
386
- * @example
387
- *
388
- * mode.processBlock(data.words, offset);
389
- */
390
- processBlock(words: number[], offset: number): void;
391
- xorBlock(words: number[], offset: number, blockSize: number): void;
392
- }
393
-
394
- declare class CBCDecryptor extends BlockCipherModeAlgorithm {
395
- get prevBlock(): number[];
396
- protected _prevBlock: number[] | undefined;
397
- /**
398
- * Processes the data block at offset.
399
- *
400
- * @param words The data words to operate on.
401
- * @param offset The offset where the block starts.
402
- *
403
- * @example
404
- *
405
- * mode.processBlock(data.words, offset);
406
- */
407
- processBlock(words: number[], offset: number): void;
408
- xorBlock(words: number[], offset: number, blockSize: number): void;
409
- }
410
-
411
- /**
412
- * Cipher Block Chaining mode.
413
- */
414
- declare abstract class CBC extends BlockCipherMode {
415
- static Decryptor: typeof CBCDecryptor;
416
- static Encryptor: typeof CBCEncryptor;
417
- }
418
-
419
- declare class PKCS7 implements AbstractPadding {
420
- /**
421
- * Pads data using the algorithm defined in PKCS #5/7.
422
- *
423
- * @param data The data to pad.
424
- * @param blockSize The multiple that the data should be padded to.
425
- *
426
- * @example
427
- *
428
- * PKCS7.pad(wordArray, 4);
429
- */
430
- static pad(data: WordArray, blockSize: number): void;
431
- /**
432
- * Unpads data that had been padded using the algorithm defined in PKCS #5/7.
433
- *
434
- * @param data The data to unpad.
435
- *
436
- * @example
437
- *
438
- * PKCS7.unpad(wordArray);
439
- */
440
- static unpad(data: WordArray): void;
441
- }
442
-
443
- declare class SmpAesCrypt {
444
- protected _password: string;
445
- protected _salt: string;
446
- protected _initVector?: string | undefined;
447
- protected get _iv(): WordArray | undefined;
448
- protected _mode: typeof CBC;
449
- protected _padding: typeof PKCS7;
450
- constructor(_password: string, _salt: string, _initVector?: string | undefined);
451
- /**
452
- * Decodes some data from a symmetric AES encryption
453
- * @param {string} data
454
- * @returns {string}
455
- */
456
- decryptAES(data: string): string;
457
- /**
458
- * Encodes some data with a symmetric AES encryption
459
- * @param {string} data
460
- * @returns {string}
461
- */
462
- encryptAES(data: string): string;
463
- /**
464
- * This is the default password generation used by Marketing Cloud in their AMPScript
465
- * @protected
466
- */
467
- protected _buildKey(): WordArray;
468
- }
469
-
470
- export { SmpAesCrypt as S, WordArray as W };
@@ -1,66 +0,0 @@
1
- type SmpLoggerMethodKeys = keyof SmpLoggerMethods;
2
-
3
- declare class SmpConsoleOnlyMethods {
4
- /**
5
- * Creates a new inline group in the Web Console log.
6
- * @param groupTitle An optional title for the group.
7
- */
8
- group: (groupTitle?: string) => void;
9
- /**
10
- * Creates a new inline group in the Web Console log that is initially collapsed.
11
- * @param groupTitle An optional title for the group.
12
- */
13
- groupCollapsed: (groupTitle?: string) => void;
14
- /**
15
- * Exits the current inline group in the Web Console.
16
- */
17
- groupEnd: () => void;
18
- /**
19
- * Starts a timer you can use to track how long an operation takes.
20
- * It works only with log {@link KikLoggingLevels} equal or higher than DEBUG.
21
- *
22
- * @param timerName The name to give the new timer. This will identify the timer.
23
- */
24
- time: (timerName?: string) => void;
25
- /**
26
- * Stops a timer that was previously started by calling {@link KikLoggingLevels.time}.
27
- * It works only with log {@link KikLoggingLevels} equal or higher than DEBUG.
28
- *
29
- * @param timerName The name of the timer to stop. Once stopped, the elapsed time is automatically displayed in the Web Console.
30
- */
31
- timeEnd: (timerName?: string) => void;
32
- }
33
- declare class SmpLoggerMethods extends SmpConsoleOnlyMethods {
34
- /**
35
- * Outputs a debugging message to the Web Console.
36
- * @param message A JavaScript string containing zero or more substitution strings.
37
- * @param optionalParams A list of JavaScript objects to output
38
- * OR JavaScript objects with which to replace substitution strings within message.
39
- */
40
- debug: (message?: any, ...optionalParams: any[]) => void;
41
- /**
42
- * Outputs an error message to the Web Console.
43
- * @param message A JavaScript string containing zero or more substitution strings.
44
- * @param optionalParams A list of JavaScript objects to output
45
- * OR JavaScript objects with which to replace substitution strings within message.
46
- */
47
- error: (message?: any, ...optionalParams: any[]) => void;
48
- /**
49
- * Outputs an informational message to the Web Console.
50
- * @param message A JavaScript string containing zero or more substitution strings.
51
- * @param optionalParams A list of JavaScript objects to output
52
- * OR JavaScript objects with which to replace substitution strings within message.
53
- */
54
- info: (message?: any, ...optionalParams: any[]) => void;
55
- /**
56
- * Outputs a message to the Web Console.
57
- * @param message A JavaScript string containing zero or more substitution strings.
58
- * @param optionalParams A list of JavaScript objects to output
59
- * OR JavaScript objects with which to replace substitution strings within message.
60
- */
61
- log: (message?: any, ...optionalParams: any[]) => void;
62
- warn: (message?: any, ...optionalParams: any[]) => void;
63
- static describe(): SmpLoggerMethodKeys[];
64
- }
65
-
66
- export { SmpLoggerMethods as S };
@@ -1 +0,0 @@
1
- import{a as i}from"./chunk-RCI7NEJO.js";import{a as s}from"./chunk-EI7MMDWY.js";var o=class{static{s(this,"SmpApiCommonUtils")}static _javascriptVariablePattern="[a-zA-Z_$][a-zA-Z_$0-9]*";static _logger=new i;static _pathParamRegex=new RegExp(`\\{(${this._javascriptVariablePattern})\\}`,"g");static credentialsToBasicAuth(t,e){return`Basic ${Buffer.from(`${t}:${e}`).toString("base64")}`}static fromBearer(t=""){return t.split(" ")[1]}static getCountryFromReferer(t){return this.getLocaleFromReferer(t)?.split("-")[0]?.toUpperCase()}static getLanguageFromReferer(t){return this.getLocaleFromReferer(t)?.split("-")[1]}static getLocaleFromReferer(t){return t?.match(/\/([A-Z]{2}-[A-Z]{2})\//i)?.[1]}static interpolateParams(t,e){try{return t.replace(this._pathParamRegex,(r,c)=>{let a=e[c];return a!==void 0?encodeURIComponent(a):r})}catch(r){this._logger.warn(`${this.constructor.name}: couldn't interpolate params`,r)}return t}};export{o as a};
@@ -1 +0,0 @@
1
- import{a as l}from"./chunk-RCI7NEJO.js";import{a}from"./chunk-EI7MMDWY.js";import{DynamoDB as c}from"@aws-sdk/client-dynamodb";import{marshall as m,unmarshall as h}from"@aws-sdk/util-dynamodb";var _=(function(r){return r.CouldNotDelete="ERR_COULD_NOT_DELETE",r.CouldNotRead="ERR_COULD_NOT_READ",r.CouldNotWrite="ERR_COULD_NOT_WRITE",r.ConditionalCheckFailedException="ERR_DUPE_TOKEN",r})(_||{}),s=class{static{a(this,"SmpDynamoService")}_config;_tableName;get marshall(){return m}get unmarshall(){return h}_db=new c([this._buildConfig()]);_logger=new l;constructor(e,o){this._config=e,this._tableName=o}_buildConfig(){return this._config}_delete(e,o=this._tableName,i){let n={TableName:o,Key:this.marshall(e),...i};return this._db.deleteItem(n).catch(t=>(this._logger.error("DynamoActionTokensService: couldn't write token to DB",t),Promise.reject(_[t.code]||"ERR_COULD_NOT_DELETE")))}_read(e,o=this._tableName,i){let n={TableName:o,Key:this.marshall(e),...i};return this._db.getItem(n).catch(t=>(this._logger.error("DynamoActionTokensService: couldn't write token to DB",t),Promise.reject(_[t.code]||"ERR_COULD_NOT_READ")))}_write(e,o=this._tableName,i){let n={TableName:o,Item:this.marshall(e),...i};return this._db.putItem(n).catch(t=>(this._logger.error("DynamoActionTokensService: couldn't write token to DB",t),Promise.reject(_[t.code]||"ERR_COULD_NOT_WRITE")))}};export{s as a};
File without changes
@@ -1 +0,0 @@
1
- import{a as t}from"./chunk-ZNC4KYAS.js";import{a as s}from"./chunk-EI7MMDWY.js";var r=class{static{s(this,"SmpConsoleOnlyMethods")}constructor(){this.group=t,this.groupCollapsed=t,this.groupEnd=t,this.time=t,this.timeEnd=t}},h=class e extends r{static{s(this,"SmpLoggerMethods")}constructor(){super(...arguments),this.debug=t,this.error=t,this.info=t,this.log=t,this.warn=t}static describe(){return Object.getOwnPropertyNames(new e).map(o=>o)}};export{h as a};
@@ -1 +0,0 @@
1
- import{a as n}from"./chunk-JXSMI3MI.js";import{a as s}from"./chunk-TGY6ZSQU.js";import{a as o}from"./chunk-RAVJJJYE.js";import{a as d}from"./chunk-RCI7NEJO.js";import{a}from"./chunk-EI7MMDWY.js";import{getApps as l,initializeApp as g}from"firebase/app";import{browserLocalPersistence as u,browserSessionPersistence as p,EmailAuthProvider as _,FacebookAuthProvider as m,GoogleAuthProvider as f,OAuthProvider as P,checkActionCode as U,confirmPasswordReset as E,fetchSignInMethodsForEmail as b,getAuth as w,getRedirectResult as S,reauthenticateWithCredential as I,sendEmailVerification as F,sendPasswordResetEmail as A,setPersistence as C,signInWithCustomToken as v,signInWithEmailAndPassword as R,signInWithPopup as L,signInWithRedirect as O,signOut as T,updatePassword as k,updateProfile as y}from"firebase/auth";var c=class h{static{a(this,"SmpFirebaseService")}static get INSTANCE(){if(!(this._instance instanceof h))throw Error(`${this.constructor.name} instance doesn't exist! Call ${this.constructor.name}.init first!`);return this._instance}static _instance;get config(){return this._config}get enabledSocials(){return this._enabledSocials}get loggedUser(){return this._loggedUser||(this._loggedUser=this._readStoredUser()),this._auth.currentUser||this._loggedUser||void 0}get providersRelation(){return{"facebook.com":s.FACEBOOK,"google.com":s.GOOGLE,"apple.com":s.APPLE}}get socialLoginUXMode(){return this._socialLoginUxMode}get storedUserKey(){return"firebaseUser"}get _auth(){return w(this._app)}_app;_config;_enabledSocials=[];_loggedUser;_logger;_popupErrors=0;_popupFallsBackToRedirect;_providers;_socialLoginUxMode=o.POPUP;constructor(e,t){this._config=e,this._enabledSocials=t.enabledSocials||[],this._socialLoginUxMode=t.socialLoginUxMode||o.POPUP,this._popupFallsBackToRedirect=!!t.popupFallsBackToRedirect,this._buildProviders(),this._logger=t.logger||new d,this._app=l().length?l()[0]:g(e),this._watchAuthState()}static init(e,t){return this._instance||(this._instance=new h(e,t)),this._instance}addAuthStateChangedCallback(e){return this._auth.onAuthStateChanged(t=>{e(t||this.loggedUser||null)})}checkActionCode(e){return U(this._auth,e)}confirmPasswordReset(e,t){return E(this._auth,e,t)}fetchSignInMethodsForEmail(e){return b(this._auth,e).then(t=>t.map(r=>this.providersRelation[r]||r))}getRedirectResult(){return S(this._auth).catch(async e=>(await this._expandDifferentCredential(e),Promise.reject(e)))}initAppCheck(){}sendEmailVerification(e){if(!this.loggedUser)throw Error("Firebase: user is not logged!");return F(this.loggedUser,e?{url:e}:void 0)}sendPasswordResetEmail(e,t){return A(this._auth,e,{url:t})}setPersistence(e){return C(this._auth,e?u:p)}signInWithCustomToken(e){return v(this._auth,e)}signInWithEmailAndPassword(e,t){return R(this._auth,e,t).then(async r=>r.user)}signInWithSocialProvider(e){if(!this._providers[e])throw Error(`Firebase: invalid social key provided! Expected one of ${this.enabledSocials}, got ${e}`);return this._signInWithProvider(this._providers[e])}signOut(){return T(this._auth)}updatePassword(e,t){if(!this.loggedUser)throw Error("Firebase: user is not logged!");let r=_.credential(this.loggedUser.email,e);return I(this.loggedUser,r).then(()=>k(this.loggedUser,t))}updateUserProfile(e){if(!this.loggedUser)throw Error("Firebase: user is not logged!");return y(this.loggedUser,e)}async verifyIdToken(){return this._auth.currentUser?.getIdTokenResult()}_buildProviders(){this._providers=this._enabledSocials.reduce((e,t)=>(t in e&&(e[t]=e[t]),e),{[s.APPLE]:new P("apple.com"),[s.FACEBOOK]:new m().setCustomParameters({prompt:"select_account"}),[s.GOOGLE]:new f().setCustomParameters({prompt:"select_account"})})}async _expandDifferentCredential(e){if(e?.code===n.DIFFERENT_CREDENTIAL){let t=await this.fetchSignInMethodsForEmail(e.customData.email);throw e.code=n["DIFFERENT_CREDENTIAL_"+t[0]],e}}_readStoredUser(){try{let e=localStorage.getItem(this.storedUserKey);if(e){this._logger?.debug("Firebase: found local user",e);let t=JSON.parse(e);return{...t,getIdToken:a(()=>Promise.resolve(t.stsTokenManager.accessToken),"getIdToken")}}}catch(e){this._logger.debug("Firebase: error while getting stored user",e)}}async _signInWithProvider(e,t=this.socialLoginUXMode){return(t===o.POPUP?L:O)(this._auth,e).then(i=>(this._logger.info(`Firebase: signin with provider ${e.providerId} was successful`),i.user)).catch(async i=>i?.code===n.POPUP_BLOCKED&&(this._logger.warn(`Firebase: social signin popup blocked (${++this._popupErrors}`),this._popupFallsBackToRedirect&&this._popupErrors>1)?(this._popupErrors=0,this._signInWithProvider(e,o.REDIRECT)):(this._logger.error(`Firebase: sign in with ${e.providerId} errored`,i),await this._expandDifferentCredential(i),Promise.reject(i)))}_updateLocalUser(e){try{e?localStorage.setItem(this.storedUserKey,JSON.stringify(e)):localStorage.removeItem(this.storedUserKey),this._logger.debug("Firebase: updating local user",e),this._loggedUser=e}catch(t){this._logger.warn("Firebase: couldn't update local user",{user:e,error:t})}}_watchAuthState(){this._auth.onAuthStateChanged(e=>{this._logger.debug("Firebase: firebase detected auth state change",e),this._updateLocalUser(e||void 0)})}};export{c as a};
@@ -1 +0,0 @@
1
- import{a as o}from"./chunk-EI7MMDWY.js";function n(){}o(n,"smpNoop");export{n as a};