@tonysamperi/ts-mapi-core 1.8.0 → 2.0.0-beta.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 (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 +38 -14
  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,256 +1,11 @@
1
- import z, { ZodTypeDef, ParseInput, ParseReturnType } from 'zod';
2
- import { DateTime } from 'ts-luxon';
3
- import { Observable, ObservableInput, OperatorFunction, ObservedValueOf } from 'rxjs';
1
+ import { S as SmpAbstractCacheStrategy, a as SmpCachedValue } from './smp-cached-value.interface-BdPg-J7L.cjs';
4
2
  import { SmpLoggerMethods } from '@tonysamperi/logger';
5
3
  export { smpNoop } from '@tonysamperi/logger';
6
- import { FirebaseOptions, FirebaseApp } from 'firebase/app';
7
- import { User, Auth, AuthProvider, ActionCodeInfo, UserCredential, IdTokenResult } from 'firebase/auth';
8
- import * as _aws_sdk_util_dynamodb from '@aws-sdk/util-dynamodb';
9
- import { marshall } from '@aws-sdk/util-dynamodb';
10
- import * as _aws_sdk_client_dynamodb from '@aws-sdk/client-dynamodb';
11
- import { DynamoDBClientConfig, DynamoDB, DeleteItemInput, GetItemInput, PutItemInput } from '@aws-sdk/client-dynamodb';
12
-
13
- interface SmpZodDateTimeCheck {
14
- kind: "min" | "max" | "between";
15
- min?: DateTime;
16
- max?: DateTime;
17
- message?: string;
18
- }
19
- interface SmpZodDateTimeDef extends ZodTypeDef {
20
- coerce: boolean;
21
- checks: SmpZodDateTimeCheck[];
22
- typeName: "SmpZodDateTime";
23
- }
24
- declare class SmpZodDateTime$1 extends z.ZodType<DateTime, SmpZodDateTimeDef> {
25
- constructor(def?: Partial<SmpZodDateTimeDef>);
26
- _parse(input: ParseInput): ParseReturnType<DateTime>;
27
- between(min: DateTime, max: DateTime, message?: string): this;
28
- coerce(): this;
29
- max(max: DateTime, message?: string): this;
30
- min(min: DateTime, message?: string): this;
31
- private _coerceToDateTime;
32
- }
33
- declare const smpZodDateTime$1: (opts?: {
34
- coerce?: boolean;
35
- }) => SmpZodDateTime$1;
36
-
37
- /**
38
- * Abstract class representing a caching strategy. This class is intended to be extended by concrete implementations
39
- * and provides an interface for performing common caching operations such as reading, writing, removing, and flushing cache entries.
40
- * You shouldn't need to implement this: you can go with SmpAbstractTtlCacheStrategy or SmpRxjsAbstractCacheStrategy, depending on what type of cache you want to implement.
41
- * For instance, for a local cache, you may stay sync, while for a Valkey cache, you should start with the rxjs.
42
- */
43
- declare abstract class SmpAbstractCacheStrategy {
44
- abstract read<T = unknown>(key: string): T | undefined | Observable<T | undefined>;
45
- abstract write<T = unknown>(key: string, value: T, ttl?: number): void | Observable<void>;
46
- abstract remove(key: string): void | Observable<void>;
47
- abstract flush(): void | Observable<void>;
48
- }
49
-
50
- interface SmpCachedValue<T = any> {
51
- value: T;
52
- expiry: number;
53
- }
54
-
55
- declare abstract class SmpAbstractRxjsTtlCacheStrategy$1 extends SmpAbstractCacheStrategy {
56
- protected abstract _flushRaw(): Observable<void>;
57
- protected abstract _readRaw(key: string): Observable<unknown | undefined>;
58
- protected abstract _removeRaw(key: string): Observable<void>;
59
- protected abstract _writeRaw(key: string, value: unknown, ttl?: number): Observable<void>;
60
- flush(): Observable<void>;
61
- read<T = unknown>(key: string): Observable<T | undefined>;
62
- remove(key: string): Observable<void>;
63
- write<T = unknown>(key: string, value: T, ttl?: number): Observable<void>;
64
- protected _isSmpCachedValue<T>(value: unknown): value is SmpCachedValue<T>;
65
- }
66
-
67
- declare function smpRxjsCatchOnly$1<T, E extends Error, O extends ObservableInput<any>>(errorFilter: (new (...args: any[]) => E) | ((err: unknown) => boolean), selector: (err: E) => O): OperatorFunction<T, T | ObservedValueOf<O>>;
68
-
69
- declare class SmpRxjsInMemoryCache$1 extends SmpAbstractRxjsTtlCacheStrategy$1 {
70
- private static _storage;
71
- protected get _staticSelf(): typeof SmpRxjsInMemoryCache$1;
72
- protected _flushRaw(): Observable<void>;
73
- protected _readRaw(key: string): Observable<unknown | undefined>;
74
- protected _removeRaw(key: string): Observable<void>;
75
- protected _writeRaw(key: string, value: unknown): Observable<void>;
76
- }
77
-
78
- type ObsFnMap = Record<string, () => Observable<any>>;
79
- declare function smpRxjsQueue$1<T extends any[]>(source: {
80
- [K in keyof T]: () => Observable<T[K]>;
81
- }): Observable<T>;
82
- declare function smpRxjsQueue$1<T extends ObsFnMap>(source: T): Observable<{
83
- [K in keyof T]: T[K] extends () => Observable<infer U> ? U : never;
84
- }>;
85
-
86
- /**
87
- * Old version of the sequence. Now rewritten using recursion, which is way faster.
88
- * But you can use this if you want to stick with the rxjs pattern
89
- * @param steps
90
- */
91
- declare function smpRxjsSequence$1<T extends any[]>(steps: {
92
- [K in keyof T]: () => Observable<T[K]>;
93
- }): Observable<T>;
94
-
95
- /**
96
- * If the source observable completes emitting an empty value (empty array or object will be considered empty), it will emit
97
- * an error. The error will be created at that time by the optional
98
- * `errorFactory` argument, otherwise, the error will be {@link Error}.
99
- *
100
- * ## Example
101
- *
102
- * Throw an error if the query didn't match anything
103
- *
104
- * ```ts
105
- * import { of, takeUntil, timer, throwIfEmpty } from 'rxjs';
106
- *
107
- * const query$ = of([]);
108
- *
109
- * query$.pipe(
110
- * smpRxjsThrowIfEmpty(() => new Error('The query had no results'))
111
- * )
112
- * .subscribe({
113
- * next() {
114
- * console.log("The query had results");
115
- * },
116
- * error(err) {
117
- * console.error(err.message);
118
- * }
119
- * });
120
- * ```
121
- *
122
- * @param errorFactory A factory function called to produce the
123
- * error to be thrown when the source observable completes without emitting a
124
- * value.
125
- * @return A function that returns an Observable that throws an error if the
126
- * source Observable completed without emitting.
127
- */
128
- declare function smpRxjsThrowIfEmpty$1<T>(errorFactory?: (value: T) => any): OperatorFunction<T, T>;
129
-
130
- /**
131
- * Custom RxJS operator that filters the source observable based on a condition
132
- * and throws an error if the resulting observable is empty.
133
- *
134
- * @template T The type of items emitted by the source observable.
135
- * @param {function(T): boolean} condition - A function that takes a value from the source observable and returns a boolean.
136
- * If the function returns `true`, the value will be emitted; otherwise, it will be filtered out.
137
- * @param {function(): Error} [errorFactory] - An optional function that returns an error to be thrown if the resulting observable is empty.
138
- * If not provided, a default error will be thrown.
139
- * @returns {OperatorFunction<T, T>} An operator function that can be used in the RxJS pipeline.
140
- *
141
- * @example
142
- * import { of } from 'rxjs';
143
- * import { smpRxjsThrowOnCondition } from "./path-to-your-file";
144
- *
145
- * const source$ = of(1, 5, -3, 7, 12).pipe(
146
- * smpRxjsThrowOnCondition(value => value >= 0, () => new Error("Value is less than 0")),
147
- * smpRxjsThrowOnCondition(value => value > 12, () => new Error("Value is lower than 12"))
148
- * );
149
- *
150
- * source$.subscribe({
151
- * next: value => console.log("Value:", value),
152
- * error: err => console.error("Error:", err)
153
- * });
154
- */
155
- declare function smpRxjsThrowOnCondition$1<T>(condition: (value: T) => boolean, errorFactory?: () => any): OperatorFunction<T, T>;
156
-
157
- declare enum SmpSocialSignInKeys {
158
- APPLE = "APPLE",
159
- FACEBOOK = "FACEBOOK",
160
- GOOGLE = "GOOGLE"
161
- }
162
-
163
- declare enum SmpSocialSignInUxModes {
164
- POPUP = "POPUP",
165
- REDIRECT = "REDIRECT"
166
- }
167
-
168
- interface SmpFirebaseServiceConfig {
169
- enabledSocials?: SmpSocialSignInKeys[];
170
- logger?: SmpLoggerMethods;
171
- popupFallsBackToRedirect?: boolean;
172
- socialLoginUxMode?: SmpSocialSignInUxModes;
173
- }
174
-
175
- declare class SmpFirebaseService$1 {
176
- static get INSTANCE(): SmpFirebaseService$1;
177
- protected static _instance?: SmpFirebaseService$1;
178
- get config(): FirebaseOptions;
179
- get enabledSocials(): SmpSocialSignInKeys[];
180
- get loggedUser(): User | void;
181
- get providersRelation(): Record<string, SmpSocialSignInKeys>;
182
- get socialLoginUXMode(): SmpSocialSignInUxModes;
183
- get storedUserKey(): string;
184
- protected get _auth(): Auth;
185
- protected readonly _app: FirebaseApp;
186
- protected readonly _config: FirebaseOptions;
187
- protected readonly _enabledSocials: SmpSocialSignInKeys[];
188
- protected _loggedUser?: User | void;
189
- protected _logger: SmpLoggerMethods;
190
- protected _popupErrors: number;
191
- protected _popupFallsBackToRedirect: boolean;
192
- protected _providers: Record<SmpSocialSignInKeys, AuthProvider>;
193
- protected _socialLoginUxMode: SmpSocialSignInUxModes;
194
- constructor(firebaseOptions: FirebaseOptions, config: SmpFirebaseServiceConfig);
195
- static init(firebaseOptions: FirebaseOptions, config: SmpFirebaseServiceConfig): SmpFirebaseService$1;
196
- addAuthStateChangedCallback(cb: (userOrNull: User | null) => void): () => void;
197
- checkActionCode(code: string): Promise<ActionCodeInfo>;
198
- confirmPasswordReset(code: string, newPassword: string): Promise<void>;
199
- fetchSignInMethodsForEmail(email: string): Promise<SmpSocialSignInKeys[] | "password">;
200
- getRedirectResult(): Promise<UserCredential | null>;
201
- initAppCheck(): void;
202
- sendEmailVerification(url?: string): Promise<void> | never;
203
- sendPasswordResetEmail(email: string, continueUrl: string): Promise<void>;
204
- setPersistence(rememberMe: boolean): Promise<void>;
205
- signInWithCustomToken(customToken: string): Promise<UserCredential>;
206
- signInWithEmailAndPassword(email: string, password: string): Promise<User>;
207
- signInWithSocialProvider(key: SmpSocialSignInKeys): Promise<User | void>;
208
- signOut(): Promise<void>;
209
- updatePassword(oldPassword: string, newPassword: string): Promise<void>;
210
- updateUserProfile(params: {
211
- displayName?: string | null;
212
- photoURL?: string | null;
213
- }): Promise<void>;
214
- verifyIdToken(): Promise<IdTokenResult | void>;
215
- protected _buildProviders(): void;
216
- protected _expandDifferentCredential(err: any): Promise<void>;
217
- protected _readStoredUser(): User | void;
218
- protected _signInWithProvider<T extends AuthProvider = AuthProvider>(provider: T, uxMode?: SmpSocialSignInUxModes): Promise<User | void>;
219
- protected _updateLocalUser(user: User | void): void;
220
- protected _watchAuthState(): void;
221
- }
222
-
223
- declare class SmpDynamoService$1<BaseKey extends object = object, PartitionKey extends string = string> {
224
- protected _config: DynamoDBClientConfig;
225
- protected _tableName: string;
226
- get marshall(): typeof marshall;
227
- get unmarshall(): (data: Record<string, _aws_sdk_client_dynamodb.AttributeValue> | _aws_sdk_client_dynamodb.AttributeValue, options?: _aws_sdk_util_dynamodb.unmarshallOptions) => Record<string, _aws_sdk_util_dynamodb.NativeAttributeValue>;
228
- protected _db: DynamoDB;
229
- protected _logger: SmpLoggerMethods;
230
- protected constructor(_config: DynamoDBClientConfig, _tableName: string);
231
- /**
232
- * Just for override purposes
233
- * @protected
234
- */
235
- protected _buildConfig(): DynamoDBClientConfig;
236
- protected _delete<T extends Record<PartitionKey, string> = Record<PartitionKey, string>>(Key: T, TableName?: string, opts?: Omit<DeleteItemInput, "Key" | "TableName">): Promise<_aws_sdk_client_dynamodb.DeleteItemCommandOutput>;
237
- /**
238
- * Read data from Dynamo passing a normal object
239
- * @param Key the index you're searching, as standard object es. {myPartitionKey: "someValue"}
240
- * @param TableName optionally override the table you're writing to
241
- * @param opts attribute names mapping, values, etc...
242
- * @protected
243
- */
244
- protected _read<T extends Record<PartitionKey, string> = Record<PartitionKey, string>>(Key: T, TableName?: string, opts?: Omit<GetItemInput, "TableName" | "Item">): Promise<_aws_sdk_client_dynamodb.GetItemCommandOutput>;
245
- /**
246
- * Write data to Dynamo passing a normal object
247
- * @param Item
248
- * @param TableName
249
- * @param opts
250
- * @protected
251
- */
252
- protected _write<T extends BaseKey = BaseKey>(Item: T, TableName: string | undefined, opts: Omit<PutItemInput, "Item" | "TableName">): Promise<_aws_sdk_client_dynamodb.PutItemCommandOutput>;
253
- }
4
+ import { S as SmpResponseMessage, a as SmpGenericResponseBase } from './smp-generic-response-base.interface-D0jHrkjw.cjs';
5
+ export { b as SmpResponseMessageBase, c as SmpResponseMessageTypes } from './smp-generic-response-base.interface-D0jHrkjw.cjs';
6
+ export { S as SmpSocialSignInKeys, a as SmpSocialSignInUxModes } from './smp-social-sign-in-ux-modes.enum-Cw9H3EqT.cjs';
7
+ import { DateTime } from 'ts-luxon';
8
+ import 'rxjs';
254
9
 
255
10
  declare abstract class SmpAbstractTtlCacheStrategy extends SmpAbstractCacheStrategy {
256
11
  protected abstract _flushRaw(): void;
@@ -280,27 +35,6 @@ declare class SmpApiCommonUtils {
280
35
  static interpolateParams(urlTemplate: string, params: Record<string, string | number | boolean>): string;
281
36
  }
282
37
 
283
- declare enum SmpResponseMessageTypes {
284
- INFO = "INFO",
285
- SUCCESS = "SUCCESS",
286
- WARNING = "WARNING",
287
- ERROR = "ERROR"
288
- }
289
-
290
- interface SmpResponseMessageBase {
291
- message: string;
292
- type: SmpResponseMessageTypes;
293
- }
294
-
295
- declare class SmpResponseMessage implements SmpResponseMessageBase {
296
- protected _message: string;
297
- protected _type: SmpResponseMessageTypes;
298
- get message(): string;
299
- get type(): SmpResponseMessageTypes;
300
- constructor(_message: string, _type?: SmpResponseMessageTypes);
301
- static sanitizeMessages(messages: string | SmpResponseMessage | (SmpResponseMessage | string)[]): SmpResponseMessage[];
302
- }
303
-
304
38
  type ResponseMessageUnion = string | SmpResponseMessage;
305
39
  interface SmpErrorResponseCreateOpts<T> {
306
40
  messages: ResponseMessageUnion | ResponseMessageUnion[];
@@ -309,11 +43,6 @@ interface SmpErrorResponseCreateOpts<T> {
309
43
  data: T;
310
44
  }
311
45
 
312
- interface SmpGenericResponseBase<T = any> {
313
- data?: T;
314
- messages: SmpResponseMessageBase[] | void;
315
- }
316
-
317
46
  declare class SmpGenericResponse<T, U = SmpGenericResponseBase> implements SmpGenericResponseBase<T> {
318
47
  protected _messages: SmpResponseMessage[];
319
48
  data?: T | undefined;
@@ -1269,18 +998,6 @@ declare class SmpInMemoryCache extends SmpAbstractTtlCacheStrategy {
1269
998
  */
1270
999
  declare function smpIsSmpCachedValue<T>(value: unknown): value is SmpCachedValue<T>;
1271
1000
 
1272
- declare const VERSION: "1.8.0";
1273
-
1274
- declare const SmpDynamoService: typeof SmpDynamoService$1;
1275
- declare const SmpFirebaseService: typeof SmpFirebaseService$1;
1276
- declare const SmpAbstractRxjsTtlCacheStrategy: typeof SmpAbstractRxjsTtlCacheStrategy$1;
1277
- declare const SmpRxjsInMemoryCache: typeof SmpRxjsInMemoryCache$1;
1278
- declare const smpRxjsCatchOnly: typeof smpRxjsCatchOnly$1;
1279
- declare const smpRxjsQueue: typeof smpRxjsQueue$1;
1280
- declare const smpRxjsSequence: typeof smpRxjsSequence$1;
1281
- declare const smpRxjsThrowIfEmpty: typeof smpRxjsThrowIfEmpty$1;
1282
- declare const smpRxjsThrowOnCondition: typeof smpRxjsThrowOnCondition$1;
1283
- declare const smpZodDateTime: typeof smpZodDateTime$1;
1284
- declare const SmpZodDateTime: typeof SmpZodDateTime$1;
1001
+ declare const VERSION: "2.0.0-beta.0";
1285
1002
 
1286
- export { SMP_HEALTHZ, SmpAbstractCacheStrategy, SmpAbstractRxjsTtlCacheStrategy, SmpAbstractTtlCacheStrategy, SmpAesCrypt, SmpApiCommonUtils, SmpBaseJwtToken, SmpBaseJwtTokenPlain, SmpBrowserCache, type SmpCachedValue, SmpCommonUtils, SmpCrypto, SmpDynamoService, SmpErrorResponse, type SmpErrorResponseCreateOpts, SmpFilterException, SmpFirebaseErrors, SmpFirebaseService, type SmpFirebaseServiceConfig, type SmpGenericConstructor, SmpGenericResponse, type 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, type SmpResponseMessageBase, SmpResponseMessageTypes, SmpRestVerbs, SmpRxjsInMemoryCache, SmpSecureCode, SmpSid, SmpSocialSignInKeys, SmpSocialSignInUxModes, SmpZodDateTime, VERSION, smpApplyMixin, smpIsSmpCachedValue, smpRxjsCatchOnly, smpRxjsQueue, smpRxjsSequence, smpRxjsThrowIfEmpty, smpRxjsThrowOnCondition, smpZodDateTime };
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 };
@@ -0,0 +1,2 @@
1
+ "use strict";var f=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var o=(t,r)=>f(t,"name",{value:r,configurable:!0});var C=(t,r)=>{for(var e in r)f(t,e,{get:r[e],enumerable:!0})},N=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of E(r))!b.call(t,s)&&s!==e&&f(t,s,{get:()=>r[s],enumerable:!(n=j(r,s))||n.enumerable});return t};var O=t=>N(f({},"__esModule",{value:!0}),t);var D={};C(D,{SmpAbstractRxjsTtlCacheStrategy:()=>a,SmpRxjsInMemoryCache:()=>_,smpRxjsCatchOnly:()=>I,smpRxjsQueue:()=>T,smpRxjsSequence:()=>V,smpRxjsThrowIfEmpty:()=>x,smpRxjsThrowOnCondition:()=>M});module.exports=O(D);var R=require("rxjs"),l=require("ts-luxon");var c=class{static{o(this,"SmpAbstractCacheStrategy")}};function y(t){return typeof t=="object"&&t!==null&&"value"in t&&"expiry"in t&&typeof t.expiry=="number"}o(y,"smpIsSmpCachedValue");var a=class extends c{static{o(this,"SmpAbstractRxjsTtlCacheStrategy")}flush(){return this._flushRaw()}read(r){return this._readRaw(r).pipe((0,R.map)(e=>{if(this._isSmpCachedValue(e)){if(e.expiry>=l.DateTime.now().ts)return e.value;this._removeRaw(r).subscribe();return}return e}))}remove(r){return this._removeRaw(r)}write(r,e,n){if(isNaN(+n)||+n<=0)return this._writeRaw(r,e,n);let s=l.DateTime.now().ts+n*1e3,w={value:e,expiry:s};return this._writeRaw(r,w,n)}_isSmpCachedValue(r){return y(r)}};var m=require("rxjs");function I(t,r){return e=>e.pipe((0,m.catchError)(n=>(typeof t==typeof isNaN?v(t)?A(n,t):t(n):!1)?r(n):(0,m.throwError)(()=>n)))}o(I,"smpRxjsCatchOnly");function v(t){try{return Reflect.construct(String,[],t),!0}catch{return!1}}o(v,"isConstructor");function A(t,r){return typeof t=="object"&&t!==null&&t.constructor===r}o(A,"isExactInstance");var i=require("rxjs");var _=class extends a{static{o(this,"SmpRxjsInMemoryCache")}static _storage=new Map;get _staticSelf(){return this.constructor}_flushRaw(){return(0,i.defer)(()=>(this._staticSelf._storage.clear(),(0,i.of)(void 0)))}_readRaw(r){return(0,i.defer)(()=>(0,i.of)(this._staticSelf._storage.get(r)))}_removeRaw(r){return(0,i.defer)(()=>(this._staticSelf._storage.delete(r),(0,i.of)(void 0)))}_writeRaw(r,e){return(0,i.defer)(()=>(this._staticSelf._storage.set(r,e),(0,i.of)(void 0)))}};var p=require("rxjs");function d(t){let r=[];function e(n){return n>=t.length?(0,p.of)(r):(0,p.defer)(()=>t[n]()).pipe((0,p.switchMap)(s=>(r[n]=s,e(n+1))))}return o(e,"runStep"),e(0)}o(d,"smpRxjsSequence");function T(t){if(Array.isArray(t))return d(t);{let r=Object.keys(t),e=r.map(n=>t[n]);return d(e).pipe((0,p.map)(n=>{let s={};return r.forEach((w,g)=>{s[w]=n[g]}),s}))}}o(T,"smpRxjsQueue");var u=require("rxjs");function V(t){return(0,u.from)(t).pipe((0,u.concatMap)(e=>e()),(0,u.toArray)())}o(V,"smpRxjsSequence");var S=require("rxjs");function x(t=J){return r=>r.pipe((0,S.map)(e=>{if(~q.indexOf(JSON.stringify(e)))throw t(e);return e}))}o(x,"smpRxjsThrowIfEmpty");var q=[void 0,null,!1,0,"","0",[],{}].map(t=>JSON.stringify(t)),J=o(()=>new Error,"defaultErrorFactory");var h=require("rxjs");function M(t,r){return e=>e.pipe((0,h.filter)(n=>!t(n)),(0,h.defaultIfEmpty)(!1),x(r))}o(M,"smpRxjsThrowOnCondition");0&&(module.exports={SmpAbstractRxjsTtlCacheStrategy,SmpRxjsInMemoryCache,smpRxjsCatchOnly,smpRxjsQueue,smpRxjsSequence,smpRxjsThrowIfEmpty,smpRxjsThrowOnCondition});
2
+ //# sourceMappingURL=rxjs.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/rxjs.ts","../../src/shared/rxjs/smp-abstract-rxjs-ttl-cache-strategy.class.ts","../../src/shared/utils/cache/smp-abstract-cache-strategy.class.ts","../../src/shared/utils/cache/smp-is-smp-cached-value.function.ts","../../src/shared/rxjs/smp-rxjs-catch-only.function.ts","../../src/shared/rxjs/smp-rxjs-in-memory-cache.class.ts","../../src/shared/rxjs/smp-rxjs-queue.function.ts","../../src/shared/rxjs/smp-rxjs-sequence.function.ts","../../src/shared/rxjs/smp-rxjs-throw-if-empty.function.ts","../../src/shared/rxjs/smp-rxjs-throw-on-condition.function.ts"],"sourcesContent":["export * from \"./shared/rxjs/index.js\";\n","import {map, Observable} from \"rxjs\";\nimport {DateTime} from \"ts-luxon\";\n//\nimport {SmpAbstractCacheStrategy} from \"../utils/cache/smp-abstract-cache-strategy.class.js\";\nimport {SmpCachedValue} from \"../utils/cache/smp-cached-value.interface.js\";\nimport {smpIsSmpCachedValue} from \"../utils/cache/smp-is-smp-cached-value.function.js\";\n\nexport abstract class SmpAbstractRxjsTtlCacheStrategy extends SmpAbstractCacheStrategy {\n\n protected abstract _flushRaw(): Observable<void>;\n\n protected abstract _readRaw(key: string): Observable<unknown | undefined>;\n\n protected abstract _removeRaw(key: string): Observable<void>;\n\n protected abstract _writeRaw(key: string, value: unknown, ttl?: number): Observable<void>;\n\n flush(): Observable<void> {\n return this._flushRaw();\n }\n\n read<T = unknown>(key: string): Observable<T | undefined> {\n return this._readRaw(key).pipe(\n map((storedValue) => {\n if (this._isSmpCachedValue<T>(storedValue)) {\n if (storedValue.expiry >= DateTime.now().ts) {\n return storedValue.value as T;\n }\n this._removeRaw(key).subscribe(); // fire-and-forget\n\n return void 0;\n }\n\n return storedValue as T | undefined;\n })\n );\n }\n\n remove(key: string) {\n return this._removeRaw(key);\n }\n\n write<T = unknown>(key: string, value: T, ttl?: number): Observable<void> {\n if (isNaN(+ttl!) || +ttl! <= 0) {\n return this._writeRaw(key, value, ttl);\n }\n\n const expiry = DateTime.now().ts + ttl! * 1000;\n const wrappedValue: SmpCachedValue<T> = {\n value,\n expiry\n };\n\n return this._writeRaw(key, wrappedValue, ttl);\n }\n\n protected _isSmpCachedValue<T>(value: unknown): value is SmpCachedValue<T> {\n return smpIsSmpCachedValue(value);\n }\n}\n","import {Observable} from \"rxjs\";\n\n/**\n * Abstract class representing a caching strategy. This class is intended to be extended by concrete implementations\n * and provides an interface for performing common caching operations such as reading, writing, removing, and flushing cache entries.\n * You shouldn't need to implement this: you can go with SmpAbstractTtlCacheStrategy or SmpRxjsAbstractCacheStrategy, depending on what type of cache you want to implement.\n * For instance, for a local cache, you may stay sync, while for a Valkey cache, you should start with the rxjs.\n */\nexport abstract class SmpAbstractCacheStrategy {\n abstract read<T = unknown>(key: string): T | undefined | Observable<T | undefined>;\n\n abstract write<T = unknown>(key: string, value: T, ttl?: number): void | Observable<void>;\n\n abstract remove(key: string): void | Observable<void>;\n\n abstract flush(): void | Observable<void>;\n}\n","import {SmpCachedValue} from \"./smp-cached-value.interface.js\";\n\n/**\n * Tells you if a value is a SmpCachedValue\n * @param value\n */\nexport function smpIsSmpCachedValue<T>(value: unknown): value is SmpCachedValue<T> {\n return (\n typeof value === \"object\" &&\n value !== null &&\n \"value\" in value &&\n \"expiry\" in value &&\n typeof (value as any).expiry === \"number\"\n );\n}\n","import {Observable, OperatorFunction, catchError, throwError} from \"rxjs\";\nimport type {ObservableInput, ObservedValueOf} from \"rxjs\";\n\nexport function smpRxjsCatchOnly<T, E extends Error, O extends ObservableInput<any>>(\n errorFilter: (new (...args: any[]) => E) | ((err: unknown) => boolean),\n selector: (err: E) => O\n): OperatorFunction<T, T | ObservedValueOf<O>> {\n return (source: Observable<T>) =>\n source.pipe(\n catchError((err: unknown) => {\n const matches = typeof errorFilter === typeof isNaN\n ? isConstructor(errorFilter)\n ? isExactInstance(err, errorFilter as new (...args: any[]) => E)\n : (errorFilter as (err: unknown) => boolean)(err)\n : false;\n\n if (matches) {\n return selector(err as E);\n }\n return throwError(() => err);\n })\n );\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\nfunction isConstructor(fn: unknown): fn is Function {\n try {\n // try creating a dummy instance\n Reflect.construct(String, [], fn as any);\n return true;\n }\n catch {\n return false;\n }\n}\n\n// Ensures that the error is an *exact* instance of the given error constructor, not a subclass\nfunction isExactInstance<E extends Error>(err: unknown, ctor: new (...args: any[]) => E): boolean {\n return (\n typeof err === \"object\" &&\n err !== null &&\n err.constructor === ctor\n );\n}\n","import {defer, Observable, of} from \"rxjs\";\n//\nimport {SmpAbstractRxjsTtlCacheStrategy} from \"./smp-abstract-rxjs-ttl-cache-strategy.class.js\";\n\nexport class SmpRxjsInMemoryCache extends SmpAbstractRxjsTtlCacheStrategy {\n\n private static _storage = new Map<string, unknown>();\n\n protected get _staticSelf(): typeof SmpRxjsInMemoryCache {\n return this.constructor as typeof SmpRxjsInMemoryCache;\n }\n\n protected _flushRaw(): Observable<void> {\n return defer(() => {\n this._staticSelf._storage.clear();\n\n return of(void 0);\n });\n }\n\n protected _readRaw(key: string): Observable<unknown | undefined> {\n return defer(() => {\n\n return of(this._staticSelf._storage.get(key));\n });\n }\n\n protected _removeRaw(key: string): Observable<void> {\n return defer(() => {\n this._staticSelf._storage.delete(key);\n\n return of(void 0);\n });\n }\n\n protected _writeRaw(key: string, value: unknown): Observable<void> {\n return defer(() => {\n this._staticSelf._storage.set(key, value);\n\n return of(void 0);\n });\n }\n}\n\n","import {map, Observable, of, defer, switchMap} from \"rxjs\";\n\nfunction smpRxjsSequence<T extends any[]>(steps: { [K in keyof T]: () => Observable<T[K]> }): Observable<T> {\n const results: Partial<T>[] = [];\n\n function runStep(index: number): Observable<T> {\n if (index >= steps.length) {\n return of(results as T);\n }\n\n return defer(() => steps[index]()).pipe(\n switchMap((value) => {\n results[index] = value;\n return runStep(index + 1);\n })\n );\n }\n\n return runStep(0);\n}\n\n// Overloads for array or object input\ntype ObsFnMap = Record<string, () => Observable<any>>;\n\nexport function smpRxjsQueue<T extends any[]>(source: { [K in keyof T]: () => Observable<T[K]> }): Observable<T>;\nexport function smpRxjsQueue<T extends ObsFnMap>(source: T): Observable<{ [K in keyof T]: T[K] extends () => Observable<infer U> ? U : never }>;\nexport function smpRxjsQueue(\n source: (() => Observable<any>)[] | ObsFnMap\n): Observable<any> {\n if (Array.isArray(source)) {\n // use a strongly typed sequence for the array of steps\n return smpRxjsSequence(source as any);\n }\n else {\n // for object, convert values, then reconstruct object mapping with correct types\n const keys = Object.keys(source);\n const stepsArray = keys.map((key) => source[key]);\n\n return smpRxjsSequence(stepsArray as any).pipe(\n map((results: any[]) => {\n const acc: any = {};\n keys.forEach((key, i) => {\n acc[key] = results[i];\n });\n return acc;\n })\n );\n }\n}\n\n\n","import {concatMap, from, Observable, toArray} from \"rxjs\";\n\n/**\n * Old version of the sequence. Now rewritten using recursion, which is way faster.\n * But you can use this if you want to stick with the rxjs pattern\n * @param steps\n */\nexport function smpRxjsSequence<T extends any[]>(\n steps: { [K in keyof T]: () => Observable<T[K]> }\n): Observable<T> {\n // Cast to readonly tuple of functions to keep tuple inference\n const stepFunctions = steps as readonly (() => Observable<T[number]>)[];\n\n return from(stepFunctions).pipe(\n concatMap(step => step()),\n toArray()\n // TS loses tuple typing here, so we cast the result back to T\n // This cast is safe because we control the input and ordering\n ) as Observable<T>;\n}\n","import {map, Observable, OperatorFunction} from \"rxjs\";\n\n/**\n * If the source observable completes emitting an empty value (empty array or object will be considered empty), it will emit\n * an error. The error will be created at that time by the optional\n * `errorFactory` argument, otherwise, the error will be {@link Error}.\n *\n * ## Example\n *\n * Throw an error if the query didn't match anything\n *\n * ```ts\n * import { of, takeUntil, timer, throwIfEmpty } from 'rxjs';\n *\n * const query$ = of([]);\n *\n * query$.pipe(\n * smpRxjsThrowIfEmpty(() => new Error('The query had no results'))\n * )\n * .subscribe({\n * next() {\n * console.log(\"The query had results\");\n * },\n * error(err) {\n * console.error(err.message);\n * }\n * });\n * ```\n *\n * @param errorFactory A factory function called to produce the\n * error to be thrown when the source observable completes without emitting a\n * value.\n * @return A function that returns an Observable that throws an error if the\n * source Observable completed without emitting.\n */\nexport function smpRxjsThrowIfEmpty<T>(errorFactory: (value: T) => any = defaultErrorFactory): OperatorFunction<T, T> {\n return (source: Observable<T>) => source.pipe(\n map(v => {\n if (~emptyValues.indexOf(JSON.stringify(v))) {\n throw errorFactory(v);\n }\n\n return v;\n })\n );\n}\n\nconst emptyValues = [void 0, null, false, 0, \"\", \"0\", [], {}].map((v) =>\n JSON.stringify(v)\n);\n\nconst defaultErrorFactory = (): Error => new Error();\n","import {defaultIfEmpty, filter, Observable, OperatorFunction} from \"rxjs\";\n//\nimport {smpRxjsThrowIfEmpty} from \"./smp-rxjs-throw-if-empty.function.js\";\n\n/**\n * Custom RxJS operator that filters the source observable based on a condition\n * and throws an error if the resulting observable is empty.\n *\n * @template T The type of items emitted by the source observable.\n * @param {function(T): boolean} condition - A function that takes a value from the source observable and returns a boolean.\n * If the function returns `true`, the value will be emitted; otherwise, it will be filtered out.\n * @param {function(): Error} [errorFactory] - An optional function that returns an error to be thrown if the resulting observable is empty.\n * If not provided, a default error will be thrown.\n * @returns {OperatorFunction<T, T>} An operator function that can be used in the RxJS pipeline.\n *\n * @example\n * import { of } from 'rxjs';\n * import { smpRxjsThrowOnCondition } from \"./path-to-your-file\";\n *\n * const source$ = of(1, 5, -3, 7, 12).pipe(\n * smpRxjsThrowOnCondition(value => value >= 0, () => new Error(\"Value is less than 0\")),\n * smpRxjsThrowOnCondition(value => value > 12, () => new Error(\"Value is lower than 12\"))\n * );\n *\n * source$.subscribe({\n * next: value => console.log(\"Value:\", value),\n * error: err => console.error(\"Error:\", err)\n * });\n */\nexport function smpRxjsThrowOnCondition<T>(\n condition: (value: T) => boolean,\n errorFactory?: () => any\n): OperatorFunction<T, T> {\n return (source: Observable<T>) =>\n source.pipe(\n filter((v: T) => !condition(v)), // Invert the condition because if I need to throw on that condition we should filter all that don't match\n defaultIfEmpty(false as unknown as T), // We nuke type errors, cause when falsy smpRxjsThrowIfEmpty will throw\n smpRxjsThrowIfEmpty(errorFactory)\n );\n}\n"],"mappings":"4dAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qCAAAE,EAAA,yBAAAC,EAAA,qBAAAC,EAAA,iBAAAC,EAAA,oBAAAC,EAAA,wBAAAC,EAAA,4BAAAC,IAAA,eAAAC,EAAAT,GCAA,IAAAU,EAA8B,gBAC9BC,EAAuB,oBCOhB,IAAeC,EAAf,KAAeA,CANtB,MAMsBA,CAAAA,EAAAA,iCAQtB,ECVO,SAASC,EAAuBC,EAAc,CACjD,OACI,OAAOA,GAAU,UACjBA,IAAU,MACV,UAAWA,GACX,WAAYA,GACZ,OAAQA,EAAcC,QAAW,QAEzC,CARgBF,EAAAA,EAAAA,uBFCT,IAAeG,EAAf,cAAuDC,C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ryCache","smpRxjsCatchOnly","smpRxjsQueue","smpRxjsSequence","smpRxjsThrowIfEmpty","smpRxjsThrowOnCondition","__toCommonJS","import_rxjs","import_ts_luxon","SmpAbstractCacheStrategy","smpIsSmpCachedValue","value","expiry","SmpAbstractRxjsTtlCacheStrategy","SmpAbstractCacheStrategy","flush","_flushRaw","read","key","_readRaw","pipe","map","storedValue","_isSmpCachedValue","expiry","DateTime","now","ts","value","_removeRaw","subscribe","remove","write","ttl","isNaN","_writeRaw","wrappedValue","smpIsSmpCachedValue","import_rxjs","smpRxjsCatchOnly","errorFilter","selector","source","pipe","catchError","err","isNaN","isConstructor","isExactInstance","throwError","fn","Reflect","construct","String","ctor","import_rxjs","SmpRxjsInMemoryCache","SmpAbstractRxjsTtlCacheStrategy","_storage","Map","_staticSelf","_flushRaw","defer","clear","of","_readRaw","key","get","_removeRaw","delete","_writeRaw","value","set","import_rxjs","smpRxjsSequence","steps","results","runStep","index","length","of","defer","pipe","switchMap","value","smpRxjsQueue","source","Array","isArray","keys","Object","stepsArray","map","key","acc","forEach","i","import_rxjs","smpRxjsSequence","steps","from","stepFunctions","pipe","concatMap","step","toArray","import_rxjs","smpRxjsThrowIfEmpty","errorFactory","defaultErrorFactory","source","pipe","map","v","emptyValues","indexOf","JSON","stringify","__name","Error","import_rxjs","smpRxjsThrowOnCondition","condition","errorFactory","source","pipe","filter","v","defaultIfEmpty","smpRxjsThrowIfEmpty"]}
@@ -0,0 +1,106 @@
1
+ import { Observable, ObservableInput, OperatorFunction, ObservedValueOf } from 'rxjs';
2
+ import { S as SmpAbstractCacheStrategy, a as SmpCachedValue } from './smp-cached-value.interface-BdPg-J7L.cjs';
3
+
4
+ declare abstract class SmpAbstractRxjsTtlCacheStrategy extends SmpAbstractCacheStrategy {
5
+ protected abstract _flushRaw(): Observable<void>;
6
+ protected abstract _readRaw(key: string): Observable<unknown | undefined>;
7
+ protected abstract _removeRaw(key: string): Observable<void>;
8
+ protected abstract _writeRaw(key: string, value: unknown, ttl?: number): Observable<void>;
9
+ flush(): Observable<void>;
10
+ read<T = unknown>(key: string): Observable<T | undefined>;
11
+ remove(key: string): Observable<void>;
12
+ write<T = unknown>(key: string, value: T, ttl?: number): Observable<void>;
13
+ protected _isSmpCachedValue<T>(value: unknown): value is SmpCachedValue<T>;
14
+ }
15
+
16
+ declare function smpRxjsCatchOnly<T, E extends Error, O extends ObservableInput<any>>(errorFilter: (new (...args: any[]) => E) | ((err: unknown) => boolean), selector: (err: E) => O): OperatorFunction<T, T | ObservedValueOf<O>>;
17
+
18
+ declare class SmpRxjsInMemoryCache extends SmpAbstractRxjsTtlCacheStrategy {
19
+ private static _storage;
20
+ protected get _staticSelf(): typeof SmpRxjsInMemoryCache;
21
+ protected _flushRaw(): Observable<void>;
22
+ protected _readRaw(key: string): Observable<unknown | undefined>;
23
+ protected _removeRaw(key: string): Observable<void>;
24
+ protected _writeRaw(key: string, value: unknown): Observable<void>;
25
+ }
26
+
27
+ type ObsFnMap = Record<string, () => Observable<any>>;
28
+ declare function smpRxjsQueue<T extends any[]>(source: {
29
+ [K in keyof T]: () => Observable<T[K]>;
30
+ }): Observable<T>;
31
+ declare function smpRxjsQueue<T extends ObsFnMap>(source: T): Observable<{
32
+ [K in keyof T]: T[K] extends () => Observable<infer U> ? U : never;
33
+ }>;
34
+
35
+ /**
36
+ * Old version of the sequence. Now rewritten using recursion, which is way faster.
37
+ * But you can use this if you want to stick with the rxjs pattern
38
+ * @param steps
39
+ */
40
+ declare function smpRxjsSequence<T extends any[]>(steps: {
41
+ [K in keyof T]: () => Observable<T[K]>;
42
+ }): Observable<T>;
43
+
44
+ /**
45
+ * If the source observable completes emitting an empty value (empty array or object will be considered empty), it will emit
46
+ * an error. The error will be created at that time by the optional
47
+ * `errorFactory` argument, otherwise, the error will be {@link Error}.
48
+ *
49
+ * ## Example
50
+ *
51
+ * Throw an error if the query didn't match anything
52
+ *
53
+ * ```ts
54
+ * import { of, takeUntil, timer, throwIfEmpty } from 'rxjs';
55
+ *
56
+ * const query$ = of([]);
57
+ *
58
+ * query$.pipe(
59
+ * smpRxjsThrowIfEmpty(() => new Error('The query had no results'))
60
+ * )
61
+ * .subscribe({
62
+ * next() {
63
+ * console.log("The query had results");
64
+ * },
65
+ * error(err) {
66
+ * console.error(err.message);
67
+ * }
68
+ * });
69
+ * ```
70
+ *
71
+ * @param errorFactory A factory function called to produce the
72
+ * error to be thrown when the source observable completes without emitting a
73
+ * value.
74
+ * @return A function that returns an Observable that throws an error if the
75
+ * source Observable completed without emitting.
76
+ */
77
+ declare function smpRxjsThrowIfEmpty<T>(errorFactory?: (value: T) => any): OperatorFunction<T, T>;
78
+
79
+ /**
80
+ * Custom RxJS operator that filters the source observable based on a condition
81
+ * and throws an error if the resulting observable is empty.
82
+ *
83
+ * @template T The type of items emitted by the source observable.
84
+ * @param {function(T): boolean} condition - A function that takes a value from the source observable and returns a boolean.
85
+ * If the function returns `true`, the value will be emitted; otherwise, it will be filtered out.
86
+ * @param {function(): Error} [errorFactory] - An optional function that returns an error to be thrown if the resulting observable is empty.
87
+ * If not provided, a default error will be thrown.
88
+ * @returns {OperatorFunction<T, T>} An operator function that can be used in the RxJS pipeline.
89
+ *
90
+ * @example
91
+ * import { of } from 'rxjs';
92
+ * import { smpRxjsThrowOnCondition } from "./path-to-your-file";
93
+ *
94
+ * const source$ = of(1, 5, -3, 7, 12).pipe(
95
+ * smpRxjsThrowOnCondition(value => value >= 0, () => new Error("Value is less than 0")),
96
+ * smpRxjsThrowOnCondition(value => value > 12, () => new Error("Value is lower than 12"))
97
+ * );
98
+ *
99
+ * source$.subscribe({
100
+ * next: value => console.log("Value:", value),
101
+ * error: err => console.error("Error:", err)
102
+ * });
103
+ */
104
+ declare function smpRxjsThrowOnCondition<T>(condition: (value: T) => boolean, errorFactory?: () => any): OperatorFunction<T, T>;
105
+
106
+ export { SmpAbstractRxjsTtlCacheStrategy, SmpRxjsInMemoryCache, smpRxjsCatchOnly, smpRxjsQueue, smpRxjsSequence, smpRxjsThrowIfEmpty, smpRxjsThrowOnCondition };
@@ -13,4 +13,9 @@ declare abstract class SmpAbstractCacheStrategy {
13
13
  abstract flush(): void | Observable<void>;
14
14
  }
15
15
 
16
- export { SmpAbstractCacheStrategy };
16
+ interface SmpCachedValue<T = any> {
17
+ value: T;
18
+ expiry: number;
19
+ }
20
+
21
+ export { SmpAbstractCacheStrategy as S, type SmpCachedValue as a };
@@ -0,0 +1,27 @@
1
+ declare enum SmpResponseMessageTypes {
2
+ INFO = "INFO",
3
+ SUCCESS = "SUCCESS",
4
+ WARNING = "WARNING",
5
+ ERROR = "ERROR"
6
+ }
7
+
8
+ interface SmpResponseMessageBase {
9
+ message: string;
10
+ type: SmpResponseMessageTypes;
11
+ }
12
+
13
+ declare class SmpResponseMessage implements SmpResponseMessageBase {
14
+ protected _message: string;
15
+ protected _type: SmpResponseMessageTypes;
16
+ get message(): string;
17
+ get type(): SmpResponseMessageTypes;
18
+ constructor(_message: string, _type?: SmpResponseMessageTypes);
19
+ static sanitizeMessages(messages: string | SmpResponseMessage | (SmpResponseMessage | string)[]): SmpResponseMessage[];
20
+ }
21
+
22
+ interface SmpGenericResponseBase<T = any> {
23
+ data?: T;
24
+ messages: SmpResponseMessageBase[] | void;
25
+ }
26
+
27
+ export { SmpResponseMessage as S, type SmpGenericResponseBase as a, type SmpResponseMessageBase as b, SmpResponseMessageTypes as c };
@@ -0,0 +1,12 @@
1
+ declare enum SmpSocialSignInKeys {
2
+ APPLE = "APPLE",
3
+ FACEBOOK = "FACEBOOK",
4
+ GOOGLE = "GOOGLE"
5
+ }
6
+
7
+ declare enum SmpSocialSignInUxModes {
8
+ POPUP = "POPUP",
9
+ REDIRECT = "REDIRECT"
10
+ }
11
+
12
+ export { SmpSocialSignInKeys as S, SmpSocialSignInUxModes as a };
@@ -0,0 +1,2 @@
1
+ "use strict";var D=Object.create;var u=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var _=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var a=(t,e)=>u(t,"name",{value:e,configurable:!0});var C=(t,e)=>{for(var n in e)u(t,n,{get:e[n],enumerable:!0})},l=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let d of b(e))!w.call(t,d)&&d!==n&&u(t,d,{get:()=>e[d],enumerable:!(i=g(e,d))||i.enumerable});return t};var S=(t,e,n)=>(n=t!=null?D(_(t)):{},l(e||!t||!t.__esModule?u(n,"default",{value:t,enumerable:!0}):n,t)),T=t=>l(u({},"__esModule",{value:!0}),t);var R={};C(R,{SmpZodDateTime:()=>x,smpGenericResponseSchema:()=>N,smpResponseMessageSchema:()=>h,smpZodDateTime:()=>O});module.exports=T(R);var f=require("zod");var I=(function(t){return t.INFO="INFO",t.SUCCESS="SUCCESS",t.WARNING="WARNING",t.ERROR="ERROR",t})({});var h=f.z.object({message:f.z.string(),type:f.z.nativeEnum(I)});var p=require("zod");var N=p.z.object({data:p.z.unknown().optional(),messages:p.z.array(h).optional()});var s=S(require("zod"),1),m=require("ts-luxon");var x=class t extends s.default.ZodType{static{a(this,"SmpZodDateTime")}constructor(e){super({typeName:"SmpZodDateTime",coerce:e?.coerce??!1,checks:e?.checks??[]})}_parse(e){let n=this._getOrReturnCtx(e),i=n.data;if(this._def.coerce&&(i=this._coerceToDateTime(i),!(i instanceof m.DateTime)||!i.isValid))return s.default.addIssueToContext(n,{code:s.ZodIssueCode.invalid_type,expected:s.ZodParsedType.date,received:s.ZodParsedType.unknown,path:n.path,message:"Invalid date format"}),s.default.INVALID;if((!(i instanceof m.DateTime)||!i.isValid)&&!this._def.coerce)return s.default.addIssueToContext(n,{code:s.ZodIssueCode.invalid_type,expected:s.ZodParsedType.date,received:s.ZodParsedType.unknown,path:n.path,message:"Input must be a valid DateTime object"}),s.default.INVALID;let d={min:a((o,r,c)=>{if(o.min&&r<o.min)return{code:s.ZodIssueCode.too_small,minimum:o.min.toMillis(),type:"date",inclusive:!0,message:o.message??`Date must be \u2265 ${o.min.toISODate()}`,path:c.path}},"min"),max:a((o,r,c)=>{if(o.max&&r>o.max)return{code:s.ZodIssueCode.too_big,maximum:o.max.toMillis(),type:"date",inclusive:!0,message:o.message??`Date must be \u2264 ${o.max.toISODate()}`,path:c.path}},"max"),between:a((o,r,c)=>{if(o.min&&o.max&&(r<o.min||r>o.max))return{code:s.ZodIssueCode.custom,message:o.message??`Date must be between ${o.min.toISODate()} and ${o.max.toISODate()}`,path:c.path}},"between")};for(let o of this._def.checks)if(i instanceof m.DateTime&&i.isValid){let r=d[o.kind](o,i,n);r&&s.default.addIssueToContext(n,r)}return n.common.issues.length>0?s.default.INVALID:s.default.OK(i)}between(e,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:"between",min:e.toUTC(),max:n.toUTC(),message:i}]})}coerce(){return new t({...this._def,coerce:!0})}max(e,n){return new t({...this._def,checks:[...this._def.checks,{kind:"max",max:e.toUTC(),message:n}]})}min(e,n){return new t({...this._def,checks:[...this._def.checks,{kind:"min",min:e.toUTC(),message:n}]})}_coerceToDateTime(e){if(e instanceof m.DateTime&&e.isValid)return e;let n={string:a(()=>m.DateTime.fromJSDate(new Date(e)),"string"),number:a(()=>m.DateTime.fromMillis(e),"number"),object:a(()=>m.DateTime.fromJSDate(e),"object"),default:a(()=>null,"default")};return(n[typeof e]||n.default)()}},O=a((t={})=>new x({coerce:t.coerce??!1,checks:[]}),"smpZodDateTime");0&&(module.exports={SmpZodDateTime,smpGenericResponseSchema,smpResponseMessageSchema,smpZodDateTime});
2
+ //# sourceMappingURL=zod.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/zod.ts","../../src/shared/zod/smp-response-message.schema.ts","../../src/shared/api/smp-response-message-types.enum.ts","../../src/shared/zod/smp-generic-response.schema.ts","../../src/shared/zod/smp-zod-date-time.definition.ts"],"sourcesContent":["export * from \"./shared/zod/index.js\";\n","import {z, ZodTypeAny} from \"zod\";\n//\nimport {SmpResponseMessage} from \"../api/smp-response-message.class.js\";\nimport {SmpResponseMessageTypes} from \"../api/smp-response-message-types.enum.js\";\n\nexport const smpResponseMessageSchema = z.object({\n message: z.string(),\n type: z.nativeEnum(SmpResponseMessageTypes)\n} as Record<keyof SmpResponseMessage, ZodTypeAny>);\n","export enum SmpResponseMessageTypes {\n INFO = \"INFO\",\n SUCCESS = \"SUCCESS\",\n WARNING = \"WARNING\",\n ERROR = \"ERROR\"\n}\n","import {z, ZodTypeAny} from \"zod\";\n//\nimport {SmpGenericResponseBase} from \"../api/smp-generic-response-base.interface.js\";\nimport {smpResponseMessageSchema} from \"./smp-response-message.schema.js\";\n\nexport const smpGenericResponseSchema = z.object({\n data: z.unknown().optional(),\n messages: z.array(smpResponseMessageSchema).optional()\n} as Record<keyof SmpGenericResponseBase, ZodTypeAny>);\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,6BAAAC,EAAA,6BAAAC,EAAA,mBAAAC,IAAA,eAAAC,EAAAN,GCAA,IAAAO,EAA4B,eCArB,IAAKC,GAAAA,SAAAA,EAAAA,8EAAAA,QDKL,IAAMC,EAA2BC,IAAEC,OAAO,CAC7CC,QAASF,IAAEG,OAAM,EACjBC,KAAMJ,IAAEK,WAAWC,CAAAA,CACvB,CAAA,EERA,IAAAC,EAA4B,eAKrB,IAAMC,EAA2BC,IAAEC,OAAO,CAC7CC,KAAMF,IAAEG,QAAO,EAAGC,SAAQ,EAC1BC,SAAUL,IAAEM,MAAMC,CAAAA,EAA0BH,SAAQ,CACxD,CAAA,ECRA,IAAAI,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,EAAIi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AAMa,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","smpGenericResponseSchema","smpResponseMessageSchema","smpZodDateTime","__toCommonJS","import_zod","SmpResponseMessageTypes","smpResponseMessageSchema","z","object","message","string","type","nativeEnum","SmpResponseMessageTypes","import_zod","smpGenericResponseSchema","z","object","data","unknown","optional","messages","array","smpResponseMessageSchema","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"]}
@@ -0,0 +1,45 @@
1
+ import z$1, { z, ZodTypeDef, ParseInput, ParseReturnType } from 'zod';
2
+ import { S as SmpResponseMessage, a as SmpGenericResponseBase } from './smp-generic-response-base.interface-D0jHrkjw.cjs';
3
+ import { DateTime } from 'ts-luxon';
4
+
5
+ declare const smpResponseMessageSchema: z.ZodObject<Record<keyof SmpResponseMessage, z.ZodTypeAny>, "strip", z.ZodTypeAny, {
6
+ message?: any;
7
+ type?: any;
8
+ }, {
9
+ message?: any;
10
+ type?: any;
11
+ }>;
12
+
13
+ declare const smpGenericResponseSchema: z.ZodObject<Record<keyof SmpGenericResponseBase<any>, z.ZodTypeAny>, "strip", z.ZodTypeAny, {
14
+ messages?: any;
15
+ data?: any;
16
+ }, {
17
+ messages?: any;
18
+ data?: any;
19
+ }>;
20
+
21
+ interface SmpZodDateTimeCheck {
22
+ kind: "min" | "max" | "between";
23
+ min?: DateTime;
24
+ max?: DateTime;
25
+ message?: string;
26
+ }
27
+ interface SmpZodDateTimeDef extends ZodTypeDef {
28
+ coerce: boolean;
29
+ checks: SmpZodDateTimeCheck[];
30
+ typeName: "SmpZodDateTime";
31
+ }
32
+ declare class SmpZodDateTime extends z$1.ZodType<DateTime, SmpZodDateTimeDef> {
33
+ constructor(def?: Partial<SmpZodDateTimeDef>);
34
+ _parse(input: ParseInput): ParseReturnType<DateTime>;
35
+ between(min: DateTime, max: DateTime, message?: string): this;
36
+ coerce(): this;
37
+ max(max: DateTime, message?: string): this;
38
+ min(min: DateTime, message?: string): this;
39
+ private _coerceToDateTime;
40
+ }
41
+ declare const smpZodDateTime: (opts?: {
42
+ coerce?: boolean;
43
+ }) => SmpZodDateTime;
44
+
45
+ export { SmpZodDateTime, smpGenericResponseSchema, smpResponseMessageSchema, smpZodDateTime };
@@ -0,0 +1 @@
1
+ var E=(function(t){return t.APPLE="APPLE",t.FACEBOOK="FACEBOOK",t.GOOGLE="GOOGLE",t})({});var O=(function(t){return t.POPUP="POPUP",t.REDIRECT="REDIRECT",t})({});var P=(function(t){return t.DIFFERENT_CREDENTIAL="auth/account-exists-with-different-credential",t.DIFFERENT_CREDENTIAL_APPLE="auth/account-exists-with-different-credential/apple",t.DIFFERENT_CREDENTIAL_FACEBOOK="auth/account-exists-with-different-credential/facebook",t.DIFFERENT_CREDENTIAL_GOOGLE="auth/account-exists-with-different-credential/google",t.EMAIL_EXISTS="auth/email-already-exists",t.INVALID_ACTION_CODE="auth/invalid-action-code",t.POPUP_BLOCKED="auth/popup-blocked",t.POPUP_CLOSED_BY_USER="auth/popup-closed-by-user",t.USER_NOT_FOUND="auth/user-not-found",t.WRONG_PASSWORD="auth/wrong-password",t})({});export{E as a,O as b,P as c};
@@ -0,0 +1 @@
1
+ import{a as p}from"./chunk-EI7MMDWY.js";var e=class{static{p(this,"SmpAbstractCacheStrategy")}};function r(n){return typeof n=="object"&&n!==null&&"value"in n&&"expiry"in n&&typeof n.expiry=="number"}p(r,"smpIsSmpCachedValue");export{e as a,r as b};