prismic-ts-codegen 0.1.11 → 0.1.13

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.
Files changed (202) hide show
  1. package/dist/_node_modules/quick-lru/index.cjs +234 -0
  2. package/dist/_node_modules/quick-lru/index.cjs.map +1 -0
  3. package/dist/_node_modules/quick-lru/index.js +235 -0
  4. package/dist/_node_modules/quick-lru/index.js.map +1 -0
  5. package/dist/constants.cjs +19 -21
  6. package/dist/constants.cjs.map +1 -1
  7. package/dist/constants.d.ts +2 -3
  8. package/dist/constants.js +19 -21
  9. package/dist/constants.js.map +1 -1
  10. package/dist/generateTypes.cjs +71 -90
  11. package/dist/generateTypes.cjs.map +1 -1
  12. package/dist/generateTypes.d.ts +2 -1
  13. package/dist/generateTypes.js +71 -90
  14. package/dist/generateTypes.js.map +1 -1
  15. package/dist/lib/addBlankLine.cjs +12 -0
  16. package/dist/lib/addBlankLine.cjs.map +1 -0
  17. package/dist/lib/addBlankLine.d.ts +5 -0
  18. package/dist/lib/addBlankLine.js +12 -0
  19. package/dist/lib/addBlankLine.js.map +1 -0
  20. package/dist/lib/addLine.cjs +8 -0
  21. package/dist/lib/addLine.cjs.map +1 -0
  22. package/dist/lib/addLine.d.ts +1 -0
  23. package/dist/lib/addLine.js +8 -0
  24. package/dist/lib/addLine.js.map +1 -0
  25. package/dist/lib/addSection.cjs +8 -0
  26. package/dist/lib/addSection.cjs.map +1 -0
  27. package/dist/lib/addSection.d.ts +1 -0
  28. package/dist/lib/addSection.js +8 -0
  29. package/dist/lib/addSection.js.map +1 -0
  30. package/dist/lib/addTrailingNewLine.cjs +11 -0
  31. package/dist/lib/addTrailingNewLine.cjs.map +1 -0
  32. package/dist/lib/addTrailingNewLine.d.ts +5 -0
  33. package/dist/lib/addTrailingNewLine.js +11 -0
  34. package/dist/lib/addTrailingNewLine.js.map +1 -0
  35. package/dist/lib/buildCustomTypeDataType.cjs +51 -0
  36. package/dist/lib/buildCustomTypeDataType.cjs.map +1 -0
  37. package/dist/lib/buildCustomTypeDataType.d.ts +13 -0
  38. package/dist/lib/buildCustomTypeDataType.js +51 -0
  39. package/dist/lib/buildCustomTypeDataType.js.map +1 -0
  40. package/dist/lib/buildCustomTypeType.cjs +60 -0
  41. package/dist/lib/buildCustomTypeType.cjs.map +1 -0
  42. package/dist/lib/buildCustomTypeType.d.ts +17 -0
  43. package/dist/lib/buildCustomTypeType.js +60 -0
  44. package/dist/lib/buildCustomTypeType.js.map +1 -0
  45. package/dist/lib/buildFieldDocs.cjs +67 -35
  46. package/dist/lib/buildFieldDocs.cjs.map +1 -1
  47. package/dist/lib/buildFieldDocs.d.ts +7 -11
  48. package/dist/lib/buildFieldDocs.js +67 -35
  49. package/dist/lib/buildFieldDocs.js.map +1 -1
  50. package/dist/lib/buildFieldProperties.cjs +300 -0
  51. package/dist/lib/buildFieldProperties.cjs.map +1 -0
  52. package/dist/lib/buildFieldProperties.d.ts +14 -0
  53. package/dist/lib/buildFieldProperties.js +300 -0
  54. package/dist/lib/buildFieldProperties.js.map +1 -0
  55. package/dist/lib/buildSharedSliceType.cjs +140 -0
  56. package/dist/lib/buildSharedSliceType.cjs.map +1 -0
  57. package/dist/lib/buildSharedSliceType.d.ts +16 -0
  58. package/dist/lib/buildSharedSliceType.js +140 -0
  59. package/dist/lib/buildSharedSliceType.js.map +1 -0
  60. package/dist/lib/buildTypeName.cjs +4 -2
  61. package/dist/lib/buildTypeName.cjs.map +1 -1
  62. package/dist/lib/buildTypeName.js +4 -2
  63. package/dist/lib/buildTypeName.js.map +1 -1
  64. package/dist/lib/buildUnion.cjs +7 -0
  65. package/dist/lib/buildUnion.cjs.map +1 -0
  66. package/dist/lib/buildUnion.d.ts +1 -0
  67. package/dist/lib/buildUnion.js +7 -0
  68. package/dist/lib/buildUnion.js.map +1 -0
  69. package/dist/lib/checkHasUIDFIeld.cjs +7 -0
  70. package/dist/lib/checkHasUIDFIeld.cjs.map +1 -0
  71. package/dist/lib/checkHasUIDFIeld.d.ts +2 -0
  72. package/dist/lib/checkHasUIDFIeld.js +7 -0
  73. package/dist/lib/checkHasUIDFIeld.js.map +1 -0
  74. package/dist/lib/getAPIIDPath.cjs +18 -14
  75. package/dist/lib/getAPIIDPath.cjs.map +1 -1
  76. package/dist/lib/getAPIIDPath.d.ts +4 -8
  77. package/dist/lib/getAPIIDPath.js +18 -14
  78. package/dist/lib/getAPIIDPath.js.map +1 -1
  79. package/dist/lib/getCacheKey.cjs +25 -0
  80. package/dist/lib/getCacheKey.cjs.map +1 -0
  81. package/dist/lib/getCacheKey.d.ts +9 -0
  82. package/dist/lib/getCacheKey.js +8 -0
  83. package/dist/lib/getCacheKey.js.map +1 -0
  84. package/dist/lib/getHumanReadableModelName.cjs +13 -17
  85. package/dist/lib/getHumanReadableModelName.cjs.map +1 -1
  86. package/dist/lib/getHumanReadableModelName.d.ts +3 -3
  87. package/dist/lib/getHumanReadableModelName.js +13 -17
  88. package/dist/lib/getHumanReadableModelName.js.map +1 -1
  89. package/dist/lib/{getHumanReadableFieldPath.cjs → getHumanReadablePath.cjs} +8 -8
  90. package/dist/lib/getHumanReadablePath.cjs.map +1 -0
  91. package/dist/lib/getHumanReadablePath.d.ts +6 -0
  92. package/dist/lib/{getHumanReadableFieldPath.js → getHumanReadablePath.js} +8 -8
  93. package/dist/lib/getHumanReadablePath.js.map +1 -0
  94. package/dist/types.d.ts +9 -1
  95. package/package.json +18 -17
  96. package/src/constants.ts +19 -22
  97. package/src/generateTypes.ts +109 -108
  98. package/src/lib/addBlankLine.ts +13 -0
  99. package/src/lib/addLine.ts +5 -0
  100. package/src/lib/addSection.ts +5 -0
  101. package/src/lib/addTrailingNewLine.ts +14 -0
  102. package/src/lib/buildCustomTypeDataType.ts +74 -0
  103. package/src/lib/buildCustomTypeType.ts +101 -0
  104. package/src/lib/buildFieldDocs.ts +128 -68
  105. package/src/lib/buildFieldProperties.ts +513 -0
  106. package/src/lib/buildSharedSliceType.ts +213 -0
  107. package/src/lib/buildTypeName.ts +4 -2
  108. package/src/lib/buildUnion.ts +3 -0
  109. package/src/lib/checkHasUIDFIeld.ts +5 -0
  110. package/src/lib/getAPIIDPath.ts +40 -41
  111. package/src/lib/getCacheKey.ts +13 -0
  112. package/src/lib/getHumanReadableModelName.ts +23 -20
  113. package/src/lib/getHumanReadablePath.ts +24 -0
  114. package/src/types.ts +11 -1
  115. package/dist/lib/addInterfacePropertiesForFields.cjs +0 -489
  116. package/dist/lib/addInterfacePropertiesForFields.cjs.map +0 -1
  117. package/dist/lib/addInterfacePropertiesForFields.d.ts +0 -21
  118. package/dist/lib/addInterfacePropertiesForFields.js +0 -489
  119. package/dist/lib/addInterfacePropertiesForFields.js.map +0 -1
  120. package/dist/lib/addTypeAliasForCustomType.cjs +0 -81
  121. package/dist/lib/addTypeAliasForCustomType.cjs.map +0 -1
  122. package/dist/lib/addTypeAliasForCustomType.d.ts +0 -11
  123. package/dist/lib/addTypeAliasForCustomType.js +0 -81
  124. package/dist/lib/addTypeAliasForCustomType.js.map +0 -1
  125. package/dist/lib/addTypeAliasForSharedSlice.cjs +0 -149
  126. package/dist/lib/addTypeAliasForSharedSlice.cjs.map +0 -1
  127. package/dist/lib/addTypeAliasForSharedSlice.d.ts +0 -10
  128. package/dist/lib/addTypeAliasForSharedSlice.js +0 -149
  129. package/dist/lib/addTypeAliasForSharedSlice.js.map +0 -1
  130. package/dist/lib/buildSharedSliceInterfaceNamePart.cjs +0 -8
  131. package/dist/lib/buildSharedSliceInterfaceNamePart.cjs.map +0 -1
  132. package/dist/lib/buildSharedSliceInterfaceNamePart.d.ts +0 -5
  133. package/dist/lib/buildSharedSliceInterfaceNamePart.js +0 -8
  134. package/dist/lib/buildSharedSliceInterfaceNamePart.js.map +0 -1
  135. package/dist/lib/getFieldDocumentationURL.cjs +0 -8
  136. package/dist/lib/getFieldDocumentationURL.cjs.map +0 -1
  137. package/dist/lib/getFieldDocumentationURL.d.ts +0 -6
  138. package/dist/lib/getFieldDocumentationURL.js +0 -8
  139. package/dist/lib/getFieldDocumentationURL.js.map +0 -1
  140. package/dist/lib/getHumanReadableFieldPath.cjs.map +0 -1
  141. package/dist/lib/getHumanReadableFieldPath.d.ts +0 -10
  142. package/dist/lib/getHumanReadableFieldPath.js.map +0 -1
  143. package/dist/lib/getHumanReadableFieldType.cjs +0 -36
  144. package/dist/lib/getHumanReadableFieldType.cjs.map +0 -1
  145. package/dist/lib/getHumanReadableFieldType.d.ts +0 -6
  146. package/dist/lib/getHumanReadableFieldType.js +0 -36
  147. package/dist/lib/getHumanReadableFieldType.js.map +0 -1
  148. package/dist/lib/getSourceFileText.cjs +0 -9
  149. package/dist/lib/getSourceFileText.cjs.map +0 -1
  150. package/dist/lib/getSourceFileText.d.ts +0 -2
  151. package/dist/lib/getSourceFileText.js +0 -9
  152. package/dist/lib/getSourceFileText.js.map +0 -1
  153. package/dist/lib/hasOwnProperty.cjs +0 -7
  154. package/dist/lib/hasOwnProperty.cjs.map +0 -1
  155. package/dist/lib/hasOwnProperty.d.ts +0 -10
  156. package/dist/lib/hasOwnProperty.js +0 -7
  157. package/dist/lib/hasOwnProperty.js.map +0 -1
  158. package/dist/lib/isCustomTypeModel.cjs +0 -7
  159. package/dist/lib/isCustomTypeModel.cjs.map +0 -1
  160. package/dist/lib/isCustomTypeModel.d.ts +0 -2
  161. package/dist/lib/isCustomTypeModel.js +0 -7
  162. package/dist/lib/isCustomTypeModel.js.map +0 -1
  163. package/dist/lib/isCustomTypeModelField.cjs +0 -7
  164. package/dist/lib/isCustomTypeModelField.cjs.map +0 -1
  165. package/dist/lib/isCustomTypeModelField.d.ts +0 -2
  166. package/dist/lib/isCustomTypeModelField.js +0 -7
  167. package/dist/lib/isCustomTypeModelField.js.map +0 -1
  168. package/dist/lib/isCustomTypeModelSlice.cjs +0 -8
  169. package/dist/lib/isCustomTypeModelSlice.cjs.map +0 -1
  170. package/dist/lib/isCustomTypeModelSlice.d.ts +0 -2
  171. package/dist/lib/isCustomTypeModelSlice.js +0 -8
  172. package/dist/lib/isCustomTypeModelSlice.js.map +0 -1
  173. package/dist/lib/isSharedSliceModel.cjs +0 -8
  174. package/dist/lib/isSharedSliceModel.cjs.map +0 -1
  175. package/dist/lib/isSharedSliceModel.d.ts +0 -2
  176. package/dist/lib/isSharedSliceModel.js +0 -8
  177. package/dist/lib/isSharedSliceModel.js.map +0 -1
  178. package/dist/lib/pascalCase.cjs +0 -8
  179. package/dist/lib/pascalCase.cjs.map +0 -1
  180. package/dist/lib/pascalCase.d.ts +0 -1
  181. package/dist/lib/pascalCase.js +0 -8
  182. package/dist/lib/pascalCase.js.map +0 -1
  183. package/dist/lib/writeFieldDocsDescription.cjs +0 -29
  184. package/dist/lib/writeFieldDocsDescription.cjs.map +0 -1
  185. package/dist/lib/writeFieldDocsDescription.d.ts +0 -13
  186. package/dist/lib/writeFieldDocsDescription.js +0 -29
  187. package/dist/lib/writeFieldDocsDescription.js.map +0 -1
  188. package/src/lib/addInterfacePropertiesForFields.ts +0 -665
  189. package/src/lib/addTypeAliasForCustomType.ts +0 -120
  190. package/src/lib/addTypeAliasForSharedSlice.ts +0 -201
  191. package/src/lib/buildSharedSliceInterfaceNamePart.ts +0 -11
  192. package/src/lib/getFieldDocumentationURL.ts +0 -15
  193. package/src/lib/getHumanReadableFieldPath.ts +0 -36
  194. package/src/lib/getHumanReadableFieldType.ts +0 -55
  195. package/src/lib/getSourceFileText.ts +0 -14
  196. package/src/lib/hasOwnProperty.ts +0 -15
  197. package/src/lib/isCustomTypeModel.ts +0 -5
  198. package/src/lib/isCustomTypeModelField.ts +0 -7
  199. package/src/lib/isCustomTypeModelSlice.ts +0 -14
  200. package/src/lib/isSharedSliceModel.ts +0 -14
  201. package/src/lib/pascalCase.ts +0 -9
  202. package/src/lib/writeFieldDocsDescription.ts +0 -51
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const constants = require("../constants.cjs");
4
- const getSourceFileText = (sourceFile) => {
5
- const text = sourceFile.print().replace(new RegExp(constants.BLANK_LINE_IDENTIFIER, "g"), "");
6
- return text;
7
- };
8
- exports.getSourceFileText = getSourceFileText;
9
- //# sourceMappingURL=getSourceFileText.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getSourceFileText.cjs","sources":["../../../src/lib/getSourceFileText.ts"],"sourcesContent":["import * as tsm from \"ts-morph\";\n\n// import prettier from \"prettier\";\nimport { BLANK_LINE_IDENTIFIER } from \"../constants\";\n\nexport const getSourceFileText = (sourceFile: tsm.SourceFile): string => {\n\tconst text = sourceFile\n\t\t.print()\n\t\t.replace(new RegExp(BLANK_LINE_IDENTIFIER, \"g\"), \"\");\n\n\treturn text;\n\n\t// return prettier.format(text, { parser: \"typescript\" });\n};\n"],"names":["BLANK_LINE_IDENTIFIER"],"mappings":";;;AAKa,MAAA,oBAAoB,CAAC,eAAsC;AACjE,QAAA,OAAO,WACX,MAAA,EACA,QAAQ,IAAI,OAAOA,iCAAuB,GAAG,GAAG,EAAE;AAE7C,SAAA;AAGR;;"}
@@ -1,2 +0,0 @@
1
- import * as tsm from "ts-morph";
2
- export declare const getSourceFileText: (sourceFile: tsm.SourceFile) => string;
@@ -1,9 +0,0 @@
1
- import { BLANK_LINE_IDENTIFIER } from "../constants.js";
2
- const getSourceFileText = (sourceFile) => {
3
- const text = sourceFile.print().replace(new RegExp(BLANK_LINE_IDENTIFIER, "g"), "");
4
- return text;
5
- };
6
- export {
7
- getSourceFileText
8
- };
9
- //# sourceMappingURL=getSourceFileText.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getSourceFileText.js","sources":["../../../src/lib/getSourceFileText.ts"],"sourcesContent":["import * as tsm from \"ts-morph\";\n\n// import prettier from \"prettier\";\nimport { BLANK_LINE_IDENTIFIER } from \"../constants\";\n\nexport const getSourceFileText = (sourceFile: tsm.SourceFile): string => {\n\tconst text = sourceFile\n\t\t.print()\n\t\t.replace(new RegExp(BLANK_LINE_IDENTIFIER, \"g\"), \"\");\n\n\treturn text;\n\n\t// return prettier.format(text, { parser: \"typescript\" });\n};\n"],"names":[],"mappings":";AAKa,MAAA,oBAAoB,CAAC,eAAsC;AACjE,QAAA,OAAO,WACX,MAAA,EACA,QAAQ,IAAI,OAAO,uBAAuB,GAAG,GAAG,EAAE;AAE7C,SAAA;AAGR;"}
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const hasOwnProperty = (obj, prop) => {
4
- return obj.hasOwnProperty(prop);
5
- };
6
- exports.hasOwnProperty = hasOwnProperty;
7
- //# sourceMappingURL=hasOwnProperty.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hasOwnProperty.cjs","sources":["../../../src/lib/hasOwnProperty.ts"],"sourcesContent":["/**\n * Determines if an object contains a given property. It augments the provided\n * object's type to include the property.\n *\n * @remarks\n * This function is only necessary because TypeScript does not narrow a type\n * after using the `in` operator on `object`.\n * @returns `true` if `obj` contains a `prop` property, `false` otherwise.\n */\nexport const hasOwnProperty = <X extends object, Y extends PropertyKey>(\n\tobj: X,\n\tprop: Y,\n): obj is X & Record<Y, unknown> => {\n\treturn obj.hasOwnProperty(prop);\n};\n"],"names":[],"mappings":";;AASa,MAAA,iBAAiB,CAC7B,KACA,SACkC;AAC3B,SAAA,IAAI,eAAe,IAAI;AAC/B;;"}
@@ -1,10 +0,0 @@
1
- /**
2
- * Determines if an object contains a given property. It augments the provided
3
- * object's type to include the property.
4
- *
5
- * @remarks
6
- * This function is only necessary because TypeScript does not narrow a type
7
- * after using the `in` operator on `object`.
8
- * @returns `true` if `obj` contains a `prop` property, `false` otherwise.
9
- */
10
- export declare const hasOwnProperty: <X extends object, Y extends PropertyKey>(obj: X, prop: Y) => obj is X & Record<Y, unknown>;
@@ -1,7 +0,0 @@
1
- const hasOwnProperty = (obj, prop) => {
2
- return obj.hasOwnProperty(prop);
3
- };
4
- export {
5
- hasOwnProperty
6
- };
7
- //# sourceMappingURL=hasOwnProperty.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hasOwnProperty.js","sources":["../../../src/lib/hasOwnProperty.ts"],"sourcesContent":["/**\n * Determines if an object contains a given property. It augments the provided\n * object's type to include the property.\n *\n * @remarks\n * This function is only necessary because TypeScript does not narrow a type\n * after using the `in` operator on `object`.\n * @returns `true` if `obj` contains a `prop` property, `false` otherwise.\n */\nexport const hasOwnProperty = <X extends object, Y extends PropertyKey>(\n\tobj: X,\n\tprop: Y,\n): obj is X & Record<Y, unknown> => {\n\treturn obj.hasOwnProperty(prop);\n};\n"],"names":[],"mappings":"AASa,MAAA,iBAAiB,CAC7B,KACA,SACkC;AAC3B,SAAA,IAAI,eAAe,IAAI;AAC/B;"}
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const isCustomTypeModel = (model) => {
4
- return typeof model === "object" && model !== null && "json" in model;
5
- };
6
- exports.isCustomTypeModel = isCustomTypeModel;
7
- //# sourceMappingURL=isCustomTypeModel.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isCustomTypeModel.cjs","sources":["../../../src/lib/isCustomTypeModel.ts"],"sourcesContent":["import type { CustomTypeModel } from \"@prismicio/client\";\n\nexport const isCustomTypeModel = (model: unknown): model is CustomTypeModel => {\n\treturn typeof model === \"object\" && model !== null && \"json\" in model;\n};\n"],"names":[],"mappings":";;AAEa,MAAA,oBAAoB,CAAC,UAA4C;AAC7E,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,UAAU;AACjE;;"}
@@ -1,2 +0,0 @@
1
- import type { CustomTypeModel } from "@prismicio/client";
2
- export declare const isCustomTypeModel: (model: unknown) => model is CustomTypeModel<string, import("@prismicio/client").CustomTypeModelDefinition<string>>;
@@ -1,7 +0,0 @@
1
- const isCustomTypeModel = (model) => {
2
- return typeof model === "object" && model !== null && "json" in model;
3
- };
4
- export {
5
- isCustomTypeModel
6
- };
7
- //# sourceMappingURL=isCustomTypeModel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isCustomTypeModel.js","sources":["../../../src/lib/isCustomTypeModel.ts"],"sourcesContent":["import type { CustomTypeModel } from \"@prismicio/client\";\n\nexport const isCustomTypeModel = (model: unknown): model is CustomTypeModel => {\n\treturn typeof model === \"object\" && model !== null && \"json\" in model;\n};\n"],"names":[],"mappings":"AAEa,MAAA,oBAAoB,CAAC,UAA4C;AAC7E,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,UAAU;AACjE;"}
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const isCustomTypeModelField = (model) => {
4
- return typeof model === "object" && model !== null && "type" in model;
5
- };
6
- exports.isCustomTypeModelField = isCustomTypeModelField;
7
- //# sourceMappingURL=isCustomTypeModelField.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isCustomTypeModelField.cjs","sources":["../../../src/lib/isCustomTypeModelField.ts"],"sourcesContent":["import type { CustomTypeModelField } from \"@prismicio/client\";\n\nexport const isCustomTypeModelField = (\n\tmodel: unknown,\n): model is CustomTypeModelField => {\n\treturn typeof model === \"object\" && model !== null && \"type\" in model;\n};\n"],"names":[],"mappings":";;AAEa,MAAA,yBAAyB,CACrC,UACkC;AAClC,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,UAAU;AACjE;;"}
@@ -1,2 +0,0 @@
1
- import type { CustomTypeModelField } from "@prismicio/client";
2
- export declare const isCustomTypeModelField: (model: unknown) => model is CustomTypeModelField;
@@ -1,7 +0,0 @@
1
- const isCustomTypeModelField = (model) => {
2
- return typeof model === "object" && model !== null && "type" in model;
3
- };
4
- export {
5
- isCustomTypeModelField
6
- };
7
- //# sourceMappingURL=isCustomTypeModelField.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isCustomTypeModelField.js","sources":["../../../src/lib/isCustomTypeModelField.ts"],"sourcesContent":["import type { CustomTypeModelField } from \"@prismicio/client\";\n\nexport const isCustomTypeModelField = (\n\tmodel: unknown,\n): model is CustomTypeModelField => {\n\treturn typeof model === \"object\" && model !== null && \"type\" in model;\n};\n"],"names":[],"mappings":"AAEa,MAAA,yBAAyB,CACrC,UACkC;AAClC,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,UAAU;AACjE;"}
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const hasOwnProperty = require("./hasOwnProperty.cjs");
4
- const isCustomTypeModelSlice = (model) => {
5
- return typeof model === "object" && model !== null && hasOwnProperty.hasOwnProperty(model, "type") && model.type === "Slice";
6
- };
7
- exports.isCustomTypeModelSlice = isCustomTypeModelSlice;
8
- //# sourceMappingURL=isCustomTypeModelSlice.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isCustomTypeModelSlice.cjs","sources":["../../../src/lib/isCustomTypeModelSlice.ts"],"sourcesContent":["import type { CustomTypeModelSlice } from \"@prismicio/client\";\n\nimport { hasOwnProperty } from \"./hasOwnProperty\";\n\nexport const isCustomTypeModelSlice = (\n\tmodel: unknown,\n): model is CustomTypeModelSlice => {\n\treturn (\n\t\ttypeof model === \"object\" &&\n\t\tmodel !== null &&\n\t\thasOwnProperty(model, \"type\") &&\n\t\tmodel.type === \"Slice\"\n\t);\n};\n"],"names":["hasOwnProperty"],"mappings":";;;AAIa,MAAA,yBAAyB,CACrC,UACkC;AAEjC,SAAA,OAAO,UAAU,YACjB,UAAU,QACVA,eAAAA,eAAe,OAAO,MAAM,KAC5B,MAAM,SAAS;AAEjB;;"}
@@ -1,2 +0,0 @@
1
- import type { CustomTypeModelSlice } from "@prismicio/client";
2
- export declare const isCustomTypeModelSlice: (model: unknown) => model is CustomTypeModelSlice<Record<string, import("@prismicio/client").CustomTypeModelFieldForGroup>, Record<string, import("@prismicio/client").CustomTypeModelFieldForGroup>>;
@@ -1,8 +0,0 @@
1
- import { hasOwnProperty } from "./hasOwnProperty.js";
2
- const isCustomTypeModelSlice = (model) => {
3
- return typeof model === "object" && model !== null && hasOwnProperty(model, "type") && model.type === "Slice";
4
- };
5
- export {
6
- isCustomTypeModelSlice
7
- };
8
- //# sourceMappingURL=isCustomTypeModelSlice.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isCustomTypeModelSlice.js","sources":["../../../src/lib/isCustomTypeModelSlice.ts"],"sourcesContent":["import type { CustomTypeModelSlice } from \"@prismicio/client\";\n\nimport { hasOwnProperty } from \"./hasOwnProperty\";\n\nexport const isCustomTypeModelSlice = (\n\tmodel: unknown,\n): model is CustomTypeModelSlice => {\n\treturn (\n\t\ttypeof model === \"object\" &&\n\t\tmodel !== null &&\n\t\thasOwnProperty(model, \"type\") &&\n\t\tmodel.type === \"Slice\"\n\t);\n};\n"],"names":[],"mappings":";AAIa,MAAA,yBAAyB,CACrC,UACkC;AAEjC,SAAA,OAAO,UAAU,YACjB,UAAU,QACV,eAAe,OAAO,MAAM,KAC5B,MAAM,SAAS;AAEjB;"}
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const hasOwnProperty = require("./hasOwnProperty.cjs");
4
- const isSharedSliceModel = (model) => {
5
- return typeof model === "object" && model !== null && hasOwnProperty.hasOwnProperty(model, "type") && model.type === "SharedSlice";
6
- };
7
- exports.isSharedSliceModel = isSharedSliceModel;
8
- //# sourceMappingURL=isSharedSliceModel.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isSharedSliceModel.cjs","sources":["../../../src/lib/isSharedSliceModel.ts"],"sourcesContent":["import type { SharedSliceModel } from \"@prismicio/client\";\n\nimport { hasOwnProperty } from \"./hasOwnProperty\";\n\nexport const isSharedSliceModel = (\n\tmodel: unknown,\n): model is SharedSliceModel => {\n\treturn (\n\t\ttypeof model === \"object\" &&\n\t\tmodel !== null &&\n\t\thasOwnProperty(model, \"type\") &&\n\t\tmodel.type === \"SharedSlice\"\n\t);\n};\n"],"names":["hasOwnProperty"],"mappings":";;;AAIa,MAAA,qBAAqB,CACjC,UAC8B;AAE7B,SAAA,OAAO,UAAU,YACjB,UAAU,QACVA,eAAAA,eAAe,OAAO,MAAM,KAC5B,MAAM,SAAS;AAEjB;;"}
@@ -1,2 +0,0 @@
1
- import type { SharedSliceModel } from "@prismicio/client";
2
- export declare const isSharedSliceModel: (model: unknown) => model is SharedSliceModel<string, import("@prismicio/client").SharedSliceModelVariation<string, Record<string, import("@prismicio/client").CustomTypeModelFieldForGroup>, Record<string, import("@prismicio/client").CustomTypeModelFieldForGroup>>>;
@@ -1,8 +0,0 @@
1
- import { hasOwnProperty } from "./hasOwnProperty.js";
2
- const isSharedSliceModel = (model) => {
3
- return typeof model === "object" && model !== null && hasOwnProperty(model, "type") && model.type === "SharedSlice";
4
- };
5
- export {
6
- isSharedSliceModel
7
- };
8
- //# sourceMappingURL=isSharedSliceModel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isSharedSliceModel.js","sources":["../../../src/lib/isSharedSliceModel.ts"],"sourcesContent":["import type { SharedSliceModel } from \"@prismicio/client\";\n\nimport { hasOwnProperty } from \"./hasOwnProperty\";\n\nexport const isSharedSliceModel = (\n\tmodel: unknown,\n): model is SharedSliceModel => {\n\treturn (\n\t\ttypeof model === \"object\" &&\n\t\tmodel !== null &&\n\t\thasOwnProperty(model, \"type\") &&\n\t\tmodel.type === \"SharedSlice\"\n\t);\n};\n"],"names":[],"mappings":";AAIa,MAAA,qBAAqB,CACjC,UAC8B;AAE7B,SAAA,OAAO,UAAU,YACjB,UAAU,QACV,eAAe,OAAO,MAAM,KAC5B,MAAM,SAAS;AAEjB;"}
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const pascalCase$1 = require("pascal-case");
4
- const pascalCase = (input) => pascalCase$1.pascalCase(input, {
5
- transform: pascalCase$1.pascalCaseTransformMerge
6
- });
7
- exports.pascalCase = pascalCase;
8
- //# sourceMappingURL=pascalCase.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pascalCase.cjs","sources":["../../../src/lib/pascalCase.ts"],"sourcesContent":["import {\n\tpascalCase as pascalCaseBase,\n\tpascalCaseTransformMerge,\n} from \"pascal-case\";\n\nexport const pascalCase = (input: string): string =>\n\tpascalCaseBase(input, {\n\t\ttransform: pascalCaseTransformMerge,\n\t});\n"],"names":["pascalCaseBase","pascalCaseTransformMerge"],"mappings":";;;AAKO,MAAM,aAAa,CAAC,UAC1BA,aAAA,WAAe,OAAO;AAAA,EACrB,WAAWC,aAAA;AACX,CAAA;;"}
@@ -1 +0,0 @@
1
- export declare const pascalCase: (input: string) => string;
@@ -1,8 +0,0 @@
1
- import { pascalCase as pascalCase$1, pascalCaseTransformMerge } from "pascal-case";
2
- const pascalCase = (input) => pascalCase$1(input, {
3
- transform: pascalCaseTransformMerge
4
- });
5
- export {
6
- pascalCase
7
- };
8
- //# sourceMappingURL=pascalCase.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pascalCase.js","sources":["../../../src/lib/pascalCase.ts"],"sourcesContent":["import {\n\tpascalCase as pascalCaseBase,\n\tpascalCaseTransformMerge,\n} from \"pascal-case\";\n\nexport const pascalCase = (input: string): string =>\n\tpascalCaseBase(input, {\n\t\ttransform: pascalCaseTransformMerge,\n\t});\n"],"names":["pascalCaseBase"],"mappings":";AAKO,MAAM,aAAa,CAAC,UAC1BA,aAAe,OAAO;AAAA,EACrB,WAAW;AACX,CAAA;"}
@@ -1,29 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const writeFieldDocsDescription = (config) => {
4
- if (config.description) {
5
- config.writer.writeLine(config.description);
6
- }
7
- config.writer.blankLineIfLastNot();
8
- if (config.fieldType) {
9
- config.writer.writeLine(`- **Field Type**: ${config.fieldType}`);
10
- }
11
- if (config.placeholder) {
12
- config.writer.writeLine(`- **Placeholder**: ${config.placeholder}`);
13
- }
14
- if (config.defaultValue !== void 0) {
15
- const stringifiedDefaultValue = typeof config.defaultValue === "boolean" ? `${config.defaultValue}` : config.defaultValue;
16
- config.writer.writeLine(`- **Default Value**: ${stringifiedDefaultValue}`);
17
- }
18
- if (config.apiIDPath) {
19
- config.writer.writeLine(`- **API ID Path**: ${config.apiIDPath}`);
20
- }
21
- if (config.tabName) {
22
- config.writer.writeLine(`- **Tab**: ${config.tabName}`);
23
- }
24
- if (config.documentationURL) {
25
- config.writer.writeLine(`- **Documentation**: ${config.documentationURL}`);
26
- }
27
- };
28
- exports.writeFieldDocsDescription = writeFieldDocsDescription;
29
- //# sourceMappingURL=writeFieldDocsDescription.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"writeFieldDocsDescription.cjs","sources":["../../../src/lib/writeFieldDocsDescription.ts"],"sourcesContent":["import type { CodeBlockWriter } from \"ts-morph\";\n\ntype BuildFieldDocsConfig = {\n\twriter: CodeBlockWriter;\n\tdescription?: string;\n\tfieldType?: string;\n\tdefaultValue?: string | boolean;\n\tplaceholder?: string;\n\tapiIDPath?: string;\n\ttabName?: string;\n\tdocumentationURL?: string;\n};\n\nexport const writeFieldDocsDescription = (\n\tconfig: BuildFieldDocsConfig,\n): void => {\n\tif (config.description) {\n\t\tconfig.writer.writeLine(config.description);\n\t}\n\n\tconfig.writer.blankLineIfLastNot();\n\n\tif (config.fieldType) {\n\t\tconfig.writer.writeLine(`- **Field Type**: ${config.fieldType}`);\n\t}\n\n\tif (config.placeholder) {\n\t\tconfig.writer.writeLine(`- **Placeholder**: ${config.placeholder}`);\n\t}\n\n\tif (config.defaultValue !== undefined) {\n\t\tconst stringifiedDefaultValue =\n\t\t\ttypeof config.defaultValue === \"boolean\"\n\t\t\t\t? `${config.defaultValue}`\n\t\t\t\t: config.defaultValue;\n\n\t\tconfig.writer.writeLine(`- **Default Value**: ${stringifiedDefaultValue}`);\n\t}\n\n\tif (config.apiIDPath) {\n\t\tconfig.writer.writeLine(`- **API ID Path**: ${config.apiIDPath}`);\n\t}\n\n\tif (config.tabName) {\n\t\tconfig.writer.writeLine(`- **Tab**: ${config.tabName}`);\n\t}\n\n\tif (config.documentationURL) {\n\t\tconfig.writer.writeLine(`- **Documentation**: ${config.documentationURL}`);\n\t}\n};\n"],"names":[],"mappings":";;AAaa,MAAA,4BAA4B,CACxC,WACS;AACT,MAAI,OAAO,aAAa;AAChB,WAAA,OAAO,UAAU,OAAO,WAAW;AAAA,EAC1C;AAED,SAAO,OAAO;AAEd,MAAI,OAAO,WAAW;AACrB,WAAO,OAAO,UAAU,qBAAqB,OAAO,WAAW;AAAA,EAC/D;AAED,MAAI,OAAO,aAAa;AACvB,WAAO,OAAO,UAAU,sBAAsB,OAAO,aAAa;AAAA,EAClE;AAEG,MAAA,OAAO,iBAAiB,QAAW;AAChC,UAAA,0BACL,OAAO,OAAO,iBAAiB,YAC5B,GAAG,OAAO,iBACV,OAAO;AAEJ,WAAA,OAAO,UAAU,wBAAwB,yBAAyB;AAAA,EACzE;AAED,MAAI,OAAO,WAAW;AACrB,WAAO,OAAO,UAAU,sBAAsB,OAAO,WAAW;AAAA,EAChE;AAED,MAAI,OAAO,SAAS;AACnB,WAAO,OAAO,UAAU,cAAc,OAAO,SAAS;AAAA,EACtD;AAED,MAAI,OAAO,kBAAkB;AAC5B,WAAO,OAAO,UAAU,wBAAwB,OAAO,kBAAkB;AAAA,EACzE;AACF;;"}
@@ -1,13 +0,0 @@
1
- import type { CodeBlockWriter } from "ts-morph";
2
- type BuildFieldDocsConfig = {
3
- writer: CodeBlockWriter;
4
- description?: string;
5
- fieldType?: string;
6
- defaultValue?: string | boolean;
7
- placeholder?: string;
8
- apiIDPath?: string;
9
- tabName?: string;
10
- documentationURL?: string;
11
- };
12
- export declare const writeFieldDocsDescription: (config: BuildFieldDocsConfig) => void;
13
- export {};
@@ -1,29 +0,0 @@
1
- const writeFieldDocsDescription = (config) => {
2
- if (config.description) {
3
- config.writer.writeLine(config.description);
4
- }
5
- config.writer.blankLineIfLastNot();
6
- if (config.fieldType) {
7
- config.writer.writeLine(`- **Field Type**: ${config.fieldType}`);
8
- }
9
- if (config.placeholder) {
10
- config.writer.writeLine(`- **Placeholder**: ${config.placeholder}`);
11
- }
12
- if (config.defaultValue !== void 0) {
13
- const stringifiedDefaultValue = typeof config.defaultValue === "boolean" ? `${config.defaultValue}` : config.defaultValue;
14
- config.writer.writeLine(`- **Default Value**: ${stringifiedDefaultValue}`);
15
- }
16
- if (config.apiIDPath) {
17
- config.writer.writeLine(`- **API ID Path**: ${config.apiIDPath}`);
18
- }
19
- if (config.tabName) {
20
- config.writer.writeLine(`- **Tab**: ${config.tabName}`);
21
- }
22
- if (config.documentationURL) {
23
- config.writer.writeLine(`- **Documentation**: ${config.documentationURL}`);
24
- }
25
- };
26
- export {
27
- writeFieldDocsDescription
28
- };
29
- //# sourceMappingURL=writeFieldDocsDescription.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"writeFieldDocsDescription.js","sources":["../../../src/lib/writeFieldDocsDescription.ts"],"sourcesContent":["import type { CodeBlockWriter } from \"ts-morph\";\n\ntype BuildFieldDocsConfig = {\n\twriter: CodeBlockWriter;\n\tdescription?: string;\n\tfieldType?: string;\n\tdefaultValue?: string | boolean;\n\tplaceholder?: string;\n\tapiIDPath?: string;\n\ttabName?: string;\n\tdocumentationURL?: string;\n};\n\nexport const writeFieldDocsDescription = (\n\tconfig: BuildFieldDocsConfig,\n): void => {\n\tif (config.description) {\n\t\tconfig.writer.writeLine(config.description);\n\t}\n\n\tconfig.writer.blankLineIfLastNot();\n\n\tif (config.fieldType) {\n\t\tconfig.writer.writeLine(`- **Field Type**: ${config.fieldType}`);\n\t}\n\n\tif (config.placeholder) {\n\t\tconfig.writer.writeLine(`- **Placeholder**: ${config.placeholder}`);\n\t}\n\n\tif (config.defaultValue !== undefined) {\n\t\tconst stringifiedDefaultValue =\n\t\t\ttypeof config.defaultValue === \"boolean\"\n\t\t\t\t? `${config.defaultValue}`\n\t\t\t\t: config.defaultValue;\n\n\t\tconfig.writer.writeLine(`- **Default Value**: ${stringifiedDefaultValue}`);\n\t}\n\n\tif (config.apiIDPath) {\n\t\tconfig.writer.writeLine(`- **API ID Path**: ${config.apiIDPath}`);\n\t}\n\n\tif (config.tabName) {\n\t\tconfig.writer.writeLine(`- **Tab**: ${config.tabName}`);\n\t}\n\n\tif (config.documentationURL) {\n\t\tconfig.writer.writeLine(`- **Documentation**: ${config.documentationURL}`);\n\t}\n};\n"],"names":[],"mappings":"AAaa,MAAA,4BAA4B,CACxC,WACS;AACT,MAAI,OAAO,aAAa;AAChB,WAAA,OAAO,UAAU,OAAO,WAAW;AAAA,EAC1C;AAED,SAAO,OAAO;AAEd,MAAI,OAAO,WAAW;AACrB,WAAO,OAAO,UAAU,qBAAqB,OAAO,WAAW;AAAA,EAC/D;AAED,MAAI,OAAO,aAAa;AACvB,WAAO,OAAO,UAAU,sBAAsB,OAAO,aAAa;AAAA,EAClE;AAEG,MAAA,OAAO,iBAAiB,QAAW;AAChC,UAAA,0BACL,OAAO,OAAO,iBAAiB,YAC5B,GAAG,OAAO,iBACV,OAAO;AAEJ,WAAA,OAAO,UAAU,wBAAwB,yBAAyB;AAAA,EACzE;AAED,MAAI,OAAO,WAAW;AACrB,WAAO,OAAO,UAAU,sBAAsB,OAAO,WAAW;AAAA,EAChE;AAED,MAAI,OAAO,SAAS;AACnB,WAAO,OAAO,UAAU,cAAc,OAAO,SAAS;AAAA,EACtD;AAED,MAAI,OAAO,kBAAkB;AAC5B,WAAO,OAAO,UAAU,wBAAwB,OAAO,kBAAkB;AAAA,EACzE;AACF;"}