moonflower 1.2.0 → 1.3.1
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/cli/entry.cjs +1 -1
- package/dist/cli/cli.cjs +2 -0
- package/dist/cli/cli.cjs.map +1 -0
- package/dist/cli/cli.d.ts +2 -0
- package/dist/cli/cli.d.ts.map +1 -0
- package/dist/cli/cli.mjs +62 -0
- package/dist/cli/cli.mjs.map +1 -0
- package/dist/cli/prettyprint.cjs +2 -0
- package/dist/cli/prettyprint.cjs.map +1 -0
- package/dist/cli/prettyprint.d.ts +5 -0
- package/dist/cli/prettyprint.d.ts.map +1 -0
- package/dist/cli/prettyprint.mjs +15 -0
- package/dist/cli/prettyprint.mjs.map +1 -0
- package/dist/errors/UserFacingErrors.cjs +1 -1
- package/dist/errors/UserFacingErrors.cjs.map +1 -1
- package/dist/errors/UserFacingErrors.d.ts +27 -0
- package/dist/errors/UserFacingErrors.d.ts.map +1 -1
- package/dist/errors/UserFacingErrors.mjs +67 -13
- package/dist/errors/UserFacingErrors.mjs.map +1 -1
- package/dist/hooks/usePathParams.cjs +1 -1
- package/dist/hooks/usePathParams.cjs.map +1 -1
- package/dist/hooks/usePathParams.d.ts.map +1 -1
- package/dist/hooks/usePathParams.mjs +20 -27
- package/dist/hooks/usePathParams.mjs.map +1 -1
- package/dist/hooks/useQueryParams.cjs +1 -1
- package/dist/hooks/useQueryParams.cjs.map +1 -1
- package/dist/hooks/useQueryParams.d.ts +4 -3
- package/dist/hooks/useQueryParams.d.ts.map +1 -1
- package/dist/hooks/useQueryParams.mjs +24 -33
- package/dist/hooks/useQueryParams.mjs.map +1 -1
- package/dist/hooks/useRequestBody.cjs +1 -1
- package/dist/hooks/useRequestBody.cjs.map +1 -1
- package/dist/hooks/useRequestBody.d.ts +4 -3
- package/dist/hooks/useRequestBody.d.ts.map +1 -1
- package/dist/hooks/useRequestBody.mjs +23 -34
- package/dist/hooks/useRequestBody.mjs.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +64 -55
- package/dist/node_modules/zod/index.cjs +2 -0
- package/dist/node_modules/zod/index.cjs.map +1 -0
- package/dist/node_modules/zod/index.mjs +6 -0
- package/dist/node_modules/zod/index.mjs.map +1 -0
- package/dist/node_modules/zod/v4/classic/checks.cjs +2 -0
- package/dist/node_modules/zod/v4/classic/checks.cjs.map +1 -0
- package/dist/node_modules/zod/v4/classic/checks.mjs +34 -0
- package/dist/node_modules/zod/v4/classic/checks.mjs.map +1 -0
- package/dist/node_modules/zod/v4/classic/coerce.cjs +2 -0
- package/dist/node_modules/zod/v4/classic/coerce.cjs.map +1 -0
- package/dist/node_modules/zod/v4/classic/coerce.mjs +26 -0
- package/dist/node_modules/zod/v4/classic/coerce.mjs.map +1 -0
- package/dist/node_modules/zod/v4/classic/compat.cjs +2 -0
- package/dist/node_modules/zod/v4/classic/compat.cjs.map +1 -0
- package/dist/node_modules/zod/v4/classic/compat.mjs +35 -0
- package/dist/node_modules/zod/v4/classic/compat.mjs.map +1 -0
- package/dist/node_modules/zod/v4/classic/errors.cjs +2 -0
- package/dist/node_modules/zod/v4/classic/errors.cjs.map +1 -0
- package/dist/node_modules/zod/v4/classic/errors.mjs +41 -0
- package/dist/node_modules/zod/v4/classic/errors.mjs.map +1 -0
- package/dist/node_modules/zod/v4/classic/external.cjs +2 -0
- package/dist/node_modules/zod/v4/classic/external.cjs.map +1 -0
- package/dist/node_modules/zod/v4/classic/external.mjs +260 -0
- package/dist/node_modules/zod/v4/classic/external.mjs.map +1 -0
- package/dist/node_modules/zod/v4/classic/from-json-schema.cjs +2 -0
- package/dist/node_modules/zod/v4/classic/from-json-schema.cjs.map +1 -0
- package/dist/node_modules/zod/v4/classic/from-json-schema.mjs +287 -0
- package/dist/node_modules/zod/v4/classic/from-json-schema.mjs.map +1 -0
- package/dist/node_modules/zod/v4/classic/iso.cjs +2 -0
- package/dist/node_modules/zod/v4/classic/iso.cjs.map +1 -0
- package/dist/node_modules/zod/v4/classic/iso.mjs +40 -0
- package/dist/node_modules/zod/v4/classic/iso.mjs.map +1 -0
- package/dist/node_modules/zod/v4/classic/parse.cjs +2 -0
- package/dist/node_modules/zod/v4/classic/parse.cjs.map +1 -0
- package/dist/node_modules/zod/v4/classic/parse.mjs +19 -0
- package/dist/node_modules/zod/v4/classic/parse.mjs.map +1 -0
- package/dist/node_modules/zod/v4/classic/schemas.cjs +2 -0
- package/dist/node_modules/zod/v4/classic/schemas.cjs.map +1 -0
- package/dist/node_modules/zod/v4/classic/schemas.mjs +912 -0
- package/dist/node_modules/zod/v4/classic/schemas.mjs.map +1 -0
- package/dist/node_modules/zod/v4/core/api.cjs +2 -0
- package/dist/node_modules/zod/v4/core/api.cjs.map +1 -0
- package/dist/node_modules/zod/v4/core/api.mjs +1110 -0
- package/dist/node_modules/zod/v4/core/api.mjs.map +1 -0
- package/dist/node_modules/zod/v4/core/checks.cjs +2 -0
- package/dist/node_modules/zod/v4/core/checks.cjs.map +1 -0
- package/dist/node_modules/zod/v4/core/checks.mjs +421 -0
- package/dist/node_modules/zod/v4/core/checks.mjs.map +1 -0
- package/dist/node_modules/zod/v4/core/core.cjs +2 -0
- package/dist/node_modules/zod/v4/core/core.cjs.map +1 -0
- package/dist/node_modules/zod/v4/core/core.mjs +62 -0
- package/dist/node_modules/zod/v4/core/core.mjs.map +1 -0
- package/dist/node_modules/zod/v4/core/doc.cjs +4 -0
- package/dist/node_modules/zod/v4/core/doc.cjs.map +1 -0
- package/dist/node_modules/zod/v4/core/doc.mjs +27 -0
- package/dist/node_modules/zod/v4/core/doc.mjs.map +1 -0
- package/dist/node_modules/zod/v4/core/errors.cjs +3 -0
- package/dist/node_modules/zod/v4/core/errors.cjs.map +1 -0
- package/dist/node_modules/zod/v4/core/errors.mjs +89 -0
- package/dist/node_modules/zod/v4/core/errors.mjs.map +1 -0
- package/dist/node_modules/zod/v4/core/index.cjs +2 -0
- package/dist/node_modules/zod/v4/core/index.cjs.map +1 -0
- package/dist/node_modules/zod/v4/core/index.mjs +293 -0
- package/dist/node_modules/zod/v4/core/index.mjs.map +1 -0
- package/dist/node_modules/zod/v4/core/json-schema-generator.cjs +2 -0
- package/dist/node_modules/zod/v4/core/json-schema-generator.cjs.map +1 -0
- package/dist/node_modules/zod/v4/core/json-schema-generator.mjs +66 -0
- package/dist/node_modules/zod/v4/core/json-schema-generator.mjs.map +1 -0
- package/dist/node_modules/zod/v4/core/json-schema-processors.cjs +2 -0
- package/dist/node_modules/zod/v4/core/json-schema-processors.cjs.map +1 -0
- package/dist/node_modules/zod/v4/core/json-schema-processors.mjs +346 -0
- package/dist/node_modules/zod/v4/core/json-schema-processors.mjs.map +1 -0
- package/dist/node_modules/zod/v4/core/json-schema.cjs +2 -0
- package/dist/node_modules/zod/v4/core/json-schema.cjs.map +1 -0
- package/dist/node_modules/zod/v4/core/json-schema.mjs +2 -0
- package/dist/node_modules/zod/v4/core/json-schema.mjs.map +1 -0
- package/dist/node_modules/zod/v4/core/parse.cjs +2 -0
- package/dist/node_modules/zod/v4/core/parse.cjs.map +1 -0
- package/dist/node_modules/zod/v4/core/parse.mjs +75 -0
- package/dist/node_modules/zod/v4/core/parse.mjs.map +1 -0
- package/dist/node_modules/zod/v4/core/regexes.cjs +2 -0
- package/dist/node_modules/zod/v4/core/regexes.cjs.map +1 -0
- package/dist/node_modules/zod/v4/core/regexes.mjs +94 -0
- package/dist/node_modules/zod/v4/core/regexes.mjs.map +1 -0
- package/dist/node_modules/zod/v4/core/registries.cjs +2 -0
- package/dist/node_modules/zod/v4/core/registries.cjs.map +1 -0
- package/dist/node_modules/zod/v4/core/registries.mjs +44 -0
- package/dist/node_modules/zod/v4/core/registries.mjs.map +1 -0
- package/dist/node_modules/zod/v4/core/schemas.cjs +36 -0
- package/dist/node_modules/zod/v4/core/schemas.cjs.map +1 -0
- package/dist/node_modules/zod/v4/core/schemas.mjs +1319 -0
- package/dist/node_modules/zod/v4/core/schemas.mjs.map +1 -0
- package/dist/node_modules/zod/v4/core/to-json-schema.cjs +4 -0
- package/dist/node_modules/zod/v4/core/to-json-schema.cjs.map +1 -0
- package/dist/node_modules/zod/v4/core/to-json-schema.mjs +244 -0
- package/dist/node_modules/zod/v4/core/to-json-schema.mjs.map +1 -0
- package/dist/node_modules/zod/v4/core/util.cjs +2 -0
- package/dist/node_modules/zod/v4/core/util.cjs.map +1 -0
- package/dist/node_modules/zod/v4/core/util.mjs +523 -0
- package/dist/node_modules/zod/v4/core/util.mjs.map +1 -0
- package/dist/node_modules/zod/v4/core/versions.cjs +2 -0
- package/dist/node_modules/zod/v4/core/versions.cjs.map +1 -0
- package/dist/node_modules/zod/v4/core/versions.mjs +9 -0
- package/dist/node_modules/zod/v4/core/versions.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/ar.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/ar.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/ar.mjs +87 -0
- package/dist/node_modules/zod/v4/locales/ar.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/az.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/az.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/az.mjs +87 -0
- package/dist/node_modules/zod/v4/locales/az.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/be.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/be.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/be.mjs +129 -0
- package/dist/node_modules/zod/v4/locales/be.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/bg.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/bg.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/bg.mjs +98 -0
- package/dist/node_modules/zod/v4/locales/bg.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/ca.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/ca.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/ca.mjs +88 -0
- package/dist/node_modules/zod/v4/locales/ca.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/cs.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/cs.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/cs.mjs +91 -0
- package/dist/node_modules/zod/v4/locales/cs.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/da.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/da.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/da.mjs +94 -0
- package/dist/node_modules/zod/v4/locales/da.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/de.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/de.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/de.mjs +89 -0
- package/dist/node_modules/zod/v4/locales/de.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/en.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/en.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/en.mjs +91 -0
- package/dist/node_modules/zod/v4/locales/en.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/eo.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/eo.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/eo.mjs +90 -0
- package/dist/node_modules/zod/v4/locales/eo.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/es.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/es.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/es.mjs +111 -0
- package/dist/node_modules/zod/v4/locales/es.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/fa.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/fa.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/fa.mjs +89 -0
- package/dist/node_modules/zod/v4/locales/fa.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/fi.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/fi.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/fi.mjs +91 -0
- package/dist/node_modules/zod/v4/locales/fi.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/fr-CA.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/fr-CA.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/fr-CA.mjs +87 -0
- package/dist/node_modules/zod/v4/locales/fr-CA.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/fr.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/fr.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/fr.mjs +89 -0
- package/dist/node_modules/zod/v4/locales/fr.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/he.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/he.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/he.mjs +152 -0
- package/dist/node_modules/zod/v4/locales/he.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/hu.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/hu.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/hu.mjs +89 -0
- package/dist/node_modules/zod/v4/locales/hu.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/hy.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/hy.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/hy.mjs +130 -0
- package/dist/node_modules/zod/v4/locales/hy.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/id.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/id.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/id.mjs +87 -0
- package/dist/node_modules/zod/v4/locales/id.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/index.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/index.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/index.mjs +101 -0
- package/dist/node_modules/zod/v4/locales/index.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/is.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/is.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/is.mjs +89 -0
- package/dist/node_modules/zod/v4/locales/is.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/it.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/it.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/it.mjs +89 -0
- package/dist/node_modules/zod/v4/locales/it.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/ja.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/ja.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/ja.mjs +89 -0
- package/dist/node_modules/zod/v4/locales/ja.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/ka.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/ka.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/ka.mjs +92 -0
- package/dist/node_modules/zod/v4/locales/ka.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/kh.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/kh.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/kh.mjs +8 -0
- package/dist/node_modules/zod/v4/locales/kh.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/km.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/km.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/km.mjs +90 -0
- package/dist/node_modules/zod/v4/locales/km.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/ko.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/ko.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/ko.mjs +87 -0
- package/dist/node_modules/zod/v4/locales/ko.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/lt.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/lt.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/lt.mjs +178 -0
- package/dist/node_modules/zod/v4/locales/lt.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/mk.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/mk.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/mk.mjs +89 -0
- package/dist/node_modules/zod/v4/locales/mk.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/ms.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/ms.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/ms.mjs +88 -0
- package/dist/node_modules/zod/v4/locales/ms.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/nl.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/nl.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/nl.mjs +88 -0
- package/dist/node_modules/zod/v4/locales/nl.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/no.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/no.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/no.mjs +89 -0
- package/dist/node_modules/zod/v4/locales/no.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/ota.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/ota.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/ota.mjs +90 -0
- package/dist/node_modules/zod/v4/locales/ota.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/pl.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/pl.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/pl.mjs +89 -0
- package/dist/node_modules/zod/v4/locales/pl.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/ps.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/ps.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/ps.mjs +89 -0
- package/dist/node_modules/zod/v4/locales/ps.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/pt.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/pt.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/pt.mjs +89 -0
- package/dist/node_modules/zod/v4/locales/pt.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/ru.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/ru.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/ru.mjs +129 -0
- package/dist/node_modules/zod/v4/locales/ru.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/sl.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/sl.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/sl.mjs +89 -0
- package/dist/node_modules/zod/v4/locales/sl.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/sv.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/sv.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/sv.mjs +89 -0
- package/dist/node_modules/zod/v4/locales/sv.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/ta.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/ta.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/ta.mjs +90 -0
- package/dist/node_modules/zod/v4/locales/ta.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/th.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/th.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/th.mjs +90 -0
- package/dist/node_modules/zod/v4/locales/th.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/tr.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/tr.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/tr.mjs +87 -0
- package/dist/node_modules/zod/v4/locales/tr.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/ua.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/ua.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/ua.mjs +8 -0
- package/dist/node_modules/zod/v4/locales/ua.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/uk.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/uk.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/uk.mjs +89 -0
- package/dist/node_modules/zod/v4/locales/uk.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/ur.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/ur.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/ur.mjs +90 -0
- package/dist/node_modules/zod/v4/locales/ur.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/uz.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/uz.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/uz.mjs +90 -0
- package/dist/node_modules/zod/v4/locales/uz.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/vi.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/vi.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/vi.mjs +89 -0
- package/dist/node_modules/zod/v4/locales/vi.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/yo.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/yo.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/yo.mjs +89 -0
- package/dist/node_modules/zod/v4/locales/yo.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/zh-CN.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/zh-CN.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/zh-CN.mjs +90 -0
- package/dist/node_modules/zod/v4/locales/zh-CN.mjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/zh-TW.cjs +2 -0
- package/dist/node_modules/zod/v4/locales/zh-TW.cjs.map +1 -0
- package/dist/node_modules/zod/v4/locales/zh-TW.mjs +87 -0
- package/dist/node_modules/zod/v4/locales/zh-TW.mjs.map +1 -0
- package/dist/openapi/analyzerModule/analyzerModule.cjs +1 -1
- package/dist/openapi/analyzerModule/analyzerModule.cjs.map +1 -1
- package/dist/openapi/analyzerModule/analyzerModule.d.ts.map +1 -1
- package/dist/openapi/analyzerModule/analyzerModule.mjs +42 -42
- package/dist/openapi/analyzerModule/analyzerModule.mjs.map +1 -1
- package/dist/openapi/analyzerModule/nodeParsers.cjs +1 -1
- package/dist/openapi/analyzerModule/nodeParsers.cjs.map +1 -1
- package/dist/openapi/analyzerModule/nodeParsers.d.ts +1 -0
- package/dist/openapi/analyzerModule/nodeParsers.d.ts.map +1 -1
- package/dist/openapi/analyzerModule/nodeParsers.mjs +261 -206
- package/dist/openapi/analyzerModule/nodeParsers.mjs.map +1 -1
- package/dist/openapi/analyzerModule/parseEndpoint.cjs +1 -1
- package/dist/openapi/analyzerModule/parseEndpoint.cjs.map +1 -1
- package/dist/openapi/analyzerModule/parseEndpoint.d.ts.map +1 -1
- package/dist/openapi/analyzerModule/parseEndpoint.mjs +62 -62
- package/dist/openapi/analyzerModule/parseEndpoint.mjs.map +1 -1
- package/dist/openapi/analyzerModule/test/TestCase.d.ts +9 -0
- package/dist/openapi/analyzerModule/test/TestCase.d.ts.map +1 -0
- package/dist/openapi/analyzerModule/test/openApiAnalyzer.zod.spec.d.ts +2 -0
- package/dist/openapi/analyzerModule/test/openApiAnalyzer.zod.spec.d.ts.map +1 -0
- package/dist/openapi/analyzerModule/test/openApiAnalyzer.zod.spec.data.d.ts +2 -0
- package/dist/openapi/analyzerModule/test/openApiAnalyzer.zod.spec.data.d.ts.map +1 -0
- package/dist/openapi/initOpenApiEngine.cjs +1 -1
- package/dist/openapi/initOpenApiEngine.cjs.map +1 -1
- package/dist/openapi/initOpenApiEngine.d.ts +7 -2
- package/dist/openapi/initOpenApiEngine.d.ts.map +1 -1
- package/dist/openapi/initOpenApiEngine.mjs +13 -7
- package/dist/openapi/initOpenApiEngine.mjs.map +1 -1
- package/dist/openapi/manager/OpenApiManager.cjs +1 -1
- package/dist/openapi/manager/OpenApiManager.cjs.map +1 -1
- package/dist/openapi/manager/OpenApiManager.d.ts +4 -0
- package/dist/openapi/manager/OpenApiManager.d.ts.map +1 -1
- package/dist/openapi/manager/OpenApiManager.mjs +11 -2
- package/dist/openapi/manager/OpenApiManager.mjs.map +1 -1
- package/dist/openapi/router/OpenApiRouter.cjs +1 -1
- package/dist/openapi/router/OpenApiRouter.cjs.map +1 -1
- package/dist/openapi/router/OpenApiRouter.d.ts.map +1 -1
- package/dist/openapi/router/OpenApiRouter.mjs +9 -6
- package/dist/openapi/router/OpenApiRouter.mjs.map +1 -1
- package/dist/utils/getValueAsNullableString.cjs +2 -0
- package/dist/utils/getValueAsNullableString.cjs.map +1 -0
- package/dist/utils/getValueAsNullableString.d.ts +2 -0
- package/dist/utils/getValueAsNullableString.d.ts.map +1 -0
- package/dist/utils/getValueAsNullableString.mjs +7 -0
- package/dist/utils/getValueAsNullableString.mjs.map +1 -0
- package/dist/utils/validationMessages.cjs +1 -1
- package/dist/utils/validationMessages.cjs.map +1 -1
- package/dist/utils/validationMessages.d.ts +1 -1
- package/dist/utils/validationMessages.d.ts.map +1 -1
- package/dist/utils/validationMessages.mjs +8 -8
- package/dist/utils/validationMessages.mjs.map +1 -1
- package/dist/validators/types.d.ts +4 -0
- package/dist/validators/types.d.ts.map +1 -1
- package/dist/validators/validateMissingParams.cjs +2 -0
- package/dist/validators/validateMissingParams.cjs.map +1 -0
- package/dist/validators/validateMissingParams.d.ts +7 -0
- package/dist/validators/validateMissingParams.d.ts.map +1 -0
- package/dist/validators/validateMissingParams.mjs +17 -0
- package/dist/validators/validateMissingParams.mjs.map +1 -0
- package/dist/validators/validateParam.cjs +2 -0
- package/dist/validators/validateParam.cjs.map +1 -0
- package/dist/validators/validateParam.d.ts +8 -0
- package/dist/validators/validateParam.d.ts.map +1 -0
- package/dist/validators/validateParam.mjs +41 -0
- package/dist/validators/validateParam.mjs.map +1 -0
- package/package.json +12 -5
- package/{cli → src/cli}/cli.ts +26 -6
- package/{cli → src/cli}/prettyprint.ts +2 -2
- package/src/errors/UserFacingErrors.ts +54 -0
- package/src/hooks/usePathParams.spec.ts +27 -0
- package/src/hooks/usePathParams.ts +5 -13
- package/src/hooks/useQueryParams.spec.ts +99 -0
- package/src/hooks/useQueryParams.ts +16 -25
- package/src/hooks/useRequestBody.spec.ts +99 -0
- package/src/hooks/useRequestBody.ts +16 -35
- package/src/openapi/analyzerModule/analyzerModule.ts +2 -3
- package/src/openapi/analyzerModule/nodeParsers.ts +113 -8
- package/src/openapi/analyzerModule/parseEndpoint.ts +2 -2
- package/src/openapi/analyzerModule/test/TestCase.ts +8 -0
- package/src/openapi/analyzerModule/test/openApiAnalyzer.spec.data.ts +9 -0
- package/src/openapi/analyzerModule/test/openApiAnalyzer.spec.ts +21 -0
- package/src/openapi/analyzerModule/test/openApiAnalyzer.zod.spec.data.ts +87 -0
- package/src/openapi/analyzerModule/test/openApiAnalyzer.zod.spec.ts +178 -0
- package/src/openapi/initOpenApiEngine.ts +48 -6
- package/src/openapi/manager/OpenApiManager.ts +16 -0
- package/src/openapi/router/OpenApiRouter.ts +6 -1
- package/src/test/app.spec.ts +27 -0
- package/src/utils/getValueAsNullableString.ts +8 -0
- package/src/utils/validationMessages.ts +4 -0
- package/src/validators/types.ts +5 -0
- package/src/validators/validateMissingParams.ts +27 -0
- package/src/validators/validateParam.ts +69 -0
- package/vite.config.ts +3 -0
|
@@ -1,279 +1,325 @@
|
|
|
1
1
|
import { SyntaxKind as e } from "ts-morph";
|
|
2
|
-
import { Logger as
|
|
3
|
-
import { OpenApiManager as
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
if (
|
|
7
|
-
return
|
|
2
|
+
import { Logger as m } from "../../utils/logger.mjs";
|
|
3
|
+
import { OpenApiManager as O } from "../manager/OpenApiManager.mjs";
|
|
4
|
+
const L = /* @__PURE__ */ new WeakMap(), c = (t) => {
|
|
5
|
+
const n = L.get(t);
|
|
6
|
+
if (n)
|
|
7
|
+
return n;
|
|
8
8
|
if (t.getKind() === e.Identifier) {
|
|
9
|
-
const
|
|
10
|
-
if (
|
|
11
|
-
const o =
|
|
9
|
+
const r = t.asKind(e.Identifier).getImplementations()[0]?.getNode();
|
|
10
|
+
if (r) {
|
|
11
|
+
const o = r.getParent().getLastChild();
|
|
12
12
|
if (o === t)
|
|
13
13
|
throw new Error("Recursive implementation found");
|
|
14
|
-
const
|
|
15
|
-
return
|
|
14
|
+
const p = c(o);
|
|
15
|
+
return L.set(t, p), p;
|
|
16
16
|
}
|
|
17
|
-
const
|
|
18
|
-
if (
|
|
19
|
-
const o =
|
|
17
|
+
const l = t.asKind(e.Identifier).getDefinitions()[0]?.getNode();
|
|
18
|
+
if (l) {
|
|
19
|
+
const o = l.getParent().getLastChild();
|
|
20
20
|
if (o === t)
|
|
21
21
|
throw new Error("Recursive implementation found");
|
|
22
|
-
const
|
|
23
|
-
return
|
|
22
|
+
const p = c(o);
|
|
23
|
+
return L.set(t, p), p;
|
|
24
24
|
}
|
|
25
25
|
throw new Error("No implementation nor definition available");
|
|
26
26
|
}
|
|
27
|
-
return
|
|
28
|
-
},
|
|
29
|
-
const
|
|
30
|
-
return
|
|
31
|
-
(
|
|
27
|
+
return L.set(t, t), t;
|
|
28
|
+
}, C = (t) => {
|
|
29
|
+
const n = t.getChildrenOfKind(e.Identifier);
|
|
30
|
+
return n.length === 2 ? c(n[1]) : t.getChildren().reverse().find(
|
|
31
|
+
(l) => l.getKind() !== e.GreaterThanToken && l.getKind() !== e.CommaToken && l.getKind() !== e.SemicolonToken
|
|
32
32
|
);
|
|
33
|
-
},
|
|
34
|
-
const
|
|
35
|
-
return
|
|
33
|
+
}, P = (t) => {
|
|
34
|
+
const n = t.getFirstChildByKind(e.SyntaxList);
|
|
35
|
+
return n.isKind(e.SyntaxList) ? y(n.getFirstChild()) : y(n);
|
|
36
36
|
}, y = (t) => {
|
|
37
|
-
const
|
|
38
|
-
if (
|
|
37
|
+
const n = t.getSymbol()?.getName();
|
|
38
|
+
if (n && O.getInstance().hasExposedModel(n))
|
|
39
39
|
return [
|
|
40
40
|
{
|
|
41
41
|
role: "ref",
|
|
42
|
-
shape:
|
|
42
|
+
shape: n,
|
|
43
43
|
optional: !1
|
|
44
44
|
}
|
|
45
45
|
];
|
|
46
|
-
const
|
|
47
|
-
if (
|
|
46
|
+
const r = c(t);
|
|
47
|
+
if (r.asKind(e.UndefinedKeyword))
|
|
48
48
|
return "undefined";
|
|
49
|
-
const
|
|
50
|
-
if (
|
|
51
|
-
if (
|
|
49
|
+
const i = r.asKind(e.LiteralType);
|
|
50
|
+
if (i) {
|
|
51
|
+
if (i.getFirstChildByKind(e.TrueKeyword))
|
|
52
52
|
return "true";
|
|
53
|
-
if (
|
|
53
|
+
if (i.getFirstChildByKind(e.FalseKeyword))
|
|
54
54
|
return "false";
|
|
55
55
|
}
|
|
56
|
-
if (
|
|
56
|
+
if (r.asKind(e.BooleanKeyword) || r.asKind(e.TrueKeyword) || r.asKind(e.FalseKeyword))
|
|
57
57
|
return "boolean";
|
|
58
|
-
if (
|
|
58
|
+
if (r.asKind(e.StringKeyword) || r.asKind(e.StringLiteral))
|
|
59
59
|
return "string";
|
|
60
|
-
if (
|
|
60
|
+
if (r.asKind(e.NumberKeyword) || r.asKind(e.NumericLiteral))
|
|
61
61
|
return "number";
|
|
62
|
-
if (
|
|
62
|
+
if (r.asKind(e.BigIntKeyword) || r.asKind(e.BigIntLiteral))
|
|
63
63
|
return "bigint";
|
|
64
|
-
const s =
|
|
64
|
+
const s = r.asKind(e.TypeLiteral);
|
|
65
65
|
if (s)
|
|
66
|
-
return s.getFirstChildByKind(e.SyntaxList).getChildrenOfKind(e.PropertySignature).map((
|
|
67
|
-
const
|
|
66
|
+
return s.getFirstChildByKind(e.SyntaxList).getChildrenOfKind(e.PropertySignature).map((I) => {
|
|
67
|
+
const k = I.getFirstChildByKind(e.Identifier), v = C(I), R = k.getNextSiblingIfKind(e.QuestionToken);
|
|
68
68
|
return {
|
|
69
69
|
role: "property",
|
|
70
|
-
identifier:
|
|
71
|
-
shape: y(
|
|
72
|
-
optional:
|
|
70
|
+
identifier: k.getText(),
|
|
71
|
+
shape: y(v),
|
|
72
|
+
optional: v.getType().isNullable() || !!R
|
|
73
73
|
};
|
|
74
74
|
});
|
|
75
|
-
const d =
|
|
75
|
+
const d = r.asKind(e.TypeReference);
|
|
76
76
|
if (d)
|
|
77
77
|
return y(d.getFirstChild());
|
|
78
|
-
if (
|
|
79
|
-
const
|
|
80
|
-
return
|
|
78
|
+
if (r.asKind(e.PropertyAccessExpression)) {
|
|
79
|
+
const w = c(r.getLastChild());
|
|
80
|
+
return f(w.asKind(e.CallExpression).getReturnType(), w);
|
|
81
81
|
}
|
|
82
|
-
const h =
|
|
82
|
+
const h = r.asKind(e.UnionType);
|
|
83
83
|
if (h)
|
|
84
|
-
return
|
|
85
|
-
const
|
|
86
|
-
if (
|
|
87
|
-
return y(
|
|
88
|
-
const
|
|
89
|
-
if (
|
|
90
|
-
return y(
|
|
91
|
-
const
|
|
92
|
-
if (
|
|
93
|
-
return
|
|
94
|
-
const
|
|
95
|
-
if (
|
|
96
|
-
return y(
|
|
97
|
-
const
|
|
98
|
-
if (
|
|
99
|
-
return y(
|
|
100
|
-
const
|
|
101
|
-
return
|
|
102
|
-
},
|
|
103
|
-
const o =
|
|
84
|
+
return f(h.getType(), r);
|
|
85
|
+
const S = r.asKind(e.TypeQuery);
|
|
86
|
+
if (S)
|
|
87
|
+
return y(S.getLastChild());
|
|
88
|
+
const F = r.asKind(e.QualifiedName);
|
|
89
|
+
if (F)
|
|
90
|
+
return y(F.getLastChild());
|
|
91
|
+
const x = r.asKind(e.CallExpression);
|
|
92
|
+
if (x)
|
|
93
|
+
return f(x.getReturnType(), x);
|
|
94
|
+
const B = r.asKind(e.AwaitExpression);
|
|
95
|
+
if (B)
|
|
96
|
+
return y(B.getChildAtIndex(1));
|
|
97
|
+
const E = r.asKind(e.AsExpression);
|
|
98
|
+
if (E)
|
|
99
|
+
return y(E.getChildAtIndex(2));
|
|
100
|
+
const D = r.getSourceFile().getFilePath().split("/").pop();
|
|
101
|
+
return m.warn(`[${D}] Unknown node type: ${r.getKindName()}`), "unknown_1";
|
|
102
|
+
}, z = (t) => t.getFirstDescendantByKind(e.SyntaxList).getChildrenOfKind(e.PropertyAssignment).map((i) => {
|
|
103
|
+
const o = i.getFirstChild(), p = (() => {
|
|
104
104
|
if (o.isKind(e.Identifier))
|
|
105
105
|
return o.getText();
|
|
106
106
|
if (o.isKind(e.StringLiteral))
|
|
107
107
|
return o.getLiteralText();
|
|
108
|
-
const s =
|
|
109
|
-
return
|
|
110
|
-
})(), a =
|
|
108
|
+
const s = i.getSourceFile().getFilePath().split("/").pop();
|
|
109
|
+
return m.warn(`[${s}] Unknown identifier name: ${o.getText()}`), "unknown_30";
|
|
110
|
+
})(), a = i.getLastChild(), u = c(a);
|
|
111
111
|
return {
|
|
112
112
|
role: "property",
|
|
113
|
-
identifier:
|
|
114
|
-
shape:
|
|
115
|
-
optional:
|
|
116
|
-
description:
|
|
117
|
-
errorMessage:
|
|
113
|
+
identifier: p,
|
|
114
|
+
shape: N(u),
|
|
115
|
+
optional: V(u),
|
|
116
|
+
description: K(u, "description"),
|
|
117
|
+
errorMessage: K(u, "errorMessage")
|
|
118
118
|
};
|
|
119
|
-
}) || [],
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
119
|
+
}) || [], T = (t) => {
|
|
120
|
+
const n = t.asKind(e.CallExpression);
|
|
121
|
+
return n ? (n.getReturnType().getSymbol()?.getName() ?? "").startsWith("Zod") : !1;
|
|
122
|
+
}, A = (t) => {
|
|
123
|
+
const n = t.asKind(e.CallExpression), l = n.getReturnType().getSymbol()?.getName() ?? "";
|
|
124
|
+
if (l === "ZodNumber")
|
|
125
|
+
return "number";
|
|
126
|
+
if (l === "ZodString")
|
|
127
|
+
return "string";
|
|
128
|
+
if (l === "ZodBoolean")
|
|
129
|
+
return "boolean";
|
|
130
|
+
if (l === "ZodBigInt")
|
|
131
|
+
return "bigint";
|
|
132
|
+
if (l === "ZodObject") {
|
|
133
|
+
const p = n.getFirstChildByKind(e.SyntaxList)?.getFirstChild()?.asKind(e.ObjectLiteralExpression);
|
|
134
|
+
if (!p)
|
|
135
|
+
return "unknown_zod_object";
|
|
136
|
+
const a = p.getFirstChildByKind(e.SyntaxList);
|
|
137
|
+
return a ? a.getChildrenOfKind(e.PropertyAssignment).map((s) => {
|
|
138
|
+
const d = s.getFirstChildByKind(e.Identifier).getText(), g = s.getLastChild();
|
|
139
|
+
return {
|
|
140
|
+
role: "property",
|
|
141
|
+
identifier: d,
|
|
142
|
+
shape: T(g) ? A(g) : N(g),
|
|
143
|
+
optional: !1
|
|
144
|
+
};
|
|
145
|
+
}) : [];
|
|
124
146
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
return
|
|
147
|
+
if (l === "ZodArray") {
|
|
148
|
+
const o = n.getFirstChildByKind(e.SyntaxList)?.getFirstChild();
|
|
149
|
+
return o ? [
|
|
150
|
+
{
|
|
151
|
+
role: "array",
|
|
152
|
+
shape: T(o) ? A(o) : N(o),
|
|
153
|
+
optional: !1
|
|
154
|
+
}
|
|
155
|
+
] : "unknown_zod_array";
|
|
156
|
+
}
|
|
157
|
+
const i = t.getSourceFile().getFilePath().split("/").pop();
|
|
158
|
+
return m.warn(`[${i}] Unknown zod type: ${l}`), "unknown_zod";
|
|
159
|
+
}, N = (t) => {
|
|
160
|
+
if (T(t))
|
|
161
|
+
return A(t);
|
|
162
|
+
const n = t.getParent().getFirstChildByKind(e.AsExpression);
|
|
163
|
+
if (n) {
|
|
164
|
+
const s = n.getLastChildByKind(e.TypeReference);
|
|
165
|
+
return P(s);
|
|
166
|
+
}
|
|
167
|
+
const r = t.getParent().getFirstChildByKind(e.TypeReference);
|
|
168
|
+
if (r)
|
|
169
|
+
return P(r);
|
|
128
170
|
if (t.getParent().getChildrenOfKind(e.SyntaxList).length >= 2) {
|
|
129
171
|
const s = t.getParent().getFirstChildByKind(e.SyntaxList).getFirstChild();
|
|
130
172
|
return y(s);
|
|
131
173
|
}
|
|
132
|
-
const
|
|
133
|
-
if (
|
|
174
|
+
const l = t.getParent().getFirstChildByKind(e.CallExpression);
|
|
175
|
+
if (l) {
|
|
134
176
|
const s = c(
|
|
135
|
-
|
|
177
|
+
l.getFirstChildByKind(e.SyntaxList).getFirstChild()
|
|
136
178
|
), d = s.getParent().getFirstChildByKind(e.TypeReference);
|
|
137
179
|
if (d)
|
|
138
|
-
return
|
|
139
|
-
const
|
|
140
|
-
if (
|
|
141
|
-
return
|
|
180
|
+
return f(d.getType(), d, []);
|
|
181
|
+
const g = s.getParent().getFirstChildByKind(e.ObjectLiteralExpression);
|
|
182
|
+
if (g)
|
|
183
|
+
return N(g);
|
|
142
184
|
if (s.getKind() === e.CallExpression || s.getKind() === e.IntersectionType)
|
|
143
|
-
return
|
|
185
|
+
return N(s);
|
|
144
186
|
const h = t.getSourceFile().getFilePath().split("/").pop();
|
|
145
|
-
return
|
|
187
|
+
return m.warn(`[${h}] Unknown call expression argument: ${s.getKindName()}`), "unknown_3";
|
|
146
188
|
}
|
|
147
189
|
const o = t.getFirstChildByKind(e.SyntaxList).getChildrenOfKind(e.PropertyAssignment).find((s) => s.getFirstChildByKind(e.Identifier)?.getText() === "parse");
|
|
148
190
|
if (o) {
|
|
149
|
-
const s =
|
|
150
|
-
return
|
|
191
|
+
const s = C(o).asKind(e.ArrowFunction).getReturnType();
|
|
192
|
+
return f(s, o);
|
|
151
193
|
}
|
|
152
|
-
const
|
|
153
|
-
if (
|
|
154
|
-
const s =
|
|
194
|
+
const p = t.getFirstChildByKind(e.SyntaxList)?.getFirstChildByKind(e.ImportType);
|
|
195
|
+
if (p) {
|
|
196
|
+
const s = p.getLastChildByKind(e.GreaterThanToken).getChildIndex(), d = p.getChildAtIndex(s - 1);
|
|
155
197
|
return y(d.getFirstChild());
|
|
156
198
|
}
|
|
157
199
|
const a = t.isKind(e.IntersectionType) ? t : t.getParent()?.isKind(e.VariableDeclaration) ? t.getParent()?.getFirstChildByKind(e.IntersectionType) : null;
|
|
158
200
|
if (a) {
|
|
159
201
|
const s = a.getFirstChildByKind(e.TypeReference);
|
|
160
202
|
if (s)
|
|
161
|
-
return
|
|
203
|
+
return P(s);
|
|
162
204
|
}
|
|
163
|
-
const
|
|
164
|
-
return
|
|
165
|
-
},
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
205
|
+
const u = t.getSourceFile().getFilePath().split("/").pop();
|
|
206
|
+
return m.warn(`[${u}] Unknown import type node`), "unknown_2";
|
|
207
|
+
}, V = (t) => {
|
|
208
|
+
if (T(t))
|
|
209
|
+
return !1;
|
|
210
|
+
const n = t.asKind(e.CallExpression);
|
|
211
|
+
if (n) {
|
|
212
|
+
const i = n.getFirstChildByKind(e.Identifier);
|
|
213
|
+
if (i?.getText() === "OptionalParam")
|
|
170
214
|
return !0;
|
|
171
|
-
if (
|
|
215
|
+
if (i?.getText() === "RequiredParam")
|
|
172
216
|
return !1;
|
|
173
|
-
const o =
|
|
174
|
-
return
|
|
217
|
+
const o = n.getFirstChildByKind(e.SyntaxList), p = c(o.getFirstChild());
|
|
218
|
+
return V(p);
|
|
175
219
|
}
|
|
176
|
-
return t.getFirstDescendantByKind(e.SyntaxList).getChildrenOfKind(e.PropertyAssignment).some((
|
|
177
|
-
},
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
220
|
+
return t.getFirstDescendantByKind(e.SyntaxList).getChildrenOfKind(e.PropertyAssignment).some((i) => i.getFirstDescendantByKind(e.Identifier).getText() === "optional" ? C(i).getKind() === e.TrueKeyword : !1);
|
|
221
|
+
}, K = (t, n) => {
|
|
222
|
+
if (T(t))
|
|
223
|
+
return "";
|
|
224
|
+
const r = c(t), l = r.asKind(e.CallExpression);
|
|
225
|
+
if (l) {
|
|
226
|
+
const d = l.getLastChildByKind(e.SyntaxList);
|
|
227
|
+
return K(d, n);
|
|
182
228
|
}
|
|
183
|
-
const
|
|
184
|
-
if (
|
|
185
|
-
return
|
|
186
|
-
const o =
|
|
229
|
+
const i = r.asKind(e.SyntaxList);
|
|
230
|
+
if (i)
|
|
231
|
+
return i.getChildren().map((g) => K(g, n)).find((g) => !!g && g !== "unknown_25") || "";
|
|
232
|
+
const o = r.asKind(e.ObjectLiteralExpression);
|
|
187
233
|
if (o) {
|
|
188
|
-
const
|
|
189
|
-
return
|
|
234
|
+
const g = _(o).find((h) => h.identifier === n);
|
|
235
|
+
return g ? Array.isArray(g.value) ? "array" : g.value || "" : "";
|
|
190
236
|
}
|
|
191
|
-
const
|
|
192
|
-
if (
|
|
193
|
-
return
|
|
194
|
-
const a =
|
|
237
|
+
const p = r.asKind(e.IntersectionType);
|
|
238
|
+
if (p)
|
|
239
|
+
return p.getTypeNodes().flatMap((d) => K(d, n)).filter((d) => !!d && d !== "unknown_25")[0] || "unknown_27";
|
|
240
|
+
const a = r.asKind(e.TypeLiteral);
|
|
195
241
|
if (a)
|
|
196
|
-
return
|
|
197
|
-
const
|
|
198
|
-
if (
|
|
199
|
-
return
|
|
242
|
+
return K(a.getFirstChildByKind(e.SyntaxList), n);
|
|
243
|
+
const u = r.asKind(e.PropertySignature);
|
|
244
|
+
if (u && r.getFirstDescendantByKind(e.Identifier).getText() === n)
|
|
245
|
+
return C(u).getFirstDescendantByKind(
|
|
200
246
|
e.StringLiteral
|
|
201
247
|
).getLiteralText();
|
|
202
|
-
const s =
|
|
203
|
-
return
|
|
204
|
-
},
|
|
205
|
-
const
|
|
206
|
-
if (!t.isObject() || !
|
|
248
|
+
const s = r.getSourceFile().getFilePath().split("/").pop();
|
|
249
|
+
return m.dev(`[${s}] Unknown property string value node ${r.getKindName()}`), "unknown_25";
|
|
250
|
+
}, $ = (t) => {
|
|
251
|
+
const n = t.getSymbol();
|
|
252
|
+
if (!t.isObject() || !n)
|
|
207
253
|
return !1;
|
|
208
|
-
const
|
|
209
|
-
return
|
|
210
|
-
},
|
|
211
|
-
const
|
|
212
|
-
if (
|
|
254
|
+
const r = t.getTypeArguments();
|
|
255
|
+
return n.getName() === "Promise" && r.length === 1;
|
|
256
|
+
}, f = (t, n, r = []) => {
|
|
257
|
+
const l = t.getAliasSymbol()?.getName();
|
|
258
|
+
if (l && O.getInstance().hasExposedModel(l))
|
|
213
259
|
return [
|
|
214
260
|
{
|
|
215
261
|
role: "ref",
|
|
216
|
-
shape:
|
|
262
|
+
shape: l,
|
|
217
263
|
optional: !1
|
|
218
264
|
}
|
|
219
265
|
];
|
|
220
|
-
const
|
|
221
|
-
if (
|
|
266
|
+
const i = $(t) ? t.getTypeArguments()[0] : t;
|
|
267
|
+
if (r.some((a) => a === i))
|
|
222
268
|
return "circular";
|
|
223
|
-
const o =
|
|
224
|
-
if (
|
|
269
|
+
const o = r.concat(i);
|
|
270
|
+
if (i.getText() === "void")
|
|
225
271
|
return "void";
|
|
226
|
-
if (
|
|
272
|
+
if (i.isAny())
|
|
227
273
|
return "any";
|
|
228
|
-
if (
|
|
274
|
+
if (i.isNull())
|
|
229
275
|
return "null";
|
|
230
|
-
if (
|
|
276
|
+
if (i.isUndefined())
|
|
231
277
|
return "undefined";
|
|
232
|
-
if (
|
|
278
|
+
if (i.isBoolean() || i.isBooleanLiteral())
|
|
233
279
|
return "boolean";
|
|
234
|
-
if (
|
|
280
|
+
if (i.isStringLiteral())
|
|
235
281
|
return [
|
|
236
282
|
{
|
|
237
283
|
role: "literal_string",
|
|
238
|
-
shape: String(
|
|
284
|
+
shape: String(i.getLiteralValue()),
|
|
239
285
|
optional: !1
|
|
240
286
|
}
|
|
241
287
|
];
|
|
242
|
-
if (
|
|
288
|
+
if (i.isNumberLiteral())
|
|
243
289
|
return [
|
|
244
290
|
{
|
|
245
291
|
role: "literal_number",
|
|
246
|
-
shape: String(
|
|
292
|
+
shape: String(i.getLiteralValue()),
|
|
247
293
|
optional: !1
|
|
248
294
|
}
|
|
249
295
|
];
|
|
250
|
-
if (
|
|
296
|
+
if (i.isString() || i.isTemplateLiteral())
|
|
251
297
|
return "string";
|
|
252
|
-
if (
|
|
298
|
+
if (i.isNumber())
|
|
253
299
|
return "number";
|
|
254
|
-
if (
|
|
300
|
+
if (i.getText() === "bigint")
|
|
255
301
|
return "bigint";
|
|
256
|
-
if (
|
|
302
|
+
if (i.isTuple())
|
|
257
303
|
return [
|
|
258
304
|
{
|
|
259
305
|
role: "tuple",
|
|
260
|
-
shape:
|
|
306
|
+
shape: i.getTupleElements().map((a) => ({
|
|
261
307
|
role: "tuple_entry",
|
|
262
|
-
shape:
|
|
308
|
+
shape: f(a, n, o),
|
|
263
309
|
optional: !1
|
|
264
310
|
})),
|
|
265
311
|
optional: !1
|
|
266
312
|
}
|
|
267
313
|
];
|
|
268
|
-
if (
|
|
314
|
+
if (i.isArray())
|
|
269
315
|
return [
|
|
270
316
|
{
|
|
271
317
|
role: "array",
|
|
272
|
-
shape:
|
|
318
|
+
shape: f(i.getArrayElementType(), n, o),
|
|
273
319
|
optional: !1
|
|
274
320
|
}
|
|
275
321
|
];
|
|
276
|
-
if (
|
|
322
|
+
if (i.isObject() && i.getText() === "Buffer")
|
|
277
323
|
return [
|
|
278
324
|
{
|
|
279
325
|
role: "buffer",
|
|
@@ -281,49 +327,50 @@ const S = /* @__PURE__ */ new WeakMap(), c = (t) => {
|
|
|
281
327
|
optional: !1
|
|
282
328
|
}
|
|
283
329
|
];
|
|
284
|
-
if (
|
|
285
|
-
const a =
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
330
|
+
if (i.isObject() && i.getProperties().length === 0) {
|
|
331
|
+
const a = i.getAliasTypeArguments()[1] ?? i.getStringIndexType();
|
|
332
|
+
if (a)
|
|
333
|
+
return [
|
|
334
|
+
{
|
|
335
|
+
role: "record",
|
|
336
|
+
shape: f(a, n, o),
|
|
337
|
+
optional: !1
|
|
338
|
+
}
|
|
339
|
+
];
|
|
293
340
|
}
|
|
294
|
-
if (
|
|
295
|
-
return
|
|
296
|
-
const
|
|
297
|
-
if (!
|
|
341
|
+
if (i.isObject())
|
|
342
|
+
return i.getText() === "Date" ? "Date" : i.getProperties().map((a) => {
|
|
343
|
+
const u = a.getValueDeclaration() || a.getDeclarations()[0];
|
|
344
|
+
if (!u)
|
|
298
345
|
return {
|
|
299
346
|
role: "property",
|
|
300
347
|
identifier: a.getName(),
|
|
301
|
-
shape:
|
|
348
|
+
shape: f(a.getTypeAtLocation(n), n, o),
|
|
302
349
|
optional: !1
|
|
303
350
|
};
|
|
304
|
-
if (!(
|
|
351
|
+
if (!(u.asKind(e.PropertySignature) || u.asKind(e.PropertyAssignment) || u.asKind(e.ShorthandPropertyAssignment)))
|
|
305
352
|
return {
|
|
306
353
|
role: "property",
|
|
307
354
|
identifier: a.getName(),
|
|
308
|
-
shape:
|
|
355
|
+
shape: f(a.getTypeAtLocation(n), n, o),
|
|
309
356
|
optional: !1
|
|
310
357
|
};
|
|
311
|
-
const d = a.getTypeAtLocation(
|
|
358
|
+
const d = a.getTypeAtLocation(n).isNullable(), g = f(a.getTypeAtLocation(n), n, o);
|
|
312
359
|
return {
|
|
313
360
|
role: "property",
|
|
314
361
|
identifier: a.getName(),
|
|
315
|
-
shape:
|
|
362
|
+
shape: g,
|
|
316
363
|
optional: d
|
|
317
364
|
};
|
|
318
365
|
}).filter((a) => a.shape !== "undefined");
|
|
319
|
-
if (
|
|
320
|
-
const
|
|
366
|
+
if (i.isUnion()) {
|
|
367
|
+
const u = i.getUnionTypes().map((g) => ({
|
|
321
368
|
role: "union_entry",
|
|
322
|
-
shape:
|
|
369
|
+
shape: f(g, n, o),
|
|
323
370
|
optional: !1
|
|
324
371
|
})).filter(
|
|
325
|
-
(
|
|
326
|
-
), s =
|
|
372
|
+
(g, h, S) => !S.find((F, x) => F.shape === g.shape && x > h)
|
|
373
|
+
), s = u.some((g) => g.shape === "undefined"), d = u.filter((g) => g.shape !== "undefined");
|
|
327
374
|
return d.length === 1 ? d[0].shape : [
|
|
328
375
|
{
|
|
329
376
|
role: "union",
|
|
@@ -332,40 +379,48 @@ const S = /* @__PURE__ */ new WeakMap(), c = (t) => {
|
|
|
332
379
|
}
|
|
333
380
|
];
|
|
334
381
|
}
|
|
335
|
-
if (
|
|
336
|
-
return
|
|
337
|
-
const
|
|
338
|
-
return
|
|
339
|
-
},
|
|
382
|
+
if (i.isIntersection())
|
|
383
|
+
return i.getIntersectionTypes().map((s) => f(s, n, o)).filter((s) => typeof s != "string").reduce((s, d) => [...s, ...d], []);
|
|
384
|
+
const p = n.getSourceFile().getFilePath().split("/").pop();
|
|
385
|
+
return m.warn(`[${p}] Unknown type shape node ${t.getText()}`), "unknown_5";
|
|
386
|
+
}, b = (t) => {
|
|
340
387
|
if (t.isKind(e.Identifier))
|
|
341
|
-
return
|
|
388
|
+
return b(c(t));
|
|
342
389
|
if (t.isKind(e.StringLiteral))
|
|
343
390
|
return t.getLiteralValue();
|
|
344
391
|
if (t.isKind(e.ArrayLiteralExpression))
|
|
345
|
-
return t.forEachChildAsArray().map((
|
|
392
|
+
return t.forEachChildAsArray().map((r) => b(r));
|
|
346
393
|
if (t.isKind(e.PropertyAccessExpression))
|
|
347
|
-
return
|
|
394
|
+
return b(C(t));
|
|
348
395
|
if (t.isKind(e.ObjectLiteralExpression))
|
|
349
|
-
return
|
|
350
|
-
const
|
|
351
|
-
return
|
|
352
|
-
},
|
|
353
|
-
const
|
|
396
|
+
return _(t);
|
|
397
|
+
const n = t.getSourceFile().getFilePath().split("/").pop();
|
|
398
|
+
return m.dev(`[${n}] Unknown literal value node ${t.getKindName()}`), "unknown_6";
|
|
399
|
+
}, Q = (t) => {
|
|
400
|
+
const n = t.getFirstDescendantByKind(e.CallExpression);
|
|
401
|
+
if (!n) return null;
|
|
402
|
+
const r = n.getArguments()[0];
|
|
403
|
+
if (!r) return null;
|
|
404
|
+
const l = r.getType();
|
|
405
|
+
return l.isStringLiteral() ? l.getLiteralValue() : null;
|
|
406
|
+
}, _ = (t) => t.getFirstDescendantByKind(e.SyntaxList).getChildrenOfKind(e.PropertyAssignment).map((i) => {
|
|
407
|
+
const p = i.getFirstDescendantByKind(e.Identifier).getText(), a = i.getLastChild(), u = c(a), s = b(u);
|
|
354
408
|
return {
|
|
355
|
-
identifier:
|
|
409
|
+
identifier: p,
|
|
356
410
|
value: s
|
|
357
411
|
};
|
|
358
412
|
}) || [];
|
|
359
413
|
export {
|
|
360
414
|
c as findNodeImplementation,
|
|
361
|
-
|
|
362
|
-
|
|
415
|
+
C as findPropertyAssignmentValueNode,
|
|
416
|
+
f as getProperTypeShape,
|
|
363
417
|
y as getRecursiveNodeShape,
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
418
|
+
z as getShapeOfValidatorLiteral,
|
|
419
|
+
P as getTypeReferenceShape,
|
|
420
|
+
V as getValidatorPropertyOptionality,
|
|
421
|
+
N as getValidatorPropertyShape,
|
|
422
|
+
K as getValidatorPropertyStringValue,
|
|
423
|
+
_ as getValuesOfObjectLiteral,
|
|
424
|
+
Q as resolveEndpointPath
|
|
370
425
|
};
|
|
371
426
|
//# sourceMappingURL=nodeParsers.mjs.map
|