@stonecrop/schema 0.8.12 → 0.9.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/README.md CHANGED
@@ -200,6 +200,90 @@ try {
200
200
  }
201
201
  ```
202
202
 
203
+ ## GraphQL to Doctype CLI
204
+
205
+ The `stonecrop-schema generate` command converts a GraphQL schema into Stonecrop doctype JSON files.
206
+
207
+ ### Basic usage
208
+
209
+ ```bash
210
+ # From a live GraphQL endpoint
211
+ stonecrop-schema generate -e http://localhost:3000/graphql -o ./app/doctypes
212
+
213
+ # From a saved introspection JSON file
214
+ stonecrop-schema generate -i introspection.json -o ./app/doctypes
215
+
216
+ # From an SDL file
217
+ stonecrop-schema generate -s schema.graphql -o ./app/doctypes
218
+ ```
219
+
220
+ ### Filtering types
221
+
222
+ GraphQL schemas (especially PostGraphile) expose many internal types. Use `--include` to
223
+ allowlist exactly the types you need, rather than having to `--exclude` everything you don't:
224
+
225
+ ```bash
226
+ # Only generate doctypes for these three types
227
+ stonecrop-schema generate -e http://localhost:3000/graphql -o ./app/doctypes \
228
+ --include 'SalesOrder,Customer,Item'
229
+
230
+ # Alternatively, exclude specific types
231
+ stonecrop-schema generate -e http://localhost:3000/graphql -o ./app/doctypes \
232
+ --exclude 'PageInfo,StonecropActionDefinition'
233
+ ```
234
+
235
+ `--include` and `--exclude` can be combined: `--include` is applied first (narrowing the set),
236
+ then `--exclude` removes any remaining unwanted names.
237
+
238
+ ### All options
239
+
240
+ | Flag | Short | Description |
241
+ |------|-------|-------------|
242
+ | `--endpoint <url>` | `-e` | Fetch introspection from a live GraphQL endpoint |
243
+ | `--introspection <file>` | `-i` | Read from a saved introspection JSON file |
244
+ | `--sdl <file>` | `-s` | Read from a GraphQL SDL (`.graphql`) file |
245
+ | `--output <dir>` | `-o` | Directory to write doctype JSON files (required) |
246
+ | `--include <types>` | | Comma-separated allowlist of type names to generate |
247
+ | `--exclude <types>` | | Comma-separated list of type names to skip |
248
+ | `--overrides <file>` | | JSON file with per-type, per-field overrides |
249
+ | `--custom-scalars <file>` | | JSON file mapping custom scalar names to field templates |
250
+ | `--include-unmapped` | | Retain `_graphqlType` metadata on fields with no mapping |
251
+ | `--help` | `-h` | Show help |
252
+
253
+ ### Custom scalars
254
+
255
+ For servers that use non-standard scalars (e.g. PostGraphile's `BigFloat`, `Datetime`), provide
256
+ a JSON mapping file:
257
+
258
+ ```json
259
+ {
260
+ "BigFloat": { "component": "ADecimalInput", "fieldtype": "Decimal" },
261
+ "Datetime": { "component": "ADatetimeInput", "fieldtype": "Datetime" }
262
+ }
263
+ ```
264
+
265
+ ```bash
266
+ stonecrop-schema generate -e http://localhost:3000/graphql -o ./app/doctypes \
267
+ --custom-scalars custom-scalars.json
268
+ ```
269
+
270
+ ### Per-field overrides
271
+
272
+ Override the generated field definition for specific types and fields:
273
+
274
+ ```json
275
+ {
276
+ "SalesOrder": {
277
+ "totalAmount": { "fieldtype": "Currency", "component": "ACurrencyInput" }
278
+ }
279
+ }
280
+ ```
281
+
282
+ ```bash
283
+ stonecrop-schema generate -e http://localhost:3000/graphql -o ./app/doctypes \
284
+ --overrides overrides.json
285
+ ```
286
+
203
287
  ## DDL Conversion
204
288
 
205
289
  Convert PostgreSQL DDL statements to Stonecrop doctype schemas:
package/package.json CHANGED
@@ -1,15 +1,12 @@
1
1
  {
2
2
  "name": "@stonecrop/schema",
3
- "version": "0.8.12",
3
+ "version": "0.9.0",
4
4
  "type": "module",
5
- "main": "./dist/index.cjs",
6
- "module": "./dist/index.js",
7
- "types": "./dist/src/index.d.ts",
5
+ "types": "./dist/schema.d.ts",
8
6
  "exports": {
9
7
  ".": {
10
- "types": "./dist/src/index.d.ts",
11
- "import": "./dist/index.js",
12
- "require": "./dist/index.cjs"
8
+ "types": "./dist/schema.d.ts",
9
+ "import": "./dist/index.js"
13
10
  }
14
11
  },
15
12
  "files": [
@@ -18,6 +15,8 @@
18
15
  "bin": {
19
16
  "stonecrop-schema": "./dist/cli.js"
20
17
  },
18
+ "description": "Stonecrop schema definitions and validation tooling",
19
+ "sideEffects": false,
21
20
  "dependencies": {
22
21
  "graphql": "^16.12.0",
23
22
  "zod": "^3.25.76"
@@ -35,7 +34,6 @@
35
34
  },
36
35
  "scripts": {
37
36
  "_phase:build": "heft build && vite build && rushx docs",
38
- "prepublish": "heft build && vite build && rushx docs",
39
37
  "build": "heft build && vite build && rushx docs",
40
38
  "docs": "bash ../common/scripts/run-docs.sh schema",
41
39
  "preview": "vite preview",
package/dist/cli.cjs DELETED
@@ -1,41 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";const r=require("node:fs"),c=require("node:path"),w=require("node:util"),x=require("graphql"),v=require("./index-aeXXzPET.cjs");async function O(e,h){const t=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",...h},body:JSON.stringify({query:x.getIntrospectionQuery()})});if(!t.ok)throw new Error(`Failed to fetch introspection: ${t.status} ${t.statusText}`);const a=await t.json();if(a.errors?.length)throw new Error(`GraphQL errors: ${a.errors.map(n=>n.message).join(", ")}`);if(!a.data)throw new Error("No data in introspection response");return a.data}async function $(){const{values:e,positionals:h}=w.parseArgs({allowPositionals:!0,options:{endpoint:{type:"string",short:"e"},introspection:{type:"string",short:"i"},sdl:{type:"string",short:"s"},output:{type:"string",short:"o"},include:{type:"string"},exclude:{type:"string"},overrides:{type:"string"},"custom-scalars":{type:"string"},"include-unmapped":{type:"boolean",default:!1},help:{type:"boolean",short:"h"}}}),t=h[0];(e.help||!t)&&(q(),process.exit(t?0:1)),t!=="generate"&&(console.error(`Unknown command: ${t}`),console.error("Available commands: generate"),process.exit(1)),[e.endpoint,e.introspection,e.sdl].filter(Boolean).length!==1&&(console.error("Exactly one of --endpoint, --introspection, or --sdl must be provided"),process.exit(1)),e.output||(console.error("--output <dir> is required"),process.exit(1));const n=c.resolve(e.output),l={includeUnmappedMeta:e["include-unmapped"]};if(e.include&&(l.include=e.include.split(",").map(o=>o.trim())),e.exclude&&(l.exclude=e.exclude.split(",").map(o=>o.trim())),e.overrides){const o=c.resolve(e.overrides),s=r.readFileSync(o,"utf-8");l.typeOverrides=JSON.parse(s)}if(e["custom-scalars"]){const o=c.resolve(e["custom-scalars"]),s=r.readFileSync(o,"utf-8");l.customScalars=JSON.parse(s)}let p;if(e.endpoint)console.log(`Fetching introspection from ${e.endpoint}...`),p=await O(e.endpoint);else if(e.introspection){const o=c.resolve(e.introspection),s=r.readFileSync(o,"utf-8"),u=JSON.parse(s);p=u.data??u}else{const o=c.resolve(e.sdl);p=r.readFileSync(o,"utf-8")}const m=v.convertGraphQLSchema(p,l);m.length===0&&(console.warn("No entity types found in the schema. Check your include/exclude filters."),process.exit(0)),r.existsSync(n)||r.mkdirSync(n,{recursive:!0});let f=0,d=0;for(const o of m){const s=`${o.slug}.json`,u=c.join(n,s),S=JSON.stringify(o,null," ");r.writeFileSync(u,S+`
3
- `,"utf-8");const g=v.validateDoctype(o);if(g.success){const i=o.fields.filter(y=>y._unmapped);i.length>0&&(f++,console.warn(` WARN: ${s} has ${i.length} unmapped field(s): ${i.map(y=>y.fieldname).join(", ")}`))}else{d++,console.error(` ERROR: ${s} failed validation:`);for(const i of g.errors)console.error(` ${i.path.join(".")}: ${i.message}`)}}console.log(`
4
- Generated ${m.length} doctype(s) in ${n}`+(f?` (${f} with warnings)`:"")+(d?` (${d} with errors)`:"")),d>0&&process.exit(1)}function q(){console.log(`
5
- stonecrop-schema - Convert GraphQL schemas to Stonecrop doctypes
6
-
7
- USAGE:
8
- stonecrop-schema generate [options]
9
-
10
- SOURCE (exactly one required):
11
- --endpoint, -e <url> Fetch introspection from a live GraphQL endpoint
12
- --introspection, -i <file> Read from a saved introspection JSON file
13
- --sdl, -s <file> Read from a GraphQL SDL (.graphql) file
14
-
15
- OUTPUT:
16
- --output, -o <dir> Directory to write doctype JSON files (required)
17
-
18
- OPTIONS:
19
- --include <types> Comma-separated list of type names to include
20
- --exclude <types> Comma-separated list of type names to exclude
21
- --overrides <file> JSON file with per-type field overrides
22
- --custom-scalars <file> JSON file mapping custom scalar names to field templates
23
- --include-unmapped Include _graphqlType metadata on unmapped fields
24
- --help, -h Show this help message
25
-
26
- EXAMPLES:
27
- # From a live PostGraphile server
28
- stonecrop-schema generate -e http://localhost:5000/graphql -o ./schemas
29
-
30
- # From a saved introspection result
31
- stonecrop-schema generate -i introspection.json -o ./schemas
32
-
33
- # From an SDL file with custom scalars
34
- stonecrop-schema generate -s schema.graphql -o ./schemas \\
35
- --custom-scalars custom-scalars.json
36
-
37
- # Only convert specific types
38
- stonecrop-schema generate -e http://localhost:5000/graphql -o ./schemas \\
39
- --include "User,Post,Comment"
40
- `)}$().catch(e=>{console.error("Error:",e.message),process.exit(1)});
41
- //# sourceMappingURL=cli.cjs.map
package/dist/cli.cjs.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli.cjs","sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * Stonecrop Schema CLI\n *\n * Converts GraphQL introspection results to Stonecrop doctype JSON schemas.\n *\n * Usage:\n * stonecrop-schema generate --endpoint <url> --output <dir>\n * stonecrop-schema generate --introspection <file.json> --output <dir>\n * stonecrop-schema generate --sdl <file.graphql> --output <dir>\n *\n * @packageDocumentation\n */\n\nimport { readFileSync, writeFileSync, mkdirSync, existsSync } from 'node:fs'\nimport { resolve, join } from 'node:path'\nimport { parseArgs } from 'node:util'\nimport { getIntrospectionQuery, type IntrospectionQuery } from 'graphql'\n\nimport { convertGraphQLSchema } from './converter/index'\nimport { validateDoctype } from './validation'\nimport type { GraphQLConversionOptions } from './converter/types'\n\n/**\n * Fetch an introspection result from a live GraphQL endpoint.\n *\n * @param endpoint - The GraphQL endpoint URL\n * @param headers - Optional HTTP headers\n * @returns The introspection query result\n */\nasync function fetchIntrospection(endpoint: string, headers?: Record<string, string>): Promise<IntrospectionQuery> {\n\tconst response = await fetch(endpoint, {\n\t\tmethod: 'POST',\n\t\theaders: {\n\t\t\t'Content-Type': 'application/json',\n\t\t\t...headers,\n\t\t},\n\t\tbody: JSON.stringify({\n\t\t\tquery: getIntrospectionQuery(),\n\t\t}),\n\t})\n\n\tif (!response.ok) {\n\t\tthrow new Error(`Failed to fetch introspection: ${response.status} ${response.statusText}`)\n\t}\n\n\tconst json = (await response.json()) as {\n\t\tdata?: IntrospectionQuery\n\t\terrors?: Array<{ message: string }>\n\t}\n\n\tif (json.errors?.length) {\n\t\tthrow new Error(`GraphQL errors: ${json.errors.map(e => e.message).join(', ')}`)\n\t}\n\n\tif (!json.data) {\n\t\tthrow new Error('No data in introspection response')\n\t}\n\n\treturn json.data\n}\n\nasync function main(): Promise<void> {\n\tconst { values, positionals } = parseArgs({\n\t\tallowPositionals: true,\n\t\toptions: {\n\t\t\tendpoint: { type: 'string', short: 'e' },\n\t\t\tintrospection: { type: 'string', short: 'i' },\n\t\t\tsdl: { type: 'string', short: 's' },\n\t\t\toutput: { type: 'string', short: 'o' },\n\t\t\tinclude: { type: 'string' },\n\t\t\texclude: { type: 'string' },\n\t\t\toverrides: { type: 'string' },\n\t\t\t'custom-scalars': { type: 'string' },\n\t\t\t'include-unmapped': { type: 'boolean', default: false },\n\t\t\thelp: { type: 'boolean', short: 'h' },\n\t\t},\n\t})\n\n\tconst command = positionals[0]\n\n\tif (values.help || !command) {\n\t\tprintHelp()\n\t\tprocess.exit(command ? 0 : 1)\n\t}\n\n\tif (command !== 'generate') {\n\t\tconsole.error(`Unknown command: ${command}`)\n\t\tconsole.error('Available commands: generate')\n\t\tprocess.exit(1)\n\t}\n\n\t// Determine source\n\tconst sourceCount = [values.endpoint, values.introspection, values.sdl].filter(Boolean).length\n\tif (sourceCount !== 1) {\n\t\tconsole.error('Exactly one of --endpoint, --introspection, or --sdl must be provided')\n\t\tprocess.exit(1)\n\t}\n\n\tif (!values.output) {\n\t\tconsole.error('--output <dir> is required')\n\t\tprocess.exit(1)\n\t}\n\n\tconst outputDir = resolve(values.output)\n\n\t// Build conversion options\n\tconst options: GraphQLConversionOptions = {\n\t\tincludeUnmappedMeta: values['include-unmapped'],\n\t}\n\n\tif (values.include) {\n\t\toptions.include = values.include.split(',').map(s => s.trim())\n\t}\n\n\tif (values.exclude) {\n\t\toptions.exclude = values.exclude.split(',').map(s => s.trim())\n\t}\n\n\tif (values.overrides) {\n\t\tconst overridesPath = resolve(values.overrides)\n\t\tconst overridesContent = readFileSync(overridesPath, 'utf-8')\n\t\toptions.typeOverrides = JSON.parse(overridesContent)\n\t}\n\n\tif (values['custom-scalars']) {\n\t\tconst scalarsPath = resolve(values['custom-scalars'])\n\t\tconst scalarsContent = readFileSync(scalarsPath, 'utf-8')\n\t\toptions.customScalars = JSON.parse(scalarsContent)\n\t}\n\n\t// Resolve source\n\tlet source: IntrospectionQuery | string\n\n\tif (values.endpoint) {\n\t\tconsole.log(`Fetching introspection from ${values.endpoint}...`)\n\t\tsource = await fetchIntrospection(values.endpoint)\n\t} else if (values.introspection) {\n\t\tconst filePath = resolve(values.introspection)\n\t\tconst content = readFileSync(filePath, 'utf-8')\n\t\tconst parsed = JSON.parse(content)\n\t\t// Handle both { data: { __schema: ... } } and { __schema: ... } formats\n\t\tsource = parsed.data ?? parsed\n\t} else {\n\t\tconst filePath = resolve(values.sdl!)\n\t\tsource = readFileSync(filePath, 'utf-8')\n\t}\n\n\t// Convert\n\tconst doctypes = convertGraphQLSchema(source, options)\n\n\tif (doctypes.length === 0) {\n\t\tconsole.warn('No entity types found in the schema. Check your include/exclude filters.')\n\t\tprocess.exit(0)\n\t}\n\n\t// Write output\n\tif (!existsSync(outputDir)) {\n\t\tmkdirSync(outputDir, { recursive: true })\n\t}\n\n\tlet warnings = 0\n\tlet errors = 0\n\n\tfor (const doctype of doctypes) {\n\t\tconst fileName = `${doctype.slug}.json`\n\t\tconst filePath = join(outputDir, fileName)\n\t\tconst json = JSON.stringify(doctype, null, '\\t')\n\n\t\twriteFileSync(filePath, json + '\\n', 'utf-8')\n\n\t\t// Validate the output\n\t\tconst validation = validateDoctype(doctype)\n\t\tif (!validation.success) {\n\t\t\terrors++\n\t\t\tconsole.error(` ERROR: ${fileName} failed validation:`)\n\t\t\tfor (const err of validation.errors) {\n\t\t\t\tconsole.error(` ${err.path.join('.')}: ${err.message}`)\n\t\t\t}\n\t\t} else {\n\t\t\t// Check for unmapped fields\n\t\t\tconst unmappedFields = doctype.fields.filter((f: any) => f._unmapped)\n\t\t\tif (unmappedFields.length > 0) {\n\t\t\t\twarnings++\n\t\t\t\tconsole.warn(\n\t\t\t\t\t` WARN: ${fileName} has ${unmappedFields.length} unmapped field(s): ${unmappedFields\n\t\t\t\t\t\t.map((f: any) => f.fieldname)\n\t\t\t\t\t\t.join(', ')}`\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t}\n\n\tconsole.log(\n\t\t`\\nGenerated ${doctypes.length} doctype(s) in ${outputDir}` +\n\t\t\t(warnings ? ` (${warnings} with warnings)` : '') +\n\t\t\t(errors ? ` (${errors} with errors)` : '')\n\t)\n\n\tif (errors > 0) {\n\t\tprocess.exit(1)\n\t}\n}\n\nfunction printHelp(): void {\n\tconsole.log(`\nstonecrop-schema - Convert GraphQL schemas to Stonecrop doctypes\n\nUSAGE:\n stonecrop-schema generate [options]\n\nSOURCE (exactly one required):\n --endpoint, -e <url> Fetch introspection from a live GraphQL endpoint\n --introspection, -i <file> Read from a saved introspection JSON file\n --sdl, -s <file> Read from a GraphQL SDL (.graphql) file\n\nOUTPUT:\n --output, -o <dir> Directory to write doctype JSON files (required)\n\nOPTIONS:\n --include <types> Comma-separated list of type names to include\n --exclude <types> Comma-separated list of type names to exclude\n --overrides <file> JSON file with per-type field overrides\n --custom-scalars <file> JSON file mapping custom scalar names to field templates\n --include-unmapped Include _graphqlType metadata on unmapped fields\n --help, -h Show this help message\n\nEXAMPLES:\n # From a live PostGraphile server\n stonecrop-schema generate -e http://localhost:5000/graphql -o ./schemas\n\n # From a saved introspection result\n stonecrop-schema generate -i introspection.json -o ./schemas\n\n # From an SDL file with custom scalars\n stonecrop-schema generate -s schema.graphql -o ./schemas \\\\\n --custom-scalars custom-scalars.json\n\n # Only convert specific types\n stonecrop-schema generate -e http://localhost:5000/graphql -o ./schemas \\\\\n --include \"User,Post,Comment\"\n`)\n}\n\nmain().catch(err => {\n\tconsole.error('Error:', err.message)\n\tprocess.exit(1)\n})\n"],"names":["fetchIntrospection","endpoint","headers","response","getIntrospectionQuery","json","e","main","values","positionals","parseArgs","command","printHelp","outputDir","resolve","options","s","overridesPath","overridesContent","readFileSync","scalarsPath","scalarsContent","source","filePath","content","parsed","doctypes","convertGraphQLSchema","existsSync","mkdirSync","warnings","errors","doctype","fileName","join","writeFileSync","validation","validateDoctype","unmappedFields","f","err"],"mappings":";6IA8BA,eAAeA,EAAmBC,EAAkBC,EAA+D,CAClH,MAAMC,EAAW,MAAM,MAAMF,EAAU,CACtC,OAAQ,OACR,QAAS,CACR,eAAgB,mBAChB,GAAGC,CAAA,EAEJ,KAAM,KAAK,UAAU,CACpB,MAAOE,EAAAA,sBAAA,CAAsB,CAC7B,CAAA,CACD,EAED,GAAI,CAACD,EAAS,GACb,MAAM,IAAI,MAAM,kCAAkCA,EAAS,MAAM,IAAIA,EAAS,UAAU,EAAE,EAG3F,MAAME,EAAQ,MAAMF,EAAS,KAAA,EAK7B,GAAIE,EAAK,QAAQ,OAChB,MAAM,IAAI,MAAM,mBAAmBA,EAAK,OAAO,IAAIC,GAAKA,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC,EAAE,EAGhF,GAAI,CAACD,EAAK,KACT,MAAM,IAAI,MAAM,mCAAmC,EAGpD,OAAOA,EAAK,IACb,CAEA,eAAeE,GAAsB,CACpC,KAAM,CAAE,OAAAC,EAAQ,YAAAC,CAAA,EAAgBC,YAAU,CACzC,iBAAkB,GAClB,QAAS,CACR,SAAU,CAAE,KAAM,SAAU,MAAO,GAAA,EACnC,cAAe,CAAE,KAAM,SAAU,MAAO,GAAA,EACxC,IAAK,CAAE,KAAM,SAAU,MAAO,GAAA,EAC9B,OAAQ,CAAE,KAAM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IACA,QAAQ,MAAM,YAAYE,CAAQ,qBAAqB,EACvD,UAAWO,KAAOJ,EAAW,OAC5B,QAAQ,MAAM,OAAOI,EAAI,KAAK,KAAK,GAAG,CAAC,KAAKA,EAAI,OAAO,EAAE,CAE3D,CAYD,CAEA,QAAQ,IACP;AAAA,YAAed,EAAS,MAAM,kBAAkBb,CAAS,IACvDiB,EAAW,KAAKA,CAAQ,kBAAoB,KAC5CC,EAAS,KAAKA,CAAM,gBAAkB,GAAA,EAGrCA,EAAS,GACZ,QAAQ,KAAK,CAAC,CAEhB,CAEA,SAASnB,GAAkB,CAC1B,QAAQ,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAoCZ,CACD,CAEAL,IAAO,MAAMiC,GAAO,CACnB,QAAQ,MAAM,SAAUA,EAAI,OAAO,EACnC,QAAQ,KAAK,CAAC,CACf,CAAC"}
@@ -1,2 +0,0 @@
1
- "use strict";const e=require("zod"),l=require("graphql"),_=e.z.enum(["Data","Text","Int","Float","Decimal","Check","Date","Time","Datetime","Duration","DateRange","JSON","Code","Link","Doctype","Attach","Currency","Quantity","Select"]),L={Data:{component:"ATextInput",fieldtype:"Data"},Text:{component:"ATextInput",fieldtype:"Text"},Int:{component:"ANumericInput",fieldtype:"Int"},Float:{component:"ANumericInput",fieldtype:"Float"},Decimal:{component:"ADecimalInput",fieldtype:"Decimal"},Check:{component:"ACheckbox",fieldtype:"Check"},Date:{component:"ADatePicker",fieldtype:"Date"},Time:{component:"ATimeInput",fieldtype:"Time"},Datetime:{component:"ADatetimePicker",fieldtype:"Datetime"},Duration:{component:"ADurationInput",fieldtype:"Duration"},DateRange:{component:"ADateRangePicker",fieldtype:"DateRange"},JSON:{component:"ACodeEditor",fieldtype:"JSON"},Code:{component:"ACodeEditor",fieldtype:"Code"},Link:{component:"ALink",fieldtype:"Link"},Doctype:{component:"ATable",fieldtype:"Doctype"},Attach:{component:"AFileAttach",fieldtype:"Attach"},Currency:{component:"ACurrencyInput",fieldtype:"Currency"},Quantity:{component:"AQuantityInput",fieldtype:"Quantity"},Select:{component:"ADropdown",fieldtype:"Select"}};function B(t){return L[t]?.component??"ATextInput"}const k=e.z.union([e.z.string(),e.z.array(e.z.string()),e.z.record(e.z.string(),e.z.unknown())]),N=e.z.object({errorMessage:e.z.string()}).passthrough(),D=e.z.object({fieldname:e.z.string().min(1),fieldtype:_,component:e.z.string().optional(),label:e.z.string().optional(),width:e.z.string().optional(),align:e.z.enum(["left","center","right","start","end"]).optional(),required:e.z.boolean().optional(),readOnly:e.z.boolean().optional(),edit:e.z.boolean().optional(),hidden:e.z.boolean().optional(),value:e.z.unknown().optional(),default:e.z.unknown().optional(),options:k.optional(),mask:e.z.string().optional(),validation:N.optional()}),O=e.z.object({label:e.z.string().min(1),handler:e.z.string().min(1),requiredFields:e.z.array(e.z.string()).optional(),allowedStates:e.z.array(e.z.string()).optional(),confirm:e.z.boolean().optional(),args:e.z.record(e.z.string(),e.z.unknown()).optional()}),E=e.z.object({states:e.z.array(e.z.string()).optional(),actions:e.z.record(e.z.string(),O).optional()}),z=e.z.object({name:e.z.string().min(1),slug:e.z.string().min(1).optional(),tableName:e.z.string().optional(),fields:e.z.array(D),workflow:E.optional(),inherits:e.z.string().optional(),listDoctype:e.z.string().optional(),parentDoctype:e.z.string().optional()});function G(t){const n=D.safeParse(t);return n.success?{success:!0,errors:[]}:{success:!1,errors:n.error.issues.map(i=>({path:i.path,message:i.message}))}}function Y(t){const n=z.safeParse(t);return n.success?{success:!0,errors:[]}:{success:!1,errors:n.error.issues.map(i=>({path:i.path,message:i.message}))}}function Z(t){return D.parse(t)}function K(t){return z.parse(t)}function V(t){return t.replace(/_([a-z])/g,(n,i)=>i.toUpperCase())}function H(t){return t.replace(/[A-Z]/g,n=>`_${n.toLowerCase()}`)}function X(t){return t.split("_").map(n=>n.charAt(0).toUpperCase()+n.slice(1).toLowerCase()).join(" ")}function M(t){const n=t.replace(/([A-Z])/g," $1").trim();return n.charAt(0).toUpperCase()+n.slice(1)}function ee(t){return t.split(/[-_\s]+/).map(n=>n.charAt(0).toUpperCase()+n.slice(1).toLowerCase()).join("")}function T(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function w(t){return t.replace(/([a-z])([A-Z])/g,"$1_$2").replace(/[\s-]+/g,"_").toLowerCase()}const v={String:{component:"ATextInput",fieldtype:"Data"},Int:{component:"ANumericInput",fieldtype:"Int"},Float:{component:"ANumericInput",fieldtype:"Float"},Boolean:{component:"ACheckbox",fieldtype:"Check"},ID:{component:"ATextInput",fieldtype:"Data"}},P={BigFloat:{component:"ADecimalInput",fieldtype:"Decimal"},BigDecimal:{component:"ADecimalInput",fieldtype:"Decimal"},Decimal:{component:"ADecimalInput",fieldtype:"Decimal"},BigInt:{component:"ANumericInput",fieldtype:"Int"},Long:{component:"ANumericInput",fieldtype:"Int"},UUID:{component:"ATextInput",fieldtype:"Data"},DateTime:{component:"ADatetimePicker",fieldtype:"Datetime"},Datetime:{component:"ADatetimePicker",fieldtype:"Datetime"},Date:{component:"ADatePicker",fieldtype:"Date"},Time:{component:"ATimeInput",fieldtype:"Time"},Interval:{component:"ADurationInput",fieldtype:"Duration"},Duration:{component:"ADurationInput",fieldtype:"Duration"},JSON:{component:"ACodeEditor",fieldtype:"JSON"},JSONObject:{component:"ACodeEditor",fieldtype:"JSON"},JsonNode:{component:"ACodeEditor",fieldtype:"JSON"}},j=new Set(["Cursor"]);function x(t){const n={...P};for(const[i,a]of Object.entries(v))n[i]=a;if(t)for(const[i,a]of Object.entries(t))n[i]={component:a.component??"ATextInput",fieldtype:a.fieldtype??"Data"};return n}const te=["Connection","Edge","Input","Patch","Payload","Condition","Filter","OrderBy","Aggregate","AggregateResult","AggregateFilter","DeleteResponse","InsertResponse","UpdateResponse","MutationResponse"],ne=new Set(["Query","Mutation","Subscription"]);function R(t,n){if(t.startsWith("__")||ne.has(t)||t==="Node")return!1;for(const a of te)if(t.endsWith(a))return!1;const i=n.getFields();return Object.keys(i).length!==0}const oe=new Set(["nodeId","__typename","clientMutationId"]);function q(t,n,i){return!oe.has(t)}function I(t){let n=!1,i=!1,a=t;return l.isNonNullType(a)&&(n=!0,a=a.ofType),l.isListType(a)&&(i=!0,a=a.ofType,l.isNonNullType(a)&&(a=a.ofType)),{namedType:a,required:n,isList:i}}function ie(t){const i=t.getFields().edges;if(!i)return;const{namedType:a,isList:r}=I(i.type);if(!r||!l.isObjectType(a))return;const d=a.getFields().node;if(!d)return;const{namedType:m}=I(d.type);if(l.isObjectType(m))return m.name}function U(t,n,i,a={}){const{namedType:r,required:y,isList:d}=I(n.type),m=x(a.customScalars),o={fieldname:t,label:M(t),component:"ATextInput",fieldtype:"Data"};if(y&&(o.required=!0),l.isScalarType(r)){if(j.has(r.name))return o._unmapped=!0,a.includeUnmappedMeta&&(o._graphqlType=r.name),o;const c=m[r.name];return c?(o.component=c.component,o.fieldtype=c.fieldtype):(o._unmapped=!0,a.includeUnmappedMeta&&(o._graphqlType=r.name)),o}if(l.isEnumType(r))return o.component="ADropdown",o.fieldtype="Select",o.options=r.getValues().map(c=>c.name),o;if(l.isObjectType(r)){if(!d&&i.has(r.name))return o.component="ALink",o.fieldtype="Link",o.options=T(r.name),o;const c=ie(r);return c&&i.has(c)?(o.component="ATable",o.fieldtype="Doctype",o.options=T(c),o):d&&i.has(r.name)?(o.component="ATable",o.fieldtype="Doctype",o.options=T(r.name),o):(o._unmapped=!0,a.includeUnmappedMeta&&(o._graphqlType=r.name),o)}return o._unmapped=!0,a.includeUnmappedMeta&&(o._graphqlType=r.name),o}function ae(t,n={}){const i=re(t),a=i.getTypeMap(),r=new Set,y=i.getQueryType(),d=i.getMutationType(),m=i.getSubscriptionType();y&&r.add(y.name),d&&r.add(d.name),m&&r.add(m.name);const o=n.isEntityType??R,c=new Set;for(const[p,s]of Object.entries(a))l.isObjectType(s)&&(r.has(p)||o(p,s)&&c.add(p));let A=c;if(n.include){const p=new Set(n.include);A=new Set([...c].filter(s=>p.has(s)))}if(n.exclude){const p=new Set(n.exclude);A=new Set([...A].filter(s=>!p.has(s)))}const Q=n.isEntityField??q,J=n.deriveTableName??(p=>w(p)),b=[];for(const p of A){const s=a[p];if(!l.isObjectType(s))continue;const W=s.getFields(),C=n.typeOverrides?.[p],$=Object.entries(W).filter(([u,g])=>Q(u,g,s)).map(([u,g])=>{if(n.classifyField){const f=n.classifyField(u,g,s);if(f!=null)return{fieldname:u,label:f.label??u,component:f.component??"ATextInput",fieldtype:f.fieldtype??"Data",...f}}const h=U(u,g,c,n);return C?.[u]?{...h,...C[u]}:h}).map(u=>{if(!n.includeUnmappedMeta){const{_graphqlType:g,_unmapped:h,...f}=u;return f}return u}),S={name:p,slug:T(p),fields:$},F=J(p);F&&(S.tableName=F),n.includeUnmappedMeta&&(S._graphqlTypeName=p),b.push(S)}return b}function re(t){return typeof t=="string"?l.buildSchema(t):l.buildClientSchema(t)}exports.ActionDefinition=O;exports.DoctypeMeta=z;exports.FieldMeta=D;exports.FieldOptions=k;exports.FieldValidation=N;exports.GQL_SCALAR_MAP=v;exports.INTERNAL_SCALARS=j;exports.StonecropFieldType=_;exports.TYPE_MAP=L;exports.WELL_KNOWN_SCALARS=P;exports.WorkflowMeta=E;exports.buildScalarMap=x;exports.camelToLabel=M;exports.camelToSnake=H;exports.classifyFieldType=U;exports.convertGraphQLSchema=ae;exports.defaultIsEntityField=q;exports.defaultIsEntityType=R;exports.getDefaultComponent=B;exports.parseDoctype=K;exports.parseField=Z;exports.pascalToSnake=w;exports.snakeToCamel=V;exports.snakeToLabel=X;exports.toPascalCase=ee;exports.toSlug=T;exports.validateDoctype=Y;exports.validateField=G;
2
- //# sourceMappingURL=index-aeXXzPET.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-aeXXzPET.cjs","sources":["../src/fieldtype.ts","../src/field.ts","../src/doctype.ts","../src/validation.ts","../src/naming.ts","../src/converter/scalars.ts","../src/converter/heuristics.ts","../src/converter/index.ts"],"sourcesContent":["import { z } from 'zod'\n\n/**\n * Stonecrop field types - the semantic type of the field.\n * These are consistent across forms and tables.\n * @public\n */\nexport const StonecropFieldType = z.enum([\n\t'Data', // Short text, varchar\n\t'Text', // Long text\n\t'Int', // Integer\n\t'Float', // Floating point (IEEE 754)\n\t'Decimal', // Arbitrary precision decimal\n\t'Check', // Boolean/checkbox\n\t'Date', // Date only\n\t'Time', // Time only\n\t'Datetime', // Date and time\n\t'Duration', // Time interval\n\t'DateRange', // Date range\n\t'JSON', // JSON data\n\t'Code', // Code/source (with syntax highlighting)\n\t'Link', // Reference to another doctype\n\t'Doctype', // Child doctype (renders as table)\n\t'Attach', // File attachment\n\t'Currency', // Currency value\n\t'Quantity', // Quantity with unit\n\t'Select', // Dropdown selection\n])\n\n/**\n * Stonecrop field type enum inferred from Zod schema\n * @public\n */\nexport type StonecropFieldType = z.infer<typeof StonecropFieldType>\n\n/**\n * Field template for TYPE_MAP entries.\n * Defines the default component and semantic field type for a field.\n * @public\n */\nexport interface FieldTemplate {\n\t/**\n\t * The Vue component name to render this field (e.g., 'ATextInput', 'ADropdown')\n\t */\n\tcomponent: string\n\t/**\n\t * The semantic field type (e.g., 'Data', 'Int', 'Select')\n\t */\n\tfieldtype: StonecropFieldType\n}\n\n/**\n * Mapping from StonecropFieldType to default Vue component.\n * Components can be overridden in the field definition.\n * @public\n */\nexport const TYPE_MAP: Record<StonecropFieldType, FieldTemplate> = {\n\t// Text\n\tData: { component: 'ATextInput', fieldtype: 'Data' },\n\tText: { component: 'ATextInput', fieldtype: 'Text' },\n\n\t// Numeric\n\tInt: { component: 'ANumericInput', fieldtype: 'Int' },\n\tFloat: { component: 'ANumericInput', fieldtype: 'Float' },\n\tDecimal: { component: 'ADecimalInput', fieldtype: 'Decimal' },\n\n\t// Boolean\n\tCheck: { component: 'ACheckbox', fieldtype: 'Check' },\n\n\t// Date/Time\n\tDate: { component: 'ADatePicker', fieldtype: 'Date' },\n\tTime: { component: 'ATimeInput', fieldtype: 'Time' },\n\tDatetime: { component: 'ADatetimePicker', fieldtype: 'Datetime' },\n\tDuration: { component: 'ADurationInput', fieldtype: 'Duration' },\n\tDateRange: { component: 'ADateRangePicker', fieldtype: 'DateRange' },\n\n\t// Structured\n\tJSON: { component: 'ACodeEditor', fieldtype: 'JSON' },\n\tCode: { component: 'ACodeEditor', fieldtype: 'Code' },\n\n\t// Relational\n\tLink: { component: 'ALink', fieldtype: 'Link' },\n\tDoctype: { component: 'ATable', fieldtype: 'Doctype' },\n\n\t// Files\n\tAttach: { component: 'AFileAttach', fieldtype: 'Attach' },\n\n\t// Specialized\n\tCurrency: { component: 'ACurrencyInput', fieldtype: 'Currency' },\n\tQuantity: { component: 'AQuantityInput', fieldtype: 'Quantity' },\n\tSelect: { component: 'ADropdown', fieldtype: 'Select' },\n}\n\n/**\n * Get the default component for a field type\n * @param fieldtype - The semantic field type\n * @returns The default component name\n * @public\n */\nexport function getDefaultComponent(fieldtype: StonecropFieldType): string {\n\treturn TYPE_MAP[fieldtype]?.component ?? 'ATextInput'\n}\n","import { z } from 'zod'\n\nimport { StonecropFieldType } from './fieldtype'\n\n/**\n * Field options - flexible bag for type-specific configuration.\n *\n * Usage by fieldtype:\n * - Link/Doctype: target doctype slug as string (\"customer\", \"sales-order-item\")\n * - Select: array of choices ([\"Draft\", \"Submitted\", \"Cancelled\"])\n * - Decimal: config object (\\{ precision: 10, scale: 2 \\})\n * - Code: config object (\\{ language: \"python\" \\})\n *\n * @public\n */\nexport const FieldOptions = z.union([\n\tz.string(), // Link/Doctype target: \"customer\"\n\tz.array(z.string()), // Select choices: [\"A\", \"B\", \"C\"]\n\tz.record(z.string(), z.unknown()), // Config: \\{ precision: 10, scale: 2 \\}\n])\n\n/**\n * Field options type inferred from Zod schema\n * @public\n */\nexport type FieldOptions = z.infer<typeof FieldOptions>\n\n/**\n * Validation configuration for form fields\n * @public\n */\nexport const FieldValidation = z\n\t.object({\n\t\t/** Error message to display when validation fails */\n\t\terrorMessage: z.string(),\n\t})\n\t.passthrough()\n\n/**\n * Field validation type inferred from Zod schema\n * @public\n */\nexport type FieldValidation = z.infer<typeof FieldValidation>\n\n/**\n * Unified field metadata - the single source of truth for field definitions.\n * Works for both forms (AForm) and tables (ATable).\n *\n * Core principle: \"Text\" is \"Text\" regardless of rendering context.\n *\n * @public\n */\nexport const FieldMeta = z.object({\n\t// === CORE (required) ===\n\n\t/** Unique identifier for the field within its doctype */\n\tfieldname: z.string().min(1),\n\n\t/** Semantic field type - determines behavior and default component */\n\tfieldtype: StonecropFieldType,\n\n\t// === COMPONENT (optional - derived from fieldtype when not specified) ===\n\n\t/** Vue component to render this field. If not specified, derived from TYPE_MAP */\n\tcomponent: z.string().optional(),\n\n\t// === DISPLAY ===\n\n\t/** Human-readable label for the field */\n\tlabel: z.string().optional(),\n\n\t/** Width of the field (CSS value, e.g., \"40ch\", \"200px\") */\n\twidth: z.string().optional(),\n\n\t/** Text alignment within the field */\n\talign: z.enum(['left', 'center', 'right', 'start', 'end']).optional(),\n\n\t// === BEHAVIOR ===\n\n\t/** Whether the field is required */\n\trequired: z.boolean().optional(),\n\n\t/** Whether the field is read-only */\n\treadOnly: z.boolean().optional(),\n\n\t/** Whether the field is editable (for table cells) */\n\tedit: z.boolean().optional(),\n\n\t/** Whether the field is hidden from the UI */\n\thidden: z.boolean().optional(),\n\n\t// === VALUE ===\n\n\t/** Current value of the field */\n\tvalue: z.unknown().optional(),\n\n\t/** Default value for new records */\n\tdefault: z.unknown().optional(),\n\n\t// === TYPE-SPECIFIC ===\n\n\t/**\n\t * Type-specific options:\n\t * - Link: target doctype slug (\"customer\")\n\t * - Doctype: child doctype slug (\"sales-order-item\")\n\t * - Select: choices array ([\"Draft\", \"Submitted\"])\n\t * - Decimal: \\{ precision, scale \\}\n\t * - Code: \\{ language \\}\n\t */\n\toptions: FieldOptions.optional(),\n\n\t/** Input mask pattern (e.g., \"##/##/####\" for dates) */\n\tmask: z.string().optional(),\n\n\t// === VALIDATION ===\n\n\t/** Validation configuration */\n\tvalidation: FieldValidation.optional(),\n})\n\n/**\n * Field metadata type inferred from Zod schema\n * @public\n */\nexport type FieldMeta = z.infer<typeof FieldMeta>\n","import { z } from 'zod'\n\nimport { FieldMeta } from './field'\n\n/**\n * Action definition within a workflow\n * @public\n */\nexport const ActionDefinition = z.object({\n\t/** Display label for the action */\n\tlabel: z.string().min(1),\n\n\t/** Handler function name or path */\n\thandler: z.string().min(1),\n\n\t/** Fields that must have values before action can execute */\n\trequiredFields: z.array(z.string()).optional(),\n\n\t/** Workflow states where this action is available */\n\tallowedStates: z.array(z.string()).optional(),\n\n\t/** Whether to show a confirmation dialog */\n\tconfirm: z.boolean().optional(),\n\n\t/** Additional arguments for the action */\n\targs: z.record(z.string(), z.unknown()).optional(),\n})\n\n/**\n * Action definition type inferred from Zod schema\n * @public\n */\nexport type ActionDefinition = z.infer<typeof ActionDefinition>\n\n/**\n * Workflow metadata - states and actions for a doctype\n * @public\n */\nexport const WorkflowMeta = z.object({\n\t/** List of workflow states */\n\tstates: z.array(z.string()).optional(),\n\n\t/** Actions available in this workflow */\n\tactions: z.record(z.string(), ActionDefinition).optional(),\n})\n\n/**\n * Workflow metadata type inferred from Zod schema\n * @public\n */\nexport type WorkflowMeta = z.infer<typeof WorkflowMeta>\n\n/**\n * Doctype metadata - complete definition of a doctype\n * @public\n */\nexport const DoctypeMeta = z.object({\n\t/** Display name of the doctype */\n\tname: z.string().min(1),\n\n\t/** URL-friendly slug (kebab-case) */\n\tslug: z.string().min(1).optional(),\n\n\t/** Database table name */\n\ttableName: z.string().optional(),\n\n\t/** Field definitions */\n\tfields: z.array(FieldMeta),\n\n\t/** Workflow configuration */\n\tworkflow: WorkflowMeta.optional(),\n\n\t/** Parent doctype for inheritance */\n\tinherits: z.string().optional(),\n\n\t/** Doctype to use for list views */\n\tlistDoctype: z.string().optional(),\n\n\t/** Parent doctype for child tables */\n\tparentDoctype: z.string().optional(),\n})\n\n/**\n * Doctype metadata type inferred from Zod schema\n * @public\n */\nexport type DoctypeMeta = z.infer<typeof DoctypeMeta>\n\n/**\n * Route context for identifying what doctype/record we're working with.\n * Used by graphql-middleware and graphql-client to resolve schema metadata.\n * @public\n */\nexport interface RouteContext {\n\t/** Doctype name (e.g., 'Task', 'Customer') */\n\tdoctype: string\n\t/** Optional record ID for viewing/editing a specific record */\n\trecordId?: string\n\t/** Additional context properties */\n\t[key: string]: unknown\n}\n","import { FieldMeta } from './field'\nimport { DoctypeMeta } from './doctype'\n\n/**\n * Validation error with path information\n * @public\n */\nexport interface ValidationError {\n\t/** Path to the invalid property */\n\tpath: (string | number)[]\n\n\t/** Error message */\n\tmessage: string\n}\n\n/**\n * Result of a validation operation\n * @public\n */\nexport interface ValidationResult {\n\t/** Whether validation passed */\n\tsuccess: boolean\n\n\t/** List of validation errors (empty if success) */\n\terrors: ValidationError[]\n}\n\n/**\n * Validate a field definition\n * @param data - Data to validate\n * @returns Validation result\n * @public\n */\nexport function validateField(data: unknown): ValidationResult {\n\tconst result = FieldMeta.safeParse(data)\n\n\tif (result.success) {\n\t\treturn { success: true, errors: [] }\n\t}\n\n\treturn {\n\t\tsuccess: false,\n\t\terrors: result.error.issues.map(issue => ({\n\t\t\tpath: issue.path,\n\t\t\tmessage: issue.message,\n\t\t})),\n\t}\n}\n\n/**\n * Validate a doctype definition\n * @param data - Data to validate\n * @returns Validation result\n * @public\n */\nexport function validateDoctype(data: unknown): ValidationResult {\n\tconst result = DoctypeMeta.safeParse(data)\n\n\tif (result.success) {\n\t\treturn { success: true, errors: [] }\n\t}\n\n\treturn {\n\t\tsuccess: false,\n\t\terrors: result.error.issues.map(issue => ({\n\t\t\tpath: issue.path,\n\t\t\tmessage: issue.message,\n\t\t})),\n\t}\n}\n\n/**\n * Parse and validate a field, throwing on failure\n * @param data - Data to parse\n * @returns Validated FieldMeta\n * @throws ZodError if validation fails\n * @public\n */\nexport function parseField(data: unknown): FieldMeta {\n\treturn FieldMeta.parse(data)\n}\n\n/**\n * Parse and validate a doctype, throwing on failure\n * @param data - Data to parse\n * @returns Validated DoctypeMeta\n * @throws ZodError if validation fails\n * @public\n */\nexport function parseDoctype(data: unknown): DoctypeMeta {\n\treturn DoctypeMeta.parse(data)\n}\n\n// Re-export types for convenience\nexport type { FieldMeta } from './field'\nexport type { DoctypeMeta } from './doctype'\n","/**\n * Naming Convention Utilities\n * Converts between various naming conventions (snake_case, camelCase, PascalCase, kebab-case)\n * @packageDocumentation\n */\n\n/**\n * Converts snake_case to camelCase\n * @param snakeCase - Snake case string\n * @returns Camel case string\n * @public\n * @example\n * ```typescript\n * snakeToCamel('user_email') // 'userEmail'\n * snakeToCamel('created_at') // 'createdAt'\n * ```\n */\nexport function snakeToCamel(snakeCase: string): string {\n\treturn snakeCase.replace(/_([a-z])/g, (_: string, letter: string) => letter.toUpperCase())\n}\n\n/**\n * Converts camelCase to snake_case\n * @param camelCase - Camel case string\n * @returns Snake case string\n * @public\n * @example\n * ```typescript\n * camelToSnake('userEmail') // 'user_email'\n * camelToSnake('createdAt') // 'created_at'\n * ```\n */\nexport function camelToSnake(camelCase: string): string {\n\treturn camelCase.replace(/[A-Z]/g, letter => `_${letter.toLowerCase()}`)\n}\n\n/**\n * Converts snake_case to Title Case label\n * @param snakeCase - Snake case string\n * @returns Title case label\n * @public\n * @example\n * ```typescript\n * snakeToLabel('user_email') // 'User Email'\n * snakeToLabel('first_name') // 'First Name'\n * ```\n */\nexport function snakeToLabel(snakeCase: string): string {\n\treturn snakeCase\n\t\t.split('_')\n\t\t.map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n\t\t.join(' ')\n}\n\n/**\n * Converts camelCase to Title Case label\n * @param camelCase - Camel case string\n * @returns Title case label\n * @public\n * @example\n * ```typescript\n * camelToLabel('userEmail') // 'User Email'\n * camelToLabel('firstName') // 'First Name'\n * ```\n */\nexport function camelToLabel(camelCase: string): string {\n\tconst withSpaces = camelCase.replace(/([A-Z])/g, ' $1').trim()\n\treturn withSpaces.charAt(0).toUpperCase() + withSpaces.slice(1)\n}\n\n/**\n * Convert table name to PascalCase doctype name\n * @param tableName - SQL table name (snake_case)\n * @returns PascalCase name\n * @public\n */\nexport function toPascalCase(tableName: string): string {\n\treturn tableName\n\t\t.split(/[-_\\s]+/)\n\t\t.map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n\t\t.join('')\n}\n\n/**\n * Convert to kebab-case slug\n * @param name - Name to convert\n * @returns kebab-case slug\n * @public\n */\nexport function toSlug(name: string): string {\n\treturn name\n\t\t.replace(/([a-z])([A-Z])/g, '$1-$2')\n\t\t.replace(/[\\s_]+/g, '-')\n\t\t.toLowerCase()\n}\n\n/**\n * Convert PascalCase to snake_case (e.g., for deriving table names from type names)\n * @param pascal - PascalCase string\n * @returns snake_case string\n * @public\n * @example\n * ```typescript\n * pascalToSnake('SalesOrder') // 'sales_order'\n * pascalToSnake('SalesOrderItem') // 'sales_order_item'\n * ```\n */\nexport function pascalToSnake(pascal: string): string {\n\treturn pascal\n\t\t.replace(/([a-z])([A-Z])/g, '$1_$2')\n\t\t.replace(/[\\s-]+/g, '_')\n\t\t.toLowerCase()\n}\n","/**\n * GraphQL Scalar Type Mappings\n *\n * Maps standard GraphQL scalars and well-known custom scalars to Stonecrop field types.\n * Source-agnostic — covers scalars commonly emitted by PostGraphile, Hasura, Apollo, etc.\n *\n * Users can extend these via the `customScalars` option in `GraphQLConversionOptions`.\n *\n * @packageDocumentation\n */\n\nimport type { FieldTemplate } from '../fieldtype'\n\n/**\n * Mapping from standard GraphQL scalar types to Stonecrop field types.\n * These are defined by the GraphQL specification and are always available.\n *\n * @public\n */\nexport const GQL_SCALAR_MAP: Record<string, FieldTemplate> = {\n\tString: { component: 'ATextInput', fieldtype: 'Data' },\n\tInt: { component: 'ANumericInput', fieldtype: 'Int' },\n\tFloat: { component: 'ANumericInput', fieldtype: 'Float' },\n\tBoolean: { component: 'ACheckbox', fieldtype: 'Check' },\n\tID: { component: 'ATextInput', fieldtype: 'Data' },\n}\n\n/**\n * Mapping from well-known custom GraphQL scalars to Stonecrop field types.\n * These cover scalars commonly used across GraphQL servers (PostGraphile, Hasura, etc.)\n * without baking in knowledge of any specific server.\n *\n * Entries here have lower precedence than `customScalars` from options, but higher\n * precedence than unknown/unmapped scalars.\n *\n * @public\n */\nexport const WELL_KNOWN_SCALARS: Record<string, FieldTemplate> = {\n\t// Arbitrary precision / large numbers\n\tBigFloat: { component: 'ADecimalInput', fieldtype: 'Decimal' },\n\tBigDecimal: { component: 'ADecimalInput', fieldtype: 'Decimal' },\n\tDecimal: { component: 'ADecimalInput', fieldtype: 'Decimal' },\n\tBigInt: { component: 'ANumericInput', fieldtype: 'Int' },\n\tLong: { component: 'ANumericInput', fieldtype: 'Int' },\n\n\t// Identifiers\n\tUUID: { component: 'ATextInput', fieldtype: 'Data' },\n\n\t// Date / Time\n\tDateTime: { component: 'ADatetimePicker', fieldtype: 'Datetime' },\n\tDatetime: { component: 'ADatetimePicker', fieldtype: 'Datetime' },\n\tDate: { component: 'ADatePicker', fieldtype: 'Date' },\n\tTime: { component: 'ATimeInput', fieldtype: 'Time' },\n\tInterval: { component: 'ADurationInput', fieldtype: 'Duration' },\n\tDuration: { component: 'ADurationInput', fieldtype: 'Duration' },\n\n\t// Structured data\n\tJSON: { component: 'ACodeEditor', fieldtype: 'JSON' },\n\tJSONObject: { component: 'ACodeEditor', fieldtype: 'JSON' },\n\tJsonNode: { component: 'ACodeEditor', fieldtype: 'JSON' },\n}\n\n/**\n * Set of scalar type names that are internal to GraphQL servers and should be skipped\n * during field conversion (they don't represent meaningful data fields).\n *\n * @public\n */\nexport const INTERNAL_SCALARS = new Set(['Cursor'])\n\n/**\n * Build a merged scalar map from the built-in maps and user-provided custom scalars.\n * Precedence (highest to lowest): customScalars → GQL_SCALAR_MAP → WELL_KNOWN_SCALARS\n *\n * @param customScalars - User-provided scalar overrides\n * @returns Merged scalar map\n * @public\n */\nexport function buildScalarMap(customScalars?: Record<string, Partial<FieldTemplate>>): Record<string, FieldTemplate> {\n\tconst merged: Record<string, FieldTemplate> = { ...WELL_KNOWN_SCALARS }\n\n\t// Standard scalars override well-known\n\tfor (const [key, value] of Object.entries(GQL_SCALAR_MAP)) {\n\t\tmerged[key] = value\n\t}\n\n\t// Custom scalars override everything\n\tif (customScalars) {\n\t\tfor (const [key, value] of Object.entries(customScalars)) {\n\t\t\tmerged[key] = {\n\t\t\t\tcomponent: value.component ?? 'ATextInput',\n\t\t\t\tfieldtype: value.fieldtype ?? 'Data',\n\t\t\t}\n\t\t}\n\t}\n\n\treturn merged\n}\n","/**\n * Default heuristics for identifying entity types and fields in a GraphQL schema.\n *\n * These heuristics work across common GraphQL servers (PostGraphile, Hasura, Apollo, etc.)\n * by detecting widely-adopted conventions like the Relay connection pattern.\n *\n * All heuristics can be overridden via the `isEntityType`, `isEntityField`, and\n * `classifyField` options in `GraphQLConversionOptions`.\n *\n * @packageDocumentation\n */\n\nimport {\n\tisScalarType,\n\tisEnumType,\n\tisObjectType,\n\tisListType,\n\tisNonNullType,\n\ttype GraphQLObjectType,\n\ttype GraphQLField,\n\ttype GraphQLOutputType,\n\ttype GraphQLNamedType,\n} from 'graphql'\n\nimport type { FieldTemplate } from '../fieldtype'\nimport type { GraphQLConversionFieldMeta, GraphQLConversionOptions } from './types'\nimport { buildScalarMap, INTERNAL_SCALARS } from './scalars'\nimport { toSlug, camelToLabel } from '../naming'\n\n/**\n * Suffixes that identify synthetic/framework types generated by GraphQL servers.\n * Types ending with these suffixes are typically not entities.\n */\nconst SYNTHETIC_SUFFIXES = [\n\t'Connection',\n\t'Edge',\n\t'Input',\n\t'Patch',\n\t'Payload',\n\t'Condition',\n\t'Filter',\n\t'OrderBy',\n\t'Aggregate',\n\t'AggregateResult',\n\t'AggregateFilter',\n\t'DeleteResponse',\n\t'InsertResponse',\n\t'UpdateResponse',\n\t'MutationResponse',\n]\n\n/**\n * Root operation type names that are never entities.\n */\nconst ROOT_TYPE_NAMES = new Set(['Query', 'Mutation', 'Subscription'])\n\n/**\n * Default heuristic to determine if a GraphQL object type represents an entity.\n * An entity type becomes a Stonecrop doctype.\n *\n * This heuristic excludes:\n * - Introspection types (`__*`)\n * - Root operation types (`Query`, `Mutation`, `Subscription`)\n * - Types with synthetic suffixes (e.g., `*Connection`, `*Edge`, `*Input`)\n * - Types starting with `Node` interface marker (exact match only)\n *\n * @param typeName - The GraphQL type name\n * @param type - The GraphQL object type definition\n * @returns `true` if this type should become a Stonecrop doctype\n * @public\n */\nexport function defaultIsEntityType(typeName: string, type: GraphQLObjectType): boolean {\n\t// Exclude introspection types\n\tif (typeName.startsWith('__')) {\n\t\treturn false\n\t}\n\n\t// Exclude root operation types\n\tif (ROOT_TYPE_NAMES.has(typeName)) {\n\t\treturn false\n\t}\n\n\t// Exclude the Node interface marker type\n\tif (typeName === 'Node') {\n\t\treturn false\n\t}\n\n\t// Exclude types matching synthetic suffixes\n\tfor (const suffix of SYNTHETIC_SUFFIXES) {\n\t\tif (typeName.endsWith(suffix)) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t// Must have at least one field\n\tconst fields = type.getFields()\n\tif (Object.keys(fields).length === 0) {\n\t\treturn false\n\t}\n\n\treturn true\n}\n\n/**\n * Fields to skip by default on entity types.\n * These are internal to GraphQL servers and don't represent semantic data.\n */\nconst SKIP_FIELDS = new Set(['nodeId', '__typename', 'clientMutationId'])\n\n/**\n * Default heuristic to filter fields on entity types.\n * Skips internal fields that don't represent meaningful data.\n *\n * @param fieldName - The GraphQL field name\n * @param _field - The GraphQL field definition (unused in default implementation)\n * @param _parentType - The parent entity type (unused in default implementation)\n * @returns `true` if this field should be included\n * @public\n */\nexport function defaultIsEntityField(\n\tfieldName: string,\n\t_field: GraphQLField<unknown, unknown>,\n\t_parentType: GraphQLObjectType\n): boolean {\n\treturn !SKIP_FIELDS.has(fieldName)\n}\n\n/**\n * Unwrap NonNull and List wrappers from a GraphQL type, tracking nullability.\n *\n * @param type - The GraphQL output type\n * @returns The unwrapped named type, whether it's required, and whether it's a list\n * @internal\n */\nfunction unwrapType(type: GraphQLOutputType): {\n\tnamedType: GraphQLNamedType\n\trequired: boolean\n\tisList: boolean\n} {\n\tlet required = false\n\tlet isList = false\n\tlet current: GraphQLOutputType = type\n\n\t// Unwrap outer NonNull\n\tif (isNonNullType(current)) {\n\t\trequired = true\n\t\tcurrent = current.ofType\n\t}\n\n\t// Unwrap List\n\tif (isListType(current)) {\n\t\tisList = true\n\t\tcurrent = current.ofType\n\n\t\t// Unwrap inner NonNull (e.g., [Type!])\n\t\tif (isNonNullType(current)) {\n\t\t\tcurrent = current.ofType\n\t\t}\n\t}\n\n\t// At this point, current should be a named type\n\treturn { namedType: current as GraphQLNamedType, required, isList }\n}\n\n/**\n * Check if a GraphQL object type looks like a Relay Connection type.\n * A connection type has an `edges` field returning a list of edge types,\n * where each edge has a `node` field.\n *\n * @param type - The GraphQL object type to check\n * @returns The node type name if this is a connection, or `undefined`\n * @internal\n */\nfunction getConnectionNodeType(type: GraphQLObjectType): string | undefined {\n\tconst fields = type.getFields()\n\n\t// Must have an 'edges' field\n\tconst edgesField = fields['edges']\n\tif (!edgesField) return undefined\n\n\t// edges must be a list\n\tconst { namedType: edgesType, isList: edgesIsList } = unwrapType(edgesField.type)\n\tif (!edgesIsList || !isObjectType(edgesType)) return undefined\n\n\t// Each edge must have a 'node' field\n\tconst edgeFields = edgesType.getFields()\n\tconst nodeField = edgeFields['node']\n\tif (!nodeField) return undefined\n\n\tconst { namedType: nodeType } = unwrapType(nodeField.type)\n\tif (!isObjectType(nodeType)) return undefined\n\n\treturn nodeType.name\n}\n\n/**\n * Classify a single GraphQL field into a Stonecrop field definition.\n *\n * Classification rules (in order):\n * 1. Scalar types → look up in merged scalar map\n * 2. Enum types → `Select` with enum values as options\n * 3. Object types that are entities → `Link` with slug as options\n * 4. Object types that are Connections → `Doctype` with node type slug as options\n * 5. List of entity type → `Doctype` with item type slug as options\n * 6. Anything else → `Data` with `_unmapped: true`\n *\n * @param fieldName - The GraphQL field name\n * @param field - The GraphQL field definition\n * @param entityTypes - Set of type names classified as entities\n * @param options - Conversion options (for custom scalars, unmapped meta, etc.)\n * @returns The Stonecrop field definition\n * @public\n */\nexport function classifyFieldType(\n\tfieldName: string,\n\tfield: GraphQLField<unknown, unknown>,\n\tentityTypes: Set<string>,\n\toptions: GraphQLConversionOptions = {}\n): GraphQLConversionFieldMeta {\n\tconst { namedType, required, isList } = unwrapType(field.type)\n\tconst scalarMap = buildScalarMap(options.customScalars)\n\n\tconst base: GraphQLConversionFieldMeta = {\n\t\tfieldname: fieldName,\n\t\tlabel: camelToLabel(fieldName),\n\t\tcomponent: 'ATextInput',\n\t\tfieldtype: 'Data',\n\t}\n\n\tif (required) {\n\t\tbase.required = true\n\t}\n\n\t// 1. Scalar types\n\tif (isScalarType(namedType)) {\n\t\t// Skip internal scalars (e.g., Cursor)\n\t\tif (INTERNAL_SCALARS.has(namedType.name)) {\n\t\t\tbase._unmapped = true\n\t\t\tif (options.includeUnmappedMeta) {\n\t\t\t\tbase._graphqlType = namedType.name\n\t\t\t}\n\t\t\treturn base\n\t\t}\n\n\t\tconst template: FieldTemplate | undefined = scalarMap[namedType.name]\n\t\tif (template) {\n\t\t\tbase.component = template.component\n\t\t\tbase.fieldtype = template.fieldtype\n\t\t} else {\n\t\t\t// Unknown scalar — default to Data with unmapped marker\n\t\t\tbase._unmapped = true\n\t\t\tif (options.includeUnmappedMeta) {\n\t\t\t\tbase._graphqlType = namedType.name\n\t\t\t}\n\t\t}\n\t\treturn base\n\t}\n\n\t// 2. Enum types → Select\n\tif (isEnumType(namedType)) {\n\t\tbase.component = 'ADropdown'\n\t\tbase.fieldtype = 'Select'\n\t\tbase.options = namedType.getValues().map(v => v.name)\n\t\treturn base\n\t}\n\n\t// 3–5. Object types\n\tif (isObjectType(namedType)) {\n\t\t// 3. Direct reference to an entity type → Link\n\t\tif (!isList && entityTypes.has(namedType.name)) {\n\t\t\tbase.component = 'ALink'\n\t\t\tbase.fieldtype = 'Link'\n\t\t\tbase.options = toSlug(namedType.name)\n\t\t\treturn base\n\t\t}\n\n\t\t// 4. Connection type → Doctype (child table)\n\t\tconst connectionNodeTypeName = getConnectionNodeType(namedType)\n\t\tif (connectionNodeTypeName && entityTypes.has(connectionNodeTypeName)) {\n\t\t\tbase.component = 'ATable'\n\t\t\tbase.fieldtype = 'Doctype'\n\t\t\tbase.options = toSlug(connectionNodeTypeName)\n\t\t\treturn base\n\t\t}\n\n\t\t// 5. List of entity type → Doctype\n\t\tif (isList && entityTypes.has(namedType.name)) {\n\t\t\tbase.component = 'ATable'\n\t\t\tbase.fieldtype = 'Doctype'\n\t\t\tbase.options = toSlug(namedType.name)\n\t\t\treturn base\n\t\t}\n\n\t\t// Unknown object type — mark as unmapped\n\t\tbase._unmapped = true\n\t\tif (options.includeUnmappedMeta) {\n\t\t\tbase._graphqlType = namedType.name\n\t\t}\n\t\treturn base\n\t}\n\n\t// Fallback — shouldn't normally be reached\n\tbase._unmapped = true\n\tif (options.includeUnmappedMeta) {\n\t\tbase._graphqlType = namedType.name\n\t}\n\treturn base\n}\n","/**\n * GraphQL Introspection to Stonecrop Schema Converter\n *\n * Converts a standard GraphQL introspection result (or SDL string) into\n * Stonecrop doctype schemas. Source-agnostic — works with any GraphQL server.\n *\n * @packageDocumentation\n */\n\nimport { buildClientSchema, buildSchema, isObjectType, type GraphQLSchema } from 'graphql'\n\nimport { toSlug, pascalToSnake } from '../naming'\nimport type { IntrospectionSource, GraphQLConversionOptions, ConvertedGraphQLDoctype } from './types'\nimport { defaultIsEntityType, defaultIsEntityField, classifyFieldType } from './heuristics'\n\n/**\n * Convert a GraphQL schema to Stonecrop doctype schemas.\n *\n * Accepts either an `IntrospectionQuery` result object or an SDL string.\n * Entity types are identified using heuristics (or a custom `isEntityType` function)\n * and converted to `DoctypeMeta`-compatible JSON objects.\n *\n * @param source - GraphQL introspection result or SDL string\n * @param options - Conversion options for controlling output format and behavior\n * @returns Array of converted Stonecrop doctype definitions\n *\n * @example\n * ```typescript\n * // From introspection result (fetched from any GraphQL server)\n * const introspection = await fetchIntrospection('http://localhost:5000/graphql')\n * const doctypes = convertGraphQLSchema(introspection)\n *\n * // From SDL string\n * const sdl = fs.readFileSync('schema.graphql', 'utf-8')\n * const doctypes = convertGraphQLSchema(sdl)\n *\n * // With PostGraphile custom scalars\n * const doctypes = convertGraphQLSchema(introspection, {\n * customScalars: {\n * BigFloat: { component: 'ADecimalInput', fieldtype: 'Decimal' }\n * }\n * })\n * ```\n *\n * @public\n */\nexport function convertGraphQLSchema(\n\tsource: IntrospectionSource,\n\toptions: GraphQLConversionOptions = {}\n): ConvertedGraphQLDoctype[] {\n\tconst schema = buildGraphQLSchema(source)\n\tconst typeMap = schema.getTypeMap()\n\n\t// Determine the root operation type names to exclude\n\tconst rootTypeNames = new Set<string>()\n\tconst queryType = schema.getQueryType()\n\tconst mutationType = schema.getMutationType()\n\tconst subscriptionType = schema.getSubscriptionType()\n\tif (queryType) rootTypeNames.add(queryType.name)\n\tif (mutationType) rootTypeNames.add(mutationType.name)\n\tif (subscriptionType) rootTypeNames.add(subscriptionType.name)\n\n\t// Use custom or default entity type detector\n\tconst isEntityType = options.isEntityType ?? defaultIsEntityType\n\n\t// Phase 1: Identify all entity types\n\tconst entityTypes = new Set<string>()\n\tfor (const [typeName, type] of Object.entries(typeMap)) {\n\t\tif (!isObjectType(type)) continue\n\n\t\t// Always skip root operation types (even if custom isEntityType doesn't)\n\t\tif (rootTypeNames.has(typeName)) continue\n\n\t\tif (isEntityType(typeName, type)) {\n\t\t\tentityTypes.add(typeName)\n\t\t}\n\t}\n\n\t// Phase 2: Apply include/exclude filters\n\tlet filteredEntityTypes = entityTypes\n\n\tif (options.include) {\n\t\tconst includeSet = new Set(options.include)\n\t\tfilteredEntityTypes = new Set([...entityTypes].filter(t => includeSet.has(t)))\n\t}\n\n\tif (options.exclude) {\n\t\tconst excludeSet = new Set(options.exclude)\n\t\tfilteredEntityTypes = new Set([...filteredEntityTypes].filter(t => !excludeSet.has(t)))\n\t}\n\n\t// Phase 3: Convert each entity type to a doctype\n\tconst isEntityField = options.isEntityField ?? defaultIsEntityField\n\tconst deriveTableName = options.deriveTableName ?? ((typeName: string) => pascalToSnake(typeName))\n\n\tconst doctypes: ConvertedGraphQLDoctype[] = []\n\n\tfor (const typeName of filteredEntityTypes) {\n\t\tconst type = typeMap[typeName]\n\t\tif (!isObjectType(type)) continue\n\n\t\tconst fields = type.getFields()\n\t\tconst typeOverrides = options.typeOverrides?.[typeName]\n\n\t\tconst convertedFields = Object.entries(fields)\n\t\t\t.filter(([fieldName, field]) => isEntityField(fieldName, field, type))\n\t\t\t.map(([fieldName, field]) => {\n\t\t\t\t// Check for full custom classification first\n\t\t\t\tif (options.classifyField) {\n\t\t\t\t\tconst custom = options.classifyField(fieldName, field, type)\n\t\t\t\t\tif (custom !== null && custom !== undefined) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tfieldname: fieldName,\n\t\t\t\t\t\t\tlabel: custom.label ?? fieldName,\n\t\t\t\t\t\t\tcomponent: custom.component ?? 'ATextInput',\n\t\t\t\t\t\t\tfieldtype: custom.fieldtype ?? 'Data',\n\t\t\t\t\t\t\t...custom,\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Default classification\n\t\t\t\tconst classified = classifyFieldType(fieldName, field, entityTypes, options)\n\n\t\t\t\t// Apply per-field overrides\n\t\t\t\tif (typeOverrides?.[fieldName]) {\n\t\t\t\t\treturn { ...classified, ...typeOverrides[fieldName] }\n\t\t\t\t}\n\n\t\t\t\treturn classified\n\t\t\t})\n\t\t\t// Clean up internal metadata unless requested\n\t\t\t.map(field => {\n\t\t\t\tif (!options.includeUnmappedMeta) {\n\t\t\t\t\tconst { _graphqlType, _unmapped, ...clean } = field\n\t\t\t\t\treturn clean\n\t\t\t\t}\n\t\t\t\treturn field\n\t\t\t})\n\n\t\tconst doctype: ConvertedGraphQLDoctype = {\n\t\t\tname: typeName,\n\t\t\tslug: toSlug(typeName),\n\t\t\tfields: convertedFields,\n\t\t}\n\n\t\tconst tableName = deriveTableName(typeName)\n\t\tif (tableName) {\n\t\t\tdoctype.tableName = tableName\n\t\t}\n\n\t\tif (options.includeUnmappedMeta) {\n\t\t\tdoctype._graphqlTypeName = typeName\n\t\t}\n\n\t\tdoctypes.push(doctype)\n\t}\n\n\treturn doctypes\n}\n\n/**\n * Build a GraphQLSchema from either an introspection result or SDL string.\n *\n * @param source - IntrospectionQuery object or SDL string\n * @returns A complete GraphQLSchema\n * @internal\n */\nfunction buildGraphQLSchema(source: IntrospectionSource): GraphQLSchema {\n\tif (typeof source === 'string') {\n\t\t// SDL string\n\t\treturn buildSchema(source)\n\t}\n\n\t// IntrospectionQuery result\n\treturn buildClientSchema(source)\n}\n\n// ═══════════════════════════════════════════════════════════════\n// Re-exports\n// ═══════════════════════════════════════════════════════════════\n\n// Main converter (this file)\nexport { convertGraphQLSchema as default }\n\n// Types\nexport type {\n\tIntrospectionSource,\n\tGraphQLConversionOptions,\n\tGraphQLConversionFieldMeta,\n\tConvertedGraphQLDoctype,\n} from './types'\n\n// Scalar maps\nexport { GQL_SCALAR_MAP, WELL_KNOWN_SCALARS, INTERNAL_SCALARS, buildScalarMap } from './scalars'\n\n// Heuristics\nexport { defaultIsEntityType, defaultIsEntityField, classifyFieldType } from './heuristics'\n\n// Naming utilities\nexport { toSlug, toPascalCase, pascalToSnake, snakeToCamel, camelToSnake, snakeToLabel, camelToLabel } from '../naming'\n"],"names":["StonecropFieldType","z","TYPE_MAP","getDefaultComponent","fieldtype","FieldOptions","FieldValidation","FieldMeta","ActionDefinition","WorkflowMeta","DoctypeMeta","validateField","data","result","issue","validateDoctype","parseField","parseDoctype","snakeToCamel","snakeCase","_","letter","camelToSnake","camelCase","snakeToLabel","word","camelToLabel","withSpaces","toPascalCase","tableName","toSlug","name","pascalToSnake","pascal","GQL_SCALAR_MAP","WELL_KNOWN_SCALARS","INTERNAL_SCALARS","buildScalarMap","customScalars","merged","key","value","SYNTHETIC_SUFFIXES","ROOT_TYPE_NAMES","defaultIsEntityType","typeName","type","suffix","fields","SKIP_FIELDS","defaultIsEntityField","fieldName","_field","_parentType","unwrapType","required","isList","current","isNonNullType","isListType","getConnectionNodeType","edgesField","edgesType","edgesIsList","isObjectType","nodeField","nodeType","classifyFieldType","field","entityTypes","options","namedType","scalarMap","base","isScalarType","template","isEnumType","v","connectionNodeTypeName","convertGraphQLSchema","source","schema","buildGraphQLSchema","typeMap","rootTypeNames","queryType","mutationType","subscriptionType","isEntityType","filteredEntityTypes","includeSet","t","excludeSet","isEntityField","deriveTableName","doctypes","typeOverrides","convertedFields","custom","classified","_graphqlType","_unmapped","clean","doctype","buildSchema","buildClientSchema"],"mappings":"yDAOaA,EAAqBC,EAAAA,EAAE,KAAK,CACxC,OACA,OACA,MACA,QACA,UACA,QACA,OACA,OACA,WACA,WACA,YACA,OACA,OACA,OACA,UACA,SACA,WACA,WACA,QACD,CAAC,EA6BYC,EAAsD,CAElE,KAAM,CAAE,UAAW,aAAc,UAAW,MAAA,EAC5C,KAAM,CAAE,UAAW,aAAc,UAAW,MAAA,EAG5C,IAAK,CAAE,UAAW,gBAAiB,UAAW,KAAA,EAC9C,MAAO,CAAE,UAAW,gBAAiB,UAAW,OAAA,EAChD,QAAS,CAAE,UAAW,gBAAiB,UAAW,SAAA,EAGlD,MAAO,CAAE,UAAW,YAAa,UAAW,OAAA,EAG5C,KAAM,CAAE,UAAW,cAAe,UAAW,MAAA,EAC7C,KAAM,CAAE,UAAW,aAAc,UAAW,MAAA,EAC5C,SAAU,CAAE,UAAW,kBAAmB,UAAW,UAAA,EACrD,SAAU,CAAE,UAAW,iBAAkB,UAAW,UAAA,EACpD,UAA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EA,IAAI/B,GAAS,CACb,GAAI,CAACE,EAAQ,oBAAqB,CACjC,KAAM,CAAE,aAAA8B,EAAc,UAAAC,EAAW,GAAGC,GAAUlC,EAC9C,OAAOkC,CACR,CACA,OAAOlC,CACR,CAAC,EAEImC,EAAmC,CACxC,KAAM1D,EACN,KAAMf,EAAOe,CAAQ,EACrB,OAAQoD,CAAA,EAGHpE,EAAYiE,EAAgBjD,CAAQ,EACtChB,IACH0E,EAAQ,UAAY1E,GAGjByC,EAAQ,sBACXiC,EAAQ,iBAAmB1D,GAG5BkD,EAAS,KAAKQ,CAAO,CACtB,CAEA,OAAOR,CACR,CASA,SAASb,GAAmBF,EAA4C,CACvE,OAAI,OAAOA,GAAW,SAEdwB,EAAAA,YAAYxB,CAAM,EAInByB,EAAAA,kBAAkBzB,CAAM,CAChC"}
package/dist/index.cjs DELETED
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-aeXXzPET.cjs");exports.ActionDefinition=e.ActionDefinition;exports.DoctypeMeta=e.DoctypeMeta;exports.FieldMeta=e.FieldMeta;exports.FieldOptions=e.FieldOptions;exports.FieldValidation=e.FieldValidation;exports.GQL_SCALAR_MAP=e.GQL_SCALAR_MAP;exports.INTERNAL_SCALARS=e.INTERNAL_SCALARS;exports.StonecropFieldType=e.StonecropFieldType;exports.TYPE_MAP=e.TYPE_MAP;exports.WELL_KNOWN_SCALARS=e.WELL_KNOWN_SCALARS;exports.WorkflowMeta=e.WorkflowMeta;exports.buildScalarMap=e.buildScalarMap;exports.camelToLabel=e.camelToLabel;exports.camelToSnake=e.camelToSnake;exports.classifyFieldType=e.classifyFieldType;exports.convertGraphQLSchema=e.convertGraphQLSchema;exports.defaultIsEntityField=e.defaultIsEntityField;exports.defaultIsEntityType=e.defaultIsEntityType;exports.getDefaultComponent=e.getDefaultComponent;exports.parseDoctype=e.parseDoctype;exports.parseField=e.parseField;exports.pascalToSnake=e.pascalToSnake;exports.snakeToCamel=e.snakeToCamel;exports.snakeToLabel=e.snakeToLabel;exports.toPascalCase=e.toPascalCase;exports.toSlug=e.toSlug;exports.validateDoctype=e.validateDoctype;exports.validateField=e.validateField;
2
- //# sourceMappingURL=index.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}