@prismicio/client 7.21.3-pr.431.23cc5c6 → 7.21.3-pr.433.35b5234
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/getRepositoryName.cjs +1 -1
- package/dist/getRepositoryName.cjs.map +1 -1
- package/dist/getRepositoryName.js +1 -1
- package/dist/getRepositoryName.js.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/package.cjs +1 -1
- package/dist/package.cjs.map +1 -1
- package/dist/package.js +1 -1
- package/dist/package.js.map +1 -1
- package/dist/types/model/types.d.cts +2 -2
- package/dist/types/model/types.d.ts +2 -2
- package/package.json +1 -8
- package/src/getRepositoryName.ts +3 -0
- package/dist/iac/customType.cjs +0 -54
- package/dist/iac/customType.cjs.map +0 -1
- package/dist/iac/customType.d.cts +0 -43
- package/dist/iac/customType.d.cts.map +0 -1
- package/dist/iac/customType.d.ts +0 -43
- package/dist/iac/customType.d.ts.map +0 -1
- package/dist/iac/customType.js +0 -53
- package/dist/iac/customType.js.map +0 -1
- package/dist/iac/fields/boolean.cjs +0 -38
- package/dist/iac/fields/boolean.cjs.map +0 -1
- package/dist/iac/fields/boolean.d.cts +0 -22
- package/dist/iac/fields/boolean.d.cts.map +0 -1
- package/dist/iac/fields/boolean.d.ts +0 -22
- package/dist/iac/fields/boolean.d.ts.map +0 -1
- package/dist/iac/fields/boolean.js +0 -38
- package/dist/iac/fields/boolean.js.map +0 -1
- package/dist/iac/fields/color.cjs +0 -29
- package/dist/iac/fields/color.cjs.map +0 -1
- package/dist/iac/fields/color.d.cts +0 -11
- package/dist/iac/fields/color.d.cts.map +0 -1
- package/dist/iac/fields/color.d.ts +0 -11
- package/dist/iac/fields/color.d.ts.map +0 -1
- package/dist/iac/fields/color.js +0 -29
- package/dist/iac/fields/color.js.map +0 -1
- package/dist/iac/fields/contentRelationship.cjs +0 -50
- package/dist/iac/fields/contentRelationship.cjs.map +0 -1
- package/dist/iac/fields/contentRelationship.d.cts +0 -23
- package/dist/iac/fields/contentRelationship.d.cts.map +0 -1
- package/dist/iac/fields/contentRelationship.d.ts +0 -23
- package/dist/iac/fields/contentRelationship.d.ts.map +0 -1
- package/dist/iac/fields/contentRelationship.js +0 -50
- package/dist/iac/fields/contentRelationship.js.map +0 -1
- package/dist/iac/fields/date.cjs +0 -29
- package/dist/iac/fields/date.cjs.map +0 -1
- package/dist/iac/fields/date.d.cts +0 -11
- package/dist/iac/fields/date.d.cts.map +0 -1
- package/dist/iac/fields/date.d.ts +0 -11
- package/dist/iac/fields/date.d.ts.map +0 -1
- package/dist/iac/fields/date.js +0 -29
- package/dist/iac/fields/date.js.map +0 -1
- package/dist/iac/fields/embed.cjs +0 -29
- package/dist/iac/fields/embed.cjs.map +0 -1
- package/dist/iac/fields/embed.d.cts +0 -11
- package/dist/iac/fields/embed.d.cts.map +0 -1
- package/dist/iac/fields/embed.d.ts +0 -11
- package/dist/iac/fields/embed.d.ts.map +0 -1
- package/dist/iac/fields/embed.js +0 -29
- package/dist/iac/fields/embed.js.map +0 -1
- package/dist/iac/fields/geoPoint.cjs +0 -26
- package/dist/iac/fields/geoPoint.cjs.map +0 -1
- package/dist/iac/fields/geoPoint.d.cts +0 -10
- package/dist/iac/fields/geoPoint.d.cts.map +0 -1
- package/dist/iac/fields/geoPoint.d.ts +0 -10
- package/dist/iac/fields/geoPoint.d.ts.map +0 -1
- package/dist/iac/fields/geoPoint.js +0 -26
- package/dist/iac/fields/geoPoint.js.map +0 -1
- package/dist/iac/fields/group.cjs +0 -38
- package/dist/iac/fields/group.cjs.map +0 -1
- package/dist/iac/fields/group.d.cts +0 -17
- package/dist/iac/fields/group.d.cts.map +0 -1
- package/dist/iac/fields/group.d.ts +0 -17
- package/dist/iac/fields/group.d.ts.map +0 -1
- package/dist/iac/fields/group.js +0 -38
- package/dist/iac/fields/group.js.map +0 -1
- package/dist/iac/fields/image.cjs +0 -48
- package/dist/iac/fields/image.cjs.map +0 -1
- package/dist/iac/fields/image.d.cts +0 -21
- package/dist/iac/fields/image.d.cts.map +0 -1
- package/dist/iac/fields/image.d.ts +0 -21
- package/dist/iac/fields/image.d.ts.map +0 -1
- package/dist/iac/fields/image.js +0 -48
- package/dist/iac/fields/image.js.map +0 -1
- package/dist/iac/fields/integration.cjs +0 -33
- package/dist/iac/fields/integration.cjs.map +0 -1
- package/dist/iac/fields/integration.d.cts +0 -15
- package/dist/iac/fields/integration.d.cts.map +0 -1
- package/dist/iac/fields/integration.d.ts +0 -15
- package/dist/iac/fields/integration.d.ts.map +0 -1
- package/dist/iac/fields/integration.js +0 -33
- package/dist/iac/fields/integration.js.map +0 -1
- package/dist/iac/fields/link.cjs +0 -45
- package/dist/iac/fields/link.cjs.map +0 -1
- package/dist/iac/fields/link.d.cts +0 -39
- package/dist/iac/fields/link.d.cts.map +0 -1
- package/dist/iac/fields/link.d.ts +0 -39
- package/dist/iac/fields/link.d.ts.map +0 -1
- package/dist/iac/fields/link.js +0 -45
- package/dist/iac/fields/link.js.map +0 -1
- package/dist/iac/fields/linkToMedia.cjs +0 -31
- package/dist/iac/fields/linkToMedia.cjs.map +0 -1
- package/dist/iac/fields/linkToMedia.d.cts +0 -11
- package/dist/iac/fields/linkToMedia.d.cts.map +0 -1
- package/dist/iac/fields/linkToMedia.d.ts +0 -11
- package/dist/iac/fields/linkToMedia.d.ts.map +0 -1
- package/dist/iac/fields/linkToMedia.js +0 -31
- package/dist/iac/fields/linkToMedia.js.map +0 -1
- package/dist/iac/fields/number.cjs +0 -29
- package/dist/iac/fields/number.cjs.map +0 -1
- package/dist/iac/fields/number.d.cts +0 -11
- package/dist/iac/fields/number.d.cts.map +0 -1
- package/dist/iac/fields/number.d.ts +0 -11
- package/dist/iac/fields/number.d.ts.map +0 -1
- package/dist/iac/fields/number.js +0 -29
- package/dist/iac/fields/number.js.map +0 -1
- package/dist/iac/fields/richText.cjs +0 -49
- package/dist/iac/fields/richText.cjs.map +0 -1
- package/dist/iac/fields/richText.d.cts +0 -33
- package/dist/iac/fields/richText.d.cts.map +0 -1
- package/dist/iac/fields/richText.d.ts +0 -33
- package/dist/iac/fields/richText.d.ts.map +0 -1
- package/dist/iac/fields/richText.js +0 -49
- package/dist/iac/fields/richText.js.map +0 -1
- package/dist/iac/fields/select.cjs +0 -46
- package/dist/iac/fields/select.cjs.map +0 -1
- package/dist/iac/fields/select.d.cts +0 -15
- package/dist/iac/fields/select.d.cts.map +0 -1
- package/dist/iac/fields/select.d.ts +0 -15
- package/dist/iac/fields/select.d.ts.map +0 -1
- package/dist/iac/fields/select.js +0 -46
- package/dist/iac/fields/select.js.map +0 -1
- package/dist/iac/fields/sliceZone.cjs +0 -37
- package/dist/iac/fields/sliceZone.cjs.map +0 -1
- package/dist/iac/fields/sliceZone.d.cts +0 -30
- package/dist/iac/fields/sliceZone.d.cts.map +0 -1
- package/dist/iac/fields/sliceZone.d.ts +0 -30
- package/dist/iac/fields/sliceZone.d.ts.map +0 -1
- package/dist/iac/fields/sliceZone.js +0 -37
- package/dist/iac/fields/sliceZone.js.map +0 -1
- package/dist/iac/fields/table.cjs +0 -26
- package/dist/iac/fields/table.cjs.map +0 -1
- package/dist/iac/fields/table.d.cts +0 -10
- package/dist/iac/fields/table.d.cts.map +0 -1
- package/dist/iac/fields/table.d.ts +0 -10
- package/dist/iac/fields/table.d.ts.map +0 -1
- package/dist/iac/fields/table.js +0 -26
- package/dist/iac/fields/table.js.map +0 -1
- package/dist/iac/fields/text.cjs +0 -29
- package/dist/iac/fields/text.cjs.map +0 -1
- package/dist/iac/fields/text.d.cts +0 -11
- package/dist/iac/fields/text.d.cts.map +0 -1
- package/dist/iac/fields/text.d.ts +0 -11
- package/dist/iac/fields/text.d.ts.map +0 -1
- package/dist/iac/fields/text.js +0 -29
- package/dist/iac/fields/text.js.map +0 -1
- package/dist/iac/fields/timestamp.cjs +0 -29
- package/dist/iac/fields/timestamp.cjs.map +0 -1
- package/dist/iac/fields/timestamp.d.cts +0 -11
- package/dist/iac/fields/timestamp.d.cts.map +0 -1
- package/dist/iac/fields/timestamp.d.ts +0 -11
- package/dist/iac/fields/timestamp.d.ts.map +0 -1
- package/dist/iac/fields/timestamp.js +0 -29
- package/dist/iac/fields/timestamp.js.map +0 -1
- package/dist/iac/fields/uid.cjs +0 -29
- package/dist/iac/fields/uid.cjs.map +0 -1
- package/dist/iac/fields/uid.d.cts +0 -11
- package/dist/iac/fields/uid.d.cts.map +0 -1
- package/dist/iac/fields/uid.d.ts +0 -11
- package/dist/iac/fields/uid.d.ts.map +0 -1
- package/dist/iac/fields/uid.js +0 -29
- package/dist/iac/fields/uid.js.map +0 -1
- package/dist/iac/sharedSlice.cjs +0 -54
- package/dist/iac/sharedSlice.cjs.map +0 -1
- package/dist/iac/sharedSlice.d.cts +0 -28
- package/dist/iac/sharedSlice.d.cts.map +0 -1
- package/dist/iac/sharedSlice.d.ts +0 -28
- package/dist/iac/sharedSlice.d.ts.map +0 -1
- package/dist/iac/sharedSlice.js +0 -54
- package/dist/iac/sharedSlice.js.map +0 -1
- package/dist/iac/variation.cjs +0 -45
- package/dist/iac/variation.cjs.map +0 -1
- package/dist/iac/variation.d.cts +0 -46
- package/dist/iac/variation.d.cts.map +0 -1
- package/dist/iac/variation.d.ts +0 -46
- package/dist/iac/variation.d.ts.map +0 -1
- package/dist/iac/variation.js +0 -44
- package/dist/iac/variation.js.map +0 -1
- package/dist/iac.cjs +0 -86
- package/dist/iac.cjs.map +0 -1
- package/dist/iac.d.cts +0 -109
- package/dist/iac.d.cts.map +0 -1
- package/dist/iac.d.ts +0 -110
- package/dist/iac.d.ts.map +0 -1
- package/dist/iac.js +0 -86
- package/dist/iac.js.map +0 -1
- package/src/iac/customType.ts +0 -98
- package/src/iac/fields/boolean.ts +0 -55
- package/src/iac/fields/color.ts +0 -33
- package/src/iac/fields/contentRelationship.ts +0 -74
- package/src/iac/fields/date.ts +0 -33
- package/src/iac/fields/embed.ts +0 -33
- package/src/iac/fields/geoPoint.ts +0 -33
- package/src/iac/fields/group.ts +0 -58
- package/src/iac/fields/image.ts +0 -65
- package/src/iac/fields/index.ts +0 -62
- package/src/iac/fields/integration.ts +0 -43
- package/src/iac/fields/link.ts +0 -79
- package/src/iac/fields/linkToMedia.ts +0 -37
- package/src/iac/fields/number.ts +0 -35
- package/src/iac/fields/richText.ts +0 -84
- package/src/iac/fields/select.ts +0 -63
- package/src/iac/fields/sliceZone.ts +0 -82
- package/src/iac/fields/table.ts +0 -31
- package/src/iac/fields/text.ts +0 -33
- package/src/iac/fields/timestamp.ts +0 -35
- package/src/iac/fields/uid.ts +0 -33
- package/src/iac/index.ts +0 -122
- package/src/iac/sharedSlice.ts +0 -81
- package/src/iac/variation.ts +0 -107
|
@@ -15,7 +15,7 @@ const require_errors = require('./errors.cjs');
|
|
|
15
15
|
const getRepositoryName = (repositoryEndpoint) => {
|
|
16
16
|
try {
|
|
17
17
|
const hostname = new URL(repositoryEndpoint).hostname;
|
|
18
|
-
if (hostname.endsWith("prismic.io") || hostname.endsWith("wroom.io") || hostname.endsWith("wroom.test")) return hostname.split(".")[0];
|
|
18
|
+
if (hostname.endsWith("prismic.io") || hostname.endsWith("wroom.io") || hostname.endsWith("dev-tools-wroom.com") || hostname.endsWith("marketing-tools-wroom.com") || hostname.endsWith("platform-wroom.com") || hostname.endsWith("wroom.test")) return hostname.split(".")[0];
|
|
19
19
|
} catch {}
|
|
20
20
|
throw new require_errors.PrismicError(`An invalid Prismic Document API endpoint was provided: ${repositoryEndpoint}`, void 0, void 0);
|
|
21
21
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRepositoryName.cjs","names":["PrismicError"],"sources":["../src/getRepositoryName.ts"],"sourcesContent":["import { PrismicError } from \"./errors\"\n\n/**\n * Get a Prismic repository's name from its standard Prismic Document API or\n * GraphQL endpoint.\n *\n * @param repositoryEndpoint - Prismic Document API endpoint for the repository.\n *\n * @returns The Prismic repository's name.\n *\n * @throws {@link Error} Thrown if an invalid Prismic Document API endpoint is\n * provided.\n */\nexport const getRepositoryName = (repositoryEndpoint: string): string => {\n\ttry {\n\t\tconst hostname = new URL(repositoryEndpoint).hostname\n\n\t\tif (\n\t\t\thostname.endsWith(\"prismic.io\") || // Production\n\t\t\thostname.endsWith(\"wroom.io\") || // Staging\n\t\t\thostname.endsWith(\"wroom.test\") // Dev\n\t\t) {\n\t\t\treturn hostname.split(\".\")[0]\n\t\t}\n\t} catch {}\n\n\tthrow new PrismicError(\n\t\t`An invalid Prismic Document API endpoint was provided: ${repositoryEndpoint}`,\n\t\tundefined,\n\t\tundefined,\n\t)\n}\n"],"mappings":";;;;;;;;;;;;;;AAaA,MAAa,qBAAqB,uBAAuC;AACxE,KAAI;EACH,MAAM,WAAW,IAAI,IAAI,mBAAmB,CAAC;AAE7C,MACC,SAAS,SAAS,aAAa,IAC/B,SAAS,SAAS,WAAW,IAC7B,SAAS,SAAS,aAAa,CAE/B,QAAO,SAAS,MAAM,IAAI,CAAC;SAErB;AAER,OAAM,IAAIA,4BACT,0DAA0D,sBAC1D,QACA,OACA"}
|
|
1
|
+
{"version":3,"file":"getRepositoryName.cjs","names":["PrismicError"],"sources":["../src/getRepositoryName.ts"],"sourcesContent":["import { PrismicError } from \"./errors\"\n\n/**\n * Get a Prismic repository's name from its standard Prismic Document API or\n * GraphQL endpoint.\n *\n * @param repositoryEndpoint - Prismic Document API endpoint for the repository.\n *\n * @returns The Prismic repository's name.\n *\n * @throws {@link Error} Thrown if an invalid Prismic Document API endpoint is\n * provided.\n */\nexport const getRepositoryName = (repositoryEndpoint: string): string => {\n\ttry {\n\t\tconst hostname = new URL(repositoryEndpoint).hostname\n\n\t\tif (\n\t\t\thostname.endsWith(\"prismic.io\") || // Production\n\t\t\thostname.endsWith(\"wroom.io\") || // Staging\n\t\t\thostname.endsWith(\"dev-tools-wroom.com\") || // Dev-Tools\n\t\t\thostname.endsWith(\"marketing-tools-wroom.com\") || // Marketing-Tools\n\t\t\thostname.endsWith(\"platform-wroom.com\") || // Platform\n\t\t\thostname.endsWith(\"wroom.test\") // Dev\n\t\t) {\n\t\t\treturn hostname.split(\".\")[0]\n\t\t}\n\t} catch {}\n\n\tthrow new PrismicError(\n\t\t`An invalid Prismic Document API endpoint was provided: ${repositoryEndpoint}`,\n\t\tundefined,\n\t\tundefined,\n\t)\n}\n"],"mappings":";;;;;;;;;;;;;;AAaA,MAAa,qBAAqB,uBAAuC;AACxE,KAAI;EACH,MAAM,WAAW,IAAI,IAAI,mBAAmB,CAAC;AAE7C,MACC,SAAS,SAAS,aAAa,IAC/B,SAAS,SAAS,WAAW,IAC7B,SAAS,SAAS,sBAAsB,IACxC,SAAS,SAAS,4BAA4B,IAC9C,SAAS,SAAS,qBAAqB,IACvC,SAAS,SAAS,aAAa,CAE/B,QAAO,SAAS,MAAM,IAAI,CAAC;SAErB;AAER,OAAM,IAAIA,4BACT,0DAA0D,sBAC1D,QACA,OACA"}
|
|
@@ -15,7 +15,7 @@ import { PrismicError } from "./errors.js";
|
|
|
15
15
|
const getRepositoryName = (repositoryEndpoint) => {
|
|
16
16
|
try {
|
|
17
17
|
const hostname = new URL(repositoryEndpoint).hostname;
|
|
18
|
-
if (hostname.endsWith("prismic.io") || hostname.endsWith("wroom.io") || hostname.endsWith("wroom.test")) return hostname.split(".")[0];
|
|
18
|
+
if (hostname.endsWith("prismic.io") || hostname.endsWith("wroom.io") || hostname.endsWith("dev-tools-wroom.com") || hostname.endsWith("marketing-tools-wroom.com") || hostname.endsWith("platform-wroom.com") || hostname.endsWith("wroom.test")) return hostname.split(".")[0];
|
|
19
19
|
} catch {}
|
|
20
20
|
throw new PrismicError(`An invalid Prismic Document API endpoint was provided: ${repositoryEndpoint}`, void 0, void 0);
|
|
21
21
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRepositoryName.js","names":[],"sources":["../src/getRepositoryName.ts"],"sourcesContent":["import { PrismicError } from \"./errors\"\n\n/**\n * Get a Prismic repository's name from its standard Prismic Document API or\n * GraphQL endpoint.\n *\n * @param repositoryEndpoint - Prismic Document API endpoint for the repository.\n *\n * @returns The Prismic repository's name.\n *\n * @throws {@link Error} Thrown if an invalid Prismic Document API endpoint is\n * provided.\n */\nexport const getRepositoryName = (repositoryEndpoint: string): string => {\n\ttry {\n\t\tconst hostname = new URL(repositoryEndpoint).hostname\n\n\t\tif (\n\t\t\thostname.endsWith(\"prismic.io\") || // Production\n\t\t\thostname.endsWith(\"wroom.io\") || // Staging\n\t\t\thostname.endsWith(\"wroom.test\") // Dev\n\t\t) {\n\t\t\treturn hostname.split(\".\")[0]\n\t\t}\n\t} catch {}\n\n\tthrow new PrismicError(\n\t\t`An invalid Prismic Document API endpoint was provided: ${repositoryEndpoint}`,\n\t\tundefined,\n\t\tundefined,\n\t)\n}\n"],"mappings":";;;;;;;;;;;;;;AAaA,MAAa,qBAAqB,uBAAuC;AACxE,KAAI;EACH,MAAM,WAAW,IAAI,IAAI,mBAAmB,CAAC;AAE7C,MACC,SAAS,SAAS,aAAa,IAC/B,SAAS,SAAS,WAAW,IAC7B,SAAS,SAAS,aAAa,CAE/B,QAAO,SAAS,MAAM,IAAI,CAAC;SAErB;AAER,OAAM,IAAI,aACT,0DAA0D,sBAC1D,QACA,OACA"}
|
|
1
|
+
{"version":3,"file":"getRepositoryName.js","names":[],"sources":["../src/getRepositoryName.ts"],"sourcesContent":["import { PrismicError } from \"./errors\"\n\n/**\n * Get a Prismic repository's name from its standard Prismic Document API or\n * GraphQL endpoint.\n *\n * @param repositoryEndpoint - Prismic Document API endpoint for the repository.\n *\n * @returns The Prismic repository's name.\n *\n * @throws {@link Error} Thrown if an invalid Prismic Document API endpoint is\n * provided.\n */\nexport const getRepositoryName = (repositoryEndpoint: string): string => {\n\ttry {\n\t\tconst hostname = new URL(repositoryEndpoint).hostname\n\n\t\tif (\n\t\t\thostname.endsWith(\"prismic.io\") || // Production\n\t\t\thostname.endsWith(\"wroom.io\") || // Staging\n\t\t\thostname.endsWith(\"dev-tools-wroom.com\") || // Dev-Tools\n\t\t\thostname.endsWith(\"marketing-tools-wroom.com\") || // Marketing-Tools\n\t\t\thostname.endsWith(\"platform-wroom.com\") || // Platform\n\t\t\thostname.endsWith(\"wroom.test\") // Dev\n\t\t) {\n\t\t\treturn hostname.split(\".\")[0]\n\t\t}\n\t} catch {}\n\n\tthrow new PrismicError(\n\t\t`An invalid Prismic Document API endpoint was provided: ${repositoryEndpoint}`,\n\t\tundefined,\n\t\tundefined,\n\t)\n}\n"],"mappings":";;;;;;;;;;;;;;AAaA,MAAa,qBAAqB,uBAAuC;AACxE,KAAI;EACH,MAAM,WAAW,IAAI,IAAI,mBAAmB,CAAC;AAE7C,MACC,SAAS,SAAS,aAAa,IAC/B,SAAS,SAAS,WAAW,IAC7B,SAAS,SAAS,sBAAsB,IACxC,SAAS,SAAS,4BAA4B,IAC9C,SAAS,SAAS,qBAAqB,IACvC,SAAS,SAAS,aAAa,CAE/B,QAAO,SAAS,MAAM,IAAI,CAAC;SAErB;AAER,OAAM,IAAI,aACT,0DAA0D,sBAC1D,QACA,OACA"}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CustomTypeModelBooleanField } from "./types/model/boolean.cjs";
|
|
1
2
|
import { CustomTypeModelColorField } from "./types/model/color.cjs";
|
|
2
3
|
import { CustomTypeModelLinkField, CustomTypeModelLinkSelectType } from "./types/model/link.cjs";
|
|
3
4
|
import { CustomTypeModelContentRelationshipField, CustomTypeModelFetchContentRelationshipLevel1, CustomTypeModelFetchCustomTypeLevel1, CustomTypeModelFetchCustomTypeLevel2, CustomTypeModelFetchGroupLevel1, CustomTypeModelFetchGroupLevel2 } from "./types/model/contentRelationship.cjs";
|
|
@@ -6,7 +7,6 @@ import { CustomTypeModelEmbedField } from "./types/model/embed.cjs";
|
|
|
6
7
|
import { CustomTypeModelGeoPointField } from "./types/model/geoPoint.cjs";
|
|
7
8
|
import { CustomTypeModelGroupField, CustomTypeModelNestedGroupField } from "./types/model/group.cjs";
|
|
8
9
|
import { CustomTypeModelImageConstraint, CustomTypeModelImageField, CustomTypeModelImageThumbnail } from "./types/model/image.cjs";
|
|
9
|
-
import { CustomTypeModelIntegrationField } from "./types/model/integration.cjs";
|
|
10
10
|
import { CustomTypeModelKeyTextField } from "./types/model/keyText.cjs";
|
|
11
11
|
import { CustomTypeModelLinkToMediaField } from "./types/model/linkToMedia.cjs";
|
|
12
12
|
import { CustomTypeModelNumberField } from "./types/model/number.cjs";
|
|
@@ -21,7 +21,7 @@ import { CustomTypeModelTimestampField } from "./types/model/timestamp.cjs";
|
|
|
21
21
|
import { CustomTypeModelTitleField } from "./types/model/title.cjs";
|
|
22
22
|
import { CustomTypeModelUIDField } from "./types/model/uid.cjs";
|
|
23
23
|
import { CustomTypeModelField, CustomTypeModelFieldForGroup, CustomTypeModelFieldForNestedGroup, CustomTypeModelFieldForSlicePrimary, CustomTypeModelFieldType } from "./types/model/types.cjs";
|
|
24
|
-
import {
|
|
24
|
+
import { CustomTypeModelIntegrationField } from "./types/model/integration.cjs";
|
|
25
25
|
import { BooleanField } from "./types/value/boolean.cjs";
|
|
26
26
|
import { ColorField } from "./types/value/color.cjs";
|
|
27
27
|
import { GroupField, NestedGroupField } from "./types/value/group.cjs";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CustomTypeModelBooleanField } from "./types/model/boolean.js";
|
|
1
2
|
import { CustomTypeModelColorField } from "./types/model/color.js";
|
|
2
3
|
import { CustomTypeModelLinkField, CustomTypeModelLinkSelectType } from "./types/model/link.js";
|
|
3
4
|
import { CustomTypeModelContentRelationshipField, CustomTypeModelFetchContentRelationshipLevel1, CustomTypeModelFetchCustomTypeLevel1, CustomTypeModelFetchCustomTypeLevel2, CustomTypeModelFetchGroupLevel1, CustomTypeModelFetchGroupLevel2 } from "./types/model/contentRelationship.js";
|
|
@@ -6,7 +7,6 @@ import { CustomTypeModelEmbedField } from "./types/model/embed.js";
|
|
|
6
7
|
import { CustomTypeModelGeoPointField } from "./types/model/geoPoint.js";
|
|
7
8
|
import { CustomTypeModelGroupField, CustomTypeModelNestedGroupField } from "./types/model/group.js";
|
|
8
9
|
import { CustomTypeModelImageConstraint, CustomTypeModelImageField, CustomTypeModelImageThumbnail } from "./types/model/image.js";
|
|
9
|
-
import { CustomTypeModelIntegrationField } from "./types/model/integration.js";
|
|
10
10
|
import { CustomTypeModelKeyTextField } from "./types/model/keyText.js";
|
|
11
11
|
import { CustomTypeModelLinkToMediaField } from "./types/model/linkToMedia.js";
|
|
12
12
|
import { CustomTypeModelNumberField } from "./types/model/number.js";
|
|
@@ -21,7 +21,7 @@ import { CustomTypeModelTimestampField } from "./types/model/timestamp.js";
|
|
|
21
21
|
import { CustomTypeModelTitleField } from "./types/model/title.js";
|
|
22
22
|
import { CustomTypeModelUIDField } from "./types/model/uid.js";
|
|
23
23
|
import { CustomTypeModelField, CustomTypeModelFieldForGroup, CustomTypeModelFieldForNestedGroup, CustomTypeModelFieldForSlicePrimary, CustomTypeModelFieldType } from "./types/model/types.js";
|
|
24
|
-
import {
|
|
24
|
+
import { CustomTypeModelIntegrationField } from "./types/model/integration.js";
|
|
25
25
|
import { BooleanField } from "./types/value/boolean.js";
|
|
26
26
|
import { ColorField } from "./types/value/color.js";
|
|
27
27
|
import { GroupField, NestedGroupField } from "./types/value/group.js";
|
package/dist/package.cjs
CHANGED
package/dist/package.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package.cjs","names":[],"sources":["../package.json"],"sourcesContent":["{\n\t\"name\": \"@prismicio/client\",\n\t\"version\": \"7.21.3-pr.
|
|
1
|
+
{"version":3,"file":"package.cjs","names":[],"sources":["../package.json"],"sourcesContent":["{\n\t\"name\": \"@prismicio/client\",\n\t\"version\": \"7.21.3-pr.433.35b5234\",\n\t\"description\": \"The official JavaScript + TypeScript client library for Prismic\",\n\t\"keywords\": [\n\t\t\"typescript\",\n\t\t\"client\",\n\t\t\"helpers\",\n\t\t\"types\",\n\t\t\"utils\",\n\t\t\"toolbox\",\n\t\t\"cms\",\n\t\t\"prismic\",\n\t\t\"prismic.io\"\n\t],\n\t\"repository\": {\n\t\t\"type\": \"git\",\n\t\t\"url\": \"ssh://git@github.com/prismicio/prismic-client.git\"\n\t},\n\t\"license\": \"Apache-2.0\",\n\t\"author\": \"Prismic <contact@prismic.io> (https://prismic.io)\",\n\t\"sideEffects\": false,\n\t\"type\": \"module\",\n\t\"exports\": {\n\t\t\".\": {\n\t\t\t\"import\": \"./dist/index.js\",\n\t\t\t\"require\": \"./dist/index.cjs\"\n\t\t},\n\t\t\"./richtext\": {\n\t\t\t\"import\": \"./dist/richtext.js\",\n\t\t\t\"require\": \"./dist/richtext.cjs\"\n\t\t},\n\t\t\"./package.json\": \"./package.json\"\n\t},\n\t\"main\": \"./dist/index.cjs\",\n\t\"module\": \"./dist/index.js\",\n\t\"react-native\": \"./dist/index.js\",\n\t\"types\": \"./dist/index.d.cts\",\n\t\"typesVersions\": {\n\t\t\"*\": {\n\t\t\t\"*\": [\n\t\t\t\t\"dist/index.d.ts\"\n\t\t\t],\n\t\t\t\"richtext\": [\n\t\t\t\t\"dist/richtext.d.ts\"\n\t\t\t]\n\t\t}\n\t},\n\t\"files\": [\n\t\t\"dist\",\n\t\t\"src\"\n\t],\n\t\"scripts\": {\n\t\t\"build\": \"tsdown\",\n\t\t\"dev\": \"tsdown --watch\",\n\t\t\"format\": \"prettier --write .\",\n\t\t\"prepare\": \"npm run build\",\n\t\t\"lint\": \"oxlint --deny-warnings\",\n\t\t\"types\": \"tsc --noEmit\",\n\t\t\"unit\": \"vitest run --coverage\",\n\t\t\"unit:watch\": \"vitest watch\",\n\t\t\"test\": \"npm run lint && npm run types && npm run unit && npm run build\"\n\t},\n\t\"dependencies\": {\n\t\t\"imgix-url-builder\": \"^0.0.6\"\n\t},\n\t\"devDependencies\": {\n\t\t\"@prismicio/e2e-tests-utils\": \"^1.14.0\",\n\t\t\"@prismicio/types-internal\": \"^3.16.1\",\n\t\t\"@trivago/prettier-plugin-sort-imports\": \"^4.3.0\",\n\t\t\"@types/node\": \"^24.10.0\",\n\t\t\"@vitest/coverage-v8\": \"^4.0.6\",\n\t\t\"oxlint\": \"^1.26.0\",\n\t\t\"prettier\": \"^3.6.2\",\n\t\t\"prettier-plugin-jsdoc\": \"1.3.3\",\n\t\t\"tsdown\": \"^0.16.1\",\n\t\t\"typescript\": \"^5.9.3\",\n\t\t\"vitest\": \"^4.0.6\"\n\t},\n\t\"engines\": {\n\t\t\"node\": \">=14.15.0\"\n\t},\n\t\"publishConfig\": {\n\t\t\"access\": \"public\"\n\t}\n}\n"],"mappings":";;WACS;cACG"}
|
package/dist/package.js
CHANGED
package/dist/package.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package.js","names":[],"sources":["../package.json"],"sourcesContent":["{\n\t\"name\": \"@prismicio/client\",\n\t\"version\": \"7.21.3-pr.
|
|
1
|
+
{"version":3,"file":"package.js","names":[],"sources":["../package.json"],"sourcesContent":["{\n\t\"name\": \"@prismicio/client\",\n\t\"version\": \"7.21.3-pr.433.35b5234\",\n\t\"description\": \"The official JavaScript + TypeScript client library for Prismic\",\n\t\"keywords\": [\n\t\t\"typescript\",\n\t\t\"client\",\n\t\t\"helpers\",\n\t\t\"types\",\n\t\t\"utils\",\n\t\t\"toolbox\",\n\t\t\"cms\",\n\t\t\"prismic\",\n\t\t\"prismic.io\"\n\t],\n\t\"repository\": {\n\t\t\"type\": \"git\",\n\t\t\"url\": \"ssh://git@github.com/prismicio/prismic-client.git\"\n\t},\n\t\"license\": \"Apache-2.0\",\n\t\"author\": \"Prismic <contact@prismic.io> (https://prismic.io)\",\n\t\"sideEffects\": false,\n\t\"type\": \"module\",\n\t\"exports\": {\n\t\t\".\": {\n\t\t\t\"import\": \"./dist/index.js\",\n\t\t\t\"require\": \"./dist/index.cjs\"\n\t\t},\n\t\t\"./richtext\": {\n\t\t\t\"import\": \"./dist/richtext.js\",\n\t\t\t\"require\": \"./dist/richtext.cjs\"\n\t\t},\n\t\t\"./package.json\": \"./package.json\"\n\t},\n\t\"main\": \"./dist/index.cjs\",\n\t\"module\": \"./dist/index.js\",\n\t\"react-native\": \"./dist/index.js\",\n\t\"types\": \"./dist/index.d.cts\",\n\t\"typesVersions\": {\n\t\t\"*\": {\n\t\t\t\"*\": [\n\t\t\t\t\"dist/index.d.ts\"\n\t\t\t],\n\t\t\t\"richtext\": [\n\t\t\t\t\"dist/richtext.d.ts\"\n\t\t\t]\n\t\t}\n\t},\n\t\"files\": [\n\t\t\"dist\",\n\t\t\"src\"\n\t],\n\t\"scripts\": {\n\t\t\"build\": \"tsdown\",\n\t\t\"dev\": \"tsdown --watch\",\n\t\t\"format\": \"prettier --write .\",\n\t\t\"prepare\": \"npm run build\",\n\t\t\"lint\": \"oxlint --deny-warnings\",\n\t\t\"types\": \"tsc --noEmit\",\n\t\t\"unit\": \"vitest run --coverage\",\n\t\t\"unit:watch\": \"vitest watch\",\n\t\t\"test\": \"npm run lint && npm run types && npm run unit && npm run build\"\n\t},\n\t\"dependencies\": {\n\t\t\"imgix-url-builder\": \"^0.0.6\"\n\t},\n\t\"devDependencies\": {\n\t\t\"@prismicio/e2e-tests-utils\": \"^1.14.0\",\n\t\t\"@prismicio/types-internal\": \"^3.16.1\",\n\t\t\"@trivago/prettier-plugin-sort-imports\": \"^4.3.0\",\n\t\t\"@types/node\": \"^24.10.0\",\n\t\t\"@vitest/coverage-v8\": \"^4.0.6\",\n\t\t\"oxlint\": \"^1.26.0\",\n\t\t\"prettier\": \"^3.6.2\",\n\t\t\"prettier-plugin-jsdoc\": \"1.3.3\",\n\t\t\"tsdown\": \"^0.16.1\",\n\t\t\"typescript\": \"^5.9.3\",\n\t\t\"vitest\": \"^4.0.6\"\n\t},\n\t\"engines\": {\n\t\t\"node\": \">=14.15.0\"\n\t},\n\t\"publishConfig\": {\n\t\t\"access\": \"public\"\n\t}\n}\n"],"mappings":";WACS;cACG"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CustomTypeModelBooleanField } from "./boolean.cjs";
|
|
1
2
|
import { CustomTypeModelColorField } from "./color.cjs";
|
|
2
3
|
import { CustomTypeModelLinkField } from "./link.cjs";
|
|
3
4
|
import { CustomTypeModelContentRelationshipField } from "./contentRelationship.cjs";
|
|
@@ -6,7 +7,6 @@ import { CustomTypeModelEmbedField } from "./embed.cjs";
|
|
|
6
7
|
import { CustomTypeModelGeoPointField } from "./geoPoint.cjs";
|
|
7
8
|
import { CustomTypeModelGroupField, CustomTypeModelNestedGroupField } from "./group.cjs";
|
|
8
9
|
import { CustomTypeModelImageField } from "./image.cjs";
|
|
9
|
-
import { CustomTypeModelIntegrationField } from "./integration.cjs";
|
|
10
10
|
import { CustomTypeModelKeyTextField } from "./keyText.cjs";
|
|
11
11
|
import { CustomTypeModelLinkToMediaField } from "./linkToMedia.cjs";
|
|
12
12
|
import { CustomTypeModelNumberField } from "./number.cjs";
|
|
@@ -19,7 +19,7 @@ import { CustomTypeModelTableField } from "./table.cjs";
|
|
|
19
19
|
import { CustomTypeModelTimestampField } from "./timestamp.cjs";
|
|
20
20
|
import { CustomTypeModelTitleField } from "./title.cjs";
|
|
21
21
|
import { CustomTypeModelUIDField } from "./uid.cjs";
|
|
22
|
-
import {
|
|
22
|
+
import { CustomTypeModelIntegrationField } from "./integration.cjs";
|
|
23
23
|
|
|
24
24
|
//#region src/types/model/types.d.ts
|
|
25
25
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CustomTypeModelBooleanField } from "./boolean.js";
|
|
1
2
|
import { CustomTypeModelColorField } from "./color.js";
|
|
2
3
|
import { CustomTypeModelLinkField } from "./link.js";
|
|
3
4
|
import { CustomTypeModelContentRelationshipField } from "./contentRelationship.js";
|
|
@@ -6,7 +7,6 @@ import { CustomTypeModelEmbedField } from "./embed.js";
|
|
|
6
7
|
import { CustomTypeModelGeoPointField } from "./geoPoint.js";
|
|
7
8
|
import { CustomTypeModelGroupField, CustomTypeModelNestedGroupField } from "./group.js";
|
|
8
9
|
import { CustomTypeModelImageField } from "./image.js";
|
|
9
|
-
import { CustomTypeModelIntegrationField } from "./integration.js";
|
|
10
10
|
import { CustomTypeModelKeyTextField } from "./keyText.js";
|
|
11
11
|
import { CustomTypeModelLinkToMediaField } from "./linkToMedia.js";
|
|
12
12
|
import { CustomTypeModelNumberField } from "./number.js";
|
|
@@ -19,7 +19,7 @@ import { CustomTypeModelTableField } from "./table.js";
|
|
|
19
19
|
import { CustomTypeModelTimestampField } from "./timestamp.js";
|
|
20
20
|
import { CustomTypeModelTitleField } from "./title.js";
|
|
21
21
|
import { CustomTypeModelUIDField } from "./uid.js";
|
|
22
|
-
import {
|
|
22
|
+
import { CustomTypeModelIntegrationField } from "./integration.js";
|
|
23
23
|
|
|
24
24
|
//#region src/types/model/types.d.ts
|
|
25
25
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prismicio/client",
|
|
3
|
-
"version": "7.21.3-pr.
|
|
3
|
+
"version": "7.21.3-pr.433.35b5234",
|
|
4
4
|
"description": "The official JavaScript + TypeScript client library for Prismic",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -26,10 +26,6 @@
|
|
|
26
26
|
"import": "./dist/index.js",
|
|
27
27
|
"require": "./dist/index.cjs"
|
|
28
28
|
},
|
|
29
|
-
"./iac": {
|
|
30
|
-
"import": "./dist/iac.js",
|
|
31
|
-
"require": "./dist/iac.cjs"
|
|
32
|
-
},
|
|
33
29
|
"./richtext": {
|
|
34
30
|
"import": "./dist/richtext.js",
|
|
35
31
|
"require": "./dist/richtext.cjs"
|
|
@@ -47,9 +43,6 @@
|
|
|
47
43
|
],
|
|
48
44
|
"richtext": [
|
|
49
45
|
"dist/richtext.d.ts"
|
|
50
|
-
],
|
|
51
|
-
"iac": [
|
|
52
|
-
"dist/iac.d.ts"
|
|
53
46
|
]
|
|
54
47
|
}
|
|
55
48
|
},
|
package/src/getRepositoryName.ts
CHANGED
|
@@ -18,6 +18,9 @@ export const getRepositoryName = (repositoryEndpoint: string): string => {
|
|
|
18
18
|
if (
|
|
19
19
|
hostname.endsWith("prismic.io") || // Production
|
|
20
20
|
hostname.endsWith("wroom.io") || // Staging
|
|
21
|
+
hostname.endsWith("dev-tools-wroom.com") || // Dev-Tools
|
|
22
|
+
hostname.endsWith("marketing-tools-wroom.com") || // Marketing-Tools
|
|
23
|
+
hostname.endsWith("platform-wroom.com") || // Platform
|
|
21
24
|
hostname.endsWith("wroom.test") // Dev
|
|
22
25
|
) {
|
|
23
26
|
return hostname.split(".")[0]
|
package/dist/iac/customType.cjs
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
//#region src/iac/customType.ts
|
|
3
|
-
/**
|
|
4
|
-
* Creates a custom type model.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
*
|
|
8
|
-
* ```ts
|
|
9
|
-
* const blogPost = model.customType({
|
|
10
|
-
* id: "blog_post",
|
|
11
|
-
* label: "Blog Post",
|
|
12
|
-
* repeatable: true,
|
|
13
|
-
* format: "page",
|
|
14
|
-
* json: {
|
|
15
|
-
* Main: {
|
|
16
|
-
* uid: model.uid({ label: "UID" }),
|
|
17
|
-
* title: model.richText({ label: "Title", single: "heading1" }),
|
|
18
|
-
* featured_image: model.image({ label: "Featured Image" }),
|
|
19
|
-
* body: model.sliceZone({
|
|
20
|
-
* choices: {
|
|
21
|
-
* hero: { type: "SharedSlice" },
|
|
22
|
-
* text_block: { type: "SharedSlice" }
|
|
23
|
-
* }
|
|
24
|
-
* })
|
|
25
|
-
* },
|
|
26
|
-
* SEO: {
|
|
27
|
-
* meta_title: model.text({ label: "Meta Title" }),
|
|
28
|
-
* meta_description: model.text({ label: "Meta Description" })
|
|
29
|
-
* }
|
|
30
|
-
* }
|
|
31
|
-
* })
|
|
32
|
-
* ```
|
|
33
|
-
*
|
|
34
|
-
* @typeParam ID - Custom type ID literal for type inference.
|
|
35
|
-
* @typeParam Definition - Tabs and fields definition for type inference.
|
|
36
|
-
*
|
|
37
|
-
* @param config - Configuration for the custom type.
|
|
38
|
-
*
|
|
39
|
-
* @returns A custom type model.
|
|
40
|
-
*/
|
|
41
|
-
const customType = (config) => {
|
|
42
|
-
return {
|
|
43
|
-
id: config.id,
|
|
44
|
-
label: config.label ?? null,
|
|
45
|
-
repeatable: config.repeatable,
|
|
46
|
-
format: config.format,
|
|
47
|
-
status: config.status ?? true,
|
|
48
|
-
json: config.json
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
//#endregion
|
|
53
|
-
exports.customType = customType;
|
|
54
|
-
//# sourceMappingURL=customType.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"customType.cjs","names":[],"sources":["../../src/iac/customType.ts"],"sourcesContent":["import type {\n\tCustomTypeModel,\n\tCustomTypeModelDefinition,\n} from \"../types/model/customType\"\n\n/**\n * Configuration for a custom type.\n */\nexport interface CustomTypeConfig<\n\tID extends string = string,\n\tDefinition extends CustomTypeModelDefinition = CustomTypeModelDefinition,\n> {\n\t/**\n\t * The API ID of the custom type.\n\t */\n\tid: ID\n\t/**\n\t * The human-readable name of the custom type.\n\t */\n\tlabel?: string | null\n\t/**\n\t * Whether multiple documents of this type can be created.\n\t */\n\trepeatable: boolean\n\t/**\n\t * The format of the custom type.\n\t *\n\t * - `\"page\"` - A page type (has a URL).\n\t * - `\"custom\"` - A custom type (no URL).\n\t *\n\t * @defaultValue `\"custom\"`\n\t */\n\tformat?: \"page\" | \"custom\"\n\t/**\n\t * Whether new documents for this type can be created.\n\t *\n\t * @defaultValue `true`\n\t */\n\tstatus?: boolean\n\t/**\n\t * The tabs and fields definition for this custom type.\n\t */\n\tjson: Definition\n}\n\n/**\n * Creates a custom type model.\n *\n * @example\n *\n * ```ts\n * const blogPost = model.customType({\n * id: \"blog_post\",\n * label: \"Blog Post\",\n * repeatable: true,\n * format: \"page\",\n * json: {\n * Main: {\n * uid: model.uid({ label: \"UID\" }),\n * title: model.richText({ label: \"Title\", single: \"heading1\" }),\n * featured_image: model.image({ label: \"Featured Image\" }),\n * body: model.sliceZone({\n * choices: {\n * hero: { type: \"SharedSlice\" },\n * text_block: { type: \"SharedSlice\" }\n * }\n * })\n * },\n * SEO: {\n * meta_title: model.text({ label: \"Meta Title\" }),\n * meta_description: model.text({ label: \"Meta Description\" })\n * }\n * }\n * })\n * ```\n *\n * @typeParam ID - Custom type ID literal for type inference.\n * @typeParam Definition - Tabs and fields definition for type inference.\n *\n * @param config - Configuration for the custom type.\n *\n * @returns A custom type model.\n */\nexport const customType = <\n\tID extends string,\n\tDefinition extends CustomTypeModelDefinition,\n>(\n\tconfig: CustomTypeConfig<ID, Definition>,\n): CustomTypeModel<ID, Definition> => {\n\treturn {\n\t\tid: config.id,\n\t\tlabel: config.label ?? null,\n\t\trepeatable: config.repeatable,\n\t\tformat: config.format,\n\t\tstatus: config.status ?? true,\n\t\tjson: config.json,\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmFA,MAAa,cAIZ,WACqC;AACrC,QAAO;EACN,IAAI,OAAO;EACX,OAAO,OAAO,SAAS;EACvB,YAAY,OAAO;EACnB,QAAQ,OAAO;EACf,QAAQ,OAAO,UAAU;EACzB,MAAM,OAAO;EACb"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { CustomTypeModelDefinition } from "../types/model/customType.cjs";
|
|
2
|
-
|
|
3
|
-
//#region src/iac/customType.d.ts
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Configuration for a custom type.
|
|
7
|
-
*/
|
|
8
|
-
interface CustomTypeConfig<ID extends string = string, Definition extends CustomTypeModelDefinition = CustomTypeModelDefinition> {
|
|
9
|
-
/**
|
|
10
|
-
* The API ID of the custom type.
|
|
11
|
-
*/
|
|
12
|
-
id: ID;
|
|
13
|
-
/**
|
|
14
|
-
* The human-readable name of the custom type.
|
|
15
|
-
*/
|
|
16
|
-
label?: string | null;
|
|
17
|
-
/**
|
|
18
|
-
* Whether multiple documents of this type can be created.
|
|
19
|
-
*/
|
|
20
|
-
repeatable: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* The format of the custom type.
|
|
23
|
-
*
|
|
24
|
-
* - `"page"` - A page type (has a URL).
|
|
25
|
-
* - `"custom"` - A custom type (no URL).
|
|
26
|
-
*
|
|
27
|
-
* @defaultValue `"custom"`
|
|
28
|
-
*/
|
|
29
|
-
format?: "page" | "custom";
|
|
30
|
-
/**
|
|
31
|
-
* Whether new documents for this type can be created.
|
|
32
|
-
*
|
|
33
|
-
* @defaultValue `true`
|
|
34
|
-
*/
|
|
35
|
-
status?: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* The tabs and fields definition for this custom type.
|
|
38
|
-
*/
|
|
39
|
-
json: Definition;
|
|
40
|
-
}
|
|
41
|
-
//#endregion
|
|
42
|
-
export { CustomTypeConfig };
|
|
43
|
-
//# sourceMappingURL=customType.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"customType.d.cts","names":[],"sources":["../../src/iac/customType.ts"],"sourcesContent":[],"mappings":";;;;;;AAQA;AAEoB,UAFH,gBAEG,CAAA,WAAA,MAAA,GAAA,MAAA,EAAA,mBAAA,yBAAA,GAA4B,yBAA5B,CAAA,CAAA;EAA4B;;;EAgC/B,EAAA,EA3BZ,EA2BY;;;;;;;;;;;;;;;;;;;;;;;;;;;QAAV"}
|
package/dist/iac/customType.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { CustomTypeModelDefinition } from "../types/model/customType.js";
|
|
2
|
-
|
|
3
|
-
//#region src/iac/customType.d.ts
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Configuration for a custom type.
|
|
7
|
-
*/
|
|
8
|
-
interface CustomTypeConfig<ID extends string = string, Definition extends CustomTypeModelDefinition = CustomTypeModelDefinition> {
|
|
9
|
-
/**
|
|
10
|
-
* The API ID of the custom type.
|
|
11
|
-
*/
|
|
12
|
-
id: ID;
|
|
13
|
-
/**
|
|
14
|
-
* The human-readable name of the custom type.
|
|
15
|
-
*/
|
|
16
|
-
label?: string | null;
|
|
17
|
-
/**
|
|
18
|
-
* Whether multiple documents of this type can be created.
|
|
19
|
-
*/
|
|
20
|
-
repeatable: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* The format of the custom type.
|
|
23
|
-
*
|
|
24
|
-
* - `"page"` - A page type (has a URL).
|
|
25
|
-
* - `"custom"` - A custom type (no URL).
|
|
26
|
-
*
|
|
27
|
-
* @defaultValue `"custom"`
|
|
28
|
-
*/
|
|
29
|
-
format?: "page" | "custom";
|
|
30
|
-
/**
|
|
31
|
-
* Whether new documents for this type can be created.
|
|
32
|
-
*
|
|
33
|
-
* @defaultValue `true`
|
|
34
|
-
*/
|
|
35
|
-
status?: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* The tabs and fields definition for this custom type.
|
|
38
|
-
*/
|
|
39
|
-
json: Definition;
|
|
40
|
-
}
|
|
41
|
-
//#endregion
|
|
42
|
-
export { CustomTypeConfig };
|
|
43
|
-
//# sourceMappingURL=customType.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"customType.d.ts","names":[],"sources":["../../src/iac/customType.ts"],"sourcesContent":[],"mappings":";;;;;;AAQA;AAEoB,UAFH,gBAEG,CAAA,WAAA,MAAA,GAAA,MAAA,EAAA,mBAAA,yBAAA,GAA4B,yBAA5B,CAAA,CAAA;EAA4B;;;EAgC/B,EAAA,EA3BZ,EA2BY;;;;;;;;;;;;;;;;;;;;;;;;;;;QAAV"}
|
package/dist/iac/customType.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
//#region src/iac/customType.ts
|
|
2
|
-
/**
|
|
3
|
-
* Creates a custom type model.
|
|
4
|
-
*
|
|
5
|
-
* @example
|
|
6
|
-
*
|
|
7
|
-
* ```ts
|
|
8
|
-
* const blogPost = model.customType({
|
|
9
|
-
* id: "blog_post",
|
|
10
|
-
* label: "Blog Post",
|
|
11
|
-
* repeatable: true,
|
|
12
|
-
* format: "page",
|
|
13
|
-
* json: {
|
|
14
|
-
* Main: {
|
|
15
|
-
* uid: model.uid({ label: "UID" }),
|
|
16
|
-
* title: model.richText({ label: "Title", single: "heading1" }),
|
|
17
|
-
* featured_image: model.image({ label: "Featured Image" }),
|
|
18
|
-
* body: model.sliceZone({
|
|
19
|
-
* choices: {
|
|
20
|
-
* hero: { type: "SharedSlice" },
|
|
21
|
-
* text_block: { type: "SharedSlice" }
|
|
22
|
-
* }
|
|
23
|
-
* })
|
|
24
|
-
* },
|
|
25
|
-
* SEO: {
|
|
26
|
-
* meta_title: model.text({ label: "Meta Title" }),
|
|
27
|
-
* meta_description: model.text({ label: "Meta Description" })
|
|
28
|
-
* }
|
|
29
|
-
* }
|
|
30
|
-
* })
|
|
31
|
-
* ```
|
|
32
|
-
*
|
|
33
|
-
* @typeParam ID - Custom type ID literal for type inference.
|
|
34
|
-
* @typeParam Definition - Tabs and fields definition for type inference.
|
|
35
|
-
*
|
|
36
|
-
* @param config - Configuration for the custom type.
|
|
37
|
-
*
|
|
38
|
-
* @returns A custom type model.
|
|
39
|
-
*/
|
|
40
|
-
const customType = (config) => {
|
|
41
|
-
return {
|
|
42
|
-
id: config.id,
|
|
43
|
-
label: config.label ?? null,
|
|
44
|
-
repeatable: config.repeatable,
|
|
45
|
-
format: config.format,
|
|
46
|
-
status: config.status ?? true,
|
|
47
|
-
json: config.json
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
//#endregion
|
|
52
|
-
export { customType };
|
|
53
|
-
//# sourceMappingURL=customType.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"customType.js","names":[],"sources":["../../src/iac/customType.ts"],"sourcesContent":["import type {\n\tCustomTypeModel,\n\tCustomTypeModelDefinition,\n} from \"../types/model/customType\"\n\n/**\n * Configuration for a custom type.\n */\nexport interface CustomTypeConfig<\n\tID extends string = string,\n\tDefinition extends CustomTypeModelDefinition = CustomTypeModelDefinition,\n> {\n\t/**\n\t * The API ID of the custom type.\n\t */\n\tid: ID\n\t/**\n\t * The human-readable name of the custom type.\n\t */\n\tlabel?: string | null\n\t/**\n\t * Whether multiple documents of this type can be created.\n\t */\n\trepeatable: boolean\n\t/**\n\t * The format of the custom type.\n\t *\n\t * - `\"page\"` - A page type (has a URL).\n\t * - `\"custom\"` - A custom type (no URL).\n\t *\n\t * @defaultValue `\"custom\"`\n\t */\n\tformat?: \"page\" | \"custom\"\n\t/**\n\t * Whether new documents for this type can be created.\n\t *\n\t * @defaultValue `true`\n\t */\n\tstatus?: boolean\n\t/**\n\t * The tabs and fields definition for this custom type.\n\t */\n\tjson: Definition\n}\n\n/**\n * Creates a custom type model.\n *\n * @example\n *\n * ```ts\n * const blogPost = model.customType({\n * id: \"blog_post\",\n * label: \"Blog Post\",\n * repeatable: true,\n * format: \"page\",\n * json: {\n * Main: {\n * uid: model.uid({ label: \"UID\" }),\n * title: model.richText({ label: \"Title\", single: \"heading1\" }),\n * featured_image: model.image({ label: \"Featured Image\" }),\n * body: model.sliceZone({\n * choices: {\n * hero: { type: \"SharedSlice\" },\n * text_block: { type: \"SharedSlice\" }\n * }\n * })\n * },\n * SEO: {\n * meta_title: model.text({ label: \"Meta Title\" }),\n * meta_description: model.text({ label: \"Meta Description\" })\n * }\n * }\n * })\n * ```\n *\n * @typeParam ID - Custom type ID literal for type inference.\n * @typeParam Definition - Tabs and fields definition for type inference.\n *\n * @param config - Configuration for the custom type.\n *\n * @returns A custom type model.\n */\nexport const customType = <\n\tID extends string,\n\tDefinition extends CustomTypeModelDefinition,\n>(\n\tconfig: CustomTypeConfig<ID, Definition>,\n): CustomTypeModel<ID, Definition> => {\n\treturn {\n\t\tid: config.id,\n\t\tlabel: config.label ?? null,\n\t\trepeatable: config.repeatable,\n\t\tformat: config.format,\n\t\tstatus: config.status ?? true,\n\t\tjson: config.json,\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmFA,MAAa,cAIZ,WACqC;AACrC,QAAO;EACN,IAAI,OAAO;EACX,OAAO,OAAO,SAAS;EACvB,YAAY,OAAO;EACnB,QAAQ,OAAO;EACf,QAAQ,OAAO,UAAU;EACzB,MAAM,OAAO;EACb"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
const require_types = require('../../types/model/types.cjs');
|
|
2
|
-
|
|
3
|
-
//#region src/iac/fields/boolean.ts
|
|
4
|
-
/**
|
|
5
|
-
* Creates a boolean field model.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
*
|
|
9
|
-
* ```ts
|
|
10
|
-
* model.boolean({ label: "Featured" })
|
|
11
|
-
*
|
|
12
|
-
* model.boolean({
|
|
13
|
-
* label: "Published",
|
|
14
|
-
* default_value: false,
|
|
15
|
-
* placeholder_true: "Published",
|
|
16
|
-
* placeholder_false: "Draft"
|
|
17
|
-
* })
|
|
18
|
-
* ```
|
|
19
|
-
*
|
|
20
|
-
* @param config - Configuration for the field.
|
|
21
|
-
*
|
|
22
|
-
* @returns A boolean field model.
|
|
23
|
-
*/
|
|
24
|
-
const boolean = (config) => {
|
|
25
|
-
return {
|
|
26
|
-
type: require_types.CustomTypeModelFieldType.Boolean,
|
|
27
|
-
config: {
|
|
28
|
-
label: (config === null || config === void 0 ? void 0 : config.label) ?? null,
|
|
29
|
-
default_value: config === null || config === void 0 ? void 0 : config.default_value,
|
|
30
|
-
placeholder_true: config === null || config === void 0 ? void 0 : config.placeholder_true,
|
|
31
|
-
placeholder_false: config === null || config === void 0 ? void 0 : config.placeholder_false
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
//#endregion
|
|
37
|
-
exports.boolean = boolean;
|
|
38
|
-
//# sourceMappingURL=boolean.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"boolean.cjs","names":["CustomTypeModelFieldType"],"sources":["../../../src/iac/fields/boolean.ts"],"sourcesContent":["import type { CustomTypeModelBooleanField } from \"../../types/model/boolean\"\nimport { CustomTypeModelFieldType } from \"../../types/model/types\"\n\n/**\n * Configuration for a boolean field.\n */\nexport interface BooleanFieldConfig {\n\tlabel?: string | null\n\t/**\n\t * Default value for the boolean field.\n\t */\n\tdefault_value?: boolean\n\t/**\n\t * Placeholder text shown when the value is true.\n\t */\n\tplaceholder_true?: string\n\t/**\n\t * Placeholder text shown when the value is false.\n\t */\n\tplaceholder_false?: string\n}\n\n/**\n * Creates a boolean field model.\n *\n * @example\n *\n * ```ts\n * model.boolean({ label: \"Featured\" })\n *\n * model.boolean({\n * label: \"Published\",\n * default_value: false,\n * placeholder_true: \"Published\",\n * placeholder_false: \"Draft\"\n * })\n * ```\n *\n * @param config - Configuration for the field.\n *\n * @returns A boolean field model.\n */\nexport const boolean = (\n\tconfig?: BooleanFieldConfig,\n): CustomTypeModelBooleanField => {\n\treturn {\n\t\ttype: CustomTypeModelFieldType.Boolean,\n\t\tconfig: {\n\t\t\tlabel: config?.label ?? null,\n\t\t\tdefault_value: config?.default_value,\n\t\t\tplaceholder_true: config?.placeholder_true,\n\t\t\tplaceholder_false: config?.placeholder_false,\n\t\t},\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA0CA,MAAa,WACZ,WACiC;AACjC,QAAO;EACN,MAAMA,uCAAyB;EAC/B,QAAQ;GACP,wDAAO,OAAQ,UAAS;GACxB,+DAAe,OAAQ;GACvB,kEAAkB,OAAQ;GAC1B,mEAAmB,OAAQ;GAC3B;EACD"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
//#region src/iac/fields/boolean.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Configuration for a boolean field.
|
|
4
|
-
*/
|
|
5
|
-
interface BooleanFieldConfig {
|
|
6
|
-
label?: string | null;
|
|
7
|
-
/**
|
|
8
|
-
* Default value for the boolean field.
|
|
9
|
-
*/
|
|
10
|
-
default_value?: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* Placeholder text shown when the value is true.
|
|
13
|
-
*/
|
|
14
|
-
placeholder_true?: string;
|
|
15
|
-
/**
|
|
16
|
-
* Placeholder text shown when the value is false.
|
|
17
|
-
*/
|
|
18
|
-
placeholder_false?: string;
|
|
19
|
-
}
|
|
20
|
-
//#endregion
|
|
21
|
-
export { BooleanFieldConfig };
|
|
22
|
-
//# sourceMappingURL=boolean.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"boolean.d.cts","names":[],"sources":["../../../src/iac/fields/boolean.ts"],"sourcesContent":[],"mappings":";AAMA;;;UAAiB,kBAAA"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
//#region src/iac/fields/boolean.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Configuration for a boolean field.
|
|
4
|
-
*/
|
|
5
|
-
interface BooleanFieldConfig {
|
|
6
|
-
label?: string | null;
|
|
7
|
-
/**
|
|
8
|
-
* Default value for the boolean field.
|
|
9
|
-
*/
|
|
10
|
-
default_value?: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* Placeholder text shown when the value is true.
|
|
13
|
-
*/
|
|
14
|
-
placeholder_true?: string;
|
|
15
|
-
/**
|
|
16
|
-
* Placeholder text shown when the value is false.
|
|
17
|
-
*/
|
|
18
|
-
placeholder_false?: string;
|
|
19
|
-
}
|
|
20
|
-
//#endregion
|
|
21
|
-
export { BooleanFieldConfig };
|
|
22
|
-
//# sourceMappingURL=boolean.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"boolean.d.ts","names":[],"sources":["../../../src/iac/fields/boolean.ts"],"sourcesContent":[],"mappings":";AAMA;;;UAAiB,kBAAA"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { CustomTypeModelFieldType } from "../../types/model/types.js";
|
|
2
|
-
|
|
3
|
-
//#region src/iac/fields/boolean.ts
|
|
4
|
-
/**
|
|
5
|
-
* Creates a boolean field model.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
*
|
|
9
|
-
* ```ts
|
|
10
|
-
* model.boolean({ label: "Featured" })
|
|
11
|
-
*
|
|
12
|
-
* model.boolean({
|
|
13
|
-
* label: "Published",
|
|
14
|
-
* default_value: false,
|
|
15
|
-
* placeholder_true: "Published",
|
|
16
|
-
* placeholder_false: "Draft"
|
|
17
|
-
* })
|
|
18
|
-
* ```
|
|
19
|
-
*
|
|
20
|
-
* @param config - Configuration for the field.
|
|
21
|
-
*
|
|
22
|
-
* @returns A boolean field model.
|
|
23
|
-
*/
|
|
24
|
-
const boolean = (config) => {
|
|
25
|
-
return {
|
|
26
|
-
type: CustomTypeModelFieldType.Boolean,
|
|
27
|
-
config: {
|
|
28
|
-
label: (config === null || config === void 0 ? void 0 : config.label) ?? null,
|
|
29
|
-
default_value: config === null || config === void 0 ? void 0 : config.default_value,
|
|
30
|
-
placeholder_true: config === null || config === void 0 ? void 0 : config.placeholder_true,
|
|
31
|
-
placeholder_false: config === null || config === void 0 ? void 0 : config.placeholder_false
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
//#endregion
|
|
37
|
-
export { boolean };
|
|
38
|
-
//# sourceMappingURL=boolean.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"boolean.js","names":[],"sources":["../../../src/iac/fields/boolean.ts"],"sourcesContent":["import type { CustomTypeModelBooleanField } from \"../../types/model/boolean\"\nimport { CustomTypeModelFieldType } from \"../../types/model/types\"\n\n/**\n * Configuration for a boolean field.\n */\nexport interface BooleanFieldConfig {\n\tlabel?: string | null\n\t/**\n\t * Default value for the boolean field.\n\t */\n\tdefault_value?: boolean\n\t/**\n\t * Placeholder text shown when the value is true.\n\t */\n\tplaceholder_true?: string\n\t/**\n\t * Placeholder text shown when the value is false.\n\t */\n\tplaceholder_false?: string\n}\n\n/**\n * Creates a boolean field model.\n *\n * @example\n *\n * ```ts\n * model.boolean({ label: \"Featured\" })\n *\n * model.boolean({\n * label: \"Published\",\n * default_value: false,\n * placeholder_true: \"Published\",\n * placeholder_false: \"Draft\"\n * })\n * ```\n *\n * @param config - Configuration for the field.\n *\n * @returns A boolean field model.\n */\nexport const boolean = (\n\tconfig?: BooleanFieldConfig,\n): CustomTypeModelBooleanField => {\n\treturn {\n\t\ttype: CustomTypeModelFieldType.Boolean,\n\t\tconfig: {\n\t\t\tlabel: config?.label ?? null,\n\t\t\tdefault_value: config?.default_value,\n\t\t\tplaceholder_true: config?.placeholder_true,\n\t\t\tplaceholder_false: config?.placeholder_false,\n\t\t},\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA0CA,MAAa,WACZ,WACiC;AACjC,QAAO;EACN,MAAM,yBAAyB;EAC/B,QAAQ;GACP,wDAAO,OAAQ,UAAS;GACxB,+DAAe,OAAQ;GACvB,kEAAkB,OAAQ;GAC1B,mEAAmB,OAAQ;GAC3B;EACD"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
const require_types = require('../../types/model/types.cjs');
|
|
2
|
-
|
|
3
|
-
//#region src/iac/fields/color.ts
|
|
4
|
-
/**
|
|
5
|
-
* Creates a color field model.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
*
|
|
9
|
-
* ```ts
|
|
10
|
-
* model.color({ label: "Background Color" })
|
|
11
|
-
* ```
|
|
12
|
-
*
|
|
13
|
-
* @param config - Configuration for the field.
|
|
14
|
-
*
|
|
15
|
-
* @returns A color field model.
|
|
16
|
-
*/
|
|
17
|
-
const color = (config) => {
|
|
18
|
-
return {
|
|
19
|
-
type: require_types.CustomTypeModelFieldType.Color,
|
|
20
|
-
config: {
|
|
21
|
-
label: (config === null || config === void 0 ? void 0 : config.label) ?? null,
|
|
22
|
-
placeholder: config === null || config === void 0 ? void 0 : config.placeholder
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
//#endregion
|
|
28
|
-
exports.color = color;
|
|
29
|
-
//# sourceMappingURL=color.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"color.cjs","names":["CustomTypeModelFieldType"],"sources":["../../../src/iac/fields/color.ts"],"sourcesContent":["import type { CustomTypeModelColorField } from \"../../types/model/color\"\nimport { CustomTypeModelFieldType } from \"../../types/model/types\"\n\n/**\n * Configuration for a color field.\n */\nexport interface ColorFieldConfig {\n\tlabel?: string | null\n\tplaceholder?: string\n}\n\n/**\n * Creates a color field model.\n *\n * @example\n *\n * ```ts\n * model.color({ label: \"Background Color\" })\n * ```\n *\n * @param config - Configuration for the field.\n *\n * @returns A color field model.\n */\nexport const color = (config?: ColorFieldConfig): CustomTypeModelColorField => {\n\treturn {\n\t\ttype: CustomTypeModelFieldType.Color,\n\t\tconfig: {\n\t\t\tlabel: config?.label ?? null,\n\t\t\tplaceholder: config?.placeholder,\n\t\t},\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAwBA,MAAa,SAAS,WAAyD;AAC9E,QAAO;EACN,MAAMA,uCAAyB;EAC/B,QAAQ;GACP,wDAAO,OAAQ,UAAS;GACxB,6DAAa,OAAQ;GACrB;EACD"}
|