prismic-ts-codegen 0.1.28 → 0.1.29
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/dist/_virtual/_rolldown/runtime.cjs +23 -0
- package/dist/cli/configSchema.cjs +29 -36
- package/dist/cli/configSchema.cjs.map +1 -1
- package/dist/cli/configSchema.d.cts +39 -0
- package/dist/cli/configSchema.d.cts.map +1 -0
- package/dist/cli/configSchema.d.ts +39 -3
- package/dist/cli/configSchema.d.ts.map +1 -0
- package/dist/cli/configSchema.js +29 -37
- package/dist/cli/configSchema.js.map +1 -1
- package/dist/cli/constants.cjs +4 -3
- package/dist/cli/constants.cjs.map +1 -1
- package/dist/cli/constants.d.cts +5 -0
- package/dist/cli/constants.d.cts.map +1 -0
- package/dist/cli/constants.d.ts +5 -1
- package/dist/cli/constants.d.ts.map +1 -0
- package/dist/cli/constants.js +5 -4
- package/dist/cli/constants.js.map +1 -1
- package/dist/cli/loadConfig.cjs +17 -27
- package/dist/cli/loadConfig.cjs.map +1 -1
- package/dist/cli/loadConfig.js +13 -25
- package/dist/cli/loadConfig.js.map +1 -1
- package/dist/cli/loadLocaleIDs.cjs +18 -17
- package/dist/cli/loadLocaleIDs.cjs.map +1 -1
- package/dist/cli/loadLocaleIDs.js +16 -18
- package/dist/cli/loadLocaleIDs.js.map +1 -1
- package/dist/cli/loadModels.cjs +45 -70
- package/dist/cli/loadModels.cjs.map +1 -1
- package/dist/cli/loadModels.js +40 -52
- package/dist/cli/loadModels.js.map +1 -1
- package/dist/cli.cjs +78 -91
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.d.cts +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +68 -81
- package/dist/cli.js.map +1 -1
- package/dist/constants.cjs +26 -25
- package/dist/constants.cjs.map +1 -1
- package/dist/constants.js +27 -28
- package/dist/constants.js.map +1 -1
- package/dist/detectTypesProvider.cjs +22 -17
- package/dist/detectTypesProvider.cjs.map +1 -1
- package/dist/detectTypesProvider.d.cts +17 -0
- package/dist/detectTypesProvider.d.cts.map +1 -0
- package/dist/detectTypesProvider.d.ts +10 -6
- package/dist/detectTypesProvider.d.ts.map +1 -0
- package/dist/detectTypesProvider.js +21 -17
- package/dist/detectTypesProvider.js.map +1 -1
- package/dist/generateTypes.cjs +76 -85
- package/dist/generateTypes.cjs.map +1 -1
- package/dist/generateTypes.d.cts +21 -0
- package/dist/generateTypes.d.cts.map +1 -0
- package/dist/generateTypes.d.ts +20 -15
- package/dist/generateTypes.d.ts.map +1 -0
- package/dist/generateTypes.js +70 -81
- package/dist/generateTypes.js.map +1 -1
- package/dist/index.cjs +6 -8
- package/dist/index.d.cts +5 -0
- package/dist/index.d.ts +5 -6
- package/dist/index.js +1 -6
- package/dist/lib/addBlankLine.cjs +7 -9
- package/dist/lib/addBlankLine.cjs.map +1 -1
- package/dist/lib/addBlankLine.js +7 -9
- package/dist/lib/addBlankLine.js.map +1 -1
- package/dist/lib/addLine.cjs +6 -5
- package/dist/lib/addLine.cjs.map +1 -1
- package/dist/lib/addLine.js +6 -5
- package/dist/lib/addLine.js.map +1 -1
- package/dist/lib/addSection.cjs +6 -5
- package/dist/lib/addSection.cjs.map +1 -1
- package/dist/lib/addSection.js +6 -5
- package/dist/lib/addSection.js.map +1 -1
- package/dist/lib/addTrailingNewLine.cjs +6 -8
- package/dist/lib/addTrailingNewLine.cjs.map +1 -1
- package/dist/lib/addTrailingNewLine.js +7 -9
- package/dist/lib/addTrailingNewLine.js.map +1 -1
- package/dist/lib/buildCustomTypeDataType.cjs +41 -44
- package/dist/lib/buildCustomTypeDataType.cjs.map +1 -1
- package/dist/lib/buildCustomTypeDataType.js +39 -43
- package/dist/lib/buildCustomTypeDataType.js.map +1 -1
- package/dist/lib/buildCustomTypeType.cjs +50 -50
- package/dist/lib/buildCustomTypeType.cjs.map +1 -1
- package/dist/lib/buildCustomTypeType.js +44 -45
- package/dist/lib/buildCustomTypeType.js.map +1 -1
- package/dist/lib/buildFieldDocs.cjs +59 -92
- package/dist/lib/buildFieldDocs.cjs.map +1 -1
- package/dist/lib/buildFieldDocs.js +56 -89
- package/dist/lib/buildFieldDocs.js.map +1 -1
- package/dist/lib/buildFieldProperties.cjs +255 -309
- package/dist/lib/buildFieldProperties.cjs.map +1 -1
- package/dist/lib/buildFieldProperties.js +249 -304
- package/dist/lib/buildFieldProperties.js.map +1 -1
- package/dist/lib/buildSharedSliceType.cjs +106 -109
- package/dist/lib/buildSharedSliceType.cjs.map +1 -1
- package/dist/lib/buildSharedSliceType.js +98 -102
- package/dist/lib/buildSharedSliceType.js.map +1 -1
- package/dist/lib/buildTypeName.cjs +9 -11
- package/dist/lib/buildTypeName.cjs.map +1 -1
- package/dist/lib/buildTypeName.js +8 -11
- package/dist/lib/buildTypeName.js.map +1 -1
- package/dist/lib/buildUnion.cjs +5 -4
- package/dist/lib/buildUnion.cjs.map +1 -1
- package/dist/lib/buildUnion.js +6 -5
- package/dist/lib/buildUnion.js.map +1 -1
- package/dist/lib/checkHasUIDFIeld.cjs +5 -4
- package/dist/lib/checkHasUIDFIeld.cjs.map +1 -1
- package/dist/lib/checkHasUIDFIeld.js +6 -5
- package/dist/lib/checkHasUIDFIeld.js.map +1 -1
- package/dist/lib/getAPIIDPath.cjs +21 -23
- package/dist/lib/getAPIIDPath.cjs.map +1 -1
- package/dist/lib/getAPIIDPath.js +22 -24
- package/dist/lib/getAPIIDPath.js.map +1 -1
- package/dist/lib/getCacheKey.cjs +14 -22
- package/dist/lib/getCacheKey.cjs.map +1 -1
- package/dist/lib/getCacheKey.js +12 -5
- package/dist/lib/getCacheKey.js.map +1 -1
- package/dist/lib/getHumanReadableModelName.cjs +12 -17
- package/dist/lib/getHumanReadableModelName.cjs.map +1 -1
- package/dist/lib/getHumanReadableModelName.js +13 -18
- package/dist/lib/getHumanReadableModelName.js.map +1 -1
- package/dist/lib/getHumanReadablePath.cjs +13 -16
- package/dist/lib/getHumanReadablePath.cjs.map +1 -1
- package/dist/lib/getHumanReadablePath.js +13 -16
- package/dist/lib/getHumanReadablePath.js.map +1 -1
- package/dist/types.d.cts +14 -0
- package/dist/types.d.cts.map +1 -0
- package/dist/types.d.ts +13 -21
- package/dist/types.d.ts.map +1 -0
- package/package.json +35 -49
- package/src/cli/configSchema.ts +181 -50
- package/src/cli/constants.ts +1 -2
- package/src/cli/index.ts +14 -24
- package/src/cli/loadConfig.ts +5 -9
- package/src/cli/loadLocaleIDs.ts +1 -3
- package/src/cli/loadModels.ts +8 -10
- package/src/constants.ts +1 -2
- package/src/detectTypesProvider.ts +3 -8
- package/src/generateTypes.ts +3 -10
- package/src/index.ts +1 -2
- package/src/lib/addBlankLine.ts +1 -1
- package/src/lib/addLine.ts +1 -1
- package/src/lib/addSection.ts +1 -1
- package/src/lib/addTrailingNewLine.ts +1 -4
- package/src/lib/buildCustomTypeDataType.ts +1 -3
- package/src/lib/buildCustomTypeType.ts +4 -6
- package/src/lib/buildFieldDocs.ts +7 -23
- package/src/lib/buildFieldProperties.ts +25 -66
- package/src/lib/buildSharedSliceType.ts +8 -10
- package/src/lib/buildTypeName.ts +1 -1
- package/src/lib/buildUnion.ts +1 -1
- package/src/lib/getAPIIDPath.ts +2 -2
- package/src/lib/getCacheKey.ts +1 -3
- package/src/lib/getHumanReadableModelName.ts +2 -8
- package/src/lib/getHumanReadablePath.ts +2 -3
- package/src/types.ts +1 -5
- package/dist/_node_modules/@babel/code-frame/lib/index.cjs +0 -217
- package/dist/_node_modules/@babel/code-frame/lib/index.cjs.map +0 -1
- package/dist/_node_modules/@babel/code-frame/lib/index.js +0 -216
- package/dist/_node_modules/@babel/code-frame/lib/index.js.map +0 -1
- package/dist/_node_modules/@babel/helper-validator-identifier/lib/identifier.cjs +0 -82
- package/dist/_node_modules/@babel/helper-validator-identifier/lib/identifier.cjs.map +0 -1
- package/dist/_node_modules/@babel/helper-validator-identifier/lib/identifier.js +0 -83
- package/dist/_node_modules/@babel/helper-validator-identifier/lib/identifier.js.map +0 -1
- package/dist/_node_modules/@babel/helper-validator-identifier/lib/index.cjs +0 -62
- package/dist/_node_modules/@babel/helper-validator-identifier/lib/index.cjs.map +0 -1
- package/dist/_node_modules/@babel/helper-validator-identifier/lib/index.js +0 -61
- package/dist/_node_modules/@babel/helper-validator-identifier/lib/index.js.map +0 -1
- package/dist/_node_modules/@babel/helper-validator-identifier/lib/keyword.cjs +0 -35
- package/dist/_node_modules/@babel/helper-validator-identifier/lib/keyword.cjs.map +0 -1
- package/dist/_node_modules/@babel/helper-validator-identifier/lib/keyword.js +0 -36
- package/dist/_node_modules/@babel/helper-validator-identifier/lib/keyword.js.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/Client.cjs +0 -1231
- package/dist/_node_modules/@prismicio/client/dist/Client.cjs.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/Client.js +0 -1231
- package/dist/_node_modules/@prismicio/client/dist/Client.js.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/buildQueryURL.cjs +0 -66
- package/dist/_node_modules/@prismicio/client/dist/buildQueryURL.cjs.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/buildQueryURL.js +0 -66
- package/dist/_node_modules/@prismicio/client/dist/buildQueryURL.js.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/cookie.cjs +0 -5
- package/dist/_node_modules/@prismicio/client/dist/cookie.cjs.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/cookie.js +0 -5
- package/dist/_node_modules/@prismicio/client/dist/cookie.js.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/createClient.cjs +0 -6
- package/dist/_node_modules/@prismicio/client/dist/createClient.cjs.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/createClient.js +0 -6
- package/dist/_node_modules/@prismicio/client/dist/createClient.js.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/errors/ForbiddenError.cjs +0 -7
- package/dist/_node_modules/@prismicio/client/dist/errors/ForbiddenError.cjs.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/errors/ForbiddenError.js +0 -7
- package/dist/_node_modules/@prismicio/client/dist/errors/ForbiddenError.js.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/errors/NotFoundError.cjs +0 -7
- package/dist/_node_modules/@prismicio/client/dist/errors/NotFoundError.cjs.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/errors/NotFoundError.js +0 -7
- package/dist/_node_modules/@prismicio/client/dist/errors/NotFoundError.js.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/errors/ParsingError.cjs +0 -7
- package/dist/_node_modules/@prismicio/client/dist/errors/ParsingError.cjs.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/errors/ParsingError.js +0 -7
- package/dist/_node_modules/@prismicio/client/dist/errors/ParsingError.js.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/errors/PreviewTokenExpired.cjs +0 -7
- package/dist/_node_modules/@prismicio/client/dist/errors/PreviewTokenExpired.cjs.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/errors/PreviewTokenExpired.js +0 -7
- package/dist/_node_modules/@prismicio/client/dist/errors/PreviewTokenExpired.js.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/errors/PrismicError.cjs +0 -16
- package/dist/_node_modules/@prismicio/client/dist/errors/PrismicError.cjs.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/errors/PrismicError.js +0 -16
- package/dist/_node_modules/@prismicio/client/dist/errors/PrismicError.js.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/errors/RefExpiredError.cjs +0 -7
- package/dist/_node_modules/@prismicio/client/dist/errors/RefExpiredError.cjs.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/errors/RefExpiredError.js +0 -7
- package/dist/_node_modules/@prismicio/client/dist/errors/RefExpiredError.js.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/errors/RefNotFoundError.cjs +0 -7
- package/dist/_node_modules/@prismicio/client/dist/errors/RefNotFoundError.cjs.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/errors/RefNotFoundError.js +0 -7
- package/dist/_node_modules/@prismicio/client/dist/errors/RefNotFoundError.js.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/errors/RepositoryNotFoundError.cjs +0 -7
- package/dist/_node_modules/@prismicio/client/dist/errors/RepositoryNotFoundError.cjs.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/errors/RepositoryNotFoundError.js +0 -7
- package/dist/_node_modules/@prismicio/client/dist/errors/RepositoryNotFoundError.js.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/filter.cjs +0 -247
- package/dist/_node_modules/@prismicio/client/dist/filter.cjs.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/filter.js +0 -247
- package/dist/_node_modules/@prismicio/client/dist/filter.js.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/getRepositoryEndpoint.cjs +0 -13
- package/dist/_node_modules/@prismicio/client/dist/getRepositoryEndpoint.cjs.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/getRepositoryEndpoint.js +0 -13
- package/dist/_node_modules/@prismicio/client/dist/getRepositoryEndpoint.js.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/getRepositoryName.cjs +0 -17
- package/dist/_node_modules/@prismicio/client/dist/getRepositoryName.cjs.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/getRepositoryName.js +0 -17
- package/dist/_node_modules/@prismicio/client/dist/getRepositoryName.js.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/helpers/asLink.cjs +0 -47
- package/dist/_node_modules/@prismicio/client/dist/helpers/asLink.cjs.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/helpers/asLink.js +0 -47
- package/dist/_node_modules/@prismicio/client/dist/helpers/asLink.js.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/helpers/documentToLinkField.cjs +0 -27
- package/dist/_node_modules/@prismicio/client/dist/helpers/documentToLinkField.cjs.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/helpers/documentToLinkField.js +0 -27
- package/dist/_node_modules/@prismicio/client/dist/helpers/documentToLinkField.js.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/isRepositoryEndpoint.cjs +0 -12
- package/dist/_node_modules/@prismicio/client/dist/isRepositoryEndpoint.cjs.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/isRepositoryEndpoint.js +0 -12
- package/dist/_node_modules/@prismicio/client/dist/isRepositoryEndpoint.js.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/isRepositoryName.cjs +0 -7
- package/dist/_node_modules/@prismicio/client/dist/isRepositoryName.cjs.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/isRepositoryName.js +0 -7
- package/dist/_node_modules/@prismicio/client/dist/isRepositoryName.js.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/lib/appendFilters.cjs +0 -11
- package/dist/_node_modules/@prismicio/client/dist/lib/appendFilters.cjs.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/lib/appendFilters.js +0 -11
- package/dist/_node_modules/@prismicio/client/dist/lib/appendFilters.js.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/lib/castArray.cjs +0 -7
- package/dist/_node_modules/@prismicio/client/dist/lib/castArray.cjs.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/lib/castArray.js +0 -7
- package/dist/_node_modules/@prismicio/client/dist/lib/castArray.js.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/lib/castThunk.cjs +0 -7
- package/dist/_node_modules/@prismicio/client/dist/lib/castThunk.cjs.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/lib/castThunk.js +0 -7
- package/dist/_node_modules/@prismicio/client/dist/lib/castThunk.js.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/lib/devMsg.cjs +0 -8
- package/dist/_node_modules/@prismicio/client/dist/lib/devMsg.cjs.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/lib/devMsg.js +0 -8
- package/dist/_node_modules/@prismicio/client/dist/lib/devMsg.js.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/lib/everyTagFilter.cjs +0 -9
- package/dist/_node_modules/@prismicio/client/dist/lib/everyTagFilter.cjs.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/lib/everyTagFilter.js +0 -9
- package/dist/_node_modules/@prismicio/client/dist/lib/everyTagFilter.js.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/lib/findMasterRef.cjs +0 -8
- package/dist/_node_modules/@prismicio/client/dist/lib/findMasterRef.cjs.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/lib/findMasterRef.js +0 -8
- package/dist/_node_modules/@prismicio/client/dist/lib/findMasterRef.js.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/lib/findRef.cjs +0 -12
- package/dist/_node_modules/@prismicio/client/dist/lib/findRef.cjs.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/lib/findRef.js +0 -12
- package/dist/_node_modules/@prismicio/client/dist/lib/findRef.js.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/lib/findRefByID.cjs +0 -8
- package/dist/_node_modules/@prismicio/client/dist/lib/findRefByID.cjs.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/lib/findRefByID.js +0 -8
- package/dist/_node_modules/@prismicio/client/dist/lib/findRefByID.js.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/lib/findRefByLabel.cjs +0 -8
- package/dist/_node_modules/@prismicio/client/dist/lib/findRefByLabel.cjs.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/lib/findRefByLabel.js +0 -8
- package/dist/_node_modules/@prismicio/client/dist/lib/findRefByLabel.js.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/lib/getPreviewCookie.cjs +0 -21
- package/dist/_node_modules/@prismicio/client/dist/lib/getPreviewCookie.cjs.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/lib/getPreviewCookie.js +0 -21
- package/dist/_node_modules/@prismicio/client/dist/lib/getPreviewCookie.js.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/lib/minifyGraphQLQuery.cjs +0 -7
- package/dist/_node_modules/@prismicio/client/dist/lib/minifyGraphQLQuery.cjs.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/lib/minifyGraphQLQuery.js +0 -7
- package/dist/_node_modules/@prismicio/client/dist/lib/minifyGraphQLQuery.js.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/lib/pLimit.cjs +0 -49
- package/dist/_node_modules/@prismicio/client/dist/lib/pLimit.cjs.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/lib/pLimit.js +0 -49
- package/dist/_node_modules/@prismicio/client/dist/lib/pLimit.js.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/lib/request.cjs +0 -43
- package/dist/_node_modules/@prismicio/client/dist/lib/request.cjs.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/lib/request.js +0 -43
- package/dist/_node_modules/@prismicio/client/dist/lib/request.js.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/lib/someTagsFilter.cjs +0 -9
- package/dist/_node_modules/@prismicio/client/dist/lib/someTagsFilter.cjs.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/lib/someTagsFilter.js +0 -9
- package/dist/_node_modules/@prismicio/client/dist/lib/someTagsFilter.js.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/lib/throttledLog.cjs +0 -17
- package/dist/_node_modules/@prismicio/client/dist/lib/throttledLog.cjs.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/lib/throttledLog.js +0 -17
- package/dist/_node_modules/@prismicio/client/dist/lib/throttledLog.js.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/lib/typeFilter.cjs +0 -8
- package/dist/_node_modules/@prismicio/client/dist/lib/typeFilter.cjs.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/lib/typeFilter.js +0 -8
- package/dist/_node_modules/@prismicio/client/dist/lib/typeFilter.js.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/package.json.cjs +0 -5
- package/dist/_node_modules/@prismicio/client/dist/package.json.cjs.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/package.json.js +0 -5
- package/dist/_node_modules/@prismicio/client/dist/package.json.js.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/types/model/types.cjs +0 -39
- package/dist/_node_modules/@prismicio/client/dist/types/model/types.cjs.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/types/model/types.js +0 -39
- package/dist/_node_modules/@prismicio/client/dist/types/model/types.js.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/types/value/link.cjs +0 -10
- package/dist/_node_modules/@prismicio/client/dist/types/value/link.cjs.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/types/value/link.js +0 -10
- package/dist/_node_modules/@prismicio/client/dist/types/value/link.js.map +0 -1
- package/dist/_node_modules/arrify/index.cjs +0 -10
- package/dist/_node_modules/arrify/index.cjs.map +0 -1
- package/dist/_node_modules/arrify/index.js +0 -10
- package/dist/_node_modules/arrify/index.js.map +0 -1
- package/dist/_node_modules/camelcase/index.cjs +0 -83
- package/dist/_node_modules/camelcase/index.cjs.map +0 -1
- package/dist/_node_modules/camelcase/index.js +0 -84
- package/dist/_node_modules/camelcase/index.js.map +0 -1
- package/dist/_node_modules/camelcase-keys/index.cjs +0 -55
- package/dist/_node_modules/camelcase-keys/index.cjs.map +0 -1
- package/dist/_node_modules/camelcase-keys/index.js +0 -56
- package/dist/_node_modules/camelcase-keys/index.js.map +0 -1
- package/dist/_node_modules/data-uri-to-buffer/dist/index.cjs +0 -41
- package/dist/_node_modules/data-uri-to-buffer/dist/index.cjs.map +0 -1
- package/dist/_node_modules/data-uri-to-buffer/dist/index.js +0 -41
- package/dist/_node_modules/data-uri-to-buffer/dist/index.js.map +0 -1
- package/dist/_node_modules/decamelize/index.cjs +0 -38
- package/dist/_node_modules/decamelize/index.cjs.map +0 -1
- package/dist/_node_modules/decamelize/index.js +0 -39
- package/dist/_node_modules/decamelize/index.js.map +0 -1
- package/dist/_node_modules/decamelize-keys/index.cjs +0 -50
- package/dist/_node_modules/decamelize-keys/index.cjs.map +0 -1
- package/dist/_node_modules/decamelize-keys/index.js +0 -51
- package/dist/_node_modules/decamelize-keys/index.js.map +0 -1
- package/dist/_node_modules/error-ex/index.cjs +0 -109
- package/dist/_node_modules/error-ex/index.cjs.map +0 -1
- package/dist/_node_modules/error-ex/index.js +0 -109
- package/dist/_node_modules/error-ex/index.js.map +0 -1
- package/dist/_node_modules/fetch-blob/file.cjs +0 -61
- package/dist/_node_modules/fetch-blob/file.cjs.map +0 -1
- package/dist/_node_modules/fetch-blob/file.js +0 -61
- package/dist/_node_modules/fetch-blob/file.js.map +0 -1
- package/dist/_node_modules/fetch-blob/index.cjs +0 -223
- package/dist/_node_modules/fetch-blob/index.cjs.map +0 -1
- package/dist/_node_modules/fetch-blob/index.js +0 -223
- package/dist/_node_modules/fetch-blob/index.js.map +0 -1
- package/dist/_node_modules/fetch-blob/streams.cjs +0 -43
- package/dist/_node_modules/fetch-blob/streams.cjs.map +0 -1
- package/dist/_node_modules/fetch-blob/streams.js +0 -42
- package/dist/_node_modules/fetch-blob/streams.js.map +0 -1
- package/dist/_node_modules/formdata-polyfill/esm.min.cjs +0 -116
- package/dist/_node_modules/formdata-polyfill/esm.min.cjs.map +0 -1
- package/dist/_node_modules/formdata-polyfill/esm.min.js +0 -116
- package/dist/_node_modules/formdata-polyfill/esm.min.js.map +0 -1
- package/dist/_node_modules/function-bind/implementation.cjs +0 -47
- package/dist/_node_modules/function-bind/implementation.cjs.map +0 -1
- package/dist/_node_modules/function-bind/implementation.js +0 -47
- package/dist/_node_modules/function-bind/implementation.js.map +0 -1
- package/dist/_node_modules/function-bind/index.cjs +0 -7
- package/dist/_node_modules/function-bind/index.cjs.map +0 -1
- package/dist/_node_modules/function-bind/index.js +0 -7
- package/dist/_node_modules/function-bind/index.js.map +0 -1
- package/dist/_node_modules/hard-rejection/index.cjs +0 -25
- package/dist/_node_modules/hard-rejection/index.cjs.map +0 -1
- package/dist/_node_modules/hard-rejection/index.js +0 -26
- package/dist/_node_modules/hard-rejection/index.js.map +0 -1
- package/dist/_node_modules/has/src/index.cjs +0 -7
- package/dist/_node_modules/has/src/index.cjs.map +0 -1
- package/dist/_node_modules/has/src/index.js +0 -7
- package/dist/_node_modules/has/src/index.js.map +0 -1
- package/dist/_node_modules/hosted-git-info/lib/from-url.cjs +0 -93
- package/dist/_node_modules/hosted-git-info/lib/from-url.cjs.map +0 -1
- package/dist/_node_modules/hosted-git-info/lib/from-url.js +0 -93
- package/dist/_node_modules/hosted-git-info/lib/from-url.js.map +0 -1
- package/dist/_node_modules/hosted-git-info/lib/hosts.cjs +0 -164
- package/dist/_node_modules/hosted-git-info/lib/hosts.cjs.map +0 -1
- package/dist/_node_modules/hosted-git-info/lib/hosts.js +0 -164
- package/dist/_node_modules/hosted-git-info/lib/hosts.js.map +0 -1
- package/dist/_node_modules/hosted-git-info/lib/index.cjs +0 -168
- package/dist/_node_modules/hosted-git-info/lib/index.cjs.map +0 -1
- package/dist/_node_modules/hosted-git-info/lib/index.js +0 -168
- package/dist/_node_modules/hosted-git-info/lib/index.js.map +0 -1
- package/dist/_node_modules/hosted-git-info/lib/parse-url.cjs +0 -51
- package/dist/_node_modules/hosted-git-info/lib/parse-url.cjs.map +0 -1
- package/dist/_node_modules/hosted-git-info/lib/parse-url.js +0 -51
- package/dist/_node_modules/hosted-git-info/lib/parse-url.js.map +0 -1
- package/dist/_node_modules/indent-string/index.cjs +0 -34
- package/dist/_node_modules/indent-string/index.cjs.map +0 -1
- package/dist/_node_modules/indent-string/index.js +0 -35
- package/dist/_node_modules/indent-string/index.js.map +0 -1
- package/dist/_node_modules/is-arrayish/index.cjs +0 -10
- package/dist/_node_modules/is-arrayish/index.cjs.map +0 -1
- package/dist/_node_modules/is-arrayish/index.js +0 -10
- package/dist/_node_modules/is-arrayish/index.js.map +0 -1
- package/dist/_node_modules/is-core-module/core.json.cjs +0 -496
- package/dist/_node_modules/is-core-module/core.json.cjs.map +0 -1
- package/dist/_node_modules/is-core-module/core.json.js +0 -496
- package/dist/_node_modules/is-core-module/core.json.js.map +0 -1
- package/dist/_node_modules/is-core-module/index.cjs +0 -62
- package/dist/_node_modules/is-core-module/index.cjs.map +0 -1
- package/dist/_node_modules/is-core-module/index.js +0 -62
- package/dist/_node_modules/is-core-module/index.js.map +0 -1
- package/dist/_node_modules/is-plain-obj/index.cjs +0 -9
- package/dist/_node_modules/is-plain-obj/index.cjs.map +0 -1
- package/dist/_node_modules/is-plain-obj/index.js +0 -9
- package/dist/_node_modules/is-plain-obj/index.js.map +0 -1
- package/dist/_node_modules/js-tokens/index.cjs +0 -27
- package/dist/_node_modules/js-tokens/index.cjs.map +0 -1
- package/dist/_node_modules/js-tokens/index.js +0 -26
- package/dist/_node_modules/js-tokens/index.js.map +0 -1
- package/dist/_node_modules/json-parse-even-better-errors/index.cjs +0 -90
- package/dist/_node_modules/json-parse-even-better-errors/index.cjs.map +0 -1
- package/dist/_node_modules/json-parse-even-better-errors/index.js +0 -90
- package/dist/_node_modules/json-parse-even-better-errors/index.js.map +0 -1
- package/dist/_node_modules/kind-of/index.cjs +0 -129
- package/dist/_node_modules/kind-of/index.cjs.map +0 -1
- package/dist/_node_modules/kind-of/index.js +0 -129
- package/dist/_node_modules/kind-of/index.js.map +0 -1
- package/dist/_node_modules/lines-and-columns/build/index.cjs +0 -67
- package/dist/_node_modules/lines-and-columns/build/index.cjs.map +0 -1
- package/dist/_node_modules/lines-and-columns/build/index.js +0 -66
- package/dist/_node_modules/lines-and-columns/build/index.js.map +0 -1
- package/dist/_node_modules/lru-cache/index.cjs +0 -1015
- package/dist/_node_modules/lru-cache/index.cjs.map +0 -1
- package/dist/_node_modules/lru-cache/index.js +0 -1015
- package/dist/_node_modules/lru-cache/index.js.map +0 -1
- package/dist/_node_modules/map-obj/index.cjs +0 -49
- package/dist/_node_modules/map-obj/index.cjs.map +0 -1
- package/dist/_node_modules/map-obj/index.js +0 -50
- package/dist/_node_modules/map-obj/index.js.map +0 -1
- package/dist/_node_modules/meow/source/index.cjs +0 -88
- package/dist/_node_modules/meow/source/index.cjs.map +0 -1
- package/dist/_node_modules/meow/source/index.js +0 -89
- package/dist/_node_modules/meow/source/index.js.map +0 -1
- package/dist/_node_modules/meow/source/options.cjs +0 -83
- package/dist/_node_modules/meow/source/options.cjs.map +0 -1
- package/dist/_node_modules/meow/source/options.js +0 -83
- package/dist/_node_modules/meow/source/options.js.map +0 -1
- package/dist/_node_modules/meow/source/parser.cjs +0 -61
- package/dist/_node_modules/meow/source/parser.cjs.map +0 -1
- package/dist/_node_modules/meow/source/parser.js +0 -61
- package/dist/_node_modules/meow/source/parser.js.map +0 -1
- package/dist/_node_modules/meow/source/utils.cjs +0 -8
- package/dist/_node_modules/meow/source/utils.cjs.map +0 -1
- package/dist/_node_modules/meow/source/utils.js +0 -8
- package/dist/_node_modules/meow/source/utils.js.map +0 -1
- package/dist/_node_modules/meow/source/validate.cjs +0 -102
- package/dist/_node_modules/meow/source/validate.cjs.map +0 -1
- package/dist/_node_modules/meow/source/validate.js +0 -102
- package/dist/_node_modules/meow/source/validate.js.map +0 -1
- package/dist/_node_modules/min-indent/index.cjs +0 -12
- package/dist/_node_modules/min-indent/index.cjs.map +0 -1
- package/dist/_node_modules/min-indent/index.js +0 -13
- package/dist/_node_modules/min-indent/index.js.map +0 -1
- package/dist/_node_modules/minimist-options/index.cjs +0 -94
- package/dist/_node_modules/minimist-options/index.cjs.map +0 -1
- package/dist/_node_modules/minimist-options/index.js +0 -95
- package/dist/_node_modules/minimist-options/index.js.map +0 -1
- package/dist/_node_modules/node-domexception/index.cjs +0 -11
- package/dist/_node_modules/node-domexception/index.cjs.map +0 -1
- package/dist/_node_modules/node-domexception/index.js +0 -10
- package/dist/_node_modules/node-domexception/index.js.map +0 -1
- package/dist/_node_modules/node-fetch/src/body.cjs +0 -262
- package/dist/_node_modules/node-fetch/src/body.cjs.map +0 -1
- package/dist/_node_modules/node-fetch/src/body.js +0 -262
- package/dist/_node_modules/node-fetch/src/body.js.map +0 -1
- package/dist/_node_modules/node-fetch/src/errors/abort-error.cjs +0 -10
- package/dist/_node_modules/node-fetch/src/errors/abort-error.cjs.map +0 -1
- package/dist/_node_modules/node-fetch/src/errors/abort-error.js +0 -10
- package/dist/_node_modules/node-fetch/src/errors/abort-error.js.map +0 -1
- package/dist/_node_modules/node-fetch/src/errors/base.cjs +0 -17
- package/dist/_node_modules/node-fetch/src/errors/base.cjs.map +0 -1
- package/dist/_node_modules/node-fetch/src/errors/base.js +0 -17
- package/dist/_node_modules/node-fetch/src/errors/base.js.map +0 -1
- package/dist/_node_modules/node-fetch/src/errors/fetch-error.cjs +0 -19
- package/dist/_node_modules/node-fetch/src/errors/fetch-error.cjs.map +0 -1
- package/dist/_node_modules/node-fetch/src/errors/fetch-error.js +0 -19
- package/dist/_node_modules/node-fetch/src/errors/fetch-error.js.map +0 -1
- package/dist/_node_modules/node-fetch/src/headers.cjs +0 -190
- package/dist/_node_modules/node-fetch/src/headers.cjs.map +0 -1
- package/dist/_node_modules/node-fetch/src/headers.js +0 -190
- package/dist/_node_modules/node-fetch/src/headers.js.map +0 -1
- package/dist/_node_modules/node-fetch/src/index.cjs +0 -292
- package/dist/_node_modules/node-fetch/src/index.cjs.map +0 -1
- package/dist/_node_modules/node-fetch/src/index.js +0 -292
- package/dist/_node_modules/node-fetch/src/index.js.map +0 -1
- package/dist/_node_modules/node-fetch/src/request.cjs +0 -203
- package/dist/_node_modules/node-fetch/src/request.cjs.map +0 -1
- package/dist/_node_modules/node-fetch/src/request.js +0 -203
- package/dist/_node_modules/node-fetch/src/request.js.map +0 -1
- package/dist/_node_modules/node-fetch/src/response.cjs +0 -122
- package/dist/_node_modules/node-fetch/src/response.cjs.map +0 -1
- package/dist/_node_modules/node-fetch/src/response.js +0 -123
- package/dist/_node_modules/node-fetch/src/response.js.map +0 -1
- package/dist/_node_modules/node-fetch/src/utils/get-search.cjs +0 -12
- package/dist/_node_modules/node-fetch/src/utils/get-search.cjs.map +0 -1
- package/dist/_node_modules/node-fetch/src/utils/get-search.js +0 -12
- package/dist/_node_modules/node-fetch/src/utils/get-search.js.map +0 -1
- package/dist/_node_modules/node-fetch/src/utils/is-redirect.cjs +0 -8
- package/dist/_node_modules/node-fetch/src/utils/is-redirect.cjs.map +0 -1
- package/dist/_node_modules/node-fetch/src/utils/is-redirect.js +0 -8
- package/dist/_node_modules/node-fetch/src/utils/is-redirect.js.map +0 -1
- package/dist/_node_modules/node-fetch/src/utils/is.cjs +0 -28
- package/dist/_node_modules/node-fetch/src/utils/is.cjs.map +0 -1
- package/dist/_node_modules/node-fetch/src/utils/is.js +0 -28
- package/dist/_node_modules/node-fetch/src/utils/is.js.map +0 -1
- package/dist/_node_modules/node-fetch/src/utils/multipart-parser.cjs +0 -356
- package/dist/_node_modules/node-fetch/src/utils/multipart-parser.cjs.map +0 -1
- package/dist/_node_modules/node-fetch/src/utils/multipart-parser.js +0 -356
- package/dist/_node_modules/node-fetch/src/utils/multipart-parser.js.map +0 -1
- package/dist/_node_modules/node-fetch/src/utils/referrer.cjs +0 -149
- package/dist/_node_modules/node-fetch/src/utils/referrer.cjs.map +0 -1
- package/dist/_node_modules/node-fetch/src/utils/referrer.js +0 -149
- package/dist/_node_modules/node-fetch/src/utils/referrer.js.map +0 -1
- package/dist/_node_modules/normalize-package-data/lib/extract_description.cjs +0 -24
- package/dist/_node_modules/normalize-package-data/lib/extract_description.cjs.map +0 -1
- package/dist/_node_modules/normalize-package-data/lib/extract_description.js +0 -24
- package/dist/_node_modules/normalize-package-data/lib/extract_description.js.map +0 -1
- package/dist/_node_modules/normalize-package-data/lib/fixer.cjs +0 -438
- package/dist/_node_modules/normalize-package-data/lib/fixer.cjs.map +0 -1
- package/dist/_node_modules/normalize-package-data/lib/fixer.js +0 -438
- package/dist/_node_modules/normalize-package-data/lib/fixer.js.map +0 -1
- package/dist/_node_modules/normalize-package-data/lib/make_warning.cjs +0 -26
- package/dist/_node_modules/normalize-package-data/lib/make_warning.cjs.map +0 -1
- package/dist/_node_modules/normalize-package-data/lib/make_warning.js +0 -26
- package/dist/_node_modules/normalize-package-data/lib/make_warning.js.map +0 -1
- package/dist/_node_modules/normalize-package-data/lib/normalize.cjs +0 -58
- package/dist/_node_modules/normalize-package-data/lib/normalize.cjs.map +0 -1
- package/dist/_node_modules/normalize-package-data/lib/normalize.js +0 -59
- package/dist/_node_modules/normalize-package-data/lib/normalize.js.map +0 -1
- package/dist/_node_modules/normalize-package-data/lib/typos.json.cjs +0 -41
- package/dist/_node_modules/normalize-package-data/lib/typos.json.cjs.map +0 -1
- package/dist/_node_modules/normalize-package-data/lib/typos.json.js +0 -41
- package/dist/_node_modules/normalize-package-data/lib/typos.json.js.map +0 -1
- package/dist/_node_modules/normalize-package-data/lib/warning_messages.json.cjs +0 -90
- package/dist/_node_modules/normalize-package-data/lib/warning_messages.json.cjs.map +0 -1
- package/dist/_node_modules/normalize-package-data/lib/warning_messages.json.js +0 -90
- package/dist/_node_modules/normalize-package-data/lib/warning_messages.json.js.map +0 -1
- package/dist/_node_modules/parse-json/index.cjs +0 -54
- package/dist/_node_modules/parse-json/index.cjs.map +0 -1
- package/dist/_node_modules/parse-json/index.js +0 -55
- package/dist/_node_modules/parse-json/index.js.map +0 -1
- package/dist/_node_modules/picocolors/picocolors.browser.cjs +0 -12
- package/dist/_node_modules/picocolors/picocolors.browser.cjs.map +0 -1
- package/dist/_node_modules/picocolors/picocolors.browser.js +0 -12
- package/dist/_node_modules/picocolors/picocolors.browser.js.map +0 -1
- package/dist/_node_modules/quick-lru/index.cjs +0 -235
- package/dist/_node_modules/quick-lru/index.cjs.map +0 -1
- package/dist/_node_modules/quick-lru/index.js +0 -236
- package/dist/_node_modules/quick-lru/index.js.map +0 -1
- package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host-info.cjs +0 -159
- package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host-info.cjs.map +0 -1
- package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host-info.js +0 -159
- package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host-info.js.map +0 -1
- package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host.cjs +0 -88
- package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host.cjs.map +0 -1
- package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host.js +0 -88
- package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host.js.map +0 -1
- package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/index.cjs +0 -180
- package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/index.cjs.map +0 -1
- package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/index.js +0 -180
- package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/index.js.map +0 -1
- package/dist/_node_modules/read-pkg/_node_modules/lru-cache/index.cjs +0 -268
- package/dist/_node_modules/read-pkg/_node_modules/lru-cache/index.cjs.map +0 -1
- package/dist/_node_modules/read-pkg/_node_modules/lru-cache/index.js +0 -268
- package/dist/_node_modules/read-pkg/_node_modules/lru-cache/index.js.map +0 -1
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/extract_description.cjs +0 -20
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/extract_description.cjs.map +0 -1
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/extract_description.js +0 -20
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/extract_description.js.map +0 -1
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/fixer.cjs +0 -438
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/fixer.cjs.map +0 -1
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/fixer.js +0 -438
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/fixer.js.map +0 -1
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/make_warning.cjs +0 -26
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/make_warning.cjs.map +0 -1
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/make_warning.js +0 -26
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/make_warning.js.map +0 -1
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/normalize.cjs +0 -58
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/normalize.cjs.map +0 -1
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/normalize.js +0 -59
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/normalize.js.map +0 -1
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/typos.json.cjs +0 -41
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/typos.json.cjs.map +0 -1
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/typos.json.js +0 -41
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/typos.json.js.map +0 -1
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/warning_messages.json.cjs +0 -90
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/warning_messages.json.cjs.map +0 -1
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/warning_messages.json.js +0 -90
- package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/warning_messages.json.js.map +0 -1
- package/dist/_node_modules/read-pkg/index.cjs +0 -20
- package/dist/_node_modules/read-pkg/index.cjs.map +0 -1
- package/dist/_node_modules/read-pkg/index.js +0 -20
- package/dist/_node_modules/read-pkg/index.js.map +0 -1
- package/dist/_node_modules/read-pkg-up/_node_modules/find-up/index.cjs +0 -48
- package/dist/_node_modules/read-pkg-up/_node_modules/find-up/index.cjs.map +0 -1
- package/dist/_node_modules/read-pkg-up/_node_modules/find-up/index.js +0 -48
- package/dist/_node_modules/read-pkg-up/_node_modules/find-up/index.js.map +0 -1
- package/dist/_node_modules/read-pkg-up/_node_modules/locate-path/index.cjs +0 -43
- package/dist/_node_modules/read-pkg-up/_node_modules/locate-path/index.cjs.map +0 -1
- package/dist/_node_modules/read-pkg-up/_node_modules/locate-path/index.js +0 -43
- package/dist/_node_modules/read-pkg-up/_node_modules/locate-path/index.js.map +0 -1
- package/dist/_node_modules/read-pkg-up/index.cjs +0 -17
- package/dist/_node_modules/read-pkg-up/index.cjs.map +0 -1
- package/dist/_node_modules/read-pkg-up/index.js +0 -17
- package/dist/_node_modules/read-pkg-up/index.js.map +0 -1
- package/dist/_node_modules/redent/index.cjs +0 -8
- package/dist/_node_modules/redent/index.cjs.map +0 -1
- package/dist/_node_modules/redent/index.js +0 -9
- package/dist/_node_modules/redent/index.js.map +0 -1
- package/dist/_node_modules/semver/classes/semver.cjs +0 -245
- package/dist/_node_modules/semver/classes/semver.cjs.map +0 -1
- package/dist/_node_modules/semver/classes/semver.js +0 -245
- package/dist/_node_modules/semver/classes/semver.js.map +0 -1
- package/dist/_node_modules/semver/functions/clean.cjs +0 -11
- package/dist/_node_modules/semver/functions/clean.cjs.map +0 -1
- package/dist/_node_modules/semver/functions/clean.js +0 -11
- package/dist/_node_modules/semver/functions/clean.js.map +0 -1
- package/dist/_node_modules/semver/functions/parse.cjs +0 -20
- package/dist/_node_modules/semver/functions/parse.cjs.map +0 -1
- package/dist/_node_modules/semver/functions/parse.js +0 -20
- package/dist/_node_modules/semver/functions/parse.js.map +0 -1
- package/dist/_node_modules/semver/functions/valid.cjs +0 -11
- package/dist/_node_modules/semver/functions/valid.cjs.map +0 -1
- package/dist/_node_modules/semver/functions/valid.js +0 -11
- package/dist/_node_modules/semver/functions/valid.js.map +0 -1
- package/dist/_node_modules/semver/internal/constants.cjs +0 -29
- package/dist/_node_modules/semver/internal/constants.cjs.map +0 -1
- package/dist/_node_modules/semver/internal/constants.js +0 -29
- package/dist/_node_modules/semver/internal/constants.js.map +0 -1
- package/dist/_node_modules/semver/internal/debug.cjs +0 -7
- package/dist/_node_modules/semver/internal/debug.cjs.map +0 -1
- package/dist/_node_modules/semver/internal/debug.js +0 -7
- package/dist/_node_modules/semver/internal/debug.js.map +0 -1
- package/dist/_node_modules/semver/internal/identifiers.cjs +0 -19
- package/dist/_node_modules/semver/internal/identifiers.cjs.map +0 -1
- package/dist/_node_modules/semver/internal/identifiers.js +0 -19
- package/dist/_node_modules/semver/internal/identifiers.js.map +0 -1
- package/dist/_node_modules/semver/internal/parse-options.cjs +0 -16
- package/dist/_node_modules/semver/internal/parse-options.cjs.map +0 -1
- package/dist/_node_modules/semver/internal/parse-options.js +0 -16
- package/dist/_node_modules/semver/internal/parse-options.js.map +0 -1
- package/dist/_node_modules/semver/internal/re.cjs +0 -82
- package/dist/_node_modules/semver/internal/re.cjs.map +0 -1
- package/dist/_node_modules/semver/internal/re.js +0 -82
- package/dist/_node_modules/semver/internal/re.js.map +0 -1
- package/dist/_node_modules/spdx-correct/index.cjs +0 -334
- package/dist/_node_modules/spdx-correct/index.cjs.map +0 -1
- package/dist/_node_modules/spdx-correct/index.js +0 -334
- package/dist/_node_modules/spdx-correct/index.js.map +0 -1
- package/dist/_node_modules/spdx-exceptions/index.json.cjs +0 -43
- package/dist/_node_modules/spdx-exceptions/index.json.cjs.map +0 -1
- package/dist/_node_modules/spdx-exceptions/index.json.js +0 -44
- package/dist/_node_modules/spdx-exceptions/index.json.js.map +0 -1
- package/dist/_node_modules/spdx-expression-parse/index.cjs +0 -11
- package/dist/_node_modules/spdx-expression-parse/index.cjs.map +0 -1
- package/dist/_node_modules/spdx-expression-parse/index.js +0 -11
- package/dist/_node_modules/spdx-expression-parse/index.js.map +0 -1
- package/dist/_node_modules/spdx-expression-parse/parse.cjs +0 -111
- package/dist/_node_modules/spdx-expression-parse/parse.cjs.map +0 -1
- package/dist/_node_modules/spdx-expression-parse/parse.js +0 -111
- package/dist/_node_modules/spdx-expression-parse/parse.js.map +0 -1
- package/dist/_node_modules/spdx-expression-parse/scan.cjs +0 -104
- package/dist/_node_modules/spdx-expression-parse/scan.cjs.map +0 -1
- package/dist/_node_modules/spdx-expression-parse/scan.js +0 -104
- package/dist/_node_modules/spdx-expression-parse/scan.js.map +0 -1
- package/dist/_node_modules/spdx-license-ids/deprecated.json.cjs +0 -30
- package/dist/_node_modules/spdx-license-ids/deprecated.json.cjs.map +0 -1
- package/dist/_node_modules/spdx-license-ids/deprecated.json.js +0 -31
- package/dist/_node_modules/spdx-license-ids/deprecated.json.js.map +0 -1
- package/dist/_node_modules/spdx-license-ids/index.json.cjs +0 -510
- package/dist/_node_modules/spdx-license-ids/index.json.cjs.map +0 -1
- package/dist/_node_modules/spdx-license-ids/index.json.js +0 -511
- package/dist/_node_modules/spdx-license-ids/index.json.js.map +0 -1
- package/dist/_node_modules/strip-indent/index.cjs +0 -12
- package/dist/_node_modules/strip-indent/index.cjs.map +0 -1
- package/dist/_node_modules/strip-indent/index.js +0 -13
- package/dist/_node_modules/strip-indent/index.js.map +0 -1
- package/dist/_node_modules/trim-newlines/index.cjs +0 -15
- package/dist/_node_modules/trim-newlines/index.cjs.map +0 -1
- package/dist/_node_modules/trim-newlines/index.js +0 -15
- package/dist/_node_modules/trim-newlines/index.js.map +0 -1
- package/dist/_node_modules/validate-npm-package-license/index.cjs +0 -71
- package/dist/_node_modules/validate-npm-package-license/index.cjs.map +0 -1
- package/dist/_node_modules/validate-npm-package-license/index.js +0 -71
- package/dist/_node_modules/validate-npm-package-license/index.js.map +0 -1
- package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.cjs +0 -3822
- package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.cjs.map +0 -1
- package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.js +0 -3822
- package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.js.map +0 -1
- package/dist/_node_modules/yallist/iterator.cjs +0 -19
- package/dist/_node_modules/yallist/iterator.cjs.map +0 -1
- package/dist/_node_modules/yallist/iterator.js +0 -19
- package/dist/_node_modules/yallist/iterator.js.map +0 -1
- package/dist/_node_modules/yallist/yallist.cjs +0 -367
- package/dist/_node_modules/yallist/yallist.cjs.map +0 -1
- package/dist/_node_modules/yallist/yallist.js +0 -367
- package/dist/_node_modules/yallist/yallist.js.map +0 -1
- package/dist/_node_modules/yargs-parser/build/lib/index.cjs +0 -56
- package/dist/_node_modules/yargs-parser/build/lib/index.cjs.map +0 -1
- package/dist/_node_modules/yargs-parser/build/lib/index.js +0 -57
- package/dist/_node_modules/yargs-parser/build/lib/index.js.map +0 -1
- package/dist/_node_modules/yargs-parser/build/lib/string-utils.cjs +0 -63
- package/dist/_node_modules/yargs-parser/build/lib/string-utils.cjs.map +0 -1
- package/dist/_node_modules/yargs-parser/build/lib/string-utils.js +0 -63
- package/dist/_node_modules/yargs-parser/build/lib/string-utils.js.map +0 -1
- package/dist/_node_modules/yargs-parser/build/lib/tokenize-arg-string.cjs +0 -39
- package/dist/_node_modules/yargs-parser/build/lib/tokenize-arg-string.cjs.map +0 -1
- package/dist/_node_modules/yargs-parser/build/lib/tokenize-arg-string.js +0 -39
- package/dist/_node_modules/yargs-parser/build/lib/tokenize-arg-string.js.map +0 -1
- package/dist/_node_modules/yargs-parser/build/lib/yargs-parser-types.cjs +0 -15
- package/dist/_node_modules/yargs-parser/build/lib/yargs-parser-types.cjs.map +0 -1
- package/dist/_node_modules/yargs-parser/build/lib/yargs-parser-types.js +0 -16
- package/dist/_node_modules/yargs-parser/build/lib/yargs-parser-types.js.map +0 -1
- package/dist/_node_modules/yargs-parser/build/lib/yargs-parser.cjs +0 -847
- package/dist/_node_modules/yargs-parser/build/lib/yargs-parser.cjs.map +0 -1
- package/dist/_node_modules/yargs-parser/build/lib/yargs-parser.js +0 -847
- package/dist/_node_modules/yargs-parser/build/lib/yargs-parser.js.map +0 -1
- package/dist/_virtual/_commonjsHelpers.cjs +0 -9
- package/dist/_virtual/_commonjsHelpers.cjs.map +0 -1
- package/dist/_virtual/_commonjsHelpers.js +0 -9
- package/dist/_virtual/_commonjsHelpers.js.map +0 -1
- package/dist/_virtual/identifier.cjs +0 -5
- package/dist/_virtual/identifier.cjs.map +0 -1
- package/dist/_virtual/identifier.js +0 -5
- package/dist/_virtual/identifier.js.map +0 -1
- package/dist/_virtual/index.cjs +0 -5
- package/dist/_virtual/index.cjs.map +0 -1
- package/dist/_virtual/index.js +0 -5
- package/dist/_virtual/index.js.map +0 -1
- package/dist/_virtual/index2.cjs +0 -5
- package/dist/_virtual/index2.cjs.map +0 -1
- package/dist/_virtual/index2.js +0 -5
- package/dist/_virtual/index2.js.map +0 -1
- package/dist/_virtual/index3.cjs +0 -5
- package/dist/_virtual/index3.cjs.map +0 -1
- package/dist/_virtual/index3.js +0 -5
- package/dist/_virtual/index3.js.map +0 -1
- package/dist/_virtual/index4.cjs +0 -5
- package/dist/_virtual/index4.cjs.map +0 -1
- package/dist/_virtual/index4.js +0 -5
- package/dist/_virtual/index4.js.map +0 -1
- package/dist/_virtual/index5.cjs +0 -5
- package/dist/_virtual/index5.cjs.map +0 -1
- package/dist/_virtual/index5.js +0 -5
- package/dist/_virtual/index5.js.map +0 -1
- package/dist/_virtual/index6.cjs +0 -5
- package/dist/_virtual/index6.cjs.map +0 -1
- package/dist/_virtual/index6.js +0 -5
- package/dist/_virtual/index6.js.map +0 -1
- package/dist/_virtual/index7.cjs +0 -5
- package/dist/_virtual/index7.cjs.map +0 -1
- package/dist/_virtual/index7.js +0 -5
- package/dist/_virtual/index7.js.map +0 -1
- package/dist/_virtual/index8.cjs +0 -5
- package/dist/_virtual/index8.cjs.map +0 -1
- package/dist/_virtual/index8.js +0 -5
- package/dist/_virtual/index8.js.map +0 -1
- package/dist/_virtual/keyword.cjs +0 -5
- package/dist/_virtual/keyword.cjs.map +0 -1
- package/dist/_virtual/keyword.js +0 -5
- package/dist/_virtual/keyword.js.map +0 -1
- package/dist/_virtual/picocolors.browser.cjs +0 -5
- package/dist/_virtual/picocolors.browser.cjs.map +0 -1
- package/dist/_virtual/picocolors.browser.js +0 -5
- package/dist/_virtual/picocolors.browser.js.map +0 -1
- package/dist/_virtual/ponyfill.es2018.cjs +0 -5
- package/dist/_virtual/ponyfill.es2018.cjs.map +0 -1
- package/dist/_virtual/ponyfill.es2018.js +0 -5
- package/dist/_virtual/ponyfill.es2018.js.map +0 -1
- package/dist/_virtual/re.cjs +0 -5
- package/dist/_virtual/re.cjs.map +0 -1
- package/dist/_virtual/re.js +0 -5
- package/dist/_virtual/re.js.map +0 -1
- package/dist/cli/index.d.ts +0 -1
- package/dist/cli/loadConfig.d.ts +0 -6
- package/dist/cli/loadLocaleIDs.d.ts +0 -10
- package/dist/cli/loadModels.d.ts +0 -15
- package/dist/cli/types.d.ts +0 -175
- package/dist/constants.d.ts +0 -26
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/addBlankLine.d.ts +0 -5
- package/dist/lib/addLine.d.ts +0 -1
- package/dist/lib/addSection.d.ts +0 -1
- package/dist/lib/addTrailingNewLine.d.ts +0 -5
- package/dist/lib/buildCustomTypeDataType.d.ts +0 -14
- package/dist/lib/buildCustomTypeType.d.ts +0 -17
- package/dist/lib/buildFieldDocs.d.ts +0 -10
- package/dist/lib/buildFieldProperties.d.ts +0 -15
- package/dist/lib/buildSharedSliceType.d.ts +0 -17
- package/dist/lib/buildTypeName.d.ts +0 -1
- package/dist/lib/buildUnion.d.ts +0 -1
- package/dist/lib/checkHasUIDFIeld.d.ts +0 -2
- package/dist/lib/getAPIIDPath.d.ts +0 -6
- package/dist/lib/getCacheKey.d.ts +0 -9
- package/dist/lib/getHumanReadableModelName.d.ts +0 -7
- package/dist/lib/getHumanReadablePath.d.ts +0 -6
- package/src/cli/types.ts +0 -192
package/dist/generateTypes.cjs
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
const require_addLine = require("./lib/addLine.cjs");
|
|
3
|
+
const require_addSection = require("./lib/addSection.cjs");
|
|
4
|
+
const require_buildUnion = require("./lib/buildUnion.cjs");
|
|
5
|
+
const require_buildCustomTypeType = require("./lib/buildCustomTypeType.cjs");
|
|
6
|
+
const require_buildSharedSliceType = require("./lib/buildSharedSliceType.cjs");
|
|
7
|
+
let common_tags = require("common-tags");
|
|
8
|
+
let quick_lru = require("quick-lru");
|
|
9
|
+
quick_lru = require_runtime.__toESM(quick_lru);
|
|
10
|
+
//#region src/generateTypes.ts
|
|
11
|
+
const cache = new quick_lru.default({ maxSize: 1e3 });
|
|
11
12
|
function generateTypes(config = {}) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
code = addSection.addSection(`
|
|
13
|
+
const fieldConfigs = config.fieldConfigs || {};
|
|
14
|
+
const shouldUseCache = config.cache ?? true;
|
|
15
|
+
let code = "";
|
|
16
|
+
const typesProvider = config.typesProvider || "@prismicio/types";
|
|
17
|
+
let clientImportName = "prismic";
|
|
18
|
+
code = require_addLine.addLine(`import type * as prismic from "${typesProvider}";`, code);
|
|
19
|
+
if (config.clientIntegration?.includeCreateClientInterface || config.clientIntegration?.includeContentNamespace) {
|
|
20
|
+
if (typesProvider !== "@prismicio/client") {
|
|
21
|
+
clientImportName = "prismicClient";
|
|
22
|
+
code = require_addLine.addLine(`import type * as ${clientImportName} from "@prismicio/client";`, code);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
code = require_addSection.addSection(`type Simplify<T> = { [KeyType in keyof T]: T[KeyType] };`, code);
|
|
26
|
+
code = require_addSection.addSection(`
|
|
27
27
|
type PickContentRelationshipFieldData<
|
|
28
28
|
TRelationship extends prismic.CustomTypeModelFetchCustomTypeLevel1 | prismic.CustomTypeModelFetchCustomTypeLevel2 | prismic.CustomTypeModelFetchGroupLevel1 | prismic.CustomTypeModelFetchGroupLevel2,
|
|
29
29
|
TData extends Record<string, prismic.AnyRegularField | prismic.GroupField | prismic.NestedGroupField | prismic.SliceZone>,
|
|
@@ -67,87 +67,78 @@ type ContentRelationshipFieldWithData<
|
|
|
67
67
|
>
|
|
68
68
|
}[Exclude<TCustomType[number], string>["id"]];
|
|
69
69
|
`, code);
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
contentTypeNames.push(...sharedSliceType.contentTypeNames);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
if (((_c = config.clientIntegration) == null ? void 0 : _c.includeCreateClientInterface) || ((_d = config.clientIntegration) == null ? void 0 : _d.includeContentNamespace)) {
|
|
111
|
-
let clientModuleCode = "";
|
|
112
|
-
if (config.clientIntegration.includeCreateClientInterface) {
|
|
113
|
-
if ((((_e = config.customTypeModels) == null ? void 0 : _e.length) || 0) > 0) {
|
|
114
|
-
clientModuleCode = addSection.addSection(`interface CreateClient {
|
|
70
|
+
const contentTypeNames = [];
|
|
71
|
+
if (config.customTypeModels) {
|
|
72
|
+
const allDocumentTypesTypeNames = [];
|
|
73
|
+
for (const model of config.customTypeModels) {
|
|
74
|
+
const customTypeType = require_buildCustomTypeType.buildCustomTypeType({
|
|
75
|
+
model,
|
|
76
|
+
localeIDs: config.localeIDs,
|
|
77
|
+
fieldConfigs,
|
|
78
|
+
cache: shouldUseCache ? cache : void 0
|
|
79
|
+
});
|
|
80
|
+
for (const auxiliaryType of customTypeType.auxiliaryTypes) code = require_addSection.addSection(auxiliaryType.code, code);
|
|
81
|
+
code = require_addSection.addSection(customTypeType.code, code);
|
|
82
|
+
allDocumentTypesTypeNames.push(customTypeType.name);
|
|
83
|
+
contentTypeNames.push(customTypeType.name);
|
|
84
|
+
contentTypeNames.push(...customTypeType.contentTypeNames);
|
|
85
|
+
}
|
|
86
|
+
if (config.customTypeModels.length > 0) {
|
|
87
|
+
const allDocumentTypesUnionName = "AllDocumentTypes";
|
|
88
|
+
code = require_addSection.addSection(`export type ${allDocumentTypesUnionName} = ${require_buildUnion.buildUnion(allDocumentTypesTypeNames)};`, code);
|
|
89
|
+
contentTypeNames.push(allDocumentTypesUnionName);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (config.sharedSliceModels) for (const model of config.sharedSliceModels) {
|
|
93
|
+
const sharedSliceType = require_buildSharedSliceType.buildSharedSliceType({
|
|
94
|
+
model,
|
|
95
|
+
fieldConfigs,
|
|
96
|
+
cache: shouldUseCache ? cache : void 0
|
|
97
|
+
});
|
|
98
|
+
for (const auxiliaryType of sharedSliceType.auxiliaryTypes) code = require_addSection.addSection(auxiliaryType.code, code);
|
|
99
|
+
code = require_addSection.addSection(sharedSliceType.code, code);
|
|
100
|
+
contentTypeNames.push(sharedSliceType.name);
|
|
101
|
+
contentTypeNames.push(...sharedSliceType.contentTypeNames);
|
|
102
|
+
}
|
|
103
|
+
if (config.clientIntegration?.includeCreateClientInterface || config.clientIntegration?.includeContentNamespace) {
|
|
104
|
+
let clientModuleCode = "";
|
|
105
|
+
if (config.clientIntegration.includeCreateClientInterface) if ((config.customTypeModels?.length || 0) > 0) {
|
|
106
|
+
clientModuleCode = require_addSection.addSection(`interface CreateClient {
|
|
115
107
|
(repositoryNameOrEndpoint: string, options?: ${clientImportName}.ClientConfig): ${clientImportName}.Client<AllDocumentTypes>;
|
|
116
108
|
}`, clientModuleCode);
|
|
117
|
-
|
|
109
|
+
clientModuleCode = require_addSection.addSection(`interface CreateWriteClient {
|
|
118
110
|
(repositoryNameOrEndpoint: string, options: ${clientImportName}.WriteClientConfig): ${clientImportName}.WriteClient<AllDocumentTypes>;
|
|
119
111
|
}`, clientModuleCode);
|
|
120
|
-
|
|
112
|
+
clientModuleCode = require_addSection.addSection(`interface CreateMigration {
|
|
121
113
|
(): ${clientImportName}.Migration<AllDocumentTypes>;
|
|
122
114
|
}`, clientModuleCode);
|
|
123
|
-
|
|
124
|
-
|
|
115
|
+
} else {
|
|
116
|
+
clientModuleCode = require_addSection.addSection(`interface CreateClient {
|
|
125
117
|
(repositoryNameOrEndpoint: string, options?: ${clientImportName}.ClientConfig): ${clientImportName}.Client;
|
|
126
118
|
}`, clientModuleCode);
|
|
127
|
-
|
|
119
|
+
clientModuleCode = require_addSection.addSection(`interface CreateWriteClient {
|
|
128
120
|
(repositoryNameOrEndpoint: string, options?: ${clientImportName}.WriteClientConfig): ${clientImportName}.WriteClient;
|
|
129
121
|
}`, clientModuleCode);
|
|
130
|
-
|
|
122
|
+
clientModuleCode = require_addSection.addSection(`interface CreateMigration {
|
|
131
123
|
(): ${clientImportName}.Migration;
|
|
132
124
|
}`, clientModuleCode);
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
if (config.clientIntegration.includeContentNamespace) {
|
|
136
|
-
clientModuleCode = addSection.addSection(commonTags.source`
|
|
125
|
+
}
|
|
126
|
+
if (config.clientIntegration.includeContentNamespace) clientModuleCode = require_addSection.addSection(common_tags.source`
|
|
137
127
|
namespace Content {
|
|
138
128
|
export type {
|
|
139
129
|
${contentTypeNames.join(",\n")}
|
|
140
130
|
}
|
|
141
131
|
}
|
|
142
132
|
`, clientModuleCode);
|
|
143
|
-
|
|
144
|
-
code = addSection.addSection(commonTags.source`
|
|
133
|
+
code = require_addSection.addSection(common_tags.source`
|
|
145
134
|
declare module "@prismicio/client" {
|
|
146
135
|
${clientModuleCode}
|
|
147
136
|
}
|
|
148
137
|
`, code);
|
|
149
|
-
|
|
150
|
-
|
|
138
|
+
}
|
|
139
|
+
return code;
|
|
151
140
|
}
|
|
141
|
+
//#endregion
|
|
152
142
|
exports.generateTypes = generateTypes;
|
|
153
|
-
|
|
143
|
+
|
|
144
|
+
//# sourceMappingURL=generateTypes.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateTypes.cjs","sources":["../../src/generateTypes.ts"],"sourcesContent":["import type { CustomTypeModel, SharedSliceModel } from \"@prismicio/client\";\nimport { source } from \"common-tags\";\nimport QuickLRU from \"quick-lru\";\n\nimport { addLine } from \"./lib/addLine\";\nimport { addSection } from \"./lib/addSection\";\nimport { buildCustomTypeType } from \"./lib/buildCustomTypeType\";\nimport { buildSharedSliceType } from \"./lib/buildSharedSliceType\";\nimport { buildUnion } from \"./lib/buildUnion\";\n\nimport { FieldConfigs } from \"./types\";\n\nexport type TypesProvider = \"@prismicio/client\" | \"@prismicio/types\";\n\nconst cache = new QuickLRU<string, unknown>({ maxSize: 1000 });\n\nexport type GenerateTypesConfig = {\n\tcustomTypeModels?: CustomTypeModel[];\n\tsharedSliceModels?: SharedSliceModel[];\n\tlocaleIDs?: string[];\n\tfieldConfigs?: FieldConfigs;\n\ttypesProvider?: TypesProvider;\n\tclientIntegration?: {\n\t\tincludeCreateClientInterface?: boolean;\n\t\tincludeContentNamespace?: boolean;\n\t};\n\tcache?: boolean;\n};\n\nexport function generateTypes(config: GenerateTypesConfig = {}): string {\n\tconst fieldConfigs = config.fieldConfigs || {};\n\tconst shouldUseCache = config.cache ?? true;\n\n\tlet code = \"\";\n\n\tconst typesProvider = config.typesProvider || \"@prismicio/types\";\n\tlet clientImportName = \"prismic\";\n\n\tcode = addLine(`import type * as prismic from \"${typesProvider}\";`, code);\n\n\tif (\n\t\tconfig.clientIntegration?.includeCreateClientInterface ||\n\t\tconfig.clientIntegration?.includeContentNamespace\n\t) {\n\t\tif (typesProvider !== \"@prismicio/client\") {\n\t\t\tclientImportName = \"prismicClient\";\n\n\t\t\t// This import declaration would be a duplicate if the types\n\t\t\t// provider is @prismicio/client.\n\t\t\tcode = addLine(\n\t\t\t\t`import type * as ${clientImportName} from \"@prismicio/client\";`,\n\t\t\t\tcode,\n\t\t\t);\n\t\t}\n\t}\n\n\tcode = addSection(\n\t\t`type Simplify<T> = { [KeyType in keyof T]: T[KeyType] };`,\n\t\tcode,\n\t);\n\n\tcode = addSection(\n\t\t`\ntype PickContentRelationshipFieldData<\n\tTRelationship extends prismic.CustomTypeModelFetchCustomTypeLevel1 | prismic.CustomTypeModelFetchCustomTypeLevel2 | prismic.CustomTypeModelFetchGroupLevel1 | prismic.CustomTypeModelFetchGroupLevel2,\n\tTData extends Record<string, prismic.AnyRegularField | prismic.GroupField | prismic.NestedGroupField | prismic.SliceZone>,\n\tTLang extends string\n> = |\n\t// Content relationship fields\n\t{\n\t\t[TSubRelationship in Extract<\n\t\t\tTRelationship[\"fields\"][number], prismic.CustomTypeModelFetchContentRelationshipLevel1\n\t\t> as TSubRelationship[\"id\"]]:\n\t\t\tContentRelationshipFieldWithData<TSubRelationship[\"customtypes\"], TLang>;\n\t} &\n\t// Group\n\t{\n\t\t[TGroup in Extract<\n\t\t\tTRelationship[\"fields\"][number], prismic.CustomTypeModelFetchGroupLevel1 | prismic.CustomTypeModelFetchGroupLevel2\n\t\t> as TGroup[\"id\"]]:\n\t\t\tTData[TGroup[\"id\"]] extends prismic.GroupField<infer TGroupData>\n\t\t\t\t? prismic.GroupField<PickContentRelationshipFieldData<TGroup, TGroupData, TLang>>\n\t\t\t\t: never\n\t} &\n\t// Other fields\n\t{\n\t\t[TFieldKey in Extract<TRelationship[\"fields\"][number], string>]:\n\t\t\tTFieldKey extends keyof TData ? TData[TFieldKey] : never;\n\t};\n\ntype ContentRelationshipFieldWithData<\n\tTCustomType extends readonly (prismic.CustomTypeModelFetchCustomTypeLevel1 | string)[] | readonly (prismic.CustomTypeModelFetchCustomTypeLevel2 | string)[],\n\tTLang extends string = string\n> = {\n\t[ID in Exclude<TCustomType[number], string>[\"id\"]]:\n\t\tprismic.ContentRelationshipField<\n\t\t\tID,\n\t\t\tTLang,\n\t\t\tPickContentRelationshipFieldData<\n\t\t\t\tExtract<TCustomType[number], { id: ID }>,\n\t\t\t\tExtract<prismic.Content.AllDocumentTypes, { type: ID }>[\"data\"],\n\t\t\t\tTLang\n\t\t\t>\n\t\t>\n}[Exclude<TCustomType[number], string>[\"id\"]];\n`,\n\t\tcode,\n\t);\n\n\tconst contentTypeNames: string[] = [];\n\n\tif (config.customTypeModels) {\n\t\tconst allDocumentTypesTypeNames: string[] = [];\n\n\t\tfor (const model of config.customTypeModels) {\n\t\t\tconst customTypeType = buildCustomTypeType({\n\t\t\t\tmodel,\n\t\t\t\tlocaleIDs: config.localeIDs,\n\t\t\t\tfieldConfigs,\n\t\t\t\tcache: shouldUseCache ? cache : undefined,\n\t\t\t});\n\n\t\t\tfor (const auxiliaryType of customTypeType.auxiliaryTypes) {\n\t\t\t\tcode = addSection(auxiliaryType.code, code);\n\t\t\t}\n\n\t\t\tcode = addSection(customTypeType.code, code);\n\n\t\t\tallDocumentTypesTypeNames.push(customTypeType.name);\n\n\t\t\tcontentTypeNames.push(customTypeType.name);\n\t\t\tcontentTypeNames.push(...customTypeType.contentTypeNames);\n\t\t}\n\n\t\tif (config.customTypeModels.length > 0) {\n\t\t\tconst allDocumentTypesUnionName = \"AllDocumentTypes\";\n\t\t\tconst allDocumentTypesUnion = buildUnion(allDocumentTypesTypeNames);\n\n\t\t\tcode = addSection(\n\t\t\t\t`export type ${allDocumentTypesUnionName} = ${allDocumentTypesUnion};`,\n\t\t\t\tcode,\n\t\t\t);\n\n\t\t\tcontentTypeNames.push(allDocumentTypesUnionName);\n\t\t}\n\t}\n\n\tif (config.sharedSliceModels) {\n\t\tfor (const model of config.sharedSliceModels) {\n\t\t\tconst sharedSliceType = buildSharedSliceType({\n\t\t\t\tmodel,\n\t\t\t\tfieldConfigs,\n\t\t\t\tcache: shouldUseCache ? cache : undefined,\n\t\t\t});\n\n\t\t\tfor (const auxiliaryType of sharedSliceType.auxiliaryTypes) {\n\t\t\t\tcode = addSection(auxiliaryType.code, code);\n\t\t\t}\n\n\t\t\tcode = addSection(sharedSliceType.code, code);\n\n\t\t\tcontentTypeNames.push(sharedSliceType.name);\n\t\t\tcontentTypeNames.push(...sharedSliceType.contentTypeNames);\n\t\t}\n\t}\n\n\tif (\n\t\tconfig.clientIntegration?.includeCreateClientInterface ||\n\t\tconfig.clientIntegration?.includeContentNamespace\n\t) {\n\t\tlet clientModuleCode = \"\";\n\n\t\tif (config.clientIntegration.includeCreateClientInterface) {\n\t\t\tif ((config.customTypeModels?.length || 0) > 0) {\n\t\t\t\tclientModuleCode = addSection(\n\t\t\t\t\t`interface CreateClient {\n\t(repositoryNameOrEndpoint: string, options?: ${clientImportName}.ClientConfig): ${clientImportName}.Client<AllDocumentTypes>;\n}`,\n\t\t\t\t\tclientModuleCode,\n\t\t\t\t);\n\t\t\t\tclientModuleCode = addSection(\n\t\t\t\t\t`interface CreateWriteClient {\n\t(repositoryNameOrEndpoint: string, options: ${clientImportName}.WriteClientConfig): ${clientImportName}.WriteClient<AllDocumentTypes>;\n}`,\n\t\t\t\t\tclientModuleCode,\n\t\t\t\t);\n\t\t\t\tclientModuleCode = addSection(\n\t\t\t\t\t`interface CreateMigration {\n\t(): ${clientImportName}.Migration<AllDocumentTypes>;\n}`,\n\t\t\t\t\tclientModuleCode,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tclientModuleCode = addSection(\n\t\t\t\t\t`interface CreateClient {\n\t(repositoryNameOrEndpoint: string, options?: ${clientImportName}.ClientConfig): ${clientImportName}.Client;\n}`,\n\t\t\t\t\tclientModuleCode,\n\t\t\t\t);\n\t\t\t\tclientModuleCode = addSection(\n\t\t\t\t\t`interface CreateWriteClient {\n\t(repositoryNameOrEndpoint: string, options?: ${clientImportName}.WriteClientConfig): ${clientImportName}.WriteClient;\n}`,\n\t\t\t\t\tclientModuleCode,\n\t\t\t\t);\n\t\t\t\tclientModuleCode = addSection(\n\t\t\t\t\t`interface CreateMigration {\n\t(): ${clientImportName}.Migration;\n}`,\n\t\t\t\t\tclientModuleCode,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif (config.clientIntegration.includeContentNamespace) {\n\t\t\tclientModuleCode = addSection(\n\t\t\t\tsource`\n\t\t\t\t\tnamespace Content {\n\t\t\t\t\t\texport type {\n\t\t\t\t\t\t\t${contentTypeNames.join(\",\\n\")}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t`,\n\t\t\t\tclientModuleCode,\n\t\t\t);\n\t\t}\n\n\t\tcode = addSection(\n\t\t\tsource`\n\t\t\t\tdeclare module \"@prismicio/client\" {\n\t\t\t\t\t${clientModuleCode}\n\t\t\t\t}\n\t\t\t`,\n\t\t\tcode,\n\t\t);\n\t}\n\n\treturn code;\n}\n"],"names":["QuickLRU","addLine","addSection","buildCustomTypeType","buildUnion","buildSharedSliceType","source"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"generateTypes.cjs","names":["QuickLRU","addLine","addSection","buildCustomTypeType","buildUnion","buildSharedSliceType"],"sources":["../src/generateTypes.ts"],"sourcesContent":["import type { CustomTypeModel, SharedSliceModel } from \"@prismicio/client\";\nimport { source } from \"common-tags\";\nimport QuickLRU from \"quick-lru\";\n\nimport { addLine } from \"./lib/addLine\";\nimport { addSection } from \"./lib/addSection\";\nimport { buildCustomTypeType } from \"./lib/buildCustomTypeType\";\nimport { buildSharedSliceType } from \"./lib/buildSharedSliceType\";\nimport { buildUnion } from \"./lib/buildUnion\";\nimport type { FieldConfigs } from \"./types\";\n\nexport type TypesProvider = \"@prismicio/client\" | \"@prismicio/types\";\n\nconst cache = new QuickLRU<string, unknown>({ maxSize: 1000 });\n\nexport type GenerateTypesConfig = {\n\tcustomTypeModels?: CustomTypeModel[];\n\tsharedSliceModels?: SharedSliceModel[];\n\tlocaleIDs?: string[];\n\tfieldConfigs?: FieldConfigs;\n\ttypesProvider?: TypesProvider;\n\tclientIntegration?: {\n\t\tincludeCreateClientInterface?: boolean;\n\t\tincludeContentNamespace?: boolean;\n\t};\n\tcache?: boolean;\n};\n\nexport function generateTypes(config: GenerateTypesConfig = {}): string {\n\tconst fieldConfigs = config.fieldConfigs || {};\n\tconst shouldUseCache = config.cache ?? true;\n\n\tlet code = \"\";\n\n\tconst typesProvider = config.typesProvider || \"@prismicio/types\";\n\tlet clientImportName = \"prismic\";\n\n\tcode = addLine(`import type * as prismic from \"${typesProvider}\";`, code);\n\n\tif (\n\t\tconfig.clientIntegration?.includeCreateClientInterface ||\n\t\tconfig.clientIntegration?.includeContentNamespace\n\t) {\n\t\tif (typesProvider !== \"@prismicio/client\") {\n\t\t\tclientImportName = \"prismicClient\";\n\n\t\t\t// This import declaration would be a duplicate if the types\n\t\t\t// provider is @prismicio/client.\n\t\t\tcode = addLine(`import type * as ${clientImportName} from \"@prismicio/client\";`, code);\n\t\t}\n\t}\n\n\tcode = addSection(`type Simplify<T> = { [KeyType in keyof T]: T[KeyType] };`, code);\n\n\tcode = addSection(\n\t\t`\ntype PickContentRelationshipFieldData<\n\tTRelationship extends prismic.CustomTypeModelFetchCustomTypeLevel1 | prismic.CustomTypeModelFetchCustomTypeLevel2 | prismic.CustomTypeModelFetchGroupLevel1 | prismic.CustomTypeModelFetchGroupLevel2,\n\tTData extends Record<string, prismic.AnyRegularField | prismic.GroupField | prismic.NestedGroupField | prismic.SliceZone>,\n\tTLang extends string\n> = |\n\t// Content relationship fields\n\t{\n\t\t[TSubRelationship in Extract<\n\t\t\tTRelationship[\"fields\"][number], prismic.CustomTypeModelFetchContentRelationshipLevel1\n\t\t> as TSubRelationship[\"id\"]]:\n\t\t\tContentRelationshipFieldWithData<TSubRelationship[\"customtypes\"], TLang>;\n\t} &\n\t// Group\n\t{\n\t\t[TGroup in Extract<\n\t\t\tTRelationship[\"fields\"][number], prismic.CustomTypeModelFetchGroupLevel1 | prismic.CustomTypeModelFetchGroupLevel2\n\t\t> as TGroup[\"id\"]]:\n\t\t\tTData[TGroup[\"id\"]] extends prismic.GroupField<infer TGroupData>\n\t\t\t\t? prismic.GroupField<PickContentRelationshipFieldData<TGroup, TGroupData, TLang>>\n\t\t\t\t: never\n\t} &\n\t// Other fields\n\t{\n\t\t[TFieldKey in Extract<TRelationship[\"fields\"][number], string>]:\n\t\t\tTFieldKey extends keyof TData ? TData[TFieldKey] : never;\n\t};\n\ntype ContentRelationshipFieldWithData<\n\tTCustomType extends readonly (prismic.CustomTypeModelFetchCustomTypeLevel1 | string)[] | readonly (prismic.CustomTypeModelFetchCustomTypeLevel2 | string)[],\n\tTLang extends string = string\n> = {\n\t[ID in Exclude<TCustomType[number], string>[\"id\"]]:\n\t\tprismic.ContentRelationshipField<\n\t\t\tID,\n\t\t\tTLang,\n\t\t\tPickContentRelationshipFieldData<\n\t\t\t\tExtract<TCustomType[number], { id: ID }>,\n\t\t\t\tExtract<prismic.Content.AllDocumentTypes, { type: ID }>[\"data\"],\n\t\t\t\tTLang\n\t\t\t>\n\t\t>\n}[Exclude<TCustomType[number], string>[\"id\"]];\n`,\n\t\tcode,\n\t);\n\n\tconst contentTypeNames: string[] = [];\n\n\tif (config.customTypeModels) {\n\t\tconst allDocumentTypesTypeNames: string[] = [];\n\n\t\tfor (const model of config.customTypeModels) {\n\t\t\tconst customTypeType = buildCustomTypeType({\n\t\t\t\tmodel,\n\t\t\t\tlocaleIDs: config.localeIDs,\n\t\t\t\tfieldConfigs,\n\t\t\t\tcache: shouldUseCache ? cache : undefined,\n\t\t\t});\n\n\t\t\tfor (const auxiliaryType of customTypeType.auxiliaryTypes) {\n\t\t\t\tcode = addSection(auxiliaryType.code, code);\n\t\t\t}\n\n\t\t\tcode = addSection(customTypeType.code, code);\n\n\t\t\tallDocumentTypesTypeNames.push(customTypeType.name);\n\n\t\t\tcontentTypeNames.push(customTypeType.name);\n\t\t\tcontentTypeNames.push(...customTypeType.contentTypeNames);\n\t\t}\n\n\t\tif (config.customTypeModels.length > 0) {\n\t\t\tconst allDocumentTypesUnionName = \"AllDocumentTypes\";\n\t\t\tconst allDocumentTypesUnion = buildUnion(allDocumentTypesTypeNames);\n\n\t\t\tcode = addSection(\n\t\t\t\t`export type ${allDocumentTypesUnionName} = ${allDocumentTypesUnion};`,\n\t\t\t\tcode,\n\t\t\t);\n\n\t\t\tcontentTypeNames.push(allDocumentTypesUnionName);\n\t\t}\n\t}\n\n\tif (config.sharedSliceModels) {\n\t\tfor (const model of config.sharedSliceModels) {\n\t\t\tconst sharedSliceType = buildSharedSliceType({\n\t\t\t\tmodel,\n\t\t\t\tfieldConfigs,\n\t\t\t\tcache: shouldUseCache ? cache : undefined,\n\t\t\t});\n\n\t\t\tfor (const auxiliaryType of sharedSliceType.auxiliaryTypes) {\n\t\t\t\tcode = addSection(auxiliaryType.code, code);\n\t\t\t}\n\n\t\t\tcode = addSection(sharedSliceType.code, code);\n\n\t\t\tcontentTypeNames.push(sharedSliceType.name);\n\t\t\tcontentTypeNames.push(...sharedSliceType.contentTypeNames);\n\t\t}\n\t}\n\n\tif (\n\t\tconfig.clientIntegration?.includeCreateClientInterface ||\n\t\tconfig.clientIntegration?.includeContentNamespace\n\t) {\n\t\tlet clientModuleCode = \"\";\n\n\t\tif (config.clientIntegration.includeCreateClientInterface) {\n\t\t\tif ((config.customTypeModels?.length || 0) > 0) {\n\t\t\t\tclientModuleCode = addSection(\n\t\t\t\t\t`interface CreateClient {\n\t(repositoryNameOrEndpoint: string, options?: ${clientImportName}.ClientConfig): ${clientImportName}.Client<AllDocumentTypes>;\n}`,\n\t\t\t\t\tclientModuleCode,\n\t\t\t\t);\n\t\t\t\tclientModuleCode = addSection(\n\t\t\t\t\t`interface CreateWriteClient {\n\t(repositoryNameOrEndpoint: string, options: ${clientImportName}.WriteClientConfig): ${clientImportName}.WriteClient<AllDocumentTypes>;\n}`,\n\t\t\t\t\tclientModuleCode,\n\t\t\t\t);\n\t\t\t\tclientModuleCode = addSection(\n\t\t\t\t\t`interface CreateMigration {\n\t(): ${clientImportName}.Migration<AllDocumentTypes>;\n}`,\n\t\t\t\t\tclientModuleCode,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tclientModuleCode = addSection(\n\t\t\t\t\t`interface CreateClient {\n\t(repositoryNameOrEndpoint: string, options?: ${clientImportName}.ClientConfig): ${clientImportName}.Client;\n}`,\n\t\t\t\t\tclientModuleCode,\n\t\t\t\t);\n\t\t\t\tclientModuleCode = addSection(\n\t\t\t\t\t`interface CreateWriteClient {\n\t(repositoryNameOrEndpoint: string, options?: ${clientImportName}.WriteClientConfig): ${clientImportName}.WriteClient;\n}`,\n\t\t\t\t\tclientModuleCode,\n\t\t\t\t);\n\t\t\t\tclientModuleCode = addSection(\n\t\t\t\t\t`interface CreateMigration {\n\t(): ${clientImportName}.Migration;\n}`,\n\t\t\t\t\tclientModuleCode,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif (config.clientIntegration.includeContentNamespace) {\n\t\t\tclientModuleCode = addSection(\n\t\t\t\tsource`\n\t\t\t\t\tnamespace Content {\n\t\t\t\t\t\texport type {\n\t\t\t\t\t\t\t${contentTypeNames.join(\",\\n\")}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t`,\n\t\t\t\tclientModuleCode,\n\t\t\t);\n\t\t}\n\n\t\tcode = addSection(\n\t\t\tsource`\n\t\t\t\tdeclare module \"@prismicio/client\" {\n\t\t\t\t\t${clientModuleCode}\n\t\t\t\t}\n\t\t\t`,\n\t\t\tcode,\n\t\t);\n\t}\n\n\treturn code;\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FieldConfigs } from "./types.cjs";
|
|
2
|
+
import { CustomTypeModel, SharedSliceModel } from "@prismicio/client";
|
|
3
|
+
|
|
4
|
+
//#region src/generateTypes.d.ts
|
|
5
|
+
type TypesProvider = "@prismicio/client" | "@prismicio/types";
|
|
6
|
+
type GenerateTypesConfig = {
|
|
7
|
+
customTypeModels?: CustomTypeModel[];
|
|
8
|
+
sharedSliceModels?: SharedSliceModel[];
|
|
9
|
+
localeIDs?: string[];
|
|
10
|
+
fieldConfigs?: FieldConfigs;
|
|
11
|
+
typesProvider?: TypesProvider;
|
|
12
|
+
clientIntegration?: {
|
|
13
|
+
includeCreateClientInterface?: boolean;
|
|
14
|
+
includeContentNamespace?: boolean;
|
|
15
|
+
};
|
|
16
|
+
cache?: boolean;
|
|
17
|
+
};
|
|
18
|
+
declare function generateTypes(config?: GenerateTypesConfig): string;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { GenerateTypesConfig, TypesProvider, generateTypes };
|
|
21
|
+
//# sourceMappingURL=generateTypes.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateTypes.d.cts","names":[],"sources":["../src/generateTypes.ts"],"mappings":";;;;KAWY,aAAA;AAAA,KAIA,mBAAA;EACX,gBAAA,GAAmB,eAAA;EACnB,iBAAA,GAAoB,gBAAA;EACpB,SAAA;EACA,YAAA,GAAe,YAAA;EACf,aAAA,GAAgB,aAAA;EAChB,iBAAA;IACC,4BAAA;IACA,uBAAA;EAAA;EAED,KAAA;AAAA;AAAA,iBAGe,aAAA,CAAc,MAAA,GAAQ,mBAAA"}
|
package/dist/generateTypes.d.ts
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { FieldConfigs } from "./types.js";
|
|
2
|
+
import { CustomTypeModel, SharedSliceModel } from "@prismicio/client";
|
|
3
|
+
|
|
4
|
+
//#region src/generateTypes.d.ts
|
|
5
|
+
type TypesProvider = "@prismicio/client" | "@prismicio/types";
|
|
6
|
+
type GenerateTypesConfig = {
|
|
7
|
+
customTypeModels?: CustomTypeModel[];
|
|
8
|
+
sharedSliceModels?: SharedSliceModel[];
|
|
9
|
+
localeIDs?: string[];
|
|
10
|
+
fieldConfigs?: FieldConfigs;
|
|
11
|
+
typesProvider?: TypesProvider;
|
|
12
|
+
clientIntegration?: {
|
|
13
|
+
includeCreateClientInterface?: boolean;
|
|
14
|
+
includeContentNamespace?: boolean;
|
|
15
|
+
};
|
|
16
|
+
cache?: boolean;
|
|
15
17
|
};
|
|
16
|
-
|
|
18
|
+
declare function generateTypes(config?: GenerateTypesConfig): string;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { GenerateTypesConfig, TypesProvider, generateTypes };
|
|
21
|
+
//# sourceMappingURL=generateTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateTypes.d.ts","names":[],"sources":["../src/generateTypes.ts"],"mappings":";;;;KAWY,aAAA;AAAA,KAIA,mBAAA;EACX,gBAAA,GAAmB,eAAA;EACnB,iBAAA,GAAoB,gBAAA;EACpB,SAAA;EACA,YAAA,GAAe,YAAA;EACf,aAAA,GAAgB,aAAA;EAChB,iBAAA;IACC,4BAAA;IACA,uBAAA;EAAA;EAED,KAAA;AAAA;AAAA,iBAGe,aAAA,CAAc,MAAA,GAAQ,mBAAA"}
|
package/dist/generateTypes.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { source } from "common-tags";
|
|
2
|
-
import QuickLRU from './_node_modules/quick-lru/index.js';
|
|
3
1
|
import { addLine } from "./lib/addLine.js";
|
|
4
2
|
import { addSection } from "./lib/addSection.js";
|
|
3
|
+
import { buildUnion } from "./lib/buildUnion.js";
|
|
5
4
|
import { buildCustomTypeType } from "./lib/buildCustomTypeType.js";
|
|
6
5
|
import { buildSharedSliceType } from "./lib/buildSharedSliceType.js";
|
|
7
|
-
import {
|
|
6
|
+
import { source } from "common-tags";
|
|
7
|
+
import QuickLRU from "quick-lru";
|
|
8
|
+
//#region src/generateTypes.ts
|
|
8
9
|
const cache = new QuickLRU({ maxSize: 1e3 });
|
|
9
10
|
function generateTypes(config = {}) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
code = addSection(`
|
|
11
|
+
const fieldConfigs = config.fieldConfigs || {};
|
|
12
|
+
const shouldUseCache = config.cache ?? true;
|
|
13
|
+
let code = "";
|
|
14
|
+
const typesProvider = config.typesProvider || "@prismicio/types";
|
|
15
|
+
let clientImportName = "prismic";
|
|
16
|
+
code = addLine(`import type * as prismic from "${typesProvider}";`, code);
|
|
17
|
+
if (config.clientIntegration?.includeCreateClientInterface || config.clientIntegration?.includeContentNamespace) {
|
|
18
|
+
if (typesProvider !== "@prismicio/client") {
|
|
19
|
+
clientImportName = "prismicClient";
|
|
20
|
+
code = addLine(`import type * as ${clientImportName} from "@prismicio/client";`, code);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
code = addSection(`type Simplify<T> = { [KeyType in keyof T]: T[KeyType] };`, code);
|
|
24
|
+
code = addSection(`
|
|
25
25
|
type PickContentRelationshipFieldData<
|
|
26
26
|
TRelationship extends prismic.CustomTypeModelFetchCustomTypeLevel1 | prismic.CustomTypeModelFetchCustomTypeLevel2 | prismic.CustomTypeModelFetchGroupLevel1 | prismic.CustomTypeModelFetchGroupLevel2,
|
|
27
27
|
TData extends Record<string, prismic.AnyRegularField | prismic.GroupField | prismic.NestedGroupField | prismic.SliceZone>,
|
|
@@ -65,89 +65,78 @@ type ContentRelationshipFieldWithData<
|
|
|
65
65
|
>
|
|
66
66
|
}[Exclude<TCustomType[number], string>["id"]];
|
|
67
67
|
`, code);
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
contentTypeNames.push(...sharedSliceType.contentTypeNames);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
if (((_c = config.clientIntegration) == null ? void 0 : _c.includeCreateClientInterface) || ((_d = config.clientIntegration) == null ? void 0 : _d.includeContentNamespace)) {
|
|
109
|
-
let clientModuleCode = "";
|
|
110
|
-
if (config.clientIntegration.includeCreateClientInterface) {
|
|
111
|
-
if ((((_e = config.customTypeModels) == null ? void 0 : _e.length) || 0) > 0) {
|
|
112
|
-
clientModuleCode = addSection(`interface CreateClient {
|
|
68
|
+
const contentTypeNames = [];
|
|
69
|
+
if (config.customTypeModels) {
|
|
70
|
+
const allDocumentTypesTypeNames = [];
|
|
71
|
+
for (const model of config.customTypeModels) {
|
|
72
|
+
const customTypeType = buildCustomTypeType({
|
|
73
|
+
model,
|
|
74
|
+
localeIDs: config.localeIDs,
|
|
75
|
+
fieldConfigs,
|
|
76
|
+
cache: shouldUseCache ? cache : void 0
|
|
77
|
+
});
|
|
78
|
+
for (const auxiliaryType of customTypeType.auxiliaryTypes) code = addSection(auxiliaryType.code, code);
|
|
79
|
+
code = addSection(customTypeType.code, code);
|
|
80
|
+
allDocumentTypesTypeNames.push(customTypeType.name);
|
|
81
|
+
contentTypeNames.push(customTypeType.name);
|
|
82
|
+
contentTypeNames.push(...customTypeType.contentTypeNames);
|
|
83
|
+
}
|
|
84
|
+
if (config.customTypeModels.length > 0) {
|
|
85
|
+
const allDocumentTypesUnionName = "AllDocumentTypes";
|
|
86
|
+
code = addSection(`export type ${allDocumentTypesUnionName} = ${buildUnion(allDocumentTypesTypeNames)};`, code);
|
|
87
|
+
contentTypeNames.push(allDocumentTypesUnionName);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (config.sharedSliceModels) for (const model of config.sharedSliceModels) {
|
|
91
|
+
const sharedSliceType = buildSharedSliceType({
|
|
92
|
+
model,
|
|
93
|
+
fieldConfigs,
|
|
94
|
+
cache: shouldUseCache ? cache : void 0
|
|
95
|
+
});
|
|
96
|
+
for (const auxiliaryType of sharedSliceType.auxiliaryTypes) code = addSection(auxiliaryType.code, code);
|
|
97
|
+
code = addSection(sharedSliceType.code, code);
|
|
98
|
+
contentTypeNames.push(sharedSliceType.name);
|
|
99
|
+
contentTypeNames.push(...sharedSliceType.contentTypeNames);
|
|
100
|
+
}
|
|
101
|
+
if (config.clientIntegration?.includeCreateClientInterface || config.clientIntegration?.includeContentNamespace) {
|
|
102
|
+
let clientModuleCode = "";
|
|
103
|
+
if (config.clientIntegration.includeCreateClientInterface) if ((config.customTypeModels?.length || 0) > 0) {
|
|
104
|
+
clientModuleCode = addSection(`interface CreateClient {
|
|
113
105
|
(repositoryNameOrEndpoint: string, options?: ${clientImportName}.ClientConfig): ${clientImportName}.Client<AllDocumentTypes>;
|
|
114
106
|
}`, clientModuleCode);
|
|
115
|
-
|
|
107
|
+
clientModuleCode = addSection(`interface CreateWriteClient {
|
|
116
108
|
(repositoryNameOrEndpoint: string, options: ${clientImportName}.WriteClientConfig): ${clientImportName}.WriteClient<AllDocumentTypes>;
|
|
117
109
|
}`, clientModuleCode);
|
|
118
|
-
|
|
110
|
+
clientModuleCode = addSection(`interface CreateMigration {
|
|
119
111
|
(): ${clientImportName}.Migration<AllDocumentTypes>;
|
|
120
112
|
}`, clientModuleCode);
|
|
121
|
-
|
|
122
|
-
|
|
113
|
+
} else {
|
|
114
|
+
clientModuleCode = addSection(`interface CreateClient {
|
|
123
115
|
(repositoryNameOrEndpoint: string, options?: ${clientImportName}.ClientConfig): ${clientImportName}.Client;
|
|
124
116
|
}`, clientModuleCode);
|
|
125
|
-
|
|
117
|
+
clientModuleCode = addSection(`interface CreateWriteClient {
|
|
126
118
|
(repositoryNameOrEndpoint: string, options?: ${clientImportName}.WriteClientConfig): ${clientImportName}.WriteClient;
|
|
127
119
|
}`, clientModuleCode);
|
|
128
|
-
|
|
120
|
+
clientModuleCode = addSection(`interface CreateMigration {
|
|
129
121
|
(): ${clientImportName}.Migration;
|
|
130
122
|
}`, clientModuleCode);
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
if (config.clientIntegration.includeContentNamespace) {
|
|
134
|
-
clientModuleCode = addSection(source`
|
|
123
|
+
}
|
|
124
|
+
if (config.clientIntegration.includeContentNamespace) clientModuleCode = addSection(source`
|
|
135
125
|
namespace Content {
|
|
136
126
|
export type {
|
|
137
127
|
${contentTypeNames.join(",\n")}
|
|
138
128
|
}
|
|
139
129
|
}
|
|
140
130
|
`, clientModuleCode);
|
|
141
|
-
|
|
142
|
-
code = addSection(source`
|
|
131
|
+
code = addSection(source`
|
|
143
132
|
declare module "@prismicio/client" {
|
|
144
133
|
${clientModuleCode}
|
|
145
134
|
}
|
|
146
135
|
`, code);
|
|
147
|
-
|
|
148
|
-
|
|
136
|
+
}
|
|
137
|
+
return code;
|
|
149
138
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
//# sourceMappingURL=generateTypes.js.map
|
|
139
|
+
//#endregion
|
|
140
|
+
export { generateTypes };
|
|
141
|
+
|
|
142
|
+
//# sourceMappingURL=generateTypes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateTypes.js","sources":["../../src/generateTypes.ts"],"sourcesContent":["import type { CustomTypeModel, SharedSliceModel } from \"@prismicio/client\";\nimport { source } from \"common-tags\";\nimport QuickLRU from \"quick-lru\";\n\nimport { addLine } from \"./lib/addLine\";\nimport { addSection } from \"./lib/addSection\";\nimport { buildCustomTypeType } from \"./lib/buildCustomTypeType\";\nimport { buildSharedSliceType } from \"./lib/buildSharedSliceType\";\nimport { buildUnion } from \"./lib/buildUnion\";\n\nimport { FieldConfigs } from \"./types\";\n\nexport type TypesProvider = \"@prismicio/client\" | \"@prismicio/types\";\n\nconst cache = new QuickLRU<string, unknown>({ maxSize: 1000 });\n\nexport type GenerateTypesConfig = {\n\tcustomTypeModels?: CustomTypeModel[];\n\tsharedSliceModels?: SharedSliceModel[];\n\tlocaleIDs?: string[];\n\tfieldConfigs?: FieldConfigs;\n\ttypesProvider?: TypesProvider;\n\tclientIntegration?: {\n\t\tincludeCreateClientInterface?: boolean;\n\t\tincludeContentNamespace?: boolean;\n\t};\n\tcache?: boolean;\n};\n\nexport function generateTypes(config: GenerateTypesConfig = {}): string {\n\tconst fieldConfigs = config.fieldConfigs || {};\n\tconst shouldUseCache = config.cache ?? true;\n\n\tlet code = \"\";\n\n\tconst typesProvider = config.typesProvider || \"@prismicio/types\";\n\tlet clientImportName = \"prismic\";\n\n\tcode = addLine(`import type * as prismic from \"${typesProvider}\";`, code);\n\n\tif (\n\t\tconfig.clientIntegration?.includeCreateClientInterface ||\n\t\tconfig.clientIntegration?.includeContentNamespace\n\t) {\n\t\tif (typesProvider !== \"@prismicio/client\") {\n\t\t\tclientImportName = \"prismicClient\";\n\n\t\t\t// This import declaration would be a duplicate if the types\n\t\t\t// provider is @prismicio/client.\n\t\t\tcode = addLine(\n\t\t\t\t`import type * as ${clientImportName} from \"@prismicio/client\";`,\n\t\t\t\tcode,\n\t\t\t);\n\t\t}\n\t}\n\n\tcode = addSection(\n\t\t`type Simplify<T> = { [KeyType in keyof T]: T[KeyType] };`,\n\t\tcode,\n\t);\n\n\tcode = addSection(\n\t\t`\ntype PickContentRelationshipFieldData<\n\tTRelationship extends prismic.CustomTypeModelFetchCustomTypeLevel1 | prismic.CustomTypeModelFetchCustomTypeLevel2 | prismic.CustomTypeModelFetchGroupLevel1 | prismic.CustomTypeModelFetchGroupLevel2,\n\tTData extends Record<string, prismic.AnyRegularField | prismic.GroupField | prismic.NestedGroupField | prismic.SliceZone>,\n\tTLang extends string\n> = |\n\t// Content relationship fields\n\t{\n\t\t[TSubRelationship in Extract<\n\t\t\tTRelationship[\"fields\"][number], prismic.CustomTypeModelFetchContentRelationshipLevel1\n\t\t> as TSubRelationship[\"id\"]]:\n\t\t\tContentRelationshipFieldWithData<TSubRelationship[\"customtypes\"], TLang>;\n\t} &\n\t// Group\n\t{\n\t\t[TGroup in Extract<\n\t\t\tTRelationship[\"fields\"][number], prismic.CustomTypeModelFetchGroupLevel1 | prismic.CustomTypeModelFetchGroupLevel2\n\t\t> as TGroup[\"id\"]]:\n\t\t\tTData[TGroup[\"id\"]] extends prismic.GroupField<infer TGroupData>\n\t\t\t\t? prismic.GroupField<PickContentRelationshipFieldData<TGroup, TGroupData, TLang>>\n\t\t\t\t: never\n\t} &\n\t// Other fields\n\t{\n\t\t[TFieldKey in Extract<TRelationship[\"fields\"][number], string>]:\n\t\t\tTFieldKey extends keyof TData ? TData[TFieldKey] : never;\n\t};\n\ntype ContentRelationshipFieldWithData<\n\tTCustomType extends readonly (prismic.CustomTypeModelFetchCustomTypeLevel1 | string)[] | readonly (prismic.CustomTypeModelFetchCustomTypeLevel2 | string)[],\n\tTLang extends string = string\n> = {\n\t[ID in Exclude<TCustomType[number], string>[\"id\"]]:\n\t\tprismic.ContentRelationshipField<\n\t\t\tID,\n\t\t\tTLang,\n\t\t\tPickContentRelationshipFieldData<\n\t\t\t\tExtract<TCustomType[number], { id: ID }>,\n\t\t\t\tExtract<prismic.Content.AllDocumentTypes, { type: ID }>[\"data\"],\n\t\t\t\tTLang\n\t\t\t>\n\t\t>\n}[Exclude<TCustomType[number], string>[\"id\"]];\n`,\n\t\tcode,\n\t);\n\n\tconst contentTypeNames: string[] = [];\n\n\tif (config.customTypeModels) {\n\t\tconst allDocumentTypesTypeNames: string[] = [];\n\n\t\tfor (const model of config.customTypeModels) {\n\t\t\tconst customTypeType = buildCustomTypeType({\n\t\t\t\tmodel,\n\t\t\t\tlocaleIDs: config.localeIDs,\n\t\t\t\tfieldConfigs,\n\t\t\t\tcache: shouldUseCache ? cache : undefined,\n\t\t\t});\n\n\t\t\tfor (const auxiliaryType of customTypeType.auxiliaryTypes) {\n\t\t\t\tcode = addSection(auxiliaryType.code, code);\n\t\t\t}\n\n\t\t\tcode = addSection(customTypeType.code, code);\n\n\t\t\tallDocumentTypesTypeNames.push(customTypeType.name);\n\n\t\t\tcontentTypeNames.push(customTypeType.name);\n\t\t\tcontentTypeNames.push(...customTypeType.contentTypeNames);\n\t\t}\n\n\t\tif (config.customTypeModels.length > 0) {\n\t\t\tconst allDocumentTypesUnionName = \"AllDocumentTypes\";\n\t\t\tconst allDocumentTypesUnion = buildUnion(allDocumentTypesTypeNames);\n\n\t\t\tcode = addSection(\n\t\t\t\t`export type ${allDocumentTypesUnionName} = ${allDocumentTypesUnion};`,\n\t\t\t\tcode,\n\t\t\t);\n\n\t\t\tcontentTypeNames.push(allDocumentTypesUnionName);\n\t\t}\n\t}\n\n\tif (config.sharedSliceModels) {\n\t\tfor (const model of config.sharedSliceModels) {\n\t\t\tconst sharedSliceType = buildSharedSliceType({\n\t\t\t\tmodel,\n\t\t\t\tfieldConfigs,\n\t\t\t\tcache: shouldUseCache ? cache : undefined,\n\t\t\t});\n\n\t\t\tfor (const auxiliaryType of sharedSliceType.auxiliaryTypes) {\n\t\t\t\tcode = addSection(auxiliaryType.code, code);\n\t\t\t}\n\n\t\t\tcode = addSection(sharedSliceType.code, code);\n\n\t\t\tcontentTypeNames.push(sharedSliceType.name);\n\t\t\tcontentTypeNames.push(...sharedSliceType.contentTypeNames);\n\t\t}\n\t}\n\n\tif (\n\t\tconfig.clientIntegration?.includeCreateClientInterface ||\n\t\tconfig.clientIntegration?.includeContentNamespace\n\t) {\n\t\tlet clientModuleCode = \"\";\n\n\t\tif (config.clientIntegration.includeCreateClientInterface) {\n\t\t\tif ((config.customTypeModels?.length || 0) > 0) {\n\t\t\t\tclientModuleCode = addSection(\n\t\t\t\t\t`interface CreateClient {\n\t(repositoryNameOrEndpoint: string, options?: ${clientImportName}.ClientConfig): ${clientImportName}.Client<AllDocumentTypes>;\n}`,\n\t\t\t\t\tclientModuleCode,\n\t\t\t\t);\n\t\t\t\tclientModuleCode = addSection(\n\t\t\t\t\t`interface CreateWriteClient {\n\t(repositoryNameOrEndpoint: string, options: ${clientImportName}.WriteClientConfig): ${clientImportName}.WriteClient<AllDocumentTypes>;\n}`,\n\t\t\t\t\tclientModuleCode,\n\t\t\t\t);\n\t\t\t\tclientModuleCode = addSection(\n\t\t\t\t\t`interface CreateMigration {\n\t(): ${clientImportName}.Migration<AllDocumentTypes>;\n}`,\n\t\t\t\t\tclientModuleCode,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tclientModuleCode = addSection(\n\t\t\t\t\t`interface CreateClient {\n\t(repositoryNameOrEndpoint: string, options?: ${clientImportName}.ClientConfig): ${clientImportName}.Client;\n}`,\n\t\t\t\t\tclientModuleCode,\n\t\t\t\t);\n\t\t\t\tclientModuleCode = addSection(\n\t\t\t\t\t`interface CreateWriteClient {\n\t(repositoryNameOrEndpoint: string, options?: ${clientImportName}.WriteClientConfig): ${clientImportName}.WriteClient;\n}`,\n\t\t\t\t\tclientModuleCode,\n\t\t\t\t);\n\t\t\t\tclientModuleCode = addSection(\n\t\t\t\t\t`interface CreateMigration {\n\t(): ${clientImportName}.Migration;\n}`,\n\t\t\t\t\tclientModuleCode,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif (config.clientIntegration.includeContentNamespace) {\n\t\t\tclientModuleCode = addSection(\n\t\t\t\tsource`\n\t\t\t\t\tnamespace Content {\n\t\t\t\t\t\texport type {\n\t\t\t\t\t\t\t${contentTypeNames.join(\",\\n\")}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t`,\n\t\t\t\tclientModuleCode,\n\t\t\t);\n\t\t}\n\n\t\tcode = addSection(\n\t\t\tsource`\n\t\t\t\tdeclare module \"@prismicio/client\" {\n\t\t\t\t\t${clientModuleCode}\n\t\t\t\t}\n\t\t\t`,\n\t\t\tcode,\n\t\t);\n\t}\n\n\treturn code;\n}\n"],"names":[],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"generateTypes.js","names":[],"sources":["../src/generateTypes.ts"],"sourcesContent":["import type { CustomTypeModel, SharedSliceModel } from \"@prismicio/client\";\nimport { source } from \"common-tags\";\nimport QuickLRU from \"quick-lru\";\n\nimport { addLine } from \"./lib/addLine\";\nimport { addSection } from \"./lib/addSection\";\nimport { buildCustomTypeType } from \"./lib/buildCustomTypeType\";\nimport { buildSharedSliceType } from \"./lib/buildSharedSliceType\";\nimport { buildUnion } from \"./lib/buildUnion\";\nimport type { FieldConfigs } from \"./types\";\n\nexport type TypesProvider = \"@prismicio/client\" | \"@prismicio/types\";\n\nconst cache = new QuickLRU<string, unknown>({ maxSize: 1000 });\n\nexport type GenerateTypesConfig = {\n\tcustomTypeModels?: CustomTypeModel[];\n\tsharedSliceModels?: SharedSliceModel[];\n\tlocaleIDs?: string[];\n\tfieldConfigs?: FieldConfigs;\n\ttypesProvider?: TypesProvider;\n\tclientIntegration?: {\n\t\tincludeCreateClientInterface?: boolean;\n\t\tincludeContentNamespace?: boolean;\n\t};\n\tcache?: boolean;\n};\n\nexport function generateTypes(config: GenerateTypesConfig = {}): string {\n\tconst fieldConfigs = config.fieldConfigs || {};\n\tconst shouldUseCache = config.cache ?? true;\n\n\tlet code = \"\";\n\n\tconst typesProvider = config.typesProvider || \"@prismicio/types\";\n\tlet clientImportName = \"prismic\";\n\n\tcode = addLine(`import type * as prismic from \"${typesProvider}\";`, code);\n\n\tif (\n\t\tconfig.clientIntegration?.includeCreateClientInterface ||\n\t\tconfig.clientIntegration?.includeContentNamespace\n\t) {\n\t\tif (typesProvider !== \"@prismicio/client\") {\n\t\t\tclientImportName = \"prismicClient\";\n\n\t\t\t// This import declaration would be a duplicate if the types\n\t\t\t// provider is @prismicio/client.\n\t\t\tcode = addLine(`import type * as ${clientImportName} from \"@prismicio/client\";`, code);\n\t\t}\n\t}\n\n\tcode = addSection(`type Simplify<T> = { [KeyType in keyof T]: T[KeyType] };`, code);\n\n\tcode = addSection(\n\t\t`\ntype PickContentRelationshipFieldData<\n\tTRelationship extends prismic.CustomTypeModelFetchCustomTypeLevel1 | prismic.CustomTypeModelFetchCustomTypeLevel2 | prismic.CustomTypeModelFetchGroupLevel1 | prismic.CustomTypeModelFetchGroupLevel2,\n\tTData extends Record<string, prismic.AnyRegularField | prismic.GroupField | prismic.NestedGroupField | prismic.SliceZone>,\n\tTLang extends string\n> = |\n\t// Content relationship fields\n\t{\n\t\t[TSubRelationship in Extract<\n\t\t\tTRelationship[\"fields\"][number], prismic.CustomTypeModelFetchContentRelationshipLevel1\n\t\t> as TSubRelationship[\"id\"]]:\n\t\t\tContentRelationshipFieldWithData<TSubRelationship[\"customtypes\"], TLang>;\n\t} &\n\t// Group\n\t{\n\t\t[TGroup in Extract<\n\t\t\tTRelationship[\"fields\"][number], prismic.CustomTypeModelFetchGroupLevel1 | prismic.CustomTypeModelFetchGroupLevel2\n\t\t> as TGroup[\"id\"]]:\n\t\t\tTData[TGroup[\"id\"]] extends prismic.GroupField<infer TGroupData>\n\t\t\t\t? prismic.GroupField<PickContentRelationshipFieldData<TGroup, TGroupData, TLang>>\n\t\t\t\t: never\n\t} &\n\t// Other fields\n\t{\n\t\t[TFieldKey in Extract<TRelationship[\"fields\"][number], string>]:\n\t\t\tTFieldKey extends keyof TData ? TData[TFieldKey] : never;\n\t};\n\ntype ContentRelationshipFieldWithData<\n\tTCustomType extends readonly (prismic.CustomTypeModelFetchCustomTypeLevel1 | string)[] | readonly (prismic.CustomTypeModelFetchCustomTypeLevel2 | string)[],\n\tTLang extends string = string\n> = {\n\t[ID in Exclude<TCustomType[number], string>[\"id\"]]:\n\t\tprismic.ContentRelationshipField<\n\t\t\tID,\n\t\t\tTLang,\n\t\t\tPickContentRelationshipFieldData<\n\t\t\t\tExtract<TCustomType[number], { id: ID }>,\n\t\t\t\tExtract<prismic.Content.AllDocumentTypes, { type: ID }>[\"data\"],\n\t\t\t\tTLang\n\t\t\t>\n\t\t>\n}[Exclude<TCustomType[number], string>[\"id\"]];\n`,\n\t\tcode,\n\t);\n\n\tconst contentTypeNames: string[] = [];\n\n\tif (config.customTypeModels) {\n\t\tconst allDocumentTypesTypeNames: string[] = [];\n\n\t\tfor (const model of config.customTypeModels) {\n\t\t\tconst customTypeType = buildCustomTypeType({\n\t\t\t\tmodel,\n\t\t\t\tlocaleIDs: config.localeIDs,\n\t\t\t\tfieldConfigs,\n\t\t\t\tcache: shouldUseCache ? cache : undefined,\n\t\t\t});\n\n\t\t\tfor (const auxiliaryType of customTypeType.auxiliaryTypes) {\n\t\t\t\tcode = addSection(auxiliaryType.code, code);\n\t\t\t}\n\n\t\t\tcode = addSection(customTypeType.code, code);\n\n\t\t\tallDocumentTypesTypeNames.push(customTypeType.name);\n\n\t\t\tcontentTypeNames.push(customTypeType.name);\n\t\t\tcontentTypeNames.push(...customTypeType.contentTypeNames);\n\t\t}\n\n\t\tif (config.customTypeModels.length > 0) {\n\t\t\tconst allDocumentTypesUnionName = \"AllDocumentTypes\";\n\t\t\tconst allDocumentTypesUnion = buildUnion(allDocumentTypesTypeNames);\n\n\t\t\tcode = addSection(\n\t\t\t\t`export type ${allDocumentTypesUnionName} = ${allDocumentTypesUnion};`,\n\t\t\t\tcode,\n\t\t\t);\n\n\t\t\tcontentTypeNames.push(allDocumentTypesUnionName);\n\t\t}\n\t}\n\n\tif (config.sharedSliceModels) {\n\t\tfor (const model of config.sharedSliceModels) {\n\t\t\tconst sharedSliceType = buildSharedSliceType({\n\t\t\t\tmodel,\n\t\t\t\tfieldConfigs,\n\t\t\t\tcache: shouldUseCache ? cache : undefined,\n\t\t\t});\n\n\t\t\tfor (const auxiliaryType of sharedSliceType.auxiliaryTypes) {\n\t\t\t\tcode = addSection(auxiliaryType.code, code);\n\t\t\t}\n\n\t\t\tcode = addSection(sharedSliceType.code, code);\n\n\t\t\tcontentTypeNames.push(sharedSliceType.name);\n\t\t\tcontentTypeNames.push(...sharedSliceType.contentTypeNames);\n\t\t}\n\t}\n\n\tif (\n\t\tconfig.clientIntegration?.includeCreateClientInterface ||\n\t\tconfig.clientIntegration?.includeContentNamespace\n\t) {\n\t\tlet clientModuleCode = \"\";\n\n\t\tif (config.clientIntegration.includeCreateClientInterface) {\n\t\t\tif ((config.customTypeModels?.length || 0) > 0) {\n\t\t\t\tclientModuleCode = addSection(\n\t\t\t\t\t`interface CreateClient {\n\t(repositoryNameOrEndpoint: string, options?: ${clientImportName}.ClientConfig): ${clientImportName}.Client<AllDocumentTypes>;\n}`,\n\t\t\t\t\tclientModuleCode,\n\t\t\t\t);\n\t\t\t\tclientModuleCode = addSection(\n\t\t\t\t\t`interface CreateWriteClient {\n\t(repositoryNameOrEndpoint: string, options: ${clientImportName}.WriteClientConfig): ${clientImportName}.WriteClient<AllDocumentTypes>;\n}`,\n\t\t\t\t\tclientModuleCode,\n\t\t\t\t);\n\t\t\t\tclientModuleCode = addSection(\n\t\t\t\t\t`interface CreateMigration {\n\t(): ${clientImportName}.Migration<AllDocumentTypes>;\n}`,\n\t\t\t\t\tclientModuleCode,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tclientModuleCode = addSection(\n\t\t\t\t\t`interface CreateClient {\n\t(repositoryNameOrEndpoint: string, options?: ${clientImportName}.ClientConfig): ${clientImportName}.Client;\n}`,\n\t\t\t\t\tclientModuleCode,\n\t\t\t\t);\n\t\t\t\tclientModuleCode = addSection(\n\t\t\t\t\t`interface CreateWriteClient {\n\t(repositoryNameOrEndpoint: string, options?: ${clientImportName}.WriteClientConfig): ${clientImportName}.WriteClient;\n}`,\n\t\t\t\t\tclientModuleCode,\n\t\t\t\t);\n\t\t\t\tclientModuleCode = addSection(\n\t\t\t\t\t`interface CreateMigration {\n\t(): ${clientImportName}.Migration;\n}`,\n\t\t\t\t\tclientModuleCode,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif (config.clientIntegration.includeContentNamespace) {\n\t\t\tclientModuleCode = addSection(\n\t\t\t\tsource`\n\t\t\t\t\tnamespace Content {\n\t\t\t\t\t\texport type {\n\t\t\t\t\t\t\t${contentTypeNames.join(\",\\n\")}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t`,\n\t\t\t\tclientModuleCode,\n\t\t\t);\n\t\t}\n\n\t\tcode = addSection(\n\t\t\tsource`\n\t\t\t\tdeclare module \"@prismicio/client\" {\n\t\t\t\t\t${clientModuleCode}\n\t\t\t\t}\n\t\t\t`,\n\t\t\tcode,\n\t\t);\n\t}\n\n\treturn code;\n}\n"],"mappings":";;;;;;;;AAaA,MAAM,QAAQ,IAAI,SAA0B,EAAE,SAAS,KAAM,CAAC;AAe9D,SAAgB,cAAc,SAA8B,EAAE,EAAU;CACvE,MAAM,eAAe,OAAO,gBAAgB,EAAE;CAC9C,MAAM,iBAAiB,OAAO,SAAS;CAEvC,IAAI,OAAO;CAEX,MAAM,gBAAgB,OAAO,iBAAiB;CAC9C,IAAI,mBAAmB;AAEvB,QAAO,QAAQ,kCAAkC,cAAc,KAAK,KAAK;AAEzE,KACC,OAAO,mBAAmB,gCAC1B,OAAO,mBAAmB;MAEtB,kBAAkB,qBAAqB;AAC1C,sBAAmB;AAInB,UAAO,QAAQ,oBAAoB,iBAAiB,6BAA6B,KAAK;;;AAIxF,QAAO,WAAW,4DAA4D,KAAK;AAEnF,QAAO,WACN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CA,KACA;CAED,MAAM,mBAA6B,EAAE;AAErC,KAAI,OAAO,kBAAkB;EAC5B,MAAM,4BAAsC,EAAE;AAE9C,OAAK,MAAM,SAAS,OAAO,kBAAkB;GAC5C,MAAM,iBAAiB,oBAAoB;IAC1C;IACA,WAAW,OAAO;IAClB;IACA,OAAO,iBAAiB,QAAQ,KAAA;IAChC,CAAC;AAEF,QAAK,MAAM,iBAAiB,eAAe,eAC1C,QAAO,WAAW,cAAc,MAAM,KAAK;AAG5C,UAAO,WAAW,eAAe,MAAM,KAAK;AAE5C,6BAA0B,KAAK,eAAe,KAAK;AAEnD,oBAAiB,KAAK,eAAe,KAAK;AAC1C,oBAAiB,KAAK,GAAG,eAAe,iBAAiB;;AAG1D,MAAI,OAAO,iBAAiB,SAAS,GAAG;GACvC,MAAM,4BAA4B;AAGlC,UAAO,WACN,eAAe,0BAA0B,KAHZ,WAAW,0BAA0B,CAGE,IACpE,KACA;AAED,oBAAiB,KAAK,0BAA0B;;;AAIlD,KAAI,OAAO,kBACV,MAAK,MAAM,SAAS,OAAO,mBAAmB;EAC7C,MAAM,kBAAkB,qBAAqB;GAC5C;GACA;GACA,OAAO,iBAAiB,QAAQ,KAAA;GAChC,CAAC;AAEF,OAAK,MAAM,iBAAiB,gBAAgB,eAC3C,QAAO,WAAW,cAAc,MAAM,KAAK;AAG5C,SAAO,WAAW,gBAAgB,MAAM,KAAK;AAE7C,mBAAiB,KAAK,gBAAgB,KAAK;AAC3C,mBAAiB,KAAK,GAAG,gBAAgB,iBAAiB;;AAI5D,KACC,OAAO,mBAAmB,gCAC1B,OAAO,mBAAmB,yBACzB;EACD,IAAI,mBAAmB;AAEvB,MAAI,OAAO,kBAAkB,6BAC5B,MAAK,OAAO,kBAAkB,UAAU,KAAK,GAAG;AAC/C,sBAAmB,WAClB;gDAC2C,iBAAiB,kBAAkB,iBAAiB;IAE/F,iBACA;AACD,sBAAmB,WAClB;+CAC0C,iBAAiB,uBAAuB,iBAAiB;IAEnG,iBACA;AACD,sBAAmB,WAClB;OACE,iBAAiB;IAEnB,iBACA;SACK;AACN,sBAAmB,WAClB;gDAC2C,iBAAiB,kBAAkB,iBAAiB;IAE/F,iBACA;AACD,sBAAmB,WAClB;gDAC2C,iBAAiB,uBAAuB,iBAAiB;IAEpG,iBACA;AACD,sBAAmB,WAClB;OACE,iBAAiB;IAEnB,iBACA;;AAIH,MAAI,OAAO,kBAAkB,wBAC5B,oBAAmB,WAClB,MAAM;;;SAGD,iBAAiB,KAAK,MAAM,CAAC;;;OAIlC,iBACA;AAGF,SAAO,WACN,MAAM;;OAEF,iBAAiB;;MAGrB,KACA;;AAGF,QAAO"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
exports.
|
|
7
|
-
exports.detectTypesProvider =
|
|
8
|
-
exports.
|
|
9
|
-
//# sourceMappingURL=index.cjs.map
|
|
2
|
+
const require_generateTypes = require("./generateTypes.cjs");
|
|
3
|
+
const require_detectTypesProvider = require("./detectTypesProvider.cjs");
|
|
4
|
+
const require_constants = require("./cli/constants.cjs");
|
|
5
|
+
exports.NON_EDITABLE_FILE_HEADER = require_constants.NON_EDITABLE_FILE_HEADER;
|
|
6
|
+
exports.detectTypesProvider = require_detectTypesProvider.detectTypesProvider;
|
|
7
|
+
exports.generateTypes = require_generateTypes.generateTypes;
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { GenerateTypesConfig, TypesProvider, generateTypes } from "./generateTypes.cjs";
|
|
2
|
+
import { DetectTypesProviderConfig, detectTypesProvider } from "./detectTypesProvider.cjs";
|
|
3
|
+
import { Config } from "./cli/configSchema.cjs";
|
|
4
|
+
import { NON_EDITABLE_FILE_HEADER } from "./cli/constants.cjs";
|
|
5
|
+
export { type Config, type DetectTypesProviderConfig, type GenerateTypesConfig, NON_EDITABLE_FILE_HEADER, type TypesProvider, detectTypesProvider, generateTypes };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export type
|
|
6
|
-
export { NON_EDITABLE_FILE_HEADER } from "./cli/constants";
|
|
1
|
+
import { GenerateTypesConfig, TypesProvider, generateTypes } from "./generateTypes.js";
|
|
2
|
+
import { DetectTypesProviderConfig, detectTypesProvider } from "./detectTypesProvider.js";
|
|
3
|
+
import { Config } from "./cli/configSchema.js";
|
|
4
|
+
import { NON_EDITABLE_FILE_HEADER } from "./cli/constants.js";
|
|
5
|
+
export { type Config, type DetectTypesProviderConfig, type GenerateTypesConfig, NON_EDITABLE_FILE_HEADER, type TypesProvider, detectTypesProvider, generateTypes };
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import { generateTypes } from "./generateTypes.js";
|
|
2
2
|
import { detectTypesProvider } from "./detectTypesProvider.js";
|
|
3
3
|
import { NON_EDITABLE_FILE_HEADER } from "./cli/constants.js";
|
|
4
|
-
export {
|
|
5
|
-
NON_EDITABLE_FILE_HEADER,
|
|
6
|
-
detectTypesProvider,
|
|
7
|
-
generateTypes
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
|
4
|
+
export { NON_EDITABLE_FILE_HEADER, detectTypesProvider, generateTypes };
|