@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.
- package/changelog.md +0 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +1273 -66
- package/dist/esm/{chunk-JE3FPJGV.js → chunk-D2XOH6K4.js} +1 -1
- package/dist/esm/chunk-LD5COSFG.js +1 -0
- package/dist/esm/{chunk-QTWLHW3D.js → chunk-STU5GUNH.js} +1 -1
- package/dist/esm/chunk-V6NBH54E.js +1 -0
- package/dist/esm/chunk-WTLVPDI2.js +1 -0
- package/dist/esm/chunk-XF457SYA.js +1 -0
- package/dist/esm/index.d.ts +2 -3
- package/dist/esm/index.js +1 -1
- package/dist/esm/services/firebase/index.d.ts +1 -1
- package/dist/esm/services/firebase/index.js +1 -1
- package/dist/esm/services/firebase/smp-firebase-service-config.interface.d.ts +1 -1
- package/dist/esm/services/firebase/smp-firebase.service.d.ts +1 -1
- package/dist/esm/services/firebase/smp-firebase.service.js +1 -1
- package/dist/esm/services/http/index.js +1 -1
- package/dist/esm/services/http/smp-http.service.js +1 -1
- package/dist/esm/services/index.d.ts +1 -1
- package/dist/esm/services/index.js +1 -1
- package/dist/esm/services/smp-dynamo.service.d.ts +1 -1
- package/dist/esm/services/smp-dynamo.service.js +1 -1
- package/dist/esm/shared/api/index.d.ts +1 -1
- package/dist/esm/shared/api/index.js +1 -1
- package/dist/esm/shared/api/smp-api-common-utils.class.d.ts +1 -1
- package/dist/esm/shared/api/smp-api-common-utils.class.js +1 -1
- package/dist/esm/shared/crypto/index.js +1 -1
- package/dist/esm/shared/crypto/smp-secure-code.class.js +1 -1
- package/dist/esm/shared/giftcard/index.d.ts +1 -1
- package/dist/esm/shared/giftcard/smp-giftcard-transaction.class.d.ts +1 -1
- package/dist/esm/shared/utils/index.d.ts +1 -1
- package/dist/esm/shared/utils/index.js +1 -1
- package/dist/esm/shared/utils/smp-noop.function.d.ts +1 -3
- package/dist/esm/shared/utils/smp-noop.function.js +1 -1
- package/package.json +2 -1
- package/dist/cjs/services/firebase/index.cjs +0 -2
- package/dist/cjs/services/firebase/index.cjs.map +0 -1
- package/dist/cjs/services/firebase/index.d.cts +0 -7
- package/dist/cjs/services/firebase/smp-firebase-service-config.interface.cjs +0 -2
- package/dist/cjs/services/firebase/smp-firebase-service-config.interface.cjs.map +0 -1
- package/dist/cjs/services/firebase/smp-firebase-service-config.interface.d.cts +0 -12
- package/dist/cjs/services/firebase/smp-firebase.service.cjs +0 -2
- package/dist/cjs/services/firebase/smp-firebase.service.cjs.map +0 -1
- package/dist/cjs/services/firebase/smp-firebase.service.d.cts +0 -56
- package/dist/cjs/services/http/index.cjs +0 -2
- package/dist/cjs/services/http/index.cjs.map +0 -1
- package/dist/cjs/services/http/index.d.cts +0 -12
- package/dist/cjs/services/http/smp-dynamic-fetch-return.type.cjs +0 -2
- package/dist/cjs/services/http/smp-dynamic-fetch-return.type.cjs.map +0 -1
- package/dist/cjs/services/http/smp-dynamic-fetch-return.type.d.cts +0 -3
- package/dist/cjs/services/http/smp-http-config.interface.cjs +0 -2
- package/dist/cjs/services/http/smp-http-config.interface.cjs.map +0 -1
- package/dist/cjs/services/http/smp-http-config.interface.d.cts +0 -16
- package/dist/cjs/services/http/smp-http-session-storage-cache.class.cjs +0 -2
- package/dist/cjs/services/http/smp-http-session-storage-cache.class.cjs.map +0 -1
- package/dist/cjs/services/http/smp-http-session-storage-cache.class.d.cts +0 -11
- package/dist/cjs/services/http/smp-http-status-code.enum.cjs +0 -2
- package/dist/cjs/services/http/smp-http-status-code.enum.cjs.map +0 -1
- package/dist/cjs/services/http/smp-http-status-code.enum.d.cts +0 -70
- package/dist/cjs/services/http/smp-http.service.cjs +0 -2
- package/dist/cjs/services/http/smp-http.service.cjs.map +0 -1
- package/dist/cjs/services/http/smp-http.service.d.cts +0 -46
- package/dist/cjs/services/index.cjs +0 -2
- package/dist/cjs/services/index.cjs.map +0 -1
- package/dist/cjs/services/index.d.cts +0 -22
- package/dist/cjs/services/smp-dynamo.service.cjs +0 -2
- package/dist/cjs/services/smp-dynamo.service.cjs.map +0 -1
- package/dist/cjs/services/smp-dynamo.service.d.cts +0 -39
- package/dist/cjs/shared/api/index.cjs +0 -2
- package/dist/cjs/shared/api/index.cjs.map +0 -1
- package/dist/cjs/shared/api/index.d.cts +0 -11
- package/dist/cjs/shared/api/smp-api-common-utils.class.cjs +0 -2
- package/dist/cjs/shared/api/smp-api-common-utils.class.cjs.map +0 -1
- package/dist/cjs/shared/api/smp-api-common-utils.class.d.cts +0 -15
- package/dist/cjs/shared/api/smp-error-response-create-opts.interface.cjs +0 -2
- package/dist/cjs/shared/api/smp-error-response-create-opts.interface.cjs.map +0 -1
- package/dist/cjs/shared/api/smp-error-response-create-opts.interface.d.cts +0 -13
- package/dist/cjs/shared/api/smp-error-response.class.cjs +0 -2
- package/dist/cjs/shared/api/smp-error-response.class.cjs.map +0 -1
- package/dist/cjs/shared/api/smp-error-response.class.d.cts +0 -25
- package/dist/cjs/shared/api/smp-generic-response-base.interface.cjs +0 -2
- package/dist/cjs/shared/api/smp-generic-response-base.interface.cjs.map +0 -1
- package/dist/cjs/shared/api/smp-generic-response-base.interface.d.cts +0 -9
- package/dist/cjs/shared/api/smp-generic-response.class.cjs +0 -2
- package/dist/cjs/shared/api/smp-generic-response.class.cjs.map +0 -1
- package/dist/cjs/shared/api/smp-generic-response.class.d.cts +0 -20
- package/dist/cjs/shared/api/smp-healtz.const.cjs +0 -2
- package/dist/cjs/shared/api/smp-healtz.const.cjs.map +0 -1
- package/dist/cjs/shared/api/smp-healtz.const.d.cts +0 -5
- package/dist/cjs/shared/api/smp-response-message-base.interface.cjs +0 -2
- package/dist/cjs/shared/api/smp-response-message-base.interface.cjs.map +0 -1
- package/dist/cjs/shared/api/smp-response-message-base.interface.d.cts +0 -8
- package/dist/cjs/shared/api/smp-response-message-types.enum.cjs +0 -2
- package/dist/cjs/shared/api/smp-response-message-types.enum.cjs.map +0 -1
- package/dist/cjs/shared/api/smp-response-message-types.enum.d.cts +0 -8
- package/dist/cjs/shared/api/smp-response-message.class.cjs +0 -2
- package/dist/cjs/shared/api/smp-response-message.class.cjs.map +0 -1
- package/dist/cjs/shared/api/smp-response-message.class.d.cts +0 -13
- package/dist/cjs/shared/api/smp-rest-verbs.enum.cjs +0 -2
- package/dist/cjs/shared/api/smp-rest-verbs.enum.cjs.map +0 -1
- package/dist/cjs/shared/api/smp-rest-verbs.enum.d.cts +0 -9
- package/dist/cjs/shared/common/index.cjs +0 -2
- package/dist/cjs/shared/common/index.cjs.map +0 -1
- package/dist/cjs/shared/common/index.d.cts +0 -6
- package/dist/cjs/shared/common/smp-base-jwt-token-plain.interface.cjs +0 -2
- package/dist/cjs/shared/common/smp-base-jwt-token-plain.interface.cjs.map +0 -1
- package/dist/cjs/shared/common/smp-base-jwt-token-plain.interface.d.cts +0 -7
- package/dist/cjs/shared/common/smp-base-jwt-token.class.cjs +0 -2
- package/dist/cjs/shared/common/smp-base-jwt-token.class.cjs.map +0 -1
- package/dist/cjs/shared/common/smp-base-jwt-token.class.d.cts +0 -14
- package/dist/cjs/shared/common/smp-generic-constructor.type.cjs +0 -2
- package/dist/cjs/shared/common/smp-generic-constructor.type.cjs.map +0 -1
- package/dist/cjs/shared/common/smp-generic-constructor.type.d.cts +0 -3
- package/dist/cjs/shared/common/smp-primitive.type.cjs +0 -2
- package/dist/cjs/shared/common/smp-primitive.type.cjs.map +0 -1
- package/dist/cjs/shared/common/smp-primitive.type.d.cts +0 -3
- package/dist/cjs/shared/common/smp-social-sign-in-keys.enum.cjs +0 -2
- package/dist/cjs/shared/common/smp-social-sign-in-keys.enum.cjs.map +0 -1
- package/dist/cjs/shared/common/smp-social-sign-in-keys.enum.d.cts +0 -7
- package/dist/cjs/shared/common/smp-social-sign-in-ux-modes.enum.cjs +0 -2
- package/dist/cjs/shared/common/smp-social-sign-in-ux-modes.enum.cjs.map +0 -1
- package/dist/cjs/shared/common/smp-social-sign-in-ux-modes.enum.d.cts +0 -6
- package/dist/cjs/shared/crypto/index.cjs +0 -2
- package/dist/cjs/shared/crypto/index.cjs.map +0 -1
- package/dist/cjs/shared/crypto/index.d.cts +0 -3
- package/dist/cjs/shared/crypto/smp-aes-crypt.class.cjs +0 -2
- package/dist/cjs/shared/crypto/smp-aes-crypt.class.cjs.map +0 -1
- package/dist/cjs/shared/crypto/smp-aes-crypt.class.d.cts +0 -1
- package/dist/cjs/shared/crypto/smp-crypto.class.cjs +0 -2
- package/dist/cjs/shared/crypto/smp-crypto.class.cjs.map +0 -1
- package/dist/cjs/shared/crypto/smp-crypto.class.d.cts +0 -10
- package/dist/cjs/shared/crypto/smp-secure-code.class.cjs +0 -2
- package/dist/cjs/shared/crypto/smp-secure-code.class.cjs.map +0 -1
- package/dist/cjs/shared/crypto/smp-secure-code.class.d.cts +0 -20
- package/dist/cjs/shared/firebase/index.cjs +0 -2
- package/dist/cjs/shared/firebase/index.cjs.map +0 -1
- package/dist/cjs/shared/firebase/index.d.cts +0 -1
- package/dist/cjs/shared/firebase/smp-firebase-errors.enum.cjs +0 -2
- package/dist/cjs/shared/firebase/smp-firebase-errors.enum.cjs.map +0 -1
- package/dist/cjs/shared/firebase/smp-firebase-errors.enum.d.cts +0 -14
- package/dist/cjs/shared/giftcard/index.cjs +0 -2
- package/dist/cjs/shared/giftcard/index.cjs.map +0 -1
- package/dist/cjs/shared/giftcard/index.d.cts +0 -8
- package/dist/cjs/shared/giftcard/smp-giftcard-transaction-config.interface.cjs +0 -2
- package/dist/cjs/shared/giftcard/smp-giftcard-transaction-config.interface.cjs.map +0 -1
- package/dist/cjs/shared/giftcard/smp-giftcard-transaction-config.interface.d.cts +0 -11
- package/dist/cjs/shared/giftcard/smp-giftcard-transaction-hash-strategies.enum.cjs +0 -2
- package/dist/cjs/shared/giftcard/smp-giftcard-transaction-hash-strategies.enum.cjs.map +0 -1
- package/dist/cjs/shared/giftcard/smp-giftcard-transaction-hash-strategies.enum.d.cts +0 -8
- package/dist/cjs/shared/giftcard/smp-giftcard-transaction-ops.enum.cjs +0 -2
- package/dist/cjs/shared/giftcard/smp-giftcard-transaction-ops.enum.cjs.map +0 -1
- package/dist/cjs/shared/giftcard/smp-giftcard-transaction-ops.enum.d.cts +0 -16
- package/dist/cjs/shared/giftcard/smp-giftcard-transaction-plain.interface.cjs +0 -2
- package/dist/cjs/shared/giftcard/smp-giftcard-transaction-plain.interface.cjs.map +0 -1
- package/dist/cjs/shared/giftcard/smp-giftcard-transaction-plain.interface.d.cts +0 -8
- package/dist/cjs/shared/giftcard/smp-giftcard-transaction.class.cjs +0 -2
- package/dist/cjs/shared/giftcard/smp-giftcard-transaction.class.cjs.map +0 -1
- package/dist/cjs/shared/giftcard/smp-giftcard-transaction.class.d.cts +0 -56
- package/dist/cjs/shared/marketing-cloud/index.cjs +0 -2
- package/dist/cjs/shared/marketing-cloud/index.cjs.map +0 -1
- package/dist/cjs/shared/marketing-cloud/index.d.cts +0 -2
- package/dist/cjs/shared/marketing-cloud/smp-marketing-cloud-validation-response.interface.cjs +0 -2
- package/dist/cjs/shared/marketing-cloud/smp-marketing-cloud-validation-response.interface.cjs.map +0 -1
- package/dist/cjs/shared/marketing-cloud/smp-marketing-cloud-validation-response.interface.d.cts +0 -14
- package/dist/cjs/shared/marketing-cloud/smp-marketing-cloud-validators.enum.cjs +0 -2
- package/dist/cjs/shared/marketing-cloud/smp-marketing-cloud-validators.enum.cjs.map +0 -1
- package/dist/cjs/shared/marketing-cloud/smp-marketing-cloud-validators.enum.d.cts +0 -7
- package/dist/cjs/shared/rxjs/index.cjs +0 -2
- package/dist/cjs/shared/rxjs/index.cjs.map +0 -1
- package/dist/cjs/shared/rxjs/index.d.cts +0 -10
- package/dist/cjs/shared/rxjs/smp-abstract-rxjs-ttl-cache-strategy.class.cjs +0 -2
- package/dist/cjs/shared/rxjs/smp-abstract-rxjs-ttl-cache-strategy.class.cjs.map +0 -1
- package/dist/cjs/shared/rxjs/smp-abstract-rxjs-ttl-cache-strategy.class.d.cts +0 -17
- package/dist/cjs/shared/rxjs/smp-rxjs-catch-only.function.cjs +0 -2
- package/dist/cjs/shared/rxjs/smp-rxjs-catch-only.function.cjs.map +0 -1
- package/dist/cjs/shared/rxjs/smp-rxjs-catch-only.function.d.cts +0 -5
- package/dist/cjs/shared/rxjs/smp-rxjs-in-memory-cache.class.cjs +0 -2
- package/dist/cjs/shared/rxjs/smp-rxjs-in-memory-cache.class.cjs.map +0 -1
- package/dist/cjs/shared/rxjs/smp-rxjs-in-memory-cache.class.d.cts +0 -15
- package/dist/cjs/shared/rxjs/smp-rxjs-queue.function.cjs +0 -2
- package/dist/cjs/shared/rxjs/smp-rxjs-queue.function.cjs.map +0 -1
- package/dist/cjs/shared/rxjs/smp-rxjs-queue.function.d.cts +0 -11
- package/dist/cjs/shared/rxjs/smp-rxjs-sequence.function.cjs +0 -2
- package/dist/cjs/shared/rxjs/smp-rxjs-sequence.function.cjs.map +0 -1
- package/dist/cjs/shared/rxjs/smp-rxjs-sequence.function.d.cts +0 -12
- package/dist/cjs/shared/rxjs/smp-rxjs-throw-if-empty.function.cjs +0 -2
- package/dist/cjs/shared/rxjs/smp-rxjs-throw-if-empty.function.cjs.map +0 -1
- package/dist/cjs/shared/rxjs/smp-rxjs-throw-if-empty.function.d.cts +0 -38
- package/dist/cjs/shared/rxjs/smp-rxjs-throw-on-condition.function.cjs +0 -2
- package/dist/cjs/shared/rxjs/smp-rxjs-throw-on-condition.function.cjs.map +0 -1
- package/dist/cjs/shared/rxjs/smp-rxjs-throw-on-condition.function.d.cts +0 -30
- package/dist/cjs/shared/utils/cache/index.cjs +0 -2
- package/dist/cjs/shared/utils/cache/index.cjs.map +0 -1
- package/dist/cjs/shared/utils/cache/index.d.cts +0 -7
- package/dist/cjs/shared/utils/cache/smp-abstract-cache-strategy.class.cjs +0 -2
- package/dist/cjs/shared/utils/cache/smp-abstract-cache-strategy.class.cjs.map +0 -1
- package/dist/cjs/shared/utils/cache/smp-abstract-cache-strategy.class.d.cts +0 -16
- package/dist/cjs/shared/utils/cache/smp-abstract-ttl-cache-strategy.class.cjs +0 -2
- package/dist/cjs/shared/utils/cache/smp-abstract-ttl-cache-strategy.class.cjs.map +0 -1
- package/dist/cjs/shared/utils/cache/smp-abstract-ttl-cache-strategy.class.d.cts +0 -17
- package/dist/cjs/shared/utils/cache/smp-browser-cache.class.cjs +0 -2
- package/dist/cjs/shared/utils/cache/smp-browser-cache.class.cjs.map +0 -1
- package/dist/cjs/shared/utils/cache/smp-browser-cache.class.d.cts +0 -16
- package/dist/cjs/shared/utils/cache/smp-cached-value.interface.cjs +0 -2
- package/dist/cjs/shared/utils/cache/smp-cached-value.interface.cjs.map +0 -1
- package/dist/cjs/shared/utils/cache/smp-cached-value.interface.d.cts +0 -6
- package/dist/cjs/shared/utils/cache/smp-in-memory-cache.class.cjs +0 -2
- package/dist/cjs/shared/utils/cache/smp-in-memory-cache.class.cjs.map +0 -1
- package/dist/cjs/shared/utils/cache/smp-in-memory-cache.class.d.cts +0 -15
- package/dist/cjs/shared/utils/cache/smp-is-smp-cached-value.function.cjs +0 -2
- package/dist/cjs/shared/utils/cache/smp-is-smp-cached-value.function.cjs.map +0 -1
- package/dist/cjs/shared/utils/cache/smp-is-smp-cached-value.function.d.cts +0 -9
- package/dist/cjs/shared/utils/index.cjs +0 -2
- package/dist/cjs/shared/utils/index.cjs.map +0 -1
- package/dist/cjs/shared/utils/index.d.cts +0 -15
- package/dist/cjs/shared/utils/smp-apply-mixin.function.cjs +0 -2
- package/dist/cjs/shared/utils/smp-apply-mixin.function.cjs.map +0 -1
- package/dist/cjs/shared/utils/smp-apply-mixin.function.d.cts +0 -5
- package/dist/cjs/shared/utils/smp-ascii-words.function.cjs +0 -2
- package/dist/cjs/shared/utils/smp-ascii-words.function.cjs.map +0 -1
- package/dist/cjs/shared/utils/smp-ascii-words.function.d.cts +0 -3
- package/dist/cjs/shared/utils/smp-common-utils.class.cjs +0 -2
- package/dist/cjs/shared/utils/smp-common-utils.class.cjs.map +0 -1
- package/dist/cjs/shared/utils/smp-common-utils.class.d.cts +0 -101
- package/dist/cjs/shared/utils/smp-filter-exception.class.cjs +0 -2
- package/dist/cjs/shared/utils/smp-filter-exception.class.cjs.map +0 -1
- package/dist/cjs/shared/utils/smp-filter-exception.class.d.cts +0 -7
- package/dist/cjs/shared/utils/smp-noop.function.cjs +0 -2
- package/dist/cjs/shared/utils/smp-noop.function.cjs.map +0 -1
- package/dist/cjs/shared/utils/smp-noop.function.d.cts +0 -3
- package/dist/cjs/shared/utils/smp-regular-expressions.class.cjs +0 -2
- package/dist/cjs/shared/utils/smp-regular-expressions.class.cjs.map +0 -1
- package/dist/cjs/shared/utils/smp-regular-expressions.class.d.cts +0 -16
- package/dist/cjs/shared/utils/smp-sid.class.cjs +0 -2
- package/dist/cjs/shared/utils/smp-sid.class.cjs.map +0 -1
- package/dist/cjs/shared/utils/smp-sid.class.d.cts +0 -18
- package/dist/cjs/shared/utils/smp-unicode-words.class.cjs +0 -2
- package/dist/cjs/shared/utils/smp-unicode-words.class.cjs.map +0 -1
- package/dist/cjs/shared/utils/smp-unicode-words.class.d.cts +0 -15
- package/dist/cjs/shared/zod/index.cjs +0 -2
- package/dist/cjs/shared/zod/index.cjs.map +0 -1
- package/dist/cjs/shared/zod/index.d.cts +0 -3
- package/dist/cjs/shared/zod/smp-zod-date-time.definition.cjs +0 -2
- package/dist/cjs/shared/zod/smp-zod-date-time.definition.cjs.map +0 -1
- package/dist/cjs/shared/zod/smp-zod-date-time.definition.d.cts +0 -28
- package/dist/cjs/smp-aes-crypt.class-CI82T7GV.d.cts +0 -470
- package/dist/cjs/smp-logger-methods.class-F7p-lMeQ.d.cts +0 -66
- package/dist/esm/chunk-C3LKT6AF.js +0 -1
- package/dist/esm/chunk-FUHGPBNJ.js +0 -1
- package/dist/esm/chunk-NIN4PUZX.js +0 -0
- package/dist/esm/chunk-RCI7NEJO.js +0 -1
- package/dist/esm/chunk-TSC2BSSL.js +0 -1
- package/dist/esm/chunk-ZNC4KYAS.js +0 -1
- package/dist/esm/smp-logger-methods.class-F7p-lMeQ.d.ts +0 -66
package/dist/cjs/index.d.cts
CHANGED
|
@@ -1,68 +1,1275 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
1
|
+
import z, { ZodTypeDef, ParseInput, ParseReturnType } from 'zod';
|
|
2
|
+
import { DateTime } from 'ts-luxon';
|
|
3
|
+
import { Observable, ObservableInput, OperatorFunction, ObservedValueOf } from 'rxjs';
|
|
4
|
+
import { SmpLoggerMethods } from '@tonysamperi/logger';
|
|
5
|
+
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
|
+
}
|
|
254
|
+
|
|
255
|
+
declare abstract class SmpAbstractTtlCacheStrategy extends SmpAbstractCacheStrategy {
|
|
256
|
+
protected abstract _flushRaw(): void;
|
|
257
|
+
protected abstract _readRaw(key: string): unknown | undefined;
|
|
258
|
+
protected abstract _removeRaw(key: string): void;
|
|
259
|
+
protected abstract _writeRaw(key: string, value: unknown, ttl?: number): void;
|
|
260
|
+
flush(): void;
|
|
261
|
+
read<T = unknown>(key: string): T | undefined;
|
|
262
|
+
remove(key: string): void;
|
|
263
|
+
write<T = unknown>(key: string, value: T, ttl?: number): void;
|
|
264
|
+
protected _isSmpCachedValue<T>(value: unknown): value is SmpCachedValue<T>;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
type SmpDynamicFetchReturn<T, U> = T extends "blob" ? Blob : T extends "arraybuffer" ? ArrayBuffer : T extends "text" ? string : T extends "json" ? U : T;
|
|
268
|
+
|
|
269
|
+
type SmpGenericConstructor<T = any, U = any> = new (...args: U[]) => T;
|
|
270
|
+
|
|
271
|
+
declare class SmpApiCommonUtils {
|
|
272
|
+
protected static _javascriptVariablePattern: string;
|
|
273
|
+
protected static _logger: SmpLoggerMethods;
|
|
274
|
+
protected static _pathParamRegex: RegExp;
|
|
275
|
+
static credentialsToBasicAuth(user: string, password: string): string;
|
|
276
|
+
static fromBearer(header?: string): string;
|
|
277
|
+
static getCountryFromReferer(referer: string): string | void;
|
|
278
|
+
static getLanguageFromReferer(referer: string): string | void;
|
|
279
|
+
static getLocaleFromReferer(referer: string): string | void;
|
|
280
|
+
static interpolateParams(urlTemplate: string, params: Record<string, string | number | boolean>): string;
|
|
281
|
+
}
|
|
282
|
+
|
|
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
|
+
type ResponseMessageUnion = string | SmpResponseMessage;
|
|
305
|
+
interface SmpErrorResponseCreateOpts<T> {
|
|
306
|
+
messages: ResponseMessageUnion | ResponseMessageUnion[];
|
|
307
|
+
errorCode: number | string;
|
|
308
|
+
status: number;
|
|
309
|
+
data: T;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
interface SmpGenericResponseBase<T = any> {
|
|
313
|
+
data?: T;
|
|
314
|
+
messages: SmpResponseMessageBase[] | void;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
declare class SmpGenericResponse<T, U = SmpGenericResponseBase> implements SmpGenericResponseBase<T> {
|
|
318
|
+
protected _messages: SmpResponseMessage[];
|
|
319
|
+
data?: T | undefined;
|
|
320
|
+
set messages(newValue: string | SmpResponseMessage | (SmpResponseMessage | string)[]);
|
|
321
|
+
get messages(): SmpResponseMessage[] | void;
|
|
322
|
+
constructor(_messages?: SmpResponseMessage[], data?: T | undefined);
|
|
323
|
+
static buildInfo<T = any>(msg: string | string[], data?: T): SmpGenericResponse<T>;
|
|
324
|
+
static buildSuccess<T = any>(msg: string | string[], data?: T): SmpGenericResponse<T>;
|
|
325
|
+
static fromPlain(plain: unknown): SmpGenericResponse<any, SmpGenericResponseBase<any>>;
|
|
326
|
+
isError(): boolean;
|
|
327
|
+
isSuccess(): boolean;
|
|
328
|
+
serialize(): U;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
declare class SmpErrorResponse<T = any> extends SmpGenericResponse<T, SmpGenericResponseBase & Pick<SmpErrorResponse, "errorCode" | "timestamp" | "status">> {
|
|
332
|
+
protected _errorCode: number | string;
|
|
333
|
+
protected _status: number;
|
|
334
|
+
static get DEFAULT_MESSAGES(): SmpResponseMessage[];
|
|
335
|
+
get errorCode(): number | string;
|
|
336
|
+
get status(): number;
|
|
337
|
+
get timestamp(): number;
|
|
338
|
+
protected _timestamp: number;
|
|
339
|
+
constructor(messages?: SmpResponseMessage[], _errorCode?: number | string, _status?: number, data?: T);
|
|
340
|
+
static create<T>({ messages, ...opts }?: Partial<SmpErrorResponseCreateOpts<T>>): SmpErrorResponse;
|
|
341
|
+
/**
|
|
342
|
+
* This shouldn't be necessary, but it's a workaround for this bug https://github.com/typestack/class-transformer/issues/1807
|
|
343
|
+
* @param plain
|
|
344
|
+
*/
|
|
345
|
+
static fromPlain(plain: unknown): SmpErrorResponse<any>;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
declare const SMP_HEALTHZ: {
|
|
349
|
+
status: string;
|
|
350
|
+
};
|
|
351
|
+
|
|
352
|
+
declare enum SmpRestVerbs {
|
|
353
|
+
GET = "GET",
|
|
354
|
+
POST = "POST",
|
|
355
|
+
PUT = "PUT",
|
|
356
|
+
DELETE = "DELETE",
|
|
357
|
+
PATCH = "PATCH"
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
interface SmpHttpConfig<T = any> {
|
|
361
|
+
cacheKey?: string;
|
|
362
|
+
clearCache?: boolean;
|
|
363
|
+
url: string;
|
|
364
|
+
method?: SmpRestVerbs | string;
|
|
365
|
+
useCredentials?: boolean;
|
|
366
|
+
body?: T;
|
|
367
|
+
headers?: Record<string, string>;
|
|
368
|
+
queryParams?: Record<string, string | number>;
|
|
369
|
+
transform?: boolean;
|
|
370
|
+
responseType?: "blob" | "arraybuffer" | "text" | "json" | "jsonp";
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
interface ParseableErrorClass<T> {
|
|
374
|
+
fromPlain(plain: unknown): T;
|
|
375
|
+
}
|
|
376
|
+
declare class SmpHttpService {
|
|
377
|
+
protected static _cachePrefix: string;
|
|
378
|
+
protected static _cacheStrategy: SmpAbstractTtlCacheStrategy;
|
|
379
|
+
protected static _config: {
|
|
380
|
+
cachePrefix: string;
|
|
381
|
+
shared: Map<string, Promise<any>>;
|
|
382
|
+
};
|
|
383
|
+
protected static _errorClass: SmpGenericConstructor & ParseableErrorClass<any>;
|
|
384
|
+
protected static _mergeParamsFallbackBaseUrl: string;
|
|
385
|
+
static $http(config: SmpHttpConfig): Promise<SmpDynamicFetchReturn<SmpHttpConfig["responseType"], any>>;
|
|
386
|
+
static $http<T = any>(config: SmpHttpConfig): Promise<T>;
|
|
387
|
+
static $http(config: SmpHttpConfig): Promise<SmpDynamicFetchReturn<SmpHttpConfig["responseType"], Blob>>;
|
|
388
|
+
static $http(config: SmpHttpConfig): Promise<SmpDynamicFetchReturn<SmpHttpConfig["responseType"], ArrayBuffer>>;
|
|
389
|
+
static $http(config: SmpHttpConfig): Promise<SmpDynamicFetchReturn<SmpHttpConfig["responseType"], string>>;
|
|
390
|
+
static $http<T, U, V>(config: SmpHttpConfig): Promise<SmpDynamicFetchReturn<SmpHttpConfig["responseType"], U>>;
|
|
391
|
+
/**
|
|
392
|
+
* Internal method to generate ajax config
|
|
393
|
+
* @param config
|
|
394
|
+
* @protected
|
|
395
|
+
*/
|
|
396
|
+
static _generateAjax<T, U, V = unknown>(config: SmpHttpConfig<T>): Promise<SmpDynamicFetchReturn<typeof config.responseType, U>>;
|
|
397
|
+
static _generateAjaxBase<T, U, V = unknown>(config: SmpHttpConfig<T>): Promise<SmpDynamicFetchReturn<typeof config.responseType, U>>;
|
|
398
|
+
static cacheFlush(): void;
|
|
399
|
+
static mergeQueryParams(url: string, queryParams: SmpHttpConfig["queryParams"]): string;
|
|
400
|
+
protected static _cacheKey(key: string): string;
|
|
401
|
+
protected static _cachePop<T = unknown>(key: string): T | void;
|
|
402
|
+
protected static _cacheRead<T>(key: string): T | void;
|
|
403
|
+
protected static _cacheRemove(key: string): void;
|
|
404
|
+
protected static _cacheWrite<T>(key: string, value: T): void;
|
|
405
|
+
protected static _preprocessRequest<T>(config: SmpHttpConfig<T>): Promise<SmpHttpConfig<T>>;
|
|
406
|
+
protected static _preprocessResponse<T>(_config_: SmpHttpConfig<T>, res: Response): Promise<Response>;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
declare class SmpBrowserCache extends SmpAbstractTtlCacheStrategy {
|
|
410
|
+
protected _storage: typeof localStorage | typeof sessionStorage;
|
|
411
|
+
protected _prefix: string;
|
|
412
|
+
constructor(_storage: typeof localStorage | typeof sessionStorage, _prefix: string);
|
|
413
|
+
protected _flushRaw(): void;
|
|
414
|
+
protected _readRaw(key: string): unknown | undefined;
|
|
415
|
+
protected _removeRaw(key: string): void;
|
|
416
|
+
protected _writeRaw(key: string, value: unknown): void;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
declare class SmpHttpSessionStorageCache extends SmpBrowserCache {
|
|
420
|
+
constructor();
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* This is basically a clone from axios, to avoid having the lib as dependency, while only this was used
|
|
425
|
+
*/
|
|
426
|
+
declare enum SmpHttpStatusCodes {
|
|
427
|
+
Continue = 100,
|
|
428
|
+
SwitchingProtocols = 101,
|
|
429
|
+
Processing = 102,
|
|
430
|
+
EarlyHints = 103,
|
|
431
|
+
Ok = 200,
|
|
432
|
+
Created = 201,
|
|
433
|
+
Accepted = 202,
|
|
434
|
+
NonAuthoritativeInformation = 203,
|
|
435
|
+
NoContent = 204,
|
|
436
|
+
ResetContent = 205,
|
|
437
|
+
PartialContent = 206,
|
|
438
|
+
MultiStatus = 207,
|
|
439
|
+
AlreadyReported = 208,
|
|
440
|
+
ImUsed = 226,
|
|
441
|
+
MultipleChoices = 300,
|
|
442
|
+
MovedPermanently = 301,
|
|
443
|
+
Found = 302,
|
|
444
|
+
SeeOther = 303,
|
|
445
|
+
NotModified = 304,
|
|
446
|
+
UseProxy = 305,
|
|
447
|
+
Unused = 306,
|
|
448
|
+
TemporaryRedirect = 307,
|
|
449
|
+
PermanentRedirect = 308,
|
|
450
|
+
BadRequest = 400,
|
|
451
|
+
Unauthorized = 401,
|
|
452
|
+
PaymentRequired = 402,
|
|
453
|
+
Forbidden = 403,
|
|
454
|
+
NotFound = 404,
|
|
455
|
+
MethodNotAllowed = 405,
|
|
456
|
+
NotAcceptable = 406,
|
|
457
|
+
ProxyAuthenticationRequired = 407,
|
|
458
|
+
RequestTimeout = 408,
|
|
459
|
+
Conflict = 409,
|
|
460
|
+
Gone = 410,
|
|
461
|
+
LengthRequired = 411,
|
|
462
|
+
PreconditionFailed = 412,
|
|
463
|
+
PayloadTooLarge = 413,
|
|
464
|
+
UriTooLong = 414,
|
|
465
|
+
UnsupportedMediaType = 415,
|
|
466
|
+
RangeNotSatisfiable = 416,
|
|
467
|
+
ExpectationFailed = 417,
|
|
468
|
+
ImATeapot = 418,
|
|
469
|
+
MisdirectedRequest = 421,
|
|
470
|
+
UnprocessableEntity = 422,
|
|
471
|
+
Locked = 423,
|
|
472
|
+
FailedDependency = 424,
|
|
473
|
+
TooEarly = 425,
|
|
474
|
+
UpgradeRequired = 426,
|
|
475
|
+
PreconditionRequired = 428,
|
|
476
|
+
TooManyRequests = 429,
|
|
477
|
+
RequestHeaderFieldsTooLarge = 431,
|
|
478
|
+
UnavailableForLegalReasons = 451,
|
|
479
|
+
InternalServerError = 500,
|
|
480
|
+
NotImplemented = 501,
|
|
481
|
+
BadGateway = 502,
|
|
482
|
+
ServiceUnavailable = 503,
|
|
483
|
+
GatewayTimeout = 504,
|
|
484
|
+
HttpVersionNotSupported = 505,
|
|
485
|
+
VariantAlsoNegotiates = 506,
|
|
486
|
+
InsufficientStorage = 507,
|
|
487
|
+
LoopDetected = 508,
|
|
488
|
+
NotExtended = 510,
|
|
489
|
+
NetworkAuthenticationRequired = 511
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
declare class SmpBaseJwtTokenPlain {
|
|
493
|
+
access_token: string;
|
|
494
|
+
exp: number;
|
|
495
|
+
iss?: string;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
declare class SmpBaseJwtToken {
|
|
499
|
+
protected _access_token: string;
|
|
500
|
+
protected _exp: number;
|
|
501
|
+
protected _iss?: string | undefined;
|
|
502
|
+
get access_token(): string;
|
|
503
|
+
get exp(): number;
|
|
504
|
+
get iss(): string | undefined;
|
|
505
|
+
constructor(_access_token: string, _exp: number, _iss?: string | undefined);
|
|
506
|
+
serialize(): SmpBaseJwtTokenPlain;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
type SmpPrimitive = string | number | boolean | symbol;
|
|
510
|
+
|
|
511
|
+
declare class WordArray {
|
|
512
|
+
sigBytes: number;
|
|
513
|
+
words: number[];
|
|
514
|
+
/**
|
|
515
|
+
* Initializes a newly created word array.
|
|
516
|
+
*
|
|
517
|
+
* @param words (Optional) An array of 32-bit words.
|
|
518
|
+
* @param sigBytes (Optional) The number of significant bytes in the words.
|
|
519
|
+
*
|
|
520
|
+
* @example
|
|
521
|
+
*
|
|
522
|
+
* let wordArray = new WordArray();
|
|
523
|
+
* let wordArray = new WordArray([0x00010203, 0x04050607]);
|
|
524
|
+
* let wordArray = new WordArray([0x00010203, 0x04050607], 6);
|
|
525
|
+
*/
|
|
526
|
+
constructor(words?: number[], sigBytes?: number);
|
|
527
|
+
/**
|
|
528
|
+
* Creates a word array filled with random bytes.
|
|
529
|
+
*
|
|
530
|
+
* @param nBytes The number of random bytes to generate.
|
|
531
|
+
*
|
|
532
|
+
* @return The random word array.
|
|
533
|
+
*
|
|
534
|
+
* @example
|
|
535
|
+
*
|
|
536
|
+
* let wordArray = WordArray.random(16);
|
|
537
|
+
*/
|
|
538
|
+
static random(nBytes: number): WordArray;
|
|
539
|
+
/**
|
|
540
|
+
* Removes insignificant bits.
|
|
541
|
+
*
|
|
542
|
+
* @example
|
|
543
|
+
*
|
|
544
|
+
* wordArray.clamp();
|
|
545
|
+
*/
|
|
546
|
+
clamp(): void;
|
|
547
|
+
/**
|
|
548
|
+
* Creates a copy of this word array.
|
|
549
|
+
*
|
|
550
|
+
* @return The clone.
|
|
551
|
+
*
|
|
552
|
+
* @example
|
|
553
|
+
*
|
|
554
|
+
* let clone = wordArray.clone();
|
|
555
|
+
*/
|
|
556
|
+
clone(): WordArray;
|
|
557
|
+
/**
|
|
558
|
+
* Concatenates a word array to this word array.
|
|
559
|
+
*
|
|
560
|
+
* @param wordArray The word array to append.
|
|
561
|
+
*
|
|
562
|
+
* @return This word array.
|
|
563
|
+
*
|
|
564
|
+
* @example
|
|
565
|
+
*
|
|
566
|
+
* wordArray1.concat(wordArray2);
|
|
567
|
+
*/
|
|
568
|
+
concat(wordArray: WordArray): WordArray;
|
|
569
|
+
/**
|
|
570
|
+
* Converts this word array to a string.
|
|
571
|
+
*
|
|
572
|
+
* @param encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
|
|
573
|
+
*
|
|
574
|
+
* @return The stringified word array.
|
|
575
|
+
*
|
|
576
|
+
* @example
|
|
577
|
+
*
|
|
578
|
+
* let string = wordArray + '';
|
|
579
|
+
* let string = wordArray.toString();
|
|
580
|
+
* let string = wordArray.toString(CryptoJS.enc.Utf8);
|
|
581
|
+
*/
|
|
582
|
+
toString<T extends {
|
|
583
|
+
stringify: (arg: WordArray) => string;
|
|
584
|
+
}>(encoder?: T): string;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
declare abstract class BlockCipherModeAlgorithm {
|
|
588
|
+
__creator: ((cipher: BlockCipher, iv: number[]) => BlockCipherMode) | undefined;
|
|
589
|
+
protected _cipher: BlockCipher;
|
|
590
|
+
protected _iv: number[] | undefined;
|
|
591
|
+
constructor(cipher: BlockCipher, iv: number[]);
|
|
592
|
+
abstract processBlock(words: number[], offset: number): void;
|
|
593
|
+
/**
|
|
594
|
+
* Initializes a newly created mode.
|
|
595
|
+
*
|
|
596
|
+
* @param cipher A block cipher instance.
|
|
597
|
+
* @param iv The IV words.
|
|
598
|
+
*
|
|
599
|
+
* @example
|
|
600
|
+
*
|
|
601
|
+
* var mode = CBC.Encryptor.create(cipher, iv.words);
|
|
602
|
+
*/
|
|
603
|
+
init(cipher: BlockCipher, iv?: number[]): void;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
declare abstract class BlockCipherMode {
|
|
607
|
+
static Decryptor: any;
|
|
608
|
+
static Encryptor: any;
|
|
609
|
+
/**
|
|
610
|
+
* Creates this mode for decryption.
|
|
611
|
+
*
|
|
612
|
+
* @param cipher A block cipher instance.
|
|
613
|
+
* @param iv The IV words.
|
|
614
|
+
*
|
|
615
|
+
* @example
|
|
616
|
+
*
|
|
617
|
+
* const mode = CBC.createDecryptor(cipher, iv.words);
|
|
618
|
+
*/
|
|
619
|
+
static createDecryptor(cipher: BlockCipher, iv: number[]): BlockCipherModeAlgorithm;
|
|
620
|
+
/**
|
|
621
|
+
* Creates this mode for encryption.
|
|
622
|
+
*
|
|
623
|
+
* @param cipher A block cipher instance.
|
|
624
|
+
* @param iv The IV words.
|
|
625
|
+
*
|
|
626
|
+
* @example
|
|
627
|
+
*
|
|
628
|
+
* var mode = CBC.createEncryptor(cipher, iv.words);
|
|
629
|
+
*/
|
|
630
|
+
static createEncryptor(cipher: BlockCipher, iv: number[]): BlockCipherModeAlgorithm;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
declare abstract class AbstractPadding {
|
|
634
|
+
static pad: (data: WordArray, blockSize: number) => void;
|
|
635
|
+
static unpad: (data: WordArray) => void;
|
|
636
|
+
}
|
|
637
|
+
type Padding = typeof AbstractPadding;
|
|
638
|
+
|
|
639
|
+
declare class CipherParams {
|
|
640
|
+
algorithm?: typeof Cipher;
|
|
641
|
+
blockSize?: number;
|
|
642
|
+
ciphertext?: WordArray;
|
|
643
|
+
formatter?: Formatter;
|
|
644
|
+
iv?: WordArray;
|
|
645
|
+
key?: WordArray | string;
|
|
646
|
+
mode?: typeof BlockCipherMode;
|
|
647
|
+
padding?: Padding;
|
|
648
|
+
salt?: WordArray | string;
|
|
649
|
+
/**
|
|
650
|
+
* Initializes a newly created cipher params object.
|
|
651
|
+
*
|
|
652
|
+
* @param cipherParams An object with any of the possible cipher parameters.
|
|
653
|
+
*
|
|
654
|
+
* @example
|
|
655
|
+
*
|
|
656
|
+
* let cipherParams = CipherParams.create({
|
|
657
|
+
* ciphertext: ciphertextWordArray,
|
|
658
|
+
* key: keyWordArray,
|
|
659
|
+
* iv: ivWordArray,
|
|
660
|
+
* salt: saltWordArray,
|
|
661
|
+
* algorithm: AES,
|
|
662
|
+
* mode: CBC,
|
|
663
|
+
* padding: PKCS7,
|
|
664
|
+
* blockSize: 4,
|
|
665
|
+
* formatter: OpenSSLFormatter
|
|
666
|
+
* });
|
|
667
|
+
*/
|
|
668
|
+
constructor(cipherParams: Omit<CipherParams, "extend" | "toString">);
|
|
669
|
+
extend(additionalParams: CipherParams): CipherParams;
|
|
670
|
+
/**
|
|
671
|
+
* Converts this cipher params object to a string.
|
|
672
|
+
*
|
|
673
|
+
* @param formatter (Optional) The formatting strategy to use.
|
|
674
|
+
*
|
|
675
|
+
* @return The stringified cipher params.
|
|
676
|
+
*
|
|
677
|
+
* @throws Error If neither the formatter nor the default formatter is set.
|
|
678
|
+
*
|
|
679
|
+
* @example
|
|
680
|
+
*
|
|
681
|
+
* let string = cipherParams + '';
|
|
682
|
+
* let string = cipherParams.toString();
|
|
683
|
+
* let string = cipherParams.toString(CryptoJS.format.OpenSSL);
|
|
684
|
+
*/
|
|
685
|
+
toString(formatter?: Formatter): string;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
interface Formatter {
|
|
689
|
+
stringify: (cipherParams: CipherParams) => string;
|
|
690
|
+
parse: (paramsStr: string) => CipherParams;
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
declare abstract class AbstractKDF {
|
|
694
|
+
static execute: (password: string, keySize: number, ivSize: number, salt?: WordArray | string) => CipherParams;
|
|
695
|
+
abstract compute?(password: WordArray | string, salt: WordArray | string): WordArray;
|
|
696
|
+
}
|
|
697
|
+
type KDF = typeof AbstractKDF;
|
|
698
|
+
|
|
699
|
+
interface BufferedBlockAlgorithmConfig {
|
|
700
|
+
blockSize?: number;
|
|
701
|
+
iv?: WordArray;
|
|
702
|
+
format?: Formatter;
|
|
703
|
+
kdf?: KDF;
|
|
704
|
+
mode?: typeof BlockCipherMode;
|
|
705
|
+
padding?: Padding;
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
declare abstract class BufferedBlockAlgorithm {
|
|
709
|
+
cfg: BufferedBlockAlgorithmConfig;
|
|
710
|
+
protected _data: WordArray;
|
|
711
|
+
protected _minBufferSize: number;
|
|
712
|
+
protected _nDataBytes: number;
|
|
713
|
+
protected abstract _doProcessBlock(wordArray: number[], offset: number): void;
|
|
714
|
+
constructor(cfg?: BufferedBlockAlgorithmConfig);
|
|
715
|
+
/**
|
|
716
|
+
* Creates a copy of this object.
|
|
717
|
+
*
|
|
718
|
+
* @return The clone.
|
|
719
|
+
*
|
|
720
|
+
* @example
|
|
721
|
+
*
|
|
722
|
+
* let clone = bufferedBlockAlgorithm.clone();
|
|
723
|
+
*/
|
|
724
|
+
clone(): BufferedBlockAlgorithm;
|
|
725
|
+
/**
|
|
726
|
+
* Resets this block algorithm's data buffer to its initial state.
|
|
727
|
+
*
|
|
728
|
+
* @example
|
|
729
|
+
*
|
|
730
|
+
* bufferedBlockAlgorithm.reset();
|
|
731
|
+
*/
|
|
732
|
+
reset(): void;
|
|
733
|
+
/**
|
|
734
|
+
* Adds new data to this block algorithm's buffer.
|
|
735
|
+
*
|
|
736
|
+
* @param data The data to append. Strings are converted to a WordArray using UTF-8.
|
|
737
|
+
*
|
|
738
|
+
* @example
|
|
739
|
+
*
|
|
740
|
+
* bufferedBlockAlgorithm._append('data');
|
|
741
|
+
* bufferedBlockAlgorithm._append(wordArray);
|
|
742
|
+
*/
|
|
743
|
+
protected _append(data: string | WordArray): void;
|
|
744
|
+
/**
|
|
745
|
+
* Processes available data blocks.
|
|
746
|
+
*
|
|
747
|
+
* This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
|
|
748
|
+
*
|
|
749
|
+
* @param doFlush Whether all blocks and partial blocks should be processed.
|
|
750
|
+
*
|
|
751
|
+
* @return The processed data.
|
|
752
|
+
*
|
|
753
|
+
* @example
|
|
754
|
+
*
|
|
755
|
+
* let processedData = bufferedBlockAlgorithm._process();
|
|
756
|
+
* let processedData = bufferedBlockAlgorithm._process(!!'flush');
|
|
757
|
+
*/
|
|
758
|
+
protected _process(doFlush?: boolean): WordArray;
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
declare class CipherHelper {
|
|
762
|
+
private readonly _cipher;
|
|
763
|
+
constructor(_cipher: typeof Cipher);
|
|
764
|
+
decrypt(ciphertext: CipherParams | string, key: WordArray | string, cfg?: BufferedBlockAlgorithmConfig): WordArray;
|
|
765
|
+
encrypt(message: WordArray | string, key: WordArray | string, cfg?: BufferedBlockAlgorithmConfig): CipherParams;
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
declare abstract class Cipher extends BufferedBlockAlgorithm {
|
|
769
|
+
/**
|
|
770
|
+
* This cipher's IV size. Default: 4 (128 bits / 32 Bits)
|
|
771
|
+
*/
|
|
772
|
+
static ivSize: number;
|
|
773
|
+
/**
|
|
774
|
+
* This cipher's key size. Default: 4 (128 bits / 32 Bits)
|
|
775
|
+
*/
|
|
776
|
+
static keySize: number;
|
|
777
|
+
/**
|
|
778
|
+
* A constant representing decryption mode.
|
|
779
|
+
*/
|
|
780
|
+
protected static readonly _DEC_XFORM_MODE = 2;
|
|
781
|
+
/**
|
|
782
|
+
* A constant representing encryption mode.
|
|
783
|
+
*/
|
|
784
|
+
protected static readonly _ENC_XFORM_MODE = 1;
|
|
785
|
+
/**
|
|
786
|
+
* The key.
|
|
787
|
+
*/
|
|
788
|
+
protected _key: WordArray;
|
|
789
|
+
/**
|
|
790
|
+
* Either the encryption or decryption transformation mode constant.
|
|
791
|
+
*/
|
|
792
|
+
protected _xformMode: number;
|
|
793
|
+
/**
|
|
794
|
+
* Initializes a newly created cipher.
|
|
795
|
+
*
|
|
796
|
+
* @param xformMode Either the encryption or decryption transormation mode constant.
|
|
797
|
+
* @param key The key.
|
|
798
|
+
* @param cfg (Optional) The configuration options to use for this operation.
|
|
799
|
+
*
|
|
800
|
+
* @example
|
|
801
|
+
*
|
|
802
|
+
* let cipher = AES.create(AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray });
|
|
803
|
+
*/
|
|
804
|
+
constructor(xformMode: number, key: WordArray, cfg?: BufferedBlockAlgorithmConfig);
|
|
805
|
+
/**
|
|
806
|
+
* Creates shortcut functions to a cipher's object interface.
|
|
807
|
+
*
|
|
808
|
+
* @param cipher The cipher to create a helper for.
|
|
809
|
+
*
|
|
810
|
+
* @return An object with encrypt and decrypt shortcut functions.
|
|
811
|
+
*
|
|
812
|
+
* @example
|
|
813
|
+
*
|
|
814
|
+
* const AES = Cipher._createHelper(AESAlgorithm);
|
|
815
|
+
*/
|
|
816
|
+
static _createHelper(cipher: typeof Cipher): CipherHelper;
|
|
817
|
+
/**
|
|
818
|
+
* Creates this cipher in decryption mode.
|
|
819
|
+
*
|
|
820
|
+
* @param key The key.
|
|
821
|
+
* @param cfg (Optional) The configuration options to use for this operation.
|
|
822
|
+
*
|
|
823
|
+
* @return A cipher instance.
|
|
824
|
+
*
|
|
825
|
+
* @example
|
|
826
|
+
*
|
|
827
|
+
* let cipher = AES.createDecryptor(keyWordArray, { iv: ivWordArray });
|
|
828
|
+
*/
|
|
829
|
+
static createDecryptor(key: WordArray | string, cfg?: BufferedBlockAlgorithmConfig): Cipher;
|
|
830
|
+
/**
|
|
831
|
+
* Creates this cipher in encryption mode.
|
|
832
|
+
*
|
|
833
|
+
* @param key The key.
|
|
834
|
+
* @param cfg (Optional) The configuration options to use for this operation.
|
|
835
|
+
*
|
|
836
|
+
* @return A cipher instance.
|
|
837
|
+
*
|
|
838
|
+
* @example
|
|
839
|
+
*
|
|
840
|
+
* let cipher = AES.createEncryptor(keyWordArray, { iv: ivWordArray });
|
|
841
|
+
*/
|
|
842
|
+
static createEncryptor(key: WordArray | string, cfg?: BufferedBlockAlgorithmConfig): Cipher;
|
|
843
|
+
/**
|
|
844
|
+
* Finalizes the encryption or decryption process.
|
|
845
|
+
* Note that the finalize operation is effectively a destructive, read-once operation.
|
|
846
|
+
*
|
|
847
|
+
* @param dataUpdate The final data to encrypt or decrypt.
|
|
848
|
+
*
|
|
849
|
+
* @return The data after final processing.
|
|
850
|
+
*
|
|
851
|
+
* @example
|
|
852
|
+
*
|
|
853
|
+
* var encrypted = cipher.finalize();
|
|
854
|
+
* var encrypted = cipher.finalize('data');
|
|
855
|
+
* var encrypted = cipher.finalize(wordArray);
|
|
856
|
+
*/
|
|
857
|
+
finalize(dataUpdate?: WordArray | string): WordArray;
|
|
858
|
+
/**
|
|
859
|
+
* Adds data to be encrypted or decrypted.
|
|
860
|
+
*
|
|
861
|
+
* @param dataUpdate The data to encrypt or decrypt.
|
|
862
|
+
*
|
|
863
|
+
* @return The data after processing.
|
|
864
|
+
*
|
|
865
|
+
* @example
|
|
866
|
+
*
|
|
867
|
+
* let encrypted = cipher.process('data');
|
|
868
|
+
* let encrypted = cipher.process(wordArray);
|
|
869
|
+
*/
|
|
870
|
+
process(dataUpdate: WordArray | string): WordArray;
|
|
871
|
+
/**
|
|
872
|
+
* Cipher specific finalize function explicitly implemented in the derived class.
|
|
873
|
+
*/
|
|
874
|
+
protected abstract _doFinalize(): WordArray;
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
declare abstract class BlockCipher extends Cipher {
|
|
878
|
+
protected _mode: BlockCipherModeAlgorithm;
|
|
879
|
+
constructor(xformMode: number, key: WordArray, cfg?: BufferedBlockAlgorithmConfig);
|
|
880
|
+
abstract decryptBlock(M: number[], offset: number): void;
|
|
881
|
+
abstract encryptBlock(M: number[], offset: number): void;
|
|
882
|
+
reset(): void;
|
|
883
|
+
protected _doFinalize(): WordArray;
|
|
884
|
+
protected _doProcessBlock(words: number[], offset: number): void;
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
declare class CBCEncryptor extends BlockCipherModeAlgorithm {
|
|
888
|
+
get prevBlock(): number[];
|
|
889
|
+
protected _prevBlock: number[] | undefined;
|
|
890
|
+
/**
|
|
891
|
+
* Processes the data block at offset.
|
|
892
|
+
*
|
|
893
|
+
* @param words The data words to operate on.
|
|
894
|
+
* @param offset The offset where the block starts.
|
|
895
|
+
*
|
|
896
|
+
* @example
|
|
897
|
+
*
|
|
898
|
+
* mode.processBlock(data.words, offset);
|
|
899
|
+
*/
|
|
900
|
+
processBlock(words: number[], offset: number): void;
|
|
901
|
+
xorBlock(words: number[], offset: number, blockSize: number): void;
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
declare class CBCDecryptor extends BlockCipherModeAlgorithm {
|
|
905
|
+
get prevBlock(): number[];
|
|
906
|
+
protected _prevBlock: number[] | undefined;
|
|
907
|
+
/**
|
|
908
|
+
* Processes the data block at offset.
|
|
909
|
+
*
|
|
910
|
+
* @param words The data words to operate on.
|
|
911
|
+
* @param offset The offset where the block starts.
|
|
912
|
+
*
|
|
913
|
+
* @example
|
|
914
|
+
*
|
|
915
|
+
* mode.processBlock(data.words, offset);
|
|
916
|
+
*/
|
|
917
|
+
processBlock(words: number[], offset: number): void;
|
|
918
|
+
xorBlock(words: number[], offset: number, blockSize: number): void;
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
/**
|
|
922
|
+
* Cipher Block Chaining mode.
|
|
923
|
+
*/
|
|
924
|
+
declare abstract class CBC extends BlockCipherMode {
|
|
925
|
+
static Decryptor: typeof CBCDecryptor;
|
|
926
|
+
static Encryptor: typeof CBCEncryptor;
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
declare class PKCS7 implements AbstractPadding {
|
|
930
|
+
/**
|
|
931
|
+
* Pads data using the algorithm defined in PKCS #5/7.
|
|
932
|
+
*
|
|
933
|
+
* @param data The data to pad.
|
|
934
|
+
* @param blockSize The multiple that the data should be padded to.
|
|
935
|
+
*
|
|
936
|
+
* @example
|
|
937
|
+
*
|
|
938
|
+
* PKCS7.pad(wordArray, 4);
|
|
939
|
+
*/
|
|
940
|
+
static pad(data: WordArray, blockSize: number): void;
|
|
941
|
+
/**
|
|
942
|
+
* Unpads data that had been padded using the algorithm defined in PKCS #5/7.
|
|
943
|
+
*
|
|
944
|
+
* @param data The data to unpad.
|
|
945
|
+
*
|
|
946
|
+
* @example
|
|
947
|
+
*
|
|
948
|
+
* PKCS7.unpad(wordArray);
|
|
949
|
+
*/
|
|
950
|
+
static unpad(data: WordArray): void;
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
declare class SmpAesCrypt {
|
|
954
|
+
protected _password: string;
|
|
955
|
+
protected _salt: string;
|
|
956
|
+
protected _initVector?: string | undefined;
|
|
957
|
+
protected get _iv(): WordArray | undefined;
|
|
958
|
+
protected _mode: typeof CBC;
|
|
959
|
+
protected _padding: typeof PKCS7;
|
|
960
|
+
constructor(_password: string, _salt: string, _initVector?: string | undefined);
|
|
961
|
+
/**
|
|
962
|
+
* Decodes some data from a symmetric AES encryption
|
|
963
|
+
* @param {string} data
|
|
964
|
+
* @returns {string}
|
|
965
|
+
*/
|
|
966
|
+
decryptAES(data: string): string;
|
|
967
|
+
/**
|
|
968
|
+
* Encodes some data with a symmetric AES encryption
|
|
969
|
+
* @param {string} data
|
|
970
|
+
* @returns {string}
|
|
971
|
+
*/
|
|
972
|
+
encryptAES(data: string): string;
|
|
973
|
+
/**
|
|
974
|
+
* This is the default password generation used by Marketing Cloud in their AMPScript
|
|
975
|
+
* @protected
|
|
976
|
+
*/
|
|
977
|
+
protected _buildKey(): WordArray;
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
declare class SmpCrypto {
|
|
981
|
+
static base64Decode(str: string): string;
|
|
982
|
+
static base64Encode(str: string): string;
|
|
983
|
+
static md5(data: string): string;
|
|
984
|
+
static sha1(data: string): string;
|
|
985
|
+
static sha256(data: string): string;
|
|
986
|
+
static sha512(data: string): string;
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
/**
|
|
990
|
+
* Util to generate predictable secure codes based on a base serial
|
|
991
|
+
*/
|
|
992
|
+
declare class SmpSecureCode {
|
|
993
|
+
protected _baseCode: string;
|
|
994
|
+
get baseCode(): string;
|
|
995
|
+
get secureCode(): string;
|
|
996
|
+
protected _crcLength: number;
|
|
997
|
+
protected _seed: string;
|
|
998
|
+
constructor(_baseCode: string);
|
|
999
|
+
/**
|
|
1000
|
+
* Checks secure code, throws a 400 error on failure
|
|
1001
|
+
* @param giftcardCode
|
|
1002
|
+
* @param pinToVerify
|
|
1003
|
+
*/
|
|
1004
|
+
static check<T extends string>(giftcardCode: string, pinToVerify: T): asserts giftcardCode is T;
|
|
1005
|
+
protected _encode(): string;
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
declare enum SmpFirebaseErrors {
|
|
1009
|
+
DIFFERENT_CREDENTIAL = "auth/account-exists-with-different-credential",
|
|
1010
|
+
DIFFERENT_CREDENTIAL_APPLE = "auth/account-exists-with-different-credential/apple",
|
|
1011
|
+
DIFFERENT_CREDENTIAL_FACEBOOK = "auth/account-exists-with-different-credential/facebook",
|
|
1012
|
+
DIFFERENT_CREDENTIAL_GOOGLE = "auth/account-exists-with-different-credential/google",
|
|
1013
|
+
EMAIL_EXISTS = "auth/email-already-exists",
|
|
1014
|
+
INVALID_ACTION_CODE = "auth/invalid-action-code",
|
|
1015
|
+
POPUP_BLOCKED = "auth/popup-blocked",
|
|
1016
|
+
POPUP_CLOSED_BY_USER = "auth/popup-closed-by-user",
|
|
1017
|
+
USER_NOT_FOUND = "auth/user-not-found",
|
|
1018
|
+
WRONG_PASSWORD = "auth/wrong-password"
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
declare enum SmpGiftcardTransactionOps {
|
|
1022
|
+
ACTIVATE = "ACTIVATE",
|
|
1023
|
+
BLOCK = "BLOCK",
|
|
1024
|
+
CHECK = "CHECK",
|
|
1025
|
+
DIGITAL_ACTIVATE = "DIGITAL_ACTIVATE",
|
|
1026
|
+
FREEZE = "FREEZE",
|
|
1027
|
+
PURCHASE = "PURCHASE",
|
|
1028
|
+
RECHARGE = "RECHARGE",
|
|
1029
|
+
ROLLBACK = "ROLLBACK",
|
|
1030
|
+
TRANSACTION = "TRANSACTION",
|
|
1031
|
+
TRANSACTION_DETAIL = "TRANSACTION_DETAIL",
|
|
1032
|
+
UNFREEZE = "UNFREEZE",
|
|
1033
|
+
XREFUND = "XREFUND"
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
interface SmpGiftcardTransactionPlain {
|
|
1037
|
+
gc: string;
|
|
1038
|
+
op: string;
|
|
1039
|
+
ot?: string;
|
|
1040
|
+
ts: number;
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
interface SmpGiftcardTransactionConfig {
|
|
1044
|
+
gc?: string;
|
|
1045
|
+
op: SmpGiftcardTransactionOps;
|
|
1046
|
+
ot?: string;
|
|
1047
|
+
dto?: DateTime;
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
declare enum SmpGiftcardTransactionHashStrategies {
|
|
1051
|
+
MD5 = "MD5",
|
|
1052
|
+
MD5_HMAC = "MD5_HMAC",
|
|
1053
|
+
SHA1 = "SHA1",
|
|
1054
|
+
SHA1_HMAC = "SHA1_HMAC"
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
/**
|
|
1058
|
+
* Base implementation that you can extend, even customizing the static parts like #SmpGiftcardTransaction._AES_ENCODER.
|
|
1059
|
+
* You can create your own instance of KikAesCrypt to override it.
|
|
1060
|
+
*/
|
|
1061
|
+
declare class SmpGiftcardTransaction implements SmpGiftcardTransactionPlain {
|
|
1062
|
+
readonly gc: string;
|
|
1063
|
+
readonly op: SmpGiftcardTransactionOps;
|
|
1064
|
+
readonly ot?: string | undefined;
|
|
1065
|
+
protected static _AES_ENCODER: SmpAesCrypt;
|
|
1066
|
+
protected static _LOGGER: SmpLoggerMethods;
|
|
1067
|
+
protected static _OP_CODES: Record<SmpGiftcardTransactionOps, string>;
|
|
1068
|
+
protected static readonly _SEP: string;
|
|
1069
|
+
get dto(): DateTime;
|
|
1070
|
+
get hash(): string;
|
|
1071
|
+
get iso(): string;
|
|
1072
|
+
get ts(): number;
|
|
1073
|
+
/**
|
|
1074
|
+
* A DateTime with second precision
|
|
1075
|
+
* @protected
|
|
1076
|
+
*/
|
|
1077
|
+
protected _dto: DateTime;
|
|
1078
|
+
protected _hashStrategies: Record<SmpGiftcardTransactionHashStrategies, any>;
|
|
1079
|
+
protected _hashStrategy: (str: string) => WordArray;
|
|
1080
|
+
/**
|
|
1081
|
+
*
|
|
1082
|
+
* @param gc giftcard code
|
|
1083
|
+
* @param op operation
|
|
1084
|
+
* @param ot original transaction in case of refund
|
|
1085
|
+
* @param unixTimestampOrMilliseconds
|
|
1086
|
+
*/
|
|
1087
|
+
constructor(gc: string | undefined, // If we're issuing a digital giftcard we won't have the gc code
|
|
1088
|
+
op: SmpGiftcardTransactionOps, ot?: string | undefined, unixTimestampOrMilliseconds?: number);
|
|
1089
|
+
static build({ gc, op, ot, dto }: SmpGiftcardTransactionConfig): SmpGiftcardTransaction;
|
|
1090
|
+
/**
|
|
1091
|
+
* @deprecated this method is related to the old transactionId format and will be removed in a few months
|
|
1092
|
+
* (around September 2024, since we can safely assume that you can refund those transactions for around 1 month,
|
|
1093
|
+
* which means by then all new payment transactions will have the new format)
|
|
1094
|
+
* @param transactionId
|
|
1095
|
+
*/
|
|
1096
|
+
static explode(transactionId: string): SmpGiftcardTransaction;
|
|
1097
|
+
static isBase64(str: string): boolean;
|
|
1098
|
+
static parse(transactionId: string): SmpGiftcardTransaction;
|
|
1099
|
+
static prefixToOperation(prefix: string): SmpGiftcardTransactionOps;
|
|
1100
|
+
serialize(): SmpGiftcardTransactionPlain;
|
|
1101
|
+
toString(): string;
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
declare enum SmpMarketingCloudValidators {
|
|
1105
|
+
ListDetectiveValidator = "ListDetectiveValidator",
|
|
1106
|
+
MXValidator = "MXValidator",
|
|
1107
|
+
SyntaxValidator = "SyntaxValidator"
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
interface SmpMarketingCloudValidationResponseOk {
|
|
1111
|
+
email: string;
|
|
1112
|
+
valid: true;
|
|
1113
|
+
}
|
|
1114
|
+
interface SmpMarketingCloudValidationResponseKo {
|
|
1115
|
+
email: string;
|
|
1116
|
+
valid: boolean;
|
|
1117
|
+
failedValidation: SmpMarketingCloudValidators;
|
|
1118
|
+
}
|
|
1119
|
+
type SmpMarketingCloudValidationResponse = SmpMarketingCloudValidationResponseOk | SmpMarketingCloudValidationResponseKo;
|
|
1120
|
+
|
|
1121
|
+
declare function smpApplyMixin<T extends SmpGenericConstructor>(derivedCtor: T, baseCtors: SmpGenericConstructor[]): void;
|
|
1122
|
+
|
|
1123
|
+
declare class SmpCommonUtils {
|
|
1124
|
+
/**
|
|
1125
|
+
* Removes items the predicate returns truthy for from the source array and returns them
|
|
1126
|
+
*/
|
|
1127
|
+
static arrayRemove<T = any>(array: T[], iteratee: (item: T, index: number) => any): T[];
|
|
1128
|
+
static assertIsArray<T>(entity: T[], withMessage?: string): asserts entity is T[];
|
|
1129
|
+
static assertIsBoolean(entity: any, withMessage?: string): asserts entity is boolean;
|
|
1130
|
+
static assertIsFunction(entity: any, withMessage?: string): asserts entity is Function;
|
|
1131
|
+
static assertIsInstance(entity: any, klass: new (...args: any[]) => any, withMessage?: string): asserts entity is typeof klass;
|
|
1132
|
+
static assertIsNotEmpty(val: any, withMessage?: string): void;
|
|
1133
|
+
static assertIsNumber(entity: any, withMessage?: string): asserts entity is number;
|
|
1134
|
+
static assertIsNumeric(entity: any, withMessage?: string): void;
|
|
1135
|
+
static assertIsObject(entity: any, withMessage?: string): asserts entity is object;
|
|
1136
|
+
static assertIsString(entity: any, withMessage?: string): asserts entity is string;
|
|
1137
|
+
static assertIsTruthy<T>(condition: T, withMessage?: string): asserts condition;
|
|
1138
|
+
static buildPath(...args: any[]): string;
|
|
1139
|
+
static downloadBlob(blob: Blob, filename: string): void;
|
|
1140
|
+
static generateRandomHexString(length?: number): string;
|
|
1141
|
+
static generateUUID(): string;
|
|
1142
|
+
static getDecimalPrecision(val: number | string): number;
|
|
1143
|
+
/**
|
|
1144
|
+
* More accurately check the type of JavaScript object
|
|
1145
|
+
* @param {Object} entity The object
|
|
1146
|
+
* @return {String} The object type
|
|
1147
|
+
*/
|
|
1148
|
+
static getType(entity: any): string;
|
|
1149
|
+
static isBoolean(value: any): value is boolean;
|
|
1150
|
+
/**
|
|
1151
|
+
* Returns true if string is a valid CSS color
|
|
1152
|
+
* @param str
|
|
1153
|
+
*/
|
|
1154
|
+
static isColor(str: string): boolean;
|
|
1155
|
+
static isEmpty(entity: any): boolean;
|
|
1156
|
+
/**
|
|
1157
|
+
*
|
|
1158
|
+
* @param value1 {any} first term of comparison
|
|
1159
|
+
* @param value2 {any} second term of comparison
|
|
1160
|
+
*
|
|
1161
|
+
* @returns boolean
|
|
1162
|
+
*/
|
|
1163
|
+
static isEqual(value1: any, value2: any): boolean;
|
|
1164
|
+
static isFormField(el: HTMLElement): boolean;
|
|
1165
|
+
static isFunction(entity: any): entity is Function;
|
|
1166
|
+
static isNotEmpty(entity: any): boolean;
|
|
1167
|
+
/**
|
|
1168
|
+
* Returns true if the entity is a number
|
|
1169
|
+
* @param entity
|
|
1170
|
+
*/
|
|
1171
|
+
static isNumber(entity: any): entity is number;
|
|
1172
|
+
/**
|
|
1173
|
+
* Returns true whether you're dealing with a numeric entity. Use isNumber if you want exact type check
|
|
1174
|
+
* @param entity
|
|
1175
|
+
*/
|
|
1176
|
+
static isNumeric(entity: any): boolean;
|
|
1177
|
+
static isObject(entity: any): entity is object;
|
|
1178
|
+
/**
|
|
1179
|
+
* This one is from underscore.js 1.13.6
|
|
1180
|
+
* It basically checks if a value is generically an object (meaning Array, Date, Map).
|
|
1181
|
+
* If you want a strict check use SmpCommonUtils.isObject instead.
|
|
1182
|
+
* [TS] TODO: It would be nice to exclude String, Number, Boolean and Symbol, but for now, this will do
|
|
1183
|
+
* @param entity
|
|
1184
|
+
* @returns {boolean}
|
|
1185
|
+
*/
|
|
1186
|
+
static isPrimitive(entity: any): boolean;
|
|
1187
|
+
static isString(entity: any): entity is string;
|
|
1188
|
+
static isWindows(): boolean;
|
|
1189
|
+
/**
|
|
1190
|
+
*
|
|
1191
|
+
* @param objLike object or array
|
|
1192
|
+
* @param iteratee the map fn
|
|
1193
|
+
*/
|
|
1194
|
+
static mapObject<T = any>(objLike: any, iteratee: (v: any, indexOrKey: string | number, arr?: string[]) => any): T[];
|
|
1195
|
+
static mapObjectKeys<T extends string = string>(obj: Record<T, any>, callback: (key: string, value: any) => any): Record<string, any>;
|
|
1196
|
+
static mapObjectValues<T extends string = string>(obj: Partial<Record<T, any>>, callback: (value: any, key: string) => any): Record<string, any>;
|
|
1197
|
+
static noop(): void;
|
|
1198
|
+
static objectHasValue<T extends object>(obj: T, value: any): boolean;
|
|
1199
|
+
static omit<T extends object, K extends keyof T>(obj: T, keys: K[]): Omit<T, K>;
|
|
1200
|
+
static parseBoolean(str?: string): boolean;
|
|
1201
|
+
static parseJsonSafely<T = any>(str: string): T | void;
|
|
1202
|
+
static pick<T extends object, K extends keyof T>(obj: T, keys: K[]): Pick<T, K>;
|
|
1203
|
+
static runSafely<V = any, U = any, T extends Function = (...args: V[]) => U>(fn?: T, thisArg?: null, params?: V[]): U | void;
|
|
1204
|
+
static sleep(timeToDelay: number): Promise<unknown>;
|
|
1205
|
+
static sprintf(str: string, ...argv: (string | number | symbol)[]): string;
|
|
1206
|
+
static stripComments(html: string): string;
|
|
1207
|
+
static submitFakeForm<T extends object = object>({ action, method, data, target }: {
|
|
1208
|
+
action: string;
|
|
1209
|
+
method: SmpRestVerbs;
|
|
1210
|
+
data?: T;
|
|
1211
|
+
target?: "_blank" | "_self";
|
|
1212
|
+
}): void;
|
|
1213
|
+
static toCamelCase(s: string): string;
|
|
1214
|
+
static toKebabCase(s: string): string;
|
|
1215
|
+
static toPascalCase(s: string): string;
|
|
1216
|
+
static toSnakeCase(s: string): string;
|
|
1217
|
+
static toUpperSnakeCase(s: string): string;
|
|
1218
|
+
static words(string: string, pattern?: RegExp): string[];
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
declare class SmpFilterException extends Error {
|
|
1222
|
+
message: string;
|
|
1223
|
+
data?: any | undefined;
|
|
1224
|
+
constructor(message?: string, data?: any | undefined);
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
/**
|
|
1228
|
+
* A util to generate session ids
|
|
1229
|
+
*/
|
|
1230
|
+
declare class SmpSid implements SmpCachedValue<string> {
|
|
1231
|
+
value: string;
|
|
1232
|
+
expiry: number;
|
|
1233
|
+
get active(): boolean;
|
|
1234
|
+
get expired(): boolean;
|
|
1235
|
+
get valid(): boolean;
|
|
1236
|
+
protected _controlSuffix: string;
|
|
1237
|
+
constructor(value?: string, expiry?: number);
|
|
1238
|
+
static parse(raw: SmpCachedValue<string>): SmpSid;
|
|
1239
|
+
toPlain(): SmpCachedValue<string>;
|
|
1240
|
+
}
|
|
1241
|
+
|
|
1242
|
+
declare class SmpRegularExpressions {
|
|
1243
|
+
static get COUNTRY(): RegExp;
|
|
1244
|
+
static get DOMAIN(): RegExp;
|
|
1245
|
+
static get EMAIL(): RegExp;
|
|
1246
|
+
static get LANGUAGE(): RegExp;
|
|
1247
|
+
static get LATIN_CHARS(): RegExp;
|
|
1248
|
+
static get LOCALE(): RegExp;
|
|
1249
|
+
static get NO_EMOJI_NO_PUNCTUATION(): RegExp;
|
|
1250
|
+
static get PHONE_NUMBER(): RegExp;
|
|
1251
|
+
static get PHONE_NUMBER_BY_PREFIX(): Record<string, Record<string, RegExp>>;
|
|
1252
|
+
static get TAXCODE_BY_COUNTRY(): Record<string, Record<string, RegExp>>;
|
|
1253
|
+
protected static _country: RegExp;
|
|
1254
|
+
protected static _language: RegExp;
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
declare class SmpInMemoryCache extends SmpAbstractTtlCacheStrategy {
|
|
1258
|
+
private static _storage;
|
|
1259
|
+
protected get _staticSelf(): typeof SmpInMemoryCache;
|
|
1260
|
+
protected _flushRaw(): void;
|
|
1261
|
+
protected _readRaw(key: string): unknown | undefined;
|
|
1262
|
+
protected _removeRaw(key: string): void;
|
|
1263
|
+
protected _writeRaw(key: string, value: unknown): void;
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
/**
|
|
1267
|
+
* Tells you if a value is a SmpCachedValue
|
|
1268
|
+
* @param value
|
|
1269
|
+
*/
|
|
1270
|
+
declare function smpIsSmpCachedValue<T>(value: unknown): value is SmpCachedValue<T>;
|
|
1271
|
+
|
|
1272
|
+
declare const VERSION: "1.8.0";
|
|
66
1273
|
|
|
67
1274
|
declare const SmpDynamoService: typeof SmpDynamoService$1;
|
|
68
1275
|
declare const SmpFirebaseService: typeof SmpFirebaseService$1;
|
|
@@ -76,4 +1283,4 @@ declare const smpRxjsThrowOnCondition: typeof smpRxjsThrowOnCondition$1;
|
|
|
76
1283
|
declare const smpZodDateTime: typeof smpZodDateTime$1;
|
|
77
1284
|
declare const SmpZodDateTime: typeof SmpZodDateTime$1;
|
|
78
1285
|
|
|
79
|
-
export { SmpAbstractRxjsTtlCacheStrategy, SmpDynamoService, SmpFirebaseService, SmpRxjsInMemoryCache, SmpZodDateTime, VERSION, smpRxjsCatchOnly, smpRxjsQueue, smpRxjsSequence, smpRxjsThrowIfEmpty, smpRxjsThrowOnCondition, smpZodDateTime };
|
|
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 };
|