@stonecrop/stonecrop 0.13.7 → 0.13.9

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.
@@ -90,8 +90,8 @@ export class SchemaValidator {
90
90
  });
91
91
  continue;
92
92
  }
93
- // Check for component or fieldtype
94
- if (!field.component && !('fieldtype' in field)) {
93
+ // ValueField requires fieldtype; fieldset/table have their own structural requirements
94
+ if (field.kind === 'field' && !field.component && !field.fieldtype) {
95
95
  issues.push({
96
96
  severity: ValidationSeverity.ERROR,
97
97
  rule: 'required-component-or-fieldtype',
@@ -100,14 +100,9 @@ export class SchemaValidator {
100
100
  fieldname: field.fieldname,
101
101
  });
102
102
  }
103
- // Validate nested schemas (recursively)
104
- if ('schema' in field) {
105
- // oxlint-disable-next-line typescript/no-unsafe-type-assertion -- 'schema' in field guard confirms property exists; SchemaTypes union narrowed at runtime
106
- const nestedSchema = field.schema;
107
- // oxlint-disable typescript/no-unsafe-type-assertion -- Immutable List or plain array; toArray() returns SchemaTypes elements
108
- const nestedArray = (Array.isArray(nestedSchema) ? nestedSchema : nestedSchema.toArray?.() || []);
109
- // oxlint-enable typescript/no-unsafe-type-assertion
110
- issues.push(...this.validateRequiredProperties(doctype, nestedArray));
103
+ // Validate nested schemas recursively (fieldset only; table columns are ColumnSchema not DoctypeField)
104
+ if (field.kind === 'fieldset') {
105
+ issues.push(...this.validateRequiredProperties(doctype, field.schema));
111
106
  }
112
107
  }
113
108
  return issues;
@@ -119,11 +114,8 @@ export class SchemaValidator {
119
114
  validateLinkFields(doctype, schema, registry) {
120
115
  const issues = [];
121
116
  for (const field of schema) {
122
- // oxlint-disable-next-line typescript/no-unsafe-type-assertion -- 'fieldtype' in field guard confirms property exists; accessing unknown-typed fieldtype safely
123
- const fieldtype = 'fieldtype' in field ? field.fieldtype : undefined;
124
- // Check Link fields
125
- if (fieldtype === 'Link') {
126
- const options = 'options' in field ? field.options : undefined;
117
+ if (field.kind === 'field' && field.fieldtype === 'Link') {
118
+ const options = field.options;
127
119
  if (!options) {
128
120
  issues.push({
129
121
  severity: ValidationSeverity.ERROR,
@@ -134,8 +126,6 @@ export class SchemaValidator {
134
126
  });
135
127
  continue;
136
128
  }
137
- // Check if target doctype exists in registry
138
- // Options should be a string representing the target doctype name
139
129
  const targetDoctype = typeof options === 'string' ? options : '';
140
130
  if (!targetDoctype) {
141
131
  issues.push({
@@ -159,14 +149,9 @@ export class SchemaValidator {
159
149
  });
160
150
  }
161
151
  }
162
- // Recursively check nested schemas
163
- if ('schema' in field) {
164
- // oxlint-disable-next-line typescript/no-unsafe-type-assertion -- 'schema' in field guard confirms property exists; SchemaTypes union narrowed at runtime
165
- const nestedSchema = field.schema;
166
- // oxlint-disable typescript/no-unsafe-type-assertion -- Immutable List or plain array; toArray() returns SchemaTypes elements
167
- const nestedArray = (Array.isArray(nestedSchema) ? nestedSchema : nestedSchema.toArray?.() || []);
168
- // oxlint-enable typescript/no-unsafe-type-assertion
169
- issues.push(...this.validateLinkFields(doctype, nestedArray, registry));
152
+ // Recursively check nested fieldset schemas
153
+ if (field.kind === 'fieldset') {
154
+ issues.push(...this.validateLinkFields(doctype, field.schema, registry));
170
155
  }
171
156
  }
172
157
  return issues;
@@ -180,7 +165,7 @@ export class SchemaValidator {
180
165
  // Build a map of Link fields by fieldname for quick lookup
181
166
  const linkFieldsByFieldname = new Map();
182
167
  for (const field of schema) {
183
- if ('fieldtype' in field && field.fieldtype === 'Link') {
168
+ if (field.kind === 'field' && field.fieldtype === 'Link') {
184
169
  linkFieldsByFieldname.set(field.fieldname, field);
185
170
  }
186
171
  }
@@ -237,9 +222,8 @@ export class SchemaValidator {
237
222
  // Only check if link has fieldname set (otherwise it's a standalone link without a field)
238
223
  if (link.fieldname) {
239
224
  const linkField = linkFieldsByFieldname.get(link.fieldname);
240
- if (linkField) {
241
- const linkFieldOptions = 'options' in linkField ? linkField.options : undefined;
242
- const linkFieldTarget = typeof linkFieldOptions === 'string' ? linkFieldOptions : undefined;
225
+ if (linkField && linkField.kind === 'field') {
226
+ const linkFieldTarget = typeof linkField.options === 'string' ? linkField.options : undefined;
243
227
  if (linkFieldTarget && linkFieldTarget !== link.target) {
244
228
  issues.push({
245
229
  severity: ValidationSeverity.ERROR,
@@ -312,7 +312,7 @@ export declare class Stonecrop {
312
312
  getSnapshot: () => import("./types").OperationLogSnapshot;
313
313
  markIrreversible: (operationId: string, reason: string) => void;
314
314
  logAction: (doctype: string, actionName: string, recordIds?: string[], result?: "success" | "failure" | "pending", error?: string) => string;
315
- }, "undo" | "redo" | "configure" | "addOperation" | "startBatch" | "commitBatch" | "cancelBatch" | "clear" | "getOperationsFor" | "getSnapshot" | "markIrreversible" | "logAction">>;
315
+ }, "clear" | "undo" | "redo" | "configure" | "addOperation" | "startBatch" | "commitBatch" | "cancelBatch" | "getOperationsFor" | "getSnapshot" | "markIrreversible" | "logAction">>;
316
316
  /**
317
317
  * Initialize the HST store structure
318
318
  */
@@ -1 +1 @@
1
- {"version":3,"file":"stonecrop.d.ts","sourceRoot":"","sources":["../../src/stonecrop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAGnD,OAAO,OAAO,MAAM,WAAW,CAAA;AAE/B,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,EAAa,KAAK,OAAO,EAAE,MAAM,cAAc,CAAA;AAGtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAEzD;;;GAGG;AACH,qBAAa,SAAS;IACrB;;;;;OAKG;IACH,MAAM,CAAC,KAAK,EAAE,SAAS,CAAA;IAEvB,2DAA2D;IAC3D,OAAO,CAAC,QAAQ,CAAU;IAC1B,OAAO,CAAC,kBAAkB,CAAC,CAAyC;IACpE,O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,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM;IA6BnE;;;;;;OAMG;IACH,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IA+B7E;;;;;;;;;OASG;IACH,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI;IAoB1D;;;;;;;;;;;;;OAaG;IACG,eAAe,CACpB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAA;KAAE,GAC9C,OAAO,CAAC,IAAI,CAAC;IAgChB;;;;;OAKG;IACH,OAAO,CAAC,iBAAiB;CA2BzB;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,IAAI,SAAS,GAAG,SAAS,CAEpD"}
@@ -271,7 +271,6 @@ export class Stonecrop {
271
271
  // TODO: For custom fetch handlers, this returns false (not blocking), but the custom handler
272
272
  // may still be invoked by useLazyLink. Future: custom handlers should be able to declare they
273
273
  // satisfy blockWorkflows, or validation should reject custom + blockWorkflows: true.
274
- // See: relationships.md Phase 6 "Open Question: blockWorkflows + custom fetch"
275
274
  return link.fetch?.method === 'sync';
276
275
  }
277
276
  /**
@@ -264,5 +264,5 @@ export declare const useOperationLogStore: import("pinia").StoreDefinition<"hst-
264
264
  getSnapshot: () => OperationLogSnapshot;
265
265
  markIrreversible: (operationId: string, reason: string) => void;
266
266
  logAction: (doctype: string, actionName: string, recordIds?: string[], result?: "success" | "failure" | "pending", error?: string) => string;
267
- }, "undo" | "redo" | "configure" | "addOperation" | "startBatch" | "commitBatch" | "cancelBatch" | "clear" | "getOperationsFor" | "getSnapshot" | "markIrreversible" | "logAction">>;
267
+ }, "clear" | "undo" | "redo" | "configure" | "addOperation" | "startBatch" | "commitBatch" | "cancelBatch" | "getOperationsFor" | "getSnapshot" | "markIrreversible" | "logAction">>;
268
268
  //# sourceMappingURL=operation-log.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { SchemaTypes } from '@stonecrop/aform';
1
+ import type { ResolvedField } from '@stonecrop/aform';
2
2
  import type { Ref, ComputedRef } from 'vue';
3
3
  import type Doctype from '../doctype';
4
4
  import type { HSTNode } from './hst';
@@ -167,7 +167,7 @@ export type HSTStonecropReturn = BaseStonecropReturn & {
167
167
  * Resolved schema with nested Doctype fields expanded.
168
168
  * Use this to iterate over fields for rendering, excluding nested doctypes handled separately.
169
169
  */
170
- resolvedSchema: Ref<SchemaTypes[]>;
170
+ resolvedSchema: Ref<ResolvedField[]>;
171
171
  /**
172
172
  * Scaffold empty descendant records from defaults for all descendant links.
173
173
  * @param path - The HST path where initialized data should be stored
@@ -1 +1 @@
1
- {"version":3,"file":"composable.d.ts","sourceRoot":"","sources":["../../../src/types/composable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,KAAK,CAAA;AAE3C,OAAO,KAAK,OAAO,MAAM,YAAY,CAAA;AACrC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AACpC,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAE7F;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG;IAC7B;;;OAGG;IACH,UAAU,EAAE,GAAG,CAAC,YAAY,EAAE,CAAC,CAAA;IAC/B;;;OAGG;IACH,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACzB;;;OAGG;IACH,aAAa,EAAE,WAAW,CAAC;QAC1B,OAAO,EAAE,OAAO,CAAA;QAChB,OAAO,EAAE,OAAO,CAAA;QAChB,SAAS,EAAE,MAAM,CAAA;QACjB,SAAS,EAA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AK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAE7C;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG;IAC3B,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAA;IACZ,8BAA8B;IAC9B,KAAK,EAAE,GAAG,CAAA;IACV,8BAA8B;IAC9B,SAAS,EAAE,MAAM,CAAA;IACjB,yBAAyB;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAAG;IACtB,+BAA+B;IAC/B,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IACrB,2DAA2D;IAC3D,MAAM,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IACpB,0BAA0B;IAC1B,KAAK,EAAE,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,CAAA;IACxB,+CAA+C;IAC/C,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IAC3B,2DAA2D;IAC3D,IAAI,EAAE,WAAW,CAAA;CACjB,CAAA"}
@@ -1,38 +1,19 @@
1
- import type { SchemaTypes } from '@stonecrop/aform';
2
- import type { FieldMeta, LinkDeclaration, WorkflowMeta } from '@stonecrop/schema';
1
+ import type { DoctypeField, LinkDeclaration, WorkflowMeta } from '@stonecrop/schema';
3
2
  import { List, Map } from 'immutable';
4
3
  import type { AnyStateNodeConfig, UnknownMachineConfig } from 'xstate';
5
4
  /**
6
- * Immutable Doctype type for Stonecrop instances
5
+ * Immutable Doctype type for Stonecrop instances. App authors should use
6
+ * `Doctype.fromObject()` rather than constructing this shape manually.
7
7
  * @public
8
8
  */
9
9
  export type ImmutableDoctype = {
10
- readonly schema?: List<SchemaTypes>;
10
+ readonly schema?: List<DoctypeField>;
11
11
  readonly workflow?: UnknownMachineConfig | AnyStateNodeConfig | WorkflowMeta;
12
12
  readonly actions?: Map<string, string[]>;
13
- readonly links?: Record<string, LinkDeclaration>;
14
- };
15
- /**
16
- * Mutable Doctype type for Stonecrop instances
17
- * @public
18
- */
19
- export type MutableDoctype = {
20
- doctype?: string;
21
- schema?: SchemaTypes[];
22
- workflow?: UnknownMachineConfig | AnyStateNodeConfig | WorkflowMeta;
23
- actions?: Record<string, string[]>;
24
- };
25
- /**
26
- * Schema type for Stonecrop instances
27
- * @public
28
- */
29
- export type Schema = {
30
- doctype: string;
31
- schema: List<SchemaTypes>;
32
13
  };
33
14
  /**
34
15
  * Plain object representation of doctype configuration for serialization/API responses.
35
- * Compatible with the DoctypeMeta type from \@stonecrop/schema.
16
+ * Extends DoctypeMeta with Stonecrop-specific properties: actions, slug, inherits.
36
17
  * @public
37
18
  */
38
19
  export type DoctypeConfig = {
@@ -41,7 +22,7 @@ export type DoctypeConfig = {
41
22
  /** URL-friendly slug (kebab-case) */
42
23
  slug?: string;
43
24
  /** Field definitions (including link fields with fieldtype: 'Link') */
44
- fields?: (SchemaTypes | FieldMeta)[];
25
+ fields?: DoctypeField[];
45
26
  /** Relationship links to other doctypes */
46
27
  links?: Record<string, LinkDeclaration>;
47
28
  /** Workflow configuration (XState format or simple WorkflowMeta) */
@@ -1 +1 @@
1
- {"version":3,"file":"doctype.d.ts","sourceRoot":"","sources":["../../../src/types/doctype.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACjF,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,KAAK,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAA;AAEtE;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC9B,QAAQ,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,CAAA;IACnC,QAAQ,CAAC,QAAQ,CAAC,EAAE,oBAAoB,GAAG,kBAAkB,GAAG,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AAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACpF,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,KAAK,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAA;AAEtE;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC9B,QAAQ,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,CAAA;IACpC,QAAQ,CAAC,QAAQ,CAAC,EAAE,oBAAoB,GAAG,kBAAkB,GAAG,YAAY,CAAA;IAC5E,QAAQ,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;CACxC,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG;IAC3B,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,qCAAqC;IACrC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,uEAAuE;IACvE,MAAM,CAAC,EAAE,YAAY,EAAE,CAAA;IACvB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA;IACvC,oEAAoE;IACpE,QAAQ,CAAC,EAAE,oBAAoB,GAAG,YAAY,CAAA;IAC9C,uCAAuC;IACvC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;IAClC,uCAAuC;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA"}
@@ -2,14 +2,14 @@ import type { AnyStateNodeConfig } from 'xstate';
2
2
  import { Component } from 'vue';
3
3
  import { ComputedRef } from 'vue';
4
4
  import type { DataClient } from '@stonecrop/schema';
5
- import type { FieldMeta } from '@stonecrop/schema';
5
+ import type { DoctypeField } from '@stonecrop/schema';
6
6
  import type { LinkDeclaration } from '@stonecrop/schema';
7
7
  import { List } from 'immutable';
8
8
  import { Map as Map_2 } from 'immutable';
9
9
  import { Plugin as Plugin_2 } from 'vue';
10
10
  import { Ref } from 'vue';
11
+ import type { ResolvedField } from '@stonecrop/aform';
11
12
  import { Router } from 'vue-router';
12
- import type { SchemaTypes } from '@stonecrop/aform';
13
13
  import { Store } from 'pinia';
14
14
  import { StoreDefinition } from 'pinia';
15
15
  import type { UnknownMachineConfig } from 'xstate';
@@ -223,21 +223,21 @@ export declare class Doctype {
223
223
  */
224
224
  static fromObject(config: DoctypeConfig): Doctype;
225
225
  /**
226
- * Returns the schema as a plain array for use with components that expect
227
- * plain JavaScript arrays (e.g., AForm, ATable).
226
+ * Returns the raw authoring schema as a plain array.
227
+ * For the resolved schema suitable for AForm, use `registry.resolveSchema(doctype)`.
228
228
  *
229
- * @returns Array of schema fields
229
+ * @returns Array of raw DoctypeField authoring definitions
230
230
  *
231
231
  * @example
232
232
  * ```ts
233
- * const schemaArray = doctype.getSchemaArray()
234
- * // Use with AForm
235
- * <AForm :schema="schemaArray" v-model:data="formData" />
233
+ * const fields = doctype.getSchemaArray()
234
+ * // Pass to resolveSchema for AForm-ready output:
235
+ * const resolved = registry.resolveSchema(doctype)
236
236
  * ```
237
237
  *
238
238
  * @public
239
239
  */
240
- getSchemaArray(): SchemaTypes[];
240
+ getSchemaArray(): DoctypeField[];
241
241
  /**
242
242
  * Returns the actions as a plain object for use with components that expect
243
243
  * plain JavaScript objects.
@@ -310,7 +310,7 @@ export declare class Doctype {
310
310
 
311
311
  /**
312
312
  * Plain object representation of doctype configuration for serialization/API responses.
313
- * Compatible with the DoctypeMeta type from \@stonecrop/schema.
313
+ * Extends DoctypeMeta with Stonecrop-specific properties: actions, slug, inherits.
314
314
  * @public
315
315
  */
316
316
  export declare type DoctypeConfig = {
@@ -319,7 +319,7 @@ export declare type DoctypeConfig = {
319
319
  /** URL-friendly slug (kebab-case) */
320
320
  slug?: string;
321
321
  /** Field definitions (including link fields with fieldtype: 'Link') */
322
- fields?: (SchemaTypes | FieldMeta)[];
322
+ fields?: DoctypeField[];
323
323
  /** Relationship links to other doctypes */
324
324
  links?: Record<string, LinkDeclaration>;
325
325
  /** Workflow configuration (XState format or simple WorkflowMeta) */
@@ -798,7 +798,7 @@ export declare type HSTStonecropReturn = BaseStonecropReturn & {
798
798
  * Resolved schema with nested Doctype fields expanded.
799
799
  * Use this to iterate over fields for rendering, excluding nested doctypes handled separately.
800
800
  */
801
- resolvedSchema: Ref<SchemaTypes[]>;
801
+ resolvedSchema: Ref<ResolvedField[]>;
802
802
  /**
803
803
  * Scaffold empty descendant records from defaults for all descendant links.
804
804
  * @param path - The HST path where initialized data should be stored
@@ -866,14 +866,14 @@ export declare type HSTStonecropReturn = BaseStonecropReturn & {
866
866
  };
867
867
 
868
868
  /**
869
- * Immutable Doctype type for Stonecrop instances
869
+ * Immutable Doctype type for Stonecrop instances. App authors should use
870
+ * `Doctype.fromObject()` rather than constructing this shape manually.
870
871
  * @public
871
872
  */
872
873
  export declare type ImmutableDoctype = {
873
- readonly schema?: List<SchemaTypes>;
874
+ readonly schema?: List<DoctypeField>;
874
875
  readonly workflow?: UnknownMachineConfig | AnyStateNodeConfig | WorkflowMeta;
875
876
  readonly actions?: Map_2<string, string[]>;
876
- readonly links?: Record<string, LinkDeclaration>;
877
877
  };
878
878
 
879
879
  /**
@@ -933,17 +933,6 @@ export declare type LazyLink = {
933
933
  */
934
934
  export declare function markOperationIrreversible(operationId: string | undefined, reason: string): void;
935
935
 
936
- /**
937
- * Mutable Doctype type for Stonecrop instances
938
- * @public
939
- */
940
- export declare type MutableDoctype = {
941
- doctype?: string;
942
- schema?: SchemaTypes[];
943
- workflow?: UnknownMachineConfig | AnyStateNodeConfig | WorkflowMeta;
944
- actions?: Record<string, string[]>;
945
- };
946
-
947
936
  /**
948
937
  * Operation Log API - nested object containing all operation log functionality
949
938
  * @public
@@ -1230,70 +1219,50 @@ export declare class Registry {
1230
1219
  */
1231
1220
  addDoctype(doctype: Doctype): void;
1232
1221
  /**
1233
- * Resolve nested Doctype fields in a schema by embedding child schemas inline.
1234
- *
1235
- * Accepts a Doctype and extracts `fields` and `links` internally.
1236
- * Fields array contains both scalar fields and link fields (with fieldtype: 'Link').
1237
- * Render order is determined by the order of fields in the fields array.
1222
+ * Resolve a Doctype's authoring schema into a rendered schema array suitable for AForm.
1238
1223
  *
1239
- * For each link field:
1240
- * - Looks up the corresponding link declaration in `links` by fieldname
1241
- * - `cardinality: 'noneOrMany'` or `'atLeastOne'`: auto-derives `columns` from the target's schema,
1242
- * sets `component` to `link.component ?? 'ATable'`, `config: { view: 'list' }`.
1243
- * - `cardinality: 'one'` or `'atMostOne'`: embeds the target schema as the entry's
1244
- * `schema` property, sets `component` to `link.component ?? 'AForm'`.
1224
+ * Transforms `DoctypeField[]` (authoring space) → `ResolvedField[]` (rendering space):
1225
+ * - `kind: 'field'` (not Link) `ResolvedScalar`
1226
+ * - `kind: 'field'` (Link, no declaration) `ResolvedScalar` with `component: 'AFormLink'`
1227
+ * - `kind: 'field'` (Link, `noneOrMany`/`atLeastOne`) `ResolvedTable`
1228
+ * - `kind: 'field'` (Link, `one`/`atMostOne`) `ResolvedLink`
1229
+ * - `kind: 'fieldset'` `ResolvedFieldset` (children resolved recursively)
1230
+ * - `kind: 'table'` → `ResolvedTable` (columns as `ColumnSchema[]`)
1245
1231
  *
1246
- * Recurses for deeply nested doctypes. Circular references are protected against.
1247
- * Returns a new array — does not mutate the original.
1232
+ * Circular references are protected against via the `visited` set.
1248
1233
  *
1249
1234
  * @param doctype - The doctype to resolve
1250
1235
  * @param visited - Internal — set of already-visited doctype slugs for cycle detection
1251
- * @returns A new schema array with nested links resolved
1236
+ * @returns A resolved schema array ready for AForm
1252
1237
  *
1253
1238
  * @public
1254
1239
  */
1255
- resolveSchema(doctype: Doctype, visited?: Set<string>): SchemaTypes[];
1240
+ resolveSchema(doctype: Doctype, visited?: Set<string>): ResolvedField[];
1256
1241
  /**
1257
- * Recursively resolve a flat fields array using the provided link context.
1258
- * Used by resolveSchema to handle fieldset children.
1242
+ * Recursively resolve a `DoctypeField[]` using the provided link context.
1243
+ * Called by `resolveSchema` and recursively for fieldset children.
1259
1244
  * @internal
1260
1245
  */
1261
1246
  private resolveFields;
1262
1247
  /**
1263
- * Build an ATable configuration from a field and child schema.
1264
- * Data-model properties from the source field are preserved via the spread `field` argument.
1248
+ * Build a `ResolvedTable` from a resolved Link field with many cardinality.
1249
+ * Extracts scalar column definitions from the child schema.
1265
1250
  * @internal
1266
1251
  */
1267
1252
  private buildTableConfig;
1268
1253
  /**
1269
- * Initialize a new record with default values based on a schema.
1254
+ * Initialize a new record with default values based on a resolved schema.
1255
+ * Narrows by `kind` discriminator for precise branch selection.
1270
1256
  *
1271
- * @remarks
1272
- * Creates a plain object with keys from the schema's fieldnames and default values
1273
- * derived from each field's `fieldtype`:
1274
- * - Data, Text → `''`
1275
- * - Check → `false`
1276
- * - Int, Float, Decimal, Currency, Quantity → `0`
1277
- * - JSON → `{}`
1278
- * - Doctype with `cardinality: 'noneOrMany'` or `'atLeastOne'` → `[]`
1279
- * - Doctype without `cardinality` or `cardinality: 'one'` → recursively initializes nested record
1280
- * - All others → `null`
1257
+ * - `kind: 'table'` or `kind: 'link'` → `[]` or `{}`
1258
+ * - `kind: 'fieldset'` recursively initializes children as `{}`
1259
+ * - `kind: 'field'` → derives default from `fieldtype`; falls back to `null`
1281
1260
  *
1282
- * For Doctype fields with a resolved `schema` array (cardinality: 'one'), recursively
1283
- * initializes the nested record.
1284
- *
1285
- * @param schema - The schema array to derive defaults from
1261
+ * @param schema - The resolved schema array to derive defaults from
1286
1262
  * @returns A plain object with default values for each field
1287
- *
1288
- * @example
1289
- * ```ts
1290
- * const defaults = registry.initializeRecord(addressSchema)
1291
- * // { street: '', city: '', state: '', zip_code: '' }
1292
- * ```
1293
- *
1294
1263
  * @public
1295
1264
  */
1296
- initializeRecord(schema: SchemaTypes[]): Record<string, any>;
1265
+ initializeRecord(schema: ResolvedField[]): Record<string, any>;
1297
1266
  /**
1298
1267
  * Get a registered doctype by slug
1299
1268
  * @param slug - The doctype slug to look up
@@ -1354,15 +1323,6 @@ export declare interface RouteContext {
1354
1323
  segments: string[];
1355
1324
  }
1356
1325
 
1357
- /**
1358
- * Schema type for Stonecrop instances
1359
- * @public
1360
- */
1361
- export declare type Schema = {
1362
- doctype: string;
1363
- schema: List<SchemaTypes>;
1364
- };
1365
-
1366
1326
  /**
1367
1327
  * Schema validator class
1368
1328
  * @public
@@ -1383,7 +1343,7 @@ export declare class SchemaValidator {
1383
1343
  * @param links - Optional links object
1384
1344
  * @returns Validation result
1385
1345
  */
1386
- validate(doctype: string, schema: List<SchemaTypes> | SchemaTypes[] | undefined, workflow?: AnyStateNodeConfig, actions?: Map_2<string, string[]> | Map<string, string[]>, links?: Record<string, LinkDeclaration>): ValidationResult;
1346
+ validate(doctype: string, schema: List<DoctypeField> | DoctypeField[] | undefined, workflow?: AnyStateNodeConfig, actions?: Map_2<string, string[]> | Map<string, string[]>, links?: Record<string, LinkDeclaration>): ValidationResult;
1387
1347
  /**
1388
1348
  * Validates that required schema properties are present
1389
1349
  * @internal
@@ -1727,7 +1687,7 @@ export declare class Stonecrop {
1727
1687
  getSnapshot: () => OperationLogSnapshot;
1728
1688
  markIrreversible: (operationId: string, reason: string) => void;
1729
1689
  logAction: (doctype: string, actionName: string, recordIds?: string[], result?: "success" | "failure" | "pending", error?: string) => string;
1730
- }, "undo" | "redo" | "configure" | "addOperation" | "startBatch" | "commitBatch" | "cancelBatch" | "clear" | "getOperationsFor" | "getSnapshot" | "markIrreversible" | "logAction">>;
1690
+ }, "clear" | "undo" | "redo" | "configure" | "addOperation" | "startBatch" | "commitBatch" | "cancelBatch" | "getOperationsFor" | "getSnapshot" | "markIrreversible" | "logAction">>;
1731
1691
  /**
1732
1692
  * Initialize the HST store structure
1733
1693
  */
@@ -2385,7 +2345,7 @@ getOperationsFor: (doctype: string, recordId?: string) => HSTOperation[];
2385
2345
  getSnapshot: () => OperationLogSnapshot;
2386
2346
  markIrreversible: (operationId: string, reason: string) => void;
2387
2347
  logAction: (doctype: string, actionName: string, recordIds?: string[], result?: "success" | "failure" | "pending", error?: string) => string;
2388
- }, "undo" | "redo" | "configure" | "addOperation" | "startBatch" | "commitBatch" | "cancelBatch" | "clear" | "getOperationsFor" | "getSnapshot" | "markIrreversible" | "logAction">>;
2348
+ }, "clear" | "undo" | "redo" | "configure" | "addOperation" | "startBatch" | "commitBatch" | "cancelBatch" | "getOperationsFor" | "getSnapshot" | "markIrreversible" | "logAction">>;
2389
2349
 
2390
2350
  /**
2391
2351
  * Unified Stonecrop composable - handles both general operations and HST reactive integration
@@ -2448,7 +2408,7 @@ export declare function useUndoRedoShortcuts(hstStore: HSTNode, enabled?: boolea
2448
2408
  * @returns Validation result
2449
2409
  * @public
2450
2410
  */
2451
- export declare function validateSchema(doctype: string, schema: List<SchemaTypes> | SchemaTypes[] | undefined, registry: Registry, workflow?: AnyStateNodeConfig, actions?: Map_2<string, string[]> | Map<string, string[]>): ValidationResult;
2411
+ export declare function validateSchema(doctype: string, schema: List<DoctypeField> | DoctypeField[] | undefined, registry: Registry, workflow?: AnyStateNodeConfig, actions?: Map_2<string, string[]> | Map<string, string[]>): ValidationResult;
2452
2412
 
2453
2413
  /**
2454
2414
  * Validation issue