prismic-ts-codegen 0.1.28 → 0.1.29-pr.80.4a1eb01
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/bin/prismic-ts-codegen.js +1 -1
- package/dist/cli/configSchema.mjs +30 -0
- package/dist/cli/configSchema.mjs.map +1 -0
- package/dist/cli/constants.mjs +6 -0
- package/dist/cli/constants.mjs.map +1 -0
- package/dist/cli/loadConfig.mjs +20 -0
- package/dist/cli/loadConfig.mjs.map +1 -0
- package/dist/cli/loadLocaleIDs.mjs +18 -0
- package/dist/cli/loadLocaleIDs.mjs.map +1 -0
- package/dist/cli/loadModels.mjs +50 -0
- package/dist/cli/loadModels.mjs.map +1 -0
- package/dist/cli.mjs +109 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/constants.mjs +31 -0
- package/dist/constants.mjs.map +1 -0
- package/dist/detectTypesProvider.mjs +24 -0
- package/dist/detectTypesProvider.mjs.map +1 -0
- package/dist/generateTypes.mjs +142 -0
- package/dist/generateTypes.mjs.map +1 -0
- package/dist/index.mjs +4 -0
- package/dist/lib/addBlankLine.mjs +10 -0
- package/dist/lib/addBlankLine.mjs.map +1 -0
- package/dist/lib/addLine.mjs +9 -0
- package/dist/lib/addLine.mjs.map +1 -0
- package/dist/lib/addSection.mjs +9 -0
- package/dist/lib/addSection.mjs.map +1 -0
- package/dist/lib/addTrailingNewLine.mjs +9 -0
- package/dist/lib/addTrailingNewLine.mjs.map +1 -0
- package/dist/lib/buildCustomTypeDataType.mjs +50 -0
- package/dist/lib/buildCustomTypeDataType.mjs.map +1 -0
- package/dist/lib/buildCustomTypeType.mjs +62 -0
- package/dist/lib/buildCustomTypeType.mjs.map +1 -0
- package/dist/lib/buildFieldDocs.mjs +66 -0
- package/dist/lib/buildFieldDocs.mjs.map +1 -0
- package/dist/lib/buildFieldProperties.mjs +284 -0
- package/dist/lib/buildFieldProperties.mjs.map +1 -0
- package/dist/lib/buildSharedSliceType.mjs +151 -0
- package/dist/lib/buildSharedSliceType.mjs.map +1 -0
- package/dist/lib/buildTypeName.mjs +11 -0
- package/dist/lib/buildTypeName.mjs.map +1 -0
- package/dist/lib/buildUnion.mjs +8 -0
- package/dist/lib/buildUnion.mjs.map +1 -0
- package/dist/lib/checkHasUIDFIeld.mjs +8 -0
- package/dist/lib/checkHasUIDFIeld.mjs.map +1 -0
- package/dist/lib/getAPIIDPath.mjs +24 -0
- package/dist/lib/getAPIIDPath.mjs.map +1 -0
- package/dist/lib/getCacheKey.mjs +15 -0
- package/dist/lib/getCacheKey.mjs.map +1 -0
- package/dist/lib/getHumanReadableModelName.mjs +15 -0
- package/dist/lib/getHumanReadableModelName.mjs.map +1 -0
- package/dist/lib/getHumanReadablePath.mjs +16 -0
- package/dist/lib/getHumanReadablePath.mjs.map +1 -0
- package/package.json +30 -50
- 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/configSchema.cjs +0 -38
- package/dist/cli/configSchema.cjs.map +0 -1
- package/dist/cli/configSchema.d.ts +0 -3
- package/dist/cli/configSchema.js +0 -38
- package/dist/cli/configSchema.js.map +0 -1
- package/dist/cli/constants.cjs +0 -5
- package/dist/cli/constants.cjs.map +0 -1
- package/dist/cli/constants.d.ts +0 -1
- package/dist/cli/constants.js +0 -5
- package/dist/cli/constants.js.map +0 -1
- package/dist/cli/index.d.ts +0 -1
- package/dist/cli/loadConfig.cjs +0 -32
- package/dist/cli/loadConfig.cjs.map +0 -1
- package/dist/cli/loadConfig.d.ts +0 -6
- package/dist/cli/loadConfig.js +0 -32
- package/dist/cli/loadConfig.js.map +0 -1
- package/dist/cli/loadLocaleIDs.cjs +0 -20
- package/dist/cli/loadLocaleIDs.cjs.map +0 -1
- package/dist/cli/loadLocaleIDs.d.ts +0 -10
- package/dist/cli/loadLocaleIDs.js +0 -20
- package/dist/cli/loadLocaleIDs.js.map +0 -1
- package/dist/cli/loadModels.cjs +0 -79
- package/dist/cli/loadModels.cjs.map +0 -1
- package/dist/cli/loadModels.d.ts +0 -15
- package/dist/cli/loadModels.js +0 -62
- package/dist/cli/loadModels.js.map +0 -1
- package/dist/cli/types.d.ts +0 -175
- package/dist/cli.cjs +0 -123
- package/dist/cli.cjs.map +0 -1
- package/dist/cli.js +0 -121
- package/dist/cli.js.map +0 -1
- package/dist/constants.cjs +0 -32
- package/dist/constants.cjs.map +0 -1
- package/dist/constants.d.ts +0 -26
- package/dist/constants.js +0 -32
- package/dist/constants.js.map +0 -1
- package/dist/detectTypesProvider.cjs +0 -20
- package/dist/detectTypesProvider.cjs.map +0 -1
- package/dist/detectTypesProvider.d.ts +0 -13
- package/dist/detectTypesProvider.js +0 -20
- package/dist/detectTypesProvider.js.map +0 -1
- package/dist/generateTypes.cjs +0 -153
- package/dist/generateTypes.cjs.map +0 -1
- package/dist/generateTypes.d.ts +0 -16
- package/dist/generateTypes.js +0 -153
- package/dist/generateTypes.js.map +0 -1
- package/dist/index.cjs +0 -9
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.ts +0 -6
- package/dist/index.js +0 -9
- package/dist/index.js.map +0 -1
- package/dist/lib/addBlankLine.cjs +0 -12
- package/dist/lib/addBlankLine.cjs.map +0 -1
- package/dist/lib/addBlankLine.d.ts +0 -5
- package/dist/lib/addBlankLine.js +0 -12
- package/dist/lib/addBlankLine.js.map +0 -1
- package/dist/lib/addLine.cjs +0 -8
- package/dist/lib/addLine.cjs.map +0 -1
- package/dist/lib/addLine.d.ts +0 -1
- package/dist/lib/addLine.js +0 -8
- package/dist/lib/addLine.js.map +0 -1
- package/dist/lib/addSection.cjs +0 -8
- package/dist/lib/addSection.cjs.map +0 -1
- package/dist/lib/addSection.d.ts +0 -1
- package/dist/lib/addSection.js +0 -8
- package/dist/lib/addSection.js.map +0 -1
- package/dist/lib/addTrailingNewLine.cjs +0 -11
- package/dist/lib/addTrailingNewLine.cjs.map +0 -1
- package/dist/lib/addTrailingNewLine.d.ts +0 -5
- package/dist/lib/addTrailingNewLine.js +0 -11
- package/dist/lib/addTrailingNewLine.js.map +0 -1
- package/dist/lib/buildCustomTypeDataType.cjs +0 -54
- package/dist/lib/buildCustomTypeDataType.cjs.map +0 -1
- package/dist/lib/buildCustomTypeDataType.d.ts +0 -14
- package/dist/lib/buildCustomTypeDataType.js +0 -54
- package/dist/lib/buildCustomTypeDataType.js.map +0 -1
- package/dist/lib/buildCustomTypeType.cjs +0 -63
- package/dist/lib/buildCustomTypeType.cjs.map +0 -1
- package/dist/lib/buildCustomTypeType.d.ts +0 -17
- package/dist/lib/buildCustomTypeType.js +0 -63
- package/dist/lib/buildCustomTypeType.js.map +0 -1
- package/dist/lib/buildFieldDocs.cjs +0 -99
- package/dist/lib/buildFieldDocs.cjs.map +0 -1
- package/dist/lib/buildFieldDocs.d.ts +0 -10
- package/dist/lib/buildFieldDocs.js +0 -99
- package/dist/lib/buildFieldDocs.js.map +0 -1
- package/dist/lib/buildFieldProperties.cjs +0 -339
- package/dist/lib/buildFieldProperties.cjs.map +0 -1
- package/dist/lib/buildFieldProperties.d.ts +0 -15
- package/dist/lib/buildFieldProperties.js +0 -339
- package/dist/lib/buildFieldProperties.js.map +0 -1
- package/dist/lib/buildSharedSliceType.cjs +0 -155
- package/dist/lib/buildSharedSliceType.cjs.map +0 -1
- package/dist/lib/buildSharedSliceType.d.ts +0 -17
- package/dist/lib/buildSharedSliceType.js +0 -155
- package/dist/lib/buildSharedSliceType.js.map +0 -1
- package/dist/lib/buildTypeName.cjs +0 -14
- package/dist/lib/buildTypeName.cjs.map +0 -1
- package/dist/lib/buildTypeName.d.ts +0 -1
- package/dist/lib/buildTypeName.js +0 -14
- package/dist/lib/buildTypeName.js.map +0 -1
- package/dist/lib/buildUnion.cjs +0 -7
- package/dist/lib/buildUnion.cjs.map +0 -1
- package/dist/lib/buildUnion.d.ts +0 -1
- package/dist/lib/buildUnion.js +0 -7
- package/dist/lib/buildUnion.js.map +0 -1
- package/dist/lib/checkHasUIDFIeld.cjs +0 -7
- package/dist/lib/checkHasUIDFIeld.cjs.map +0 -1
- package/dist/lib/checkHasUIDFIeld.d.ts +0 -2
- package/dist/lib/checkHasUIDFIeld.js +0 -7
- package/dist/lib/checkHasUIDFIeld.js.map +0 -1
- package/dist/lib/getAPIIDPath.cjs +0 -26
- package/dist/lib/getAPIIDPath.cjs.map +0 -1
- package/dist/lib/getAPIIDPath.d.ts +0 -6
- package/dist/lib/getAPIIDPath.js +0 -26
- package/dist/lib/getAPIIDPath.js.map +0 -1
- package/dist/lib/getCacheKey.cjs +0 -25
- package/dist/lib/getCacheKey.cjs.map +0 -1
- package/dist/lib/getCacheKey.d.ts +0 -9
- package/dist/lib/getCacheKey.js +0 -8
- package/dist/lib/getCacheKey.js.map +0 -1
- package/dist/lib/getHumanReadableModelName.cjs +0 -20
- package/dist/lib/getHumanReadableModelName.cjs.map +0 -1
- package/dist/lib/getHumanReadableModelName.d.ts +0 -7
- package/dist/lib/getHumanReadableModelName.js +0 -20
- package/dist/lib/getHumanReadableModelName.js.map +0 -1
- package/dist/lib/getHumanReadablePath.cjs +0 -19
- package/dist/lib/getHumanReadablePath.cjs.map +0 -1
- package/dist/lib/getHumanReadablePath.d.ts +0 -6
- package/dist/lib/getHumanReadablePath.js +0 -19
- package/dist/lib/getHumanReadablePath.js.map +0 -1
- package/dist/types.d.ts +0 -22
- package/src/cli/types.ts +0 -192
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buildFieldProperties.cjs","sources":["../../../src/lib/buildFieldProperties.ts"],"sourcesContent":["import {\n\ttype CustomTypeModelField,\n\tCustomTypeModelFieldType,\n} from \"@prismicio/client\";\nimport { source, stripIndent } from \"common-tags\";\n\nimport { AuxiliaryType, FieldConfigs, FieldPath } from \"../types\";\n\nimport { addLine } from \"./addLine\";\nimport { addSection } from \"./addSection\";\nimport { buildFieldDocs } from \"./buildFieldDocs\";\nimport { buildTypeName } from \"./buildTypeName\";\nimport { buildUnion } from \"./buildUnion\";\nimport { getHumanReadablePath } from \"./getHumanReadablePath\";\n\ntype BuildFieldPropertyArgs = Pick<\n\tBuildFieldPropertiesArgs,\n\t\"path\" | \"fieldConfigs\" | \"tabName\"\n> & {\n\tname: string;\n\tfield: CustomTypeModelField;\n};\n\ntype BuildFieldPropertyReturnType = {\n\tcode: string;\n\tauxiliaryTypes: AuxiliaryType[];\n\tcontentTypeNames: string[];\n};\n\nfunction buildFieldProperty(\n\targs: BuildFieldPropertyArgs,\n): BuildFieldPropertyReturnType {\n\tlet code = buildFieldDocs({\n\t\tname: args.name,\n\t\tfield: args.field,\n\t\tpath: args.path,\n\t\ttabName: args.tabName,\n\t});\n\n\tconst auxiliaryTypes: AuxiliaryType[] = [];\n\tconst contentTypeNames: string[] = [];\n\n\tconst name =\n\t\targs.name.includes(\"-\") ||\n\t\targs.name.includes(\":\") ||\n\t\t/^[0-9]/.test(args.name)\n\t\t\t? `\"${args.name}\"`\n\t\t\t: args.name;\n\n\tswitch (args.field.type) {\n\t\tcase \"UID\": {\n\t\t\t// UID fields are not included in Data.\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"Boolean\": {\n\t\t\tcode = addLine(`${name}: prismic.BooleanField;`, code);\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"Color\": {\n\t\t\tcode = addLine(`${name}: prismic.ColorField;`, code);\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"Date\": {\n\t\t\tcode = addLine(`${name}: prismic.DateField;`, code);\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"Embed\": {\n\t\t\tconst providerTypes: string[] = [];\n\n\t\t\tif (args.fieldConfigs.embed?.providerTypes) {\n\t\t\t\tfor (const providerType in args.fieldConfigs.embed?.providerTypes) {\n\t\t\t\t\tconst configuredProviderType =\n\t\t\t\t\t\targs.fieldConfigs.embed?.providerTypes[providerType];\n\n\t\t\t\t\tproviderTypes.push(\n\t\t\t\t\t\t`({ provider_name: \"${providerType}\" } & ${configuredProviderType})`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst providerTypesUnion = buildUnion(providerTypes);\n\n\t\t\tcode =\n\t\t\t\tproviderTypes.length > 0\n\t\t\t\t\t? addLine(\n\t\t\t\t\t\t\t`${name}: prismic.EmbedField<prismic.AnyOEmbed & prismic.OEmbedExtra & (${providerTypesUnion})>`,\n\t\t\t\t\t\t\tcode,\n\t\t\t\t\t )\n\t\t\t\t\t: addLine(`${name}: prismic.EmbedField`, code);\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"GeoPoint\": {\n\t\t\tcode = addLine(`${name}: prismic.GeoPointField;`, code);\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"Image\": {\n\t\t\tif (\n\t\t\t\targs.field.config?.thumbnails &&\n\t\t\t\targs.field.config.thumbnails.length > 0\n\t\t\t) {\n\t\t\t\tconst thumbnailNames = buildUnion(\n\t\t\t\t\targs.field.config.thumbnails.map((thumb) => `\"${thumb.name}\"`),\n\t\t\t\t);\n\n\t\t\t\tcode = addLine(`${name}: prismic.ImageField<${thumbnailNames}>;`, code);\n\t\t\t} else {\n\t\t\t\tcode = addLine(`${name}: prismic.ImageField<never>;`, code);\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"IntegrationFields\": {\n\t\t\tconst catalogType = args.field.config?.catalog\n\t\t\t\t? args.fieldConfigs.integrationFields?.catalogTypes?.[\n\t\t\t\t\t\targs.field.config.catalog\n\t\t\t\t ]\n\t\t\t\t: undefined;\n\n\t\t\tif (catalogType) {\n\t\t\t\tcode = addLine(\n\t\t\t\t\t`${name}: prismic.IntegrationField<${catalogType}>;`,\n\t\t\t\t\tcode,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tcode = addLine(`${name}: prismic.IntegrationField;`, code);\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"Link\": {\n\t\t\tconst variants =\n\t\t\t\targs.field.config &&\n\t\t\t\t\"variants\" in args.field.config &&\n\t\t\t\tArray.isArray(args.field.config.variants) &&\n\t\t\t\targs.field.config.variants.length > 0\n\t\t\t\t\t? args.field.config.variants\n\t\t\t\t\t\t\t.map((variant) => `\"${variant.replace(/\\\"/g, '\\\\\"')}\"`)\n\t\t\t\t\t\t\t.join(\" | \")\n\t\t\t\t\t: \"never\";\n\n\t\t\tswitch (args.field.config?.select) {\n\t\t\t\tcase \"document\": {\n\t\t\t\t\tif (\n\t\t\t\t\t\t\"customtypes\" in args.field.config &&\n\t\t\t\t\t\targs.field.config.customtypes &&\n\t\t\t\t\t\targs.field.config.customtypes.length > 0\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst contentRelationshipUnion = buildUnion(\n\t\t\t\t\t\t\targs.field.config.customtypes.map((type) => {\n\t\t\t\t\t\t\t\tif (typeof type === \"string\") {\n\t\t\t\t\t\t\t\t\treturn `prismic.ContentRelationshipField<\"${type}\">`;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn `ContentRelationshipFieldWithData<${JSON.stringify([\n\t\t\t\t\t\t\t\t\ttype,\n\t\t\t\t\t\t\t\t])}>`;\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tcode = addLine(`${name}: ${contentRelationshipUnion};`, code);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcode = addLine(`${name}: prismic.ContentRelationshipField;`, code);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase \"media\": {\n\t\t\t\t\tcode = addLine(\n\t\t\t\t\t\t`${name}: prismic.LinkToMediaField<prismic.FieldState, ${variants}>;`,\n\t\t\t\t\t\tcode,\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tdefault: {\n\t\t\t\t\tlet type = `prismic.LinkField<string, string, unknown, prismic.FieldState, ${variants}>`;\n\n\t\t\t\t\tif (args.field.config?.repeat) {\n\t\t\t\t\t\ttype = `prismic.Repeatable<${type}>`;\n\t\t\t\t\t}\n\n\t\t\t\t\tcode = addLine(`${name}: ${type};`, code);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"Number\": {\n\t\t\tcode = addLine(`${name}: prismic.NumberField;`, code);\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"StructuredText\": {\n\t\t\tcode = addLine(`${name}: prismic.RichTextField;`, code);\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"Select\": {\n\t\t\tconst options: string[] =\n\t\t\t\targs.field.config?.options?.map((option) => `\"${option}\"`) || [];\n\t\t\tconst optionsType = options.length ? buildUnion(options) : \"string\";\n\n\t\t\tconst hasDefault = Boolean(args.field.config?.default_value);\n\n\t\t\tif (hasDefault) {\n\t\t\t\tcode = addLine(\n\t\t\t\t\t`${name}: prismic.SelectField<${optionsType}, \"filled\">;`,\n\t\t\t\t\tcode,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tcode = addLine(\n\t\t\t\t\t`${name}: prismic.SelectField${\n\t\t\t\t\t\toptions.length > 0 ? `<${optionsType}>` : \"\"\n\t\t\t\t\t};`,\n\t\t\t\t\tcode,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"Table\": {\n\t\t\tcode = addLine(`${name}: prismic.TableField;`, code);\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"Text\": {\n\t\t\tcode = addLine(`${name}: prismic.KeyTextField;`, code);\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"Timestamp\": {\n\t\t\tcode = addLine(`${name}: prismic.TimestampField;`, code);\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"Group\": {\n\t\t\tconst groupPathParts = args.path.filter(\n\t\t\t\t(part) =>\n\t\t\t\t\tpart.model !== undefined &&\n\t\t\t\t\t\"type\" in part.model &&\n\t\t\t\t\tpart.model.type === CustomTypeModelFieldType.Group,\n\t\t\t);\n\t\t\tconst isNestedGroup = groupPathParts.length > 0;\n\n\t\t\tlet itemName;\n\t\t\tif (\n\t\t\t\targs.path[0].model &&\n\t\t\t\t\"type\" in args.path[0].model &&\n\t\t\t\targs.path[0].model.type === \"SharedSlice\"\n\t\t\t) {\n\t\t\t\tconst [slicePathPart, variationPathPart, zonePathPart] = args.path;\n\n\t\t\t\titemName = buildTypeName(\n\t\t\t\t\tslicePathPart.name,\n\t\t\t\t\t\"Slice\",\n\t\t\t\t\tvariationPathPart.name,\n\t\t\t\t\tzonePathPart.name,\n\t\t\t\t\t...groupPathParts.map((part) => part.name),\n\t\t\t\t\targs.name,\n\t\t\t\t\t\"Item\",\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\titemName = buildTypeName(\n\t\t\t\t\targs.path[0].name,\n\t\t\t\t\t\"Document\",\n\t\t\t\t\t\"Data\",\n\t\t\t\t\t...groupPathParts.map((part) => part.name),\n\t\t\t\t\targs.name,\n\t\t\t\t\t\"Item\",\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst path: FieldPath = [\n\t\t\t\t...args.path,\n\t\t\t\t{\n\t\t\t\t\tname: name,\n\t\t\t\t\tmodel: args.field,\n\t\t\t\t},\n\t\t\t];\n\t\t\tconst humanReadablePath = getHumanReadablePath({ path });\n\n\t\t\tconst itemFieldProperties = buildFieldProperties({\n\t\t\t\tfields: args.field.config?.fields || {},\n\t\t\t\tfieldConfigs: args.fieldConfigs,\n\t\t\t\tpath,\n\t\t\t});\n\t\t\tauxiliaryTypes.push(...itemFieldProperties.auxiliaryTypes);\n\t\t\tcontentTypeNames.push(...itemFieldProperties.contentTypeNames);\n\n\t\t\tauxiliaryTypes.push({\n\t\t\t\tname: itemName,\n\t\t\t\tcode: source`\n\t\t\t\t\t/**\n\t\t\t\t\t * Item in *${humanReadablePath}*\n\t\t\t\t\t */\n\t\t\t\t\texport interface ${itemName} {\n\t\t\t\t\t\t${itemFieldProperties.code}\n\t\t\t\t\t}\n\t\t\t\t`,\n\t\t\t});\n\t\t\tcontentTypeNames.push(itemName);\n\n\t\t\tif (isNestedGroup) {\n\t\t\t\tcode = addLine(\n\t\t\t\t\t`${name}: prismic.NestedGroupField<Simplify<${itemName}>>;`,\n\t\t\t\t\tcode,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tcode = addLine(\n\t\t\t\t\t`${name}: prismic.GroupField<Simplify<${itemName}>>;`,\n\t\t\t\t\tcode,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"Slices\": {\n\t\t\tconst choiceNames: string[] = [];\n\n\t\t\tif (args.field.config?.choices) {\n\t\t\t\tfor (const choiceID in args.field.config.choices) {\n\t\t\t\t\tconst choice = args.field.config.choices[choiceID];\n\n\t\t\t\t\tif (choice.type === \"SharedSlice\") {\n\t\t\t\t\t\t// TODO: Verify that the Shared Slice\n\t\t\t\t\t\t// is provided to the global\n\t\t\t\t\t\t// `sharedSlices` array. If it is not,\n\t\t\t\t\t\t// the type won't exist, so we can't\n\t\t\t\t\t\t// add it to the union. We should\n\t\t\t\t\t\t// probably throw an error if we reach\n\t\t\t\t\t\t// that state, or maybe the input can\n\t\t\t\t\t\t// be validated early so we don't\n\t\t\t\t\t\t// generate any code using invalid\n\t\t\t\t\t\t// models.\n\t\t\t\t\t\tchoiceNames.push(buildTypeName(choiceID, \"Slice\"));\n\t\t\t\t\t} else if (choice.type === \"Slice\") {\n\t\t\t\t\t\tconst sliceName = buildTypeName(\n\t\t\t\t\t\t\targs.path[0].name,\n\t\t\t\t\t\t\t\"Document\",\n\t\t\t\t\t\t\t\"Data\",\n\t\t\t\t\t\t\targs.name,\n\t\t\t\t\t\t\tchoiceID,\n\t\t\t\t\t\t\t\"Slice\",\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tlet primaryInterfaceName: string | undefined;\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tchoice[\"non-repeat\"] &&\n\t\t\t\t\t\t\tObject.keys(choice[\"non-repeat\"]).length > 0\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tprimaryInterfaceName = buildTypeName(sliceName, \"Primary\");\n\n\t\t\t\t\t\t\tconst path: FieldPath = [\n\t\t\t\t\t\t\t\t...args.path,\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tname: args.name,\n\t\t\t\t\t\t\t\t\tmodel: args.field,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tname: choiceID,\n\t\t\t\t\t\t\t\t\tmodel: choice,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tname: \"primary\",\n\t\t\t\t\t\t\t\t\tlabel: \"Primary\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t\tconst humanReadablePath = getHumanReadablePath({ path });\n\n\t\t\t\t\t\t\tconst primaryFieldProperties = buildFieldProperties({\n\t\t\t\t\t\t\t\tfields: choice[\"non-repeat\"],\n\t\t\t\t\t\t\t\tfieldConfigs: args.fieldConfigs,\n\t\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tauxiliaryTypes.push(...primaryFieldProperties.auxiliaryTypes);\n\t\t\t\t\t\t\tcontentTypeNames.push(...primaryFieldProperties.contentTypeNames);\n\n\t\t\t\t\t\t\tlet primaryCode = stripIndent`\n\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t * Primary content in *${humanReadablePath}*\n\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t`;\n\t\t\t\t\t\t\tprimaryCode = primaryFieldProperties.code\n\t\t\t\t\t\t\t\t? addLine(\n\t\t\t\t\t\t\t\t\t\tsource`\n\t\t\t\t\t\t\t\t\t\t\texport interface ${primaryInterfaceName} {\n\t\t\t\t\t\t\t\t\t\t\t\t${primaryFieldProperties.code}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t\t\t\t\tprimaryCode,\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: addLine(\n\t\t\t\t\t\t\t\t\t\t`export interface ${primaryInterfaceName} {}`,\n\t\t\t\t\t\t\t\t\t\tprimaryCode,\n\t\t\t\t\t\t\t\t );\n\n\t\t\t\t\t\t\tauxiliaryTypes.push({\n\t\t\t\t\t\t\t\tname: primaryInterfaceName,\n\t\t\t\t\t\t\t\tcode: primaryCode,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tcontentTypeNames.push(primaryInterfaceName);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet itemInterfaceName: string | undefined;\n\t\t\t\t\t\tif (choice.repeat && Object.keys(choice.repeat).length > 0) {\n\t\t\t\t\t\t\titemInterfaceName = buildTypeName(sliceName, \"Item\");\n\n\t\t\t\t\t\t\tconst path: FieldPath = [\n\t\t\t\t\t\t\t\t...args.path,\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tname: args.name,\n\t\t\t\t\t\t\t\t\tmodel: args.field,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tname: choiceID,\n\t\t\t\t\t\t\t\t\tmodel: choice,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tname: \"items\",\n\t\t\t\t\t\t\t\t\tlabel: \"Items\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t\tconst humanReadablePath = getHumanReadablePath({ path });\n\n\t\t\t\t\t\t\tconst itemFieldProperties = buildFieldProperties({\n\t\t\t\t\t\t\t\tfields: choice.repeat,\n\t\t\t\t\t\t\t\tfieldConfigs: args.fieldConfigs,\n\t\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tauxiliaryTypes.push(...itemFieldProperties.auxiliaryTypes);\n\t\t\t\t\t\t\tcontentTypeNames.push(...itemFieldProperties.contentTypeNames);\n\n\t\t\t\t\t\t\tlet itemCode = stripIndent`\n\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t * Item content in *${humanReadablePath}*\n\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t`;\n\t\t\t\t\t\t\titemCode = itemFieldProperties.code\n\t\t\t\t\t\t\t\t? addLine(\n\t\t\t\t\t\t\t\t\t\tsource`\n\t\t\t\t\t\t\t\t\t\t\texport interface ${itemInterfaceName} {\n\t\t\t\t\t\t\t\t\t\t\t\t${itemFieldProperties.code}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t\t\t\t\titemCode,\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: addLine(`export interface ${itemInterfaceName} {}`, itemCode);\n\n\t\t\t\t\t\t\tauxiliaryTypes.push({\n\t\t\t\t\t\t\t\tname: itemInterfaceName,\n\t\t\t\t\t\t\t\tcode: itemCode,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tcontentTypeNames.push(itemInterfaceName);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tauxiliaryTypes.push({\n\t\t\t\t\t\t\tname: sliceName,\n\t\t\t\t\t\t\tcode: stripIndent`\n\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t * Slice for *${getHumanReadablePath({\n\t\t\t\t\t\t\t\t\t\tpath: [\n\t\t\t\t\t\t\t\t\t\t\t...args.path,\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tname: args.name,\n\t\t\t\t\t\t\t\t\t\t\t\tmodel: args.field,\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t})}*\n\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\texport type ${sliceName} = prismic.Slice<\"${choiceID}\", ${\n\t\t\t\t\t\t\t\tprimaryInterfaceName\n\t\t\t\t\t\t\t\t\t? `Simplify<${primaryInterfaceName}>`\n\t\t\t\t\t\t\t\t\t: `Record<string, never>`\n\t\t\t\t\t\t\t}, ${\n\t\t\t\t\t\t\t\titemInterfaceName ? `Simplify<${itemInterfaceName}>` : `never`\n\t\t\t\t\t\t\t}>\n\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tchoiceNames.push(sliceName);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst choiceUnionName = buildTypeName(\n\t\t\t\targs.path[0].name,\n\t\t\t\t\"Document\",\n\t\t\t\t\"Data\",\n\t\t\t\targs.name,\n\t\t\t\t\"Slice\",\n\t\t\t);\n\t\t\tconst choiceUnion = buildUnion(choiceNames);\n\t\t\tauxiliaryTypes.push({\n\t\t\t\tname: choiceUnionName,\n\t\t\t\tcode: `type ${choiceUnionName} = ${choiceUnion}`,\n\t\t\t});\n\t\t\tcontentTypeNames.push(choiceUnionName);\n\n\t\t\tcode = addLine(`${name}: prismic.SliceZone<${choiceUnionName}>;`, code);\n\n\t\t\tbreak;\n\t\t}\n\n\t\tdefault: {\n\t\t\tcode = addLine(`${name}: unknown;`, code);\n\t\t}\n\t}\n\n\treturn {\n\t\tcode,\n\t\tauxiliaryTypes,\n\t\tcontentTypeNames,\n\t};\n}\n\ntype BuildFieldPropertiesArgs = {\n\tfields: Record<string, CustomTypeModelField>;\n\tpath: FieldPath;\n\tfieldConfigs: FieldConfigs;\n\ttabName?: string;\n};\n\ntype BuildFieldPropertiesReturnType = {\n\tcode: string;\n\tauxiliaryTypes: AuxiliaryType[];\n\tcontentTypeNames: string[];\n};\n\nexport function buildFieldProperties(\n\targs: BuildFieldPropertiesArgs,\n): BuildFieldPropertiesReturnType {\n\tlet code = \"\";\n\n\tconst auxiliaryTypes: AuxiliaryType[] = [];\n\tconst contentTypeNames: string[] = [];\n\n\tfor (const name in args.fields) {\n\t\tconst field = args.fields[name];\n\n\t\tconst fieldProperty = buildFieldProperty({\n\t\t\tname,\n\t\t\tfield,\n\t\t\tpath: args.path,\n\t\t\tfieldConfigs: args.fieldConfigs,\n\t\t\ttabName: args.tabName,\n\t\t});\n\n\t\tcode = addSection(fieldProperty.code, code);\n\n\t\tauxiliaryTypes.push(...fieldProperty.auxiliaryTypes);\n\t\tcontentTypeNames.push(...fieldProperty.contentTypeNames);\n\t}\n\n\treturn {\n\t\tcode,\n\t\tauxiliaryTypes,\n\t\tcontentTypeNames,\n\t};\n}\n"],"names":["buildFieldDocs","addLine","buildUnion","CustomTypeModelFieldType","buildTypeName","getHumanReadablePath","source","stripIndent","addSection"],"mappings":";;;;;;;;;;AA6BA,SAAS,mBACR,MAA4B;;AAE5B,MAAI,OAAOA,eAAAA,eAAe;AAAA,IACzB,MAAM,KAAK;AAAA,IACX,OAAO,KAAK;AAAA,IACZ,MAAM,KAAK;AAAA,IACX,SAAS,KAAK;AAAA,EAAA,CACd;AAED,QAAM,iBAAkC,CAAA;AACxC,QAAM,mBAA6B,CAAA;AAE7B,QAAA,OACL,KAAK,KAAK,SAAS,GAAG,KACtB,KAAK,KAAK,SAAS,GAAG,KACtB,SAAS,KAAK,KAAK,IAAI,IACpB,IAAI,KAAK,IAAI,MACb,KAAK;AAED,UAAA,KAAK,MAAM,MAAM;AAAA,IACxB,KAAK,OAAO;AAEX;AAAA,IACD;AAAA,IAEA,KAAK,WAAW;AACf,aAAOC,QAAQ,QAAA,GAAG,IAAI,2BAA2B,IAAI;AAErD;AAAA,IACD;AAAA,IAEA,KAAK,SAAS;AACb,aAAOA,QAAQ,QAAA,GAAG,IAAI,yBAAyB,IAAI;AAEnD;AAAA,IACD;AAAA,IAEA,KAAK,QAAQ;AACZ,aAAOA,QAAQ,QAAA,GAAG,IAAI,wBAAwB,IAAI;AAElD;AAAA,IACD;AAAA,IA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AA,IACA;AAAA,IACA;AAAA,EAAA;AAEF;;"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { type CustomTypeModelField } from "@prismicio/client";
|
|
2
|
-
import { AuxiliaryType, FieldConfigs, FieldPath } from "../types";
|
|
3
|
-
type BuildFieldPropertiesArgs = {
|
|
4
|
-
fields: Record<string, CustomTypeModelField>;
|
|
5
|
-
path: FieldPath;
|
|
6
|
-
fieldConfigs: FieldConfigs;
|
|
7
|
-
tabName?: string;
|
|
8
|
-
};
|
|
9
|
-
type BuildFieldPropertiesReturnType = {
|
|
10
|
-
code: string;
|
|
11
|
-
auxiliaryTypes: AuxiliaryType[];
|
|
12
|
-
contentTypeNames: string[];
|
|
13
|
-
};
|
|
14
|
-
export declare function buildFieldProperties(args: BuildFieldPropertiesArgs): BuildFieldPropertiesReturnType;
|
|
15
|
-
export {};
|
|
@@ -1,339 +0,0 @@
|
|
|
1
|
-
import { CustomTypeModelFieldType } from './../_node_modules/@prismicio/client/dist/types/model/types.js';
|
|
2
|
-
import { stripIndent, source } from "common-tags";
|
|
3
|
-
import { addLine } from "./addLine.js";
|
|
4
|
-
import { addSection } from "./addSection.js";
|
|
5
|
-
import { buildFieldDocs } from "./buildFieldDocs.js";
|
|
6
|
-
import { buildTypeName } from "./buildTypeName.js";
|
|
7
|
-
import { buildUnion } from "./buildUnion.js";
|
|
8
|
-
import { getHumanReadablePath } from "./getHumanReadablePath.js";
|
|
9
|
-
function buildFieldProperty(args) {
|
|
10
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
11
|
-
let code = buildFieldDocs({
|
|
12
|
-
name: args.name,
|
|
13
|
-
field: args.field,
|
|
14
|
-
path: args.path,
|
|
15
|
-
tabName: args.tabName
|
|
16
|
-
});
|
|
17
|
-
const auxiliaryTypes = [];
|
|
18
|
-
const contentTypeNames = [];
|
|
19
|
-
const name = args.name.includes("-") || args.name.includes(":") || /^[0-9]/.test(args.name) ? `"${args.name}"` : args.name;
|
|
20
|
-
switch (args.field.type) {
|
|
21
|
-
case "UID": {
|
|
22
|
-
break;
|
|
23
|
-
}
|
|
24
|
-
case "Boolean": {
|
|
25
|
-
code = addLine(`${name}: prismic.BooleanField;`, code);
|
|
26
|
-
break;
|
|
27
|
-
}
|
|
28
|
-
case "Color": {
|
|
29
|
-
code = addLine(`${name}: prismic.ColorField;`, code);
|
|
30
|
-
break;
|
|
31
|
-
}
|
|
32
|
-
case "Date": {
|
|
33
|
-
code = addLine(`${name}: prismic.DateField;`, code);
|
|
34
|
-
break;
|
|
35
|
-
}
|
|
36
|
-
case "Embed": {
|
|
37
|
-
const providerTypes = [];
|
|
38
|
-
if ((_a = args.fieldConfigs.embed) == null ? void 0 : _a.providerTypes) {
|
|
39
|
-
for (const providerType in (_b = args.fieldConfigs.embed) == null ? void 0 : _b.providerTypes) {
|
|
40
|
-
const configuredProviderType = (_c = args.fieldConfigs.embed) == null ? void 0 : _c.providerTypes[providerType];
|
|
41
|
-
providerTypes.push(`({ provider_name: "${providerType}" } & ${configuredProviderType})`);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
const providerTypesUnion = buildUnion(providerTypes);
|
|
45
|
-
code = providerTypes.length > 0 ? addLine(`${name}: prismic.EmbedField<prismic.AnyOEmbed & prismic.OEmbedExtra & (${providerTypesUnion})>`, code) : addLine(`${name}: prismic.EmbedField`, code);
|
|
46
|
-
break;
|
|
47
|
-
}
|
|
48
|
-
case "GeoPoint": {
|
|
49
|
-
code = addLine(`${name}: prismic.GeoPointField;`, code);
|
|
50
|
-
break;
|
|
51
|
-
}
|
|
52
|
-
case "Image": {
|
|
53
|
-
if (((_d = args.field.config) == null ? void 0 : _d.thumbnails) && args.field.config.thumbnails.length > 0) {
|
|
54
|
-
const thumbnailNames = buildUnion(args.field.config.thumbnails.map((thumb) => `"${thumb.name}"`));
|
|
55
|
-
code = addLine(`${name}: prismic.ImageField<${thumbnailNames}>;`, code);
|
|
56
|
-
} else {
|
|
57
|
-
code = addLine(`${name}: prismic.ImageField<never>;`, code);
|
|
58
|
-
}
|
|
59
|
-
break;
|
|
60
|
-
}
|
|
61
|
-
case "IntegrationFields": {
|
|
62
|
-
const catalogType = ((_e = args.field.config) == null ? void 0 : _e.catalog) ? (_g = (_f = args.fieldConfigs.integrationFields) == null ? void 0 : _f.catalogTypes) == null ? void 0 : _g[args.field.config.catalog] : void 0;
|
|
63
|
-
if (catalogType) {
|
|
64
|
-
code = addLine(`${name}: prismic.IntegrationField<${catalogType}>;`, code);
|
|
65
|
-
} else {
|
|
66
|
-
code = addLine(`${name}: prismic.IntegrationField;`, code);
|
|
67
|
-
}
|
|
68
|
-
break;
|
|
69
|
-
}
|
|
70
|
-
case "Link": {
|
|
71
|
-
const variants = args.field.config && "variants" in args.field.config && Array.isArray(args.field.config.variants) && args.field.config.variants.length > 0 ? args.field.config.variants.map((variant) => `"${variant.replace(/\"/g, '\\"')}"`).join(" | ") : "never";
|
|
72
|
-
switch ((_h = args.field.config) == null ? void 0 : _h.select) {
|
|
73
|
-
case "document": {
|
|
74
|
-
if ("customtypes" in args.field.config && args.field.config.customtypes && args.field.config.customtypes.length > 0) {
|
|
75
|
-
const contentRelationshipUnion = buildUnion(args.field.config.customtypes.map((type) => {
|
|
76
|
-
if (typeof type === "string") {
|
|
77
|
-
return `prismic.ContentRelationshipField<"${type}">`;
|
|
78
|
-
}
|
|
79
|
-
return `ContentRelationshipFieldWithData<${JSON.stringify([
|
|
80
|
-
type
|
|
81
|
-
])}>`;
|
|
82
|
-
}));
|
|
83
|
-
code = addLine(`${name}: ${contentRelationshipUnion};`, code);
|
|
84
|
-
} else {
|
|
85
|
-
code = addLine(`${name}: prismic.ContentRelationshipField;`, code);
|
|
86
|
-
}
|
|
87
|
-
break;
|
|
88
|
-
}
|
|
89
|
-
case "media": {
|
|
90
|
-
code = addLine(`${name}: prismic.LinkToMediaField<prismic.FieldState, ${variants}>;`, code);
|
|
91
|
-
break;
|
|
92
|
-
}
|
|
93
|
-
default: {
|
|
94
|
-
let type = `prismic.LinkField<string, string, unknown, prismic.FieldState, ${variants}>`;
|
|
95
|
-
if ((_i = args.field.config) == null ? void 0 : _i.repeat) {
|
|
96
|
-
type = `prismic.Repeatable<${type}>`;
|
|
97
|
-
}
|
|
98
|
-
code = addLine(`${name}: ${type};`, code);
|
|
99
|
-
break;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
break;
|
|
103
|
-
}
|
|
104
|
-
case "Number": {
|
|
105
|
-
code = addLine(`${name}: prismic.NumberField;`, code);
|
|
106
|
-
break;
|
|
107
|
-
}
|
|
108
|
-
case "StructuredText": {
|
|
109
|
-
code = addLine(`${name}: prismic.RichTextField;`, code);
|
|
110
|
-
break;
|
|
111
|
-
}
|
|
112
|
-
case "Select": {
|
|
113
|
-
const options = ((_k = (_j = args.field.config) == null ? void 0 : _j.options) == null ? void 0 : _k.map((option) => `"${option}"`)) || [];
|
|
114
|
-
const optionsType = options.length ? buildUnion(options) : "string";
|
|
115
|
-
const hasDefault = Boolean((_l = args.field.config) == null ? void 0 : _l.default_value);
|
|
116
|
-
if (hasDefault) {
|
|
117
|
-
code = addLine(`${name}: prismic.SelectField<${optionsType}, "filled">;`, code);
|
|
118
|
-
} else {
|
|
119
|
-
code = addLine(`${name}: prismic.SelectField${options.length > 0 ? `<${optionsType}>` : ""};`, code);
|
|
120
|
-
}
|
|
121
|
-
break;
|
|
122
|
-
}
|
|
123
|
-
case "Table": {
|
|
124
|
-
code = addLine(`${name}: prismic.TableField;`, code);
|
|
125
|
-
break;
|
|
126
|
-
}
|
|
127
|
-
case "Text": {
|
|
128
|
-
code = addLine(`${name}: prismic.KeyTextField;`, code);
|
|
129
|
-
break;
|
|
130
|
-
}
|
|
131
|
-
case "Timestamp": {
|
|
132
|
-
code = addLine(`${name}: prismic.TimestampField;`, code);
|
|
133
|
-
break;
|
|
134
|
-
}
|
|
135
|
-
case "Group": {
|
|
136
|
-
const groupPathParts = args.path.filter((part) => part.model !== void 0 && "type" in part.model && part.model.type === CustomTypeModelFieldType.Group);
|
|
137
|
-
const isNestedGroup = groupPathParts.length > 0;
|
|
138
|
-
let itemName;
|
|
139
|
-
if (args.path[0].model && "type" in args.path[0].model && args.path[0].model.type === "SharedSlice") {
|
|
140
|
-
const [slicePathPart, variationPathPart, zonePathPart] = args.path;
|
|
141
|
-
itemName = buildTypeName(slicePathPart.name, "Slice", variationPathPart.name, zonePathPart.name, ...groupPathParts.map((part) => part.name), args.name, "Item");
|
|
142
|
-
} else {
|
|
143
|
-
itemName = buildTypeName(args.path[0].name, "Document", "Data", ...groupPathParts.map((part) => part.name), args.name, "Item");
|
|
144
|
-
}
|
|
145
|
-
const path = [
|
|
146
|
-
...args.path,
|
|
147
|
-
{
|
|
148
|
-
name,
|
|
149
|
-
model: args.field
|
|
150
|
-
}
|
|
151
|
-
];
|
|
152
|
-
const humanReadablePath = getHumanReadablePath({ path });
|
|
153
|
-
const itemFieldProperties = buildFieldProperties({
|
|
154
|
-
fields: ((_m = args.field.config) == null ? void 0 : _m.fields) || {},
|
|
155
|
-
fieldConfigs: args.fieldConfigs,
|
|
156
|
-
path
|
|
157
|
-
});
|
|
158
|
-
auxiliaryTypes.push(...itemFieldProperties.auxiliaryTypes);
|
|
159
|
-
contentTypeNames.push(...itemFieldProperties.contentTypeNames);
|
|
160
|
-
auxiliaryTypes.push({
|
|
161
|
-
name: itemName,
|
|
162
|
-
code: source`
|
|
163
|
-
/**
|
|
164
|
-
* Item in *${humanReadablePath}*
|
|
165
|
-
*/
|
|
166
|
-
export interface ${itemName} {
|
|
167
|
-
${itemFieldProperties.code}
|
|
168
|
-
}
|
|
169
|
-
`
|
|
170
|
-
});
|
|
171
|
-
contentTypeNames.push(itemName);
|
|
172
|
-
if (isNestedGroup) {
|
|
173
|
-
code = addLine(`${name}: prismic.NestedGroupField<Simplify<${itemName}>>;`, code);
|
|
174
|
-
} else {
|
|
175
|
-
code = addLine(`${name}: prismic.GroupField<Simplify<${itemName}>>;`, code);
|
|
176
|
-
}
|
|
177
|
-
break;
|
|
178
|
-
}
|
|
179
|
-
case "Slices": {
|
|
180
|
-
const choiceNames = [];
|
|
181
|
-
if ((_n = args.field.config) == null ? void 0 : _n.choices) {
|
|
182
|
-
for (const choiceID in args.field.config.choices) {
|
|
183
|
-
const choice = args.field.config.choices[choiceID];
|
|
184
|
-
if (choice.type === "SharedSlice") {
|
|
185
|
-
choiceNames.push(buildTypeName(choiceID, "Slice"));
|
|
186
|
-
} else if (choice.type === "Slice") {
|
|
187
|
-
const sliceName = buildTypeName(args.path[0].name, "Document", "Data", args.name, choiceID, "Slice");
|
|
188
|
-
let primaryInterfaceName;
|
|
189
|
-
if (choice["non-repeat"] && Object.keys(choice["non-repeat"]).length > 0) {
|
|
190
|
-
primaryInterfaceName = buildTypeName(sliceName, "Primary");
|
|
191
|
-
const path = [
|
|
192
|
-
...args.path,
|
|
193
|
-
{
|
|
194
|
-
name: args.name,
|
|
195
|
-
model: args.field
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
name: choiceID,
|
|
199
|
-
model: choice
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
name: "primary",
|
|
203
|
-
label: "Primary"
|
|
204
|
-
}
|
|
205
|
-
];
|
|
206
|
-
const humanReadablePath = getHumanReadablePath({ path });
|
|
207
|
-
const primaryFieldProperties = buildFieldProperties({
|
|
208
|
-
fields: choice["non-repeat"],
|
|
209
|
-
fieldConfigs: args.fieldConfigs,
|
|
210
|
-
path
|
|
211
|
-
});
|
|
212
|
-
auxiliaryTypes.push(...primaryFieldProperties.auxiliaryTypes);
|
|
213
|
-
contentTypeNames.push(...primaryFieldProperties.contentTypeNames);
|
|
214
|
-
let primaryCode = stripIndent`
|
|
215
|
-
/**
|
|
216
|
-
* Primary content in *${humanReadablePath}*
|
|
217
|
-
*/
|
|
218
|
-
`;
|
|
219
|
-
primaryCode = primaryFieldProperties.code ? addLine(source`
|
|
220
|
-
export interface ${primaryInterfaceName} {
|
|
221
|
-
${primaryFieldProperties.code}
|
|
222
|
-
}
|
|
223
|
-
`, primaryCode) : addLine(`export interface ${primaryInterfaceName} {}`, primaryCode);
|
|
224
|
-
auxiliaryTypes.push({
|
|
225
|
-
name: primaryInterfaceName,
|
|
226
|
-
code: primaryCode
|
|
227
|
-
});
|
|
228
|
-
contentTypeNames.push(primaryInterfaceName);
|
|
229
|
-
}
|
|
230
|
-
let itemInterfaceName;
|
|
231
|
-
if (choice.repeat && Object.keys(choice.repeat).length > 0) {
|
|
232
|
-
itemInterfaceName = buildTypeName(sliceName, "Item");
|
|
233
|
-
const path = [
|
|
234
|
-
...args.path,
|
|
235
|
-
{
|
|
236
|
-
name: args.name,
|
|
237
|
-
model: args.field
|
|
238
|
-
},
|
|
239
|
-
{
|
|
240
|
-
name: choiceID,
|
|
241
|
-
model: choice
|
|
242
|
-
},
|
|
243
|
-
{
|
|
244
|
-
name: "items",
|
|
245
|
-
label: "Items"
|
|
246
|
-
}
|
|
247
|
-
];
|
|
248
|
-
const humanReadablePath = getHumanReadablePath({ path });
|
|
249
|
-
const itemFieldProperties = buildFieldProperties({
|
|
250
|
-
fields: choice.repeat,
|
|
251
|
-
fieldConfigs: args.fieldConfigs,
|
|
252
|
-
path
|
|
253
|
-
});
|
|
254
|
-
auxiliaryTypes.push(...itemFieldProperties.auxiliaryTypes);
|
|
255
|
-
contentTypeNames.push(...itemFieldProperties.contentTypeNames);
|
|
256
|
-
let itemCode = stripIndent`
|
|
257
|
-
/**
|
|
258
|
-
* Item content in *${humanReadablePath}*
|
|
259
|
-
*/
|
|
260
|
-
`;
|
|
261
|
-
itemCode = itemFieldProperties.code ? addLine(source`
|
|
262
|
-
export interface ${itemInterfaceName} {
|
|
263
|
-
${itemFieldProperties.code}
|
|
264
|
-
}
|
|
265
|
-
`, itemCode) : addLine(`export interface ${itemInterfaceName} {}`, itemCode);
|
|
266
|
-
auxiliaryTypes.push({
|
|
267
|
-
name: itemInterfaceName,
|
|
268
|
-
code: itemCode
|
|
269
|
-
});
|
|
270
|
-
contentTypeNames.push(itemInterfaceName);
|
|
271
|
-
}
|
|
272
|
-
auxiliaryTypes.push({
|
|
273
|
-
name: sliceName,
|
|
274
|
-
code: stripIndent`
|
|
275
|
-
/**
|
|
276
|
-
* Slice for *${getHumanReadablePath({
|
|
277
|
-
path: [
|
|
278
|
-
...args.path,
|
|
279
|
-
{
|
|
280
|
-
name: args.name,
|
|
281
|
-
model: args.field
|
|
282
|
-
}
|
|
283
|
-
]
|
|
284
|
-
})}*
|
|
285
|
-
*/
|
|
286
|
-
export type ${sliceName} = prismic.Slice<"${choiceID}", ${primaryInterfaceName ? `Simplify<${primaryInterfaceName}>` : `Record<string, never>`}, ${itemInterfaceName ? `Simplify<${itemInterfaceName}>` : `never`}>
|
|
287
|
-
`
|
|
288
|
-
});
|
|
289
|
-
choiceNames.push(sliceName);
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
const choiceUnionName = buildTypeName(args.path[0].name, "Document", "Data", args.name, "Slice");
|
|
294
|
-
const choiceUnion = buildUnion(choiceNames);
|
|
295
|
-
auxiliaryTypes.push({
|
|
296
|
-
name: choiceUnionName,
|
|
297
|
-
code: `type ${choiceUnionName} = ${choiceUnion}`
|
|
298
|
-
});
|
|
299
|
-
contentTypeNames.push(choiceUnionName);
|
|
300
|
-
code = addLine(`${name}: prismic.SliceZone<${choiceUnionName}>;`, code);
|
|
301
|
-
break;
|
|
302
|
-
}
|
|
303
|
-
default: {
|
|
304
|
-
code = addLine(`${name}: unknown;`, code);
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
return {
|
|
308
|
-
code,
|
|
309
|
-
auxiliaryTypes,
|
|
310
|
-
contentTypeNames
|
|
311
|
-
};
|
|
312
|
-
}
|
|
313
|
-
function buildFieldProperties(args) {
|
|
314
|
-
let code = "";
|
|
315
|
-
const auxiliaryTypes = [];
|
|
316
|
-
const contentTypeNames = [];
|
|
317
|
-
for (const name in args.fields) {
|
|
318
|
-
const field = args.fields[name];
|
|
319
|
-
const fieldProperty = buildFieldProperty({
|
|
320
|
-
name,
|
|
321
|
-
field,
|
|
322
|
-
path: args.path,
|
|
323
|
-
fieldConfigs: args.fieldConfigs,
|
|
324
|
-
tabName: args.tabName
|
|
325
|
-
});
|
|
326
|
-
code = addSection(fieldProperty.code, code);
|
|
327
|
-
auxiliaryTypes.push(...fieldProperty.auxiliaryTypes);
|
|
328
|
-
contentTypeNames.push(...fieldProperty.contentTypeNames);
|
|
329
|
-
}
|
|
330
|
-
return {
|
|
331
|
-
code,
|
|
332
|
-
auxiliaryTypes,
|
|
333
|
-
contentTypeNames
|
|
334
|
-
};
|
|
335
|
-
}
|
|
336
|
-
export {
|
|
337
|
-
buildFieldProperties
|
|
338
|
-
};
|
|
339
|
-
//# sourceMappingURL=buildFieldProperties.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buildFieldProperties.js","sources":["../../../src/lib/buildFieldProperties.ts"],"sourcesContent":["import {\n\ttype CustomTypeModelField,\n\tCustomTypeModelFieldType,\n} from \"@prismicio/client\";\nimport { source, stripIndent } from \"common-tags\";\n\nimport { AuxiliaryType, FieldConfigs, FieldPath } from \"../types\";\n\nimport { addLine } from \"./addLine\";\nimport { addSection } from \"./addSection\";\nimport { buildFieldDocs } from \"./buildFieldDocs\";\nimport { buildTypeName } from \"./buildTypeName\";\nimport { buildUnion } from \"./buildUnion\";\nimport { getHumanReadablePath } from \"./getHumanReadablePath\";\n\ntype BuildFieldPropertyArgs = Pick<\n\tBuildFieldPropertiesArgs,\n\t\"path\" | \"fieldConfigs\" | \"tabName\"\n> & {\n\tname: string;\n\tfield: CustomTypeModelField;\n};\n\ntype BuildFieldPropertyReturnType = {\n\tcode: string;\n\tauxiliaryTypes: AuxiliaryType[];\n\tcontentTypeNames: string[];\n};\n\nfunction buildFieldProperty(\n\targs: BuildFieldPropertyArgs,\n): BuildFieldPropertyReturnType {\n\tlet code = buildFieldDocs({\n\t\tname: args.name,\n\t\tfield: args.field,\n\t\tpath: args.path,\n\t\ttabName: args.tabName,\n\t});\n\n\tconst auxiliaryTypes: AuxiliaryType[] = [];\n\tconst contentTypeNames: string[] = [];\n\n\tconst name =\n\t\targs.name.includes(\"-\") ||\n\t\targs.name.includes(\":\") ||\n\t\t/^[0-9]/.test(args.name)\n\t\t\t? `\"${args.name}\"`\n\t\t\t: args.name;\n\n\tswitch (args.field.type) {\n\t\tcase \"UID\": {\n\t\t\t// UID fields are not included in Data.\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"Boolean\": {\n\t\t\tcode = addLine(`${name}: prismic.BooleanField;`, code);\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"Color\": {\n\t\t\tcode = addLine(`${name}: prismic.ColorField;`, code);\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"Date\": {\n\t\t\tcode = addLine(`${name}: prismic.DateField;`, code);\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"Embed\": {\n\t\t\tconst providerTypes: string[] = [];\n\n\t\t\tif (args.fieldConfigs.embed?.providerTypes) {\n\t\t\t\tfor (const providerType in args.fieldConfigs.embed?.providerTypes) {\n\t\t\t\t\tconst configuredProviderType =\n\t\t\t\t\t\targs.fieldConfigs.embed?.providerTypes[providerType];\n\n\t\t\t\t\tproviderTypes.push(\n\t\t\t\t\t\t`({ provider_name: \"${providerType}\" } & ${configuredProviderType})`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst providerTypesUnion = buildUnion(providerTypes);\n\n\t\t\tcode =\n\t\t\t\tproviderTypes.length > 0\n\t\t\t\t\t? addLine(\n\t\t\t\t\t\t\t`${name}: prismic.EmbedField<prismic.AnyOEmbed & prismic.OEmbedExtra & (${providerTypesUnion})>`,\n\t\t\t\t\t\t\tcode,\n\t\t\t\t\t )\n\t\t\t\t\t: addLine(`${name}: prismic.EmbedField`, code);\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"GeoPoint\": {\n\t\t\tcode = addLine(`${name}: prismic.GeoPointField;`, code);\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"Image\": {\n\t\t\tif (\n\t\t\t\targs.field.config?.thumbnails &&\n\t\t\t\targs.field.config.thumbnails.length > 0\n\t\t\t) {\n\t\t\t\tconst thumbnailNames = buildUnion(\n\t\t\t\t\targs.field.config.thumbnails.map((thumb) => `\"${thumb.name}\"`),\n\t\t\t\t);\n\n\t\t\t\tcode = addLine(`${name}: prismic.ImageField<${thumbnailNames}>;`, code);\n\t\t\t} else {\n\t\t\t\tcode = addLine(`${name}: prismic.ImageField<never>;`, code);\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"IntegrationFields\": {\n\t\t\tconst catalogType = args.field.config?.catalog\n\t\t\t\t? args.fieldConfigs.integrationFields?.catalogTypes?.[\n\t\t\t\t\t\targs.field.config.catalog\n\t\t\t\t ]\n\t\t\t\t: undefined;\n\n\t\t\tif (catalogType) {\n\t\t\t\tcode = addLine(\n\t\t\t\t\t`${name}: prismic.IntegrationField<${catalogType}>;`,\n\t\t\t\t\tcode,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tcode = addLine(`${name}: prismic.IntegrationField;`, code);\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"Link\": {\n\t\t\tconst variants =\n\t\t\t\targs.field.config &&\n\t\t\t\t\"variants\" in args.field.config &&\n\t\t\t\tArray.isArray(args.field.config.variants) &&\n\t\t\t\targs.field.config.variants.length > 0\n\t\t\t\t\t? args.field.config.variants\n\t\t\t\t\t\t\t.map((variant) => `\"${variant.replace(/\\\"/g, '\\\\\"')}\"`)\n\t\t\t\t\t\t\t.join(\" | \")\n\t\t\t\t\t: \"never\";\n\n\t\t\tswitch (args.field.config?.select) {\n\t\t\t\tcase \"document\": {\n\t\t\t\t\tif (\n\t\t\t\t\t\t\"customtypes\" in args.field.config &&\n\t\t\t\t\t\targs.field.config.customtypes &&\n\t\t\t\t\t\targs.field.config.customtypes.length > 0\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst contentRelationshipUnion = buildUnion(\n\t\t\t\t\t\t\targs.field.config.customtypes.map((type) => {\n\t\t\t\t\t\t\t\tif (typeof type === \"string\") {\n\t\t\t\t\t\t\t\t\treturn `prismic.ContentRelationshipField<\"${type}\">`;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn `ContentRelationshipFieldWithData<${JSON.stringify([\n\t\t\t\t\t\t\t\t\ttype,\n\t\t\t\t\t\t\t\t])}>`;\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tcode = addLine(`${name}: ${contentRelationshipUnion};`, code);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcode = addLine(`${name}: prismic.ContentRelationshipField;`, code);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase \"media\": {\n\t\t\t\t\tcode = addLine(\n\t\t\t\t\t\t`${name}: prismic.LinkToMediaField<prismic.FieldState, ${variants}>;`,\n\t\t\t\t\t\tcode,\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tdefault: {\n\t\t\t\t\tlet type = `prismic.LinkField<string, string, unknown, prismic.FieldState, ${variants}>`;\n\n\t\t\t\t\tif (args.field.config?.repeat) {\n\t\t\t\t\t\ttype = `prismic.Repeatable<${type}>`;\n\t\t\t\t\t}\n\n\t\t\t\t\tcode = addLine(`${name}: ${type};`, code);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"Number\": {\n\t\t\tcode = addLine(`${name}: prismic.NumberField;`, code);\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"StructuredText\": {\n\t\t\tcode = addLine(`${name}: prismic.RichTextField;`, code);\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"Select\": {\n\t\t\tconst options: string[] =\n\t\t\t\targs.field.config?.options?.map((option) => `\"${option}\"`) || [];\n\t\t\tconst optionsType = options.length ? buildUnion(options) : \"string\";\n\n\t\t\tconst hasDefault = Boolean(args.field.config?.default_value);\n\n\t\t\tif (hasDefault) {\n\t\t\t\tcode = addLine(\n\t\t\t\t\t`${name}: prismic.SelectField<${optionsType}, \"filled\">;`,\n\t\t\t\t\tcode,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tcode = addLine(\n\t\t\t\t\t`${name}: prismic.SelectField${\n\t\t\t\t\t\toptions.length > 0 ? `<${optionsType}>` : \"\"\n\t\t\t\t\t};`,\n\t\t\t\t\tcode,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"Table\": {\n\t\t\tcode = addLine(`${name}: prismic.TableField;`, code);\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"Text\": {\n\t\t\tcode = addLine(`${name}: prismic.KeyTextField;`, code);\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"Timestamp\": {\n\t\t\tcode = addLine(`${name}: prismic.TimestampField;`, code);\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"Group\": {\n\t\t\tconst groupPathParts = args.path.filter(\n\t\t\t\t(part) =>\n\t\t\t\t\tpart.model !== undefined &&\n\t\t\t\t\t\"type\" in part.model &&\n\t\t\t\t\tpart.model.type === CustomTypeModelFieldType.Group,\n\t\t\t);\n\t\t\tconst isNestedGroup = groupPathParts.length > 0;\n\n\t\t\tlet itemName;\n\t\t\tif (\n\t\t\t\targs.path[0].model &&\n\t\t\t\t\"type\" in args.path[0].model &&\n\t\t\t\targs.path[0].model.type === \"SharedSlice\"\n\t\t\t) {\n\t\t\t\tconst [slicePathPart, variationPathPart, zonePathPart] = args.path;\n\n\t\t\t\titemName = buildTypeName(\n\t\t\t\t\tslicePathPart.name,\n\t\t\t\t\t\"Slice\",\n\t\t\t\t\tvariationPathPart.name,\n\t\t\t\t\tzonePathPart.name,\n\t\t\t\t\t...groupPathParts.map((part) => part.name),\n\t\t\t\t\targs.name,\n\t\t\t\t\t\"Item\",\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\titemName = buildTypeName(\n\t\t\t\t\targs.path[0].name,\n\t\t\t\t\t\"Document\",\n\t\t\t\t\t\"Data\",\n\t\t\t\t\t...groupPathParts.map((part) => part.name),\n\t\t\t\t\targs.name,\n\t\t\t\t\t\"Item\",\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst path: FieldPath = [\n\t\t\t\t...args.path,\n\t\t\t\t{\n\t\t\t\t\tname: name,\n\t\t\t\t\tmodel: args.field,\n\t\t\t\t},\n\t\t\t];\n\t\t\tconst humanReadablePath = getHumanReadablePath({ path });\n\n\t\t\tconst itemFieldProperties = buildFieldProperties({\n\t\t\t\tfields: args.field.config?.fields || {},\n\t\t\t\tfieldConfigs: args.fieldConfigs,\n\t\t\t\tpath,\n\t\t\t});\n\t\t\tauxiliaryTypes.push(...itemFieldProperties.auxiliaryTypes);\n\t\t\tcontentTypeNames.push(...itemFieldProperties.contentTypeNames);\n\n\t\t\tauxiliaryTypes.push({\n\t\t\t\tname: itemName,\n\t\t\t\tcode: source`\n\t\t\t\t\t/**\n\t\t\t\t\t * Item in *${humanReadablePath}*\n\t\t\t\t\t */\n\t\t\t\t\texport interface ${itemName} {\n\t\t\t\t\t\t${itemFieldProperties.code}\n\t\t\t\t\t}\n\t\t\t\t`,\n\t\t\t});\n\t\t\tcontentTypeNames.push(itemName);\n\n\t\t\tif (isNestedGroup) {\n\t\t\t\tcode = addLine(\n\t\t\t\t\t`${name}: prismic.NestedGroupField<Simplify<${itemName}>>;`,\n\t\t\t\t\tcode,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tcode = addLine(\n\t\t\t\t\t`${name}: prismic.GroupField<Simplify<${itemName}>>;`,\n\t\t\t\t\tcode,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"Slices\": {\n\t\t\tconst choiceNames: string[] = [];\n\n\t\t\tif (args.field.config?.choices) {\n\t\t\t\tfor (const choiceID in args.field.config.choices) {\n\t\t\t\t\tconst choice = args.field.config.choices[choiceID];\n\n\t\t\t\t\tif (choice.type === \"SharedSlice\") {\n\t\t\t\t\t\t// TODO: Verify that the Shared Slice\n\t\t\t\t\t\t// is provided to the global\n\t\t\t\t\t\t// `sharedSlices` array. If it is not,\n\t\t\t\t\t\t// the type won't exist, so we can't\n\t\t\t\t\t\t// add it to the union. We should\n\t\t\t\t\t\t// probably throw an error if we reach\n\t\t\t\t\t\t// that state, or maybe the input can\n\t\t\t\t\t\t// be validated early so we don't\n\t\t\t\t\t\t// generate any code using invalid\n\t\t\t\t\t\t// models.\n\t\t\t\t\t\tchoiceNames.push(buildTypeName(choiceID, \"Slice\"));\n\t\t\t\t\t} else if (choice.type === \"Slice\") {\n\t\t\t\t\t\tconst sliceName = buildTypeName(\n\t\t\t\t\t\t\targs.path[0].name,\n\t\t\t\t\t\t\t\"Document\",\n\t\t\t\t\t\t\t\"Data\",\n\t\t\t\t\t\t\targs.name,\n\t\t\t\t\t\t\tchoiceID,\n\t\t\t\t\t\t\t\"Slice\",\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tlet primaryInterfaceName: string | undefined;\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tchoice[\"non-repeat\"] &&\n\t\t\t\t\t\t\tObject.keys(choice[\"non-repeat\"]).length > 0\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tprimaryInterfaceName = buildTypeName(sliceName, \"Primary\");\n\n\t\t\t\t\t\t\tconst path: FieldPath = [\n\t\t\t\t\t\t\t\t...args.path,\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tname: args.name,\n\t\t\t\t\t\t\t\t\tmodel: args.field,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tname: choiceID,\n\t\t\t\t\t\t\t\t\tmodel: choice,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tname: \"primary\",\n\t\t\t\t\t\t\t\t\tlabel: \"Primary\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t\tconst humanReadablePath = getHumanReadablePath({ path });\n\n\t\t\t\t\t\t\tconst primaryFieldProperties = buildFieldProperties({\n\t\t\t\t\t\t\t\tfields: choice[\"non-repeat\"],\n\t\t\t\t\t\t\t\tfieldConfigs: args.fieldConfigs,\n\t\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tauxiliaryTypes.push(...primaryFieldProperties.auxiliaryTypes);\n\t\t\t\t\t\t\tcontentTypeNames.push(...primaryFieldProperties.contentTypeNames);\n\n\t\t\t\t\t\t\tlet primaryCode = stripIndent`\n\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t * Primary content in *${humanReadablePath}*\n\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t`;\n\t\t\t\t\t\t\tprimaryCode = primaryFieldProperties.code\n\t\t\t\t\t\t\t\t? addLine(\n\t\t\t\t\t\t\t\t\t\tsource`\n\t\t\t\t\t\t\t\t\t\t\texport interface ${primaryInterfaceName} {\n\t\t\t\t\t\t\t\t\t\t\t\t${primaryFieldProperties.code}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t\t\t\t\tprimaryCode,\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: addLine(\n\t\t\t\t\t\t\t\t\t\t`export interface ${primaryInterfaceName} {}`,\n\t\t\t\t\t\t\t\t\t\tprimaryCode,\n\t\t\t\t\t\t\t\t );\n\n\t\t\t\t\t\t\tauxiliaryTypes.push({\n\t\t\t\t\t\t\t\tname: primaryInterfaceName,\n\t\t\t\t\t\t\t\tcode: primaryCode,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tcontentTypeNames.push(primaryInterfaceName);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet itemInterfaceName: string | undefined;\n\t\t\t\t\t\tif (choice.repeat && Object.keys(choice.repeat).length > 0) {\n\t\t\t\t\t\t\titemInterfaceName = buildTypeName(sliceName, \"Item\");\n\n\t\t\t\t\t\t\tconst path: FieldPath = [\n\t\t\t\t\t\t\t\t...args.path,\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tname: args.name,\n\t\t\t\t\t\t\t\t\tmodel: args.field,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tname: choiceID,\n\t\t\t\t\t\t\t\t\tmodel: choice,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tname: \"items\",\n\t\t\t\t\t\t\t\t\tlabel: \"Items\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t\tconst humanReadablePath = getHumanReadablePath({ path });\n\n\t\t\t\t\t\t\tconst itemFieldProperties = buildFieldProperties({\n\t\t\t\t\t\t\t\tfields: choice.repeat,\n\t\t\t\t\t\t\t\tfieldConfigs: args.fieldConfigs,\n\t\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tauxiliaryTypes.push(...itemFieldProperties.auxiliaryTypes);\n\t\t\t\t\t\t\tcontentTypeNames.push(...itemFieldProperties.contentTypeNames);\n\n\t\t\t\t\t\t\tlet itemCode = stripIndent`\n\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t * Item content in *${humanReadablePath}*\n\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t`;\n\t\t\t\t\t\t\titemCode = itemFieldProperties.code\n\t\t\t\t\t\t\t\t? addLine(\n\t\t\t\t\t\t\t\t\t\tsource`\n\t\t\t\t\t\t\t\t\t\t\texport interface ${itemInterfaceName} {\n\t\t\t\t\t\t\t\t\t\t\t\t${itemFieldProperties.code}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t\t\t\t\titemCode,\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: addLine(`export interface ${itemInterfaceName} {}`, itemCode);\n\n\t\t\t\t\t\t\tauxiliaryTypes.push({\n\t\t\t\t\t\t\t\tname: itemInterfaceName,\n\t\t\t\t\t\t\t\tcode: itemCode,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tcontentTypeNames.push(itemInterfaceName);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tauxiliaryTypes.push({\n\t\t\t\t\t\t\tname: sliceName,\n\t\t\t\t\t\t\tcode: stripIndent`\n\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t * Slice for *${getHumanReadablePath({\n\t\t\t\t\t\t\t\t\t\tpath: [\n\t\t\t\t\t\t\t\t\t\t\t...args.path,\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tname: args.name,\n\t\t\t\t\t\t\t\t\t\t\t\tmodel: args.field,\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t})}*\n\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\texport type ${sliceName} = prismic.Slice<\"${choiceID}\", ${\n\t\t\t\t\t\t\t\tprimaryInterfaceName\n\t\t\t\t\t\t\t\t\t? `Simplify<${primaryInterfaceName}>`\n\t\t\t\t\t\t\t\t\t: `Record<string, never>`\n\t\t\t\t\t\t\t}, ${\n\t\t\t\t\t\t\t\titemInterfaceName ? `Simplify<${itemInterfaceName}>` : `never`\n\t\t\t\t\t\t\t}>\n\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tchoiceNames.push(sliceName);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst choiceUnionName = buildTypeName(\n\t\t\t\targs.path[0].name,\n\t\t\t\t\"Document\",\n\t\t\t\t\"Data\",\n\t\t\t\targs.name,\n\t\t\t\t\"Slice\",\n\t\t\t);\n\t\t\tconst choiceUnion = buildUnion(choiceNames);\n\t\t\tauxiliaryTypes.push({\n\t\t\t\tname: choiceUnionName,\n\t\t\t\tcode: `type ${choiceUnionName} = ${choiceUnion}`,\n\t\t\t});\n\t\t\tcontentTypeNames.push(choiceUnionName);\n\n\t\t\tcode = addLine(`${name}: prismic.SliceZone<${choiceUnionName}>;`, code);\n\n\t\t\tbreak;\n\t\t}\n\n\t\tdefault: {\n\t\t\tcode = addLine(`${name}: unknown;`, code);\n\t\t}\n\t}\n\n\treturn {\n\t\tcode,\n\t\tauxiliaryTypes,\n\t\tcontentTypeNames,\n\t};\n}\n\ntype BuildFieldPropertiesArgs = {\n\tfields: Record<string, CustomTypeModelField>;\n\tpath: FieldPath;\n\tfieldConfigs: FieldConfigs;\n\ttabName?: string;\n};\n\ntype BuildFieldPropertiesReturnType = {\n\tcode: string;\n\tauxiliaryTypes: AuxiliaryType[];\n\tcontentTypeNames: string[];\n};\n\nexport function buildFieldProperties(\n\targs: BuildFieldPropertiesArgs,\n): BuildFieldPropertiesReturnType {\n\tlet code = \"\";\n\n\tconst auxiliaryTypes: AuxiliaryType[] = [];\n\tconst contentTypeNames: string[] = [];\n\n\tfor (const name in args.fields) {\n\t\tconst field = args.fields[name];\n\n\t\tconst fieldProperty = buildFieldProperty({\n\t\t\tname,\n\t\t\tfield,\n\t\t\tpath: args.path,\n\t\t\tfieldConfigs: args.fieldConfigs,\n\t\t\ttabName: args.tabName,\n\t\t});\n\n\t\tcode = addSection(fieldProperty.code, code);\n\n\t\tauxiliaryTypes.push(...fieldProperty.auxiliaryTypes);\n\t\tcontentTypeNames.push(...fieldProperty.contentTypeNames);\n\t}\n\n\treturn {\n\t\tcode,\n\t\tauxiliaryTypes,\n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6B,CAAA;AAExB,aAAA,QAAQ,KAAK,QAAQ;AACzB,UAAA,QAAQ,KAAK,OAAO,IAAI;AAE9B,UAAM,gBAAgB,mBAAmB;AAAA,MACxC;AAAA,MACA;AAAA,MACA,MAAM,KAAK;AAAA,MACX,cAAc,KAAK;AAAA,MACnB,SAAS,KAAK;AAAA,IAAA,CACd;AAEM,WAAA,WAAW,cAAc,MAAM,IAAI;AAE3B,mBAAA,KAAK,GAAG,cAAc,cAAc;AAClC,qBAAA,KAAK,GAAG,cAAc,gBAAgB;AAAA,EACxD;AAEO,SAAA;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAEF;"}
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const commonTags = require("common-tags");
|
|
4
|
-
const constants = require("../constants.cjs");
|
|
5
|
-
const addSection = require("./addSection.cjs");
|
|
6
|
-
const buildFieldProperties = require("./buildFieldProperties.cjs");
|
|
7
|
-
const buildTypeName = require("./buildTypeName.cjs");
|
|
8
|
-
const buildUnion = require("./buildUnion.cjs");
|
|
9
|
-
const getCacheKey = require("./getCacheKey.cjs");
|
|
10
|
-
const getHumanReadableModelName = require("./getHumanReadableModelName.cjs");
|
|
11
|
-
const getHumanReadablePath = require("./getHumanReadablePath.cjs");
|
|
12
|
-
function buildSharedSliceType(args) {
|
|
13
|
-
if (args.cache) {
|
|
14
|
-
const key = getCacheKey.getCacheKey([args.model, args.fieldConfigs]);
|
|
15
|
-
const cached = args.cache.get(key);
|
|
16
|
-
if (cached) {
|
|
17
|
-
return cached;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
let code = "";
|
|
21
|
-
const auxiliaryTypes = [];
|
|
22
|
-
const contentTypeNames = [];
|
|
23
|
-
const name = buildTypeName.buildTypeName(args.model.id, "Slice");
|
|
24
|
-
const humanReadableName = getHumanReadableModelName.getHumanReadableModelName({
|
|
25
|
-
name: args.model.id,
|
|
26
|
-
model: args.model
|
|
27
|
-
});
|
|
28
|
-
const variationNames = [];
|
|
29
|
-
for (const variationModel of args.model.variations) {
|
|
30
|
-
const variationName = buildTypeName.buildTypeName(name, variationModel.id);
|
|
31
|
-
let primaryInterfaceName;
|
|
32
|
-
if (variationModel.primary && Object.keys(variationModel.primary).length > 0) {
|
|
33
|
-
primaryInterfaceName = buildTypeName.buildTypeName(variationName, "Primary");
|
|
34
|
-
const path = [
|
|
35
|
-
{
|
|
36
|
-
name: args.model.id,
|
|
37
|
-
model: args.model
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
name: variationModel.id,
|
|
41
|
-
label: variationModel.name
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
name: "primary",
|
|
45
|
-
label: "Primary"
|
|
46
|
-
}
|
|
47
|
-
];
|
|
48
|
-
const humanReadablePath = getHumanReadablePath.getHumanReadablePath({ path });
|
|
49
|
-
const primaryFieldProperties = buildFieldProperties.buildFieldProperties({
|
|
50
|
-
fields: variationModel.primary,
|
|
51
|
-
fieldConfigs: args.fieldConfigs,
|
|
52
|
-
path
|
|
53
|
-
});
|
|
54
|
-
auxiliaryTypes.push(...primaryFieldProperties.auxiliaryTypes);
|
|
55
|
-
contentTypeNames.push(...primaryFieldProperties.contentTypeNames);
|
|
56
|
-
contentTypeNames.push(primaryInterfaceName);
|
|
57
|
-
const docs = commonTags.stripIndent`
|
|
58
|
-
/**
|
|
59
|
-
* Primary content in *${humanReadablePath}*
|
|
60
|
-
*/
|
|
61
|
-
`;
|
|
62
|
-
code = addSection.addSection(primaryFieldProperties.code ? commonTags.source`
|
|
63
|
-
${docs}
|
|
64
|
-
export interface ${primaryInterfaceName} {
|
|
65
|
-
${primaryFieldProperties.code}
|
|
66
|
-
}
|
|
67
|
-
` : commonTags.source`
|
|
68
|
-
${docs}
|
|
69
|
-
export interface ${primaryInterfaceName} {}
|
|
70
|
-
`, code);
|
|
71
|
-
}
|
|
72
|
-
let itemInterfaceName;
|
|
73
|
-
if (variationModel.items && Object.keys(variationModel.items).length > 0) {
|
|
74
|
-
itemInterfaceName = buildTypeName.buildTypeName(variationName, "Item");
|
|
75
|
-
const path = [
|
|
76
|
-
{
|
|
77
|
-
name: args.model.id,
|
|
78
|
-
model: args.model
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
name: "items",
|
|
82
|
-
label: "Items"
|
|
83
|
-
}
|
|
84
|
-
];
|
|
85
|
-
const humanReadablePath = getHumanReadablePath.getHumanReadablePath({ path });
|
|
86
|
-
const itemFieldProperties = buildFieldProperties.buildFieldProperties({
|
|
87
|
-
fields: variationModel.items,
|
|
88
|
-
fieldConfigs: args.fieldConfigs,
|
|
89
|
-
path
|
|
90
|
-
});
|
|
91
|
-
auxiliaryTypes.push(...itemFieldProperties.auxiliaryTypes);
|
|
92
|
-
contentTypeNames.push(...itemFieldProperties.contentTypeNames);
|
|
93
|
-
contentTypeNames.push(itemInterfaceName);
|
|
94
|
-
const docs = commonTags.stripIndent`
|
|
95
|
-
/**
|
|
96
|
-
* Primary content in *${humanReadablePath}*
|
|
97
|
-
*/
|
|
98
|
-
`;
|
|
99
|
-
code = addSection.addSection(itemFieldProperties.code ? commonTags.source`
|
|
100
|
-
${docs}
|
|
101
|
-
export interface ${itemInterfaceName} {
|
|
102
|
-
${itemFieldProperties.code}
|
|
103
|
-
}
|
|
104
|
-
` : commonTags.source`
|
|
105
|
-
${docs}
|
|
106
|
-
export interface ${itemInterfaceName} {}
|
|
107
|
-
`, code);
|
|
108
|
-
}
|
|
109
|
-
code = addSection.addSection(commonTags.source`
|
|
110
|
-
/**
|
|
111
|
-
* ${variationModel.name} variation for ${humanReadableName} Slice
|
|
112
|
-
*
|
|
113
|
-
* - **API ID**: \`${variationModel.id}\`
|
|
114
|
-
* - **Description**: ${variationModel.description || "*None*"}
|
|
115
|
-
* - **Documentation**: ${constants.SHARED_SLICES_DOCUMENTATION_URL}
|
|
116
|
-
*/
|
|
117
|
-
export type ${variationName} = prismic.SharedSliceVariation<"${variationModel.id}", ${primaryInterfaceName ? `Simplify<${primaryInterfaceName}>` : `Record<string, never>`}, ${itemInterfaceName ? `Simplify<${itemInterfaceName}>` : `never`}>;
|
|
118
|
-
`, code);
|
|
119
|
-
variationNames.push(variationName);
|
|
120
|
-
}
|
|
121
|
-
const variationUnionName = buildTypeName.buildTypeName(name, "Variation");
|
|
122
|
-
const variationsUnion = buildUnion.buildUnion(variationNames);
|
|
123
|
-
contentTypeNames.push(variationUnionName);
|
|
124
|
-
contentTypeNames.push(...variationNames);
|
|
125
|
-
code = addSection.addSection(commonTags.source`
|
|
126
|
-
/**
|
|
127
|
-
* Slice variation for *${humanReadableName}*
|
|
128
|
-
*/
|
|
129
|
-
type ${variationUnionName} = ${variationNames.length > 0 ? variationsUnion : "never"}
|
|
130
|
-
`, code);
|
|
131
|
-
code = addSection.addSection(commonTags.source`
|
|
132
|
-
/**
|
|
133
|
-
* ${humanReadableName} Shared Slice
|
|
134
|
-
*
|
|
135
|
-
* - **API ID**: \`${args.model.id}\`
|
|
136
|
-
* - **Description**: ${args.model.description || "*None*"}
|
|
137
|
-
* - **Documentation**: ${constants.SHARED_SLICES_DOCUMENTATION_URL}
|
|
138
|
-
*/
|
|
139
|
-
export type ${name} = prismic.SharedSlice<"${args.model.id}", ${variationUnionName}>;
|
|
140
|
-
`, code);
|
|
141
|
-
const result = {
|
|
142
|
-
name,
|
|
143
|
-
variationNames,
|
|
144
|
-
code,
|
|
145
|
-
auxiliaryTypes,
|
|
146
|
-
contentTypeNames
|
|
147
|
-
};
|
|
148
|
-
if (args.cache) {
|
|
149
|
-
const key = getCacheKey.getCacheKey([args.model, args.fieldConfigs]);
|
|
150
|
-
args.cache.set(key, result);
|
|
151
|
-
}
|
|
152
|
-
return result;
|
|
153
|
-
}
|
|
154
|
-
exports.buildSharedSliceType = buildSharedSliceType;
|
|
155
|
-
//# sourceMappingURL=buildSharedSliceType.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buildSharedSliceType.cjs","sources":["../../../src/lib/buildSharedSliceType.ts"],"sourcesContent":["import type { SharedSliceModel } from \"@prismicio/client\";\nimport { source, stripIndent } from \"common-tags\";\nimport QuickLRU from \"quick-lru\";\n\nimport { AuxiliaryType, FieldConfigs, FieldPath } from \"../types\";\n\nimport { SHARED_SLICES_DOCUMENTATION_URL } from \"../constants\";\n\nimport { addSection } from \"./addSection\";\nimport { buildFieldProperties } from \"./buildFieldProperties\";\nimport { buildTypeName } from \"./buildTypeName\";\nimport { buildUnion } from \"./buildUnion\";\nimport { getCacheKey } from \"./getCacheKey\";\nimport { getHumanReadableModelName } from \"./getHumanReadableModelName\";\nimport { getHumanReadablePath } from \"./getHumanReadablePath\";\n\ntype BuildSharedSliceTypeArgs = {\n\tmodel: SharedSliceModel;\n\tfieldConfigs: FieldConfigs;\n\tcache?: QuickLRU<string, unknown>;\n};\n\ntype BuildSharedSliceTypeReturnValue = {\n\tname: string;\n\tvariationNames: string[];\n\tcode: string;\n\tauxiliaryTypes: AuxiliaryType[];\n\tcontentTypeNames: string[];\n};\n\nexport function buildSharedSliceType(\n\targs: BuildSharedSliceTypeArgs,\n): BuildSharedSliceTypeReturnValue {\n\tif (args.cache) {\n\t\tconst key = getCacheKey([args.model, args.fieldConfigs]);\n\t\tconst cached = args.cache.get(key);\n\n\t\tif (cached) {\n\t\t\treturn cached as BuildSharedSliceTypeReturnValue;\n\t\t}\n\t}\n\n\tlet code = \"\";\n\n\tconst auxiliaryTypes: AuxiliaryType[] = [];\n\tconst contentTypeNames: string[] = [];\n\n\tconst name = buildTypeName(args.model.id, \"Slice\");\n\tconst humanReadableName = getHumanReadableModelName({\n\t\tname: args.model.id,\n\t\tmodel: args.model,\n\t});\n\n\tconst variationNames: string[] = [];\n\tfor (const variationModel of args.model.variations) {\n\t\tconst variationName = buildTypeName(name, variationModel.id);\n\n\t\tlet primaryInterfaceName: string | undefined;\n\t\tif (\n\t\t\tvariationModel.primary &&\n\t\t\tObject.keys(variationModel.primary).length > 0\n\t\t) {\n\t\t\tprimaryInterfaceName = buildTypeName(variationName, \"Primary\");\n\n\t\t\tconst path: FieldPath = [\n\t\t\t\t{\n\t\t\t\t\tname: args.model.id,\n\t\t\t\t\tmodel: args.model,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: variationModel.id,\n\t\t\t\t\tlabel: variationModel.name,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: \"primary\",\n\t\t\t\t\tlabel: \"Primary\",\n\t\t\t\t},\n\t\t\t];\n\t\t\tconst humanReadablePath = getHumanReadablePath({ path });\n\n\t\t\tconst primaryFieldProperties = buildFieldProperties({\n\t\t\t\tfields: variationModel.primary,\n\t\t\t\tfieldConfigs: args.fieldConfigs,\n\t\t\t\tpath,\n\t\t\t});\n\t\t\tauxiliaryTypes.push(...primaryFieldProperties.auxiliaryTypes);\n\t\t\tcontentTypeNames.push(...primaryFieldProperties.contentTypeNames);\n\n\t\t\tcontentTypeNames.push(primaryInterfaceName);\n\n\t\t\tconst docs = stripIndent`\n\t\t\t\t/**\n\t\t\t\t * Primary content in *${humanReadablePath}*\n\t\t\t\t */\n\t\t\t`;\n\n\t\t\tcode = addSection(\n\t\t\t\tprimaryFieldProperties.code\n\t\t\t\t\t? source`\n\t\t\t\t\t\t${docs}\n\t\t\t\t\t\texport interface ${primaryInterfaceName} {\n\t\t\t\t\t\t\t${primaryFieldProperties.code}\n\t\t\t\t\t\t}\n\t\t\t\t\t`\n\t\t\t\t\t: source`\n\t\t\t\t\t\t${docs}\n\t\t\t\t\t\texport interface ${primaryInterfaceName} {}\n\t\t\t\t\t`,\n\t\t\t\tcode,\n\t\t\t);\n\t\t}\n\n\t\tlet itemInterfaceName: string | undefined;\n\t\tif (variationModel.items && Object.keys(variationModel.items).length > 0) {\n\t\t\titemInterfaceName = buildTypeName(variationName, \"Item\");\n\n\t\t\tconst path: FieldPath = [\n\t\t\t\t{\n\t\t\t\t\tname: args.model.id,\n\t\t\t\t\tmodel: args.model,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: \"items\",\n\t\t\t\t\tlabel: \"Items\",\n\t\t\t\t},\n\t\t\t];\n\t\t\tconst humanReadablePath = getHumanReadablePath({ path });\n\n\t\t\tconst itemFieldProperties = buildFieldProperties({\n\t\t\t\tfields: variationModel.items,\n\t\t\t\tfieldConfigs: args.fieldConfigs,\n\t\t\t\tpath,\n\t\t\t});\n\t\t\tauxiliaryTypes.push(...itemFieldProperties.auxiliaryTypes);\n\t\t\tcontentTypeNames.push(...itemFieldProperties.contentTypeNames);\n\n\t\t\tcontentTypeNames.push(itemInterfaceName);\n\n\t\t\tconst docs = stripIndent`\n\t\t\t\t/**\n\t\t\t\t * Primary content in *${humanReadablePath}*\n\t\t\t\t */\n\t\t\t`;\n\n\t\t\tcode = addSection(\n\t\t\t\titemFieldProperties.code\n\t\t\t\t\t? source`\n\t\t\t\t\t\t${docs}\n\t\t\t\t\t\texport interface ${itemInterfaceName} {\n\t\t\t\t\t\t\t${itemFieldProperties.code}\n\t\t\t\t\t\t}\n\t\t\t\t\t`\n\t\t\t\t\t: source`\n\t\t\t\t\t\t${docs}\n\t\t\t\t\t\texport interface ${itemInterfaceName} {}\n\t\t\t\t\t`,\n\t\t\t\tcode,\n\t\t\t);\n\t\t}\n\n\t\tcode = addSection(\n\t\t\tsource`\n\t\t\t\t/**\n\t\t\t\t * ${variationModel.name} variation for ${humanReadableName} Slice\n\t\t\t\t *\n\t\t\t\t * - **API ID**: \\`${variationModel.id}\\`\n\t\t\t\t * - **Description**: ${variationModel.description || \"*None*\"}\n\t\t\t\t * - **Documentation**: ${SHARED_SLICES_DOCUMENTATION_URL}\n\t\t\t\t */\n\t\t\t\texport type ${variationName} = prismic.SharedSliceVariation<\"${\n\t\t\t\tvariationModel.id\n\t\t\t}\", ${\n\t\t\t\tprimaryInterfaceName\n\t\t\t\t\t? `Simplify<${primaryInterfaceName}>`\n\t\t\t\t\t: `Record<string, never>`\n\t\t\t}, ${itemInterfaceName ? `Simplify<${itemInterfaceName}>` : `never`}>;\n\t\t\t`,\n\t\t\tcode,\n\t\t);\n\n\t\tvariationNames.push(variationName);\n\t}\n\n\tconst variationUnionName = buildTypeName(name, \"Variation\");\n\tconst variationsUnion = buildUnion(variationNames);\n\n\tcontentTypeNames.push(variationUnionName);\n\tcontentTypeNames.push(...variationNames);\n\n\tcode = addSection(\n\t\tsource`\n\t\t\t/**\n\t\t\t * Slice variation for *${humanReadableName}*\n\t\t\t */\n\t\t\ttype ${variationUnionName} = ${\n\t\t\tvariationNames.length > 0 ? variationsUnion : \"never\"\n\t\t}\n\t\t`,\n\t\tcode,\n\t);\n\n\tcode = addSection(\n\t\tsource`\n\t\t\t/**\n\t\t\t * ${humanReadableName} Shared Slice\n\t\t\t *\n\t\t\t * - **API ID**: \\`${args.model.id}\\`\n\t\t\t * - **Description**: ${args.model.description || \"*None*\"}\n\t\t\t * - **Documentation**: ${SHARED_SLICES_DOCUMENTATION_URL}\n\t\t\t */\n\t\t\texport type ${name} = prismic.SharedSlice<\"${\n\t\t\targs.model.id\n\t\t}\", ${variationUnionName}>;\n\t\t`,\n\t\tcode,\n\t);\n\n\tconst result = {\n\t\tname,\n\t\tvariationNames,\n\t\tcode,\n\t\tauxiliaryTypes,\n\t\tcontentTypeNames,\n\t};\n\n\tif (args.cache) {\n\t\tconst key = getCacheKey([args.model, args.fieldConfigs]);\n\n\t\targs.cache.set(key, result);\n\t}\n\n\treturn result;\n}\n"],"names":["getCacheKey","buildTypeName","getHumanReadableModelName","getHumanReadablePath","buildFieldProperties","stripIndent","addSection","source","SHARED_SLICES_DOCUMENTATION_URL","buildUnion"],"mappings":";;;;;;;;;;;AA8BM,SAAU,qBACf,MAA8B;AAE9B,MAAI,KAAK,OAAO;AACf,UAAM,MAAMA,YAAAA,YAAY,CAAC,KAAK,OAAO,KAAK,YAAY,CAAC;AACvD,UAAM,SAAS,KAAK,MAAM,IAA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