@stonecrop/schema 0.10.15 → 0.11.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 +87 -26
- package/dist/cli.cjs +41 -0
- package/dist/cli.cjs.map +1 -0
- package/dist/cli.js +1 -1
- package/dist/converter/heuristics.js +8 -6
- package/dist/converter/index.js +20 -3
- package/dist/converter-DNwpowpq.js +459 -0
- package/dist/converter-DNwpowpq.js.map +1 -0
- package/dist/doctype.js +90 -5
- package/dist/field.js +5 -3
- package/dist/fieldtype.js +0 -2
- package/dist/index-0qWNlDQ5.js +450 -0
- package/dist/index-0qWNlDQ5.js.map +1 -0
- package/dist/index-2UVTfbcY.js +448 -0
- package/dist/index-2UVTfbcY.js.map +1 -0
- package/dist/index-9QjWZ_PC.js +449 -0
- package/dist/index-9QjWZ_PC.js.map +1 -0
- package/dist/index-BCADNO5M.js +449 -0
- package/dist/index-BCADNO5M.js.map +1 -0
- package/dist/index-BRQJGVFR.js +453 -0
- package/dist/index-BRQJGVFR.js.map +1 -0
- package/dist/index-BatnoC-J.js +429 -0
- package/dist/index-BatnoC-J.js.map +1 -0
- package/dist/index-BhMd2_xl.js +454 -0
- package/dist/index-BhMd2_xl.js.map +1 -0
- package/dist/index-CLc5mUMQ.js +478 -0
- package/dist/index-CLc5mUMQ.js.map +1 -0
- package/dist/index-COrltkHl.js +401 -0
- package/dist/index-COrltkHl.js.map +1 -0
- package/dist/index-CvN9xK1B.js +453 -0
- package/dist/index-CvN9xK1B.js.map +1 -0
- package/dist/index-CzoRIy1-.js +408 -0
- package/dist/index-CzoRIy1-.js.map +1 -0
- package/dist/index-DIb_Z0wI.js +476 -0
- package/dist/index-DIb_Z0wI.js.map +1 -0
- package/dist/index-DNROIEMe.js +449 -0
- package/dist/index-DNROIEMe.js.map +1 -0
- package/dist/index-DUFcQC-H.js +449 -0
- package/dist/index-DUFcQC-H.js.map +1 -0
- package/dist/index-DmD8vmuB.js +449 -0
- package/dist/index-DmD8vmuB.js.map +1 -0
- package/dist/index-XZZbfFxT.js +434 -0
- package/dist/index-XZZbfFxT.js.map +1 -0
- package/dist/index-aeXXzPET.cjs +2 -0
- package/dist/index-aeXXzPET.cjs.map +1 -0
- package/dist/index-neVkjlgB.js +446 -0
- package/dist/index-neVkjlgB.js.map +1 -0
- package/dist/index-xdlVWldg.js +408 -0
- package/dist/index-xdlVWldg.js.map +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.js +23 -29
- package/dist/jsonschema.js +225 -0
- package/dist/schema.d.ts +206 -35
- package/dist/src/cli.js +210 -0
- package/dist/src/converter/heuristics.d.ts.map +1 -1
- package/dist/src/converter/heuristics.js +256 -0
- package/dist/src/converter/index.d.ts.map +1 -1
- package/dist/src/converter/index.js +164 -0
- package/dist/src/converter/scalars.js +86 -0
- package/dist/src/converter/types.d.ts +2 -0
- package/dist/src/converter/types.d.ts.map +1 -1
- package/dist/src/converter/types.js +5 -0
- package/dist/src/doctype.d.ts +176 -12
- package/dist/src/doctype.d.ts.map +1 -1
- package/dist/src/doctype.js +67 -0
- package/dist/src/field.d.ts +3 -2
- package/dist/src/field.d.ts.map +1 -1
- package/dist/src/field.js +108 -0
- package/dist/src/fieldtype.d.ts +0 -1
- package/dist/src/fieldtype.d.ts.map +1 -1
- package/dist/src/fieldtype.js +75 -0
- package/dist/src/index.d.ts +5 -9
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +12 -0
- package/dist/src/jsonschema.d.ts +95 -0
- package/dist/src/jsonschema.d.ts.map +1 -0
- package/dist/src/naming.js +106 -0
- package/dist/src/tsdoc-metadata.json +11 -0
- package/dist/src/validation.js +60 -0
- package/package.json +1 -1
package/dist/src/doctype.d.ts
CHANGED
|
@@ -1,4 +1,115 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Cardinality for relationship links.
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export declare const Cardinality: z.ZodEnum<{
|
|
7
|
+
one: "one";
|
|
8
|
+
atMostOne: "atMostOne";
|
|
9
|
+
noneOrMany: "noneOrMany";
|
|
10
|
+
atLeastOne: "atLeastOne";
|
|
11
|
+
}>;
|
|
12
|
+
/**
|
|
13
|
+
* Cardinality type inferred from Zod schema
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
export type Cardinality = z.infer<typeof Cardinality>;
|
|
17
|
+
/**
|
|
18
|
+
* Serialized function type - a function serialized to a string.
|
|
19
|
+
* Used for custom fetch handlers.
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
22
|
+
export type SerializedFunction = string;
|
|
23
|
+
/**
|
|
24
|
+
* Sync fetch strategy - data is fetched in the initial query.
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
27
|
+
export declare const SyncFetch: z.ZodObject<{
|
|
28
|
+
method: z.ZodLiteral<"sync">;
|
|
29
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
/**
|
|
32
|
+
* Sync fetch strategy type
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
35
|
+
export type SyncFetch = z.infer<typeof SyncFetch>;
|
|
36
|
+
/**
|
|
37
|
+
* Lazy fetch strategy - data is fetched on demand in a separate query.
|
|
38
|
+
* @public
|
|
39
|
+
*/
|
|
40
|
+
export declare const LazyFetch: z.ZodObject<{
|
|
41
|
+
method: z.ZodLiteral<"lazy">;
|
|
42
|
+
}, z.core.$strip>;
|
|
43
|
+
/**
|
|
44
|
+
* Lazy fetch strategy type
|
|
45
|
+
* @public
|
|
46
|
+
*/
|
|
47
|
+
export type LazyFetch = z.infer<typeof LazyFetch>;
|
|
48
|
+
/**
|
|
49
|
+
* Custom fetch strategy - uses a custom handler function.
|
|
50
|
+
* @public
|
|
51
|
+
*/
|
|
52
|
+
export declare const CustomFetch: z.ZodObject<{
|
|
53
|
+
method: z.ZodLiteral<"custom">;
|
|
54
|
+
handler: z.ZodString;
|
|
55
|
+
}, z.core.$strip>;
|
|
56
|
+
/**
|
|
57
|
+
* Custom fetch strategy type
|
|
58
|
+
* @public
|
|
59
|
+
*/
|
|
60
|
+
export type CustomFetch = z.infer<typeof CustomFetch>;
|
|
61
|
+
/**
|
|
62
|
+
* Fetch strategy for link data loading.
|
|
63
|
+
* - sync: fetched in the initial query
|
|
64
|
+
* - lazy: fetched on demand in a separate query
|
|
65
|
+
* - custom: uses a custom handler function
|
|
66
|
+
* @public
|
|
67
|
+
*/
|
|
68
|
+
export declare const FetchStrategy: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
69
|
+
method: z.ZodLiteral<"sync">;
|
|
70
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
71
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
72
|
+
method: z.ZodLiteral<"lazy">;
|
|
73
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
74
|
+
method: z.ZodLiteral<"custom">;
|
|
75
|
+
handler: z.ZodString;
|
|
76
|
+
}, z.core.$strip>], "method">;
|
|
77
|
+
/**
|
|
78
|
+
* Fetch strategy type
|
|
79
|
+
* @public
|
|
80
|
+
*/
|
|
81
|
+
export type FetchStrategy = z.infer<typeof FetchStrategy>;
|
|
82
|
+
/**
|
|
83
|
+
* Link declaration - describes a relationship from one doctype to another.
|
|
84
|
+
* @public
|
|
85
|
+
*/
|
|
86
|
+
export declare const LinkDeclaration: z.ZodObject<{
|
|
87
|
+
target: z.ZodString;
|
|
88
|
+
cardinality: z.ZodEnum<{
|
|
89
|
+
one: "one";
|
|
90
|
+
atMostOne: "atMostOne";
|
|
91
|
+
noneOrMany: "noneOrMany";
|
|
92
|
+
atLeastOne: "atLeastOne";
|
|
93
|
+
}>;
|
|
94
|
+
backlink: z.ZodOptional<z.ZodString>;
|
|
95
|
+
component: z.ZodOptional<z.ZodString>;
|
|
96
|
+
fieldname: z.ZodOptional<z.ZodString>;
|
|
97
|
+
fetch: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
98
|
+
method: z.ZodLiteral<"sync">;
|
|
99
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
100
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
101
|
+
method: z.ZodLiteral<"lazy">;
|
|
102
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
103
|
+
method: z.ZodLiteral<"custom">;
|
|
104
|
+
handler: z.ZodString;
|
|
105
|
+
}, z.core.$strip>], "method">>;
|
|
106
|
+
blockWorkflows: z.ZodOptional<z.ZodBoolean>;
|
|
107
|
+
}, z.core.$strip>;
|
|
108
|
+
/**
|
|
109
|
+
* Link declaration type inferred from Zod schema
|
|
110
|
+
* @public
|
|
111
|
+
*/
|
|
112
|
+
export type LinkDeclaration = z.infer<typeof LinkDeclaration>;
|
|
2
113
|
/**
|
|
3
114
|
* Action definition within a workflow
|
|
4
115
|
* @public
|
|
@@ -61,7 +172,6 @@ export declare const DoctypeMeta: z.ZodObject<{
|
|
|
61
172
|
JSON: "JSON";
|
|
62
173
|
Code: "Code";
|
|
63
174
|
Link: "Link";
|
|
64
|
-
Doctype: "Doctype";
|
|
65
175
|
Attach: "Attach";
|
|
66
176
|
Currency: "Currency";
|
|
67
177
|
Quantity: "Quantity";
|
|
@@ -86,13 +196,37 @@ export declare const DoctypeMeta: z.ZodObject<{
|
|
|
86
196
|
options: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
|
|
87
197
|
cardinality: z.ZodOptional<z.ZodEnum<{
|
|
88
198
|
one: "one";
|
|
89
|
-
|
|
199
|
+
atMostOne: "atMostOne";
|
|
200
|
+
noneOrMany: "noneOrMany";
|
|
201
|
+
atLeastOne: "atLeastOne";
|
|
90
202
|
}>>;
|
|
91
203
|
mask: z.ZodOptional<z.ZodString>;
|
|
92
204
|
validation: z.ZodOptional<z.ZodObject<{
|
|
93
205
|
errorMessage: z.ZodString;
|
|
94
206
|
}, z.core.$loose>>;
|
|
95
207
|
}, z.core.$strip>>;
|
|
208
|
+
links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
209
|
+
target: z.ZodString;
|
|
210
|
+
cardinality: z.ZodEnum<{
|
|
211
|
+
one: "one";
|
|
212
|
+
atMostOne: "atMostOne";
|
|
213
|
+
noneOrMany: "noneOrMany";
|
|
214
|
+
atLeastOne: "atLeastOne";
|
|
215
|
+
}>;
|
|
216
|
+
backlink: z.ZodOptional<z.ZodString>;
|
|
217
|
+
component: z.ZodOptional<z.ZodString>;
|
|
218
|
+
fieldname: z.ZodOptional<z.ZodString>;
|
|
219
|
+
fetch: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
220
|
+
method: z.ZodLiteral<"sync">;
|
|
221
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
222
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
223
|
+
method: z.ZodLiteral<"lazy">;
|
|
224
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
225
|
+
method: z.ZodLiteral<"custom">;
|
|
226
|
+
handler: z.ZodString;
|
|
227
|
+
}, z.core.$strip>], "method">>;
|
|
228
|
+
blockWorkflows: z.ZodOptional<z.ZodBoolean>;
|
|
229
|
+
}, z.core.$strip>>>;
|
|
96
230
|
workflow: z.ZodOptional<z.ZodObject<{
|
|
97
231
|
states: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
98
232
|
actions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
@@ -105,8 +239,6 @@ export declare const DoctypeMeta: z.ZodObject<{
|
|
|
105
239
|
}, z.core.$strip>>>;
|
|
106
240
|
}, z.core.$strip>>;
|
|
107
241
|
inherits: z.ZodOptional<z.ZodString>;
|
|
108
|
-
listDoctype: z.ZodOptional<z.ZodString>;
|
|
109
|
-
parentDoctype: z.ZodOptional<z.ZodString>;
|
|
110
242
|
}, z.core.$strip>;
|
|
111
243
|
/**
|
|
112
244
|
* Doctype metadata type inferred from Zod schema
|
|
@@ -137,6 +269,38 @@ export interface DoctypeRef {
|
|
|
137
269
|
/** URL-friendly slug (e.g., 'task', 'customer') */
|
|
138
270
|
slug?: string;
|
|
139
271
|
}
|
|
272
|
+
/**
|
|
273
|
+
* Options for fetching a single record
|
|
274
|
+
* @public
|
|
275
|
+
*/
|
|
276
|
+
export interface GetRecordOptions {
|
|
277
|
+
/**
|
|
278
|
+
* Include nested link sub-selections.
|
|
279
|
+
* - `true`: include all descendant links
|
|
280
|
+
* - `string[]`: include only named links
|
|
281
|
+
* - `false` / omitted: scalar fields only (default)
|
|
282
|
+
*/
|
|
283
|
+
includeNested?: boolean | string[];
|
|
284
|
+
/**
|
|
285
|
+
* Maximum depth for recursive sub-selections.
|
|
286
|
+
* No default — unlimited when omitted.
|
|
287
|
+
*/
|
|
288
|
+
maxDepth?: number;
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Options for fetching multiple records
|
|
292
|
+
* @public
|
|
293
|
+
*/
|
|
294
|
+
export interface GetRecordsOptions {
|
|
295
|
+
/** Filter expression (field-value pairs) */
|
|
296
|
+
filters?: Record<string, unknown>;
|
|
297
|
+
/** Order by expression (e.g. 'NAME_ASC') */
|
|
298
|
+
orderBy?: string;
|
|
299
|
+
/** Maximum number of records to return */
|
|
300
|
+
limit?: number;
|
|
301
|
+
/** Number of records to skip */
|
|
302
|
+
offset?: number;
|
|
303
|
+
}
|
|
140
304
|
/**
|
|
141
305
|
* Interface for data clients that fetch doctype metadata and records.
|
|
142
306
|
* Implemented by \@stonecrop/graphql-client's StonecropClient.
|
|
@@ -155,23 +319,23 @@ export interface DataClient<T extends DoctypeRef = DoctypeRef, M = DoctypeMeta>
|
|
|
155
319
|
getMeta(context: DoctypeContext): Promise<M | null>;
|
|
156
320
|
/**
|
|
157
321
|
* Fetch a single record by ID
|
|
322
|
+
*
|
|
323
|
+
* When `includeNested` is set, builds a query with sub-selections for descendant
|
|
324
|
+
* links and returns ancestor + merged descendants. When omitted, returns flat scalar data.
|
|
325
|
+
*
|
|
158
326
|
* @param doctype - Doctype reference (name and optional slug)
|
|
159
327
|
* @param recordId - Record ID to fetch
|
|
328
|
+
* @param options - Query options
|
|
160
329
|
* @returns Record data or null if not found
|
|
161
330
|
*/
|
|
162
|
-
getRecord(doctype: T, recordId: string): Promise<Record<string, unknown> | null>;
|
|
331
|
+
getRecord(doctype: T, recordId: string, options?: GetRecordOptions): Promise<Record<string, unknown> | null>;
|
|
163
332
|
/**
|
|
164
333
|
* Fetch multiple records
|
|
165
334
|
* @param doctype - Doctype reference (name and optional slug)
|
|
166
|
-
* @param options -
|
|
335
|
+
* @param options - Query options
|
|
167
336
|
* @returns Array of record data
|
|
168
337
|
*/
|
|
169
|
-
getRecords(doctype: T, options?:
|
|
170
|
-
filters?: Record<string, unknown>;
|
|
171
|
-
orderBy?: string;
|
|
172
|
-
limit?: number;
|
|
173
|
-
offset?: number;
|
|
174
|
-
}): Promise<Record<string, unknown>[]>;
|
|
338
|
+
getRecords(doctype: T, options?: GetRecordsOptions): Promise<Record<string, unknown>[]>;
|
|
175
339
|
/**
|
|
176
340
|
* Execute a doctype action (e.g., SUBMIT, APPROVE, save).
|
|
177
341
|
* All state changes flow through this single mutation endpoint.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctype.d.ts","sourceRoot":"","sources":["../../src/doctype.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;;;;iBAuB1B,CAAA;AAEH;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAE/D;;;GAGG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;iBAWtB,CAAA;AAEH;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAA;AAEvD;;;GAGG;AACH,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"doctype.d.ts","sourceRoot":"","sources":["../../src/doctype.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { FieldMeta } from './field';
|
|
3
|
+
/**
|
|
4
|
+
* Action definition within a workflow
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export const ActionDefinition = z
|
|
8
|
+
.object({
|
|
9
|
+
/** Display label for the action */
|
|
10
|
+
label: z.string().min(1),
|
|
11
|
+
/** Handler function name or path */
|
|
12
|
+
handler: z.string().min(1),
|
|
13
|
+
/** Fields that must have values before action can execute */
|
|
14
|
+
requiredFields: z.array(z.string()).optional(),
|
|
15
|
+
/** Workflow states where this action is available */
|
|
16
|
+
allowedStates: z.array(z.string()).optional(),
|
|
17
|
+
/** Whether to show a confirmation dialog */
|
|
18
|
+
confirm: z.boolean().optional(),
|
|
19
|
+
/** Additional arguments for the action */
|
|
20
|
+
args: z.record(z.string(), z.unknown()).optional(),
|
|
21
|
+
})
|
|
22
|
+
.meta({
|
|
23
|
+
title: 'ActionDefinition',
|
|
24
|
+
description: 'Action definition within a workflow',
|
|
25
|
+
});
|
|
26
|
+
/**
|
|
27
|
+
* Workflow metadata - states and actions for a doctype
|
|
28
|
+
* @public
|
|
29
|
+
*/
|
|
30
|
+
export const WorkflowMeta = z
|
|
31
|
+
.object({
|
|
32
|
+
/** List of workflow states */
|
|
33
|
+
states: z.array(z.string()).optional(),
|
|
34
|
+
/** Actions available in this workflow */
|
|
35
|
+
actions: z.record(z.string(), ActionDefinition).optional(),
|
|
36
|
+
})
|
|
37
|
+
.meta({
|
|
38
|
+
title: 'WorkflowMeta',
|
|
39
|
+
description: 'Workflow metadata - states and actions for a doctype',
|
|
40
|
+
});
|
|
41
|
+
/**
|
|
42
|
+
* Doctype metadata - complete definition of a doctype
|
|
43
|
+
* @public
|
|
44
|
+
*/
|
|
45
|
+
export const DoctypeMeta = z
|
|
46
|
+
.object({
|
|
47
|
+
/** Display name of the doctype */
|
|
48
|
+
name: z.string().min(1),
|
|
49
|
+
/** URL-friendly slug (kebab-case) */
|
|
50
|
+
slug: z.string().min(1).optional(),
|
|
51
|
+
/** Database table name */
|
|
52
|
+
tableName: z.string().optional(),
|
|
53
|
+
/** Field definitions */
|
|
54
|
+
fields: z.array(FieldMeta),
|
|
55
|
+
/** Workflow configuration */
|
|
56
|
+
workflow: WorkflowMeta.optional(),
|
|
57
|
+
/** Parent doctype for inheritance */
|
|
58
|
+
inherits: z.string().optional(),
|
|
59
|
+
/** Doctype to use for list views */
|
|
60
|
+
listDoctype: z.string().optional(),
|
|
61
|
+
/** Parent doctype for child tables */
|
|
62
|
+
parentDoctype: z.string().optional(),
|
|
63
|
+
})
|
|
64
|
+
.meta({
|
|
65
|
+
title: 'DoctypeMeta',
|
|
66
|
+
description: 'Doctype metadata - complete definition of a doctype',
|
|
67
|
+
});
|
package/dist/src/field.d.ts
CHANGED
|
@@ -54,7 +54,6 @@ export declare const FieldMeta: z.ZodObject<{
|
|
|
54
54
|
JSON: "JSON";
|
|
55
55
|
Code: "Code";
|
|
56
56
|
Link: "Link";
|
|
57
|
-
Doctype: "Doctype";
|
|
58
57
|
Attach: "Attach";
|
|
59
58
|
Currency: "Currency";
|
|
60
59
|
Quantity: "Quantity";
|
|
@@ -79,7 +78,9 @@ export declare const FieldMeta: z.ZodObject<{
|
|
|
79
78
|
options: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
|
|
80
79
|
cardinality: z.ZodOptional<z.ZodEnum<{
|
|
81
80
|
one: "one";
|
|
82
|
-
|
|
81
|
+
atMostOne: "atMostOne";
|
|
82
|
+
noneOrMany: "noneOrMany";
|
|
83
|
+
atLeastOne: "atLeastOne";
|
|
83
84
|
}>>;
|
|
84
85
|
mask: z.ZodOptional<z.ZodString>;
|
|
85
86
|
validation: z.ZodOptional<z.ZodObject<{
|
package/dist/src/field.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../src/field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,qGAStB,CAAA;AAEH;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAA;AAEvD;;;GAGG;AACH,eAAO,MAAM,eAAe;IAE1B,qDAAqD;;iBAMpD,CAAA;AAEH;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAA;AAE7D;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../src/field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,qGAStB,CAAA;AAEH;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAA;AAEvD;;;GAGG;AACH,eAAO,MAAM,eAAe;IAE1B,qDAAqD;;iBAMpD,CAAA;AAEH;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAA;AAE7D;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAtBpB,qDAAqD;;;iBA8GpD,CAAA;AAEH;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAA"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { StonecropFieldType } from './fieldtype';
|
|
3
|
+
/**
|
|
4
|
+
* Field options - flexible bag for type-specific configuration.
|
|
5
|
+
*
|
|
6
|
+
* Usage by fieldtype:
|
|
7
|
+
* - Link/Doctype: target doctype slug as string ("customer", "sales-order-item")
|
|
8
|
+
* - Select: array of choices (["Draft", "Submitted", "Cancelled"])
|
|
9
|
+
* - Decimal: config object (\{ precision: 10, scale: 2 \})
|
|
10
|
+
* - Code: config object (\{ language: "python" \})
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export const FieldOptions = z
|
|
15
|
+
.union([
|
|
16
|
+
z.string(), // Link/Doctype target: "customer"
|
|
17
|
+
z.array(z.string()), // Select choices: ["A", "B", "C"]
|
|
18
|
+
z.record(z.string(), z.unknown()), // Config: \{ precision: 10, scale: 2 \}
|
|
19
|
+
])
|
|
20
|
+
.meta({
|
|
21
|
+
title: 'FieldOptions',
|
|
22
|
+
description: 'Field options - flexible bag for type-specific configuration',
|
|
23
|
+
});
|
|
24
|
+
/**
|
|
25
|
+
* Validation configuration for form fields
|
|
26
|
+
* @public
|
|
27
|
+
*/
|
|
28
|
+
export const FieldValidation = z
|
|
29
|
+
.looseObject({
|
|
30
|
+
/** Error message to display when validation fails */
|
|
31
|
+
errorMessage: z.string(),
|
|
32
|
+
})
|
|
33
|
+
.meta({
|
|
34
|
+
title: 'FieldValidation',
|
|
35
|
+
description: 'Validation configuration for form fields',
|
|
36
|
+
});
|
|
37
|
+
/**
|
|
38
|
+
* Unified field metadata - the single source of truth for field definitions.
|
|
39
|
+
* Works for both forms (AForm) and tables (ATable).
|
|
40
|
+
*
|
|
41
|
+
* Core principle: "Text" is "Text" regardless of rendering context.
|
|
42
|
+
*
|
|
43
|
+
* @public
|
|
44
|
+
*/
|
|
45
|
+
export const FieldMeta = z
|
|
46
|
+
.object({
|
|
47
|
+
// === CORE (required) ===
|
|
48
|
+
/** Unique identifier for the field within its doctype */
|
|
49
|
+
fieldname: z.string().min(1),
|
|
50
|
+
/** Semantic field type - determines behavior and default component */
|
|
51
|
+
fieldtype: StonecropFieldType,
|
|
52
|
+
// === COMPONENT (optional - derived from fieldtype when not specified) ===
|
|
53
|
+
/** Vue component to render this field. If not specified, derived from TYPE_MAP */
|
|
54
|
+
component: z.string().optional(),
|
|
55
|
+
// === DISPLAY ===
|
|
56
|
+
/** Human-readable label for the field */
|
|
57
|
+
label: z.string().optional(),
|
|
58
|
+
/** Width of the field (CSS value, e.g., "40ch", "200px") */
|
|
59
|
+
width: z.string().optional(),
|
|
60
|
+
/** Text alignment within the field */
|
|
61
|
+
align: z.enum(['left', 'center', 'right', 'start', 'end']).optional(),
|
|
62
|
+
// === BEHAVIOR ===
|
|
63
|
+
/** Whether the field is required */
|
|
64
|
+
required: z.boolean().optional(),
|
|
65
|
+
/** Whether the field is read-only */
|
|
66
|
+
readOnly: z.boolean().optional(),
|
|
67
|
+
/** Whether the field is editable (for table cells) */
|
|
68
|
+
edit: z.boolean().optional(),
|
|
69
|
+
/** Whether the field is hidden from the UI */
|
|
70
|
+
hidden: z.boolean().optional(),
|
|
71
|
+
// === VALUE ===
|
|
72
|
+
/** Current value of the field */
|
|
73
|
+
value: z.unknown().optional(),
|
|
74
|
+
/** Default value for new records */
|
|
75
|
+
default: z.unknown().optional(),
|
|
76
|
+
// === TYPE-SPECIFIC ===
|
|
77
|
+
/**
|
|
78
|
+
* Type-specific options:
|
|
79
|
+
* - Link: target doctype slug ("customer")
|
|
80
|
+
* - Doctype: child doctype slug ("sales-order-item")
|
|
81
|
+
* - Select: choices array (["Draft", "Submitted"])
|
|
82
|
+
* - Decimal: \{ precision, scale \}
|
|
83
|
+
* - Code: \{ language \}
|
|
84
|
+
*/
|
|
85
|
+
options: FieldOptions.optional(),
|
|
86
|
+
/**
|
|
87
|
+
* Cardinality for Doctype fields:
|
|
88
|
+
* - 'one': 1:1 nested form (default)
|
|
89
|
+
* - 'many': 1:many child table
|
|
90
|
+
*/
|
|
91
|
+
cardinality: z.enum(['one', 'many']).optional(),
|
|
92
|
+
/**
|
|
93
|
+
* Input mask pattern. Accepts either a plain mask string or a stringified
|
|
94
|
+
* arrow function that receives `locale` and returns a mask string.
|
|
95
|
+
*
|
|
96
|
+
* Plain pattern: `"##/##/####"`
|
|
97
|
+
*
|
|
98
|
+
* Function pattern: `"(locale) => locale === 'en-US' ? '(###) ###-####' : '####-######'"`
|
|
99
|
+
*/
|
|
100
|
+
mask: z.string().optional(),
|
|
101
|
+
// === VALIDATION ===
|
|
102
|
+
/** Validation configuration */
|
|
103
|
+
validation: FieldValidation.optional(),
|
|
104
|
+
})
|
|
105
|
+
.meta({
|
|
106
|
+
title: 'FieldMeta',
|
|
107
|
+
description: 'Unified field metadata - the single source of truth for field definitions, works for both forms (AForm) and tables (ATable)',
|
|
108
|
+
});
|
package/dist/src/fieldtype.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fieldtype.d.ts","sourceRoot":"","sources":["../../src/fieldtype.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;;;GAIG;AACH,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"fieldtype.d.ts","sourceRoot":"","sources":["../../src/fieldtype.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;;;GAIG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;EAwB5B,CAAA;AAEH;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAEnE;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC7B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,SAAS,EAAE,kBAAkB,CAAA;CAC7B;AAED;;;;GAIG;AACH,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,kBAAkB,EAAE,aAAa,CAkC9D,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,kBAAkB,GAAG,MAAM,CAEzE"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Stonecrop field types - the semantic type of the field.
|
|
4
|
+
* These are consistent across forms and tables.
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export const StonecropFieldType = z
|
|
8
|
+
.enum([
|
|
9
|
+
'Data', // Short text, varchar
|
|
10
|
+
'Text', // Long text
|
|
11
|
+
'Int', // Integer
|
|
12
|
+
'Float', // Floating point (IEEE 754)
|
|
13
|
+
'Decimal', // Arbitrary precision decimal
|
|
14
|
+
'Check', // Boolean/checkbox
|
|
15
|
+
'Date', // Date only
|
|
16
|
+
'Time', // Time only
|
|
17
|
+
'Datetime', // Date and time
|
|
18
|
+
'Duration', // Time interval
|
|
19
|
+
'DateRange', // Date range
|
|
20
|
+
'JSON', // JSON data
|
|
21
|
+
'Code', // Code/source (with syntax highlighting)
|
|
22
|
+
'Link', // Reference to another doctype
|
|
23
|
+
'Doctype', // Child doctype (1:1 nested form or 1:many table via cardinality)
|
|
24
|
+
'Attach', // File attachment
|
|
25
|
+
'Currency', // Currency value
|
|
26
|
+
'Quantity', // Quantity with unit
|
|
27
|
+
'Select', // Dropdown selection
|
|
28
|
+
])
|
|
29
|
+
.meta({
|
|
30
|
+
title: 'StonecropFieldType',
|
|
31
|
+
description: 'Semantic field types for Stonecrop doctypes, consistent across forms and tables',
|
|
32
|
+
});
|
|
33
|
+
/**
|
|
34
|
+
* Mapping from StonecropFieldType to default Vue component.
|
|
35
|
+
* Components can be overridden in the field definition.
|
|
36
|
+
* @public
|
|
37
|
+
*/
|
|
38
|
+
export const TYPE_MAP = {
|
|
39
|
+
// Text
|
|
40
|
+
Data: { component: 'ATextInput', fieldtype: 'Data' },
|
|
41
|
+
Text: { component: 'ATextInput', fieldtype: 'Text' },
|
|
42
|
+
// Numeric
|
|
43
|
+
Int: { component: 'ANumericInput', fieldtype: 'Int' },
|
|
44
|
+
Float: { component: 'ANumericInput', fieldtype: 'Float' },
|
|
45
|
+
Decimal: { component: 'ADecimalInput', fieldtype: 'Decimal' },
|
|
46
|
+
// Boolean
|
|
47
|
+
Check: { component: 'ACheckbox', fieldtype: 'Check' },
|
|
48
|
+
// Date/Time
|
|
49
|
+
Date: { component: 'ADate', fieldtype: 'Date' },
|
|
50
|
+
Time: { component: 'ATimeInput', fieldtype: 'Time' },
|
|
51
|
+
Datetime: { component: 'ADatetimePicker', fieldtype: 'Datetime' },
|
|
52
|
+
Duration: { component: 'ADurationInput', fieldtype: 'Duration' },
|
|
53
|
+
DateRange: { component: 'ADateRangePicker', fieldtype: 'DateRange' },
|
|
54
|
+
// Structured
|
|
55
|
+
JSON: { component: 'ACodeEditor', fieldtype: 'JSON' },
|
|
56
|
+
Code: { component: 'ACodeEditor', fieldtype: 'Code' },
|
|
57
|
+
// Relational
|
|
58
|
+
Link: { component: 'ALink', fieldtype: 'Link' },
|
|
59
|
+
Doctype: { component: 'AForm', fieldtype: 'Doctype' },
|
|
60
|
+
// Files
|
|
61
|
+
Attach: { component: 'AFileAttach', fieldtype: 'Attach' },
|
|
62
|
+
// Specialized
|
|
63
|
+
Currency: { component: 'ACurrencyInput', fieldtype: 'Currency' },
|
|
64
|
+
Quantity: { component: 'AQuantityInput', fieldtype: 'Quantity' },
|
|
65
|
+
Select: { component: 'ADropdown', fieldtype: 'Select' },
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Get the default component for a field type
|
|
69
|
+
* @param fieldtype - The semantic field type
|
|
70
|
+
* @returns The default component name
|
|
71
|
+
* @public
|
|
72
|
+
*/
|
|
73
|
+
export function getDefaultComponent(fieldtype) {
|
|
74
|
+
return TYPE_MAP[fieldtype]?.component ?? 'ATextInput';
|
|
75
|
+
}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
export { StonecropFieldType, TYPE_MAP, getDefaultComponent } from './fieldtype';
|
|
2
|
-
export { FieldMeta, FieldOptions, FieldValidation } from './field';
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
1
|
+
export { StonecropFieldType, TYPE_MAP, getDefaultComponent, type FieldTemplate } from './fieldtype';
|
|
2
|
+
export type { FieldMeta, FieldOptions, FieldValidation } from './field';
|
|
3
|
+
export type { ActionDefinition, Cardinality, CustomFetch, DataClient, DoctypeContext, DoctypeMeta, DoctypeRef, FetchStrategy, GetRecordOptions, GetRecordsOptions, LazyFetch, LinkDeclaration, SerializedFunction, SyncFetch, WorkflowMeta, } from './doctype';
|
|
4
|
+
export { parseDoctype, parseField, validateDoctype, validateField, type ValidationError, type ValidationResult, } from './validation';
|
|
5
|
+
export { buildScalarMap, classifyFieldType, convertGraphQLSchema, defaultIsEntityField, defaultIsEntityType, GQL_SCALAR_MAP, INTERNAL_SCALARS, WELL_KNOWN_SCALARS, type ConvertedGraphQLDoctype, type GraphQLConversionFieldMeta, type GraphQLConversionOptions, type IntrospectionSource, } from './converter';
|
|
6
6
|
export { toSlug, toPascalCase, pascalToSnake, snakeToCamel, camelToSnake, snakeToLabel, camelToLabel } from './naming';
|
|
7
|
-
export type { StonecropFieldType as StonecropFieldTypeValue } from './fieldtype';
|
|
8
|
-
export type { FieldMeta as FieldMetaType, FieldOptions as FieldOptionsType } from './field';
|
|
9
|
-
export type { FieldTemplate } from './fieldtype';
|
|
10
|
-
export type { DoctypeMeta as DoctypeMetaType, WorkflowMeta as WorkflowMetaType } from './doctype';
|
|
11
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,mBAAmB,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAA;AAGnG,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAGvE,YAAY,EACX,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,UAAU,EACV,cAAc,EACd,WAAW,EACX,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,SAAS,EACT,YAAY,GACZ,MAAM,WAAW,CAAA;AAGlB,OAAO,EACN,YAAY,EACZ,UAAU,EACV,eAAe,EACf,aAAa,EACb,KAAK,eAAe,EACpB,KAAK,gBAAgB,GACrB,MAAM,cAAc,CAAA;AAGrB,OAAO,EACN,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,KAAK,uBAAuB,EAC5B,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,GACxB,MAAM,aAAa,CAAA;AAGpB,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Field types
|
|
2
|
+
export { StonecropFieldType, TYPE_MAP, getDefaultComponent } from './fieldtype';
|
|
3
|
+
// Field schema
|
|
4
|
+
export { FieldMeta, FieldOptions, FieldValidation } from './field';
|
|
5
|
+
// Doctype schema
|
|
6
|
+
export { DoctypeMeta, WorkflowMeta, ActionDefinition, } from './doctype';
|
|
7
|
+
// Validation helpers
|
|
8
|
+
export { validateField, validateDoctype, parseField, parseDoctype, } from './validation';
|
|
9
|
+
// GraphQL to Doctype conversion
|
|
10
|
+
export { convertGraphQLSchema, GQL_SCALAR_MAP, WELL_KNOWN_SCALARS, INTERNAL_SCALARS, buildScalarMap, defaultIsEntityType, defaultIsEntityField, classifyFieldType, } from './converter';
|
|
11
|
+
// Naming utilities
|
|
12
|
+
export { toSlug, toPascalCase, pascalToSnake, snakeToCamel, camelToSnake, snakeToLabel, camelToLabel } from './naming';
|