@stonecrop/graphql-middleware 0.8.8 → 0.8.10

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.
@@ -0,0 +1,330 @@
1
+ import { extendSchema, gql } from 'postgraphile/utils';
2
+ import { constant, lambda, object, loadOne } from 'postgraphile/grafast';
3
+ import pluralize from 'pluralize';
4
+ import { snakeToCamel, toPascalCase } from '@stonecrop/schema';
5
+ import { getHandler } from '../registry/actions';
6
+ import { getMeta, getAllMeta } from '../registry/doctypes';
7
+ /**
8
+ * Create a PostGraphile plugin that extends the GraphQL schema with Stonecrop functionality
9
+ * @param options - Plugin configuration options
10
+ * @returns A PostGraphile plugin
11
+ * @public
12
+ */
13
+ export const createStonecropPlugin = (options) => {
14
+ // Resolve inflection callbacks with Amber defaults
15
+ const recordFieldName = options.inflection?.recordFieldName ?? defaultRecordFieldName;
16
+ const connectionFieldName = options.inflection?.connectionFieldName ?? defaultConnectionFieldName;
17
+ const orderByTypeName = options.inflection?.orderByTypeName ?? defaultOrderByTypeName;
18
+ return extendSchema(() => {
19
+ return {
20
+ typeDefs: gql `
21
+ type StonecropFieldMeta {
22
+ fieldname: String!
23
+ fieldtype: String!
24
+ label: String
25
+ required: Boolean
26
+ options: JSON
27
+ }
28
+
29
+ type StonecropActionDefinition {
30
+ label: String!
31
+ handler: String!
32
+ requiredFields: [String!]
33
+ allowedStates: [String!]
34
+ confirm: Boolean
35
+ args: JSON
36
+ }
37
+
38
+ type StonecropWorkflowMeta {
39
+ states: [String!]
40
+ actions: JSON
41
+ }
42
+
43
+ type StonecropDoctypeMeta {
44
+ name: String!
45
+ tableName: String
46
+ fields: [StonecropFieldMeta!]!
47
+ workflow: StonecropWorkflowMeta
48
+ listDoctype: String
49
+ parentDoctype: String
50
+ }
51
+
52
+ type StonecropRecordResult {
53
+ data: JSON
54
+ doctype: String!
55
+ }
56
+
57
+ type StonecropRecordsResult {
58
+ data: [JSON!]!
59
+ doctype: String!
60
+ count: Int!
61
+ }
62
+
63
+ type StonecropActionResult {
64
+ success: Boolean!
65
+ data: JSON
66
+ error: String
67
+ }
68
+
69
+ extend type Query {
70
+ stonecropMeta(doctype: String!): StonecropDoctypeMeta
71
+ stonecropAllMeta: [StonecropDoctypeMeta!]!
72
+ stonecropRecord(doctype: String!, id: String!): StonecropRecordResult
73
+ stonecropRecords(
74
+ doctype: String!
75
+ filters: JSON
76
+ orderBy: String
77
+ limit: Int
78
+ offset: Int
79
+ ): StonecropRecordsResult
80
+ }
81
+
82
+ extend type Mutation {
83
+ stonecropAction(doctype: String!, action: String!, args: JSON): StonecropActionResult!
84
+ }
85
+ `,
86
+ objects: {
87
+ Query: {
88
+ plans: {
89
+ stonecropMeta(_, { $doctype }) {
90
+ return lambda($doctype, (doctype) => {
91
+ const meta = getMeta(doctype);
92
+ return meta ?? null;
93
+ });
94
+ },
95
+ stonecropAllMeta() {
96
+ return constant(getAllMeta());
97
+ },
98
+ stonecropRecord(_, { $doctype, $id }) {
99
+ return loadOne(object({ doctype: $doctype, id: $id }), async (specs) => {
100
+ return await Promise.all(specs.map(async (spec) => {
101
+ const meta = getMeta(spec.doctype);
102
+ if (!meta) {
103
+ throw new Error(`Unknown doctype: ${spec.doctype}`);
104
+ }
105
+ if (!meta.tableName) {
106
+ throw new Error(`Doctype ${spec.doctype} has no table mapping`);
107
+ }
108
+ const query = buildRecordQuery(meta, recordFieldName);
109
+ const result = await options.executor.query(query, { id: spec.id });
110
+ return {
111
+ data: extractSingleResult(result, meta, recordFieldName),
112
+ doctype: spec.doctype,
113
+ };
114
+ }));
115
+ });
116
+ },
117
+ stonecropRecords(_, { $doctype, $filters, $orderBy, $limit, $offset }) {
118
+ return loadOne(object({
119
+ doctype: $doctype,
120
+ filters: $filters,
121
+ orderBy: $orderBy,
122
+ limit: $limit,
123
+ offset: $offset,
124
+ }), async (specs) => {
125
+ return await Promise.all(specs.map(async (spec) => {
126
+ const meta = getMeta(spec.doctype);
127
+ if (!meta) {
128
+ throw new Error(`Unknown doctype: ${spec.doctype}`);
129
+ }
130
+ if (!meta.tableName) {
131
+ throw new Error(`Doctype ${spec.doctype} has no table mapping`);
132
+ }
133
+ const query = buildListQuery(meta, {
134
+ limit: spec.limit,
135
+ offset: spec.offset,
136
+ orderBy: spec.orderBy,
137
+ }, connectionFieldName, orderByTypeName);
138
+ const result = await options.executor.query(query, {
139
+ limit: spec.limit,
140
+ offset: spec.offset,
141
+ orderBy: spec.orderBy,
142
+ });
143
+ const data = extractListResult(result, meta, connectionFieldName);
144
+ return {
145
+ data,
146
+ doctype: spec.doctype,
147
+ count: data.length,
148
+ };
149
+ }));
150
+ });
151
+ },
152
+ },
153
+ },
154
+ Mutation: {
155
+ plans: {
156
+ stonecropAction(_, { $doctype, $action, $args: $actionArgs }) {
157
+ return loadOne(object({
158
+ doctype: $doctype,
159
+ action: $action,
160
+ actionArgs: $actionArgs,
161
+ }), async (specs) => {
162
+ return await Promise.all(specs.map(async (spec) => {
163
+ const meta = getMeta(spec.doctype);
164
+ if (!meta) {
165
+ return {
166
+ success: false,
167
+ data: null,
168
+ error: `Unknown doctype: ${spec.doctype}`,
169
+ };
170
+ }
171
+ const actionDef = meta.workflow?.actions?.[spec.action];
172
+ if (!actionDef) {
173
+ return {
174
+ success: false,
175
+ data: null,
176
+ error: `Unknown action: ${spec.action} on ${spec.doctype}`,
177
+ };
178
+ }
179
+ const handler = getHandler(actionDef.handler);
180
+ if (!handler) {
181
+ return {
182
+ success: false,
183
+ data: null,
184
+ error: `Handler not registered: ${actionDef.handler}`,
185
+ };
186
+ }
187
+ const actionContext = {
188
+ doctype: meta,
189
+ executor: options.executor,
190
+ };
191
+ try {
192
+ const result = await handler(spec.actionArgs ?? [], actionContext);
193
+ return {
194
+ success: true,
195
+ data: result,
196
+ error: null,
197
+ };
198
+ }
199
+ catch (err) {
200
+ return {
201
+ success: false,
202
+ data: null,
203
+ error: err instanceof Error ? err.message : String(err),
204
+ };
205
+ }
206
+ }));
207
+ });
208
+ },
209
+ },
210
+ },
211
+ },
212
+ };
213
+ });
214
+ };
215
+ // =============================================================================
216
+ // Inflection helpers — default to PostGraphile Amber preset conventions
217
+ // Uses `pluralize` for proper English singularization (handles irregular
218
+ // plurals like statuses→status, categories→category, addresses→address).
219
+ // snakeToCamel / toPascalCase are imported from @stonecrop/schema.
220
+ // =============================================================================
221
+ /**
222
+ * Amber default: sales_orders → salesOrderById
223
+ * Uses `pluralize` for proper singularization of irregular plurals.
224
+ * Override via `StonecropInflectionConfig.recordFieldName` for non-standard PK columns.
225
+ * @internal
226
+ */
227
+ function defaultRecordFieldName(tableName) {
228
+ const singular = pluralize.singular(tableName);
229
+ return `${snakeToCamel(singular)}ById`;
230
+ }
231
+ /**
232
+ * Amber default: sales_orders → allSalesOrders
233
+ * @internal
234
+ */
235
+ function defaultConnectionFieldName(tableName) {
236
+ return `all${toPascalCase(tableName)}`;
237
+ }
238
+ /**
239
+ * Amber default: sales_orders → SalesOrdersOrderBy
240
+ * @internal
241
+ */
242
+ function defaultOrderByTypeName(tableName) {
243
+ return `${toPascalCase(tableName)}OrderBy`;
244
+ }
245
+ // =============================================================================
246
+ // Query builders — generate GraphQL queries to send to the underlying schema
247
+ // =============================================================================
248
+ /**
249
+ * Fieldtypes that map to GraphQL object/connection types and require sub-selections.
250
+ * These fields are excluded from generated query field selections.
251
+ * @internal
252
+ */
253
+ const RELATION_FIELDTYPES = new Set(['Link', 'Doctype']);
254
+ /**
255
+ * Filter fields to only those directly queryable as scalars, excluding Link and Doctype
256
+ * relation fields that require GraphQL sub-selections.
257
+ * @internal
258
+ */
259
+ function queryableFieldNames(meta) {
260
+ return meta.fields
261
+ .filter(f => !RELATION_FIELDTYPES.has(f.fieldtype))
262
+ .map(f => f.fieldname)
263
+ .join('\n ');
264
+ }
265
+ /**
266
+ * Build a GraphQL query to fetch a single record by ID.
267
+ * Excludes Link and Doctype relation fields from the selection set.
268
+ * @internal
269
+ */
270
+ function buildRecordQuery(meta, recordFieldName) {
271
+ const fieldNames = queryableFieldNames(meta);
272
+ const queryName = recordFieldName(meta.tableName);
273
+ return `
274
+ query GetRecord($id: UUID!) {
275
+ ${queryName}(id: $id) {
276
+ ${fieldNames}
277
+ }
278
+ }
279
+ `;
280
+ }
281
+ /**
282
+ * Build a GraphQL connection query to fetch a list of records.
283
+ * Only declares variables ($limit, $offset, $orderBy) that are actually used in the query,
284
+ * avoiding GraphQL spec §5.8.3 violations from unused variable declarations.
285
+ * Excludes Link and Doctype relation fields from the selection set.
286
+ * @internal
287
+ */
288
+ function buildListQuery(meta, args, connectionFieldName, orderByTypeName) {
289
+ const fieldNames = queryableFieldNames(meta);
290
+ const connectionName = connectionFieldName(meta.tableName);
291
+ const orderByType = orderByTypeName(meta.tableName);
292
+ const varDecls = [];
293
+ const queryArgs = [];
294
+ if (args.limit) {
295
+ varDecls.push('$limit: Int');
296
+ queryArgs.push(`first: $limit`);
297
+ }
298
+ if (args.offset) {
299
+ varDecls.push('$offset: Int');
300
+ queryArgs.push(`offset: $offset`);
301
+ }
302
+ if (args.orderBy) {
303
+ varDecls.push(`$orderBy: [${orderByType}!]`);
304
+ queryArgs.push(`orderBy: $orderBy`);
305
+ }
306
+ const varStr = varDecls.length > 0 ? `(${varDecls.join(', ')})` : '';
307
+ const argsStr = queryArgs.length > 0 ? `(${queryArgs.join(', ')})` : '';
308
+ return `
309
+ query GetRecords${varStr} {
310
+ ${connectionName}${argsStr} {
311
+ nodes {
312
+ ${fieldNames}
313
+ }
314
+ }
315
+ }
316
+ `;
317
+ }
318
+ function extractSingleResult(result, meta, recordFieldName) {
319
+ const queryName = recordFieldName(meta.tableName);
320
+ return result[queryName];
321
+ }
322
+ function extractListResult(result, meta, connectionFieldName) {
323
+ const connectionName = connectionFieldName(meta.tableName);
324
+ const connection = result[connectionName];
325
+ return connection?.nodes ?? [];
326
+ }
327
+ // =============================================================================
328
+ // Exported for testing and advanced usage
329
+ // =============================================================================
330
+ export { defaultRecordFieldName, defaultConnectionFieldName, defaultOrderByTypeName, buildRecordQuery, buildListQuery, queryableFieldNames, RELATION_FIELDTYPES, };
@@ -1,4 +1,4 @@
1
- import { ActionHandler } from '../types';
1
+ import type { ActionHandler } from '../types';
2
2
  /**
3
3
  * Register an action handler
4
4
  * @param name - Unique name for the action handler
@@ -0,0 +1,148 @@
1
+ const handlerRegistry = new Map();
2
+ /**
3
+ * Register an action handler
4
+ * @param name - Unique name for the action handler
5
+ * @param handler - Action handler function to register
6
+ * @public
7
+ */
8
+ export function registerHandler(name, handler) {
9
+ handlerRegistry.set(name, handler);
10
+ }
11
+ /**
12
+ * Get a registered handler by name
13
+ * @param name - Name of the action handler to retrieve
14
+ * @public
15
+ */
16
+ export function getHandler(name) {
17
+ return handlerRegistry.get(name);
18
+ }
19
+ /**
20
+ * Check if a handler is registered
21
+ * @param name - Name of the action handler to check
22
+ * @public
23
+ */
24
+ export function hasHandler(name) {
25
+ return handlerRegistry.has(name);
26
+ }
27
+ /**
28
+ * Clear all registered handlers
29
+ * @public
30
+ */
31
+ export function clearHandlers() {
32
+ handlerRegistry.clear();
33
+ }
34
+ // =============================================================================
35
+ // Built-in Handlers
36
+ // =============================================================================
37
+ /**
38
+ * Validate that all required fields are present in a record
39
+ */
40
+ const validateRequiredFields = async (args, context) => {
41
+ const [record] = args;
42
+ const { doctype } = context;
43
+ const missing = [];
44
+ for (const field of doctype.fields) {
45
+ if (field.required && (record[field.fieldname] === undefined || record[field.fieldname] === null)) {
46
+ missing.push(field.label ?? field.fieldname);
47
+ }
48
+ }
49
+ if (missing.length > 0) {
50
+ throw new Error(`Missing required fields: ${missing.join(', ')}`);
51
+ }
52
+ return { valid: true };
53
+ };
54
+ /**
55
+ * Validate field types match expected types
56
+ */
57
+ const validateFieldTypes = async (args, context) => {
58
+ const [record] = args;
59
+ const { doctype } = context;
60
+ const errors = [];
61
+ for (const field of doctype.fields) {
62
+ const value = record[field.fieldname];
63
+ if (value === undefined || value === null)
64
+ continue;
65
+ const error = validateFieldValue(field.fieldname, value, field.fieldtype);
66
+ if (error)
67
+ errors.push(error);
68
+ }
69
+ if (errors.length > 0) {
70
+ throw new Error(`Field type validation failed:\n${errors.join('\n')}`);
71
+ }
72
+ return { valid: true };
73
+ };
74
+ /**
75
+ * Validate a single field value against its expected type
76
+ */
77
+ function validateFieldValue(fieldname, value, fieldtype) {
78
+ switch (fieldtype) {
79
+ case 'Int':
80
+ if (typeof value !== 'number' || !Number.isInteger(value)) {
81
+ return `${fieldname}: expected integer, got ${typeof value}`;
82
+ }
83
+ break;
84
+ case 'Float':
85
+ case 'Decimal':
86
+ case 'Currency':
87
+ case 'Quantity':
88
+ if (typeof value !== 'number' && typeof value !== 'string') {
89
+ return `${fieldname}: expected number, got ${typeof value}`;
90
+ }
91
+ break;
92
+ case 'Check':
93
+ if (typeof value !== 'boolean') {
94
+ return `${fieldname}: expected boolean, got ${typeof value}`;
95
+ }
96
+ break;
97
+ case 'Data':
98
+ case 'Text':
99
+ case 'Code':
100
+ case 'Link':
101
+ if (typeof value !== 'string') {
102
+ return `${fieldname}: expected string, got ${typeof value}`;
103
+ }
104
+ break;
105
+ case 'Date':
106
+ case 'Time':
107
+ case 'Datetime':
108
+ if (typeof value !== 'string' && !(value instanceof Date)) {
109
+ return `${fieldname}: expected date string or Date, got ${typeof value}`;
110
+ }
111
+ break;
112
+ case 'JSON':
113
+ if (typeof value !== 'object') {
114
+ return `${fieldname}: expected object, got ${typeof value}`;
115
+ }
116
+ break;
117
+ case 'Table':
118
+ if (!Array.isArray(value)) {
119
+ return `${fieldname}: expected array, got ${typeof value}`;
120
+ }
121
+ break;
122
+ }
123
+ return null;
124
+ }
125
+ /**
126
+ * No-op handler for testing or placeholder actions
127
+ */
128
+ const noop = async () => {
129
+ return { ok: true };
130
+ };
131
+ /**
132
+ * Built-in handlers available for registration
133
+ * @public
134
+ */
135
+ export const builtinHandlers = {
136
+ validateRequiredFields,
137
+ validateFieldTypes,
138
+ noop,
139
+ };
140
+ /**
141
+ * Register all built-in handlers
142
+ * @public
143
+ */
144
+ export function registerBuiltinHandlers() {
145
+ for (const [name, handler] of Object.entries(builtinHandlers)) {
146
+ registerHandler(name, handler);
147
+ }
148
+ }
@@ -1,4 +1,4 @@
1
- import { DoctypeMeta, ValidationError } from '../types';
1
+ import type { DoctypeMeta, ValidationError } from '../types';
2
2
  /**
3
3
  * Error thrown when a doctype definition fails validation
4
4
  * @public
@@ -0,0 +1,167 @@
1
+ import { readFileSync, readdirSync, statSync } from 'node:fs';
2
+ import { join } from 'node:path';
3
+ import { parseDoctype, validateDoctype } from '../types';
4
+ const doctypeRegistry = new Map();
5
+ /**
6
+ * Error thrown when a doctype definition fails validation
7
+ * @public
8
+ */
9
+ export class DoctypeValidationError extends Error {
10
+ file;
11
+ errors;
12
+ constructor(
13
+ /** File path or name where the validation error occurred */
14
+ file,
15
+ /** List of validation errors found */
16
+ errors) {
17
+ const errorMessages = errors.map(e => ` ${e.path.join('.')}: ${e.message}`).join('\n');
18
+ super(`Invalid doctype definition in ${file}:\n${errorMessages}`);
19
+ this.file = file;
20
+ this.errors = errors;
21
+ this.name = 'DoctypeValidationError';
22
+ }
23
+ }
24
+ /**
25
+ * Load doctype definitions from a directory of JSON files
26
+ * @param dir - Directory path containing doctype JSON files
27
+ * @param options - Options for loading doctypes (continueOnError, onError callback)
28
+ * @public
29
+ */
30
+ export function loadDoctypes(dir, options = {}) {
31
+ const entries = readdirSync(dir);
32
+ for (const entry of entries) {
33
+ const fullPath = join(dir, entry);
34
+ const stat = statSync(fullPath);
35
+ if (stat.isDirectory()) {
36
+ loadDoctypes(fullPath, options);
37
+ }
38
+ else if (entry.endsWith('.json')) {
39
+ loadDoctypeFile(fullPath, options);
40
+ }
41
+ }
42
+ }
43
+ /**
44
+ * Load and validate a single doctype file
45
+ */
46
+ function loadDoctypeFile(filePath, options) {
47
+ const content = readFileSync(filePath, 'utf-8');
48
+ let data;
49
+ try {
50
+ data = JSON.parse(content);
51
+ }
52
+ catch (err) {
53
+ const parseError = {
54
+ path: [],
55
+ message: `Invalid JSON: ${err instanceof Error ? err.message : String(err)}`,
56
+ };
57
+ if (options.continueOnError) {
58
+ options.onError?.(filePath, [parseError]);
59
+ return;
60
+ }
61
+ throw new DoctypeValidationError(filePath, [parseError]);
62
+ }
63
+ const result = validateDoctype(data);
64
+ if (!result.success) {
65
+ if (options.continueOnError) {
66
+ options.onError?.(filePath, result.errors);
67
+ return;
68
+ }
69
+ throw new DoctypeValidationError(filePath, result.errors);
70
+ }
71
+ const doctype = parseDoctype(data);
72
+ doctypeRegistry.set(doctype.name, doctype);
73
+ }
74
+ /**
75
+ * Load doctypes from an object (for programmatic use)
76
+ * @param doctypes - Object mapping doctype names to doctype definitions
77
+ * @param options - Options for loading doctypes (continueOnError, onError callback)
78
+ * @public
79
+ */
80
+ export function loadDoctypesFromObject(doctypes, options = {}) {
81
+ for (const [name, data] of Object.entries(doctypes)) {
82
+ const withName = { ...data, name };
83
+ const result = validateDoctype(withName);
84
+ if (!result.success) {
85
+ if (options.continueOnError) {
86
+ options.onError?.(name, result.errors);
87
+ continue;
88
+ }
89
+ throw new DoctypeValidationError(name, result.errors);
90
+ }
91
+ const doctype = parseDoctype(withName);
92
+ doctypeRegistry.set(doctype.name, doctype);
93
+ }
94
+ }
95
+ /**
96
+ * Get a doctype by name
97
+ * @param name - Name of the doctype to retrieve
98
+ * @public
99
+ */
100
+ export function getMeta(name) {
101
+ return doctypeRegistry.get(name);
102
+ }
103
+ /**
104
+ * Get all loaded doctypes
105
+ * @public
106
+ */
107
+ export function getAllMeta() {
108
+ return Array.from(doctypeRegistry.values());
109
+ }
110
+ /**
111
+ * Check if a doctype is registered
112
+ * @param name - Name of the doctype to check
113
+ * @public
114
+ */
115
+ export function hasMeta(name) {
116
+ return doctypeRegistry.has(name);
117
+ }
118
+ /**
119
+ * Clear all registered doctypes
120
+ * @public
121
+ */
122
+ export function clearRegistry() {
123
+ doctypeRegistry.clear();
124
+ }
125
+ /**
126
+ * Validate cross-doctype references (Link fields, inherits, etc.)
127
+ * Call after all doctypes are loaded.
128
+ * @public
129
+ */
130
+ export function validateReferences() {
131
+ const errors = [];
132
+ for (const doctype of doctypeRegistry.values()) {
133
+ // Check inherits reference
134
+ if (doctype.inherits && !doctypeRegistry.has(doctype.inherits)) {
135
+ errors.push({
136
+ path: [doctype.name, 'inherits'],
137
+ message: `References unknown doctype: ${doctype.inherits}`,
138
+ });
139
+ }
140
+ // Check listDoctype reference
141
+ if (doctype.listDoctype && !doctypeRegistry.has(doctype.listDoctype)) {
142
+ errors.push({
143
+ path: [doctype.name, 'listDoctype'],
144
+ message: `References unknown doctype: ${doctype.listDoctype}`,
145
+ });
146
+ }
147
+ // Check parentDoctype reference
148
+ if (doctype.parentDoctype && !doctypeRegistry.has(doctype.parentDoctype)) {
149
+ errors.push({
150
+ path: [doctype.name, 'parentDoctype'],
151
+ message: `References unknown doctype: ${doctype.parentDoctype}`,
152
+ });
153
+ }
154
+ // Check Link field targets
155
+ for (const field of doctype.fields) {
156
+ if (field.fieldtype === 'Link' && typeof field.options === 'string') {
157
+ if (!doctypeRegistry.has(field.options)) {
158
+ errors.push({
159
+ path: [doctype.name, 'fields', field.fieldname, 'options'],
160
+ message: `Link references unknown doctype: ${field.options}`,
161
+ });
162
+ }
163
+ }
164
+ }
165
+ }
166
+ return errors;
167
+ }
@@ -0,0 +1,11 @@
1
+ // This file is read by tools that parse documentation comments conforming to the TSDoc standard.
2
+ // It should be published with your NPM package. It should not be tracked by Git.
3
+ {
4
+ "tsdocVersion": "0.12",
5
+ "toolPackages": [
6
+ {
7
+ "packageName": "@microsoft/api-extractor",
8
+ "packageVersion": "7.57.0"
9
+ }
10
+ ]
11
+ }
@@ -1,6 +1,6 @@
1
- import { DoctypeMeta } from '@stonecrop/schema';
2
1
  export { StonecropFieldType, FieldOptions, FieldMeta, ActionDefinition, WorkflowMeta, DoctypeMeta, validateDoctype, validateField, parseDoctype, parseField, } from '@stonecrop/schema';
3
2
  export type { ValidationResult, ValidationError, IntrospectionSource, GraphQLConversionOptions, GraphQLConversionFieldMeta, ConvertedGraphQLDoctype, } from '@stonecrop/schema';
3
+ import type { DoctypeMeta } from '@stonecrop/schema';
4
4
  /**
5
5
  * Route context for identifying what doctype/record we're working with
6
6
  * @public
@@ -0,0 +1,2 @@
1
+ // Re-export all schema types from @stonecrop/schema for backward compatibility
2
+ export { StonecropFieldType, FieldOptions, FieldMeta, ActionDefinition, WorkflowMeta, DoctypeMeta, validateDoctype, validateField, parseDoctype, parseField, } from '@stonecrop/schema';
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=query-builders.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-builders.test.d.ts","sourceRoot":"","sources":["../../tests/query-builders.test.ts"],"names":[],"mappings":""}