@tonysamperi/ts-mapi-core 1.7.0 → 1.8.0-next.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 +7 -0
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +6 -4
- package/dist/cjs/services/firebase/index.cjs +1 -1
- package/dist/cjs/services/firebase/index.cjs.map +1 -1
- package/dist/cjs/services/firebase/smp-firebase.service.cjs +1 -1
- package/dist/cjs/services/firebase/smp-firebase.service.cjs.map +1 -1
- package/dist/cjs/services/http/index.cjs +1 -1
- package/dist/cjs/services/http/index.cjs.map +1 -1
- package/dist/cjs/services/http/smp-http-session-storage-cache.class.cjs.map +1 -1
- package/dist/cjs/services/http/smp-http-status-code.enum.cjs +1 -1
- package/dist/cjs/services/http/smp-http-status-code.enum.cjs.map +1 -1
- package/dist/cjs/services/http/smp-http.service.cjs +1 -1
- package/dist/cjs/services/http/smp-http.service.cjs.map +1 -1
- package/dist/cjs/services/index.cjs +1 -1
- package/dist/cjs/services/index.cjs.map +1 -1
- package/dist/cjs/services/smp-dynamo.service.cjs +1 -1
- package/dist/cjs/services/smp-dynamo.service.cjs.map +1 -1
- package/dist/cjs/shared/api/index.cjs +1 -1
- package/dist/cjs/shared/api/index.cjs.map +1 -1
- package/dist/cjs/shared/api/index.d.cts +1 -1
- package/dist/cjs/shared/api/smp-api-common-utils.class.cjs.map +1 -1
- package/dist/cjs/shared/api/{smp-error-response-build-opts.interface.cjs → smp-error-response-create-opts.interface.cjs} +1 -1
- package/dist/cjs/shared/api/smp-error-response-create-opts.interface.cjs.map +1 -0
- package/dist/cjs/shared/api/smp-error-response.class.cjs +1 -1
- package/dist/cjs/shared/api/smp-error-response.class.cjs.map +1 -1
- package/dist/cjs/shared/api/smp-error-response.class.d.cts +1 -1
- package/dist/cjs/shared/api/smp-generic-response.class.cjs +1 -1
- package/dist/cjs/shared/api/smp-generic-response.class.cjs.map +1 -1
- package/dist/cjs/shared/api/smp-response-message-types.enum.cjs +1 -1
- package/dist/cjs/shared/api/smp-response-message-types.enum.cjs.map +1 -1
- package/dist/cjs/shared/api/smp-response-message.class.cjs +1 -1
- package/dist/cjs/shared/api/smp-response-message.class.cjs.map +1 -1
- package/dist/cjs/shared/api/smp-rest-verbs.enum.cjs +1 -1
- package/dist/cjs/shared/api/smp-rest-verbs.enum.cjs.map +1 -1
- package/dist/cjs/shared/common/index.cjs +1 -1
- package/dist/cjs/shared/common/index.cjs.map +1 -1
- package/dist/cjs/shared/common/index.d.cts +2 -0
- package/dist/cjs/shared/common/smp-base-jwt-token-plain.interface.cjs +2 -0
- package/dist/cjs/shared/common/smp-base-jwt-token-plain.interface.cjs.map +1 -0
- package/dist/cjs/shared/common/smp-base-jwt-token-plain.interface.d.cts +7 -0
- package/dist/cjs/shared/common/smp-base-jwt-token.class.cjs +2 -0
- package/dist/cjs/shared/common/smp-base-jwt-token.class.cjs.map +1 -0
- package/dist/cjs/shared/common/smp-base-jwt-token.class.d.cts +14 -0
- package/dist/cjs/shared/common/smp-generic-constructor.type.cjs.map +1 -1
- package/dist/cjs/shared/common/smp-generic-constructor.type.d.cts +1 -1
- package/dist/cjs/shared/common/smp-social-sign-in-keys.enum.cjs +1 -1
- package/dist/cjs/shared/common/smp-social-sign-in-keys.enum.cjs.map +1 -1
- package/dist/cjs/shared/common/smp-social-sign-in-ux-modes.enum.cjs +1 -1
- package/dist/cjs/shared/common/smp-social-sign-in-ux-modes.enum.cjs.map +1 -1
- package/dist/cjs/shared/crypto/index.cjs +1 -1
- package/dist/cjs/shared/crypto/index.cjs.map +1 -1
- package/dist/cjs/shared/crypto/smp-aes-crypt.class.cjs +1 -1
- package/dist/cjs/shared/crypto/smp-aes-crypt.class.cjs.map +1 -1
- package/dist/cjs/shared/crypto/smp-crypto.class.cjs.map +1 -1
- package/dist/cjs/shared/crypto/smp-secure-code.class.cjs +1 -1
- package/dist/cjs/shared/crypto/smp-secure-code.class.cjs.map +1 -1
- package/dist/cjs/shared/firebase/index.cjs +1 -1
- package/dist/cjs/shared/firebase/index.cjs.map +1 -1
- package/dist/cjs/shared/firebase/smp-firebase-errors.enum.cjs +1 -1
- package/dist/cjs/shared/firebase/smp-firebase-errors.enum.cjs.map +1 -1
- package/dist/cjs/shared/giftcard/index.cjs +1 -1
- package/dist/cjs/shared/giftcard/index.cjs.map +1 -1
- package/dist/cjs/shared/giftcard/smp-giftcard-transaction-hash-strategies.enum.cjs +1 -1
- package/dist/cjs/shared/giftcard/smp-giftcard-transaction-hash-strategies.enum.cjs.map +1 -1
- package/dist/cjs/shared/giftcard/smp-giftcard-transaction-ops.enum.cjs +1 -1
- package/dist/cjs/shared/giftcard/smp-giftcard-transaction-ops.enum.cjs.map +1 -1
- package/dist/cjs/shared/giftcard/smp-giftcard-transaction.class.cjs +1 -1
- package/dist/cjs/shared/giftcard/smp-giftcard-transaction.class.cjs.map +1 -1
- package/dist/cjs/shared/marketing-cloud/index.cjs +1 -1
- package/dist/cjs/shared/marketing-cloud/index.cjs.map +1 -1
- package/dist/cjs/shared/marketing-cloud/smp-marketing-cloud-validators.enum.cjs +1 -1
- package/dist/cjs/shared/marketing-cloud/smp-marketing-cloud-validators.enum.cjs.map +1 -1
- package/dist/cjs/shared/rxjs/index.cjs +1 -1
- package/dist/cjs/shared/rxjs/index.cjs.map +1 -1
- package/dist/cjs/shared/rxjs/smp-abstract-rxjs-ttl-cache-strategy.class.cjs.map +1 -1
- package/dist/cjs/shared/rxjs/smp-rxjs-catch-only.function.cjs.map +1 -1
- package/dist/cjs/shared/rxjs/smp-rxjs-in-memory-cache.class.cjs.map +1 -1
- package/dist/cjs/shared/rxjs/smp-rxjs-queue.function.cjs +1 -1
- package/dist/cjs/shared/rxjs/smp-rxjs-queue.function.cjs.map +1 -1
- package/dist/cjs/shared/rxjs/smp-rxjs-queue.function.d.cts +3 -15
- package/dist/cjs/shared/rxjs/smp-rxjs-sequence.function.cjs +1 -1
- package/dist/cjs/shared/rxjs/smp-rxjs-sequence.function.cjs.map +1 -1
- package/dist/cjs/shared/rxjs/smp-rxjs-sequence.function.d.cts +4 -3
- package/dist/cjs/shared/utils/cache/index.cjs.map +1 -1
- package/dist/cjs/shared/utils/cache/smp-abstract-cache-strategy.class.cjs.map +1 -1
- package/dist/cjs/shared/utils/cache/smp-abstract-cache-strategy.class.d.cts +6 -0
- package/dist/cjs/shared/utils/cache/smp-abstract-ttl-cache-strategy.class.cjs.map +1 -1
- package/dist/cjs/shared/utils/cache/smp-browser-cache.class.cjs.map +1 -1
- package/dist/cjs/shared/utils/cache/smp-in-memory-cache.class.cjs.map +1 -1
- package/dist/cjs/shared/utils/index.cjs +1 -1
- package/dist/cjs/shared/utils/index.cjs.map +1 -1
- package/dist/cjs/shared/utils/smp-common-utils.class.cjs +1 -1
- package/dist/cjs/shared/utils/smp-common-utils.class.cjs.map +1 -1
- package/dist/cjs/shared/utils/smp-filter-exception.class.cjs.map +1 -1
- package/dist/cjs/shared/utils/smp-sid.class.cjs +1 -1
- package/dist/cjs/shared/utils/smp-sid.class.cjs.map +1 -1
- package/dist/cjs/shared/zod/index.cjs.map +1 -1
- package/dist/cjs/shared/zod/smp-zod-date-time.definition.cjs.map +1 -1
- package/dist/esm/chunk-2UDNZC5A.js +1 -0
- package/dist/esm/chunk-3HRZ6R3F.js +1 -0
- package/dist/esm/chunk-4TNTWTMN.js +1 -0
- package/dist/esm/chunk-5WULAY6L.js +1 -0
- package/dist/esm/{chunk-V2OQU7B5.js → chunk-7CWGJ3NF.js} +1 -1
- package/dist/esm/{chunk-S3E7FKAY.js → chunk-CFV5G67M.js} +1 -1
- package/dist/esm/{chunk-YYOHQHR4.js → chunk-ET5LYR3A.js} +1 -1
- package/dist/esm/{chunk-3AFPQCOH.js → chunk-FTXCYY5S.js} +1 -1
- package/dist/esm/chunk-FUHGPBNJ.js +1 -0
- package/dist/esm/chunk-G7PUYG2K.js +1 -0
- package/dist/esm/chunk-GRXWCGMW.js +1 -0
- package/dist/esm/{chunk-ENM3HAPF.js → chunk-JE3FPJGV.js} +1 -1
- package/dist/esm/chunk-JXSMI3MI.js +1 -0
- package/dist/esm/chunk-L7KNFRNV.js +1 -0
- package/dist/esm/chunk-MLBCWEB4.js +1 -0
- package/dist/esm/{chunk-NVYQBLR6.js → chunk-MRKAFTDG.js} +1 -1
- package/dist/esm/chunk-OUSY7GMI.js +1 -0
- package/dist/esm/{chunk-GALYBKBP.js → chunk-QK6DPGU6.js} +1 -1
- package/dist/esm/chunk-QRCMHI3B.js +1 -0
- package/dist/esm/chunk-QTWLHW3D.js +1 -0
- package/dist/esm/chunk-QYDMV6LH.js +1 -0
- package/dist/esm/chunk-RAJGA43T.js +1 -0
- package/dist/esm/chunk-RAVJJJYE.js +1 -0
- package/dist/esm/{chunk-FAUAQNPB.js → chunk-SJOEBOGG.js} +1 -1
- package/dist/esm/chunk-SPPRTVHH.js +1 -0
- package/dist/esm/chunk-TGY6ZSQU.js +1 -0
- package/dist/esm/{chunk-7MD4IY4X.js → chunk-TSC2BSSL.js} +1 -1
- package/dist/esm/chunk-VHMV4QQT.js +1 -0
- package/dist/esm/{chunk-JFKLRHIQ.js → chunk-YEQJ4M3P.js} +1 -1
- package/dist/esm/{chunk-DTVHTARR.js → chunk-ZTDFA2UA.js} +1 -1
- package/dist/esm/index.d.ts +5 -3
- package/dist/esm/index.js +1 -1
- package/dist/esm/services/firebase/index.js +1 -1
- package/dist/esm/services/firebase/smp-firebase-service-config.interface.js +0 -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-session-storage-cache.class.js +1 -1
- package/dist/esm/services/http/smp-http-status-code.enum.js +1 -1
- package/dist/esm/services/http/smp-http.service.js +1 -1
- package/dist/esm/services/index.js +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-error-response-create-opts.interface.js +1 -0
- package/dist/esm/shared/api/smp-error-response.class.d.ts +1 -1
- package/dist/esm/shared/api/smp-error-response.class.js +1 -1
- package/dist/esm/shared/api/smp-generic-response.class.js +1 -1
- package/dist/esm/shared/api/smp-response-message-types.enum.js +1 -1
- package/dist/esm/shared/api/smp-response-message.class.js +1 -1
- package/dist/esm/shared/api/smp-rest-verbs.enum.js +1 -1
- package/dist/esm/shared/common/index.d.ts +2 -0
- package/dist/esm/shared/common/index.js +1 -1
- package/dist/esm/shared/common/smp-base-jwt-token-plain.interface.d.ts +7 -0
- package/dist/esm/shared/common/smp-base-jwt-token-plain.interface.js +1 -0
- package/dist/esm/shared/common/smp-base-jwt-token.class.d.ts +14 -0
- package/dist/esm/shared/common/smp-base-jwt-token.class.js +1 -0
- package/dist/esm/shared/common/smp-generic-constructor.type.d.ts +1 -1
- package/dist/esm/shared/common/smp-social-sign-in-keys.enum.js +1 -1
- package/dist/esm/shared/common/smp-social-sign-in-ux-modes.enum.js +1 -1
- package/dist/esm/shared/crypto/index.js +1 -1
- package/dist/esm/shared/crypto/smp-aes-crypt.class.js +1 -1
- package/dist/esm/shared/crypto/smp-secure-code.class.js +1 -1
- package/dist/esm/shared/firebase/index.js +1 -1
- package/dist/esm/shared/firebase/smp-firebase-errors.enum.js +1 -1
- package/dist/esm/shared/giftcard/index.js +1 -1
- package/dist/esm/shared/giftcard/smp-giftcard-transaction-hash-strategies.enum.js +1 -1
- package/dist/esm/shared/giftcard/smp-giftcard-transaction-ops.enum.js +1 -1
- package/dist/esm/shared/giftcard/smp-giftcard-transaction.class.js +1 -1
- package/dist/esm/shared/marketing-cloud/index.js +1 -1
- package/dist/esm/shared/marketing-cloud/smp-marketing-cloud-validators.enum.js +1 -1
- package/dist/esm/shared/rxjs/index.js +1 -1
- package/dist/esm/shared/rxjs/smp-abstract-rxjs-ttl-cache-strategy.class.js +1 -1
- package/dist/esm/shared/rxjs/smp-rxjs-in-memory-cache.class.js +1 -1
- package/dist/esm/shared/rxjs/smp-rxjs-queue.function.d.ts +3 -15
- package/dist/esm/shared/rxjs/smp-rxjs-queue.function.js +1 -1
- package/dist/esm/shared/rxjs/smp-rxjs-sequence.function.d.ts +4 -3
- package/dist/esm/shared/rxjs/smp-rxjs-sequence.function.js +1 -1
- package/dist/esm/shared/utils/cache/index.js +1 -1
- package/dist/esm/shared/utils/cache/smp-abstract-cache-strategy.class.d.ts +6 -0
- package/dist/esm/shared/utils/cache/smp-abstract-ttl-cache-strategy.class.js +1 -1
- package/dist/esm/shared/utils/cache/smp-browser-cache.class.js +1 -1
- package/dist/esm/shared/utils/cache/smp-in-memory-cache.class.js +1 -1
- package/dist/esm/shared/utils/index.js +1 -1
- package/dist/esm/shared/utils/smp-common-utils.class.js +1 -1
- package/dist/esm/shared/utils/smp-sid.class.js +1 -1
- package/package.json +2 -2
- package/dist/cjs/shared/api/smp-error-response-build-opts.interface.cjs.map +0 -1
- package/dist/esm/chunk-3TSDCOVH.js +0 -1
- package/dist/esm/chunk-4A2VEL4I.js +0 -1
- package/dist/esm/chunk-4NS456EU.js +0 -1
- package/dist/esm/chunk-5XYURNIE.js +0 -1
- package/dist/esm/chunk-JF4ZPHEK.js +0 -1
- package/dist/esm/chunk-JXXO4LSO.js +0 -1
- package/dist/esm/chunk-LB7RIIRT.js +0 -1
- package/dist/esm/chunk-MMNEY2JK.js +0 -1
- package/dist/esm/chunk-QECKVXF4.js +0 -1
- package/dist/esm/chunk-S7DRNW2X.js +0 -1
- package/dist/esm/chunk-U4GEYICC.js +0 -1
- package/dist/esm/chunk-VP72PKJQ.js +0 -1
- package/dist/esm/chunk-W462XDMF.js +0 -1
- package/dist/esm/chunk-WLD2KYV4.js +0 -1
- package/dist/esm/chunk-YFGB7SCJ.js +0 -0
- package/dist/esm/chunk-Z3K5PNSB.js +0 -1
- package/dist/esm/chunk-Z5KZUWJJ.js +0 -1
- package/dist/esm/chunk-Z7KKB4KI.js +0 -1
- package/dist/esm/shared/api/smp-error-response-build-opts.interface.js +0 -1
- /package/dist/cjs/shared/api/{smp-error-response-build-opts.interface.d.cts → smp-error-response-create-opts.interface.d.cts} +0 -0
- /package/dist/esm/{chunk-EHABREBA.js → chunk-2JBVVJ2E.js} +0 -0
- /package/dist/esm/{chunk-FAYDNSZG.js → chunk-HM7F3YYW.js} +0 -0
- /package/dist/esm/{chunk-NHNK7NE2.js → chunk-I3CNDIWD.js} +0 -0
- /package/dist/esm/shared/api/{smp-error-response-build-opts.interface.d.ts → smp-error-response-create-opts.interface.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/shared/zod/index.ts","../../../../src/shared/zod/smp-zod-date-time.definition.ts"],"sourcesContent":["export * from \"./smp-zod-date-time.definition.js\";\n","import z, {ZodTypeDef, ZodIssueCode, ParseInput, ParseContext, ParseReturnType, ZodParsedType} from \"zod\";\nimport {DateTime} from \"ts-luxon\";\n\ninterface SmpZodDateTimeCheck {\n kind: \"min\" | \"max\" | \"between\";\n min?: DateTime;\n max?: DateTime;\n message?: string;\n}\n\ninterface SmpZodDateTimeDef extends ZodTypeDef {\n coerce: boolean;\n checks: SmpZodDateTimeCheck[];\n typeName: \"SmpZodDateTime\";\n}\n\nexport class SmpZodDateTime extends z.ZodType<DateTime, SmpZodDateTimeDef> {\n // Constructor and other methods (between, coerce, max, min, _coerceToDateTime) remain the same as your latest version or my previous suggestions.\n // For brevity, only _parse is shown fully modified here. Ensure other parts of the class are consistent.\n\n constructor(def?: Partial<SmpZodDateTimeDef>) {\n super({\n typeName: \"SmpZodDateTime\",\n coerce: def?.coerce ?? false,\n checks: def?.checks ?? []\n });\n }\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n _parse(input: ParseInput): ParseReturnType<DateTime> {\n const ctx = this._getOrReturnCtx(input);\n let val = ctx.data;\n\n if (this._def.coerce) {\n val = this._coerceToDateTime(val); // Assuming _coerceToDateTime is implemented\n if (!(val instanceof DateTime) || !val.isValid) {\n z.addIssueToContext(ctx, { // Changed from ctx.addIssue\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.date, // Using ZodParsedType.date\n received: ZodParsedType.unknown,\n path: ctx.path,\n message: \"Invalid date format\"\n });\n return z.INVALID;\n }\n }\n\n // Ensure val is a DateTime object before proceeding with checks if not coercing\n // or if coercion failed to produce a DateTime (though the above check should catch it)\n if (!(val instanceof DateTime) || !val.isValid) {\n // If not coercing, and it's not a valid DateTime, this is an invalid type.\n // This specific case might be implicitly handled if !this._def.coerce means val must already be DateTime.\n // However, adding an explicit check if not coercing can be safer.\n if (!this._def.coerce) {\n z.addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.date, // Or a custom type name if you prefer\n received: ZodParsedType.unknown, // Or more specific if possible\n path: ctx.path,\n message: \"Input must be a valid DateTime object\"\n });\n return z.INVALID;\n }\n // If coercion was supposed to happen, and we still don't have a valid DateTime,\n // the earlier check inside the `if (this._def.coerce)` block should have caught it.\n }\n\n\n const checkMap: Record<SmpZodDateTimeCheck[\"kind\"], (check: SmpZodDateTimeCheck, dateTimeVal: DateTime, parseCtx: ParseContext) => z.ZodIssue | undefined> = {\n min: (check, dateTimeVal, parseCtx) => {\n if (check.min && dateTimeVal < check.min) {\n return {\n code: ZodIssueCode.too_small,\n minimum: check.min.toMillis(), // Changed to number (milliseconds)\n type: \"date\", // Added type\n inclusive: true,\n message: check.message ?? `Date must be ≥ ${check.min.toISODate()}`,\n path: parseCtx.path\n };\n }\n return undefined;\n },\n max: (check, dateTimeVal, parseCtx) => {\n if (check.max && dateTimeVal > check.max) {\n return {\n code: ZodIssueCode.too_big,\n maximum: check.max.toMillis(), // Changed to number (milliseconds)\n type: \"date\", // Added type\n inclusive: true, // Added inclusive\n message: check.message ?? `Date must be ≤ ${check.max.toISODate()}`,\n path: parseCtx.path\n };\n }\n return undefined;\n },\n between: (check, dateTimeVal, parseCtx) => {\n if (check.min && check.max && (dateTimeVal < check.min || dateTimeVal > check.max)) {\n return {\n code: ZodIssueCode.custom,\n message: check.message ?? `Date must be between ${check.min.toISODate()} and ${check.max.toISODate()}`,\n path: parseCtx.path\n // Optionally, add params for more structured error data:\n // params: { min: check.min.toISO(), max: check.max.toISO() }\n };\n }\n return undefined;\n }\n };\n\n for (const check of this._def.checks) {\n // Ensure val is a DateTime before passing to checkMap functions\n // This is crucial if coercion didn't happen or didn't result in a DateTime.\n // The earlier checks should ideally ensure 'val' is a valid DateTime if it reached this point.\n if (val instanceof DateTime && val.isValid) {\n const issueData = checkMap[check.kind](check, val, ctx);\n if (issueData) {\n z.addIssueToContext(ctx, issueData); // Changed from ctx.addIssue\n }\n }\n else {\n // This case should ideally be caught earlier (e.g., if not coercing, or if coercion failed)\n // If it reaches here, it implies a logic flaw or an unexpected state.\n // For robustness, you might add a generic invalid_type issue here if 'val' is not a DateTime.\n // However, the checks at the beginning of _parse should prevent this.\n }\n }\n\n if (ctx.common.issues.length > 0) { // Check ctx.common.issues.length\n return z.INVALID;\n }\n\n return z.OK(val as DateTime); // Ensure the 'val' returned by OK is typed as DateTime\n }\n\n between(min: DateTime, max: DateTime, message?: string): this {\n return new SmpZodDateTime({\n ...this._def,\n checks: [...this._def.checks, {kind: \"between\", min: min.toUTC(), max: max.toUTC(), message}]\n }) as this;\n }\n\n coerce(): this {\n return new SmpZodDateTime({\n ...this._def,\n coerce: true\n }) as this;\n }\n\n max(max: DateTime, message?: string): this {\n return new SmpZodDateTime({\n ...this._def,\n checks: [...this._def.checks, {kind: \"max\", max: max.toUTC(), message}]\n }) as this;\n }\n\n min(min: DateTime, message?: string): this {\n return new SmpZodDateTime({\n ...this._def,\n checks: [...this._def.checks, {kind: \"min\", min: min.toUTC(), message}]\n }) as this;\n }\n\n // Coercion helper function (ensure it's robust as discussed previously)\n private _coerceToDateTime(val: any): DateTime | null {\n if (val instanceof DateTime && val.isValid) {\n return val; // Already valid DateTime\n }\n\n const coercionMap: Record<string, () => DateTime | null> = {\n string: () => DateTime.fromJSDate(new Date(val)),\n number: () => DateTime.fromMillis(val),\n object: () => DateTime.fromJSDate(val),\n default: () => null\n };\n\n return (coercionMap[typeof val] || coercionMap.default)();\n }\n}\n\nexport const smpZodDateTime = (opts: { coerce?: boolean } = {}) => {\n return new SmpZodDateTime({\n coerce: opts.coerce ?? false,\n checks: []\n });\n};\n"],"mappings":"6mBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oBAAAE,EAAA,mBAAAC,IAAA,eAAAC,EAAAJ,GCAA,IAAAK,EAAoG,oBACpGC,EAAuB,oBAehB,IAAMC,EAAN,MAAMA,UAAuBC,EAAAA,QAAEC,OAAO,CAhB7C,MAgB6C,CAAAC,EAAA,uBAIzCC,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,SACnCjB,SAAAA,QAAEkB,kBAAkBR,EAAK,CACrBS,KAAMC,eAAaC,aACnBC,SAAUC,gBAAcC,KACxBC,SAAUF,gBAAcG,QACxBC,KAAMjB,EAAIiB,KACVC,QAAS,qBACb,CAAA,EACO5B,EAAAA,QAAE6B,QAMjB,IAAI,EAAEjB,aAAeI,aAAa,CAACJ,EAAIK,UAI/B,CAAC,KAAKH,KAAKR,OACXN,SAAAA,QAAEkB,kBAAkBR,EAAK,CACrBS,KAAMC,eAAaC,aACnBC,SAAUC,gBAAcC,KACxBC,SAAUF,gBAAcG,QACxBC,KAAMjB,EAAIiB,KACVC,QAAS,uCACb,CAAA,EACO5B,EAAAA,QAAE6B,QAOjB,IAAMC,EAAuJ,CACzJC,IAAK7B,EAAA,C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_exports","__export","SmpZodDateTime","smpZodDateTime","__toCommonJS","import_zod","import_ts_luxon","SmpZodDateTime","z","ZodType","__name","constructor","def","typeName","coerce","checks","_parse","input","ctx","_getOrReturnCtx","val","data","_def","_coerceToDateTime","DateTime","isValid","addIssueToContext","code","ZodIssueCode","invalid_type","expected","ZodParsedType","date","received","unknown","path","message","INVALID","checkMap","min","check","dateTimeVal","parseCtx","too_small","minimum","toMillis","type","inclusive","toISODate","max","too_big","maximum","between","custom","issueData","kind","common","issues","length","OK","toUTC","coercionMap","string","fromJSDate","Date","number","fromMillis","object","default","smpZodDateTime","opts"]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/shared/zod/index.ts","../../../../src/shared/zod/smp-zod-date-time.definition.ts"],"sourcesContent":["export * from \"./smp-zod-date-time.definition.js\";\n","import z, {ZodTypeDef, ZodIssueCode, ParseInput, ParseContext, ParseReturnType, ZodParsedType} from \"zod\";\nimport {DateTime} from \"ts-luxon\";\n\ninterface SmpZodDateTimeCheck {\n kind: \"min\" | \"max\" | \"between\";\n min?: DateTime;\n max?: DateTime;\n message?: string;\n}\n\ninterface SmpZodDateTimeDef extends ZodTypeDef {\n coerce: boolean;\n checks: SmpZodDateTimeCheck[];\n typeName: \"SmpZodDateTime\";\n}\n\nexport class SmpZodDateTime extends z.ZodType<DateTime, SmpZodDateTimeDef> {\n // Constructor and other methods (between, coerce, max, min, _coerceToDateTime) remain the same as your latest version or my previous suggestions.\n // For brevity, only _parse is shown fully modified here. Ensure other parts of the class are consistent.\n\n constructor(def?: Partial<SmpZodDateTimeDef>) {\n super({\n typeName: \"SmpZodDateTime\",\n coerce: def?.coerce ?? false,\n checks: def?.checks ?? []\n });\n }\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n _parse(input: ParseInput): ParseReturnType<DateTime> {\n const ctx = this._getOrReturnCtx(input);\n let val = ctx.data;\n\n if (this._def.coerce) {\n val = this._coerceToDateTime(val); // Assuming _coerceToDateTime is implemented\n if (!(val instanceof DateTime) || !val.isValid) {\n z.addIssueToContext(ctx, { // Changed from ctx.addIssue\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.date, // Using ZodParsedType.date\n received: ZodParsedType.unknown,\n path: ctx.path,\n message: \"Invalid date format\"\n });\n return z.INVALID;\n }\n }\n\n // Ensure val is a DateTime object before proceeding with checks if not coercing\n // or if coercion failed to produce a DateTime (though the above check should catch it)\n if (!(val instanceof DateTime) || !val.isValid) {\n // If not coercing, and it's not a valid DateTime, this is an invalid type.\n // This specific case might be implicitly handled if !this._def.coerce means val must already be DateTime.\n // However, adding an explicit check if not coercing can be safer.\n if (!this._def.coerce) {\n z.addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.date, // Or a custom type name if you prefer\n received: ZodParsedType.unknown, // Or more specific if possible\n path: ctx.path,\n message: \"Input must be a valid DateTime object\"\n });\n return z.INVALID;\n }\n // If coercion was supposed to happen, and we still don't have a valid DateTime,\n // the earlier check inside the `if (this._def.coerce)` block should have caught it.\n }\n\n\n const checkMap: Record<SmpZodDateTimeCheck[\"kind\"], (check: SmpZodDateTimeCheck, dateTimeVal: DateTime, parseCtx: ParseContext) => z.ZodIssue | undefined> = {\n min: (check, dateTimeVal, parseCtx) => {\n if (check.min && dateTimeVal < check.min) {\n return {\n code: ZodIssueCode.too_small,\n minimum: check.min.toMillis(), // Changed to number (milliseconds)\n type: \"date\", // Added type\n inclusive: true,\n message: check.message ?? `Date must be ≥ ${check.min.toISODate()}`,\n path: parseCtx.path\n };\n }\n return undefined;\n },\n max: (check, dateTimeVal, parseCtx) => {\n if (check.max && dateTimeVal > check.max) {\n return {\n code: ZodIssueCode.too_big,\n maximum: check.max.toMillis(), // Changed to number (milliseconds)\n type: \"date\", // Added type\n inclusive: true, // Added inclusive\n message: check.message ?? `Date must be ≤ ${check.max.toISODate()}`,\n path: parseCtx.path\n };\n }\n return undefined;\n },\n between: (check, dateTimeVal, parseCtx) => {\n if (check.min && check.max && (dateTimeVal < check.min || dateTimeVal > check.max)) {\n return {\n code: ZodIssueCode.custom,\n message: check.message ?? `Date must be between ${check.min.toISODate()} and ${check.max.toISODate()}`,\n path: parseCtx.path\n // Optionally, add params for more structured error data:\n // params: { min: check.min.toISO(), max: check.max.toISO() }\n };\n }\n return undefined;\n }\n };\n\n for (const check of this._def.checks) {\n // Ensure val is a DateTime before passing to checkMap functions\n // This is crucial if coercion didn't happen or didn't result in a DateTime.\n // The earlier checks should ideally ensure 'val' is a valid DateTime if it reached this point.\n if (val instanceof DateTime && val.isValid) {\n const issueData = checkMap[check.kind](check, val, ctx);\n if (issueData) {\n z.addIssueToContext(ctx, issueData); // Changed from ctx.addIssue\n }\n }\n else {\n // This case should ideally be caught earlier (e.g., if not coercing, or if coercion failed)\n // If it reaches here, it implies a logic flaw or an unexpected state.\n // For robustness, you might add a generic invalid_type issue here if 'val' is not a DateTime.\n // However, the checks at the beginning of _parse should prevent this.\n }\n }\n\n if (ctx.common.issues.length > 0) { // Check ctx.common.issues.length\n return z.INVALID;\n }\n\n return z.OK(val as DateTime); // Ensure the 'val' returned by OK is typed as DateTime\n }\n\n between(min: DateTime, max: DateTime, message?: string): this {\n return new SmpZodDateTime({\n ...this._def,\n checks: [...this._def.checks, {kind: \"between\", min: min.toUTC(), max: max.toUTC(), message}]\n }) as this;\n }\n\n coerce(): this {\n return new SmpZodDateTime({\n ...this._def,\n coerce: true\n }) as this;\n }\n\n max(max: DateTime, message?: string): this {\n return new SmpZodDateTime({\n ...this._def,\n checks: [...this._def.checks, {kind: \"max\", max: max.toUTC(), message}]\n }) as this;\n }\n\n min(min: DateTime, message?: string): this {\n return new SmpZodDateTime({\n ...this._def,\n checks: [...this._def.checks, {kind: \"min\", min: min.toUTC(), message}]\n }) as this;\n }\n\n // Coercion helper function (ensure it's robust as discussed previously)\n private _coerceToDateTime(val: any): DateTime | null {\n if (val instanceof DateTime && val.isValid) {\n return val; // Already valid DateTime\n }\n\n const coercionMap: Record<string, () => DateTime | null> = {\n string: () => DateTime.fromJSDate(new Date(val)),\n number: () => DateTime.fromMillis(val),\n object: () => DateTime.fromJSDate(val),\n default: () => null\n };\n\n return (coercionMap[typeof val] || coercionMap.default)();\n }\n}\n\nexport const smpZodDateTime = (opts: { coerce?: boolean } = {}) => {\n return new SmpZodDateTime({\n coerce: opts.coerce ?? false,\n checks: []\n });\n};\n"],"mappings":"6mBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oBAAAE,EAAA,mBAAAC,IAAA,eAAAC,EAAAJ,GCAA,IAAAK,EAAoG,oBACpGC,EAAuB,oBAehB,IAAMC,EAAN,MAAMA,UAAuBC,EAAAA,QAAEC,OAAO,CAhB7C,MAgB6C,CAAAC,EAAA,uBAIzC,YAAYC,EAAkC,CAC1C,MAAM,CACFC,SAAU,iBACVC,OAAQF,GAAKE,QAAU,GACvBC,OAAQH,GAAKG,QAAU,CAAA,CAC3B,CAAA,CACJ,CAGAC,OAAOC,EAA8C,CACjD,IAAMC,EAAM,KAAKC,gBAAgBF,CAAAA,EAC7BG,EAAMF,EAAIG,KAEd,GAAI,KAAKC,KAAKR,SACVM,EAAM,KAAKG,kBAAkBH,CAAAA,EACzB,EAAEA,aAAeI,aAAa,CAACJ,EAAIK,SACnChB,SAAAA,QAAEiB,kBAAkBR,EAAK,CACrBS,KAAMC,eAAaC,aACnBC,SAAUC,gBAAcC,KACxBC,SAAUF,gBAAcG,QACxBC,KAAMjB,EAAIiB,KACVC,QAAS,qBACb,CAAA,EACO3B,EAAAA,QAAE4B,QAMjB,IAAI,EAAEjB,aAAeI,aAAa,CAACJ,EAAIK,UAI/B,CAAC,KAAKH,KAAKR,OACXL,SAAAA,QAAEiB,kBAAkBR,EAAK,CACrBS,KAAMC,eAAaC,aACnBC,SAAUC,gBAAcC,KACxBC,SAAUF,gBAAcG,QACxBC,KAAMjB,EAAIiB,KACVC,QAAS,uCACb,CAAA,EACO3B,EAAAA,QAAE4B,QAOjB,IAAMC,EAAuJ,CACzJC,IAAK5B,EAAA,C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ports","__export","SmpZodDateTime","smpZodDateTime","__toCommonJS","import_zod","import_ts_luxon","SmpZodDateTime","z","ZodType","__name","def","typeName","coerce","checks","_parse","input","ctx","_getOrReturnCtx","val","data","_def","_coerceToDateTime","DateTime","isValid","addIssueToContext","code","ZodIssueCode","invalid_type","expected","ZodParsedType","date","received","unknown","path","message","INVALID","checkMap","min","check","dateTimeVal","parseCtx","too_small","minimum","toMillis","type","inclusive","toISODate","max","too_big","maximum","between","custom","issueData","kind","common","issues","length","OK","toUTC","coercionMap","string","fromJSDate","Date","number","fromMillis","object","default","smpZodDateTime","opts"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/shared/zod/smp-zod-date-time.definition.ts"],"sourcesContent":["import z, {ZodTypeDef, ZodIssueCode, ParseInput, ParseContext, ParseReturnType, ZodParsedType} from \"zod\";\nimport {DateTime} from \"ts-luxon\";\n\ninterface SmpZodDateTimeCheck {\n kind: \"min\" | \"max\" | \"between\";\n min?: DateTime;\n max?: DateTime;\n message?: string;\n}\n\ninterface SmpZodDateTimeDef extends ZodTypeDef {\n coerce: boolean;\n checks: SmpZodDateTimeCheck[];\n typeName: \"SmpZodDateTime\";\n}\n\nexport class SmpZodDateTime extends z.ZodType<DateTime, SmpZodDateTimeDef> {\n // Constructor and other methods (between, coerce, max, min, _coerceToDateTime) remain the same as your latest version or my previous suggestions.\n // For brevity, only _parse is shown fully modified here. Ensure other parts of the class are consistent.\n\n constructor(def?: Partial<SmpZodDateTimeDef>) {\n super({\n typeName: \"SmpZodDateTime\",\n coerce: def?.coerce ?? false,\n checks: def?.checks ?? []\n });\n }\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n _parse(input: ParseInput): ParseReturnType<DateTime> {\n const ctx = this._getOrReturnCtx(input);\n let val = ctx.data;\n\n if (this._def.coerce) {\n val = this._coerceToDateTime(val); // Assuming _coerceToDateTime is implemented\n if (!(val instanceof DateTime) || !val.isValid) {\n z.addIssueToContext(ctx, { // Changed from ctx.addIssue\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.date, // Using ZodParsedType.date\n received: ZodParsedType.unknown,\n path: ctx.path,\n message: \"Invalid date format\"\n });\n return z.INVALID;\n }\n }\n\n // Ensure val is a DateTime object before proceeding with checks if not coercing\n // or if coercion failed to produce a DateTime (though the above check should catch it)\n if (!(val instanceof DateTime) || !val.isValid) {\n // If not coercing, and it's not a valid DateTime, this is an invalid type.\n // This specific case might be implicitly handled if !this._def.coerce means val must already be DateTime.\n // However, adding an explicit check if not coercing can be safer.\n if (!this._def.coerce) {\n z.addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.date, // Or a custom type name if you prefer\n received: ZodParsedType.unknown, // Or more specific if possible\n path: ctx.path,\n message: \"Input must be a valid DateTime object\"\n });\n return z.INVALID;\n }\n // If coercion was supposed to happen, and we still don't have a valid DateTime,\n // the earlier check inside the `if (this._def.coerce)` block should have caught it.\n }\n\n\n const checkMap: Record<SmpZodDateTimeCheck[\"kind\"], (check: SmpZodDateTimeCheck, dateTimeVal: DateTime, parseCtx: ParseContext) => z.ZodIssue | undefined> = {\n min: (check, dateTimeVal, parseCtx) => {\n if (check.min && dateTimeVal < check.min) {\n return {\n code: ZodIssueCode.too_small,\n minimum: check.min.toMillis(), // Changed to number (milliseconds)\n type: \"date\", // Added type\n inclusive: true,\n message: check.message ?? `Date must be ≥ ${check.min.toISODate()}`,\n path: parseCtx.path\n };\n }\n return undefined;\n },\n max: (check, dateTimeVal, parseCtx) => {\n if (check.max && dateTimeVal > check.max) {\n return {\n code: ZodIssueCode.too_big,\n maximum: check.max.toMillis(), // Changed to number (milliseconds)\n type: \"date\", // Added type\n inclusive: true, // Added inclusive\n message: check.message ?? `Date must be ≤ ${check.max.toISODate()}`,\n path: parseCtx.path\n };\n }\n return undefined;\n },\n between: (check, dateTimeVal, parseCtx) => {\n if (check.min && check.max && (dateTimeVal < check.min || dateTimeVal > check.max)) {\n return {\n code: ZodIssueCode.custom,\n message: check.message ?? `Date must be between ${check.min.toISODate()} and ${check.max.toISODate()}`,\n path: parseCtx.path\n // Optionally, add params for more structured error data:\n // params: { min: check.min.toISO(), max: check.max.toISO() }\n };\n }\n return undefined;\n }\n };\n\n for (const check of this._def.checks) {\n // Ensure val is a DateTime before passing to checkMap functions\n // This is crucial if coercion didn't happen or didn't result in a DateTime.\n // The earlier checks should ideally ensure 'val' is a valid DateTime if it reached this point.\n if (val instanceof DateTime && val.isValid) {\n const issueData = checkMap[check.kind](check, val, ctx);\n if (issueData) {\n z.addIssueToContext(ctx, issueData); // Changed from ctx.addIssue\n }\n }\n else {\n // This case should ideally be caught earlier (e.g., if not coercing, or if coercion failed)\n // If it reaches here, it implies a logic flaw or an unexpected state.\n // For robustness, you might add a generic invalid_type issue here if 'val' is not a DateTime.\n // However, the checks at the beginning of _parse should prevent this.\n }\n }\n\n if (ctx.common.issues.length > 0) { // Check ctx.common.issues.length\n return z.INVALID;\n }\n\n return z.OK(val as DateTime); // Ensure the 'val' returned by OK is typed as DateTime\n }\n\n between(min: DateTime, max: DateTime, message?: string): this {\n return new SmpZodDateTime({\n ...this._def,\n checks: [...this._def.checks, {kind: \"between\", min: min.toUTC(), max: max.toUTC(), message}]\n }) as this;\n }\n\n coerce(): this {\n return new SmpZodDateTime({\n ...this._def,\n coerce: true\n }) as this;\n }\n\n max(max: DateTime, message?: string): this {\n return new SmpZodDateTime({\n ...this._def,\n checks: [...this._def.checks, {kind: \"max\", max: max.toUTC(), message}]\n }) as this;\n }\n\n min(min: DateTime, message?: string): this {\n return new SmpZodDateTime({\n ...this._def,\n checks: [...this._def.checks, {kind: \"min\", min: min.toUTC(), message}]\n }) as this;\n }\n\n // Coercion helper function (ensure it's robust as discussed previously)\n private _coerceToDateTime(val: any): DateTime | null {\n if (val instanceof DateTime && val.isValid) {\n return val; // Already valid DateTime\n }\n\n const coercionMap: Record<string, () => DateTime | null> = {\n string: () => DateTime.fromJSDate(new Date(val)),\n number: () => DateTime.fromMillis(val),\n object: () => DateTime.fromJSDate(val),\n default: () => null\n };\n\n return (coercionMap[typeof val] || coercionMap.default)();\n }\n}\n\nexport const smpZodDateTime = (opts: { coerce?: boolean } = {}) => {\n return new SmpZodDateTime({\n coerce: opts.coerce ?? false,\n checks: []\n });\n};\n"],"mappings":"6mBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oBAAAE,EAAA,mBAAAC,IAAA,eAAAC,EAAAJ,GAAA,IAAAK,EAAoG,oBACpGC,EAAuB,oBAehB,IAAMC,EAAN,MAAMA,UAAuBC,EAAAA,QAAEC,OAAO,CAhB7C,MAgB6C,CAAAC,EAAA,uBAIzCC,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,SACnCjB,SAAAA,QAAEkB,kBAAkBR,EAAK,CACrBS,KAAMC,eAAaC,aACnBC,SAAUC,gBAAcC,KACxBC,SAAUF,gBAAcG,QACxBC,KAAMjB,EAAIiB,KACVC,QAAS,qBACb,CAAA,EACO5B,EAAAA,QAAE6B,QAMjB,IAAI,EAAEjB,aAAeI,aAAa,CAACJ,EAAIK,UAI/B,CAAC,KAAKH,KAAKR,OACXN,SAAAA,QAAEkB,kBAAkBR,EAAK,CACrBS,KAAMC,eAAaC,aACnBC,SAAUC,gBAAcC,KACxBC,SAAUF,gBAAcG,QACxBC,KAAMjB,EAAIiB,KACVC,QAAS,uCACb,CAAA,EACO5B,EAAAA,QAAE6B,QAOjB,IAAMC,EAAuJ,CACzJC,IAAK7B,EAAA,CAAC8B,EAAOC,EAAaC,IAAAA,CACtB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pZodDateTime","__toCommonJS","import_zod","import_ts_luxon","SmpZodDateTime","z","ZodType","__name","constructor","def","typeName","coerce","checks","_parse","input","ctx","_getOrReturnCtx","val","data","_def","_coerceToDateTime","DateTime","isValid","addIssueToContext","code","ZodIssueCode","invalid_type","expected","ZodParsedType","date","received","unknown","path","message","INVALID","checkMap","min","check","dateTimeVal","parseCtx","too_small","minimum","toMillis","type","inclusive","toISODate","max","too_big","maximum","between","custom","issueData","kind","common","issues","length","OK","toUTC","coercionMap","string","fromJSDate","Date","number","fromMillis","object","default","smpZodDateTime","opts"]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/shared/zod/smp-zod-date-time.definition.ts"],"sourcesContent":["import z, {ZodTypeDef, ZodIssueCode, ParseInput, ParseContext, ParseReturnType, ZodParsedType} from \"zod\";\nimport {DateTime} from \"ts-luxon\";\n\ninterface SmpZodDateTimeCheck {\n kind: \"min\" | \"max\" | \"between\";\n min?: DateTime;\n max?: DateTime;\n message?: string;\n}\n\ninterface SmpZodDateTimeDef extends ZodTypeDef {\n coerce: boolean;\n checks: SmpZodDateTimeCheck[];\n typeName: \"SmpZodDateTime\";\n}\n\nexport class SmpZodDateTime extends z.ZodType<DateTime, SmpZodDateTimeDef> {\n // Constructor and other methods (between, coerce, max, min, _coerceToDateTime) remain the same as your latest version or my previous suggestions.\n // For brevity, only _parse is shown fully modified here. Ensure other parts of the class are consistent.\n\n constructor(def?: Partial<SmpZodDateTimeDef>) {\n super({\n typeName: \"SmpZodDateTime\",\n coerce: def?.coerce ?? false,\n checks: def?.checks ?? []\n });\n }\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n _parse(input: ParseInput): ParseReturnType<DateTime> {\n const ctx = this._getOrReturnCtx(input);\n let val = ctx.data;\n\n if (this._def.coerce) {\n val = this._coerceToDateTime(val); // Assuming _coerceToDateTime is implemented\n if (!(val instanceof DateTime) || !val.isValid) {\n z.addIssueToContext(ctx, { // Changed from ctx.addIssue\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.date, // Using ZodParsedType.date\n received: ZodParsedType.unknown,\n path: ctx.path,\n message: \"Invalid date format\"\n });\n return z.INVALID;\n }\n }\n\n // Ensure val is a DateTime object before proceeding with checks if not coercing\n // or if coercion failed to produce a DateTime (though the above check should catch it)\n if (!(val instanceof DateTime) || !val.isValid) {\n // If not coercing, and it's not a valid DateTime, this is an invalid type.\n // This specific case might be implicitly handled if !this._def.coerce means val must already be DateTime.\n // However, adding an explicit check if not coercing can be safer.\n if (!this._def.coerce) {\n z.addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.date, // Or a custom type name if you prefer\n received: ZodParsedType.unknown, // Or more specific if possible\n path: ctx.path,\n message: \"Input must be a valid DateTime object\"\n });\n return z.INVALID;\n }\n // If coercion was supposed to happen, and we still don't have a valid DateTime,\n // the earlier check inside the `if (this._def.coerce)` block should have caught it.\n }\n\n\n const checkMap: Record<SmpZodDateTimeCheck[\"kind\"], (check: SmpZodDateTimeCheck, dateTimeVal: DateTime, parseCtx: ParseContext) => z.ZodIssue | undefined> = {\n min: (check, dateTimeVal, parseCtx) => {\n if (check.min && dateTimeVal < check.min) {\n return {\n code: ZodIssueCode.too_small,\n minimum: check.min.toMillis(), // Changed to number (milliseconds)\n type: \"date\", // Added type\n inclusive: true,\n message: check.message ?? `Date must be ≥ ${check.min.toISODate()}`,\n path: parseCtx.path\n };\n }\n return undefined;\n },\n max: (check, dateTimeVal, parseCtx) => {\n if (check.max && dateTimeVal > check.max) {\n return {\n code: ZodIssueCode.too_big,\n maximum: check.max.toMillis(), // Changed to number (milliseconds)\n type: \"date\", // Added type\n inclusive: true, // Added inclusive\n message: check.message ?? `Date must be ≤ ${check.max.toISODate()}`,\n path: parseCtx.path\n };\n }\n return undefined;\n },\n between: (check, dateTimeVal, parseCtx) => {\n if (check.min && check.max && (dateTimeVal < check.min || dateTimeVal > check.max)) {\n return {\n code: ZodIssueCode.custom,\n message: check.message ?? `Date must be between ${check.min.toISODate()} and ${check.max.toISODate()}`,\n path: parseCtx.path\n // Optionally, add params for more structured error data:\n // params: { min: check.min.toISO(), max: check.max.toISO() }\n };\n }\n return undefined;\n }\n };\n\n for (const check of this._def.checks) {\n // Ensure val is a DateTime before passing to checkMap functions\n // This is crucial if coercion didn't happen or didn't result in a DateTime.\n // The earlier checks should ideally ensure 'val' is a valid DateTime if it reached this point.\n if (val instanceof DateTime && val.isValid) {\n const issueData = checkMap[check.kind](check, val, ctx);\n if (issueData) {\n z.addIssueToContext(ctx, issueData); // Changed from ctx.addIssue\n }\n }\n else {\n // This case should ideally be caught earlier (e.g., if not coercing, or if coercion failed)\n // If it reaches here, it implies a logic flaw or an unexpected state.\n // For robustness, you might add a generic invalid_type issue here if 'val' is not a DateTime.\n // However, the checks at the beginning of _parse should prevent this.\n }\n }\n\n if (ctx.common.issues.length > 0) { // Check ctx.common.issues.length\n return z.INVALID;\n }\n\n return z.OK(val as DateTime); // Ensure the 'val' returned by OK is typed as DateTime\n }\n\n between(min: DateTime, max: DateTime, message?: string): this {\n return new SmpZodDateTime({\n ...this._def,\n checks: [...this._def.checks, {kind: \"between\", min: min.toUTC(), max: max.toUTC(), message}]\n }) as this;\n }\n\n coerce(): this {\n return new SmpZodDateTime({\n ...this._def,\n coerce: true\n }) as this;\n }\n\n max(max: DateTime, message?: string): this {\n return new SmpZodDateTime({\n ...this._def,\n checks: [...this._def.checks, {kind: \"max\", max: max.toUTC(), message}]\n }) as this;\n }\n\n min(min: DateTime, message?: string): this {\n return new SmpZodDateTime({\n ...this._def,\n checks: [...this._def.checks, {kind: \"min\", min: min.toUTC(), message}]\n }) as this;\n }\n\n // Coercion helper function (ensure it's robust as discussed previously)\n private _coerceToDateTime(val: any): DateTime | null {\n if (val instanceof DateTime && val.isValid) {\n return val; // Already valid DateTime\n }\n\n const coercionMap: Record<string, () => DateTime | null> = {\n string: () => DateTime.fromJSDate(new Date(val)),\n number: () => DateTime.fromMillis(val),\n object: () => DateTime.fromJSDate(val),\n default: () => null\n };\n\n return (coercionMap[typeof val] || coercionMap.default)();\n }\n}\n\nexport const smpZodDateTime = (opts: { coerce?: boolean } = {}) => {\n return new SmpZodDateTime({\n coerce: opts.coerce ?? false,\n checks: []\n });\n};\n"],"mappings":"6mBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oBAAAE,EAAA,mBAAAC,IAAA,eAAAC,EAAAJ,GAAA,IAAAK,EAAoG,oBACpGC,EAAuB,oBAehB,IAAMC,EAAN,MAAMA,UAAuBC,EAAAA,QAAEC,OAAO,CAhB7C,MAgB6C,CAAAC,EAAA,uBAIzC,YAAYC,EAAkC,CAC1C,MAAM,CACFC,SAAU,iBACVC,OAAQF,GAAKE,QAAU,GACvBC,OAAQH,GAAKG,QAAU,CAAA,CAC3B,CAAA,CACJ,CAGAC,OAAOC,EAA8C,CACjD,IAAMC,EAAM,KAAKC,gBAAgBF,CAAAA,EAC7BG,EAAMF,EAAIG,KAEd,GAAI,KAAKC,KAAKR,SACVM,EAAM,KAAKG,kBAAkBH,CAAAA,EACzB,EAAEA,aAAeI,aAAa,CAACJ,EAAIK,SACnChB,SAAAA,QAAEiB,kBAAkBR,EAAK,CACrBS,KAAMC,eAAaC,aACnBC,SAAUC,gBAAcC,KACxBC,SAAUF,gBAAcG,QACxBC,KAAMjB,EAAIiB,KACVC,QAAS,qBACb,CAAA,EACO3B,EAAAA,QAAE4B,QAMjB,IAAI,EAAEjB,aAAeI,aAAa,CAACJ,EAAIK,UAI/B,CAAC,KAAKH,KAAKR,OACXL,SAAAA,QAAEiB,kBAAkBR,EAAK,CACrBS,KAAMC,eAAaC,aACnBC,SAAUC,gBAAcC,KACxBC,SAAUF,gBAAcG,QACxBC,KAAMjB,EAAIiB,KACVC,QAAS,uCACb,CAAA,EACO3B,EAAAA,QAAE4B,QAOjB,IAAMC,EAAuJ,CACzJC,IAAK5B,EAAA,CAAC6B,EAAOC,EAAaC,IAAAA,CACtB,GAAIF,EAAMD,KAAOE,EAAcD,EAAMD,I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odDateTime","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 @@
|
|
|
1
|
+
import{a as s}from"./chunk-EI7MMDWY.js";import{map as o,of as a,defer as i,switchMap as m}from"rxjs";function u(t){let e=[];function n(r){return r>=t.length?a(e):i(()=>t[r]()).pipe(m(p=>(e[r]=p,n(r+1))))}return s(n,"runStep"),n(0)}s(u,"smpRxjsSequence");function h(t){if(Array.isArray(t))return u(t);{let e=Object.keys(t),n=e.map(r=>t[r]);return u(n).pipe(o(r=>{let p={};return e.forEach((c,f)=>{p[c]=r[f]}),p}))}}s(h,"smpRxjsQueue");export{h as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var M=(function(A){return A.MD5="MD5",A.MD5_HMAC="MD5_HMAC",A.SHA1="SHA1",A.SHA1_HMAC="SHA1_HMAC",A})({});export{M as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a=(function(t){return t.ListDetectiveValidator="ListDetectiveValidator",t.MXValidator="MXValidator",t.SyntaxValidator="SyntaxValidator",t})({});export{a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as f}from"./chunk-ET5LYR3A.js";import{a as u}from"./chunk-CFV5G67M.js";import{a}from"./chunk-EI7MMDWY.js";import{Expose as d,plainToInstance as E}from"class-transformer";function l(r,e,t,s){var n=arguments.length,o=n<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,s);else for(var m=r.length-1;m>=0;m--)(p=r[m])&&(o=(n<3?p(o):n>3?p(e,t,o):p(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o}a(l,"_ts_decorate");function c(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}a(c,"_ts_metadata");var i=class r extends f{static{a(this,"SmpErrorResponse")}_errorCode;_status;static get DEFAULT_MESSAGES(){return[new u("GENERIC_ERROR")]}get errorCode(){return this._errorCode}get status(){return this._status}get timestamp(){return this._timestamp}_timestamp=Date.now();constructor(e=r.DEFAULT_MESSAGES,t="GENERIC_ERROR",s=500,n){super(e,n),this._errorCode=t,this._status=s}static create({messages:e=r.DEFAULT_MESSAGES,...t}={}){return new r(u.sanitizeMessages(e),t.errorCode,t.status,t.data)}static fromPlain(e){let t=E(R,e,{excludePrefixes:["_"]}),s=new r;return Object.getOwnPropertyNames(t).forEach(n=>{n in s&&(s[n]=t[n])}),s}};l([d(),c("design:type",Object),c("design:paramtypes",[])],i.prototype,"errorCode",null);l([d(),c("design:type",Number),c("design:paramtypes",[])],i.prototype,"timestamp",null);var R=class extends i{static{a(this,"SmpErrorResponseMutable")}set errorCode(e){this._errorCode=e}set status(e){this._status=e}set timestamp(e){this._timestamp=e}};export{i as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
1
|
+
import{a as s}from"./chunk-QK6DPGU6.js";import{a as r}from"./chunk-EI7MMDWY.js";var e=class extends s{static{r(this,"SmpHttpSessionStorageCache")}constructor(){super(sessionStorage,"smp_rest_cache_")}};export{e as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
1
|
+
import{a as s}from"./chunk-QYDMV6LH.js";import{a as i}from"./chunk-EI7MMDWY.js";import{Expose as u}from"class-transformer";function y(n,e,t,r){var o=arguments.length,p=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(f=n[l])&&(p=(o<3?f(p):o>3?f(e,t,p):f(e,t))||p);return o>3&&p&&Object.defineProperty(e,t,p),p}i(y,"_ts_decorate");function a(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)}i(a,"_ts_metadata");var c=class n{static{i(this,"SmpResponseMessage")}_message;_type;get message(){return this._message}get type(){return this._type}constructor(e,t=s.ERROR){this._message=e,this._type=t}static sanitizeMessages(e){return typeof e=="string"?e.length?[new n(e)]:[]:[e].flat().map(t=>typeof t=="string"?new n(t):t)}};y([u(),a("design:type",String),a("design:paramtypes",[])],c.prototype,"message",null);y([u(),a("design:type",typeof s>"u"?Object:s),a("design:paramtypes",[])],c.prototype,"type",null);export{c as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as c}from"./chunk-
|
|
1
|
+
import{a as c}from"./chunk-CFV5G67M.js";import{a as l}from"./chunk-QYDMV6LH.js";import{a}from"./chunk-EI7MMDWY.js";import{Expose as d,instanceToPlain as g,plainToInstance as h,Transform as _}from"class-transformer";function u(t,e,s,r){var i=arguments.length,n=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,s):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,s,r);else for(var f=t.length-1;f>=0;f--)(o=t[f])&&(n=(i<3?o(n):i>3?o(e,s,n):o(e,s))||n);return i>3&&n&&Object.defineProperty(e,s,n),n}a(u,"_ts_decorate");function p(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}a(p,"_ts_metadata");var m=class t{static{a(this,"SmpGenericResponse")}_messages;data;set messages(e){this._messages=c.sanitizeMessages(e)}get messages(){return this._messages}constructor(e=[],s){this._messages=e,this.data=s}static buildInfo(e,s){return new t([e].flat().map(r=>new c(r,l.INFO)),s)}static buildSuccess(e,s){return new t([e].flat().map(r=>new c(r,l.SUCCESS)),s)}static fromPlain(e){return h(t,e)}isError(){return!this.isSuccess()}isSuccess(){return"_errorCode"in this&&this._errorCode!==null&&this._errorCode!==void 0}serialize(){return g(this,{excludePrefixes:["_"]})}};u([d(),_(({value:t})=>t?.length?t:void 0),p("design:type",Object),p("design:paramtypes",[])],m.prototype,"messages",null);export{m as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a
|
|
1
|
+
import{a}from"./chunk-DADFHUII.js";import{a as t}from"./chunk-5VCNTUI6.js";import{a as s}from"./chunk-EI7MMDWY.js";import{DateTime as o}from"ts-luxon";var m=class extends a{static{s(this,"SmpAbstractTtlCacheStrategy")}flush(){this._flushRaw()}read(e){let r=this._readRaw(e);if(this._isSmpCachedValue(r)){if(r.expiry>=o.now().ts)return r.value;this._removeRaw(e);return}return r}remove(e){this._removeRaw(e)}write(e,r,i){if(isNaN(+i)||+i<=0){this._writeRaw(e,r,i);return}let p=o.now().ts+i*1e3,u={value:r,expiry:p};this._writeRaw(e,u,i)}_isSmpCachedValue(e){return t(e)}};export{m as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as l}from"./chunk-RCI7NEJO.js";import{a}from"./chunk-EI7MMDWY.js";import{DynamoDB as c}from"@aws-sdk/client-dynamodb";import{marshall as m,unmarshall as h}from"@aws-sdk/util-dynamodb";var _=(function(r){return r.CouldNotDelete="ERR_COULD_NOT_DELETE",r.CouldNotRead="ERR_COULD_NOT_READ",r.CouldNotWrite="ERR_COULD_NOT_WRITE",r.ConditionalCheckFailedException="ERR_DUPE_TOKEN",r})(_||{}),s=class{static{a(this,"SmpDynamoService")}_config;_tableName;get marshall(){return m}get unmarshall(){return h}_db=new c([this._buildConfig()]);_logger=new l;constructor(e,o){this._config=e,this._tableName=o}_buildConfig(){return this._config}_delete(e,o=this._tableName,i){let n={TableName:o,Key:this.marshall(e),...i};return this._db.deleteItem(n).catch(t=>(this._logger.error("DynamoActionTokensService: couldn't write token to DB",t),Promise.reject(_[t.code]||"ERR_COULD_NOT_DELETE")))}_read(e,o=this._tableName,i){let n={TableName:o,Key:this.marshall(e),...i};return this._db.getItem(n).catch(t=>(this._logger.error("DynamoActionTokensService: couldn't write token to DB",t),Promise.reject(_[t.code]||"ERR_COULD_NOT_READ")))}_write(e,o=this._tableName,i){let n={TableName:o,Item:this.marshall(e),...i};return this._db.putItem(n).catch(t=>(this._logger.error("DynamoActionTokensService: couldn't write token to DB",t),Promise.reject(_[t.code]||"ERR_COULD_NOT_WRITE")))}};export{s as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-3HRZ6R3F.js";import{a as s}from"./chunk-RAJGA43T.js";import{a as m}from"./chunk-QRCMHI3B.js";import{b as h,d as A,g as u,j as _,k as S}from"./chunk-XZEYUIQ6.js";import{a as p}from"./chunk-EI7MMDWY.js";import{Expose as d,instanceToPlain as g,plainToInstance as C}from"class-transformer";import{DateTime as E}from"ts-luxon";function R(n,t,e,r){var o=arguments.length,i=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,r);else for(var f=n.length-1;f>=0;f--)(c=n[f])&&(i=(o<3?c(i):o>3?c(t,e,i):c(t,e))||i);return o>3&&i&&Object.defineProperty(t,e,i),i}p(R,"_ts_decorate");function O(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)}p(O,"_ts_metadata");var l=class n{static{p(this,"SmpGiftcardTransaction")}gc;op;ot;static _AES_ENCODER=new m("changeme","5f6eae61d2428b99","d92fbf214e16a79fd36f9a5185ae733f");static _LOGGER=console;static _OP_CODES={[s.CHECK]:"",[s.TRANSACTION]:"",[s.TRANSACTION_DETAIL]:"",[s.ACTIVATE]:"A",[s.BLOCK]:"B",[s.DIGITAL_ACTIVATE]:"D",[s.FREEZE]:"F",[s.PURCHASE]:"P",[s.RECHARGE]:"G",[s.ROLLBACK]:"R",[s.UNFREEZE]:"U",[s.XREFUND]:"X"};static _SEP="_";get dto(){return this._dto}get hash(){return this._hashStrategy(this.toString()).toString()}get iso(){return this.dto.toUTC().toISO()}get ts(){return this._dto.ts}_dto;_hashStrategies={[a.MD5]:t=>_(t),[a.MD5_HMAC]:t=>{let e=new A;return e.update(h.parse(t)),e.finalize()},[a.SHA1]:t=>S(t),[a.SHA1_HMAC]:t=>{let e=new u;return e.update(h.parse(t)),e.finalize()}};_hashStrategy=this._hashStrategies[a.MD5];constructor(t="ACTIVATION",e,r,o){this.gc=t,this.op=e,this.ot=r,this._dto=typeof o=="number"&&o>=0?E.fromMillis(+`${o}000`.slice(0,13)):E.local()}static build({gc:t,op:e,ot:r,dto:o}){return new this(t,e,r,o?.ts)}static explode(t){let e=this.constructor,r=(t||"").split(e._SEP);if(r.length<4)throw new Error(`INVALID_TRANSACTION "${t}"`);return this.build({gc:r[1],op:e.prefixToOperation(r[2]),dto:E.fromSeconds(+r[3])})}static isBase64(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)&&t.length%4===0}static parse(t){this._LOGGER.info(`${this.constructor.name}: trying to parse ${t}`);try{if(this.isBase64(t)){let e=this._AES_ENCODER.decryptAES(t),r=JSON.parse(e);return C(n,r)}else return this.explode(t)}catch(e){throw this._LOGGER.error(`${this.constructor.name}: failed to parse ${t}`,e),new Error(`UNPARSEABLE "${t}"`)}}static prefixToOperation(t){return Object.entries(this._OP_CODES).find(([,r])=>r===t)[0]}serialize(){return g(this,{excludePrefixes:["_"]})}toString(){let t=JSON.stringify(this.serialize());return this.constructor._AES_ENCODER.encryptAES(t)}};R([d(),O("design:type",Number),O("design:paramtypes",[])],l.prototype,"ts",null);export{l as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as s}from"./chunk-EI7MMDWY.js";var e=class{static{s(this,"SmpBaseJwtToken")}_access_token;_exp;_iss;get access_token(){return this._access_token}get exp(){return this._exp}get iss(){return this._iss}constructor(t,_,i){this._access_token=t,this._exp=_,this._iss=i}serialize(){return{access_token:this._access_token,exp:this._exp,iss:this._iss}}};export{e as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as u}from"./chunk-
|
|
1
|
+
import{a as u}from"./chunk-SJOEBOGG.js";import{a as o}from"./chunk-7CWGJ3NF.js";import{a as h}from"./chunk-5WULAY6L.js";import{a as n}from"./chunk-EI7MMDWY.js";var _=class{static{n(this,"SmpHttpService")}static _cachePrefix="smp_rest_cache_";static _cacheStrategy=typeof sessionStorage<"u"?new o:new u;static _config={cachePrefix:this._cachePrefix,shared:new Map};static _errorClass=h;static _mergeParamsFallbackBaseUrl="https://ts-mapi-core.com";static $http(e){return this._generateAjax(e)}static async _generateAjax(e){if(e.cacheKey){let t=this._cacheRead(e.cacheKey);return t?Promise.resolve(t):this._generateAjaxBase(e).then(r=>(e.cacheKey&&this._cacheWrite(e.cacheKey,r),r))}return this._generateAjaxBase(e)}static async _generateAjaxBase(e){let t=await this._preprocessRequest(e),r={method:t.method,headers:new Headers({"content-type":"application/json",...t.headers}),body:t.body?JSON.stringify(t.body):null};return t.useCredentials&&(r.credentials="include"),t.url=this.mergeQueryParams(t.url,t.queryParams),fetch(t.url,r).then(a=>this._preprocessResponse(e,a)).then(a=>{if(a.ok){if(a.status===204||a.headers.get("content-length")==="0")return null;switch(t.responseType){case"blob":return a.blob();case"arraybuffer":return a.arrayBuffer();case"text":return a.text();case"json":default:return a.json()}}return a.json().then(s=>{let c=s;try{c=this._errorClass.fromPlain(s)}catch(i){console.debug("http: failed to parse error response into ErrorResponse",i)}return Promise.reject({status:a.status,message:a.statusText,body:c})})})}static cacheFlush(){this._cacheStrategy.flush()}static mergeQueryParams(e,t){let r=e.startsWith("http");if(t){let a=new URL(e,globalThis?.location?.origin||this._mergeParamsFallbackBaseUrl),s=Object.fromEntries(a.searchParams.entries());a.search=new URLSearchParams({...s,...Object.fromEntries(Object.entries(t).map(([c,i])=>[c,`${i}`]))}).toString(),e=r?a.href:a.pathname+a.search}return e}static _cacheKey(e){return`${this._config.cachePrefix}${e}`}static _cachePop(e){let t=this._cacheRead(e);return this._cacheRemove(e),t}static _cacheRead(e){return this._cacheStrategy.read(this._cacheKey(e))}static _cacheRemove(e){this._cacheStrategy.remove(this._cacheKey(e))}static _cacheWrite(e,t){this._cacheStrategy.write(this._cacheKey(e),t)}static async _preprocessRequest(e){return e}static async _preprocessResponse(e,t){return t}};export{_ as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var u=(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{u as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as t}from"./chunk-EI7MMDWY.js";import{concatMap as e,from as p,toArray as r}from"rxjs";function i(n){return p(n).pipe(e(o=>o()),r())}t(i,"smpRxjsSequence");export{i as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as s}from"./chunk-EI7MMDWY.js";var c=class{static{s(this,"SmpBaseJwtTokenPlain")}access_token;exp;iss};export{c as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-YEQJ4M3P.js";import{a as s}from"./chunk-EI7MMDWY.js";import{defer as e,of as r}from"rxjs";var i=class extends a{static{s(this,"SmpRxjsInMemoryCache")}static _storage=new Map;get _staticSelf(){return this.constructor}_flushRaw(){return e(()=>(this._staticSelf._storage.clear(),r(void 0)))}_readRaw(t){return e(()=>r(this._staticSelf._storage.get(t)))}_removeRaw(t){return e(()=>(this._staticSelf._storage.delete(t),r(void 0)))}_writeRaw(t,o){return e(()=>(this._staticSelf._storage.set(t,o),r(void 0)))}};export{i as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var n=(function(e){return e[e.Continue=100]="Continue",e[e.SwitchingProtocols=101]="SwitchingProtocols",e[e.Processing=102]="Processing",e[e.EarlyHints=103]="EarlyHints",e[e.Ok=200]="Ok",e[e.Created=201]="Created",e[e.Accepted=202]="Accepted",e[e.NonAuthoritativeInformation=203]="NonAuthoritativeInformation",e[e.NoContent=204]="NoContent",e[e.ResetContent=205]="ResetContent",e[e.PartialContent=206]="PartialContent",e[e.MultiStatus=207]="MultiStatus",e[e.AlreadyReported=208]="AlreadyReported",e[e.ImUsed=226]="ImUsed",e[e.MultipleChoices=300]="MultipleChoices",e[e.MovedPermanently=301]="MovedPermanently",e[e.Found=302]="Found",e[e.SeeOther=303]="SeeOther",e[e.NotModified=304]="NotModified",e[e.UseProxy=305]="UseProxy",e[e.Unused=306]="Unused",e[e.TemporaryRedirect=307]="TemporaryRedirect",e[e.PermanentRedirect=308]="PermanentRedirect",e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.PaymentRequired=402]="PaymentRequired",e[e.Forbidden=403]="Forbidden",e[e.NotFound=404]="NotFound",e[e.MethodNotAllowed=405]="MethodNotAllowed",e[e.NotAcceptable=406]="NotAcceptable",e[e.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",e[e.RequestTimeout=408]="RequestTimeout",e[e.Conflict=409]="Conflict",e[e.Gone=410]="Gone",e[e.LengthRequired=411]="LengthRequired",e[e.PreconditionFailed=412]="PreconditionFailed",e[e.PayloadTooLarge=413]="PayloadTooLarge",e[e.UriTooLong=414]="UriTooLong",e[e.UnsupportedMediaType=415]="UnsupportedMediaType",e[e.RangeNotSatisfiable=416]="RangeNotSatisfiable",e[e.ExpectationFailed=417]="ExpectationFailed",e[e.ImATeapot=418]="ImATeapot",e[e.MisdirectedRequest=421]="MisdirectedRequest",e[e.UnprocessableEntity=422]="UnprocessableEntity",e[e.Locked=423]="Locked",e[e.FailedDependency=424]="FailedDependency",e[e.TooEarly=425]="TooEarly",e[e.UpgradeRequired=426]="UpgradeRequired",e[e.PreconditionRequired=428]="PreconditionRequired",e[e.TooManyRequests=429]="TooManyRequests",e[e.RequestHeaderFieldsTooLarge=431]="RequestHeaderFieldsTooLarge",e[e.UnavailableForLegalReasons=451]="UnavailableForLegalReasons",e[e.InternalServerError=500]="InternalServerError",e[e.NotImplemented=501]="NotImplemented",e[e.BadGateway=502]="BadGateway",e[e.ServiceUnavailable=503]="ServiceUnavailable",e[e.GatewayTimeout=504]="GatewayTimeout",e[e.HttpVersionNotSupported=505]="HttpVersionNotSupported",e[e.VariantAlsoNegotiates=506]="VariantAlsoNegotiates",e[e.InsufficientStorage=507]="InsufficientStorage",e[e.LoopDetected=508]="LoopDetected",e[e.NotExtended=510]="NotExtended",e[e.NetworkAuthenticationRequired=511]="NetworkAuthenticationRequired",e})({});export{n as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as i}from"./chunk-
|
|
1
|
+
import{a as i}from"./chunk-FTXCYY5S.js";import{a as s}from"./chunk-EI7MMDWY.js";var o=class extends i{static{s(this,"SmpBrowserCache")}_storage;_prefix;constructor(t,e){super(),this._storage=t,this._prefix=e}_flushRaw(){let t=[],e=-1;for(;++e<this._storage.length;){let r=this._storage.key(e);r&&r.startsWith(this._prefix)&&t.push(r)}for(e=-1;++e<t.length;)this._storage.removeItem(t[e])}_readRaw(t){let e=this._storage.getItem(this._prefix+t);try{return e?JSON.parse(e):void 0}catch{console.warn(`${this.constructor.name}: failed to parse cache item for key ${this._prefix+t}`);return}}_removeRaw(t){this._storage.removeItem(this._prefix+t)}_writeRaw(t,e){try{this._storage.setItem(this._prefix+t,JSON.stringify(e))}catch(r){console.warn(`${this.constructor.name}: failed to write cache item for key ${this._prefix+t}`,r)}}};export{o as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as i,b as r,e as d,f as _,g as o,h as n,i as e}from"./chunk-XZEYUIQ6.js";import{a as s}from"./chunk-EI7MMDWY.js";var a=class{static{s(this,"SmpAesCrypt")}_password;_salt;_initVector;get _iv(){return this._initVector?i.parse(this._initVector):void 0}_mode=d;_padding=_;constructor(t,h,p){this._password=t,this._salt=h,this._initVector=p}decryptAES(t){return e.decrypt(t,this._buildKey(),{iv:this._iv,mode:this._mode,padding:this._padding}).toString(r)}encryptAES(t){return e.encrypt(t,this._buildKey(),{iv:this._iv,mode:this._mode,padding:this._padding}).toString()}_buildKey(){return n.execute(this._password,i.parse(this._salt),{keySize:256/32,iterations:1e3,hasher:o})}};export{a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b as c,d as n}from"./chunk-XZEYUIQ6.js";import{a as o}from"./chunk-OUSY7GMI.js";import{a as r}from"./chunk-5WULAY6L.js";import{a as s}from"./chunk-EI7MMDWY.js";var h=class{static{s(this,"SmpSecureCode")}_baseCode;get baseCode(){return this._baseCode}get secureCode(){return this._encode()}_crcLength=5;_seed="changeme";constructor(e){this._baseCode=e}static check(e,t){if(new this(e).secureCode!==t)throw r.create({messages:"WRONG_SECURE_CODE",errorCode:"WRONG_SECURE_CODE",status:o.BadRequest})}_encode(){let e=new n;return e.update(c.parse(this._seed+this._baseCode)),e.finalize().toString(a).substring(0,this._crcLength).toUpperCase()}};export{h as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var R=(function(N){return N.INFO="INFO",N.SUCCESS="SUCCESS",N.WARNING="WARNING",N.ERROR="ERROR",N})({});export{R as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var A=(function(E){return E.ACTIVATE="ACTIVATE",E.BLOCK="BLOCK",E.CHECK="CHECK",E.DIGITAL_ACTIVATE="DIGITAL_ACTIVATE",E.FREEZE="FREEZE",E.PURCHASE="PURCHASE",E.RECHARGE="RECHARGE",E.ROLLBACK="ROLLBACK",E.TRANSACTION="TRANSACTION",E.TRANSACTION_DETAIL="TRANSACTION_DETAIL",E.UNFREEZE="UNFREEZE",E.XREFUND="XREFUND",E})({});export{A as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r=(function(P){return P.POPUP="POPUP",P.REDIRECT="REDIRECT",P})({});export{r as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
1
|
+
import{a as s}from"./chunk-FTXCYY5S.js";import{a as e}from"./chunk-EI7MMDWY.js";var a=class extends s{static{e(this,"SmpInMemoryCache")}static _storage=new Map;get _staticSelf(){return this.constructor}_flushRaw(){this._staticSelf._storage.clear()}_readRaw(t){return this._staticSelf._storage.get(t)}_removeRaw(t){this._staticSelf._storage.delete(t)}_writeRaw(t,r){this._staticSelf._storage.set(t,r)}};export{a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as t}from"./chunk-EI7MMDWY.js";import{DateTime as i}from"ts-luxon";var r=class s{static{t(this,"SmpSid")}value;expiry;get active(){return this.value.endsWith(this._controlSuffix)}get expired(){return i.now().ts>this.expiry}get valid(){return!this.expired}_controlSuffix="$1";constructor(e=`sid-xxxx-${+i.now().ts}`,x=0){this.value=e,this.expiry=x}static parse(e){return new s(e.value,e.expiry)}toPlain(){return{value:this.value,expiry:this.expiry}}};export{r as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var E=(function(O){return O.APPLE="APPLE",O.FACEBOOK="FACEBOOK",O.GOOGLE="GOOGLE",O})({});export{E as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as n}from"./chunk-
|
|
1
|
+
import{a as n}from"./chunk-JXSMI3MI.js";import{a as s}from"./chunk-TGY6ZSQU.js";import{a as o}from"./chunk-RAVJJJYE.js";import{a as d}from"./chunk-RCI7NEJO.js";import{a}from"./chunk-EI7MMDWY.js";import{getApps as l,initializeApp as g}from"firebase/app";import{browserLocalPersistence as u,browserSessionPersistence as p,EmailAuthProvider as _,FacebookAuthProvider as m,GoogleAuthProvider as f,OAuthProvider as P,checkActionCode as U,confirmPasswordReset as E,fetchSignInMethodsForEmail as b,getAuth as w,getRedirectResult as S,reauthenticateWithCredential as I,sendEmailVerification as F,sendPasswordResetEmail as A,setPersistence as C,signInWithCustomToken as v,signInWithEmailAndPassword as R,signInWithPopup as L,signInWithRedirect as O,signOut as T,updatePassword as k,updateProfile as y}from"firebase/auth";var c=class h{static{a(this,"SmpFirebaseService")}static get INSTANCE(){if(!(this._instance instanceof h))throw Error(`${this.constructor.name} instance doesn't exist! Call ${this.constructor.name}.init first!`);return this._instance}static _instance;get config(){return this._config}get enabledSocials(){return this._enabledSocials}get loggedUser(){return this._loggedUser||(this._loggedUser=this._readStoredUser()),this._auth.currentUser||this._loggedUser||void 0}get providersRelation(){return{"facebook.com":s.FACEBOOK,"google.com":s.GOOGLE,"apple.com":s.APPLE}}get socialLoginUXMode(){return this._socialLoginUxMode}get storedUserKey(){return"firebaseUser"}get _auth(){return w(this._app)}_app;_config;_enabledSocials=[];_loggedUser;_logger;_popupErrors=0;_popupFallsBackToRedirect;_providers;_socialLoginUxMode=o.POPUP;constructor(e,t){this._config=e,this._enabledSocials=t.enabledSocials||[],this._socialLoginUxMode=t.socialLoginUxMode||o.POPUP,this._popupFallsBackToRedirect=!!t.popupFallsBackToRedirect,this._buildProviders(),this._logger=t.logger||new d,this._app=l().length?l()[0]:g(e),this._watchAuthState()}static init(e,t){return this._instance||(this._instance=new h(e,t)),this._instance}addAuthStateChangedCallback(e){return this._auth.onAuthStateChanged(t=>{e(t||this.loggedUser||null)})}checkActionCode(e){return U(this._auth,e)}confirmPasswordReset(e,t){return E(this._auth,e,t)}fetchSignInMethodsForEmail(e){return b(this._auth,e).then(t=>t.map(r=>this.providersRelation[r]||r))}getRedirectResult(){return S(this._auth).catch(async e=>(await this._expandDifferentCredential(e),Promise.reject(e)))}initAppCheck(){}sendEmailVerification(e){if(!this.loggedUser)throw Error("Firebase: user is not logged!");return F(this.loggedUser,e?{url:e}:void 0)}sendPasswordResetEmail(e,t){return A(this._auth,e,{url:t})}setPersistence(e){return C(this._auth,e?u:p)}signInWithCustomToken(e){return v(this._auth,e)}signInWithEmailAndPassword(e,t){return R(this._auth,e,t).then(async r=>r.user)}signInWithSocialProvider(e){if(!this._providers[e])throw Error(`Firebase: invalid social key provided! Expected one of ${this.enabledSocials}, got ${e}`);return this._signInWithProvider(this._providers[e])}signOut(){return T(this._auth)}updatePassword(e,t){if(!this.loggedUser)throw Error("Firebase: user is not logged!");let r=_.credential(this.loggedUser.email,e);return I(this.loggedUser,r).then(()=>k(this.loggedUser,t))}updateUserProfile(e){if(!this.loggedUser)throw Error("Firebase: user is not logged!");return y(this.loggedUser,e)}async verifyIdToken(){return this._auth.currentUser?.getIdTokenResult()}_buildProviders(){this._providers=this._enabledSocials.reduce((e,t)=>(t in e&&(e[t]=e[t]),e),{[s.APPLE]:new P("apple.com"),[s.FACEBOOK]:new m().setCustomParameters({prompt:"select_account"}),[s.GOOGLE]:new f().setCustomParameters({prompt:"select_account"})})}async _expandDifferentCredential(e){if(e?.code===n.DIFFERENT_CREDENTIAL){let t=await this.fetchSignInMethodsForEmail(e.customData.email);throw e.code=n["DIFFERENT_CREDENTIAL_"+t[0]],e}}_readStoredUser(){try{let e=localStorage.getItem(this.storedUserKey);if(e){this._logger?.debug("Firebase: found local user",e);let t=JSON.parse(e);return{...t,getIdToken:a(()=>Promise.resolve(t.stsTokenManager.accessToken),"getIdToken")}}}catch(e){this._logger.debug("Firebase: error while getting stored user",e)}}async _signInWithProvider(e,t=this.socialLoginUXMode){return(t===o.POPUP?L:O)(this._auth,e).then(i=>(this._logger.info(`Firebase: signin with provider ${e.providerId} was successful`),i.user)).catch(async i=>i?.code===n.POPUP_BLOCKED&&(this._logger.warn(`Firebase: social signin popup blocked (${++this._popupErrors}`),this._popupFallsBackToRedirect&&this._popupErrors>1)?(this._popupErrors=0,this._signInWithProvider(e,o.REDIRECT)):(this._logger.error(`Firebase: sign in with ${e.providerId} errored`,i),await this._expandDifferentCredential(i),Promise.reject(i)))}_updateLocalUser(e){try{e?localStorage.setItem(this.storedUserKey,JSON.stringify(e)):localStorage.removeItem(this.storedUserKey),this._logger.debug("Firebase: updating local user",e),this._loggedUser=e}catch(t){this._logger.warn("Firebase: couldn't update local user",{user:e,error:t})}}_watchAuthState(){this._auth.onAuthStateChanged(e=>{this._logger.debug("Firebase: firebase detected auth state change",e),this._updateLocalUser(e||void 0)})}};export{c as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var E=(function(T){return T.GET="GET",T.POST="POST",T.PUT="PUT",T.DELETE="DELETE",T.PATCH="PATCH",T})({});export{E as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a as t}from"./chunk-DADFHUII.js";import{a}from"./chunk-5VCNTUI6.js";import{a as s}from"./chunk-EI7MMDWY.js";import{map as u}from"rxjs";import{DateTime as m}from"ts-luxon";var p=class extends t{static{s(this,"SmpAbstractRxjsTtlCacheStrategy")}flush(){return this._flushRaw()}read(r){return this._readRaw(r).pipe(u(e=>{if(this._isSmpCachedValue(e)){if(e.expiry>=m.now().ts)return e.value;this._removeRaw(r).subscribe();return}return e}))}remove(r){return this._removeRaw(r)}write(r,e,i){if(isNaN(+i)||+i<=0)return this._writeRaw(r,e,i);let n=m.now().ts+i*1e3,o={value:e,expiry:n};return this._writeRaw(r,o,i)}_isSmpCachedValue(r){return a(r)}};export{p as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as u}from"./chunk-DOKJQH4K.js";import{a as f}from"./chunk-R6VG4656.js";import{a as p}from"./chunk-
|
|
1
|
+
import{a as u}from"./chunk-DOKJQH4K.js";import{a as f}from"./chunk-R6VG4656.js";import{a as p}from"./chunk-VHMV4QQT.js";import{a as c}from"./chunk-EI7MMDWY.js";var h=class l{static{c(this,"SmpCommonUtils")}static arrayRemove(t,r){let e=[],s=t.filter((n,i)=>r(n,i)&&e.push(i));return e.reverse().forEach(n=>t.splice(n,1)),s}static assertIsArray(t,r){if(!Array.isArray(t))throw new Error(r||`${this.constructor.name} => val was not an array`)}static assertIsBoolean(t,r){if(!this.isBoolean(t))throw new Error(r||`${this.constructor.name} => val was not boolean`)}static assertIsFunction(t,r){if(!this.isFunction(t))throw new Error(r||`${this.constructor.name} => entity was not a function`)}static assertIsInstance(t,r,e){if(!(t instanceof r))throw new Error(e||`${this.constructor.name} => val was not instance of class`)}static assertIsNotEmpty(t,r){if(this.isEmpty(t))throw new Error(r||`${this.constructor.name} => entity was empty`)}static assertIsNumber(t,r){if(typeof t!="number")throw new Error(r||`${this.constructor.name} => val was not numeric`)}static assertIsNumeric(t,r){if(!this.isNumeric(t))throw new Error(r||`${this.constructor.name} => val was not numeric`)}static assertIsObject(t,r){if(!this.isObject(t))throw new Error(r||`${this.constructor.name} => val was not an object`)}static assertIsString(t,r){if(!this.isString(t))throw new Error(r||`${this.constructor.name} => val was not a string`)}static assertIsTruthy(t,r){if(!t)throw new Error(r||`${this.constructor.name} => condition wasn't truthy`)}static buildPath(...t){let r=t.filter(e=>!!e).join("/").replace(/(?<!:)\/\/+/g,"/");return r.startsWith("http")&&!r.endsWith("/")?`${r}/`:r}static downloadBlob(t,r){let e=window.URL.createObjectURL(t),s=document.createElement("a");s.href=e,s.setAttribute("download",r),document.body.appendChild(s),s.click()}static generateRandomHexString(t=12){let r="0123456789abcdef",e="";for(let s=0;s<t;s++){let n=Math.floor(Math.random()*r.length);e+=r[n]}return e}static generateUUID(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let r=Math.random()*16|0;return(t==="x"?r:r&3|8).toString(16)})}static getDecimalPrecision(t){if(this.assertIsNumeric(t),!isFinite(+t))return 0;let r=1,e=0;for(;Math.round(+t*r)/r!==t;)r*=10,e++;return e}static getType(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}static isBoolean(t){return typeof t=="boolean"}static isColor(t){if(!t||!this.isString(t))return!1;let r=new Option().style;return r.color=t,r.color!==""}static isEmpty(t){return!t&&t!==0}static isEqual(t,r){function e(){if(t.length!==r.length)return!1;for(let o=0;o<t.length;o++)if(!l.isEqual(t[o],r[o]))return!1;return!0}c(e,"areArraysEqual");function s(){if(Object.keys(t).length!==Object.keys(r).length)return!1;for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&!l.isEqual(t[o],r[o]))return!1;return!0}c(s,"areObjectsEqual");function n(){return t.toString()===r.toString()}c(n,"areFunctionsEqual");function i(){return t===r}c(i,"arePrimativesEqual");let a=this.getType(t);return a!==this.getType(r)?!1:a==="array"?e():a==="object"?s():a==="function"?n():i()}static isFormField(t){return/^(?:input|select|textarea|button)$/i.test(t.nodeName)}static isFunction(t){return typeof t==typeof isNaN}static isNotEmpty(t){return!this.isEmpty(t)}static isNumber(t){return typeof t=="number"&&this.isNumeric(t)}static isNumeric(t){return!isNaN(t)}static isObject(t){return!!t&&t===Object(t)&&t.constructor===Object}static isPrimitive(t){let r=this.getType(t);return r!=="function"&&(r!=="object"||!t)}static isString(t){return typeof t=="string"}static isWindows(){return navigator.userAgent.toLowerCase().includes("win")}static mapObject(t,r){if(this.assertIsFunction(r,`CommonUtils => expected type of iteratee to be Function, got ${typeof r}`),this.isObject(t))return Object.entries(t).reduce((e,[s,n])=>(e.push(r(n,s)),e),[]);if(Array.isArray(t))return t.map(r);throw new Error(`CommonUtils => invalid object provided. Expected Object or Array, got ${typeof r}`)}static mapObjectKeys(t,r){return Object.entries(t).reduce((e,[s,n])=>(e[s]=r.call(null,s,n),e),{})}static mapObjectValues(t,r){return this.isObject(t)?Object.entries(t).reduce((e,[s,n])=>(e[s]=r.call(null,n,s),e),{}):{}}static noop(){}static objectHasValue(t,r){return!!~Object.values(t).filter(e=>this.isEqual(e,r))}static omit(t,r){return Object.keys(t).filter(s=>!r.includes(s)).reduce((s,n)=>(s[n]=t[n],s),{})}static parseBoolean(t){return t?/^true$/i.test(t):!1}static parseJsonSafely(t){try{return JSON.parse(t)}catch(r){console.warn(`${this.constructor.name} => couldn't parse json string`,{str:t,error:r});return}}static pick(t,r){return r.reduce((e,s)=>(s in t&&(e[s]=t[s]),e),{})}static runSafely(t,r=null,e=[]){if(this.isFunction(t))return t.apply(r,e)}static sleep(t){return new Promise(r=>setTimeout(r,t))}static sprintf(t,...r){return this.isString(t)&&r.length?this.sprintf(t.replace("%s",String(r.shift())),...r):t}static stripComments(t){return typeof t=="string"?t.replace(/(<!--.*?-->)|(<!--[\S\s]+?-->)|(<!--[\S\s]*?$)/g,""):t}static submitFakeForm({action:t,method:r=p.POST,data:e,target:s}){let n=Object.entries(e||{}).map(([a,o])=>`<input name="${a}" type="hidden" value="${o}" />`),i=document.createElement("form");i.method=r,i.action=t,i.innerHTML=`${n}`,i.target=s||"_self",document.body.append(i),i.submit()}static toCamelCase(t){return this.words(t.replace(/['\u2019]/g,"")).reduce((r,e,s)=>(e=e.toLowerCase(),r+(s?e.charAt(0).toUpperCase()+e.slice(1):e)),"")}static toKebabCase(t){return this.words(t.replace(/['\u2019]/g,"")).join("-").toLowerCase()}static toPascalCase(t){return this.toCamelCase(t).replace(/^(.)/,r=>r.toUpperCase())}static toSnakeCase(t){return this.words(t.replace(/['\u2019]/g,"")).join("_").toLowerCase()}static toUpperSnakeCase(t){return this.toSnakeCase(t).toUpperCase()}static words(t,r){return r===void 0?(u.HAS_UNICODE_WORD(t)?u.unicodeWords(t):f(t))||[]:t.match(r)||[]}};export{h as a};
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export { SmpHttpConfig } from './services/http/smp-http-config.interface.js';
|
|
|
4
4
|
export { SmpHttpStatusCodes } from './services/http/smp-http-status-code.enum.js';
|
|
5
5
|
export { SmpApiCommonUtils } from './shared/api/smp-api-common-utils.class.js';
|
|
6
6
|
export { SmpErrorResponse } from './shared/api/smp-error-response.class.js';
|
|
7
|
-
export { SmpErrorResponseCreateOpts } from './shared/api/smp-error-response-
|
|
7
|
+
export { SmpErrorResponseCreateOpts } from './shared/api/smp-error-response-create-opts.interface.js';
|
|
8
8
|
export { SmpGenericResponse } from './shared/api/smp-generic-response.class.js';
|
|
9
9
|
export { SmpGenericResponseBase } from './shared/api/smp-generic-response-base.interface.js';
|
|
10
10
|
export { SMP_HEALTHZ } from './shared/api/smp-healtz.const.js';
|
|
@@ -12,6 +12,8 @@ export { SmpResponseMessage } from './shared/api/smp-response-message.class.js';
|
|
|
12
12
|
export { SmpResponseMessageBase } from './shared/api/smp-response-message-base.interface.js';
|
|
13
13
|
export { SmpResponseMessageTypes } from './shared/api/smp-response-message-types.enum.js';
|
|
14
14
|
export { SmpRestVerbs } from './shared/api/smp-rest-verbs.enum.js';
|
|
15
|
+
export { SmpBaseJwtToken } from './shared/common/smp-base-jwt-token.class.js';
|
|
16
|
+
export { SmpBaseJwtTokenPlain } from './shared/common/smp-base-jwt-token-plain.interface.js';
|
|
15
17
|
export { SmpGenericConstructor } from './shared/common/smp-generic-constructor.type.js';
|
|
16
18
|
export { SmpPrimitive } from './shared/common/smp-primitive.type.js';
|
|
17
19
|
export { SmpSocialSignInKeys } from './shared/common/smp-social-sign-in-keys.enum.js';
|
|
@@ -19,6 +21,7 @@ export { SmpSocialSignInUxModes } from './shared/common/smp-social-sign-in-ux-mo
|
|
|
19
21
|
export { S as SmpAesCrypt } from './smp-aes-crypt.class-CI82T7GV.js';
|
|
20
22
|
export { SmpCrypto } from './shared/crypto/smp-crypto.class.js';
|
|
21
23
|
export { SmpSecureCode } from './shared/crypto/smp-secure-code.class.js';
|
|
24
|
+
export { SmpFirebaseErrors } from './shared/firebase/smp-firebase-errors.enum.js';
|
|
22
25
|
export { SmpGiftcardTransaction } from './shared/giftcard/smp-giftcard-transaction.class.js';
|
|
23
26
|
export { SmpGiftcardTransactionConfig } from './shared/giftcard/smp-giftcard-transaction-config.interface.js';
|
|
24
27
|
export { SmpGiftcardTransactionHashStrategies } from './shared/giftcard/smp-giftcard-transaction-hash-strategies.enum.js';
|
|
@@ -26,7 +29,6 @@ export { SmpGiftcardTransactionOps } from './shared/giftcard/smp-giftcard-transa
|
|
|
26
29
|
export { SmpGiftcardTransactionPlain } from './shared/giftcard/smp-giftcard-transaction-plain.interface.js';
|
|
27
30
|
export { SmpMarketingCloudValidationResponse, SmpMarketingCloudValidationResponseKo, SmpMarketingCloudValidationResponseOk } from './shared/marketing-cloud/smp-marketing-cloud-validation-response.interface.js';
|
|
28
31
|
export { SmpMarketingCloudValidators } from './shared/marketing-cloud/smp-marketing-cloud-validators.enum.js';
|
|
29
|
-
export { SmpFirebaseErrors } from './shared/firebase/smp-firebase-errors.enum.js';
|
|
30
32
|
export { SmpAbstractRxjsTtlCacheStrategy } from './shared/rxjs/smp-abstract-rxjs-ttl-cache-strategy.class.js';
|
|
31
33
|
export { smpRxjsCatchOnly } from './shared/rxjs/smp-rxjs-catch-only.function.js';
|
|
32
34
|
export { SmpRxjsInMemoryCache } from './shared/rxjs/smp-rxjs-in-memory-cache.class.js';
|
|
@@ -60,6 +62,6 @@ import '@aws-sdk/client-dynamodb';
|
|
|
60
62
|
import 'firebase/app';
|
|
61
63
|
import 'firebase/auth';
|
|
62
64
|
|
|
63
|
-
declare const VERSION: "1.
|
|
65
|
+
declare const VERSION: "1.8.0-next.0";
|
|
64
66
|
|
|
65
67
|
export { VERSION };
|
package/dist/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-O7TJDNO6.js";import{a as
|
|
1
|
+
import"./chunk-O7TJDNO6.js";import{a as H,b as J}from"./chunk-QPKVVZUA.js";import"./chunk-PKEW426R.js";import"./chunk-DGUMFWCQ.js";import"./chunk-EB55SS67.js";import{a as z}from"./chunk-ZTDFA2UA.js";import{a as A}from"./chunk-4UTF5FWK.js";import"./chunk-NIN4PUZX.js";import{a as G}from"./chunk-RGLXAD7B.js";import{a as C}from"./chunk-SPPRTVHH.js";import"./chunk-DOKJQH4K.js";import{a as w}from"./chunk-ZKODHJSY.js";import"./chunk-R6VG4656.js";import"./chunk-Q77KUWBZ.js";import"./chunk-553CS7VH.js";import{a as d}from"./chunk-4TNTWTMN.js";import"./chunk-SZM4WHQJ.js";import{a as j}from"./chunk-MRKAFTDG.js";import{a as k}from"./chunk-2UDNZC5A.js";import{a as l}from"./chunk-L7KNFRNV.js";import{a as u}from"./chunk-QWZP25QT.js";import{a as q}from"./chunk-FLTR4ZY6.js";import{a as g}from"./chunk-YEQJ4M3P.js";import{a as h}from"./chunk-QW43DOPY.js";import"./chunk-D66G2KIE.js";import"./chunk-HOM5S5W3.js";import"./chunk-BHFFGFHY.js";import{a as U}from"./chunk-G7PUYG2K.js";import"./chunk-ZYPNYJVE.js";import{a as O}from"./chunk-3HRZ6R3F.js";import{a as N}from"./chunk-RAJGA43T.js";import"./chunk-NQICKEAS.js";import{a as E}from"./chunk-RJBWCWAE.js";import{a as F}from"./chunk-QTWLHW3D.js";import{a as B}from"./chunk-QRCMHI3B.js";import"./chunk-XZEYUIQ6.js";import"./chunk-HM7F3YYW.js";import{a as V}from"./chunk-MLBCWEB4.js";import{a as R}from"./chunk-GRXWCGMW.js";import"./chunk-4LYXZUNL.js";import"./chunk-ELQKTQ6W.js";import"./chunk-U5DBFRKV.js";import"./chunk-AV6X4R7W.js";import{a as D}from"./chunk-2YYH6VGI.js";import"./chunk-SXISZIFJ.js";import{a as I}from"./chunk-VHMV4QQT.js";import{a as v}from"./chunk-C3LKT6AF.js";import"./chunk-2JBVVJ2E.js";import{a as r}from"./chunk-FUHGPBNJ.js";import{a as o}from"./chunk-TSC2BSSL.js";import{a as L}from"./chunk-JXSMI3MI.js";import{a as b}from"./chunk-TGY6ZSQU.js";import{a as y}from"./chunk-RAVJJJYE.js";import"./chunk-RCI7NEJO.js";import{a as s}from"./chunk-ZNC4KYAS.js";import"./chunk-SDQLEPBS.js";import"./chunk-WTEJYEK2.js";import{a as n}from"./chunk-OUSY7GMI.js";import{a}from"./chunk-JE3FPJGV.js";import{a as i}from"./chunk-SJOEBOGG.js";import{a as c}from"./chunk-7CWGJ3NF.js";import{a as _}from"./chunk-QK6DPGU6.js";import{a as S}from"./chunk-FTXCYY5S.js";import{a as x}from"./chunk-DADFHUII.js";import{a as f}from"./chunk-5VCNTUI6.js";import{a as t}from"./chunk-5WULAY6L.js";import{a as p}from"./chunk-ET5LYR3A.js";import{a as m}from"./chunk-CFV5G67M.js";import{a as e}from"./chunk-QYDMV6LH.js";import"./chunk-EI7MMDWY.js";var K="1.8.0-next.0";export{D as SMP_HEALTHZ,x as SmpAbstractCacheStrategy,g as SmpAbstractRxjsTtlCacheStrategy,S as SmpAbstractTtlCacheStrategy,B as SmpAesCrypt,v as SmpApiCommonUtils,R as SmpBaseJwtToken,V as SmpBaseJwtTokenPlain,_ as SmpBrowserCache,z as SmpCommonUtils,E as SmpCrypto,r as SmpDynamoService,t as SmpErrorResponse,A as SmpFilterException,L as SmpFirebaseErrors,o as SmpFirebaseService,p as SmpGenericResponse,U as SmpGiftcardTransaction,O as SmpGiftcardTransactionHashStrategies,N as SmpGiftcardTransactionOps,a as SmpHttpService,c as SmpHttpSessionStorageCache,n as SmpHttpStatusCodes,i as SmpInMemoryCache,d as SmpMarketingCloudValidators,G as SmpRegularExpressions,m as SmpResponseMessage,e as SmpResponseMessageTypes,I as SmpRestVerbs,j as SmpRxjsInMemoryCache,F as SmpSecureCode,C as SmpSid,b as SmpSocialSignInKeys,y as SmpSocialSignInUxModes,H as SmpZodDateTime,K as VERSION,w as smpApplyMixin,f as smpIsSmpCachedValue,s as smpNoop,h as smpRxjsCatchOnly,k as smpRxjsQueue,l as smpRxjsSequence,q as smpRxjsThrowIfEmpty,u as smpRxjsThrowOnCondition,J as smpZodDateTime};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../chunk-
|
|
1
|
+
import"../../chunk-I3CNDIWD.js";import{a}from"../../chunk-TSC2BSSL.js";import"../../chunk-JXSMI3MI.js";import"../../chunk-TGY6ZSQU.js";import"../../chunk-RAVJJJYE.js";import"../../chunk-RCI7NEJO.js";import"../../chunk-ZNC4KYAS.js";import"../../chunk-EI7MMDWY.js";export{a as SmpFirebaseService};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"../../chunk-YFGB7SCJ.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-TSC2BSSL.js";import"../../chunk-JXSMI3MI.js";import"../../chunk-TGY6ZSQU.js";import"../../chunk-RAVJJJYE.js";import"../../chunk-RCI7NEJO.js";import"../../chunk-ZNC4KYAS.js";import"../../chunk-EI7MMDWY.js";export{a as SmpFirebaseService};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../chunk-SDQLEPBS.js";import
|
|
1
|
+
import"../../chunk-SDQLEPBS.js";import"../../chunk-WTEJYEK2.js";import{a as c}from"../../chunk-OUSY7GMI.js";import{a as b}from"../../chunk-JE3FPJGV.js";import"../../chunk-SJOEBOGG.js";import{a}from"../../chunk-7CWGJ3NF.js";import"../../chunk-QK6DPGU6.js";import"../../chunk-FTXCYY5S.js";import"../../chunk-DADFHUII.js";import"../../chunk-5VCNTUI6.js";import"../../chunk-5WULAY6L.js";import"../../chunk-ET5LYR3A.js";import"../../chunk-CFV5G67M.js";import"../../chunk-QYDMV6LH.js";import"../../chunk-EI7MMDWY.js";export{b as SmpHttpService,a as SmpHttpSessionStorageCache,c as SmpHttpStatusCodes};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-7CWGJ3NF.js";import"../../chunk-QK6DPGU6.js";import"../../chunk-FTXCYY5S.js";import"../../chunk-DADFHUII.js";import"../../chunk-5VCNTUI6.js";import"../../chunk-EI7MMDWY.js";export{a as SmpHttpSessionStorageCache};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-OUSY7GMI.js";import"../../chunk-EI7MMDWY.js";export{a as SmpHttpStatusCodes};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-JE3FPJGV.js";import"../../chunk-SJOEBOGG.js";import"../../chunk-7CWGJ3NF.js";import"../../chunk-QK6DPGU6.js";import"../../chunk-FTXCYY5S.js";import"../../chunk-DADFHUII.js";import"../../chunk-5VCNTUI6.js";import"../../chunk-5WULAY6L.js";import"../../chunk-ET5LYR3A.js";import"../../chunk-CFV5G67M.js";import"../../chunk-QYDMV6LH.js";import"../../chunk-EI7MMDWY.js";export{a as SmpHttpService};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../chunk-
|
|
1
|
+
import{a as e}from"../chunk-FUHGPBNJ.js";import"../chunk-I3CNDIWD.js";import{a as r}from"../chunk-TSC2BSSL.js";import"../chunk-JXSMI3MI.js";import"../chunk-TGY6ZSQU.js";import"../chunk-RAVJJJYE.js";import"../chunk-RCI7NEJO.js";import"../chunk-ZNC4KYAS.js";import"../chunk-SDQLEPBS.js";import"../chunk-WTEJYEK2.js";import{a as p}from"../chunk-OUSY7GMI.js";import{a as m}from"../chunk-JE3FPJGV.js";import"../chunk-SJOEBOGG.js";import{a as o}from"../chunk-7CWGJ3NF.js";import"../chunk-QK6DPGU6.js";import"../chunk-FTXCYY5S.js";import"../chunk-DADFHUII.js";import"../chunk-5VCNTUI6.js";import"../chunk-5WULAY6L.js";import"../chunk-ET5LYR3A.js";import"../chunk-CFV5G67M.js";import"../chunk-QYDMV6LH.js";import"../chunk-EI7MMDWY.js";export{e as SmpDynamoService,r as SmpFirebaseService,m as SmpHttpService,o as SmpHttpSessionStorageCache,p as SmpHttpStatusCodes};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-FUHGPBNJ.js";import"../chunk-RCI7NEJO.js";import"../chunk-ZNC4KYAS.js";import"../chunk-EI7MMDWY.js";export{a as SmpDynamoService};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { SmpApiCommonUtils } from './smp-api-common-utils.class.js';
|
|
2
2
|
export { SmpErrorResponse } from './smp-error-response.class.js';
|
|
3
|
-
export { SmpErrorResponseCreateOpts } from './smp-error-response-
|
|
3
|
+
export { SmpErrorResponseCreateOpts } from './smp-error-response-create-opts.interface.js';
|
|
4
4
|
export { SmpGenericResponse } from './smp-generic-response.class.js';
|
|
5
5
|
export { SmpGenericResponseBase } from './smp-generic-response-base.interface.js';
|
|
6
6
|
export { SMP_HEALTHZ } from './smp-healtz.const.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../chunk-U5DBFRKV.js";import"../../chunk-AV6X4R7W.js";import{a as f}from"../../chunk-2YYH6VGI.js";import"../../chunk-SXISZIFJ.js";import{a as g}from"../../chunk-
|
|
1
|
+
import"../../chunk-U5DBFRKV.js";import"../../chunk-AV6X4R7W.js";import{a as f}from"../../chunk-2YYH6VGI.js";import"../../chunk-SXISZIFJ.js";import{a as g}from"../../chunk-VHMV4QQT.js";import{a as e}from"../../chunk-C3LKT6AF.js";import"../../chunk-2JBVVJ2E.js";import"../../chunk-RCI7NEJO.js";import"../../chunk-ZNC4KYAS.js";import{a as d}from"../../chunk-5WULAY6L.js";import{a as c}from"../../chunk-ET5LYR3A.js";import{a as b}from"../../chunk-CFV5G67M.js";import{a}from"../../chunk-QYDMV6LH.js";import"../../chunk-EI7MMDWY.js";export{f as SMP_HEALTHZ,e as SmpApiCommonUtils,d as SmpErrorResponse,c as SmpGenericResponse,b as SmpResponseMessage,a as SmpResponseMessageTypes,g as SmpRestVerbs};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../../chunk-2JBVVJ2E.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SmpErrorResponseCreateOpts } from './smp-error-response-
|
|
1
|
+
import { SmpErrorResponseCreateOpts } from './smp-error-response-create-opts.interface.js';
|
|
2
2
|
import { SmpGenericResponseBase } from './smp-generic-response-base.interface.js';
|
|
3
3
|
import { SmpGenericResponse } from './smp-generic-response.class.js';
|
|
4
4
|
import { SmpResponseMessage } from './smp-response-message.class.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-5WULAY6L.js";import"../../chunk-ET5LYR3A.js";import"../../chunk-CFV5G67M.js";import"../../chunk-QYDMV6LH.js";import"../../chunk-EI7MMDWY.js";export{a as SmpErrorResponse};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-ET5LYR3A.js";import"../../chunk-CFV5G67M.js";import"../../chunk-QYDMV6LH.js";import"../../chunk-EI7MMDWY.js";export{a as SmpGenericResponse};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-QYDMV6LH.js";import"../../chunk-EI7MMDWY.js";export{a as SmpResponseMessageTypes};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-CFV5G67M.js";import"../../chunk-QYDMV6LH.js";import"../../chunk-EI7MMDWY.js";export{a as SmpResponseMessage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-VHMV4QQT.js";import"../../chunk-EI7MMDWY.js";export{a as SmpRestVerbs};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export { SmpBaseJwtToken } from './smp-base-jwt-token.class.js';
|
|
2
|
+
export { SmpBaseJwtTokenPlain } from './smp-base-jwt-token-plain.interface.js';
|
|
1
3
|
export { SmpGenericConstructor } from './smp-generic-constructor.type.js';
|
|
2
4
|
export { SmpPrimitive } from './smp-primitive.type.js';
|
|
3
5
|
export { SmpSocialSignInKeys } from './smp-social-sign-in-keys.enum.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../chunk-
|
|
1
|
+
import"../../chunk-HM7F3YYW.js";import{a as b}from"../../chunk-MLBCWEB4.js";import{a}from"../../chunk-GRXWCGMW.js";import"../../chunk-4LYXZUNL.js";import"../../chunk-ELQKTQ6W.js";import{a as c}from"../../chunk-TGY6ZSQU.js";import{a as d}from"../../chunk-RAVJJJYE.js";import"../../chunk-EI7MMDWY.js";export{a as SmpBaseJwtToken,b as SmpBaseJwtTokenPlain,c as SmpSocialSignInKeys,d as SmpSocialSignInUxModes};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"../../chunk-MLBCWEB4.js";import"../../chunk-EI7MMDWY.js";export{a as SmpBaseJwtTokenPlain};
|