@slicemachine/adapter-nuxt 0.0.2-dev-plugins-m3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +98 -0
- package/dist/_node_modules/data-uri-to-buffer/dist/index.cjs +41 -0
- package/dist/_node_modules/data-uri-to-buffer/dist/index.cjs.map +1 -0
- package/dist/_node_modules/data-uri-to-buffer/dist/index.js +41 -0
- package/dist/_node_modules/data-uri-to-buffer/dist/index.js.map +1 -0
- package/dist/_node_modules/fetch-blob/file.cjs +61 -0
- package/dist/_node_modules/fetch-blob/file.cjs.map +1 -0
- package/dist/_node_modules/fetch-blob/file.js +61 -0
- package/dist/_node_modules/fetch-blob/file.js.map +1 -0
- package/dist/_node_modules/fetch-blob/index.cjs +223 -0
- package/dist/_node_modules/fetch-blob/index.cjs.map +1 -0
- package/dist/_node_modules/fetch-blob/index.js +223 -0
- package/dist/_node_modules/fetch-blob/index.js.map +1 -0
- package/dist/_node_modules/fetch-blob/streams.cjs +43 -0
- package/dist/_node_modules/fetch-blob/streams.cjs.map +1 -0
- package/dist/_node_modules/fetch-blob/streams.js +42 -0
- package/dist/_node_modules/fetch-blob/streams.js.map +1 -0
- package/dist/_node_modules/formdata-polyfill/esm.min.cjs +116 -0
- package/dist/_node_modules/formdata-polyfill/esm.min.cjs.map +1 -0
- package/dist/_node_modules/formdata-polyfill/esm.min.js +116 -0
- package/dist/_node_modules/formdata-polyfill/esm.min.js.map +1 -0
- package/dist/_node_modules/node-domexception/index.cjs +11 -0
- package/dist/_node_modules/node-domexception/index.cjs.map +1 -0
- package/dist/_node_modules/node-domexception/index.js +10 -0
- package/dist/_node_modules/node-domexception/index.js.map +1 -0
- package/dist/_node_modules/node-fetch/src/body.cjs +262 -0
- package/dist/_node_modules/node-fetch/src/body.cjs.map +1 -0
- package/dist/_node_modules/node-fetch/src/body.js +262 -0
- package/dist/_node_modules/node-fetch/src/body.js.map +1 -0
- package/dist/_node_modules/node-fetch/src/errors/abort-error.cjs +10 -0
- package/dist/_node_modules/node-fetch/src/errors/abort-error.cjs.map +1 -0
- package/dist/_node_modules/node-fetch/src/errors/abort-error.js +10 -0
- package/dist/_node_modules/node-fetch/src/errors/abort-error.js.map +1 -0
- package/dist/_node_modules/node-fetch/src/errors/base.cjs +17 -0
- package/dist/_node_modules/node-fetch/src/errors/base.cjs.map +1 -0
- package/dist/_node_modules/node-fetch/src/errors/base.js +17 -0
- package/dist/_node_modules/node-fetch/src/errors/base.js.map +1 -0
- package/dist/_node_modules/node-fetch/src/errors/fetch-error.cjs +19 -0
- package/dist/_node_modules/node-fetch/src/errors/fetch-error.cjs.map +1 -0
- package/dist/_node_modules/node-fetch/src/errors/fetch-error.js +19 -0
- package/dist/_node_modules/node-fetch/src/errors/fetch-error.js.map +1 -0
- package/dist/_node_modules/node-fetch/src/headers.cjs +190 -0
- package/dist/_node_modules/node-fetch/src/headers.cjs.map +1 -0
- package/dist/_node_modules/node-fetch/src/headers.js +190 -0
- package/dist/_node_modules/node-fetch/src/headers.js.map +1 -0
- package/dist/_node_modules/node-fetch/src/index.cjs +292 -0
- package/dist/_node_modules/node-fetch/src/index.cjs.map +1 -0
- package/dist/_node_modules/node-fetch/src/index.js +292 -0
- package/dist/_node_modules/node-fetch/src/index.js.map +1 -0
- package/dist/_node_modules/node-fetch/src/request.cjs +206 -0
- package/dist/_node_modules/node-fetch/src/request.cjs.map +1 -0
- package/dist/_node_modules/node-fetch/src/request.js +206 -0
- package/dist/_node_modules/node-fetch/src/request.js.map +1 -0
- package/dist/_node_modules/node-fetch/src/response.cjs +122 -0
- package/dist/_node_modules/node-fetch/src/response.cjs.map +1 -0
- package/dist/_node_modules/node-fetch/src/response.js +123 -0
- package/dist/_node_modules/node-fetch/src/response.js.map +1 -0
- package/dist/_node_modules/node-fetch/src/utils/get-search.cjs +12 -0
- package/dist/_node_modules/node-fetch/src/utils/get-search.cjs.map +1 -0
- package/dist/_node_modules/node-fetch/src/utils/get-search.js +12 -0
- package/dist/_node_modules/node-fetch/src/utils/get-search.js.map +1 -0
- package/dist/_node_modules/node-fetch/src/utils/is-redirect.cjs +8 -0
- package/dist/_node_modules/node-fetch/src/utils/is-redirect.cjs.map +1 -0
- package/dist/_node_modules/node-fetch/src/utils/is-redirect.js +8 -0
- package/dist/_node_modules/node-fetch/src/utils/is-redirect.js.map +1 -0
- package/dist/_node_modules/node-fetch/src/utils/is.cjs +28 -0
- package/dist/_node_modules/node-fetch/src/utils/is.cjs.map +1 -0
- package/dist/_node_modules/node-fetch/src/utils/is.js +28 -0
- package/dist/_node_modules/node-fetch/src/utils/is.js.map +1 -0
- package/dist/_node_modules/node-fetch/src/utils/multipart-parser.cjs +356 -0
- package/dist/_node_modules/node-fetch/src/utils/multipart-parser.cjs.map +1 -0
- package/dist/_node_modules/node-fetch/src/utils/multipart-parser.js +356 -0
- package/dist/_node_modules/node-fetch/src/utils/multipart-parser.js.map +1 -0
- package/dist/_node_modules/node-fetch/src/utils/referrer.cjs +149 -0
- package/dist/_node_modules/node-fetch/src/utils/referrer.cjs.map +1 -0
- package/dist/_node_modules/node-fetch/src/utils/referrer.js +149 -0
- package/dist/_node_modules/node-fetch/src/utils/referrer.js.map +1 -0
- package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.cjs +3822 -0
- package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.cjs.map +1 -0
- package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.js +3822 -0
- package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.js.map +1 -0
- package/dist/_virtual/_commonjsHelpers.cjs +5 -0
- package/dist/_virtual/_commonjsHelpers.cjs.map +1 -0
- package/dist/_virtual/_commonjsHelpers.js +5 -0
- package/dist/_virtual/_commonjsHelpers.js.map +1 -0
- package/dist/_virtual/ponyfill.es2018.cjs +13 -0
- package/dist/_virtual/ponyfill.es2018.cjs.map +1 -0
- package/dist/_virtual/ponyfill.es2018.js +14 -0
- package/dist/_virtual/ponyfill.es2018.js.map +1 -0
- package/dist/constants.cjs +5 -0
- package/dist/constants.cjs.map +1 -0
- package/dist/constants.d.ts +4 -0
- package/dist/constants.js +5 -0
- package/dist/constants.js.map +1 -0
- package/dist/hooks/customType-asset-delete.cjs +31 -0
- package/dist/hooks/customType-asset-delete.cjs.map +1 -0
- package/dist/hooks/customType-asset-delete.d.ts +3 -0
- package/dist/hooks/customType-asset-delete.js +14 -0
- package/dist/hooks/customType-asset-delete.js.map +1 -0
- package/dist/hooks/customType-asset-read.cjs +34 -0
- package/dist/hooks/customType-asset-read.cjs.map +1 -0
- package/dist/hooks/customType-asset-read.d.ts +3 -0
- package/dist/hooks/customType-asset-read.js +17 -0
- package/dist/hooks/customType-asset-read.js.map +1 -0
- package/dist/hooks/customType-asset-update.cjs +34 -0
- package/dist/hooks/customType-asset-update.cjs.map +1 -0
- package/dist/hooks/customType-asset-update.d.ts +3 -0
- package/dist/hooks/customType-asset-update.js +16 -0
- package/dist/hooks/customType-asset-update.js.map +1 -0
- package/dist/hooks/customType-create.cjs +43 -0
- package/dist/hooks/customType-create.cjs.map +1 -0
- package/dist/hooks/customType-create.d.ts +3 -0
- package/dist/hooks/customType-create.js +25 -0
- package/dist/hooks/customType-create.js.map +1 -0
- package/dist/hooks/customType-delete.cjs +32 -0
- package/dist/hooks/customType-delete.cjs.map +1 -0
- package/dist/hooks/customType-delete.d.ts +3 -0
- package/dist/hooks/customType-delete.js +15 -0
- package/dist/hooks/customType-delete.js.map +1 -0
- package/dist/hooks/customType-read.cjs +31 -0
- package/dist/hooks/customType-read.cjs.map +1 -0
- package/dist/hooks/customType-read.d.ts +3 -0
- package/dist/hooks/customType-read.js +14 -0
- package/dist/hooks/customType-read.js.map +1 -0
- package/dist/hooks/customType-rename.cjs +6 -0
- package/dist/hooks/customType-rename.cjs.map +1 -0
- package/dist/hooks/customType-rename.d.ts +1 -0
- package/dist/hooks/customType-rename.js +6 -0
- package/dist/hooks/customType-rename.js.map +1 -0
- package/dist/hooks/customType-update.cjs +6 -0
- package/dist/hooks/customType-update.cjs.map +1 -0
- package/dist/hooks/customType-update.d.ts +1 -0
- package/dist/hooks/customType-update.js +6 -0
- package/dist/hooks/customType-update.js.map +1 -0
- package/dist/hooks/customTypeLibrary-read.cjs +53 -0
- package/dist/hooks/customTypeLibrary-read.cjs.map +1 -0
- package/dist/hooks/customTypeLibrary-read.d.ts +3 -0
- package/dist/hooks/customTypeLibrary-read.js +35 -0
- package/dist/hooks/customTypeLibrary-read.js.map +1 -0
- package/dist/hooks/project-init.cjs +112 -0
- package/dist/hooks/project-init.cjs.map +1 -0
- package/dist/hooks/project-init.d.ts +3 -0
- package/dist/hooks/project-init.js +94 -0
- package/dist/hooks/project-init.js.map +1 -0
- package/dist/hooks/slice-asset-delete.cjs +33 -0
- package/dist/hooks/slice-asset-delete.cjs.map +1 -0
- package/dist/hooks/slice-asset-delete.d.ts +3 -0
- package/dist/hooks/slice-asset-delete.js +16 -0
- package/dist/hooks/slice-asset-delete.js.map +1 -0
- package/dist/hooks/slice-asset-read.cjs +36 -0
- package/dist/hooks/slice-asset-read.cjs.map +1 -0
- package/dist/hooks/slice-asset-read.d.ts +3 -0
- package/dist/hooks/slice-asset-read.js +19 -0
- package/dist/hooks/slice-asset-read.js.map +1 -0
- package/dist/hooks/slice-asset-update.cjs +36 -0
- package/dist/hooks/slice-asset-update.cjs.map +1 -0
- package/dist/hooks/slice-asset-update.d.ts +3 -0
- package/dist/hooks/slice-asset-update.js +18 -0
- package/dist/hooks/slice-asset-update.js.map +1 -0
- package/dist/hooks/slice-create.cjs +77 -0
- package/dist/hooks/slice-create.cjs.map +1 -0
- package/dist/hooks/slice-create.d.ts +3 -0
- package/dist/hooks/slice-create.js +59 -0
- package/dist/hooks/slice-create.js.map +1 -0
- package/dist/hooks/slice-delete.cjs +41 -0
- package/dist/hooks/slice-delete.cjs.map +1 -0
- package/dist/hooks/slice-delete.d.ts +3 -0
- package/dist/hooks/slice-delete.js +24 -0
- package/dist/hooks/slice-delete.js.map +1 -0
- package/dist/hooks/slice-read.cjs +62 -0
- package/dist/hooks/slice-read.cjs.map +1 -0
- package/dist/hooks/slice-read.d.ts +3 -0
- package/dist/hooks/slice-read.js +44 -0
- package/dist/hooks/slice-read.js.map +1 -0
- package/dist/hooks/slice-rename.cjs +51 -0
- package/dist/hooks/slice-rename.cjs.map +1 -0
- package/dist/hooks/slice-rename.d.ts +3 -0
- package/dist/hooks/slice-rename.js +34 -0
- package/dist/hooks/slice-rename.js.map +1 -0
- package/dist/hooks/slice-update.cjs +14 -0
- package/dist/hooks/slice-update.cjs.map +1 -0
- package/dist/hooks/slice-update.d.ts +3 -0
- package/dist/hooks/slice-update.js +14 -0
- package/dist/hooks/slice-update.js.map +1 -0
- package/dist/hooks/sliceLibrary-read.cjs +52 -0
- package/dist/hooks/sliceLibrary-read.cjs.map +1 -0
- package/dist/hooks/sliceLibrary-read.d.ts +3 -0
- package/dist/hooks/sliceLibrary-read.js +34 -0
- package/dist/hooks/sliceLibrary-read.js.map +1 -0
- package/dist/hooks/sliceSimulator-setup-read.cjs +150 -0
- package/dist/hooks/sliceSimulator-setup-read.cjs.map +1 -0
- package/dist/hooks/sliceSimulator-setup-read.d.ts +3 -0
- package/dist/hooks/sliceSimulator-setup-read.js +150 -0
- package/dist/hooks/sliceSimulator-setup-read.js.map +1 -0
- package/dist/hooks/snippet-read.cjs +101 -0
- package/dist/hooks/snippet-read.cjs.map +1 -0
- package/dist/hooks/snippet-read.d.ts +3 -0
- package/dist/hooks/snippet-read.js +101 -0
- package/dist/hooks/snippet-read.js.map +1 -0
- package/dist/index.cjs +4 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/buildCustomTypeAssetPath.cjs +29 -0
- package/dist/lib/buildCustomTypeAssetPath.cjs.map +1 -0
- package/dist/lib/buildCustomTypeAssetPath.d.ts +9 -0
- package/dist/lib/buildCustomTypeAssetPath.js +12 -0
- package/dist/lib/buildCustomTypeAssetPath.js.map +1 -0
- package/dist/lib/buildCustomTypeDirectoryPath.cjs +26 -0
- package/dist/lib/buildCustomTypeDirectoryPath.cjs.map +1 -0
- package/dist/lib/buildCustomTypeDirectoryPath.d.ts +8 -0
- package/dist/lib/buildCustomTypeDirectoryPath.js +9 -0
- package/dist/lib/buildCustomTypeDirectoryPath.js.map +1 -0
- package/dist/lib/buildCustomTypeLibraryDirectoryPath.cjs +7 -0
- package/dist/lib/buildCustomTypeLibraryDirectoryPath.cjs.map +1 -0
- package/dist/lib/buildCustomTypeLibraryDirectoryPath.d.ts +7 -0
- package/dist/lib/buildCustomTypeLibraryDirectoryPath.js +7 -0
- package/dist/lib/buildCustomTypeLibraryDirectoryPath.js.map +1 -0
- package/dist/lib/buildSliceAssetPath.cjs +34 -0
- package/dist/lib/buildSliceAssetPath.cjs.map +1 -0
- package/dist/lib/buildSliceAssetPath.d.ts +11 -0
- package/dist/lib/buildSliceAssetPath.js +17 -0
- package/dist/lib/buildSliceAssetPath.js.map +1 -0
- package/dist/lib/buildSliceDirectoryPath.cjs +30 -0
- package/dist/lib/buildSliceDirectoryPath.cjs.map +1 -0
- package/dist/lib/buildSliceDirectoryPath.d.ts +10 -0
- package/dist/lib/buildSliceDirectoryPath.js +13 -0
- package/dist/lib/buildSliceDirectoryPath.js.map +1 -0
- package/dist/lib/buildSliceLibraryDirectoryPath.cjs +7 -0
- package/dist/lib/buildSliceLibraryDirectoryPath.cjs.map +1 -0
- package/dist/lib/buildSliceLibraryDirectoryPath.d.ts +8 -0
- package/dist/lib/buildSliceLibraryDirectoryPath.js +7 -0
- package/dist/lib/buildSliceLibraryDirectoryPath.js.map +1 -0
- package/dist/lib/checkIsTypeScriptProject.cjs +9 -0
- package/dist/lib/checkIsTypeScriptProject.cjs.map +1 -0
- package/dist/lib/checkIsTypeScriptProject.d.ts +8 -0
- package/dist/lib/checkIsTypeScriptProject.js +9 -0
- package/dist/lib/checkIsTypeScriptProject.js.map +1 -0
- package/dist/lib/checkPathExists.cjs +30 -0
- package/dist/lib/checkPathExists.cjs.map +1 -0
- package/dist/lib/checkPathExists.d.ts +2 -0
- package/dist/lib/checkPathExists.js +13 -0
- package/dist/lib/checkPathExists.js.map +1 -0
- package/dist/lib/isSharedSliceModel.cjs +7 -0
- package/dist/lib/isSharedSliceModel.cjs.map +1 -0
- package/dist/lib/isSharedSliceModel.d.ts +335 -0
- package/dist/lib/isSharedSliceModel.js +7 -0
- package/dist/lib/isSharedSliceModel.js.map +1 -0
- package/dist/lib/pascalCase.cjs +8 -0
- package/dist/lib/pascalCase.cjs.map +1 -0
- package/dist/lib/pascalCase.d.ts +8 -0
- package/dist/lib/pascalCase.js +8 -0
- package/dist/lib/pascalCase.js.map +1 -0
- package/dist/lib/readJSONFile.cjs +26 -0
- package/dist/lib/readJSONFile.cjs.map +1 -0
- package/dist/lib/readJSONFile.d.ts +1 -0
- package/dist/lib/readJSONFile.js +9 -0
- package/dist/lib/readJSONFile.js.map +1 -0
- package/dist/lib/rejectIfNecessary.cjs +10 -0
- package/dist/lib/rejectIfNecessary.cjs.map +1 -0
- package/dist/lib/rejectIfNecessary.d.ts +1 -0
- package/dist/lib/rejectIfNecessary.js +10 -0
- package/dist/lib/rejectIfNecessary.js.map +1 -0
- package/dist/lib/updateSliceModelFile.cjs +33 -0
- package/dist/lib/updateSliceModelFile.cjs.map +1 -0
- package/dist/lib/updateSliceModelFile.d.ts +9 -0
- package/dist/lib/updateSliceModelFile.js +15 -0
- package/dist/lib/updateSliceModelFile.js.map +1 -0
- package/dist/lib/upsertGlobalContentTypes.cjs +55 -0
- package/dist/lib/upsertGlobalContentTypes.cjs.map +1 -0
- package/dist/lib/upsertGlobalContentTypes.d.ts +12 -0
- package/dist/lib/upsertGlobalContentTypes.js +37 -0
- package/dist/lib/upsertGlobalContentTypes.js.map +1 -0
- package/dist/lib/upsertSliceLibraryIndexFile.cjs +83 -0
- package/dist/lib/upsertSliceLibraryIndexFile.cjs.map +1 -0
- package/dist/lib/upsertSliceLibraryIndexFile.d.ts +7 -0
- package/dist/lib/upsertSliceLibraryIndexFile.js +65 -0
- package/dist/lib/upsertSliceLibraryIndexFile.js.map +1 -0
- package/dist/packages/adapter-nuxt/package.json.cjs +5 -0
- package/dist/packages/adapter-nuxt/package.json.cjs.map +1 -0
- package/dist/packages/adapter-nuxt/package.json.js +5 -0
- package/dist/packages/adapter-nuxt/package.json.js.map +1 -0
- package/dist/plugin.cjs +59 -0
- package/dist/plugin.cjs.map +1 -0
- package/dist/plugin.d.ts +2 -0
- package/dist/plugin.js +59 -0
- package/dist/plugin.js.map +1 -0
- package/dist/simulator/SliceSimulator.cjs +79 -0
- package/dist/simulator/SliceSimulator.cjs.map +1 -0
- package/dist/simulator/SliceSimulator.d.ts +34 -0
- package/dist/simulator/SliceSimulator.js +79 -0
- package/dist/simulator/SliceSimulator.js.map +1 -0
- package/dist/simulator/index.d.ts +2 -0
- package/dist/simulator.cjs +5 -0
- package/dist/simulator.cjs.map +1 -0
- package/dist/simulator.js +5 -0
- package/dist/simulator.js.map +1 -0
- package/dist/types.d.ts +5 -0
- package/package.json +107 -0
- package/src/constants.ts +5 -0
- package/src/hooks/customType-asset-delete.ts +18 -0
- package/src/hooks/customType-asset-read.ts +22 -0
- package/src/hooks/customType-asset-update.ts +20 -0
- package/src/hooks/customType-create.ts +45 -0
- package/src/hooks/customType-delete.ts +21 -0
- package/src/hooks/customType-read.ts +24 -0
- package/src/hooks/customType-rename.ts +3 -0
- package/src/hooks/customType-update.ts +3 -0
- package/src/hooks/customTypeLibrary-read.ts +53 -0
- package/src/hooks/project-init.ts +163 -0
- package/src/hooks/slice-asset-delete.ts +21 -0
- package/src/hooks/slice-asset-read.ts +25 -0
- package/src/hooks/slice-asset-update.ts +23 -0
- package/src/hooks/slice-create.ts +115 -0
- package/src/hooks/slice-delete.ts +41 -0
- package/src/hooks/slice-read.ts +69 -0
- package/src/hooks/slice-rename.ts +46 -0
- package/src/hooks/slice-update.ts +19 -0
- package/src/hooks/sliceLibrary-read.ts +48 -0
- package/src/hooks/sliceSimulator-setup-read.ts +209 -0
- package/src/hooks/snippet-read.ts +145 -0
- package/src/index.ts +4 -0
- package/src/lib/buildCustomTypeAssetPath.ts +24 -0
- package/src/lib/buildCustomTypeDirectoryPath.ts +20 -0
- package/src/lib/buildCustomTypeLibraryDirectoryPath.ts +13 -0
- package/src/lib/buildSliceAssetPath.ts +32 -0
- package/src/lib/buildSliceDirectoryPath.ts +26 -0
- package/src/lib/buildSliceLibraryDirectoryPath.ts +14 -0
- package/src/lib/checkIsTypeScriptProject.ts +17 -0
- package/src/lib/checkPathExists.ts +12 -0
- package/src/lib/isSharedSliceModel.ts +14 -0
- package/src/lib/pascalCase.ts +12 -0
- package/src/lib/readJSONFile.ts +7 -0
- package/src/lib/rejectIfNecessary.ts +16 -0
- package/src/lib/updateSliceModelFile.ts +33 -0
- package/src/lib/upsertGlobalContentTypes.ts +62 -0
- package/src/lib/upsertSliceLibraryIndexFile.ts +90 -0
- package/src/plugin.ts +63 -0
- package/src/simulator/SliceSimulator.ts +157 -0
- package/src/simulator/index.ts +2 -0
- package/src/types.ts +5 -0
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
export declare const isSharedSliceModel: (input: any) => input is {
|
|
2
|
+
id: string;
|
|
3
|
+
type: "SharedSlice";
|
|
4
|
+
name: string;
|
|
5
|
+
variations: readonly ({
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
description: string;
|
|
9
|
+
imageUrl: string;
|
|
10
|
+
docURL: string;
|
|
11
|
+
version: string;
|
|
12
|
+
} & {
|
|
13
|
+
display?: string | undefined;
|
|
14
|
+
primary?: {
|
|
15
|
+
[x: string]: ({
|
|
16
|
+
type: "Color";
|
|
17
|
+
} & {
|
|
18
|
+
fieldset?: string | null | undefined;
|
|
19
|
+
config?: {
|
|
20
|
+
label?: string | null | undefined;
|
|
21
|
+
placeholder?: string | undefined;
|
|
22
|
+
} | undefined;
|
|
23
|
+
}) | ({
|
|
24
|
+
type: "Boolean";
|
|
25
|
+
} & {
|
|
26
|
+
config?: {
|
|
27
|
+
label?: string | null | undefined;
|
|
28
|
+
default_value?: boolean | undefined;
|
|
29
|
+
placeholder_true?: string | undefined;
|
|
30
|
+
placeholder_false?: string | undefined;
|
|
31
|
+
} | undefined;
|
|
32
|
+
}) | ({
|
|
33
|
+
type: "Embed";
|
|
34
|
+
} & {
|
|
35
|
+
fieldset?: string | null | undefined;
|
|
36
|
+
config?: {
|
|
37
|
+
label?: string | null | undefined;
|
|
38
|
+
placeholder?: string | undefined;
|
|
39
|
+
useAsTitle?: boolean | undefined;
|
|
40
|
+
} | undefined;
|
|
41
|
+
}) | ({
|
|
42
|
+
type: "GeoPoint";
|
|
43
|
+
} & {
|
|
44
|
+
fieldset?: string | null | undefined;
|
|
45
|
+
config?: {
|
|
46
|
+
label?: string | null | undefined;
|
|
47
|
+
} | undefined;
|
|
48
|
+
}) | ({
|
|
49
|
+
type: "Date";
|
|
50
|
+
} & {
|
|
51
|
+
fieldset?: string | null | undefined;
|
|
52
|
+
config?: {
|
|
53
|
+
label?: string | null | undefined;
|
|
54
|
+
placeholder?: string | undefined;
|
|
55
|
+
default?: string | undefined;
|
|
56
|
+
} | undefined;
|
|
57
|
+
}) | ({
|
|
58
|
+
type: "Number";
|
|
59
|
+
} & {
|
|
60
|
+
fieldset?: string | null | undefined;
|
|
61
|
+
config?: {
|
|
62
|
+
label?: string | null | undefined;
|
|
63
|
+
placeholder?: string | undefined;
|
|
64
|
+
min?: number | undefined;
|
|
65
|
+
max?: number | undefined;
|
|
66
|
+
step?: number | undefined;
|
|
67
|
+
} | undefined;
|
|
68
|
+
}) | ({
|
|
69
|
+
type: "Range";
|
|
70
|
+
} & {
|
|
71
|
+
fieldset?: string | null | undefined;
|
|
72
|
+
config?: {
|
|
73
|
+
label?: string | null | undefined;
|
|
74
|
+
placeholder?: string | undefined;
|
|
75
|
+
min?: number | undefined;
|
|
76
|
+
max?: number | undefined;
|
|
77
|
+
step?: number | undefined;
|
|
78
|
+
} | undefined;
|
|
79
|
+
}) | ({
|
|
80
|
+
type: "StructuredText";
|
|
81
|
+
} & {
|
|
82
|
+
fieldset?: string | null | undefined;
|
|
83
|
+
config?: {
|
|
84
|
+
label?: string | null | undefined;
|
|
85
|
+
placeholder?: string | undefined;
|
|
86
|
+
useAsTitle?: boolean | undefined;
|
|
87
|
+
single?: string | undefined;
|
|
88
|
+
multi?: string | undefined;
|
|
89
|
+
imageConstraint?: {
|
|
90
|
+
width?: number | null | undefined;
|
|
91
|
+
height?: number | null | undefined;
|
|
92
|
+
} | undefined;
|
|
93
|
+
labels?: readonly string[] | undefined;
|
|
94
|
+
allowTargetBlank?: boolean | undefined;
|
|
95
|
+
} | undefined;
|
|
96
|
+
}) | ({
|
|
97
|
+
type: "Select";
|
|
98
|
+
} & {
|
|
99
|
+
fieldset?: string | null | undefined;
|
|
100
|
+
config?: {
|
|
101
|
+
label?: string | null | undefined;
|
|
102
|
+
placeholder?: string | undefined;
|
|
103
|
+
default_value?: string | undefined;
|
|
104
|
+
options?: readonly string[] | undefined;
|
|
105
|
+
} | undefined;
|
|
106
|
+
}) | ({
|
|
107
|
+
type: "Separator";
|
|
108
|
+
} & {
|
|
109
|
+
config?: {
|
|
110
|
+
label?: string | null | undefined;
|
|
111
|
+
} | undefined;
|
|
112
|
+
}) | ({
|
|
113
|
+
type: "Text";
|
|
114
|
+
} & {
|
|
115
|
+
fieldset?: string | null | undefined;
|
|
116
|
+
config?: {
|
|
117
|
+
label?: string | null | undefined;
|
|
118
|
+
useAsTitle?: boolean | undefined;
|
|
119
|
+
placeholder?: string | undefined;
|
|
120
|
+
} | undefined;
|
|
121
|
+
}) | ({
|
|
122
|
+
type: "Timestamp";
|
|
123
|
+
} & {
|
|
124
|
+
fieldset?: string | null | undefined;
|
|
125
|
+
config?: {
|
|
126
|
+
label?: string | null | undefined;
|
|
127
|
+
placeholder?: string | undefined;
|
|
128
|
+
default?: string | undefined;
|
|
129
|
+
} | undefined;
|
|
130
|
+
}) | ({
|
|
131
|
+
type: "Link";
|
|
132
|
+
} & {
|
|
133
|
+
fieldset?: string | null | undefined;
|
|
134
|
+
config?: {
|
|
135
|
+
label?: string | null | undefined;
|
|
136
|
+
useAsTitle?: boolean | undefined;
|
|
137
|
+
placeholder?: string | undefined;
|
|
138
|
+
select?: "document" | "media" | "web" | null | undefined;
|
|
139
|
+
customtypes?: readonly string[] | undefined;
|
|
140
|
+
masks?: readonly string[] | undefined;
|
|
141
|
+
tags?: readonly string[] | undefined;
|
|
142
|
+
allowTargetBlank?: boolean | undefined;
|
|
143
|
+
} | undefined;
|
|
144
|
+
}) | ({
|
|
145
|
+
type: "Image";
|
|
146
|
+
} & {
|
|
147
|
+
fieldset?: string | null | undefined;
|
|
148
|
+
config?: {
|
|
149
|
+
label?: string | null | undefined;
|
|
150
|
+
placeholder?: string | undefined;
|
|
151
|
+
constraint?: {
|
|
152
|
+
width?: number | null | undefined;
|
|
153
|
+
height?: number | null | undefined;
|
|
154
|
+
} | undefined;
|
|
155
|
+
thumbnails?: readonly ({
|
|
156
|
+
name: string;
|
|
157
|
+
} & {
|
|
158
|
+
width?: number | null | undefined;
|
|
159
|
+
height?: number | null | undefined;
|
|
160
|
+
})[] | undefined;
|
|
161
|
+
} | undefined;
|
|
162
|
+
}) | ({
|
|
163
|
+
type: "IntegrationFields";
|
|
164
|
+
} & {
|
|
165
|
+
fieldset?: string | null | undefined;
|
|
166
|
+
config?: {
|
|
167
|
+
label?: string | null | undefined;
|
|
168
|
+
placeholder?: string | undefined;
|
|
169
|
+
catalog?: string | undefined;
|
|
170
|
+
} | undefined;
|
|
171
|
+
});
|
|
172
|
+
} | undefined;
|
|
173
|
+
items?: {
|
|
174
|
+
[x: string]: ({
|
|
175
|
+
type: "Color";
|
|
176
|
+
} & {
|
|
177
|
+
fieldset?: string | null | undefined;
|
|
178
|
+
config?: {
|
|
179
|
+
label?: string | null | undefined;
|
|
180
|
+
placeholder?: string | undefined;
|
|
181
|
+
} | undefined;
|
|
182
|
+
}) | ({
|
|
183
|
+
type: "Boolean";
|
|
184
|
+
} & {
|
|
185
|
+
config?: {
|
|
186
|
+
label?: string | null | undefined;
|
|
187
|
+
default_value?: boolean | undefined;
|
|
188
|
+
placeholder_true?: string | undefined;
|
|
189
|
+
placeholder_false?: string | undefined;
|
|
190
|
+
} | undefined;
|
|
191
|
+
}) | ({
|
|
192
|
+
type: "Embed";
|
|
193
|
+
} & {
|
|
194
|
+
fieldset?: string | null | undefined;
|
|
195
|
+
config?: {
|
|
196
|
+
label?: string | null | undefined;
|
|
197
|
+
placeholder?: string | undefined;
|
|
198
|
+
useAsTitle?: boolean | undefined;
|
|
199
|
+
} | undefined;
|
|
200
|
+
}) | ({
|
|
201
|
+
type: "GeoPoint";
|
|
202
|
+
} & {
|
|
203
|
+
fieldset?: string | null | undefined;
|
|
204
|
+
config?: {
|
|
205
|
+
label?: string | null | undefined;
|
|
206
|
+
} | undefined;
|
|
207
|
+
}) | ({
|
|
208
|
+
type: "Date";
|
|
209
|
+
} & {
|
|
210
|
+
fieldset?: string | null | undefined;
|
|
211
|
+
config?: {
|
|
212
|
+
label?: string | null | undefined;
|
|
213
|
+
placeholder?: string | undefined;
|
|
214
|
+
default?: string | undefined;
|
|
215
|
+
} | undefined;
|
|
216
|
+
}) | ({
|
|
217
|
+
type: "Number";
|
|
218
|
+
} & {
|
|
219
|
+
fieldset?: string | null | undefined;
|
|
220
|
+
config?: {
|
|
221
|
+
label?: string | null | undefined;
|
|
222
|
+
placeholder?: string | undefined;
|
|
223
|
+
min?: number | undefined;
|
|
224
|
+
max?: number | undefined;
|
|
225
|
+
step?: number | undefined;
|
|
226
|
+
} | undefined;
|
|
227
|
+
}) | ({
|
|
228
|
+
type: "Range";
|
|
229
|
+
} & {
|
|
230
|
+
fieldset?: string | null | undefined;
|
|
231
|
+
config?: {
|
|
232
|
+
label?: string | null | undefined;
|
|
233
|
+
placeholder?: string | undefined;
|
|
234
|
+
min?: number | undefined;
|
|
235
|
+
max?: number | undefined;
|
|
236
|
+
step?: number | undefined;
|
|
237
|
+
} | undefined;
|
|
238
|
+
}) | ({
|
|
239
|
+
type: "StructuredText";
|
|
240
|
+
} & {
|
|
241
|
+
fieldset?: string | null | undefined;
|
|
242
|
+
config?: {
|
|
243
|
+
label?: string | null | undefined;
|
|
244
|
+
placeholder?: string | undefined;
|
|
245
|
+
useAsTitle?: boolean | undefined;
|
|
246
|
+
single?: string | undefined;
|
|
247
|
+
multi?: string | undefined;
|
|
248
|
+
imageConstraint?: {
|
|
249
|
+
width?: number | null | undefined;
|
|
250
|
+
height?: number | null | undefined;
|
|
251
|
+
} | undefined;
|
|
252
|
+
labels?: readonly string[] | undefined;
|
|
253
|
+
allowTargetBlank?: boolean | undefined;
|
|
254
|
+
} | undefined;
|
|
255
|
+
}) | ({
|
|
256
|
+
type: "Select";
|
|
257
|
+
} & {
|
|
258
|
+
fieldset?: string | null | undefined;
|
|
259
|
+
config?: {
|
|
260
|
+
label?: string | null | undefined;
|
|
261
|
+
placeholder?: string | undefined;
|
|
262
|
+
default_value?: string | undefined;
|
|
263
|
+
options?: readonly string[] | undefined;
|
|
264
|
+
} | undefined;
|
|
265
|
+
}) | ({
|
|
266
|
+
type: "Separator";
|
|
267
|
+
} & {
|
|
268
|
+
config?: {
|
|
269
|
+
label?: string | null | undefined;
|
|
270
|
+
} | undefined;
|
|
271
|
+
}) | ({
|
|
272
|
+
type: "Text";
|
|
273
|
+
} & {
|
|
274
|
+
fieldset?: string | null | undefined;
|
|
275
|
+
config?: {
|
|
276
|
+
label?: string | null | undefined;
|
|
277
|
+
useAsTitle?: boolean | undefined;
|
|
278
|
+
placeholder?: string | undefined;
|
|
279
|
+
} | undefined;
|
|
280
|
+
}) | ({
|
|
281
|
+
type: "Timestamp";
|
|
282
|
+
} & {
|
|
283
|
+
fieldset?: string | null | undefined;
|
|
284
|
+
config?: {
|
|
285
|
+
label?: string | null | undefined;
|
|
286
|
+
placeholder?: string | undefined;
|
|
287
|
+
default?: string | undefined;
|
|
288
|
+
} | undefined;
|
|
289
|
+
}) | ({
|
|
290
|
+
type: "Link";
|
|
291
|
+
} & {
|
|
292
|
+
fieldset?: string | null | undefined;
|
|
293
|
+
config?: {
|
|
294
|
+
label?: string | null | undefined;
|
|
295
|
+
useAsTitle?: boolean | undefined;
|
|
296
|
+
placeholder?: string | undefined;
|
|
297
|
+
select?: "document" | "media" | "web" | null | undefined;
|
|
298
|
+
customtypes?: readonly string[] | undefined;
|
|
299
|
+
masks?: readonly string[] | undefined;
|
|
300
|
+
tags?: readonly string[] | undefined;
|
|
301
|
+
allowTargetBlank?: boolean | undefined;
|
|
302
|
+
} | undefined;
|
|
303
|
+
}) | ({
|
|
304
|
+
type: "Image";
|
|
305
|
+
} & {
|
|
306
|
+
fieldset?: string | null | undefined;
|
|
307
|
+
config?: {
|
|
308
|
+
label?: string | null | undefined;
|
|
309
|
+
placeholder?: string | undefined;
|
|
310
|
+
constraint?: {
|
|
311
|
+
width?: number | null | undefined;
|
|
312
|
+
height?: number | null | undefined;
|
|
313
|
+
} | undefined;
|
|
314
|
+
thumbnails?: readonly ({
|
|
315
|
+
name: string;
|
|
316
|
+
} & {
|
|
317
|
+
width?: number | null | undefined;
|
|
318
|
+
height?: number | null | undefined;
|
|
319
|
+
})[] | undefined;
|
|
320
|
+
} | undefined;
|
|
321
|
+
}) | ({
|
|
322
|
+
type: "IntegrationFields";
|
|
323
|
+
} & {
|
|
324
|
+
fieldset?: string | null | undefined;
|
|
325
|
+
config?: {
|
|
326
|
+
label?: string | null | undefined;
|
|
327
|
+
placeholder?: string | undefined;
|
|
328
|
+
catalog?: string | undefined;
|
|
329
|
+
} | undefined;
|
|
330
|
+
});
|
|
331
|
+
} | undefined;
|
|
332
|
+
})[];
|
|
333
|
+
} & {
|
|
334
|
+
description?: string | undefined;
|
|
335
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isSharedSliceModel.js","sources":["../../../src/lib/isSharedSliceModel.ts"],"sourcesContent":["import type { SharedSlice } from \"@prismicio/types-internal/lib/customtypes\";\n\nexport const isSharedSliceModel = (\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n\tinput: any,\n): input is SharedSlice => {\n\treturn (\n\t\ttypeof input === \"object\" &&\n\t\tinput !== null &&\n\t\t\"type\" in input &&\n\t\tinput.type === \"SharedSlice\" &&\n\t\ttypeof input.id === \"string\"\n\t);\n};\n"],"names":[],"mappings":"AAEa,MAAA,qBAAqB,CAEjC,UACyB;AACzB,SACC,OAAO,UAAU,YACjB,UAAU,QACV,UAAU,SACV,MAAM,SAAS,iBACf,OAAO,MAAM,OAAO;AAEtB;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const pascalCase$1 = require("pascal-case");
|
|
4
|
+
const pascalCase = (...input) => {
|
|
5
|
+
return pascalCase$1.pascalCase(input.filter(Boolean).join(" "));
|
|
6
|
+
};
|
|
7
|
+
exports.pascalCase = pascalCase;
|
|
8
|
+
//# sourceMappingURL=pascalCase.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pascalCase.cjs","sources":["../../../src/lib/pascalCase.ts"],"sourcesContent":["import { pascalCase as basePascalCase } from \"pascal-case\";\n\n/**\n * Converts a string to a Pascal cased string.\n *\n * @param input - String to convert into a Pascal cased string.\n *\n * @returns Pascal cased string version of `input`.\n */\nexport const pascalCase = (...input: (string | undefined)[]): string => {\n\treturn basePascalCase(input.filter(Boolean).join(\" \"));\n};\n"],"names":["basePascalCase"],"mappings":";;;AASa,MAAA,aAAa,IAAI,UAAyC;AACtE,SAAOA,aAAAA,WAAe,MAAM,OAAO,OAAO,EAAE,KAAK,GAAG,CAAC;AACtD;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pascalCase.js","sources":["../../../src/lib/pascalCase.ts"],"sourcesContent":["import { pascalCase as basePascalCase } from \"pascal-case\";\n\n/**\n * Converts a string to a Pascal cased string.\n *\n * @param input - String to convert into a Pascal cased string.\n *\n * @returns Pascal cased string version of `input`.\n */\nexport const pascalCase = (...input: (string | undefined)[]): string => {\n\treturn basePascalCase(input.filter(Boolean).join(\" \"));\n};\n"],"names":["basePascalCase"],"mappings":";AASa,MAAA,aAAa,IAAI,UAAyC;AACtE,SAAOA,aAAe,MAAM,OAAO,OAAO,EAAE,KAAK,GAAG,CAAC;AACtD;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const fs = require("node:fs/promises");
|
|
4
|
+
function _interopNamespaceDefault(e) {
|
|
5
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
6
|
+
if (e) {
|
|
7
|
+
for (const k in e) {
|
|
8
|
+
if (k !== "default") {
|
|
9
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
10
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: () => e[k]
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
n.default = e;
|
|
18
|
+
return Object.freeze(n);
|
|
19
|
+
}
|
|
20
|
+
const fs__namespace = /* @__PURE__ */ _interopNamespaceDefault(fs);
|
|
21
|
+
const readJSONFile = async (path) => {
|
|
22
|
+
const contents = await fs__namespace.readFile(path, "utf8");
|
|
23
|
+
return JSON.parse(contents);
|
|
24
|
+
};
|
|
25
|
+
exports.readJSONFile = readJSONFile;
|
|
26
|
+
//# sourceMappingURL=readJSONFile.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readJSONFile.cjs","sources":["../../../src/lib/readJSONFile.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\n\nexport const readJSONFile = async <T = unknown>(path: string): Promise<T> => {\n\tconst contents = await fs.readFile(path, \"utf8\");\n\n\treturn JSON.parse(contents);\n};\n"],"names":["fs"],"mappings":";;;;;;;;;;;;;;;;;;;;AAEa,MAAA,eAAe,OAAoB,SAA4B;AAC3E,QAAM,WAAW,MAAMA,cAAG,SAAS,MAAM,MAAM;AAExC,SAAA,KAAK,MAAM,QAAQ;AAC3B;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const readJSONFile: <T = unknown>(path: string) => Promise<T>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readJSONFile.js","sources":["../../../src/lib/readJSONFile.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\n\nexport const readJSONFile = async <T = unknown>(path: string): Promise<T> => {\n\tconst contents = await fs.readFile(path, \"utf8\");\n\n\treturn JSON.parse(contents);\n};\n"],"names":[],"mappings":";AAEa,MAAA,eAAe,OAAoB,SAA4B;AAC3E,QAAM,WAAW,MAAM,GAAG,SAAS,MAAM,MAAM;AAExC,SAAA,KAAK,MAAM,QAAQ;AAC3B;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const rejectIfNecessary = (promiseSettledResults) => {
|
|
4
|
+
const rejectedReasons = promiseSettledResults.filter((result) => result.status === "rejected").map((result) => result.reason);
|
|
5
|
+
if (rejectedReasons.length > 0) {
|
|
6
|
+
throw rejectedReasons[0];
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
exports.rejectIfNecessary = rejectIfNecessary;
|
|
10
|
+
//# sourceMappingURL=rejectIfNecessary.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rejectIfNecessary.cjs","sources":["../../../src/lib/rejectIfNecessary.ts"],"sourcesContent":["export const rejectIfNecessary = <\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tTPromiseSettledResults extends readonly PromiseSettledResult<any>[],\n>(\n\tpromiseSettledResults: TPromiseSettledResults,\n): void => {\n\tconst rejectedReasons = promiseSettledResults\n\t\t.filter(\n\t\t\t(result): result is PromiseRejectedResult => result.status === \"rejected\",\n\t\t)\n\t\t.map((result) => result.reason);\n\n\tif (rejectedReasons.length > 0) {\n\t\tthrow rejectedReasons[0];\n\t}\n};\n"],"names":[],"mappings":";;AAAa,MAAA,oBAAoB,CAIhC,0BACS;AACT,QAAM,kBAAkB,sBACtB,OACA,CAAC,WAA4C,OAAO,WAAW,UAAU,EAEzE,IAAI,CAAC,WAAW,OAAO,MAAM;AAE3B,MAAA,gBAAgB,SAAS,GAAG;AAC/B,UAAM,gBAAgB,CAAC;AAAA,EACvB;AACF;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const rejectIfNecessary: <TPromiseSettledResults extends readonly PromiseSettledResult<any>[]>(promiseSettledResults: TPromiseSettledResults) => void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const rejectIfNecessary = (promiseSettledResults) => {
|
|
2
|
+
const rejectedReasons = promiseSettledResults.filter((result) => result.status === "rejected").map((result) => result.reason);
|
|
3
|
+
if (rejectedReasons.length > 0) {
|
|
4
|
+
throw rejectedReasons[0];
|
|
5
|
+
}
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
rejectIfNecessary
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=rejectIfNecessary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rejectIfNecessary.js","sources":["../../../src/lib/rejectIfNecessary.ts"],"sourcesContent":["export const rejectIfNecessary = <\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tTPromiseSettledResults extends readonly PromiseSettledResult<any>[],\n>(\n\tpromiseSettledResults: TPromiseSettledResults,\n): void => {\n\tconst rejectedReasons = promiseSettledResults\n\t\t.filter(\n\t\t\t(result): result is PromiseRejectedResult => result.status === \"rejected\",\n\t\t)\n\t\t.map((result) => result.reason);\n\n\tif (rejectedReasons.length > 0) {\n\t\tthrow rejectedReasons[0];\n\t}\n};\n"],"names":[],"mappings":"AAAa,MAAA,oBAAoB,CAIhC,0BACS;AACT,QAAM,kBAAkB,sBACtB,OACA,CAAC,WAA4C,OAAO,WAAW,UAAU,EAEzE,IAAI,CAAC,WAAW,OAAO,MAAM;AAE3B,MAAA,gBAAgB,SAAS,GAAG;AAC/B,UAAM,gBAAgB,CAAC;AAAA,EACvB;AACF;"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const fs = require("node:fs/promises");
|
|
4
|
+
const path = require("node:path");
|
|
5
|
+
const buildSliceDirectoryPath = require("./buildSliceDirectoryPath.cjs");
|
|
6
|
+
function _interopNamespaceDefault(e) {
|
|
7
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
8
|
+
if (e) {
|
|
9
|
+
for (const k in e) {
|
|
10
|
+
if (k !== "default") {
|
|
11
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
12
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: () => e[k]
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
n.default = e;
|
|
20
|
+
return Object.freeze(n);
|
|
21
|
+
}
|
|
22
|
+
const fs__namespace = /* @__PURE__ */ _interopNamespaceDefault(fs);
|
|
23
|
+
const path__namespace = /* @__PURE__ */ _interopNamespaceDefault(path);
|
|
24
|
+
const updateSliceModelFile = async ({ libraryID, model, helpers, options }) => {
|
|
25
|
+
const filePath = path__namespace.join(buildSliceDirectoryPath.buildSliceDirectoryPath({ libraryID, model, helpers }), "model.json");
|
|
26
|
+
let contents = JSON.stringify(model);
|
|
27
|
+
if (options.format) {
|
|
28
|
+
contents = await helpers.format(contents, filePath);
|
|
29
|
+
}
|
|
30
|
+
await fs__namespace.writeFile(filePath, contents);
|
|
31
|
+
};
|
|
32
|
+
exports.updateSliceModelFile = updateSliceModelFile;
|
|
33
|
+
//# sourceMappingURL=updateSliceModelFile.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updateSliceModelFile.cjs","sources":["../../../src/lib/updateSliceModelFile.ts"],"sourcesContent":["import type { SharedSlice } from \"@prismicio/types-internal/lib/customtypes\";\nimport { SliceMachineContext } from \"@slicemachine/plugin-kit\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\n\nimport type { PluginOptions } from \"../types\";\n\nimport { buildSliceDirectoryPath } from \"./buildSliceDirectoryPath\";\n\ntype UpdateSliceModelFileArgs = {\n\tlibraryID: string;\n\tmodel: SharedSlice;\n} & SliceMachineContext<PluginOptions>;\n\nexport const updateSliceModelFile = async ({\n\tlibraryID,\n\tmodel,\n\thelpers,\n\toptions,\n}: UpdateSliceModelFileArgs): Promise<void> => {\n\tconst filePath = path.join(\n\t\tbuildSliceDirectoryPath({ libraryID, model, helpers }),\n\t\t\"model.json\",\n\t);\n\n\tlet contents = JSON.stringify(model);\n\n\tif (options.format) {\n\t\tcontents = await helpers.format(contents, filePath);\n\t}\n\n\tawait fs.writeFile(filePath, contents);\n};\n"],"names":["path","buildSliceDirectoryPath","fs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAcO,MAAM,uBAAuB,OAAO,EAC1C,WACA,OACA,SACA,cAC6C;AACvC,QAAA,WAAWA,gBAAK,KACrBC,gDAAwB,EAAE,WAAW,OAAO,QAAA,CAAS,GACrD,YAAY;AAGT,MAAA,WAAW,KAAK,UAAU,KAAK;AAEnC,MAAI,QAAQ,QAAQ;AACnB,eAAW,MAAM,QAAQ,OAAO,UAAU,QAAQ;AAAA,EAClD;AAEK,QAAAC,cAAG,UAAU,UAAU,QAAQ;AACtC;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SharedSlice } from "@prismicio/types-internal/lib/customtypes";
|
|
2
|
+
import { SliceMachineContext } from "@slicemachine/plugin-kit";
|
|
3
|
+
import type { PluginOptions } from "../types";
|
|
4
|
+
type UpdateSliceModelFileArgs = {
|
|
5
|
+
libraryID: string;
|
|
6
|
+
model: SharedSlice;
|
|
7
|
+
} & SliceMachineContext<PluginOptions>;
|
|
8
|
+
export declare const updateSliceModelFile: ({ libraryID, model, helpers, options, }: UpdateSliceModelFileArgs) => Promise<void>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as fs from "node:fs/promises";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
import { buildSliceDirectoryPath } from "./buildSliceDirectoryPath.js";
|
|
4
|
+
const updateSliceModelFile = async ({ libraryID, model, helpers, options }) => {
|
|
5
|
+
const filePath = path.join(buildSliceDirectoryPath({ libraryID, model, helpers }), "model.json");
|
|
6
|
+
let contents = JSON.stringify(model);
|
|
7
|
+
if (options.format) {
|
|
8
|
+
contents = await helpers.format(contents, filePath);
|
|
9
|
+
}
|
|
10
|
+
await fs.writeFile(filePath, contents);
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
updateSliceModelFile
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=updateSliceModelFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updateSliceModelFile.js","sources":["../../../src/lib/updateSliceModelFile.ts"],"sourcesContent":["import type { SharedSlice } from \"@prismicio/types-internal/lib/customtypes\";\nimport { SliceMachineContext } from \"@slicemachine/plugin-kit\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\n\nimport type { PluginOptions } from \"../types\";\n\nimport { buildSliceDirectoryPath } from \"./buildSliceDirectoryPath\";\n\ntype UpdateSliceModelFileArgs = {\n\tlibraryID: string;\n\tmodel: SharedSlice;\n} & SliceMachineContext<PluginOptions>;\n\nexport const updateSliceModelFile = async ({\n\tlibraryID,\n\tmodel,\n\thelpers,\n\toptions,\n}: UpdateSliceModelFileArgs): Promise<void> => {\n\tconst filePath = path.join(\n\t\tbuildSliceDirectoryPath({ libraryID, model, helpers }),\n\t\t\"model.json\",\n\t);\n\n\tlet contents = JSON.stringify(model);\n\n\tif (options.format) {\n\t\tcontents = await helpers.format(contents, filePath);\n\t}\n\n\tawait fs.writeFile(filePath, contents);\n};\n"],"names":[],"mappings":";;;AAcO,MAAM,uBAAuB,OAAO,EAC1C,WACA,OACA,SACA,cAC6C;AACvC,QAAA,WAAW,KAAK,KACrB,wBAAwB,EAAE,WAAW,OAAO,QAAA,CAAS,GACrD,YAAY;AAGT,MAAA,WAAW,KAAK,UAAU,KAAK;AAEnC,MAAI,QAAQ,QAAQ;AACnB,eAAW,MAAM,QAAQ,OAAO,UAAU,QAAQ;AAAA,EAClD;AAEK,QAAA,GAAG,UAAU,UAAU,QAAQ;AACtC;"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const prismicTsCodegen = require("prismic-ts-codegen");
|
|
4
|
+
const fs = require("node:fs/promises");
|
|
5
|
+
const path = require("node:path");
|
|
6
|
+
const constants = require("../constants.cjs");
|
|
7
|
+
function _interopNamespaceDefault(e) {
|
|
8
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
9
|
+
if (e) {
|
|
10
|
+
for (const k in e) {
|
|
11
|
+
if (k !== "default") {
|
|
12
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
13
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: () => e[k]
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
n.default = e;
|
|
21
|
+
return Object.freeze(n);
|
|
22
|
+
}
|
|
23
|
+
const fs__namespace = /* @__PURE__ */ _interopNamespaceDefault(fs);
|
|
24
|
+
const path__namespace = /* @__PURE__ */ _interopNamespaceDefault(path);
|
|
25
|
+
const upsertGlobalContentTypes = async ({ actions, helpers, options }) => {
|
|
26
|
+
const filePath = helpers.joinPathFromRoot("prismicio.d.ts");
|
|
27
|
+
const [customTypeModelDescriptors, sharedSliceModelDescriptors] = await Promise.all([
|
|
28
|
+
actions.readAllCustomTypeModels(),
|
|
29
|
+
actions.readAllSliceModels()
|
|
30
|
+
]);
|
|
31
|
+
const customTypeModels = customTypeModelDescriptors.map((customTypeModelDescriptors2) => {
|
|
32
|
+
return customTypeModelDescriptors2.model;
|
|
33
|
+
});
|
|
34
|
+
const sharedSliceModels = sharedSliceModelDescriptors.map((sharedSliceModelDescriptors2) => {
|
|
35
|
+
return sharedSliceModelDescriptors2.model;
|
|
36
|
+
});
|
|
37
|
+
let contents = prismicTsCodegen.generateTypes({
|
|
38
|
+
customTypeModels,
|
|
39
|
+
sharedSliceModels,
|
|
40
|
+
clientIntegration: {
|
|
41
|
+
includeCreateClientInterface: true,
|
|
42
|
+
includeContentNamespace: true
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
contents = `${constants.NON_EDITABLE_FILE_BANNER}
|
|
46
|
+
|
|
47
|
+
${contents}`;
|
|
48
|
+
if (options.format) {
|
|
49
|
+
contents = await helpers.format(contents, filePath);
|
|
50
|
+
}
|
|
51
|
+
await fs__namespace.mkdir(path__namespace.dirname(filePath), { recursive: true });
|
|
52
|
+
await fs__namespace.writeFile(filePath, contents);
|
|
53
|
+
};
|
|
54
|
+
exports.upsertGlobalContentTypes = upsertGlobalContentTypes;
|
|
55
|
+
//# sourceMappingURL=upsertGlobalContentTypes.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upsertGlobalContentTypes.cjs","sources":["../../../src/lib/upsertGlobalContentTypes.ts"],"sourcesContent":["import type { SliceMachineContext } from \"@slicemachine/plugin-kit\";\nimport { generateTypes } from \"prismic-ts-codegen\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\n\nimport type { PluginOptions } from \"../types\";\nimport { NON_EDITABLE_FILE_BANNER } from \"../constants\";\n\n/**\n * Arguments for `upsertGlobalContentTypes()`.\n */\ntype UpsertGlobalTypesArgs = Pick<\n\tSliceMachineContext<PluginOptions>,\n\t\"actions\" | \"helpers\" | \"options\"\n>;\n\n/**\n * Creates a globally accessible TypeScript file containing types representing\n * the Prismic repository's content.\n */\nexport const upsertGlobalContentTypes = async ({\n\tactions,\n\thelpers,\n\toptions,\n}: UpsertGlobalTypesArgs): Promise<void> => {\n\tconst filePath = helpers.joinPathFromRoot(\"prismicio.d.ts\");\n\n\tconst [customTypeModelDescriptors, sharedSliceModelDescriptors] =\n\t\tawait Promise.all([\n\t\t\tactions.readAllCustomTypeModels(),\n\t\t\tactions.readAllSliceModels(),\n\t\t]);\n\n\tconst customTypeModels = customTypeModelDescriptors.map(\n\t\t(customTypeModelDescriptors) => {\n\t\t\treturn customTypeModelDescriptors.model;\n\t\t},\n\t);\n\tconst sharedSliceModels = sharedSliceModelDescriptors.map(\n\t\t(sharedSliceModelDescriptors) => {\n\t\t\treturn sharedSliceModelDescriptors.model;\n\t\t},\n\t);\n\n\tlet contents = generateTypes({\n\t\tcustomTypeModels,\n\t\tsharedSliceModels,\n\t\tclientIntegration: {\n\t\t\tincludeCreateClientInterface: true,\n\t\t\tincludeContentNamespace: true,\n\t\t},\n\t});\n\n\tcontents = `${NON_EDITABLE_FILE_BANNER}\\n\\n${contents}`;\n\n\tif (options.format) {\n\t\tcontents = await helpers.format(contents, filePath);\n\t}\n\n\tawait fs.mkdir(path.dirname(filePath), { recursive: true });\n\tawait fs.writeFile(filePath, contents);\n};\n"],"names":["customTypeModelDescriptors","sharedSliceModelDescriptors","generateTypes","NON_EDITABLE_FILE_BANNER","fs","path"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAoBO,MAAM,2BAA2B,OAAO,EAC9C,SACA,SACA,cAC0C;AACpC,QAAA,WAAW,QAAQ,iBAAiB,gBAAgB;AAE1D,QAAM,CAAC,4BAA4B,2BAA2B,IAC7D,MAAM,QAAQ,IAAI;AAAA,IACjB,QAAQ,wBAAyB;AAAA,IACjC,QAAQ,mBAAoB;AAAA,EAAA,CAC5B;AAEF,QAAM,mBAAmB,2BAA2B,IACnD,CAACA,gCAA8B;AAC9B,WAAOA,4BAA2B;AAAA,EAAA,CAClC;AAEF,QAAM,oBAAoB,4BAA4B,IACrD,CAACC,iCAA+B;AAC/B,WAAOA,6BAA4B;AAAA,EAAA,CACnC;AAGF,MAAI,WAAWC,iBAAAA,cAAc;AAAA,IAC5B;AAAA,IACA;AAAA,IACA,mBAAmB;AAAA,MAClB,8BAA8B;AAAA,MAC9B,yBAAyB;AAAA,IACzB;AAAA,EAAA,CACD;AAED,aAAW,GAAGC;;EAA+B;AAE7C,MAAI,QAAQ,QAAQ;AACnB,eAAW,MAAM,QAAQ,OAAO,UAAU,QAAQ;AAAA,EAClD;AAEK,QAAAC,cAAG,MAAMC,gBAAK,QAAQ,QAAQ,GAAG,EAAE,WAAW,KAAA,CAAM;AACpD,QAAAD,cAAG,UAAU,UAAU,QAAQ;AACtC;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SliceMachineContext } from "@slicemachine/plugin-kit";
|
|
2
|
+
import type { PluginOptions } from "../types";
|
|
3
|
+
/**
|
|
4
|
+
* Arguments for `upsertGlobalContentTypes()`.
|
|
5
|
+
*/
|
|
6
|
+
type UpsertGlobalTypesArgs = Pick<SliceMachineContext<PluginOptions>, "actions" | "helpers" | "options">;
|
|
7
|
+
/**
|
|
8
|
+
* Creates a globally accessible TypeScript file containing types representing
|
|
9
|
+
* the Prismic repository's content.
|
|
10
|
+
*/
|
|
11
|
+
export declare const upsertGlobalContentTypes: ({ actions, helpers, options, }: UpsertGlobalTypesArgs) => Promise<void>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { generateTypes } from "prismic-ts-codegen";
|
|
2
|
+
import * as fs from "node:fs/promises";
|
|
3
|
+
import * as path from "node:path";
|
|
4
|
+
import { NON_EDITABLE_FILE_BANNER } from "../constants.js";
|
|
5
|
+
const upsertGlobalContentTypes = async ({ actions, helpers, options }) => {
|
|
6
|
+
const filePath = helpers.joinPathFromRoot("prismicio.d.ts");
|
|
7
|
+
const [customTypeModelDescriptors, sharedSliceModelDescriptors] = await Promise.all([
|
|
8
|
+
actions.readAllCustomTypeModels(),
|
|
9
|
+
actions.readAllSliceModels()
|
|
10
|
+
]);
|
|
11
|
+
const customTypeModels = customTypeModelDescriptors.map((customTypeModelDescriptors2) => {
|
|
12
|
+
return customTypeModelDescriptors2.model;
|
|
13
|
+
});
|
|
14
|
+
const sharedSliceModels = sharedSliceModelDescriptors.map((sharedSliceModelDescriptors2) => {
|
|
15
|
+
return sharedSliceModelDescriptors2.model;
|
|
16
|
+
});
|
|
17
|
+
let contents = generateTypes({
|
|
18
|
+
customTypeModels,
|
|
19
|
+
sharedSliceModels,
|
|
20
|
+
clientIntegration: {
|
|
21
|
+
includeCreateClientInterface: true,
|
|
22
|
+
includeContentNamespace: true
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
contents = `${NON_EDITABLE_FILE_BANNER}
|
|
26
|
+
|
|
27
|
+
${contents}`;
|
|
28
|
+
if (options.format) {
|
|
29
|
+
contents = await helpers.format(contents, filePath);
|
|
30
|
+
}
|
|
31
|
+
await fs.mkdir(path.dirname(filePath), { recursive: true });
|
|
32
|
+
await fs.writeFile(filePath, contents);
|
|
33
|
+
};
|
|
34
|
+
export {
|
|
35
|
+
upsertGlobalContentTypes
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=upsertGlobalContentTypes.js.map
|