processfocus 0.1.0-next.2 → 0.1.0-next.4
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/dist/{auth-FmXptohB.mjs → auth-DWWupwJA.mjs} +57 -24
- package/dist/auth-config/src/lib/authentication-config.d.ts +13 -8
- package/dist/auth-config/src/lib/aws-role-binding.d.ts +21 -0
- package/dist/auth-config/src/lib/provider-types.d.ts +87 -76
- package/dist/auth-config/src/lib/workload-trust.d.ts +41 -0
- package/dist/auth.mjs +1 -2
- package/dist/business-calendar/src/lib/calendar-config.d.ts +73 -76
- package/dist/business-calendar/src/lib/calendar-period.d.ts +30 -30
- package/dist/business-calendar/src/lib/calendar-service.d.ts +10 -10
- package/dist/business-calendar/src/lib/datetime-utils.d.ts +1 -1
- package/dist/business-calendar/src/lib/holidays.d.ts +40 -40
- package/dist/business-calendar/src/lib/types.d.ts +29 -29
- package/dist/calendar.mjs +73 -63
- package/dist/form-schema/src/index.d.ts +4 -1
- package/dist/form-schema/src/lib/annotation-helpers.d.ts +2 -2
- package/dist/form-schema/src/lib/email.d.ts +2 -2
- package/dist/form-schema/src/lib/field-count.d.ts +2 -2
- package/dist/form-schema/src/lib/form-annotations.d.ts +6 -0
- package/dist/form-schema/src/lib/form-presentation.d.ts +30 -0
- package/dist/form-schema/src/lib/form-schema.d.ts +64 -34
- package/dist/form-schema/src/lib/number-from-string.d.ts +3 -0
- package/dist/form-schema/src/lib/phone.d.ts +2 -2
- package/dist/form-schema/src/lib/public-completion-correction.d.ts +5 -0
- package/dist/form-schema/src/lib/search-lookup-items.d.ts +3 -0
- package/dist/form-submission-schema/src/index.d.ts +3 -0
- package/dist/form-submission-schema/src/lib/executable-rules.d.ts +43 -0
- package/dist/form-submission-schema/src/lib/form-submission-schema.d.ts +33 -10
- package/dist/form-submission-schema/src/lib/json-schema.d.ts +3 -0
- package/dist/form-submission-schema/src/lib/submission-utils.d.ts +19 -0
- package/dist/forms.mjs +26 -2
- package/dist/frontend-manifest/src/lib/browser-plugin-artifact.d.ts +9 -0
- package/dist/frontend-manifest/src/lib/frontend-manifest.d.ts +8 -6
- package/dist/frontend-plugin-host/src/lib/frontend-plugin-host.d.ts +11 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +466 -972
- package/dist/manifest.mjs +1 -2
- package/dist/plugin.mjs +1 -2
- package/dist/process/src/lib/form-authoring.d.ts +1 -1
- package/dist/process/src/lib/form-decoration.d.ts +3 -3
- package/dist/process/src/lib/form.d.ts +61 -97
- package/dist/process/src/lib/list.d.ts +36 -23
- package/dist/process/src/lib/lookup-accessor.d.ts +4 -1
- package/dist/process/src/lib/organisation.d.ts +14 -0
- package/dist/process/src/lib/process.d.ts +24 -2
- package/dist/process/src/lib/schedule.d.ts +1 -1
- package/dist/process/src/lib/step.d.ts +13 -3
- package/dist/process/src/lib/system-step-executor.d.ts +4 -4
- package/dist/process/src/lib/system-step.d.ts +11 -1
- package/dist/sdk/src/index.d.ts +1 -1
- package/dist/sdk/src/testing.d.ts +0 -1
- package/dist/{src-C-909PVQ.mjs → src-BQ55-khF.mjs} +118 -66
- package/dist/testing.d.ts +0 -1
- package/dist/testing.mjs +2 -4
- package/package.json +4 -4
- package/dist/form-client-representation/src/index.d.ts +0 -6
- package/dist/form-client-representation/src/lib/as-client-representation.d.ts +0 -31
- package/dist/form-client-representation/src/lib/client-form-definition.d.ts +0 -17
- package/dist/form-client-representation/src/lib/extract-annotations.d.ts +0 -20
- package/dist/form-client-representation/src/lib/plugin-registry.d.ts +0 -6
- package/dist/form-client-representation/src/lib/types.d.ts +0 -239
- package/dist/form-client-representation/src/lib/walker.d.ts +0 -68
- package/dist/form-rule/src/index.d.ts +0 -3
- package/dist/form-rule/src/lib/evaluator.d.ts +0 -2
- package/dist/form-rule/src/lib/paths.d.ts +0 -9
- package/dist/form-rule/src/lib/types.d.ts +0 -89
- package/dist/form-schema/src/lib/property-signature.d.ts +0 -3
- package/dist/paths-BkzLn-rG.mjs +0 -282
|
@@ -71,7 +71,7 @@ export declare class LongDurationDispatchError extends LongDurationDispatchError
|
|
|
71
71
|
* separate exported class for reserved-tag formatting if it appears in a cause.
|
|
72
72
|
*/
|
|
73
73
|
export type SystemStepExecutorError = StepNotFoundError | NotASystemStepError | OutputValidationError | LongDurationDispatchError | ForEachStepRequiresItemsError | AuthorTaggedError;
|
|
74
|
-
declare const LongDurationDispatcher_base: Context.
|
|
74
|
+
declare const LongDurationDispatcher_base: Context.ServiceClass<LongDurationDispatcher, "processfocus/LongDurationDispatcher", {
|
|
75
75
|
readonly dispatch: (todoId: string, stepPath: string) => Effect.Effect<void, LongDurationDispatchError>;
|
|
76
76
|
}>;
|
|
77
77
|
/**
|
|
@@ -79,7 +79,7 @@ declare const LongDurationDispatcher_base: Context.TagClass<LongDurationDispatch
|
|
|
79
79
|
*/
|
|
80
80
|
export declare class LongDurationDispatcher extends LongDurationDispatcher_base {
|
|
81
81
|
}
|
|
82
|
-
declare const StepProcessStateReader_base: Context.
|
|
82
|
+
declare const StepProcessStateReader_base: Context.ServiceClass<StepProcessStateReader, "processfocus/StepProcessStateReader", {
|
|
83
83
|
/**
|
|
84
84
|
* Read the current process state for a given todo.
|
|
85
85
|
* Returns the full state object (may be empty).
|
|
@@ -112,9 +112,9 @@ export interface SystemStepExecutorService {
|
|
|
112
112
|
* @param completedStepPaths - Completed steps whose JSON state values can be schema-rehydrated
|
|
113
113
|
* @returns A StepResult: Completed with output, or Deferred for async dispatch.
|
|
114
114
|
*/
|
|
115
|
-
readonly execute: (stepPath: string, state: Record<string, unknown>, ctx: FlowContext<Record<string, StepMeta>>, todoId: string, forEachInput?: unknown, completedStepPaths?: readonly string[]) => Effect.Effect<StepResult, SystemStepExecutorError, unknown>;
|
|
115
|
+
readonly execute: (stepPath: string, state: Record<string, unknown>, ctx: FlowContext<Record<string, StepMeta>>, todoId: string, forEachInput?: unknown, completedStepPaths?: readonly string[], externalWriteAttemptId?: string) => Effect.Effect<StepResult, SystemStepExecutorError, unknown>;
|
|
116
116
|
}
|
|
117
|
-
declare const SystemStepExecutor_base: Context.
|
|
117
|
+
declare const SystemStepExecutor_base: Context.ServiceClass<SystemStepExecutor, "processfocus/SystemStepExecutor", SystemStepExecutorService>;
|
|
118
118
|
/**
|
|
119
119
|
* Context tag for the SystemStepExecutor service.
|
|
120
120
|
*/
|
|
@@ -19,6 +19,14 @@ import { type IStepScope, Step } from "./step.js";
|
|
|
19
19
|
export type AuthorTaggedError = {
|
|
20
20
|
readonly _tag: string;
|
|
21
21
|
readonly retryable?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Set only for a terminal, confirmed rejection of the external write using
|
|
24
|
+
* CurrentStepJobContext.externalWriteAttemptId. Never set for ambiguous
|
|
25
|
+
* outcomes (timeouts, lost responses or malformed success). Todo-backed
|
|
26
|
+
* workers reserve the next durable identity with the failure; manual restart
|
|
27
|
+
* uses it. Other operations in the step must retain their original keys.
|
|
28
|
+
*/
|
|
29
|
+
readonly externalWriteRejected?: boolean;
|
|
22
30
|
};
|
|
23
31
|
/**
|
|
24
32
|
* Structural guard for AuthorTaggedError (cross-boundary safe; no instanceof).
|
|
@@ -81,8 +89,10 @@ export type StepResult = {
|
|
|
81
89
|
export interface StepJobContext {
|
|
82
90
|
readonly todoId: string;
|
|
83
91
|
readonly stepPath: string;
|
|
92
|
+
/** Durable replacement identity after a confirmed rejected external write. */
|
|
93
|
+
readonly externalWriteAttemptId?: string;
|
|
84
94
|
}
|
|
85
|
-
declare const CurrentStepJobContext_base: Context.
|
|
95
|
+
declare const CurrentStepJobContext_base: Context.ServiceClass<CurrentStepJobContext, "processfocus/CurrentStepJobContext", StepJobContext>;
|
|
86
96
|
/**
|
|
87
97
|
* Current system-step job identifiers, provided while `executeStep` runs.
|
|
88
98
|
* Use this from NodeStep `execute` callbacks that need the Todo identity
|
package/dist/sdk/src/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export { DocumentStore, type DocumentStoreProps, } from "./process/src/lib/docum
|
|
|
5
5
|
export { ExecutionFailureNotifications, type ExecutionFailureNotificationsProps, } from "./process/src/lib/execution-failure-notifications.js";
|
|
6
6
|
export type { CamelCase, FlowContext, ForEachOutput, FormStepMeta, MergeFormStep, MergeSteps, ProcessMeta, ProviderUserDisplayResolver, StepMeta, StepProviderUserInfo, StepUserInfo, SummaryContext, } from "./process/src/lib/flow-context.js";
|
|
7
7
|
export { type ConditionOptions, ElseBranch, type ElseTransitionOptions, FlowPath, type MergeState, type OnErrorOptions, type ScheduleOptions, type TransitionOptions, } from "./process/src/lib/flow-path.js";
|
|
8
|
-
export { Form, type FormEmbedConfig, type FormPublicCompletionConfig,
|
|
8
|
+
export { Form, type FormEmbedConfig, type FormPublicCompletionConfig, type FormStepProps, LookupFieldNotFoundError, type PublicCompletionCorrectionConfig, type PublicCompletionEmailTemplate, type PublicCompletionRecipient, type Summary, } from "./process/src/lib/form.js";
|
|
9
9
|
export { Invitation, type InvitationProps, } from "./process/src/lib/invitation.js";
|
|
10
10
|
export { DEFAULT_PAGE_SIZE, List, type ListDeleteFunction, type ListItemQueryContext, type ListItemQueryFunction, type ListProps, type ListQueryContext, type ListQueryFunction, type ListQueryResult, type ListSortDirection, type ListSortInput, ListSortable, type ListUpdateFunction, ListUpdateValidationError, ListVisibleInList, MAX_PAGE_SIZE, type OutputItem, } from "./process/src/lib/list.js";
|
|
11
11
|
export { type DependentQueryInput, LookupAccessor, LookupBuilder, type QueryInput, } from "./process/src/lib/lookup-accessor.js";
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Effect, Number as Number$1, Option, Result, Schema, SchemaGetter, SchemaIssue } from "effect";
|
|
2
2
|
import isURL from "validator/lib/isURL";
|
|
3
3
|
import isEmail from "validator/lib/isEmail";
|
|
4
|
-
|
|
5
|
-
//#region ../form-schema/src/lib/form-annotations.ts
|
|
4
|
+
// ../form-schema/src/lib/form-annotations.ts
|
|
6
5
|
const FormLabel = Symbol.for("pf/form/annotation/Label");
|
|
7
6
|
const FormDescription = Symbol.for("pf/form/annotation/Description");
|
|
8
7
|
const FormReadOnly = Symbol.for("pf/form/annotation/ReadOnly");
|
|
@@ -11,8 +10,11 @@ const FormPermission = Symbol.for("pf/form/annotation/Permission");
|
|
|
11
10
|
const FormRequired = Symbol.for("pf/form/annotation/Required");
|
|
12
11
|
const FormMessage = Symbol.for("pf/form/annotation/Message");
|
|
13
12
|
const FormAutoComplete = Symbol.for("pf/form/annotation/AutoComplete");
|
|
13
|
+
/** Set to false on a form schema to preserve initial focus instead of focusing its first editable control. */
|
|
14
|
+
const FormAutoFocus = Symbol.for("pf/form/annotation/AutoFocus");
|
|
14
15
|
const FormNumberInput = Symbol.for("pf/form/annotation/NumberInput");
|
|
15
16
|
const FormDateInput = Symbol.for("pf/form/annotation/DateInput");
|
|
17
|
+
const FormLocalDateTimeInput = Symbol.for("pf/form/annotation/LocalDateTimeInput");
|
|
16
18
|
const FormEmailInput = Symbol.for("pf/form/annotation/EmailInput");
|
|
17
19
|
const FormPhoneInput = Symbol.for("pf/form/annotation/PhoneInput");
|
|
18
20
|
const FormTextAreaInput = Symbol.for("pf/form/annotation/TextAreaInput");
|
|
@@ -21,13 +23,15 @@ const FormListInput = Symbol.for("pf/form/annotation/ListInput");
|
|
|
21
23
|
const FormFileInput = Symbol.for("pf/form/annotation/FileInput");
|
|
22
24
|
const FormLookupInput = Symbol.for("pf/form/annotation/LookupInput");
|
|
23
25
|
const FormRadioInput = Symbol.for("pf/form/annotation/RadioInput");
|
|
26
|
+
const FormCheckboxGroupInput = Symbol.for("pf/form/annotation/CheckboxGroupInput");
|
|
24
27
|
const FormSuggestionInput = Symbol.for("pf/form/annotation/SuggestionInput");
|
|
25
28
|
const FormCalendarSlotInput = Symbol.for("pf/form/annotation/CalendarSlotInput");
|
|
26
29
|
const FormProviderUserInput = Symbol.for("pf/form/annotation/ProviderUserInput");
|
|
27
30
|
const FormStaticText = Symbol.for("pf/form/annotation/StaticText");
|
|
28
31
|
const FormComponentPluginType = Symbol.for("pf/form/annotation/ComponentPluginType");
|
|
29
|
-
|
|
30
|
-
|
|
32
|
+
/** Public, static renderer options. Server-resolved configuration travels separately. */
|
|
33
|
+
const FormPluginData = Symbol.for("pf/form/annotation/PluginData");
|
|
34
|
+
// ../form-schema/src/lib/form-schema.ts
|
|
31
35
|
const FLATTEN_SYMBOL = Symbol.for("processfocus/form-schema/flatten");
|
|
32
36
|
const STRUCTURAL_ONLY_SYMBOL = Symbol.for("processfocus/form-schema/structural-only");
|
|
33
37
|
const STRUCTURAL_TYPE_SYMBOL = Symbol.for("processfocus/form-schema/structural-type");
|
|
@@ -40,9 +44,13 @@ const LINK_DISPLAY_SYMBOL = Symbol.for("processfocus/form-schema/link-display");
|
|
|
40
44
|
const LINK_COLOR_SYMBOL = Symbol.for("processfocus/form-schema/link-color");
|
|
41
45
|
const CurrentProviderUser = Symbol.for("processfocus/form-schema/current-provider-user");
|
|
42
46
|
/** Preserve read-only classification in downstream process-state inference. */
|
|
43
|
-
const ReadOnly = (schema) => schema.
|
|
44
|
-
const Wrapper = (fields) => Schema.Struct(fields).
|
|
45
|
-
|
|
47
|
+
const ReadOnly = (schema) => schema.annotate({ [FormReadOnly]: true });
|
|
48
|
+
const Wrapper = (fields, options) => Schema.Struct(fields).annotate({
|
|
49
|
+
[FLATTEN_SYMBOL]: true,
|
|
50
|
+
...options?.label !== void 0 && { [FormLabel]: options.label },
|
|
51
|
+
...options?.description !== void 0 && { [FormDescription]: options.description }
|
|
52
|
+
});
|
|
53
|
+
const structuralElement = (type, data) => Schema.make(Schema.optionalKey(Schema.Undefined).ast).annotate({
|
|
46
54
|
[STRUCTURAL_ONLY_SYMBOL]: true,
|
|
47
55
|
[STRUCTURAL_TYPE_SYMBOL]: type,
|
|
48
56
|
...data
|
|
@@ -50,6 +58,11 @@ const structuralElement = (type, data) => Schema.Undefined.annotations({
|
|
|
50
58
|
const StructuralOnly = structuralElement("structural");
|
|
51
59
|
const Divider = structuralElement("divider");
|
|
52
60
|
const TextBlock = (text) => structuralElement("textblock", { [TEXTBLOCK_CONTENT_SYMBOL]: text });
|
|
61
|
+
/** Display-only list: blank lines separate items; an empty body hides the list. */
|
|
62
|
+
const TextList = (heading) => structuralElement("text-list", {
|
|
63
|
+
[FormLabel]: heading,
|
|
64
|
+
[TEXTBLOCK_CONTENT_SYMBOL]: ""
|
|
65
|
+
});
|
|
53
66
|
const DynamicTextBlock = (options) => structuralElement("textblock", {
|
|
54
67
|
[TEXTBLOCK_CONTENT_SYMBOL]: options.text,
|
|
55
68
|
[TEXTBLOCK_DYNAMIC_CONTENT_SYMBOL]: options.resolve
|
|
@@ -101,13 +114,13 @@ const applyFieldAnnotations = (schema, options) => {
|
|
|
101
114
|
if (options.readOnly !== void 0) annotations[FormReadOnly] = options.readOnly;
|
|
102
115
|
if (isFieldPermissionMetadata(options.permission)) annotations[FormPermission] = options.permission;
|
|
103
116
|
if (options.default !== void 0) annotations[FormDefault] = options.default;
|
|
104
|
-
return Object.getOwnPropertySymbols(annotations).length > 0 ? schema.
|
|
117
|
+
return Object.getOwnPropertySymbols(annotations).length > 0 ? schema.annotate(annotations) : schema;
|
|
105
118
|
};
|
|
106
119
|
function TextField(options) {
|
|
107
120
|
return applyFieldAnnotations(Schema.String, options);
|
|
108
121
|
}
|
|
109
122
|
function TextArea(options) {
|
|
110
|
-
return applyFieldAnnotations(Schema.String.
|
|
123
|
+
return applyFieldAnnotations(Schema.String.annotate({ [FormTextAreaInput]: true }), options);
|
|
111
124
|
}
|
|
112
125
|
/**
|
|
113
126
|
* Create a text field from a transformation schema
|
|
@@ -135,7 +148,13 @@ const isHttpsUrl = (value) => isURL(value, {
|
|
|
135
148
|
require_protocol: true,
|
|
136
149
|
require_tld: true
|
|
137
150
|
});
|
|
138
|
-
const httpsUrlSchema = Schema.String.pipe(Schema.
|
|
151
|
+
const httpsUrlSchema = Schema.String.pipe(Schema.check(Schema.makeFilter(isHttpsUrl, {
|
|
152
|
+
message: "Must be a valid HTTPS URL (e.g. https://example.com/path)",
|
|
153
|
+
arbitraryConstraint: { patterns: [{
|
|
154
|
+
source: "^https://[a-z]{3,12}\\.example\\.com$",
|
|
155
|
+
flags: ""
|
|
156
|
+
}] }
|
|
157
|
+
})));
|
|
139
158
|
/**
|
|
140
159
|
* Create an HTTPS URL text field with built-in validation via
|
|
141
160
|
* `validator.js`.
|
|
@@ -171,27 +190,32 @@ const NumberField = (options) => applyFieldAnnotations(Schema.Number, options);
|
|
|
171
190
|
* @example
|
|
172
191
|
* ```typescript
|
|
173
192
|
* const schema = Schema.Struct({
|
|
174
|
-
* age: NumberFieldFrom(
|
|
193
|
+
* age: NumberFieldFrom(NumberFromString, { label: "Your age" })
|
|
175
194
|
* })
|
|
176
195
|
* ```
|
|
177
196
|
*/
|
|
178
197
|
const NumberFieldFrom = (schema, options) => {
|
|
179
|
-
const base = options?.required ? schema.
|
|
180
|
-
jsonSchema: { minLength: 1 },
|
|
198
|
+
const base = options?.required ? schema.pipe(Schema.encodeTo(Schema.toEncoded(schema).check(Schema.makeFilter((value) => typeof value !== "string" || value.length > 0, { toJsonSchema: () => ({ minLength: 1 }) })))).annotate({
|
|
181
199
|
[FormRequired]: true,
|
|
182
200
|
[FormNumberInput]: true
|
|
183
|
-
}) : schema.
|
|
201
|
+
}) : schema.annotate({ [FormNumberInput]: true });
|
|
184
202
|
return applyFieldAnnotations(base, options);
|
|
185
203
|
};
|
|
186
|
-
const DateField = (options) => applyFieldAnnotations(Schema.
|
|
187
|
-
const
|
|
188
|
-
|
|
189
|
-
|
|
204
|
+
const DateField = (options) => applyFieldAnnotations(Schema.DateTimeUtcFromString.annotate({ [FormDateInput]: true }), options);
|
|
205
|
+
const localDateTimePattern = /\d{4}-\d{2}-\d{2} (?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d)?/;
|
|
206
|
+
/** A wall-clock date and time. The caller interprets it in the intended zone. */
|
|
207
|
+
const LocalDateTimeField = (options) => applyFieldAnnotations(Schema.String.check(Schema.isPattern(new RegExp(`^(?:${localDateTimePattern.source})${options?.required ? "" : "?"}$`), { message: "Choose a date and enter a time." })).annotate({
|
|
208
|
+
[FormLocalDateTimeInput]: true,
|
|
209
|
+
...options?.required ? { [FormRequired]: true } : {}
|
|
210
|
+
}), options);
|
|
211
|
+
const requiredBooleanSchema = Schema.Boolean.pipe(Schema.check(Schema.makeFilter((b) => b === true, {
|
|
212
|
+
message: "This field is required",
|
|
213
|
+
toJsonSchema: () => ({
|
|
190
214
|
type: "boolean",
|
|
191
215
|
enum: [true]
|
|
192
|
-
},
|
|
216
|
+
}),
|
|
193
217
|
[FormRequired]: true
|
|
194
|
-
}));
|
|
218
|
+
})));
|
|
195
219
|
/**
|
|
196
220
|
* Create a boolean field with optional label and description
|
|
197
221
|
*
|
|
@@ -229,7 +253,7 @@ const FileField = (options) => {
|
|
|
229
253
|
...options.accept != null && { accept: options.accept },
|
|
230
254
|
...options.maxSize != null && { maxSize: options.maxSize }
|
|
231
255
|
};
|
|
232
|
-
const base = Schema.String.
|
|
256
|
+
const base = Schema.String.annotate({ [FormFileInput]: metadata });
|
|
233
257
|
return applyFieldAnnotations(base, options);
|
|
234
258
|
};
|
|
235
259
|
/**
|
|
@@ -249,7 +273,7 @@ const FileField = (options) => {
|
|
|
249
273
|
*/
|
|
250
274
|
const ListField = (itemFields, options) => {
|
|
251
275
|
const schema = Schema.Array(Schema.Struct(itemFields));
|
|
252
|
-
const annotatedSchema = options?.addButtonLabel === void 0 ? schema : schema.
|
|
276
|
+
const annotatedSchema = options?.addButtonLabel === void 0 ? schema : schema.annotate({ [FormListInput]: { addButtonLabel: options.addButtonLabel } });
|
|
253
277
|
return applyFieldAnnotations(annotatedSchema, options);
|
|
254
278
|
};
|
|
255
279
|
/**
|
|
@@ -258,14 +282,16 @@ const ListField = (itemFields, options) => {
|
|
|
258
282
|
* The row field labels become the table column headings. Table fields are for
|
|
259
283
|
* display only and are excluded from form submissions via the read-only marker.
|
|
260
284
|
*/
|
|
261
|
-
const TableField = (itemFields, options) => applyFieldAnnotations(Schema.Array(Schema.Struct(itemFields)).
|
|
285
|
+
const TableField = (itemFields, options) => applyFieldAnnotations(Schema.Array(Schema.Struct(itemFields)).annotate({ [FormTableInput]: true }), {
|
|
262
286
|
...options,
|
|
263
287
|
readOnly: true
|
|
264
288
|
});
|
|
289
|
+
/** Choices are presentation, not an eligibility constraint: retain unavailable IDs. */
|
|
290
|
+
const CheckboxGroupField = (options) => applyFieldAnnotations(Schema.Array(Schema.String).check(Schema.makeFilter((values) => new Set(values).size === values.length || "Select each value only once.")).annotate({ [FormCheckboxGroupInput]: { options: options.options } }), options);
|
|
265
291
|
const RadioField = (options) => {
|
|
266
292
|
const values = options.options.map((option) => option.value);
|
|
267
293
|
const metadata = { options: options.options };
|
|
268
|
-
return applyFieldAnnotations(Schema.
|
|
294
|
+
return applyFieldAnnotations(Schema.Literals(values).annotate({ [FormRadioInput]: metadata }), options);
|
|
269
295
|
};
|
|
270
296
|
/**
|
|
271
297
|
* Create a searchable lookup/select field.
|
|
@@ -296,8 +322,14 @@ const RadioField = (options) => {
|
|
|
296
322
|
* ```
|
|
297
323
|
*/
|
|
298
324
|
const LookupField = (options) => {
|
|
299
|
-
|
|
300
|
-
const
|
|
325
|
+
if (options.mode === "local" && (!Number.isSafeInteger(options.maxItems) || options.maxItems < 1)) throw new Error("Local lookup maxItems must be a positive safe integer");
|
|
326
|
+
const metadata = {
|
|
327
|
+
...options.resolve != null && { resolve: options.resolve },
|
|
328
|
+
...options.mode != null && { mode: options.mode },
|
|
329
|
+
...options.mode === "local" && { maxItems: options.maxItems },
|
|
330
|
+
...options.query != null && { query: options.query }
|
|
331
|
+
};
|
|
332
|
+
const base = Schema.String.check(Schema.isMinLength(1, { message: "Select an option from the suggestions." })).annotate({ [FormLookupInput]: metadata });
|
|
301
333
|
return applyFieldAnnotations(base, options);
|
|
302
334
|
};
|
|
303
335
|
/**
|
|
@@ -309,7 +341,7 @@ const LookupField = (options) => {
|
|
|
309
341
|
*/
|
|
310
342
|
const SuggestionField = (options) => {
|
|
311
343
|
const metadata = { ...options.query != null && { query: options.query } };
|
|
312
|
-
const base = Schema.String.
|
|
344
|
+
const base = Schema.String.annotate({
|
|
313
345
|
[FormLookupInput]: metadata,
|
|
314
346
|
[FormSuggestionInput]: true
|
|
315
347
|
});
|
|
@@ -324,7 +356,7 @@ const CalendarSlotField = (options) => {
|
|
|
324
356
|
...options.emptyMessageHtml != null && { emptyMessageHtml: options.emptyMessageHtml },
|
|
325
357
|
...options.loadErrorMessageHtml != null && { loadErrorMessageHtml: options.loadErrorMessageHtml }
|
|
326
358
|
};
|
|
327
|
-
return applyFieldAnnotations(Schema.String.
|
|
359
|
+
return applyFieldAnnotations(Schema.String.annotate({ [FormCalendarSlotInput]: metadata }), options);
|
|
328
360
|
};
|
|
329
361
|
/**
|
|
330
362
|
* Create a provider-user field.
|
|
@@ -333,36 +365,33 @@ const CalendarSlotField = (options) => {
|
|
|
333
365
|
* email. `CurrentProviderUser` can be used as a symbolic default for later
|
|
334
366
|
* runtime resolution.
|
|
335
367
|
*/
|
|
336
|
-
const ProviderUserField = (options) => applyFieldAnnotations(Schema.String.
|
|
337
|
-
|
|
338
|
-
//#region ../form-schema/src/lib/annotation-helpers.ts
|
|
368
|
+
const ProviderUserField = (options) => applyFieldAnnotations(Schema.String.annotate({ [FormProviderUserInput]: true }), options);
|
|
369
|
+
// ../form-schema/src/lib/annotation-helpers.ts
|
|
339
370
|
/** Look through field wrappers on the encoded side, never into container children. */
|
|
340
371
|
const fieldAnnotation = (ast, key) => {
|
|
341
|
-
const direct = ast.annotations
|
|
372
|
+
const direct = Reflect.get(ast.context?.annotations ?? {}, key) ?? ast.checks?.toReversed().map((check) => Reflect.get(check.annotations ?? {}, key)).find((value) => value !== void 0) ?? Reflect.get(ast.annotations ?? {}, key);
|
|
342
373
|
if (direct !== void 0) return direct;
|
|
343
|
-
if (ast.
|
|
374
|
+
if (ast.encoding) for (const link of ast.encoding) {
|
|
375
|
+
const value = fieldAnnotation(link.to, key);
|
|
376
|
+
if (value !== void 0) return value;
|
|
377
|
+
}
|
|
344
378
|
if (ast._tag === "Union") for (const type of ast.types) {
|
|
345
379
|
const value = fieldAnnotation(type, key);
|
|
346
380
|
if (value !== void 0) return value;
|
|
347
381
|
}
|
|
348
382
|
};
|
|
349
383
|
/** Property annotations override the underlying encoded field's annotations. */
|
|
350
|
-
const fieldInputAst = (field) =>
|
|
351
|
-
...field.ast.from.annotations,
|
|
352
|
-
...field.ast.to.annotations
|
|
353
|
-
}) : field.ast;
|
|
384
|
+
const fieldInputAst = (field) => field.ast;
|
|
354
385
|
const hasStructuralOnlyAnnotation = (field) => fieldAnnotation(fieldInputAst(field), STRUCTURAL_ONLY_SYMBOL) !== void 0;
|
|
355
386
|
const hasFlattenAnnotation = (field) => fieldAnnotation(fieldInputAst(field), FLATTEN_SYMBOL) !== void 0;
|
|
356
387
|
const isReadOnlyField = (field) => fieldAnnotation(fieldInputAst(field), FormReadOnly) === true;
|
|
357
|
-
|
|
358
|
-
//#region ../form-schema/src/lib/deferred-value.ts
|
|
388
|
+
// ../form-schema/src/lib/deferred-value.ts
|
|
359
389
|
/** An opaque authoring-time value. Only the owning Form can resolve it. */
|
|
360
390
|
const DeferredValueTypeId = Symbol.for("pf/form/deferred-value");
|
|
361
391
|
const isDeferredValue = (value) => typeof value === "object" && value !== null && DeferredValueTypeId in value && value[DeferredValueTypeId] === true && "fallback" in value;
|
|
362
392
|
/** Internal annotation for a deferred structural leaf, never a value schema. */
|
|
363
393
|
const FormDeferredContent = Symbol.for("pf/form/deferred-content");
|
|
364
|
-
|
|
365
|
-
//#region ../form-schema/src/lib/email.ts
|
|
394
|
+
// ../form-schema/src/lib/email.ts
|
|
366
395
|
/**
|
|
367
396
|
* Email schema using validator.js for robust email validation.
|
|
368
397
|
*
|
|
@@ -382,23 +411,22 @@ const FormDeferredContent = Symbol.for("pf/form/deferred-content");
|
|
|
382
411
|
* })
|
|
383
412
|
* ```
|
|
384
413
|
*/
|
|
385
|
-
const Email = Schema.Trim.pipe(Schema.
|
|
414
|
+
const Email = Schema.Trim.pipe(Schema.check(Schema.makeFilter((s) => isEmail(s, {
|
|
386
415
|
require_tld: false,
|
|
387
416
|
allow_utf8_local_part: true,
|
|
388
417
|
allow_ip_domain: true
|
|
389
|
-
}), { message:
|
|
418
|
+
}), { message: "must be a valid email address" })), Schema.annotate({
|
|
390
419
|
identifier: "Email",
|
|
391
420
|
title: "Email address",
|
|
392
421
|
description: "A valid email address",
|
|
393
|
-
|
|
422
|
+
format: "email",
|
|
394
423
|
[FormEmailInput]: true
|
|
395
424
|
}));
|
|
396
425
|
const EmailField = (options) => applyFieldAnnotations(Email, {
|
|
397
426
|
autoComplete: options?.autoComplete ?? "email",
|
|
398
427
|
...options
|
|
399
428
|
});
|
|
400
|
-
|
|
401
|
-
//#region ../form-schema/src/lib/field-count.ts
|
|
429
|
+
// ../form-schema/src/lib/field-count.ts
|
|
402
430
|
const isKeyObject = (segment) => typeof segment === "object" && segment !== null && "key" in segment && typeof segment.key !== "undefined";
|
|
403
431
|
const extractKey = (segment) => {
|
|
404
432
|
if (segment === void 0) return void 0;
|
|
@@ -414,13 +442,13 @@ const extractKey = (segment) => {
|
|
|
414
442
|
*/
|
|
415
443
|
const countInvalidFields = (schema, data) => {
|
|
416
444
|
const contextFreeSchema = schema;
|
|
417
|
-
const result = Schema.
|
|
445
|
+
const result = Schema.decodeUnknownResult(contextFreeSchema)(data, {
|
|
418
446
|
errors: "all",
|
|
419
447
|
onExcessProperty: "ignore"
|
|
420
448
|
});
|
|
421
|
-
if (
|
|
422
|
-
const issues =
|
|
423
|
-
return new Set(issues.map((issue) => extractKey(issue.path[0])).filter((key) => key !== void 0)).size;
|
|
449
|
+
if (Result.isSuccess(result)) return 0;
|
|
450
|
+
const issues = SchemaIssue.makeFormatterStandardSchemaV1()(result.failure.issue).issues;
|
|
451
|
+
return new Set(issues.map((issue) => extractKey(issue.path?.[0])).filter((key) => key !== void 0)).size;
|
|
424
452
|
};
|
|
425
453
|
/**
|
|
426
454
|
* Counts the total number of fields in a schema.
|
|
@@ -445,8 +473,39 @@ const calculateFieldCompletion = (schema, data) => {
|
|
|
445
473
|
totalFields
|
|
446
474
|
};
|
|
447
475
|
};
|
|
448
|
-
|
|
449
|
-
|
|
476
|
+
// ../form-schema/src/lib/form-presentation.ts
|
|
477
|
+
/** Request data only. The executable schema remains the source of field structure. */
|
|
478
|
+
const FormPresentation = Schema.Struct({
|
|
479
|
+
label: Schema.optional(Schema.String),
|
|
480
|
+
description: Schema.optional(Schema.String),
|
|
481
|
+
text: Schema.optional(Schema.String),
|
|
482
|
+
href: Schema.optional(Schema.String)
|
|
483
|
+
});
|
|
484
|
+
const FormRequestData = Schema.Struct({
|
|
485
|
+
presentation: Schema.Record(Schema.String, FormPresentation),
|
|
486
|
+
inaccessible: Schema.Array(Schema.String),
|
|
487
|
+
originalValues: Schema.Record(Schema.String, Schema.Unknown),
|
|
488
|
+
lookups: Schema.optional(Schema.Record(Schema.String, Schema.Struct({
|
|
489
|
+
dependencies: Schema.Array(Schema.String),
|
|
490
|
+
queryName: Schema.String
|
|
491
|
+
}))),
|
|
492
|
+
prefill: Schema.optional(Schema.Struct({
|
|
493
|
+
dependency: Schema.String,
|
|
494
|
+
fields: Schema.Array(Schema.String),
|
|
495
|
+
concealed: Schema.Array(Schema.String),
|
|
496
|
+
queryName: Schema.String
|
|
497
|
+
}))
|
|
498
|
+
});
|
|
499
|
+
// ../form-schema/src/lib/number-from-string.ts
|
|
500
|
+
/** Preserve the authored numeric-string contract, including explicit non-finite values. */
|
|
501
|
+
const NumberFromString = Schema.String.pipe(Schema.decodeTo(Schema.Number, {
|
|
502
|
+
decode: SchemaGetter.transformEffect((value) => {
|
|
503
|
+
const parsed = Number$1.parse(value);
|
|
504
|
+
return Option.isSome(parsed) ? Effect.succeed(parsed.value) : Effect.fail(new SchemaIssue.InvalidValue({ message: "Must be a numeric string" }, value));
|
|
505
|
+
}),
|
|
506
|
+
encode: SchemaGetter.transform(String)
|
|
507
|
+
}));
|
|
508
|
+
// ../form-schema/src/lib/phone.ts
|
|
450
509
|
/**
|
|
451
510
|
* Validates a phone number using practical rules:
|
|
452
511
|
* - Must contain only digits, spaces, dashes, parentheses, and plus sign
|
|
@@ -474,25 +533,18 @@ const isPhoneNumber = (s) => {
|
|
|
474
533
|
const digitCount = countDigits(s);
|
|
475
534
|
return digitCount >= 7 && digitCount <= 15;
|
|
476
535
|
};
|
|
477
|
-
const Phone = Schema.Trim.pipe(Schema.
|
|
536
|
+
const Phone = Schema.Trim.pipe(Schema.check(Schema.makeFilter((s) => isPhoneNumber(s), { message: "must be a valid phone number (7-15 digits)" })), Schema.annotate({
|
|
478
537
|
identifier: "Phone",
|
|
479
538
|
title: "Phone number",
|
|
480
539
|
description: "A valid phone number",
|
|
481
|
-
|
|
540
|
+
format: "phone",
|
|
482
541
|
[FormPhoneInput]: true
|
|
483
542
|
}));
|
|
484
543
|
const PhoneField = (options) => applyFieldAnnotations(Phone, {
|
|
485
544
|
autoComplete: options?.autoComplete ?? "tel",
|
|
486
545
|
...options
|
|
487
546
|
});
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
const signature = field.ast;
|
|
493
|
-
if (signature._tag === "PropertySignatureDeclaration") return Schema.makePropertySignature(new Schema.PropertySignatureDeclaration(map(signature.type, "input"), signature.isOptional, signature.isReadonly, mapAnnotations(signature.annotations, signature.type, "input"), signature.defaultValue));
|
|
494
|
-
const { from, to } = signature;
|
|
495
|
-
return Schema.makePropertySignature(new Schema.PropertySignatureTransformation(new Schema.FromPropertySignature(map(from.type, "input"), from.isOptional, from.isReadonly, mapAnnotations(from.annotations, from.type, "input"), from.fromKey), new Schema.ToPropertySignature(map(to.type, "output"), to.isOptional, to.isReadonly, mapAnnotations(to.annotations, from.type, "output"), to.defaultValue), signature.decode, signature.encode));
|
|
496
|
-
};
|
|
497
|
-
//#endregion
|
|
498
|
-
export { Wrapper as $, LINK_URL_SYMBOL as A, RadioField as B, FLATTEN_SYMBOL as C, FormRequired as Ct, LINK_COLOR_SYMBOL as D, FormTextAreaInput as Dt, Image as E, FormTableInput as Et, METRIC_BREAKDOWN_SYMBOL as F, SuggestionField as G, STRUCTURAL_ONLY_SYMBOL as H, MetricBreakdown as I, TableField as J, TEXTBLOCK_CONTENT_SYMBOL as K, NumberField as L, LinkButton as M, ListField as N, LINK_DISPLAY_SYMBOL as O, LookupField as P, TextFieldFrom as Q, NumberFieldFrom as R, DynamicTextBlock as S, FormReadOnly as St, HttpsUrlField as T, FormSuggestionInput as Tt, STRUCTURAL_TYPE_SYMBOL as U, ReadOnly as V, StructuralOnly as W, TextBlock as X, TextArea as Y, TextField as Z, BooleanField as _, FormNumberInput as _t, countInvalidFields as a, FormAutoComplete as at, DateField as b, FormProviderUserInput as bt, EmailField as c, FormDateInput as ct, isDeferredValue as d, FormEmailInput as dt, applyFieldAnnotations as et, fieldAnnotation as f, FormFileInput as ft, isReadOnlyField as g, FormMessage as gt, hasStructuralOnlyAnnotation as h, FormLookupInput as ht, calculateFieldCompletion as i, isMetricBreakdownOptions as it, Link as j, LINK_TEXT_SYMBOL as k, DeferredValueTypeId as l, FormDefault as lt, hasFlattenAnnotation as m, FormListInput as mt, Phone as n, isHttpsUrl as nt, countTotalFields as o, FormCalendarSlotInput as ot, fieldInputAst as p, FormLabel as pt, TEXTBLOCK_DYNAMIC_CONTENT_SYMBOL as q, PhoneField as r, isListFieldMetadata as rt, Email as s, FormComponentPluginType as st, mapFormPropertySignature as t, isFieldPermissionMetadata as tt, FormDeferredContent as u, FormDescription as ut, CalendarSlotField as v, FormPermission as vt, FileField as w, FormStaticText as wt, Divider as x, FormRadioInput as xt, CurrentProviderUser as y, FormPhoneInput as yt, ProviderUserField as z };
|
|
547
|
+
// ../form-schema/src/lib/public-completion-correction.ts
|
|
548
|
+
/** System-owned correction has its own authorization and submission operation. */
|
|
549
|
+
const publicCompletionCorrectionForm = Schema.Struct({ correctedEmail: EmailField({ label: "Corrected email" }) });
|
|
550
|
+
export { TableField as $, Image as A, FormProviderUserInput as At, METRIC_BREAKDOWN_SYMBOL as B, CurrentProviderUser as C, FormLocalDateTimeInput as Ct, FLATTEN_SYMBOL as D, FormPermission as Dt, DynamicTextBlock as E, FormNumberInput as Et, Link as F, FormSuggestionInput as Ft, RadioField as G, NumberField as H, LinkButton as I, FormTableInput as It, STRUCTURAL_TYPE_SYMBOL as J, ReadOnly as K, ListField as L, FormTextAreaInput as Lt, LINK_DISPLAY_SYMBOL as M, FormReadOnly as Mt, LINK_TEXT_SYMBOL as N, FormRequired as Nt, FileField as O, FormPhoneInput as Ot, LINK_URL_SYMBOL as P, FormStaticText as Pt, TEXTBLOCK_DYNAMIC_CONTENT_SYMBOL as Q, LocalDateTimeField as R, CheckboxGroupField as S, FormListInput as St, Divider as T, FormMessage as Tt, NumberFieldFrom as U, MetricBreakdown as V, ProviderUserField as W, SuggestionField as X, StructuralOnly as Y, TEXTBLOCK_CONTENT_SYMBOL as Z, hasFlattenAnnotation as _, FormDefault as _t, FormPresentation as a, Wrapper as at, BooleanField as b, FormFileInput as bt, countInvalidFields as c, isHttpsUrl as ct, EmailField as d, FormAutoComplete as dt, TextArea as et, DeferredValueTypeId as f, FormAutoFocus as ft, fieldInputAst as g, FormDateInput as gt, fieldAnnotation as h, FormComponentPluginType as ht, NumberFromString as i, TextList as it, LINK_COLOR_SYMBOL as j, FormRadioInput as jt, HttpsUrlField as k, FormPluginData as kt, countTotalFields as l, isListFieldMetadata as lt, isDeferredValue as m, FormCheckboxGroupInput as mt, Phone as n, TextField as nt, FormRequestData as o, applyFieldAnnotations as ot, FormDeferredContent as p, FormCalendarSlotInput as pt, STRUCTURAL_ONLY_SYMBOL as q, PhoneField as r, TextFieldFrom as rt, calculateFieldCompletion as s, isFieldPermissionMetadata as st, publicCompletionCorrectionForm as t, TextBlock as tt, Email as u, isMetricBreakdownOptions as ut, hasStructuralOnlyAnnotation as v, FormDescription as vt, DateField as w, FormLookupInput as wt, CalendarSlotField as x, FormLabel as xt, isReadOnlyField as y, FormEmailInput as yt, LookupField as z };
|
package/dist/testing.d.ts
CHANGED
package/dist/testing.mjs
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
//#region src/testing.ts
|
|
1
|
+
// src/testing.ts
|
|
3
2
|
const validateOrganisation = (organisation) => organisation.processes().flatMap((process) => Object.values(process.validateFlows()).flat().map((message) => `${process.node.path}: ${message}`));
|
|
4
|
-
|
|
5
|
-
export { evaluateFormRules, formRuleConditionPaths, formRuleReferencesFieldNames, validateOrganisation };
|
|
3
|
+
export { validateOrganisation };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "processfocus",
|
|
3
|
-
"version": "0.1.0-next.
|
|
3
|
+
"version": "0.1.0-next.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"repository": {
|
|
@@ -45,14 +45,14 @@
|
|
|
45
45
|
"./package.json": "./package.json"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@processfocus/runtime": "0.1.0-next.
|
|
48
|
+
"@processfocus/runtime": "0.1.0-next.4",
|
|
49
49
|
"constructs": "^10.8.1",
|
|
50
|
-
"effect": "
|
|
50
|
+
"effect": "4.1.4",
|
|
51
51
|
"graphology": "^0.26.0",
|
|
52
52
|
"validator": "^13.15.35"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"react": "^19.3.
|
|
55
|
+
"react": "^19.3.1"
|
|
56
56
|
},
|
|
57
57
|
"publishConfig": {
|
|
58
58
|
"access": "public",
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { Effect, Schema } from "effect";
|
|
2
|
-
import type { ClientRepresentation } from "./types.js";
|
|
3
|
-
import { type WalkError } from "./walker.js";
|
|
4
|
-
/**
|
|
5
|
-
* Convert an Effect Schema.Struct to its client-side form representation
|
|
6
|
-
*
|
|
7
|
-
* This function walks the schema's AST and generates a typed structure
|
|
8
|
-
* that mirrors the schema's type shape, with each field mapped to its
|
|
9
|
-
* corresponding form component (TextField, NumberField, etc.).
|
|
10
|
-
*
|
|
11
|
-
* **IMPORTANT**: Only Schema.Struct is supported. The type system prevents
|
|
12
|
-
* passing any other schema type at compile time.
|
|
13
|
-
*
|
|
14
|
-
* @param schema - The Effect Schema.Struct to convert
|
|
15
|
-
* @returns An Effect that produces the client representation
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* ```typescript
|
|
19
|
-
* const schema = Schema.Struct({
|
|
20
|
-
* username: Schema.String,
|
|
21
|
-
* age: Schema.NumberFromString,
|
|
22
|
-
* })
|
|
23
|
-
*
|
|
24
|
-
* const representation = await Effect.runPromise(asClientRepresentation(schema))
|
|
25
|
-
* // {
|
|
26
|
-
* // username: { field: "username", type: "text", label: "Username", ... },
|
|
27
|
-
* // age: { field: "age", _tag: "number", label: "Age", ... }
|
|
28
|
-
* // }
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
export declare const asClientRepresentation: <const Fields extends Schema.Struct.Fields>(schema: Schema.Struct<Fields>) => Effect.Effect<ClientRepresentation<Schema.Struct<Fields>>, WalkError>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type FormRule } from "../../../form-rule/src/index.js";
|
|
2
|
-
import { type FormComponent } from "./types.js";
|
|
3
|
-
export interface ClientFormDefinition {
|
|
4
|
-
readonly components: Readonly<Record<string, FormComponent>>;
|
|
5
|
-
readonly rules: readonly FormRule[];
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Projects a definition through an already-authorized field set. A rule is
|
|
9
|
-
* removed as a unit when any condition, effect, or otherwise path references
|
|
10
|
-
* an omitted field.
|
|
11
|
-
*/
|
|
12
|
-
export declare const omitClientFormDefinitionFields: (definition: ClientFormDefinition, omittedFieldNames: ReadonlySet<string>) => ClientFormDefinition;
|
|
13
|
-
/** Browser-safe structural validation for form component JSON. */
|
|
14
|
-
export declare const isFormComponent: (value: unknown) => value is FormComponent;
|
|
15
|
-
export declare const isClientFormDefinition: (value: unknown) => value is ClientFormDefinition;
|
|
16
|
-
export declare const parseClientFormDefinition: (value: unknown, path?: string) => ClientFormDefinition;
|
|
17
|
-
export declare const parseNullableClientFormDefinition: (value: unknown, path?: string) => ClientFormDefinition | null;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type * as AST from "effect/SchemaAST";
|
|
2
|
-
import type { ClientFieldPermissionMetadata } from "./types.js";
|
|
3
|
-
/**
|
|
4
|
-
* Metadata extracted from Effect Schema annotations.
|
|
5
|
-
* Property names match BaseFormComponent for spreading.
|
|
6
|
-
*/
|
|
7
|
-
export interface FieldMetadata {
|
|
8
|
-
label: string;
|
|
9
|
-
description?: string;
|
|
10
|
-
autoComplete?: string;
|
|
11
|
-
readonly?: boolean;
|
|
12
|
-
required?: boolean;
|
|
13
|
-
content?: string;
|
|
14
|
-
permission?: ClientFieldPermissionMetadata;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Extract FormLabel, FormDescription, and FormReadOnly annotations from AST.
|
|
18
|
-
* Note: FormDefault is handled separately at runtime when process state is available.
|
|
19
|
-
*/
|
|
20
|
-
export declare const extractAnnotations: (annotations: AST.Annotations, fieldName: string) => FieldMetadata;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Compatibility surface for the shared public runtime registry. Keeping the
|
|
3
|
-
* state in one published module prevents private runtimes and internal form
|
|
4
|
-
* walkers from registering against different singleton instances.
|
|
5
|
-
*/
|
|
6
|
-
export { type PluginScript, type WalkerPlugin, cleanupAllPlugins, getMatchingPlugin, registerWalkerPlugin, unregisterWalkerPlugin, } from "@processfocus/runtime";
|