@cossistant/core 0.0.14 → 0.0.16
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/checks.d.ts.map +1 -1
- package/core.d.ts.map +1 -1
- package/errors.d.ts.map +1 -1
- package/index.d.ts +2 -2
- package/package.json +1 -1
- package/store/create-store.d.ts.map +1 -1
- package/store/support-store.d.ts +40 -24
- package/store/support-store.d.ts.map +1 -1
- package/store/support-store.js +5 -10
- package/store/support-store.js.map +1 -1
package/checks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checks.d.ts","names":["core","errors","schemas","util","$ZodCheckDef","$ZodErrorMap","ParsePayload","$ZodCheckInternals","T","$ZodIssueBase","MaybeAsync","$ZodType","$ZodCheck","$constructor","$ZodCheckLessThanDef","Numeric","$ZodCheckLessThanInternals","$ZodIssueTooBig","$ZodCheckLessThan","$ZodCheckGreaterThanDef","$ZodCheckGreaterThanInternals","$ZodIssueTooSmall","$ZodCheckGreaterThan","$ZodCheckMultipleOfDef","$ZodCheckMultipleOfInternals","$ZodIssueNotMultipleOf","$ZodCheckMultipleOf","$ZodNumberFormats","$ZodCheckNumberFormatDef","$ZodCheckNumberFormatInternals","$ZodIssueInvalidType","$ZodCheckNumberFormat","$ZodBigIntFormats","$ZodCheckBigIntFormatDef","$ZodCheckBigIntFormatInternals","$ZodCheckBigIntFormat","$ZodCheckMaxSizeDef","$ZodCheckMaxSizeInternals","HasSize","$ZodCheckMaxSize","$ZodCheckMinSizeDef","$ZodCheckMinSizeInternals","$ZodCheckMinSize","$ZodCheckSizeEqualsDef","$ZodCheckSizeEqualsInternals","$ZodCheckSizeEquals","$ZodCheckMaxLengthDef","$ZodCheckMaxLengthInternals","HasLength","$ZodCheckMaxLength","$ZodCheckMinLengthDef","$ZodCheckMinLengthInternals","$ZodCheckMinLength","$ZodCheckLengthEqualsDef","$ZodCheckLengthEqualsInternals","$ZodCheckLengthEquals","$ZodStringFormats","$ZodCheckStringFormatDef","Format","RegExp","$ZodCheckStringFormatInternals","$ZodIssueInvalidStringFormat","$ZodCheckStringFormat","$ZodCheckRegexDef","$ZodCheckRegexInternals","$ZodCheckRegex","$ZodCheckLowerCaseDef","$ZodCheckLowerCaseInternals","$ZodCheckLowerCase","$ZodCheckUpperCaseDef","$ZodCheckUpperCaseInternals","$ZodCheckUpperCase","$ZodCheckIncludesDef","$ZodCheckIncludesInternals","$ZodCheckIncludes","$ZodCheckStartsWithDef","$ZodCheckStartsWithInternals","$ZodCheckStartsWith","$ZodCheckEndsWithDef","$ZodCheckEndsWithInternals","$ZodCheckEndsWith","$ZodCheckPropertyDef","$ZodCheckPropertyInternals","$ZodIssue","$ZodCheckProperty","$ZodCheckMimeTypeDef","MimeTypes","$ZodCheckMimeTypeInternals","File","$ZodIssueInvalidValue","$ZodCheckMimeType","$ZodCheckOverwriteDef","$ZodCheckOverwriteInternals","$ZodCheckOverwrite","$ZodChecks","$ZodStringFormatChecks","$ZodStringFormatTypes"],"sources":["../../../node_modules/.bun/zod@4.1.12/node_modules/zod/v4/core/checks.d.cts"],"sourcesContent":["import * as core from \"./core.cjs\";\nimport type * as errors from \"./errors.cjs\";\nimport type * as schemas from \"./schemas.cjs\";\nimport * as util from \"./util.cjs\";\nexport interface $ZodCheckDef {\n check: string;\n error?: errors.$ZodErrorMap<never> | undefined;\n /** If true, no later checks will be executed if this check fails. Default `false`. */\n abort?: boolean | undefined;\n /** If provided, this check will only be executed if the function returns `true`. Defaults to `payload => z.util.isAborted(payload)`. */\n when?: ((payload: schemas.ParsePayload) => boolean) | undefined;\n}\nexport interface $ZodCheckInternals<T> {\n def: $ZodCheckDef;\n /** The set of issues this check might throw. */\n issc?: errors.$ZodIssueBase;\n check(payload: schemas.ParsePayload<T>): util.MaybeAsync<void>;\n onattach: ((schema: schemas.$ZodType) => void)[];\n}\nexport interface $ZodCheck<in T = never> {\n _zod: $ZodCheckInternals<T>;\n}\nexport declare const $ZodCheck: core.$constructor<$ZodCheck<any>>;\nexport interface $ZodCheckLessThanDef extends $ZodCheckDef {\n check: \"less_than\";\n value: util.Numeric;\n inclusive: boolean;\n}\nexport interface $ZodCheckLessThanInternals<T extends util.Numeric = util.Numeric> extends $ZodCheckInternals<T> {\n def: $ZodCheckLessThanDef;\n issc: errors.$ZodIssueTooBig<T>;\n}\nexport interface $ZodCheckLessThan<T extends util.Numeric = util.Numeric> extends $ZodCheck<T> {\n _zod: $ZodCheckLessThanInternals<T>;\n}\nexport declare const $ZodCheckLessThan: core.$constructor<$ZodCheckLessThan>;\nexport interface $ZodCheckGreaterThanDef extends $ZodCheckDef {\n check: \"greater_than\";\n value: util.Numeric;\n inclusive: boolean;\n}\nexport interface $ZodCheckGreaterThanInternals<T extends util.Numeric = util.Numeric> extends $ZodCheckInternals<T> {\n def: $ZodCheckGreaterThanDef;\n issc: errors.$ZodIssueTooSmall<T>;\n}\nexport interface $ZodCheckGreaterThan<T extends util.Numeric = util.Numeric> extends $ZodCheck<T> {\n _zod: $ZodCheckGreaterThanInternals<T>;\n}\nexport declare const $ZodCheckGreaterThan: core.$constructor<$ZodCheckGreaterThan>;\nexport interface $ZodCheckMultipleOfDef<T extends number | bigint = number | bigint> extends $ZodCheckDef {\n check: \"multiple_of\";\n value: T;\n}\nexport interface $ZodCheckMultipleOfInternals<T extends number | bigint = number | bigint> extends $ZodCheckInternals<T> {\n def: $ZodCheckMultipleOfDef<T>;\n issc: errors.$ZodIssueNotMultipleOf;\n}\nexport interface $ZodCheckMultipleOf<T extends number | bigint = number | bigint> extends $ZodCheck<T> {\n _zod: $ZodCheckMultipleOfInternals<T>;\n}\nexport declare const $ZodCheckMultipleOf: core.$constructor<$ZodCheckMultipleOf<number | bigint>>;\nexport type $ZodNumberFormats = \"int32\" | \"uint32\" | \"float32\" | \"float64\" | \"safeint\";\nexport interface $ZodCheckNumberFormatDef extends $ZodCheckDef {\n check: \"number_format\";\n format: $ZodNumberFormats;\n}\nexport interface $ZodCheckNumberFormatInternals extends $ZodCheckInternals<number> {\n def: $ZodCheckNumberFormatDef;\n issc: errors.$ZodIssueInvalidType | errors.$ZodIssueTooBig<\"number\"> | errors.$ZodIssueTooSmall<\"number\">;\n}\nexport interface $ZodCheckNumberFormat extends $ZodCheck<number> {\n _zod: $ZodCheckNumberFormatInternals;\n}\nexport declare const $ZodCheckNumberFormat: core.$constructor<$ZodCheckNumberFormat>;\nexport type $ZodBigIntFormats = \"int64\" | \"uint64\";\nexport interface $ZodCheckBigIntFormatDef extends $ZodCheckDef {\n check: \"bigint_format\";\n format: $ZodBigIntFormats | undefined;\n}\nexport interface $ZodCheckBigIntFormatInternals extends $ZodCheckInternals<bigint> {\n def: $ZodCheckBigIntFormatDef;\n issc: errors.$ZodIssueTooBig<\"bigint\"> | errors.$ZodIssueTooSmall<\"bigint\">;\n}\nexport interface $ZodCheckBigIntFormat extends $ZodCheck<bigint> {\n _zod: $ZodCheckBigIntFormatInternals;\n}\nexport declare const $ZodCheckBigIntFormat: core.$constructor<$ZodCheckBigIntFormat>;\nexport interface $ZodCheckMaxSizeDef extends $ZodCheckDef {\n check: \"max_size\";\n maximum: number;\n}\nexport interface $ZodCheckMaxSizeInternals<T extends util.HasSize = util.HasSize> extends $ZodCheckInternals<T> {\n def: $ZodCheckMaxSizeDef;\n issc: errors.$ZodIssueTooBig<T>;\n}\nexport interface $ZodCheckMaxSize<T extends util.HasSize = util.HasSize> extends $ZodCheck<T> {\n _zod: $ZodCheckMaxSizeInternals<T>;\n}\nexport declare const $ZodCheckMaxSize: core.$constructor<$ZodCheckMaxSize>;\nexport interface $ZodCheckMinSizeDef extends $ZodCheckDef {\n check: \"min_size\";\n minimum: number;\n}\nexport interface $ZodCheckMinSizeInternals<T extends util.HasSize = util.HasSize> extends $ZodCheckInternals<T> {\n def: $ZodCheckMinSizeDef;\n issc: errors.$ZodIssueTooSmall<T>;\n}\nexport interface $ZodCheckMinSize<T extends util.HasSize = util.HasSize> extends $ZodCheck<T> {\n _zod: $ZodCheckMinSizeInternals<T>;\n}\nexport declare const $ZodCheckMinSize: core.$constructor<$ZodCheckMinSize>;\nexport interface $ZodCheckSizeEqualsDef extends $ZodCheckDef {\n check: \"size_equals\";\n size: number;\n}\nexport interface $ZodCheckSizeEqualsInternals<T extends util.HasSize = util.HasSize> extends $ZodCheckInternals<T> {\n def: $ZodCheckSizeEqualsDef;\n issc: errors.$ZodIssueTooBig<T> | errors.$ZodIssueTooSmall<T>;\n}\nexport interface $ZodCheckSizeEquals<T extends util.HasSize = util.HasSize> extends $ZodCheck<T> {\n _zod: $ZodCheckSizeEqualsInternals<T>;\n}\nexport declare const $ZodCheckSizeEquals: core.$constructor<$ZodCheckSizeEquals>;\nexport interface $ZodCheckMaxLengthDef extends $ZodCheckDef {\n check: \"max_length\";\n maximum: number;\n}\nexport interface $ZodCheckMaxLengthInternals<T extends util.HasLength = util.HasLength> extends $ZodCheckInternals<T> {\n def: $ZodCheckMaxLengthDef;\n issc: errors.$ZodIssueTooBig<T>;\n}\nexport interface $ZodCheckMaxLength<T extends util.HasLength = util.HasLength> extends $ZodCheck<T> {\n _zod: $ZodCheckMaxLengthInternals<T>;\n}\nexport declare const $ZodCheckMaxLength: core.$constructor<$ZodCheckMaxLength>;\nexport interface $ZodCheckMinLengthDef extends $ZodCheckDef {\n check: \"min_length\";\n minimum: number;\n}\nexport interface $ZodCheckMinLengthInternals<T extends util.HasLength = util.HasLength> extends $ZodCheckInternals<T> {\n def: $ZodCheckMinLengthDef;\n issc: errors.$ZodIssueTooSmall<T>;\n}\nexport interface $ZodCheckMinLength<T extends util.HasLength = util.HasLength> extends $ZodCheck<T> {\n _zod: $ZodCheckMinLengthInternals<T>;\n}\nexport declare const $ZodCheckMinLength: core.$constructor<$ZodCheckMinLength>;\nexport interface $ZodCheckLengthEqualsDef extends $ZodCheckDef {\n check: \"length_equals\";\n length: number;\n}\nexport interface $ZodCheckLengthEqualsInternals<T extends util.HasLength = util.HasLength> extends $ZodCheckInternals<T> {\n def: $ZodCheckLengthEqualsDef;\n issc: errors.$ZodIssueTooBig<T> | errors.$ZodIssueTooSmall<T>;\n}\nexport interface $ZodCheckLengthEquals<T extends util.HasLength = util.HasLength> extends $ZodCheck<T> {\n _zod: $ZodCheckLengthEqualsInternals<T>;\n}\nexport declare const $ZodCheckLengthEquals: core.$constructor<$ZodCheckLengthEquals>;\nexport type $ZodStringFormats = \"email\" | \"url\" | \"emoji\" | \"uuid\" | \"guid\" | \"nanoid\" | \"cuid\" | \"cuid2\" | \"ulid\" | \"xid\" | \"ksuid\" | \"datetime\" | \"date\" | \"time\" | \"duration\" | \"ipv4\" | \"ipv6\" | \"cidrv4\" | \"cidrv6\" | \"base64\" | \"base64url\" | \"json_string\" | \"e164\" | \"lowercase\" | \"uppercase\" | \"regex\" | \"jwt\" | \"starts_with\" | \"ends_with\" | \"includes\";\nexport interface $ZodCheckStringFormatDef<Format extends string = string> extends $ZodCheckDef {\n check: \"string_format\";\n format: Format;\n pattern?: RegExp | undefined;\n}\nexport interface $ZodCheckStringFormatInternals extends $ZodCheckInternals<string> {\n def: $ZodCheckStringFormatDef;\n issc: errors.$ZodIssueInvalidStringFormat;\n}\nexport interface $ZodCheckStringFormat extends $ZodCheck<string> {\n _zod: $ZodCheckStringFormatInternals;\n}\nexport declare const $ZodCheckStringFormat: core.$constructor<$ZodCheckStringFormat>;\nexport interface $ZodCheckRegexDef extends $ZodCheckStringFormatDef {\n format: \"regex\";\n pattern: RegExp;\n}\nexport interface $ZodCheckRegexInternals extends $ZodCheckInternals<string> {\n def: $ZodCheckRegexDef;\n issc: errors.$ZodIssueInvalidStringFormat;\n}\nexport interface $ZodCheckRegex extends $ZodCheck<string> {\n _zod: $ZodCheckRegexInternals;\n}\nexport declare const $ZodCheckRegex: core.$constructor<$ZodCheckRegex>;\nexport interface $ZodCheckLowerCaseDef extends $ZodCheckStringFormatDef<\"lowercase\"> {\n}\nexport interface $ZodCheckLowerCaseInternals extends $ZodCheckInternals<string> {\n def: $ZodCheckLowerCaseDef;\n issc: errors.$ZodIssueInvalidStringFormat;\n}\nexport interface $ZodCheckLowerCase extends $ZodCheck<string> {\n _zod: $ZodCheckLowerCaseInternals;\n}\nexport declare const $ZodCheckLowerCase: core.$constructor<$ZodCheckLowerCase>;\nexport interface $ZodCheckUpperCaseDef extends $ZodCheckStringFormatDef<\"uppercase\"> {\n}\nexport interface $ZodCheckUpperCaseInternals extends $ZodCheckInternals<string> {\n def: $ZodCheckUpperCaseDef;\n issc: errors.$ZodIssueInvalidStringFormat;\n}\nexport interface $ZodCheckUpperCase extends $ZodCheck<string> {\n _zod: $ZodCheckUpperCaseInternals;\n}\nexport declare const $ZodCheckUpperCase: core.$constructor<$ZodCheckUpperCase>;\nexport interface $ZodCheckIncludesDef extends $ZodCheckStringFormatDef<\"includes\"> {\n includes: string;\n position?: number | undefined;\n}\nexport interface $ZodCheckIncludesInternals extends $ZodCheckInternals<string> {\n def: $ZodCheckIncludesDef;\n issc: errors.$ZodIssueInvalidStringFormat;\n}\nexport interface $ZodCheckIncludes extends $ZodCheck<string> {\n _zod: $ZodCheckIncludesInternals;\n}\nexport declare const $ZodCheckIncludes: core.$constructor<$ZodCheckIncludes>;\nexport interface $ZodCheckStartsWithDef extends $ZodCheckStringFormatDef<\"starts_with\"> {\n prefix: string;\n}\nexport interface $ZodCheckStartsWithInternals extends $ZodCheckInternals<string> {\n def: $ZodCheckStartsWithDef;\n issc: errors.$ZodIssueInvalidStringFormat;\n}\nexport interface $ZodCheckStartsWith extends $ZodCheck<string> {\n _zod: $ZodCheckStartsWithInternals;\n}\nexport declare const $ZodCheckStartsWith: core.$constructor<$ZodCheckStartsWith>;\nexport interface $ZodCheckEndsWithDef extends $ZodCheckStringFormatDef<\"ends_with\"> {\n suffix: string;\n}\nexport interface $ZodCheckEndsWithInternals extends $ZodCheckInternals<string> {\n def: $ZodCheckEndsWithDef;\n issc: errors.$ZodIssueInvalidStringFormat;\n}\nexport interface $ZodCheckEndsWith extends $ZodCheckInternals<string> {\n _zod: $ZodCheckEndsWithInternals;\n}\nexport declare const $ZodCheckEndsWith: core.$constructor<$ZodCheckEndsWith>;\nexport interface $ZodCheckPropertyDef extends $ZodCheckDef {\n check: \"property\";\n property: string;\n schema: schemas.$ZodType;\n}\nexport interface $ZodCheckPropertyInternals<T extends object = object> extends $ZodCheckInternals<T> {\n def: $ZodCheckPropertyDef;\n issc: errors.$ZodIssue;\n}\nexport interface $ZodCheckProperty<T extends object = object> extends $ZodCheck<T> {\n _zod: $ZodCheckPropertyInternals<T>;\n}\nexport declare const $ZodCheckProperty: core.$constructor<$ZodCheckProperty>;\nexport interface $ZodCheckMimeTypeDef extends $ZodCheckDef {\n check: \"mime_type\";\n mime: util.MimeTypes[];\n}\nexport interface $ZodCheckMimeTypeInternals<T extends schemas.File = schemas.File> extends $ZodCheckInternals<T> {\n def: $ZodCheckMimeTypeDef;\n issc: errors.$ZodIssueInvalidValue;\n}\nexport interface $ZodCheckMimeType<T extends schemas.File = schemas.File> extends $ZodCheck<T> {\n _zod: $ZodCheckMimeTypeInternals<T>;\n}\nexport declare const $ZodCheckMimeType: core.$constructor<$ZodCheckMimeType>;\nexport interface $ZodCheckOverwriteDef<T = unknown> extends $ZodCheckDef {\n check: \"overwrite\";\n tx(value: T): T;\n}\nexport interface $ZodCheckOverwriteInternals<T = unknown> extends $ZodCheckInternals<T> {\n def: $ZodCheckOverwriteDef<T>;\n issc: never;\n}\nexport interface $ZodCheckOverwrite<T = unknown> extends $ZodCheck<T> {\n _zod: $ZodCheckOverwriteInternals<T>;\n}\nexport declare const $ZodCheckOverwrite: core.$constructor<$ZodCheckOverwrite>;\nexport type $ZodChecks = $ZodCheckLessThan | $ZodCheckGreaterThan | $ZodCheckMultipleOf | $ZodCheckNumberFormat | $ZodCheckBigIntFormat | $ZodCheckMaxSize | $ZodCheckMinSize | $ZodCheckSizeEquals | $ZodCheckMaxLength | $ZodCheckMinLength | $ZodCheckLengthEquals | $ZodCheckStringFormat | $ZodCheckProperty | $ZodCheckMimeType | $ZodCheckOverwrite;\nexport type $ZodStringFormatChecks = $ZodCheckRegex | $ZodCheckLowerCase | $ZodCheckUpperCase | $ZodCheckIncludes | $ZodCheckStartsWith | $ZodCheckEndsWith | schemas.$ZodStringFormatTypes;\n"],"x_google_ignoreList":[0],"mappings":";;;;;;UAIiBI,YAAAA;;EAAAA,KAAAA,CAAAA,EAELH,YAFiB,CAEjBA,KAAAA,CAAAA,GAAAA,SAIUC;EAELK;EACRH,KAAAA,CAAAA,EAAAA,OAAAA,GAAAA,SAAAA;EAEEH;EAC6BO,IAAAA,CAAAA,EAAAA,CAAAA,CAAAA,OAAAA,EANlBN,YAMkBM,EAAAA,GAAAA,OAAAA,CAAAA,GAAAA,SAAAA;;AAAKL,UAJ5BI,kBAI4BJ,CAAAA,CAAAA,CAAAA,CAAAA;EACrBD,GAAAA,EAJfE,YAIeF;EAAgB;EAEvBU,IAAAA,CAAAA,EAJNX,aAKkBO;EAERI,KAAAA,CAAAA,OAA4C,EAN9CV,YAM+BU,CANVJ,CAMRR,CAAAA,CAAAA,EANaG,UAMI,CAAA,IAAA,CAAA;EAChCW,QAAAA,EAAAA,CAAAA,CAAAA,MAAAA,EANOZ,QAQbC,EAAAA,GAAAA,IAFmCC,CAAAA,EAAAA;AAK9C;AAAsDD,UATrCS,SASqCT,CAAAA,OAAAA,KAAAA,CAAAA,CAAAA;EAAeA,IAAAA,EAR3DI,kBAQ2DJ,CARxCK,CAQwCL,CAAAA;;AAC5DW,cAPYF,SAOZE,EAPuBd,YAOvBc,CAPyCF,SAOzCE,CAAAA,GAAAA,CAAAA,CAAAA;AACwBN,UAPhBM,oBAAAA,SAA6BV,YAObI,CAAAA;EAAvBP,KAAAA,EAAAA,WAAAA;EAFiFM,KAAAA,EAHhFJ,OAGgFI;EAAkB,SAAA,EAAA,OAAA;AAI7G;AAA6CJ,UAJ5Ba,0BAI4Bb,CAAAA,UAJSA,OAITA,GAJwBA,OAIxBA,CAAAA,SAJ8CI,kBAI9CJ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mB,4BAAAA,SAAqCrE;OAC7CoE;QACC1E;;UAEO4E,mBAAAA,SAA4BjE;QACnCgE;;cAEWC,qBAAqB7E,aAAkB6E;UAC3CC,oBAAAA,SAA6BrB;;;UAG7BsB,0BAAAA,SAAmCxE;OAC3CuE;QACC7E;;UAEO+E,iBAAAA,SAA0BzE;QACjCwE;;cAEWC,mBAAmBhF,aAAkBgF"}
|
|
1
|
+
{"version":3,"file":"checks.d.ts","names":["core","errors","schemas","util","$ZodCheckDef","$ZodErrorMap","ParsePayload","$ZodCheckInternals","T","$ZodIssueBase","MaybeAsync","$ZodType","$ZodCheck","$constructor","$ZodCheckLessThanDef","Numeric","$ZodCheckLessThanInternals","$ZodIssueTooBig","$ZodCheckLessThan","$ZodCheckGreaterThanDef","$ZodCheckGreaterThanInternals","$ZodIssueTooSmall","$ZodCheckGreaterThan","$ZodCheckMultipleOfDef","$ZodCheckMultipleOfInternals","$ZodIssueNotMultipleOf","$ZodCheckMultipleOf","$ZodNumberFormats","$ZodCheckNumberFormatDef","$ZodCheckNumberFormatInternals","$ZodIssueInvalidType","$ZodCheckNumberFormat","$ZodBigIntFormats","$ZodCheckBigIntFormatDef","$ZodCheckBigIntFormatInternals","$ZodCheckBigIntFormat","$ZodCheckMaxSizeDef","$ZodCheckMaxSizeInternals","HasSize","$ZodCheckMaxSize","$ZodCheckMinSizeDef","$ZodCheckMinSizeInternals","$ZodCheckMinSize","$ZodCheckSizeEqualsDef","$ZodCheckSizeEqualsInternals","$ZodCheckSizeEquals","$ZodCheckMaxLengthDef","$ZodCheckMaxLengthInternals","HasLength","$ZodCheckMaxLength","$ZodCheckMinLengthDef","$ZodCheckMinLengthInternals","$ZodCheckMinLength","$ZodCheckLengthEqualsDef","$ZodCheckLengthEqualsInternals","$ZodCheckLengthEquals","$ZodStringFormats","$ZodCheckStringFormatDef","Format","RegExp","$ZodCheckStringFormatInternals","$ZodIssueInvalidStringFormat","$ZodCheckStringFormat","$ZodCheckRegexDef","$ZodCheckRegexInternals","$ZodCheckRegex","$ZodCheckLowerCaseDef","$ZodCheckLowerCaseInternals","$ZodCheckLowerCase","$ZodCheckUpperCaseDef","$ZodCheckUpperCaseInternals","$ZodCheckUpperCase","$ZodCheckIncludesDef","$ZodCheckIncludesInternals","$ZodCheckIncludes","$ZodCheckStartsWithDef","$ZodCheckStartsWithInternals","$ZodCheckStartsWith","$ZodCheckEndsWithDef","$ZodCheckEndsWithInternals","$ZodCheckEndsWith","$ZodCheckPropertyDef","$ZodCheckPropertyInternals","$ZodIssue","$ZodCheckProperty","$ZodCheckMimeTypeDef","MimeTypes","$ZodCheckMimeTypeInternals","File","$ZodIssueInvalidValue","$ZodCheckMimeType","$ZodCheckOverwriteDef","$ZodCheckOverwriteInternals","$ZodCheckOverwrite","$ZodChecks","$ZodStringFormatChecks","$ZodStringFormatTypes"],"sources":["../../../node_modules/.bun/zod@4.1.12/node_modules/zod/v4/core/checks.d.cts"],"sourcesContent":["import * as core from \"./core.cjs\";\nimport type * as errors from \"./errors.cjs\";\nimport type * as schemas from \"./schemas.cjs\";\nimport * as util from \"./util.cjs\";\nexport interface $ZodCheckDef {\n check: string;\n error?: errors.$ZodErrorMap<never> | undefined;\n /** If true, no later checks will be executed if this check fails. Default `false`. */\n abort?: boolean | undefined;\n /** If provided, this check will only be executed if the function returns `true`. Defaults to `payload => z.util.isAborted(payload)`. */\n when?: ((payload: schemas.ParsePayload) => boolean) | undefined;\n}\nexport interface $ZodCheckInternals<T> {\n def: $ZodCheckDef;\n /** The set of issues this check might throw. */\n issc?: errors.$ZodIssueBase;\n check(payload: schemas.ParsePayload<T>): util.MaybeAsync<void>;\n onattach: ((schema: schemas.$ZodType) => void)[];\n}\nexport interface $ZodCheck<in T = never> {\n _zod: $ZodCheckInternals<T>;\n}\nexport declare const $ZodCheck: core.$constructor<$ZodCheck<any>>;\nexport interface $ZodCheckLessThanDef extends $ZodCheckDef {\n check: \"less_than\";\n value: util.Numeric;\n inclusive: boolean;\n}\nexport interface $ZodCheckLessThanInternals<T extends util.Numeric = util.Numeric> extends $ZodCheckInternals<T> {\n def: $ZodCheckLessThanDef;\n issc: errors.$ZodIssueTooBig<T>;\n}\nexport interface $ZodCheckLessThan<T extends util.Numeric = util.Numeric> extends $ZodCheck<T> {\n _zod: $ZodCheckLessThanInternals<T>;\n}\nexport declare const $ZodCheckLessThan: core.$constructor<$ZodCheckLessThan>;\nexport interface $ZodCheckGreaterThanDef extends $ZodCheckDef {\n check: \"greater_than\";\n value: util.Numeric;\n inclusive: boolean;\n}\nexport interface $ZodCheckGreaterThanInternals<T extends util.Numeric = util.Numeric> extends $ZodCheckInternals<T> {\n def: $ZodCheckGreaterThanDef;\n issc: errors.$ZodIssueTooSmall<T>;\n}\nexport interface $ZodCheckGreaterThan<T extends util.Numeric = util.Numeric> extends $ZodCheck<T> {\n _zod: $ZodCheckGreaterThanInternals<T>;\n}\nexport declare const $ZodCheckGreaterThan: core.$constructor<$ZodCheckGreaterThan>;\nexport interface $ZodCheckMultipleOfDef<T extends number | bigint = number | bigint> extends $ZodCheckDef {\n check: \"multiple_of\";\n value: T;\n}\nexport interface $ZodCheckMultipleOfInternals<T extends number | bigint = number | bigint> extends $ZodCheckInternals<T> {\n def: $ZodCheckMultipleOfDef<T>;\n issc: errors.$ZodIssueNotMultipleOf;\n}\nexport interface $ZodCheckMultipleOf<T extends number | bigint = number | bigint> extends $ZodCheck<T> {\n _zod: $ZodCheckMultipleOfInternals<T>;\n}\nexport declare const $ZodCheckMultipleOf: core.$constructor<$ZodCheckMultipleOf<number | bigint>>;\nexport type $ZodNumberFormats = \"int32\" | \"uint32\" | \"float32\" | \"float64\" | \"safeint\";\nexport interface $ZodCheckNumberFormatDef extends $ZodCheckDef {\n check: \"number_format\";\n format: $ZodNumberFormats;\n}\nexport interface $ZodCheckNumberFormatInternals extends $ZodCheckInternals<number> {\n def: $ZodCheckNumberFormatDef;\n issc: errors.$ZodIssueInvalidType | errors.$ZodIssueTooBig<\"number\"> | errors.$ZodIssueTooSmall<\"number\">;\n}\nexport interface $ZodCheckNumberFormat extends $ZodCheck<number> {\n _zod: $ZodCheckNumberFormatInternals;\n}\nexport declare const $ZodCheckNumberFormat: core.$constructor<$ZodCheckNumberFormat>;\nexport type $ZodBigIntFormats = \"int64\" | \"uint64\";\nexport interface $ZodCheckBigIntFormatDef extends $ZodCheckDef {\n check: \"bigint_format\";\n format: $ZodBigIntFormats | undefined;\n}\nexport interface $ZodCheckBigIntFormatInternals extends $ZodCheckInternals<bigint> {\n def: $ZodCheckBigIntFormatDef;\n issc: errors.$ZodIssueTooBig<\"bigint\"> | errors.$ZodIssueTooSmall<\"bigint\">;\n}\nexport interface $ZodCheckBigIntFormat extends $ZodCheck<bigint> {\n _zod: $ZodCheckBigIntFormatInternals;\n}\nexport declare const $ZodCheckBigIntFormat: core.$constructor<$ZodCheckBigIntFormat>;\nexport interface $ZodCheckMaxSizeDef extends $ZodCheckDef {\n check: \"max_size\";\n maximum: number;\n}\nexport interface $ZodCheckMaxSizeInternals<T extends util.HasSize = util.HasSize> extends $ZodCheckInternals<T> {\n def: $ZodCheckMaxSizeDef;\n issc: errors.$ZodIssueTooBig<T>;\n}\nexport interface $ZodCheckMaxSize<T extends util.HasSize = util.HasSize> extends $ZodCheck<T> {\n _zod: $ZodCheckMaxSizeInternals<T>;\n}\nexport declare const $ZodCheckMaxSize: core.$constructor<$ZodCheckMaxSize>;\nexport interface $ZodCheckMinSizeDef extends $ZodCheckDef {\n check: \"min_size\";\n minimum: number;\n}\nexport interface $ZodCheckMinSizeInternals<T extends util.HasSize = util.HasSize> extends $ZodCheckInternals<T> {\n def: $ZodCheckMinSizeDef;\n issc: errors.$ZodIssueTooSmall<T>;\n}\nexport interface $ZodCheckMinSize<T extends util.HasSize = util.HasSize> extends $ZodCheck<T> {\n _zod: $ZodCheckMinSizeInternals<T>;\n}\nexport declare const $ZodCheckMinSize: core.$constructor<$ZodCheckMinSize>;\nexport interface $ZodCheckSizeEqualsDef extends $ZodCheckDef {\n check: \"size_equals\";\n size: number;\n}\nexport interface $ZodCheckSizeEqualsInternals<T extends util.HasSize = util.HasSize> extends $ZodCheckInternals<T> {\n def: $ZodCheckSizeEqualsDef;\n issc: errors.$ZodIssueTooBig<T> | errors.$ZodIssueTooSmall<T>;\n}\nexport interface $ZodCheckSizeEquals<T extends util.HasSize = util.HasSize> extends $ZodCheck<T> {\n _zod: $ZodCheckSizeEqualsInternals<T>;\n}\nexport declare const $ZodCheckSizeEquals: core.$constructor<$ZodCheckSizeEquals>;\nexport interface $ZodCheckMaxLengthDef extends $ZodCheckDef {\n check: \"max_length\";\n maximum: number;\n}\nexport interface $ZodCheckMaxLengthInternals<T extends util.HasLength = util.HasLength> extends $ZodCheckInternals<T> {\n def: $ZodCheckMaxLengthDef;\n issc: errors.$ZodIssueTooBig<T>;\n}\nexport interface $ZodCheckMaxLength<T extends util.HasLength = util.HasLength> extends $ZodCheck<T> {\n _zod: $ZodCheckMaxLengthInternals<T>;\n}\nexport declare const $ZodCheckMaxLength: core.$constructor<$ZodCheckMaxLength>;\nexport interface $ZodCheckMinLengthDef extends $ZodCheckDef {\n check: \"min_length\";\n minimum: number;\n}\nexport interface $ZodCheckMinLengthInternals<T extends util.HasLength = util.HasLength> extends $ZodCheckInternals<T> {\n def: $ZodCheckMinLengthDef;\n issc: errors.$ZodIssueTooSmall<T>;\n}\nexport interface $ZodCheckMinLength<T extends util.HasLength = util.HasLength> extends $ZodCheck<T> {\n _zod: $ZodCheckMinLengthInternals<T>;\n}\nexport declare const $ZodCheckMinLength: core.$constructor<$ZodCheckMinLength>;\nexport interface $ZodCheckLengthEqualsDef extends $ZodCheckDef {\n check: \"length_equals\";\n length: number;\n}\nexport interface $ZodCheckLengthEqualsInternals<T extends util.HasLength = util.HasLength> extends $ZodCheckInternals<T> {\n def: $ZodCheckLengthEqualsDef;\n issc: errors.$ZodIssueTooBig<T> | errors.$ZodIssueTooSmall<T>;\n}\nexport interface $ZodCheckLengthEquals<T extends util.HasLength = util.HasLength> extends $ZodCheck<T> {\n _zod: $ZodCheckLengthEqualsInternals<T>;\n}\nexport declare const $ZodCheckLengthEquals: core.$constructor<$ZodCheckLengthEquals>;\nexport type $ZodStringFormats = \"email\" | \"url\" | \"emoji\" | \"uuid\" | \"guid\" | \"nanoid\" | \"cuid\" | \"cuid2\" | \"ulid\" | \"xid\" | \"ksuid\" | \"datetime\" | \"date\" | \"time\" | \"duration\" | \"ipv4\" | \"ipv6\" | \"cidrv4\" | \"cidrv6\" | \"base64\" | \"base64url\" | \"json_string\" | \"e164\" | \"lowercase\" | \"uppercase\" | \"regex\" | \"jwt\" | \"starts_with\" | \"ends_with\" | \"includes\";\nexport interface $ZodCheckStringFormatDef<Format extends string = string> extends $ZodCheckDef {\n check: \"string_format\";\n format: Format;\n pattern?: RegExp | undefined;\n}\nexport interface $ZodCheckStringFormatInternals extends $ZodCheckInternals<string> {\n def: $ZodCheckStringFormatDef;\n issc: errors.$ZodIssueInvalidStringFormat;\n}\nexport interface $ZodCheckStringFormat extends $ZodCheck<string> {\n _zod: $ZodCheckStringFormatInternals;\n}\nexport declare const $ZodCheckStringFormat: core.$constructor<$ZodCheckStringFormat>;\nexport interface $ZodCheckRegexDef extends $ZodCheckStringFormatDef {\n format: \"regex\";\n pattern: RegExp;\n}\nexport interface $ZodCheckRegexInternals extends $ZodCheckInternals<string> {\n def: $ZodCheckRegexDef;\n issc: errors.$ZodIssueInvalidStringFormat;\n}\nexport interface $ZodCheckRegex extends $ZodCheck<string> {\n _zod: $ZodCheckRegexInternals;\n}\nexport declare const $ZodCheckRegex: core.$constructor<$ZodCheckRegex>;\nexport interface $ZodCheckLowerCaseDef extends $ZodCheckStringFormatDef<\"lowercase\"> {\n}\nexport interface $ZodCheckLowerCaseInternals extends $ZodCheckInternals<string> {\n def: $ZodCheckLowerCaseDef;\n issc: errors.$ZodIssueInvalidStringFormat;\n}\nexport interface $ZodCheckLowerCase extends $ZodCheck<string> {\n _zod: $ZodCheckLowerCaseInternals;\n}\nexport declare const $ZodCheckLowerCase: core.$constructor<$ZodCheckLowerCase>;\nexport interface $ZodCheckUpperCaseDef extends $ZodCheckStringFormatDef<\"uppercase\"> {\n}\nexport interface $ZodCheckUpperCaseInternals extends $ZodCheckInternals<string> {\n def: $ZodCheckUpperCaseDef;\n issc: errors.$ZodIssueInvalidStringFormat;\n}\nexport interface $ZodCheckUpperCase extends $ZodCheck<string> {\n _zod: $ZodCheckUpperCaseInternals;\n}\nexport declare const $ZodCheckUpperCase: core.$constructor<$ZodCheckUpperCase>;\nexport interface $ZodCheckIncludesDef extends $ZodCheckStringFormatDef<\"includes\"> {\n includes: string;\n position?: number | undefined;\n}\nexport interface $ZodCheckIncludesInternals extends $ZodCheckInternals<string> {\n def: $ZodCheckIncludesDef;\n issc: errors.$ZodIssueInvalidStringFormat;\n}\nexport interface $ZodCheckIncludes extends $ZodCheck<string> {\n _zod: $ZodCheckIncludesInternals;\n}\nexport declare const $ZodCheckIncludes: core.$constructor<$ZodCheckIncludes>;\nexport interface $ZodCheckStartsWithDef extends $ZodCheckStringFormatDef<\"starts_with\"> {\n prefix: string;\n}\nexport interface $ZodCheckStartsWithInternals extends $ZodCheckInternals<string> {\n def: $ZodCheckStartsWithDef;\n issc: errors.$ZodIssueInvalidStringFormat;\n}\nexport interface $ZodCheckStartsWith extends $ZodCheck<string> {\n _zod: $ZodCheckStartsWithInternals;\n}\nexport declare const $ZodCheckStartsWith: core.$constructor<$ZodCheckStartsWith>;\nexport interface $ZodCheckEndsWithDef extends $ZodCheckStringFormatDef<\"ends_with\"> {\n suffix: string;\n}\nexport interface $ZodCheckEndsWithInternals extends $ZodCheckInternals<string> {\n def: $ZodCheckEndsWithDef;\n issc: errors.$ZodIssueInvalidStringFormat;\n}\nexport interface $ZodCheckEndsWith extends $ZodCheckInternals<string> {\n _zod: $ZodCheckEndsWithInternals;\n}\nexport declare const $ZodCheckEndsWith: core.$constructor<$ZodCheckEndsWith>;\nexport interface $ZodCheckPropertyDef extends $ZodCheckDef {\n check: \"property\";\n property: string;\n schema: schemas.$ZodType;\n}\nexport interface $ZodCheckPropertyInternals<T extends object = object> extends $ZodCheckInternals<T> {\n def: $ZodCheckPropertyDef;\n issc: errors.$ZodIssue;\n}\nexport interface $ZodCheckProperty<T extends object = object> extends $ZodCheck<T> {\n _zod: $ZodCheckPropertyInternals<T>;\n}\nexport declare const $ZodCheckProperty: core.$constructor<$ZodCheckProperty>;\nexport interface $ZodCheckMimeTypeDef extends $ZodCheckDef {\n check: \"mime_type\";\n mime: util.MimeTypes[];\n}\nexport interface $ZodCheckMimeTypeInternals<T extends schemas.File = schemas.File> extends $ZodCheckInternals<T> {\n def: $ZodCheckMimeTypeDef;\n issc: errors.$ZodIssueInvalidValue;\n}\nexport interface $ZodCheckMimeType<T extends schemas.File = schemas.File> extends $ZodCheck<T> {\n _zod: $ZodCheckMimeTypeInternals<T>;\n}\nexport declare const $ZodCheckMimeType: core.$constructor<$ZodCheckMimeType>;\nexport interface $ZodCheckOverwriteDef<T = unknown> extends $ZodCheckDef {\n check: \"overwrite\";\n tx(value: T): T;\n}\nexport interface $ZodCheckOverwriteInternals<T = unknown> extends $ZodCheckInternals<T> {\n def: $ZodCheckOverwriteDef<T>;\n issc: never;\n}\nexport interface $ZodCheckOverwrite<T = unknown> extends $ZodCheck<T> {\n _zod: $ZodCheckOverwriteInternals<T>;\n}\nexport declare const $ZodCheckOverwrite: core.$constructor<$ZodCheckOverwrite>;\nexport type $ZodChecks = $ZodCheckLessThan | $ZodCheckGreaterThan | $ZodCheckMultipleOf | $ZodCheckNumberFormat | $ZodCheckBigIntFormat | $ZodCheckMaxSize | $ZodCheckMinSize | $ZodCheckSizeEquals | $ZodCheckMaxLength | $ZodCheckMinLength | $ZodCheckLengthEquals | $ZodCheckStringFormat | $ZodCheckProperty | $ZodCheckMimeType | $ZodCheckOverwrite;\nexport type $ZodStringFormatChecks = $ZodCheckRegex | $ZodCheckLowerCase | $ZodCheckUpperCase | $ZodCheckIncludes | $ZodCheckStarts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AAAA,SAA6BrB;;;UAG7BsB,0BAAAA,SAAmCxE;OAC3CuE;QACC7E;;UAEO+E,iBAAAA,SAA0BzE;QACjCwE;;cAEWC,mBAAmBhF,aAAkBgF"}
|
package/core.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","names":["errors","schemas","Class","ZodTrait","$constructor","T","D","NEVER","$brand","$ZodBranded","Brand","SomeType","output","Record","$ZodAsyncError","Error","$ZodEncodeError","input","infer","$ZodConfig","$ZodErrorMap","globalConfig","config","Partial"],"sources":["../../../node_modules/.bun/zod@4.1.12/node_modules/zod/v4/core/core.d.cts"],"sourcesContent":["import type * as errors from \"./errors.cjs\";\nimport type * as schemas from \"./schemas.cjs\";\nimport type { Class } from \"./util.cjs\";\ntype ZodTrait = {\n _zod: {\n def: any;\n [k: string]: any;\n };\n};\nexport interface $constructor<T extends ZodTrait, D = T[\"_zod\"][\"def\"]> {\n new (def: D): T;\n init(inst: T, def: D): asserts inst is T;\n}\n/** A special constant with type `never` */\nexport declare const NEVER: never;\nexport declare function $constructor<T extends ZodTrait, D = T[\"_zod\"][\"def\"]>(name: string, initializer: (inst: T, def: D) => void, params?: {\n Parent?: typeof Class;\n}): $constructor<T, D>;\nexport declare const $brand: unique symbol;\nexport type $brand<T extends string | number | symbol = string | number | symbol> = {\n [$brand]: {\n [k in T]: true;\n };\n};\nexport type $ZodBranded<T extends schemas.SomeType, Brand extends string | number | symbol> = T & Record<\"_zod\", Record<\"output\", output<T> & $brand<Brand>>>;\nexport declare class $ZodAsyncError extends Error {\n constructor();\n}\nexport declare class $ZodEncodeError extends Error {\n constructor(name: string);\n}\nexport type input<T> = T extends {\n _zod: {\n input: any;\n };\n} ? T[\"_zod\"][\"input\"] : unknown;\nexport type output<T> = T extends {\n _zod: {\n output: any;\n };\n} ? T[\"_zod\"][\"output\"] : unknown;\nexport type { output as infer };\nexport interface $ZodConfig {\n /** Custom error map. Overrides `config().localeError`. */\n customError?: errors.$ZodErrorMap | undefined;\n /** Localized error map. Lowest priority. */\n localeError?: errors.$ZodErrorMap | undefined;\n /** Disable JIT schema compilation. Useful in environments that disallow `eval`. */\n jitless?: boolean | undefined;\n}\nexport declare const globalConfig: $ZodConfig;\nexport declare function config(newConfig?: Partial<$ZodConfig>): $ZodConfig;\n"],"x_google_ignoreList":[0],"mappings":";;;;KAGKG,QAAAA;EAAAA,IAAAA,EAAAA;IAMYC,GAAAA,EAAAA,GAAAA;IAAuBD,CAAAA,CAAAA,EAAAA,MAAAA,CAAAA,EAAAA,GAAAA;EAAcE,CAAAA;CACxCC;AAAID,UADDD,YACCC,CAAAA,UADsBF,QACtBE,EAAAA,IADoCA,CACpCA,CAAAA,MAAAA,CAAAA,CAAAA,KAAAA,CAAAA,CAAAA,CAAAA;EACHA,KAAAA,GAAAA,EADDC,CACCD,CAAAA,EADGA,CACHA;EAAQC,IAAAA,CAAAA,IAAAA,EAARD,CAAQC,EAAAA,GAAAA,EAAAA,CAAAA,CAAAA,EAAAA,QAAAA,IAAAA,IAAoBD,CAApBC;;AAIwBH,iBAAvBC,YAAuBD,CAAAA,UAAAA,QAAAA,EAAAA,IAAcE,CAAdF,CAAAA,MAAAA,CAAAA,CAAAA,KAAAA,CAAAA,CAAAA,CAAAA,IAAAA,EAAAA,MAAAA,EAAAA,WAAAA,EAAAA,CAAAA,IAAAA,EAAkEE,CAAlEF,EAAAA,GAAAA,EAA0EG,CAA1EH,EAAAA,GAAAA,IAAAA,EAAAA,MAAkEE,CAAlEF,EAAAA;EAAcE,MAAAA,CAAAA,EAAAA,OACzCH,KADyCG;CAAoDA,CAAAA,EAE7GD,YAF6GC,CAEhGA,CAFgGA,EAE7FC,CAF6FD,CAAAA;AAAQC,cAGpGE,MAHoGF,EAAAA,OAAAA,MAAAA;AACrGJ,KAGRM,MAHQN,CAAAA,UAAAA,MAAAA,GAAAA,MAAAA,GAAAA,MAAAA,GAAAA,MAAAA,GAAAA,MAAAA,GAAAA,MAAAA,CAAAA,GAAAA;EACHG,CAGZG,MAAAA,CAHYH,EAAAA,QAIHA,CAJMC,GAAAA,IAAAA,EAAhBF;CAAY;AACKI,KAMTC,WAN8B,CAAA,UAMRR,QANQ,EAAA,cAAA,MAAA,GAAA,MAAA,GAAA,MAAA,CAAA,GAMoDI,CANpD,GAMwDQ,MANxD,CAAA,MAAA,EAMuEA,MANvE,CAAA,QAAA,EAMwFD,MANxF,CAM+FP,CAN/F,CAAA,GAMoGG,MANpG,CAM2GE,KAN3G,CAAA,CAAA,CAAA;AAM2GA,KAOzIO,KAPyIP,CAAAA,CAAAA,CAAAA,GAO9HL,CAP8HK,SAAAA;EAAPF,IAAAA,EAAAA;IAA7BK,KAAAA,EAAAA,GAAAA;EAAfA,CAAAA;CAAM,GAWpGR,CAXoG,CAAA,MAAA,CAAA,CAAA,OAAA,CAAA,GAAA,OAAA;AAO5FY,KAKAL,MALK,
|
|
1
|
+
{"version":3,"file":"core.d.ts","names":["errors","schemas","Class","ZodTrait","$constructor","T","D","NEVER","$brand","$ZodBranded","Brand","SomeType","output","Record","$ZodAsyncError","Error","$ZodEncodeError","input","infer","$ZodConfig","$ZodErrorMap","globalConfig","config","Partial"],"sources":["../../../node_modules/.bun/zod@4.1.12/node_modules/zod/v4/core/core.d.cts"],"sourcesContent":["import type * as errors from \"./errors.cjs\";\nimport type * as schemas from \"./schemas.cjs\";\nimport type { Class } from \"./util.cjs\";\ntype ZodTrait = {\n _zod: {\n def: any;\n [k: string]: any;\n };\n};\nexport interface $constructor<T extends ZodTrait, D = T[\"_zod\"][\"def\"]> {\n new (def: D): T;\n init(inst: T, def: D): asserts inst is T;\n}\n/** A special constant with type `never` */\nexport declare const NEVER: never;\nexport declare function $constructor<T extends ZodTrait, D = T[\"_zod\"][\"def\"]>(name: string, initializer: (inst: T, def: D) => void, params?: {\n Parent?: typeof Class;\n}): $constructor<T, D>;\nexport declare const $brand: unique symbol;\nexport type $brand<T extends string | number | symbol = string | number | symbol> = {\n [$brand]: {\n [k in T]: true;\n };\n};\nexport type $ZodBranded<T extends schemas.SomeType, Brand extends string | number | symbol> = T & Record<\"_zod\", Record<\"output\", output<T> & $brand<Brand>>>;\nexport declare class $ZodAsyncError extends Error {\n constructor();\n}\nexport declare class $ZodEncodeError extends Error {\n constructor(name: string);\n}\nexport type input<T> = T extends {\n _zod: {\n input: any;\n };\n} ? T[\"_zod\"][\"input\"] : unknown;\nexport type output<T> = T extends {\n _zod: {\n output: any;\n };\n} ? T[\"_zod\"][\"output\"] : unknown;\nexport type { output as infer };\nexport interface $ZodConfig {\n /** Custom error map. Overrides `config().localeError`. */\n customError?: errors.$ZodErrorMap | undefined;\n /** Localized error map. Lowest priority. */\n localeError?: errors.$ZodErrorMap | undefined;\n /** Disable JIT schema compilation. Useful in environments that disallow `eval`. */\n jitless?: boolean | undefined;\n}\nexport declare const globalConfig: $ZodConfig;\nexport declare function config(newConfig?: Partial<$ZodConfig>): $ZodConfig;\n"],"x_google_ignoreList":[0],"mappings":";;;;KAGKG,QAAAA;EAAAA,IAAAA,EAAAA;IAMYC,GAAAA,EAAAA,GAAAA;IAAuBD,CAAAA,CAAAA,EAAAA,MAAAA,CAAAA,EAAAA,GAAAA;EAAcE,CAAAA;CACxCC;AAAID,UADDD,YACCC,CAAAA,UADsBF,QACtBE,EAAAA,IADoCA,CACpCA,CAAAA,MAAAA,CAAAA,CAAAA,KAAAA,CAAAA,CAAAA,CAAAA;EACHA,KAAAA,GAAAA,EADDC,CACCD,CAAAA,EADGA,CACHA;EAAQC,IAAAA,CAAAA,IAAAA,EAARD,CAAQC,EAAAA,GAAAA,EAAAA,CAAAA,CAAAA,EAAAA,QAAAA,IAAAA,IAAoBD,CAApBC;;AAIwBH,iBAAvBC,YAAuBD,CAAAA,UAAAA,QAAAA,EAAAA,IAAcE,CAAdF,CAAAA,MAAAA,CAAAA,CAAAA,KAAAA,CAAAA,CAAAA,CAAAA,IAAAA,EAAAA,MAAAA,EAAAA,WAAAA,EAAAA,CAAAA,IAAAA,EAAkEE,CAAlEF,EAAAA,GAAAA,EAA0EG,CAA1EH,EAAAA,GAAAA,IAAAA,EAAAA,MAAkEE,CAAlEF,EAAAA;EAAcE,MAAAA,CAAAA,EAAAA,OACzCH,KADyCG;CAAoDA,CAAAA,EAE7GD,YAF6GC,CAEhGA,CAFgGA,EAE7FC,CAF6FD,CAAAA;AAAQC,cAGpGE,MAHoGF,EAAAA,OAAAA,MAAAA;AACrGJ,KAGRM,MAHQN,CAAAA,UAAAA,MAAAA,GAAAA,MAAAA,GAAAA,MAAAA,GAAAA,MAAAA,GAAAA,MAAAA,GAAAA,MAAAA,CAAAA,GAAAA;EACHG,CAGZG,MAAAA,CAHYH,EAAAA,QAIHA,CAJMC,GAAAA,IAAAA,EAAhBF;CAAY;AACKI,KAMTC,WAN8B,CAAA,UAMRR,QANQ,EAAA,cAAA,MAAA,GAAA,MAAA,GAAA,MAAA,CAAA,GAMoDI,CANpD,GAMwDQ,MANxD,CAAA,MAAA,EAMuEA,MANvE,CAAA,QAAA,EAMwFD,MANxF,CAM+FP,CAN/F,CAAA,GAMoGG,MANpG,CAM2GE,KAN3G,CAAA,CAAA,CAAA;AAM2GA,KAOzIO,KAPyIP,CAAAA,CAAAA,CAAAA,GAO9HL,CAP8HK,SAAAA;EAAPF,IAAAA,EAAAA;IAA7BK,KAAAA,EAAAA,GAAAA;EAAfA,CAAAA;CAAM,GAWpGR,CAXoG,CAAA,MAAA,CAAA,CAAA,OAAA,CAAA,GAAA,OAAA;AAO5FY,KAKAL,MALK,CAAAP,CAAAA,CAAAA,GAKOA,CALP,SAIZ;EACOO,IAAAA,EAAAA;;;IAIRP"}
|
package/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","names":["$ZodCheck","$ZodStringFormats","$constructor","$ZodType","StandardSchemaV1","util","$ZodIssueBase","PropertyKey","$ZodIssueInvalidType","Input","$ZodIssueTooBig","$ZodIssueTooSmall","$ZodIssueInvalidStringFormat","$ZodIssueNotMultipleOf","$ZodIssueUnrecognizedKeys","Record","$ZodIssueInvalidUnion","$ZodIssue","$ZodIssueInvalidKey","$ZodIssueInvalidElement","$ZodIssueInvalidValue","Primitive","$ZodIssueCustom","$ZodIssueStringCommonFormats","Exclude","$ZodIssueStringInvalidRegex","$ZodIssueStringInvalidJWT","$ZodIssueStringStartsWith","$ZodIssueStringEndsWith","$ZodIssueStringIncludes","$ZodStringFormatIssues","$ZodIssueCode","$ZodInternalIssue","T","RawIssue","MakePartial","Flatten","$ZodRawIssue","$ZodErrorMap","$ZodError","Error","$ZodRealError","$ZodFlattenedError","U","_FlattenedError","flattenError","_ZodFormattedError","K","$ZodFormattedError","formatError","$ZodErrorTree","Array","treeifyError","toDotPath","PathSegment","prettifyError","FailureResult"],"sources":["../../../node_modules/.bun/zod@4.1.12/node_modules/zod/v4/core/errors.d.cts"],"sourcesContent":["import type { $ZodCheck, $ZodStringFormats } from \"./checks.cjs\";\nimport { $constructor } from \"./core.cjs\";\nimport type { $ZodType } from \"./schemas.cjs\";\nimport type { StandardSchemaV1 } from \"./standard-schema.cjs\";\nimport * as util from \"./util.cjs\";\nexport interface $ZodIssueBase {\n readonly code?: string;\n readonly input?: unknown;\n readonly path: PropertyKey[];\n readonly message: string;\n}\nexport interface $ZodIssueInvalidType<Input = unknown> extends $ZodIssueBase {\n readonly code: \"invalid_type\";\n readonly expected: $ZodType[\"_zod\"][\"def\"][\"type\"];\n readonly input?: Input;\n}\nexport interface $ZodIssueTooBig<Input = unknown> extends $ZodIssueBase {\n readonly code: \"too_big\";\n readonly origin: \"number\" | \"int\" | \"bigint\" | \"date\" | \"string\" | \"array\" | \"set\" | \"file\" | (string & {});\n readonly maximum: number | bigint;\n readonly inclusive?: boolean;\n readonly exact?: boolean;\n readonly input?: Input;\n}\nexport interface $ZodIssueTooSmall<Input = unknown> extends $ZodIssueBase {\n readonly code: \"too_small\";\n readonly origin: \"number\" | \"int\" | \"bigint\" | \"date\" | \"string\" | \"array\" | \"set\" | \"file\" | (string & {});\n readonly minimum: number | bigint;\n /** True if the allowable range includes the minimum */\n readonly inclusive?: boolean;\n /** True if the allowed value is fixed (e.g.` z.length(5)`), not a range (`z.minLength(5)`) */\n readonly exact?: boolean;\n readonly input?: Input;\n}\nexport interface $ZodIssueInvalidStringFormat extends $ZodIssueBase {\n readonly code: \"invalid_format\";\n readonly format: $ZodStringFormats | (string & {});\n readonly pattern?: string;\n readonly input?: string;\n}\nexport interface $ZodIssueNotMultipleOf<Input extends number | bigint = number | bigint> extends $ZodIssueBase {\n readonly code: \"not_multiple_of\";\n readonly divisor: number;\n readonly input?: Input;\n}\nexport interface $ZodIssueUnrecognizedKeys extends $ZodIssueBase {\n readonly code: \"unrecognized_keys\";\n readonly keys: string[];\n readonly input?: Record<string, unknown>;\n}\nexport interface $ZodIssueInvalidUnion extends $ZodIssueBase {\n readonly code: \"invalid_union\";\n readonly errors: $ZodIssue[][];\n readonly input?: unknown;\n readonly discriminator?: string | undefined;\n}\nexport interface $ZodIssueInvalidKey<Input = unknown> extends $ZodIssueBase {\n readonly code: \"invalid_key\";\n readonly origin: \"map\" | \"record\";\n readonly issues: $ZodIssue[];\n readonly input?: Input;\n}\nexport interface $ZodIssueInvalidElement<Input = unknown> extends $ZodIssueBase {\n readonly code: \"invalid_element\";\n readonly origin: \"map\" | \"set\";\n readonly key: unknown;\n readonly issues: $ZodIssue[];\n readonly input?: Input;\n}\nexport interface $ZodIssueInvalidValue<Input = unknown> extends $ZodIssueBase {\n readonly code: \"invalid_value\";\n readonly values: util.Primitive[];\n readonly input?: Input;\n}\nexport interface $ZodIssueCustom extends $ZodIssueBase {\n readonly code: \"custom\";\n readonly params?: Record<string, any> | undefined;\n readonly input?: unknown;\n}\nexport interface $ZodIssueStringCommonFormats extends $ZodIssueInvalidStringFormat {\n format: Exclude<$ZodStringFormats, \"regex\" | \"jwt\" | \"starts_with\" | \"ends_with\" | \"includes\">;\n}\nexport interface $ZodIssueStringInvalidRegex extends $ZodIssueInvalidStringFormat {\n format: \"regex\";\n pattern: string;\n}\nexport interface $ZodIssueStringInvalidJWT extends $ZodIssueInvalidStringFormat {\n format: \"jwt\";\n algorithm?: string;\n}\nexport interface $ZodIssueStringStartsWith extends $ZodIssueInvalidStringFormat {\n format: \"starts_with\";\n prefix: string;\n}\nexport interface $ZodIssueStringEndsWith extends $ZodIssueInvalidStringFormat {\n format: \"ends_with\";\n suffix: string;\n}\nexport interface $ZodIssueStringIncludes extends $ZodIssueInvalidStringFormat {\n format: \"includes\";\n includes: string;\n}\nexport type $ZodStringFormatIssues = $ZodIssueStringCommonFormats | $ZodIssueStringInvalidRegex | $ZodIssueStringInvalidJWT | $ZodIssueStringStartsWith | $ZodIssueStringEndsWith | $ZodIssueStringIncludes;\nexport type $ZodIssue = $ZodIssueInvalidType | $ZodIssueTooBig | $ZodIssueTooSmall | $ZodIssueInvalidStringFormat | $ZodIssueNotMultipleOf | $ZodIssueUnrecognizedKeys | $ZodIssueInvalidUnion | $ZodIssueInvalidKey | $ZodIssueInvalidElement | $ZodIssueInvalidValue | $ZodIssueCustom;\nexport type $ZodIssueCode = $ZodIssue[\"code\"];\nexport type $ZodInternalIssue<T extends $ZodIssueBase = $ZodIssue> = T extends any ? RawIssue<T> : never;\ntype RawIssue<T extends $ZodIssueBase> = T extends any ? util.Flatten<util.MakePartial<T, \"message\" | \"path\"> & {\n /** The input data */\n readonly input: unknown;\n /** The schema or check that originated this issue. */\n readonly inst?: $ZodType | $ZodCheck;\n /** If `true`, Zod will continue executing checks/refinements after this issue. */\n readonly continue?: boolean | undefined;\n} & Record<string, unknown>> : never;\nexport type $ZodRawIssue<T extends $ZodIssueBase = $ZodIssue> = $ZodInternalIssue<T>;\nexport interface $ZodErrorMap<T extends $ZodIssueBase = $ZodIssue> {\n (issue: $ZodRawIssue<T>): {\n message: string;\n } | string | undefined | null;\n}\nexport interface $ZodError<T = unknown> extends Error {\n type: T;\n issues: $ZodIssue[];\n _zod: {\n output: T;\n def: $ZodIssue[];\n };\n stack?: string;\n name: string;\n}\nexport declare const $ZodError: $constructor<$ZodError>;\ninterface $ZodRealError<T = any> extends $ZodError<T> {\n}\nexport declare const $ZodRealError: $constructor<$ZodRealError>;\nexport type $ZodFlattenedError<T, U = string> = _FlattenedError<T, U>;\ntype _FlattenedError<T, U = string> = {\n formErrors: U[];\n fieldErrors: {\n [P in keyof T]?: U[];\n };\n};\nexport declare function flattenError<T>(error: $ZodError<T>): _FlattenedError<T>;\nexport declare function flattenError<T, U>(error: $ZodError<T>, mapper?: (issue: $ZodIssue) => U): _FlattenedError<T, U>;\ntype _ZodFormattedError<T, U = string> = T extends [any, ...any[]] ? {\n [K in keyof T]?: $ZodFormattedError<T[K], U>;\n} : T extends any[] ? {\n [k: number]: $ZodFormattedError<T[number], U>;\n} : T extends object ? util.Flatten<{\n [K in keyof T]?: $ZodFormattedError<T[K], U>;\n}> : any;\nexport type $ZodFormattedError<T, U = string> = {\n _errors: U[];\n} & util.Flatten<_ZodFormattedError<T, U>>;\nexport declare function formatError<T>(error: $ZodError<T>): $ZodFormattedError<T>;\nexport declare function formatError<T, U>(error: $ZodError<T>, mapper?: (issue: $ZodIssue) => U): $ZodFormattedError<T, U>;\nexport type $ZodErrorTree<T, U = string> = T extends util.Primitive ? {\n errors: U[];\n} : T extends [any, ...any[]] ? {\n errors: U[];\n items?: {\n [K in keyof T]?: $ZodErrorTree<T[K], U>;\n };\n} : T extends any[] ? {\n errors: U[];\n items?: Array<$ZodErrorTree<T[number], U>>;\n} : T extends object ? {\n errors: U[];\n properties?: {\n [K in keyof T]?: $ZodErrorTree<T[K], U>;\n };\n} : {\n errors: U[];\n};\nexport declare function treeifyError<T>(error: $ZodError<T>): $ZodErrorTree<T>;\nexport declare function treeifyError<T, U>(error: $ZodError<T>, mapper?: (issue: $ZodIssue) => U): $ZodErrorTree<T, U>;\n/** Format a ZodError as a human-readable string in the following form.\n *\n * From\n *\n * ```ts\n * ZodError {\n * issues: [\n * {\n * expected: 'string',\n * code: 'invalid_type',\n * path: [ 'username' ],\n * message: 'Invalid input: expected string'\n * },\n * {\n * expected: 'number',\n * code: 'invalid_type',\n * path: [ 'favoriteNumbers', 1 ],\n * message: 'Invalid input: expected number'\n * }\n * ];\n * }\n * ```\n *\n * to\n *\n * ```\n * username\n * ✖ Expected number, received string at \"username\n * favoriteNumbers[0]\n * ✖ Invalid input: expected number\n * ```\n */\nexport declare function toDotPath(_path: readonly (string | number | symbol | StandardSchemaV1.PathSegment)[]): string;\nexport declare function prettifyError(error: StandardSchemaV1.FailureResult): string;\nexport {};\n"],"x_google_ignoreList":[0],"mappings":";;;;;;UAKiBM,aAAAA;EAAAA,SAAAA,IAAAA,CAAAA,EAAa,MAAA;EAMbE,SAAAA,KAAAA,CAAAA,EAAAA,OAAoB;EAEdL,SAAAA,IAAAA,EALJI,WAKIJ,EAAAA;EACFM,SAAAA,OAAAA,EAAAA,MAAAA;;AAHuD,UAA3DD,oBAA2D,CAAA,QAAA,OAAA,CAAA,SAAbF,aAAa,CAAA;EAK3DI,SAAAA,IAAAA,EAAAA,cAAeD;EAQfE,SAAAA,QAAAA,EAXMR,QAWW,CAAAM,MAAAA,CAAAA,CAAAA,KAQbA,CAAAA,CAAAA,MARuCH,CAAAA;EAU3CM,SAAAA,KAAAA,CAAAA,EApBIH,KAoBJG;AAMjB;AAKiBE,UA7BAJ,eA6ByB,CAAA,QAAA,OAGrBK,CAAAA,SAhCqCT,aA6BM,CAAA;EAK/CU,SAAAA,IAAAA,EAAAA,SAAqB;EAMrBE,SAAAA,MAAAA,EAAAA,QAAmB,GAAA,KAAAT,GAAAA,QAAA,GAAA,MAAA,GAAA,QAAA,GAAA,OAAA,GAAA,KAAA,GAAA,MAAA,GAAA,CAAA,MAAA,GAAA,CAAA,CAAA,CAAA;EAGfQ,SAAAA,OAAAA,EAAAA,MAAAA,GAAAA,MAAAA;EACAR,SAAAA,SAAAA,CAAAA,EAAAA,OAAAA;EAJyCH,SAAAA,KAAAA,CAAAA,EA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V,CAoCcU,CAAAA,CAAAA,EAAAA;IAAtBG,OAAAA,EAAAA,MAAAA;EAAbzC,CAAAA,GAAAA,MAAAA,GAAAA,SAAAA,GAAAA,IAAAA;;UAhCakC,+BAA+BC;QACtCP;UACEhB;;YAEIgB;SACHhB;;;;;cAKQsB,WAAWrC,aAAaqC;KAIjCG,oCAAoCE,gBAAgBX,GAAGU;KAC9DC;cACWD;6BAEIV,KAAKU;;KAKpBG,oCAAoCb,0CACzBA,KAAKe,mBAAmBf,EAAEc,IAAIJ,OAC1CV;eACae,mBAAmBf,WAAWU;IAC3CV,mBAAmB5B,sBACP4B,KAAKe,mBAAmBf,EAAEc,IAAIJ;KAElCK;WACCL;IACTtC,QAAayC,mBAAmBb,GAAGU"}
|
|
1
|
+
{"version":3,"file":"errors.d.ts","names":["$ZodCheck","$ZodStringFormats","$constructor","$ZodType","StandardSchemaV1","util","$ZodIssueBase","PropertyKey","$ZodIssueInvalidType","Input","$ZodIssueTooBig","$ZodIssueTooSmall","$ZodIssueInvalidStringFormat","$ZodIssueNotMultipleOf","$ZodIssueUnrecognizedKeys","Record","$ZodIssueInvalidUnion","$ZodIssue","$ZodIssueInvalidKey","$ZodIssueInvalidElement","$ZodIssueInvalidValue","Primitive","$ZodIssueCustom","$ZodIssueStringCommonFormats","Exclude","$ZodIssueStringInvalidRegex","$ZodIssueStringInvalidJWT","$ZodIssueStringStartsWith","$ZodIssueStringEndsWith","$ZodIssueStringIncludes","$ZodStringFormatIssues","$ZodIssueCode","$ZodInternalIssue","T","RawIssue","MakePartial","Flatten","$ZodRawIssue","$ZodErrorMap","$ZodError","Error","$ZodRealError","$ZodFlattenedError","U","_FlattenedError","flattenError","_ZodFormattedError","K","$ZodFormattedError","formatError","$ZodErrorTree","Array","treeifyError","toDotPath","PathSegment","prettifyError","FailureResult"],"sources":["../../../node_modules/.bun/zod@4.1.12/node_modules/zod/v4/core/errors.d.cts"],"sourcesContent":["import type { $ZodCheck, $ZodStringFormats } from \"./checks.cjs\";\nimport { $constructor } from \"./core.cjs\";\nimport type { $ZodType } from \"./schemas.cjs\";\nimport type { StandardSchemaV1 } from \"./standard-schema.cjs\";\nimport * as util from \"./util.cjs\";\nexport interface $ZodIssueBase {\n readonly code?: string;\n readonly input?: unknown;\n readonly path: PropertyKey[];\n readonly message: string;\n}\nexport interface $ZodIssueInvalidType<Input = unknown> extends $ZodIssueBase {\n readonly code: \"invalid_type\";\n readonly expected: $ZodType[\"_zod\"][\"def\"][\"type\"];\n readonly input?: Input;\n}\nexport interface $ZodIssueTooBig<Input = unknown> extends $ZodIssueBase {\n readonly code: \"too_big\";\n readonly origin: \"number\" | \"int\" | \"bigint\" | \"date\" | \"string\" | \"array\" | \"set\" | \"file\" | (string & {});\n readonly maximum: number | bigint;\n readonly inclusive?: boolean;\n readonly exact?: boolean;\n readonly input?: Input;\n}\nexport interface $ZodIssueTooSmall<Input = unknown> extends $ZodIssueBase {\n readonly code: \"too_small\";\n readonly origin: \"number\" | \"int\" | \"bigint\" | \"date\" | \"string\" | \"array\" | \"set\" | \"file\" | (string & {});\n readonly minimum: number | bigint;\n /** True if the allowable range includes the minimum */\n readonly inclusive?: boolean;\n /** True if the allowed value is fixed (e.g.` z.length(5)`), not a range (`z.minLength(5)`) */\n readonly exact?: boolean;\n readonly input?: Input;\n}\nexport interface $ZodIssueInvalidStringFormat extends $ZodIssueBase {\n readonly code: \"invalid_format\";\n readonly format: $ZodStringFormats | (string & {});\n readonly pattern?: string;\n readonly input?: string;\n}\nexport interface $ZodIssueNotMultipleOf<Input extends number | bigint = number | bigint> extends $ZodIssueBase {\n readonly code: \"not_multiple_of\";\n readonly divisor: number;\n readonly input?: Input;\n}\nexport interface $ZodIssueUnrecognizedKeys extends $ZodIssueBase {\n readonly code: \"unrecognized_keys\";\n readonly keys: string[];\n readonly input?: Record<string, unknown>;\n}\nexport interface $ZodIssueInvalidUnion extends $ZodIssueBase {\n readonly code: \"invalid_union\";\n readonly errors: $ZodIssue[][];\n readonly input?: unknown;\n readonly discriminator?: string | undefined;\n}\nexport interface $ZodIssueInvalidKey<Input = unknown> extends $ZodIssueBase {\n readonly code: \"invalid_key\";\n readonly origin: \"map\" | \"record\";\n readonly issues: $ZodIssue[];\n readonly input?: Input;\n}\nexport interface $ZodIssueInvalidElement<Input = unknown> extends $ZodIssueBase {\n readonly code: \"invalid_element\";\n readonly origin: \"map\" | \"set\";\n readonly key: unknown;\n readonly issues: $ZodIssue[];\n readonly input?: Input;\n}\nexport interface $ZodIssueInvalidValue<Input = unknown> extends $ZodIssueBase {\n readonly code: \"invalid_value\";\n readonly values: util.Primitive[];\n readonly input?: Input;\n}\nexport interface $ZodIssueCustom extends $ZodIssueBase {\n readonly code: \"custom\";\n readonly params?: Record<string, any> | undefined;\n readonly input?: unknown;\n}\nexport interface $ZodIssueStringCommonFormats extends $ZodIssueInvalidStringFormat {\n format: Exclude<$ZodStringFormats, \"regex\" | \"jwt\" | \"starts_with\" | \"ends_with\" | \"includes\">;\n}\nexport interface $ZodIssueStringInvalidRegex extends $ZodIssueInvalidStringFormat {\n format: \"regex\";\n pattern: string;\n}\nexport interface $ZodIssueStringInvalidJWT extends $ZodIssueInvalidStringFormat {\n format: \"jwt\";\n algorithm?: string;\n}\nexport interface $ZodIssueStringStartsWith extends $ZodIssueInvalidStringFormat {\n format: \"starts_with\";\n prefix: string;\n}\nexport interface $ZodIssueStringEndsWith extends $ZodIssueInvalidStringFormat {\n format: \"ends_with\";\n suffix: string;\n}\nexport interface $ZodIssueStringIncludes extends $ZodIssueInvalidStringFormat {\n format: \"includes\";\n includes: string;\n}\nexport type $ZodStringFormatIssues = $ZodIssueStringCommonFormats | $ZodIssueStringInvalidRegex | $ZodIssueStringInvalidJWT | $ZodIssueStringStartsWith | $ZodIssueStringEndsWith | $ZodIssueStringIncludes;\nexport type $ZodIssue = $ZodIssueInvalidType | $ZodIssueTooBig | $ZodIssueTooSmall | $ZodIssueInvalidStringFormat | $ZodIssueNotMultipleOf | $ZodIssueUnrecognizedKeys | $ZodIssueInvalidUnion | $ZodIssueInvalidKey | $ZodIssueInvalidElement | $ZodIssueInvalidValue | $ZodIssueCustom;\nexport type $ZodIssueCode = $ZodIssue[\"code\"];\nexport type $ZodInternalIssue<T extends $ZodIssueBase = $ZodIssue> = T extends any ? RawIssue<T> : never;\ntype RawIssue<T extends $ZodIssueBase> = T extends any ? util.Flatten<util.MakePartial<T, \"message\" | \"path\"> & {\n /** The input data */\n readonly input: unknown;\n /** The schema or check that originated this issue. */\n readonly inst?: $ZodType | $ZodCheck;\n /** If `true`, Zod will continue executing checks/refinements after this issue. */\n readonly continue?: boolean | undefined;\n} & Record<string, unknown>> : never;\nexport type $ZodRawIssue<T extends $ZodIssueBase = $ZodIssue> = $ZodInternalIssue<T>;\nexport interface $ZodErrorMap<T extends $ZodIssueBase = $ZodIssue> {\n (issue: $ZodRawIssue<T>): {\n message: string;\n } | string | undefined | null;\n}\nexport interface $ZodError<T = unknown> extends Error {\n type: T;\n issues: $ZodIssue[];\n _zod: {\n output: T;\n def: $ZodIssue[];\n };\n stack?: string;\n name: string;\n}\nexport declare const $ZodError: $constructor<$ZodError>;\ninterface $ZodRealError<T = any> extends $ZodError<T> {\n}\nexport declare const $ZodRealError: $constructor<$ZodRealError>;\nexport type $ZodFlattenedError<T, U = string> = _FlattenedError<T, U>;\ntype _FlattenedError<T, U = string> = {\n formErrors: U[];\n fieldErrors: {\n [P in keyof T]?: U[];\n };\n};\nexport declare function flattenError<T>(error: $ZodError<T>): _FlattenedError<T>;\nexport declare function flattenError<T, U>(error: $ZodError<T>, mapper?: (issue: $ZodIssue) => U): _FlattenedError<T, U>;\ntype _ZodFormattedError<T, U = string> = T extends [any, ...any[]] ? {\n [K in keyof T]?: $ZodFormattedError<T[K], U>;\n} : T extends any[] ? {\n [k: number]: $ZodFormattedError<T[number], U>;\n} : T extends object ? util.Flatten<{\n [K in keyof T]?: $ZodFormattedError<T[K], U>;\n}> : any;\nexport type $ZodFormattedError<T, U = string> = {\n _errors: U[];\n} & util.Flatten<_ZodFormattedError<T, U>>;\nexport declare function formatError<T>(error: $ZodError<T>): $ZodFormattedError<T>;\nexport declare function formatError<T, U>(error: $ZodError<T>, mapper?: (issue: $ZodIssue) => U): $ZodFormattedError<T, U>;\nexport type $ZodErrorTree<T, U = string> = T extends util.Primitive ? {\n errors: U[];\n} : T extends [any, ...any[]] ? {\n errors: U[];\n items?: {\n [K in keyof T]?: $ZodErrorTree<T[K], U>;\n };\n} : T extends any[] ? {\n errors: U[];\n items?: Array<$ZodErrorTree<T[number], U>>;\n} : T extends object ? {\n errors: U[];\n properties?: {\n [K in keyof T]?: $ZodErrorTree<T[K], U>;\n };\n} : {\n errors: U[];\n};\nexport declare function treeifyError<T>(error: $ZodError<T>): $ZodErrorTree<T>;\nexport declare function treeifyError<T, U>(error: $ZodError<T>, mapper?: (issue: $ZodIssue) => U): $ZodErrorTree<T, U>;\n/** Format a ZodError as a human-readable string in the following form.\n *\n * From\n *\n * ```ts\n * ZodError {\n * issues: [\n * {\n * expected: 'string',\n * code: 'invalid_type',\n * path: [ 'username' ],\n * message: 'Invalid input: expected string'\n * },\n * {\n * expected: 'number',\n * code: 'invalid_type',\n * path: [ 'favoriteNumbers', 1 ],\n * message: 'Invalid input: expected number'\n * }\n * ];\n * }\n * ```\n *\n * to\n *\n * ```\n * username\n * ✖ Expected number, received string at \"username\n * favoriteNumbers[0]\n * ✖ Invalid input: expected number\n * ```\n */\nexport declare function toDotPath(_path: readonly (string | number | symbol | StandardSchemaV1.PathSegment)[]): string;\nexport declare function prettifyError(error: StandardSchemaV1.FailureResult): string;\nexport {};\n"],"x_google_ignoreList":[0],"mappings":";;;;;;UAKiBM,aAAAA;EAAAA,SAAAA,IAAAA,CAAAA,EAAa,MAAA;EAMbE,SAAAA,KAAAA,CAAAA,EAAAA,OAAoB;EAEdL,SAAAA,IAAAA,EALJI,WAKIJ,EAAAA;EACFM,SAAAA,OAAAA,EAAAA,MAAAA;;AAHuD,UAA3DD,oBAA2D,C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zBA,SAAAA,GAAAA,GA1CyC5B,OA0CzC4B,CA1CsD5B,WA0CtD4B,CA1CuEA,CA0CvEA,EAAAA,SAAAA,GAAAA,MAAAA,CAAAA,GAAAA;EAAwBA;EAAEc,SAAAA,KAAAA,EAAAA,OAAAA;EAAIJ;EAAzBK,SAAAA,IAAAA,CAAAA,EAtCD7C,QAsCC6C,GAtCUhD,SAsCVgD;EADE3C;EAAY,SAAA,QAAA,CAAA,EAAA,OAAA,GAAA,SAAA;AAGnC,CAAA,GArCIU,MAqCQiC,CAAAA,MAAAA,EAAAA,OAAkB,CAAA,CAAA,GAAA,KAAAL;AACjBA,KArCDN,YAqCCM,CAAAA,UArCsBrC,aAqCtBqC,GArCsC1B,SAqCtC0B,CAAAA,GArCmDX,iBAqCnDW,CArCqEV,CAqCrEU,CAAAA;AACuBV,UArCnBK,YAqCmBL,CAAAA,UArCI3B,aAqCJ2B,GArCoBhB,SAqCpBgB,CAAAA,CAAAA;EAAGU,CAAAA,KAAAA,EApC3BN,YAoC2BM,CApCdV,CAoCcU,CAAAA,CAAAA,EAAAA;IAAtBG,OAAAA,EAAAA,MAAAA;EAAbzC,CAAAA,GAAAA,MAAAA,GAAAA,SAAAA,GAAAA,IAAAA;;UAhCakC,+BAA+BC;QACtCP;UACEhB;;YAEIgB;SACHhB;;;;;cAKQsB,WAAWrC,aAAaqC;KAIjCG,oCAAoCE,gBAAgBX,GAAGU;KAC9DC;cACWD;6BAEIV,KAAKU;;KAKpBG,oCAAoCb,0CACzBA,KAAKe,mBAAmBf,EAAEc,IAAIJ,OAC1CV;eACae,mBAAmBf,WAAWU;IAC3CV,mBAAmB5B,sBACP4B,KAAKe,mBAAmBf,EAAEc,IAAIJ;KAElCK;WACCL;IACTtC,QAAayC,mBAAmBb,GAAGU"}
|
package/index.d.ts
CHANGED
|
@@ -6,10 +6,10 @@ import { CossistantClient } from "./client.js";
|
|
|
6
6
|
import { normalizeLocale } from "./locale-utils.js";
|
|
7
7
|
import { CossistantRestClient } from "./rest-client.js";
|
|
8
8
|
import { ConversationSeenState, SeenActorType, SeenEntry, SeenState, SeenStore, applyConversationSeenEvent, createSeenStore, hydrateConversationSeen, upsertConversationSeen } from "./store/seen-store.js";
|
|
9
|
-
import { NavigationState, SUPPORT_PAGES, SupportConfig, SupportNavigation, SupportStore, SupportStoreActions, SupportStoreOptions, SupportStoreState, SupportStoreStorage, createSupportStore } from "./store/support-store.js";
|
|
9
|
+
import { DefaultRoutes, NavigationState, RouteRegistry, SUPPORT_PAGES, SupportConfig, SupportNavigation, SupportPage, SupportStore, SupportStoreActions, SupportStoreOptions, SupportStoreState, SupportStoreStorage, createSupportStore } from "./store/support-store.js";
|
|
10
10
|
import { ConversationTypingState, TypingActorType, TypingEntry, TypingState, TypingStore, TypingStoreDependencies, applyConversationTypingEvent, clearTypingFromTimelineItem, clearTypingState, createTypingStore, getConversationTyping, setTypingState } from "./store/typing-store.js";
|
|
11
11
|
import { generateConversationId, generateMessageId } from "./utils.js";
|
|
12
12
|
import { VisitorData, collectVisitorData } from "./visitor-data.js";
|
|
13
13
|
import { clearAllVisitorIds, clearVisitorId, getVisitorId, setVisitorId } from "./visitor-tracker.js";
|
|
14
14
|
import { CossistantConfig, CossistantError } from "@cossistant/types";
|
|
15
|
-
export { type ConversationPagination, type ConversationSeenState, type ConversationTimelineItemsState, type ConversationTypingState, type ConversationsState, type ConversationsStore, CossistantAPIError, CossistantClient, type CossistantConfig, type CossistantError, CossistantRestClient, type NavigationState, type SUPPORT_PAGES, type SeenActorType, type SeenEntry, type SeenState, type SeenStore, type SupportConfig, type SupportNavigation, type SupportStore, type SupportStoreActions, type SupportStoreOptions, type SupportStoreState, type SupportStoreStorage, type TimelineItemsState, type TimelineItemsStore, type TypingActorType, type TypingEntry, type TypingState, type TypingStore, type TypingStoreDependencies, type VisitorData, type WebsiteError, type WebsiteState, type WebsiteStatus, type WebsiteStore, applyConversationSeenEvent, applyConversationTypingEvent, clearAllVisitorIds, clearTypingFromTimelineItem, clearTypingState, clearVisitorId, collectVisitorData, createConversationsStore, createSeenStore, createSupportStore, createTimelineItemsStore, createTypingStore, createWebsiteStore, CossistantClient as default, generateConversationId, generateMessageId, getConversationById, getConversationPagination, getConversationTimelineItems, getConversationTyping, getConversations, getVisitorId, getWebsiteState, hydrateConversationSeen, normalizeLocale, setTypingState, setVisitorId, upsertConversationSeen };
|
|
15
|
+
export { type ConversationPagination, type ConversationSeenState, type ConversationTimelineItemsState, type ConversationTypingState, type ConversationsState, type ConversationsStore, CossistantAPIError, CossistantClient, type CossistantConfig, type CossistantError, CossistantRestClient, type DefaultRoutes, type NavigationState, type RouteRegistry, type SUPPORT_PAGES, type SeenActorType, type SeenEntry, type SeenState, type SeenStore, type SupportConfig, type SupportNavigation, type SupportPage, type SupportStore, type SupportStoreActions, type SupportStoreOptions, type SupportStoreState, type SupportStoreStorage, type TimelineItemsState, type TimelineItemsStore, type TypingActorType, type TypingEntry, type TypingState, type TypingStore, type TypingStoreDependencies, type VisitorData, type WebsiteError, type WebsiteState, type WebsiteStatus, type WebsiteStore, applyConversationSeenEvent, applyConversationTypingEvent, clearAllVisitorIds, clearTypingFromTimelineItem, clearTypingState, clearVisitorId, collectVisitorData, createConversationsStore, createSeenStore, createSupportStore, createTimelineItemsStore, createTypingStore, createWebsiteStore, CossistantClient as default, generateConversationId, generateMessageId, getConversationById, getConversationPagination, getConversationTimelineItems, getConversationTyping, getConversations, getVisitorId, getWebsiteState, hydrateConversationSeen, normalizeLocale, setTypingState, setVisitorId, upsertConversationSeen };
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-store.d.ts","names":[],"sources":["../../src/store/create-store.ts"],"sourcesContent":[],"mappings":";KAAY,gCAAgC;AAAhC,KAEA,gBAAA,GAFa,GAAA,
|
|
1
|
+
{"version":3,"file":"create-store.d.ts","names":[],"sources":["../../src/store/create-store.ts"],"sourcesContent":[],"mappings":";KAAY,gCAAgC;AAAhC,KAEA,gBAAA,GAFa,GAAA,GAAA,IAAmB;AAEhC,KAEA,YAFgB,CAAA,MAAA,CAAA,GAAA,CAAA,KAAA,EAEe,MAFf,EAAA,GAE0B,MAF1B;AAEhB,KAEA,KAFA,CAAA,MAAY,CAAA,GAAA;EAEZ,QAAK,EAAA,EACJ,MADI;EACJ,QAAA,CAAA,OAAA,EACM,YADN,CACmB,MADnB,CAAA,CAAA,EAAA,IAAA;EACmB,SAAA,CAAA,QAAA,EACX,aADW,CACG,MADH,CAAA,CAAA,EACa,gBADb;EAAb,KAAA,CAAA,EAAA,EAAA,GAAA,GAAA,IAAA,CAAA,EAAA,IAAA;CACgB;AAAd,iBAIL,WAJK,CAAA,MAAA,CAAA,CAAA,YAAA,EAI6B,MAJ7B,CAAA,EAIsC,KAJtC,CAI4C,MAJ5C,CAAA"}
|
package/store/support-store.d.ts
CHANGED
|
@@ -1,26 +1,42 @@
|
|
|
1
1
|
import { Store } from "./create-store.js";
|
|
2
2
|
|
|
3
3
|
//#region src/store/support-store.d.ts
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
params: {
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Built-in routes with their parameter types.
|
|
7
|
+
*/
|
|
8
|
+
type DefaultRoutes = {
|
|
9
|
+
HOME: undefined;
|
|
10
|
+
ARTICLES: undefined;
|
|
11
|
+
CONVERSATION: {
|
|
13
12
|
conversationId: string;
|
|
14
13
|
initialMessage?: string;
|
|
15
14
|
};
|
|
16
|
-
|
|
17
|
-
page: "CONVERSATION_HISTORY";
|
|
18
|
-
params?: undefined;
|
|
15
|
+
CONVERSATION_HISTORY: undefined;
|
|
19
16
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Extensible route registry via module augmentation.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* declare module '@cossistant/core' {
|
|
22
|
+
* interface RouteRegistry {
|
|
23
|
+
* SETTINGS: { tab: string };
|
|
24
|
+
* }
|
|
25
|
+
* }
|
|
26
|
+
*/
|
|
27
|
+
interface RouteRegistry extends DefaultRoutes {}
|
|
28
|
+
type NavigationState<Routes extends Record<string, unknown> = RouteRegistry> = { [K in keyof Routes]: Routes[K] extends undefined ? {
|
|
29
|
+
page: K;
|
|
30
|
+
params?: undefined;
|
|
31
|
+
} : {
|
|
32
|
+
page: K;
|
|
33
|
+
params: Routes[K];
|
|
34
|
+
} }[keyof Routes];
|
|
35
|
+
type SupportPage<Routes extends Record<string, unknown> = RouteRegistry> = keyof Routes & string;
|
|
36
|
+
type SUPPORT_PAGES = SupportPage;
|
|
37
|
+
type SupportNavigation<Routes extends Record<string, unknown> = RouteRegistry> = {
|
|
38
|
+
previousPages: NavigationState<Routes>[];
|
|
39
|
+
current: NavigationState<Routes>;
|
|
24
40
|
};
|
|
25
41
|
type SupportConfig = {
|
|
26
42
|
size: "normal" | "larger";
|
|
@@ -33,13 +49,13 @@ type SupportConfig = {
|
|
|
33
49
|
};
|
|
34
50
|
};
|
|
35
51
|
};
|
|
36
|
-
type SupportStoreState = {
|
|
37
|
-
navigation: SupportNavigation
|
|
52
|
+
type SupportStoreState<Routes extends Record<string, unknown> = RouteRegistry> = {
|
|
53
|
+
navigation: SupportNavigation<Routes>;
|
|
38
54
|
config: SupportConfig;
|
|
39
55
|
};
|
|
40
|
-
type SupportStoreActions = {
|
|
41
|
-
navigate(state: NavigationState): void;
|
|
42
|
-
replace(state: NavigationState): void;
|
|
56
|
+
type SupportStoreActions<Routes extends Record<string, unknown> = RouteRegistry> = {
|
|
57
|
+
navigate(state: NavigationState<Routes>): void;
|
|
58
|
+
replace(state: NavigationState<Routes>): void;
|
|
43
59
|
goBack(): void;
|
|
44
60
|
open(): void;
|
|
45
61
|
close(): void;
|
|
@@ -56,8 +72,8 @@ type SupportStoreOptions = {
|
|
|
56
72
|
storage?: SupportStoreStorage;
|
|
57
73
|
storageKey?: string;
|
|
58
74
|
};
|
|
59
|
-
type SupportStore = Store<SupportStoreState
|
|
60
|
-
declare function createSupportStore(options?: SupportStoreOptions): SupportStore
|
|
75
|
+
type SupportStore<Routes extends Record<string, unknown> = RouteRegistry> = Store<SupportStoreState<Routes>> & SupportStoreActions<Routes>;
|
|
76
|
+
declare function createSupportStore<Routes extends Record<string, unknown> = RouteRegistry>(options?: SupportStoreOptions): SupportStore<Routes>;
|
|
61
77
|
//#endregion
|
|
62
|
-
export { NavigationState, SUPPORT_PAGES, SupportConfig, SupportNavigation, SupportStore, SupportStoreActions, SupportStoreOptions, SupportStoreState, SupportStoreStorage, createSupportStore };
|
|
78
|
+
export { DefaultRoutes, NavigationState, RouteRegistry, SUPPORT_PAGES, SupportConfig, SupportNavigation, SupportPage, SupportStore, SupportStoreActions, SupportStoreOptions, SupportStoreState, SupportStoreStorage, createSupportStore };
|
|
63
79
|
//# sourceMappingURL=support-store.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"support-store.d.ts","names":[],"sources":["../../src/store/support-store.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"support-store.d.ts","names":[],"sources":["../../src/store/support-store.ts"],"sourcesContent":[],"mappings":";;;;;;AAKA;AAiBiB,KAjBL,aAAA,GAiBmB;EAGnB,IAAA,EAAA,SAAA;EACI,QAAA,EAAA,SAAA;EAA0B,YAAA,EAAA;IAE7B,cAAA,EAAA,MAAA;IAAS,cAAA,CAAA,EAAA,MAAA;EAAO,CAAA;EACjB,oBAAA,EAAA,SAAA;CACA;;;;;AAIZ;;;;;AAKA;AAGY,UApBK,aAAA,SAAsB,aAoBV,CAAA;AACa,KAlB9B,eAkB8B,CAAA,eAjB1B,MAiB0B,CAAA,MAAA,EAAA,OAAA,CAAA,GAjBA,aAiBA,CAAA,GAAA,QAEV,MAjBnB,MAiBmB,GAjBV,MAiBU,CAjBH,CAiBG,CAAA,SAAA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AA,KAAA,EAtB3C,eAsB2C,CAtB3B,MAsB2B,CAAA,CAAA,EAAA,IAAA;EAApB,MAAA,EAAA,EAAA,IAAA;EAAmB,IAAA,EAAA,EAAA,IAAA;EAmI1C,KAAA,EAAA,EAAA,IAAA;EACA,MAAA,EAAA,EAAA,IAAA;EAA0B,YAAA,CAAA,MAAA,EArJpB,OAqJoB,CArJZ,aAqJY,CAAA,CAAA,EAAA,IAAA;EAC/B,KAAA,EAAA,EAAA,IAAA;CAAwC;AAAb,KAlJ1B,mBAAA,GAkJ0B;EAAY,OAAA,CAAA,GAAA,EAAA,MAAA,CAAA,EAAA,MAAA,GAAA,IAAA;;;;KA5ItC,mBAAA;YACD;;;KAIC,4BACI,0BAA0B,iBACtC,MAAM,kBAAkB,WAAW,oBAAoB;iBAmI3C,kCACA,0BAA0B,yBAC/B,sBAA2B,aAAa"}
|
package/store/support-store.js
CHANGED
|
@@ -22,16 +22,11 @@ function createDefaultState() {
|
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
function cloneNavigationState(state) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
default: return {
|
|
31
|
-
page: state.page,
|
|
32
|
-
params: state.params
|
|
33
|
-
};
|
|
34
|
-
}
|
|
25
|
+
if ("params" in state && state.params !== void 0) return {
|
|
26
|
+
...state,
|
|
27
|
+
params: { ...state.params }
|
|
28
|
+
};
|
|
29
|
+
return { ...state };
|
|
35
30
|
}
|
|
36
31
|
function parsePersistedState(persisted, fallback) {
|
|
37
32
|
if (!persisted) return fallback;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"support-store.js","names":["data: PersistedState"],"sources":["../../src/store/support-store.ts"],"sourcesContent":["import { createStore, type Store } from \"./create-store\";\n\nexport type NavigationState =\n\t| { page: \"HOME\"; params?: undefined }\n\t| { page: \"ARTICLES\"; params?: undefined }\n\t| {\n\t\t\tpage: \"CONVERSATION\";\n\t\t\tparams: { conversationId: string; initialMessage?: string };\n\t }\n\t| { page: \"CONVERSATION_HISTORY\"; params?: undefined };\n\nexport type SUPPORT_PAGES = NavigationState[\"page\"];\n\nexport type SupportNavigation = {\n\tpreviousPages: NavigationState[];\n\tcurrent: NavigationState;\n};\n\nexport type SupportConfig = {\n\tsize: \"normal\" | \"larger\";\n\tisOpen: boolean;\n\tcontent: {\n\t\thome?: {\n\t\t\theader?: string;\n\t\t\tsubheader?: string;\n\t\t\tctaLabel?: string;\n\t\t};\n\t};\n};\n\nexport type SupportStoreState = {\n\tnavigation: SupportNavigation;\n\tconfig: SupportConfig;\n};\n\nexport type SupportStoreActions = {\n\tnavigate(state: NavigationState): void;\n\treplace(state: NavigationState): void;\n\tgoBack(): void;\n\topen(): void;\n\tclose(): void;\n\ttoggle(): void;\n\tupdateConfig(config: Partial<SupportConfig>): void;\n\treset(): void;\n};\n\nexport type SupportStoreStorage = {\n\tgetItem(key: string): string | null;\n\tsetItem(key: string, value: string): void;\n\tremoveItem(key: string): void;\n};\n\nexport type SupportStoreOptions = {\n\tstorage?: SupportStoreStorage;\n\tstorageKey?: string;\n};\n\nexport type SupportStore = Store<SupportStoreState> & SupportStoreActions;\n\nconst STORAGE_KEY = \"cossistant-support-store\";\n\ntype PersistedConfig = Pick<SupportConfig, \"size\" | \"isOpen\">;\n\ntype PersistedState = {\n\tnavigation?: SupportNavigation;\n\tconfig?: PersistedConfig;\n};\n\nfunction createDefaultNavigation(): SupportNavigation {\n\treturn {\n\t\tcurrent: { page: \"HOME\" },\n\t\tpreviousPages: [],\n\t};\n}\n\nfunction createDefaultConfig(): SupportConfig {\n\treturn {\n\t\tsize: \"normal\",\n\t\tcontent: {},\n\t\tisOpen: false,\n\t};\n}\n\nfunction createDefaultState(): SupportStoreState {\n\treturn {\n\t\tnavigation: createDefaultNavigation(),\n\t\tconfig: createDefaultConfig(),\n\t};\n}\n\nfunction cloneNavigationState(state: NavigationState): NavigationState {\n\tswitch (state.page) {\n\t\tcase \"CONVERSATION\":\n\t\t\treturn {\n\t\t\t\tpage: \"CONVERSATION\",\n\t\t\t\tparams: { ...state.params },\n\t\t\t};\n\t\tdefault:\n\t\t\treturn { page: state.page, params: state.params } as NavigationState;\n\t}\n}\n\nfunction parsePersistedState(\n\tpersisted: PersistedState | null | undefined,\n\tfallback: SupportStoreState\n): SupportStoreState {\n\tif (!persisted) {\n\t\treturn fallback;\n\t}\n\n\tconst persistedNavigation = persisted.navigation;\n\tconst navigation: SupportNavigation = {\n\t\tcurrent: persistedNavigation?.current\n\t\t\t? cloneNavigationState(persistedNavigation.current)\n\t\t\t: cloneNavigationState(fallback.navigation.current),\n\t\tpreviousPages: (\n\t\t\tpersistedNavigation?.previousPages ?? fallback.navigation.previousPages\n\t\t).map((page) => cloneNavigationState(page)),\n\t};\n\n\tconst config: SupportConfig = {\n\t\t...fallback.config,\n\t\t...persisted.config,\n\t};\n\n\treturn {\n\t\tnavigation,\n\t\tconfig,\n\t};\n}\n\nfunction getInitialState(options: SupportStoreOptions): SupportStoreState {\n\tconst fallback = createDefaultState();\n\tconst storage = options.storage;\n\tif (!storage) {\n\t\treturn fallback;\n\t}\n\n\ttry {\n\t\tconst raw = storage.getItem(options.storageKey ?? STORAGE_KEY);\n\t\tif (!raw) {\n\t\t\treturn fallback;\n\t\t}\n\n\t\tconst parsed = JSON.parse(raw) as PersistedState;\n\t\treturn parsePersistedState(parsed, fallback);\n\t} catch (error) {\n\t\tconsole.warn(\"[SupportStore] Failed to read persisted state\", error);\n\t\treturn fallback;\n\t}\n}\n\nfunction persistState(\n\tstate: SupportStoreState,\n\toptions: SupportStoreOptions\n): void {\n\tconst storage = options.storage;\n\tif (!storage) {\n\t\treturn;\n\t}\n\n\tconst data: PersistedState = {\n\t\tnavigation: {\n\t\t\tcurrent: state.navigation.current,\n\t\t\tpreviousPages: [...state.navigation.previousPages],\n\t\t},\n\t\tconfig: {\n\t\t\tsize: state.config.size,\n\t\t\tisOpen: state.config.isOpen,\n\t\t},\n\t};\n\n\ttry {\n\t\tstorage.setItem(options.storageKey ?? STORAGE_KEY, JSON.stringify(data));\n\t} catch (error) {\n\t\tconsole.warn(\"[SupportStore] Failed to persist state\", error);\n\t}\n}\n\nexport function createSupportStore(\n\toptions: SupportStoreOptions = {}\n): SupportStore {\n\tconst initialState = getInitialState(options);\n\tconst store = createStore<SupportStoreState>(initialState);\n\n\tconst commit = (updater: (state: SupportStoreState) => SupportStoreState) => {\n\t\tconst previous = store.getState();\n\t\tstore.setState(updater);\n\t\tconst next = store.getState();\n\t\tif (next !== previous) {\n\t\t\tpersistState(next, options);\n\t\t}\n\t};\n\n\treturn {\n\t\t...store,\n\t\tnavigate(state) {\n\t\t\tcommit((current) => ({\n\t\t\t\tnavigation: {\n\t\t\t\t\tpreviousPages: [\n\t\t\t\t\t\t...current.navigation.previousPages,\n\t\t\t\t\t\tcurrent.navigation.current,\n\t\t\t\t\t],\n\t\t\t\t\tcurrent: state,\n\t\t\t\t},\n\t\t\t\tconfig: current.config,\n\t\t\t}));\n\t\t},\n\t\treplace(state) {\n\t\t\tcommit((current) => ({\n\t\t\t\tnavigation: {\n\t\t\t\t\t...current.navigation,\n\t\t\t\t\tcurrent: state,\n\t\t\t\t},\n\t\t\t\tconfig: current.config,\n\t\t\t}));\n\t\t},\n\t\tgoBack() {\n\t\t\tcommit((current) => {\n\t\t\t\tconst { previousPages } = current.navigation;\n\t\t\t\tif (previousPages.length === 0) {\n\t\t\t\t\treturn current;\n\t\t\t\t}\n\n\t\t\t\tconst nextPrevious = previousPages.slice(0, -1);\n\t\t\t\tconst previous = previousPages.at(-1);\n\n\t\t\t\tif (!previous) {\n\t\t\t\t\treturn current;\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\tnavigation: {\n\t\t\t\t\t\tpreviousPages: nextPrevious,\n\t\t\t\t\t\tcurrent: previous,\n\t\t\t\t\t},\n\t\t\t\t\tconfig: current.config,\n\t\t\t\t};\n\t\t\t});\n\t\t},\n\t\topen() {\n\t\t\tcommit((current) => ({\n\t\t\t\tnavigation: current.navigation,\n\t\t\t\tconfig: { ...current.config, isOpen: true },\n\t\t\t}));\n\t\t},\n\t\tclose() {\n\t\t\tcommit((current) => ({\n\t\t\t\tnavigation: current.navigation,\n\t\t\t\tconfig: { ...current.config, isOpen: false },\n\t\t\t}));\n\t\t},\n\t\ttoggle() {\n\t\t\tcommit((current) => ({\n\t\t\t\tnavigation: current.navigation,\n\t\t\t\tconfig: { ...current.config, isOpen: !current.config.isOpen },\n\t\t\t}));\n\t\t},\n\t\tupdateConfig(config) {\n\t\t\tcommit((current) => ({\n\t\t\t\tnavigation: current.navigation,\n\t\t\t\tconfig: { ...current.config, ...config },\n\t\t\t}));\n\t\t},\n\t\treset() {\n\t\t\tcommit(() => createDefaultState());\n\t\t},\n\t};\n}\n"],"mappings":";;;AA2DA,MAAM,cAAc;AASpB,SAAS,0BAA6C;AACrD,QAAO;EACN,SAAS,EAAE,MAAM,QAAQ;EACzB,eAAe,EAAE;EACjB;;AAGF,SAAS,sBAAqC;AAC7C,QAAO;EACN,MAAM;EACN,SAAS,EAAE;EACX,QAAQ;EACR;;AAGF,SAAS,qBAAwC;AAChD,QAAO;EACN,YAAY,yBAAyB;EACrC,QAAQ,qBAAqB;EAC7B;;AAGF,SAAS,qBAAqB,OAAyC;AACtE,SAAQ,MAAM,MAAd;EACC,KAAK,eACJ,QAAO;GACN,MAAM;GACN,QAAQ,EAAE,GAAG,MAAM,QAAQ;GAC3B;EACF,QACC,QAAO;GAAE,MAAM,MAAM;GAAM,QAAQ,MAAM;GAAQ;;;AAIpD,SAAS,oBACR,WACA,UACoB;AACpB,KAAI,CAAC,UACJ,QAAO;CAGR,MAAM,sBAAsB,UAAU;AAetC,QAAO;EACN,YAfqC;GACrC,SAAS,qBAAqB,UAC3B,qBAAqB,oBAAoB,QAAQ,GACjD,qBAAqB,SAAS,WAAW,QAAQ;GACpD,gBACC,qBAAqB,iBAAiB,SAAS,WAAW,eACzD,KAAK,SAAS,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IACpB,YAAY;KACX,GAAG,QAAQ;KACX,SAAS;KACT;IACD,QAAQ,QAAQ;IAChB,EAAE;;EAEJ,SAAS;AACR,WAAQ,YAAY;IACnB,MAAM,EAAE,kBAAkB,QAAQ;AAClC,QAAI,cAAc,WAAW,EAC5B,QAAO;IAGR,MAAM,eAAe,cAAc,MAAM,GAAG,GAAG;IAC/C,MAAM,WAAW,cAAc,GAAG,GAAG;AAErC,QAAI,CAAC,SACJ,QAAO;AAGR,WAAO;KACN,YAAY;MACX,eAAe;MACf,SAAS;MACT;KACD,QAAQ,QAAQ;KAChB;KACA;;EAEH,OAAO;AACN,WAAQ,aAAa;IACpB,YAAY,QAAQ;IACpB,QAAQ;KAAE,GAAG,QAAQ;KAAQ,QAAQ;KAAM;IAC3C,EAAE;;EAEJ,QAAQ;AACP,WAAQ,aAAa;IACpB,YAAY,QAAQ;IACpB,QAAQ;KAAE,GAAG,QAAQ;KAAQ,QAAQ;KAAO;IAC5C,EAAE;;EAEJ,SAAS;AACR,WAAQ,aAAa;IACpB,YAAY,QAAQ;IACpB,QAAQ;KAAE,GAAG,QAAQ;KAAQ,QAAQ,CAAC,QAAQ,OAAO;KAAQ;IAC7D,EAAE;;EAEJ,aAAa,QAAQ;AACpB,WAAQ,aAAa;IACpB,YAAY,QAAQ;IACpB,QAAQ;KAAE,GAAG,QAAQ;KAAQ,GAAG;KAAQ;IACxC,EAAE;;EAEJ,QAAQ;AACP,gBAAa,oBAAoB,CAAC;;EAEnC"}
|
|
1
|
+
{"version":3,"file":"support-store.js","names":["data: PersistedState<Routes>"],"sources":["../../src/store/support-store.ts"],"sourcesContent":["import { createStore, type Store } from \"./create-store\";\n\n/**\n * Built-in routes with their parameter types.\n */\nexport type DefaultRoutes = {\n\tHOME: undefined;\n\tARTICLES: undefined;\n\tCONVERSATION: { conversationId: string; initialMessage?: string };\n\tCONVERSATION_HISTORY: undefined;\n};\n\n/**\n * Extensible route registry via module augmentation.\n *\n * @example\n * declare module '@cossistant/core' {\n * interface RouteRegistry {\n * SETTINGS: { tab: string };\n * }\n * }\n */\nexport interface RouteRegistry extends DefaultRoutes {}\n\n// Build discriminated union from route registry\nexport type NavigationState<\n\tRoutes extends Record<string, unknown> = RouteRegistry,\n> = {\n\t[K in keyof Routes]: Routes[K] extends undefined\n\t\t? { page: K; params?: undefined }\n\t\t: { page: K; params: Routes[K] };\n}[keyof Routes];\n\n// Extract page names as string union\nexport type SupportPage<\n\tRoutes extends Record<string, unknown> = RouteRegistry,\n> = keyof Routes & string;\n\n// Keep backward compatibility\nexport type SUPPORT_PAGES = SupportPage;\n\n// Typed navigation\nexport type SupportNavigation<\n\tRoutes extends Record<string, unknown> = RouteRegistry,\n> = {\n\tpreviousPages: NavigationState<Routes>[];\n\tcurrent: NavigationState<Routes>;\n};\n\nexport type SupportConfig = {\n\tsize: \"normal\" | \"larger\";\n\tisOpen: boolean;\n\tcontent: {\n\t\thome?: {\n\t\t\theader?: string;\n\t\t\tsubheader?: string;\n\t\t\tctaLabel?: string;\n\t\t};\n\t};\n};\n\nexport type SupportStoreState<\n\tRoutes extends Record<string, unknown> = RouteRegistry,\n> = {\n\tnavigation: SupportNavigation<Routes>;\n\tconfig: SupportConfig;\n};\n\nexport type SupportStoreActions<\n\tRoutes extends Record<string, unknown> = RouteRegistry,\n> = {\n\tnavigate(state: NavigationState<Routes>): void;\n\treplace(state: NavigationState<Routes>): void;\n\tgoBack(): void;\n\topen(): void;\n\tclose(): void;\n\ttoggle(): void;\n\tupdateConfig(config: Partial<SupportConfig>): void;\n\treset(): void;\n};\n\nexport type SupportStoreStorage = {\n\tgetItem(key: string): string | null;\n\tsetItem(key: string, value: string): void;\n\tremoveItem(key: string): void;\n};\n\nexport type SupportStoreOptions = {\n\tstorage?: SupportStoreStorage;\n\tstorageKey?: string;\n};\n\nexport type SupportStore<\n\tRoutes extends Record<string, unknown> = RouteRegistry,\n> = Store<SupportStoreState<Routes>> & SupportStoreActions<Routes>;\n\nconst STORAGE_KEY = \"cossistant-support-store\";\n\ntype PersistedConfig = Pick<SupportConfig, \"size\" | \"isOpen\">;\n\ntype PersistedState<Routes extends Record<string, unknown> = RouteRegistry> = {\n\tnavigation?: SupportNavigation<Routes>;\n\tconfig?: PersistedConfig;\n};\n\nfunction createDefaultNavigation<\n\tRoutes extends Record<string, unknown> = RouteRegistry,\n>(): SupportNavigation<Routes> {\n\treturn {\n\t\tcurrent: { page: \"HOME\" } as NavigationState<Routes>,\n\t\tpreviousPages: [],\n\t};\n}\n\nfunction createDefaultConfig(): SupportConfig {\n\treturn {\n\t\tsize: \"normal\",\n\t\tcontent: {},\n\t\tisOpen: false,\n\t};\n}\n\nfunction createDefaultState<\n\tRoutes extends Record<string, unknown> = RouteRegistry,\n>(): SupportStoreState<Routes> {\n\treturn {\n\t\tnavigation: createDefaultNavigation<Routes>(),\n\t\tconfig: createDefaultConfig(),\n\t};\n}\n\nfunction cloneNavigationState<\n\tRoutes extends Record<string, unknown> = RouteRegistry,\n>(state: NavigationState<Routes>): NavigationState<Routes> {\n\t// Type-safe cloning with params if they exist\n\tif (\"params\" in state && state.params !== undefined) {\n\t\treturn {\n\t\t\t...state,\n\t\t\tparams: { ...state.params },\n\t\t} as NavigationState<Routes>;\n\t}\n\treturn { ...state } as NavigationState<Routes>;\n}\n\nfunction parsePersistedState<\n\tRoutes extends Record<string, unknown> = RouteRegistry,\n>(\n\tpersisted: PersistedState<Routes> | null | undefined,\n\tfallback: SupportStoreState<Routes>\n): SupportStoreState<Routes> {\n\tif (!persisted) {\n\t\treturn fallback;\n\t}\n\n\tconst persistedNavigation = persisted.navigation;\n\tconst navigation: SupportNavigation<Routes> = {\n\t\tcurrent: persistedNavigation?.current\n\t\t\t? cloneNavigationState<Routes>(persistedNavigation.current)\n\t\t\t: cloneNavigationState<Routes>(fallback.navigation.current),\n\t\tpreviousPages: (\n\t\t\tpersistedNavigation?.previousPages ?? fallback.navigation.previousPages\n\t\t).map((page) => cloneNavigationState<Routes>(page)),\n\t};\n\n\tconst config: SupportConfig = {\n\t\t...fallback.config,\n\t\t...persisted.config,\n\t};\n\n\treturn {\n\t\tnavigation,\n\t\tconfig,\n\t};\n}\n\nfunction getInitialState<\n\tRoutes extends Record<string, unknown> = RouteRegistry,\n>(options: SupportStoreOptions): SupportStoreState<Routes> {\n\tconst fallback = createDefaultState<Routes>();\n\tconst storage = options.storage;\n\tif (!storage) {\n\t\treturn fallback;\n\t}\n\n\ttry {\n\t\tconst raw = storage.getItem(options.storageKey ?? STORAGE_KEY);\n\t\tif (!raw) {\n\t\t\treturn fallback;\n\t\t}\n\n\t\tconst parsed = JSON.parse(raw) as PersistedState<Routes>;\n\t\treturn parsePersistedState<Routes>(parsed, fallback);\n\t} catch (error) {\n\t\tconsole.warn(\"[SupportStore] Failed to read persisted state\", error);\n\t\treturn fallback;\n\t}\n}\n\nfunction persistState<Routes extends Record<string, unknown> = RouteRegistry>(\n\tstate: SupportStoreState<Routes>,\n\toptions: SupportStoreOptions\n): void {\n\tconst storage = options.storage;\n\tif (!storage) {\n\t\treturn;\n\t}\n\n\tconst data: PersistedState<Routes> = {\n\t\tnavigation: {\n\t\t\tcurrent: state.navigation.current,\n\t\t\tpreviousPages: [...state.navigation.previousPages],\n\t\t},\n\t\tconfig: {\n\t\t\tsize: state.config.size,\n\t\t\tisOpen: state.config.isOpen,\n\t\t},\n\t};\n\n\ttry {\n\t\tstorage.setItem(options.storageKey ?? STORAGE_KEY, JSON.stringify(data));\n\t} catch (error) {\n\t\tconsole.warn(\"[SupportStore] Failed to persist state\", error);\n\t}\n}\n\nexport function createSupportStore<\n\tRoutes extends Record<string, unknown> = RouteRegistry,\n>(options: SupportStoreOptions = {}): SupportStore<Routes> {\n\tconst initialState = getInitialState<Routes>(options);\n\tconst store = createStore<SupportStoreState<Routes>>(initialState);\n\n\tconst commit = (\n\t\tupdater: (state: SupportStoreState<Routes>) => SupportStoreState<Routes>\n\t) => {\n\t\tconst previous = store.getState();\n\t\tstore.setState(updater);\n\t\tconst next = store.getState();\n\t\tif (next !== previous) {\n\t\t\tpersistState(next, options);\n\t\t}\n\t};\n\n\treturn {\n\t\t...store,\n\t\tnavigate(state) {\n\t\t\tcommit((current) => ({\n\t\t\t\tnavigation: {\n\t\t\t\t\tpreviousPages: [\n\t\t\t\t\t\t...current.navigation.previousPages,\n\t\t\t\t\t\tcurrent.navigation.current,\n\t\t\t\t\t],\n\t\t\t\t\tcurrent: state,\n\t\t\t\t},\n\t\t\t\tconfig: current.config,\n\t\t\t}));\n\t\t},\n\t\treplace(state) {\n\t\t\tcommit((current) => ({\n\t\t\t\tnavigation: {\n\t\t\t\t\t...current.navigation,\n\t\t\t\t\tcurrent: state,\n\t\t\t\t},\n\t\t\t\tconfig: current.config,\n\t\t\t}));\n\t\t},\n\t\tgoBack() {\n\t\t\tcommit((current) => {\n\t\t\t\tconst { previousPages } = current.navigation;\n\t\t\t\tif (previousPages.length === 0) {\n\t\t\t\t\treturn current;\n\t\t\t\t}\n\n\t\t\t\tconst nextPrevious = previousPages.slice(0, -1);\n\t\t\t\tconst previous = previousPages.at(-1);\n\n\t\t\t\tif (!previous) {\n\t\t\t\t\treturn current;\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\tnavigation: {\n\t\t\t\t\t\tpreviousPages: nextPrevious,\n\t\t\t\t\t\tcurrent: previous,\n\t\t\t\t\t},\n\t\t\t\t\tconfig: current.config,\n\t\t\t\t};\n\t\t\t});\n\t\t},\n\t\topen() {\n\t\t\tcommit((current) => ({\n\t\t\t\tnavigation: current.navigation,\n\t\t\t\tconfig: { ...current.config, isOpen: true },\n\t\t\t}));\n\t\t},\n\t\tclose() {\n\t\t\tcommit((current) => ({\n\t\t\t\tnavigation: current.navigation,\n\t\t\t\tconfig: { ...current.config, isOpen: false },\n\t\t\t}));\n\t\t},\n\t\ttoggle() {\n\t\t\tcommit((current) => ({\n\t\t\t\tnavigation: current.navigation,\n\t\t\t\tconfig: { ...current.config, isOpen: !current.config.isOpen },\n\t\t\t}));\n\t\t},\n\t\tupdateConfig(config) {\n\t\t\tcommit((current) => ({\n\t\t\t\tnavigation: current.navigation,\n\t\t\t\tconfig: { ...current.config, ...config },\n\t\t\t}));\n\t\t},\n\t\treset() {\n\t\t\tcommit(() => createDefaultState<Routes>());\n\t\t},\n\t};\n}\n"],"mappings":";;;AAgGA,MAAM,cAAc;AASpB,SAAS,0BAEsB;AAC9B,QAAO;EACN,SAAS,EAAE,MAAM,QAAQ;EACzB,eAAe,EAAE;EACjB;;AAGF,SAAS,sBAAqC;AAC7C,QAAO;EACN,MAAM;EACN,SAAS,EAAE;EACX,QAAQ;EACR;;AAGF,SAAS,qBAEsB;AAC9B,QAAO;EACN,YAAY,yBAAiC;EAC7C,QAAQ,qBAAqB;EAC7B;;AAGF,SAAS,qBAEP,OAAyD;AAE1D,KAAI,YAAY,SAAS,MAAM,WAAW,OACzC,QAAO;EACN,GAAG;EACH,QAAQ,EAAE,GAAG,MAAM,QAAQ;EAC3B;AAEF,QAAO,EAAE,GAAG,OAAO;;AAGpB,SAAS,oBAGR,WACA,UAC4B;AAC5B,KAAI,CAAC,UACJ,QAAO;CAGR,MAAM,sBAAsB,UAAU;AAetC,QAAO;EACN,YAf6C;GAC7C,SAAS,qBAAqB,UAC3B,qBAA6B,oBAAoB,QAAQ,GACzD,qBAA6B,SAAS,WAAW,QAAQ;GAC5D,gBACC,qBAAqB,iBAAiB,SAAS,WAAW,eACzD,KAAK,SAAS,qBAA6B,KAAK,CAAC;GACnD;EASA,QAP6B;GAC7B,GAAG,SAAS;GACZ,GAAG,UAAU;GACb;EAKA;;AAGF,SAAS,gBAEP,SAAyD;CAC1D,MAAM,WAAW,oBAA4B;CAC7C,MAAM,UAAU,QAAQ;AACxB,KAAI,CAAC,QACJ,QAAO;AAGR,KAAI;EACH,MAAM,MAAM,QAAQ,QAAQ,QAAQ,cAAc,YAAY;AAC9D,MAAI,CAAC,IACJ,QAAO;AAIR,SAAO,oBADQ,KAAK,MAAM,IAAI,EACa,SAAS;UAC5C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