processfocus 0.1.0-next.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.
Files changed (98) hide show
  1. package/LICENSE.md +28 -0
  2. package/README.md +14 -0
  3. package/dist/auth-FmXptohB.mjs +275 -0
  4. package/dist/auth-config/src/lib/authentication-config.d.ts +146 -0
  5. package/dist/auth-config/src/lib/custom-entities-config.d.ts +47 -0
  6. package/dist/auth-config/src/lib/policies-config.d.ts +52 -0
  7. package/dist/auth-config/src/lib/provider-types.d.ts +194 -0
  8. package/dist/auth.d.ts +4 -0
  9. package/dist/auth.mjs +2 -0
  10. package/dist/business-calendar/src/index.d.ts +10 -0
  11. package/dist/business-calendar/src/lib/calendar-config.d.ts +163 -0
  12. package/dist/business-calendar/src/lib/calendar-period.d.ts +88 -0
  13. package/dist/business-calendar/src/lib/calendar-service-impl.d.ts +19 -0
  14. package/dist/business-calendar/src/lib/calendar-service.d.ts +215 -0
  15. package/dist/business-calendar/src/lib/datetime-utils.d.ts +30 -0
  16. package/dist/business-calendar/src/lib/duration-calculator.d.ts +49 -0
  17. package/dist/business-calendar/src/lib/errors.d.ts +69 -0
  18. package/dist/business-calendar/src/lib/holiday-calculator.d.ts +61 -0
  19. package/dist/business-calendar/src/lib/holidays.d.ts +141 -0
  20. package/dist/business-calendar/src/lib/types.d.ts +110 -0
  21. package/dist/calendar.d.ts +1 -0
  22. package/dist/calendar.mjs +1204 -0
  23. package/dist/form-client-representation/src/index.d.ts +6 -0
  24. package/dist/form-client-representation/src/lib/as-client-representation.d.ts +31 -0
  25. package/dist/form-client-representation/src/lib/client-form-definition.d.ts +17 -0
  26. package/dist/form-client-representation/src/lib/extract-annotations.d.ts +20 -0
  27. package/dist/form-client-representation/src/lib/plugin-registry.d.ts +6 -0
  28. package/dist/form-client-representation/src/lib/types.d.ts +239 -0
  29. package/dist/form-client-representation/src/lib/walker.d.ts +68 -0
  30. package/dist/form-rule/src/index.d.ts +3 -0
  31. package/dist/form-rule/src/lib/evaluator.d.ts +2 -0
  32. package/dist/form-rule/src/lib/paths.d.ts +9 -0
  33. package/dist/form-rule/src/lib/types.d.ts +89 -0
  34. package/dist/form-schema/src/index.d.ts +8 -0
  35. package/dist/form-schema/src/lib/annotation-helpers.d.ts +8 -0
  36. package/dist/form-schema/src/lib/deferred-value.d.ts +10 -0
  37. package/dist/form-schema/src/lib/email.d.ts +23 -0
  38. package/dist/form-schema/src/lib/field-count.d.ts +32 -0
  39. package/dist/form-schema/src/lib/form-annotations.d.ts +25 -0
  40. package/dist/form-schema/src/lib/form-schema.d.ts +459 -0
  41. package/dist/form-schema/src/lib/phone.d.ts +4 -0
  42. package/dist/form-schema/src/lib/property-signature.d.ts +3 -0
  43. package/dist/form-submission-schema/src/index.d.ts +2 -0
  44. package/dist/form-submission-schema/src/lib/form-submission-schema.d.ts +49 -0
  45. package/dist/form-submission-schema/src/lib/schema-defaults.d.ts +16 -0
  46. package/dist/forms.d.ts +1 -0
  47. package/dist/forms.mjs +2 -0
  48. package/dist/frontend-manifest/src/index.d.ts +2 -0
  49. package/dist/frontend-manifest/src/lib/browser-plugin-artifact.d.ts +25 -0
  50. package/dist/frontend-manifest/src/lib/frontend-manifest.d.ts +83 -0
  51. package/dist/frontend-plugin-host/src/index.d.ts +2 -0
  52. package/dist/frontend-plugin-host/src/lib/frontend-plugin-host.d.ts +124 -0
  53. package/dist/index.d.ts +26 -0
  54. package/dist/index.mjs +3780 -0
  55. package/dist/manifest.d.ts +2 -0
  56. package/dist/manifest.mjs +5 -0
  57. package/dist/paths-BkzLn-rG.mjs +282 -0
  58. package/dist/plugin.d.ts +3 -0
  59. package/dist/plugin.mjs +84 -0
  60. package/dist/process/src/lib/app-icons.d.ts +52 -0
  61. package/dist/process/src/lib/brands.d.ts +20 -0
  62. package/dist/process/src/lib/document-store.d.ts +30 -0
  63. package/dist/process/src/lib/execution-failure-notifications.d.ts +14 -0
  64. package/dist/process/src/lib/flow-context.d.ts +181 -0
  65. package/dist/process/src/lib/flow-path.d.ts +123 -0
  66. package/dist/process/src/lib/form-authoring.d.ts +19 -0
  67. package/dist/process/src/lib/form-decoration.d.ts +13 -0
  68. package/dist/process/src/lib/form-defaults.d.ts +5 -0
  69. package/dist/process/src/lib/form.d.ts +557 -0
  70. package/dist/process/src/lib/invitation.d.ts +35 -0
  71. package/dist/process/src/lib/list.d.ts +447 -0
  72. package/dist/process/src/lib/lookup-accessor.d.ts +68 -0
  73. package/dist/process/src/lib/node_step.d.ts +68 -0
  74. package/dist/process/src/lib/org-unit.d.ts +53 -0
  75. package/dist/process/src/lib/org-utils.d.ts +56 -0
  76. package/dist/process/src/lib/organisation-frontend-plugin-manifest.d.ts +33 -0
  77. package/dist/process/src/lib/organisation.d.ts +166 -0
  78. package/dist/process/src/lib/phase.d.ts +16 -0
  79. package/dist/process/src/lib/process.d.ts +196 -0
  80. package/dist/process/src/lib/public-form-branding.d.ts +27 -0
  81. package/dist/process/src/lib/role.d.ts +29 -0
  82. package/dist/process/src/lib/schedule.d.ts +239 -0
  83. package/dist/process/src/lib/sla.d.ts +84 -0
  84. package/dist/process/src/lib/stats-view.d.ts +68 -0
  85. package/dist/process/src/lib/step.d.ts +130 -0
  86. package/dist/process/src/lib/system-step-executor.d.ts +130 -0
  87. package/dist/process/src/lib/system-step.d.ts +248 -0
  88. package/dist/sdk/src/auth.d.ts +4 -0
  89. package/dist/sdk/src/calendar.d.ts +1 -0
  90. package/dist/sdk/src/forms.d.ts +1 -0
  91. package/dist/sdk/src/index.d.ts +26 -0
  92. package/dist/sdk/src/manifest.d.ts +2 -0
  93. package/dist/sdk/src/plugin.d.ts +3 -0
  94. package/dist/sdk/src/testing.d.ts +9 -0
  95. package/dist/src-C-909PVQ.mjs +498 -0
  96. package/dist/testing.d.ts +9 -0
  97. package/dist/testing.mjs +5 -0
  98. package/package.json +67 -0
@@ -0,0 +1,459 @@
1
+ import type { DateTime, Effect } from "effect";
2
+ import { Schema } from "effect";
3
+ import type { DeferredValue, FormValue } from "./deferred-value.js";
4
+ export declare const FLATTEN_SYMBOL: unique symbol;
5
+ export declare const STRUCTURAL_ONLY_SYMBOL: unique symbol;
6
+ export declare const STRUCTURAL_TYPE_SYMBOL: unique symbol;
7
+ export declare const TEXTBLOCK_CONTENT_SYMBOL: unique symbol;
8
+ export declare const TEXTBLOCK_DYNAMIC_CONTENT_SYMBOL: unique symbol;
9
+ export declare const METRIC_BREAKDOWN_SYMBOL: unique symbol;
10
+ export declare const LINK_URL_SYMBOL: unique symbol;
11
+ export declare const LINK_TEXT_SYMBOL: unique symbol;
12
+ export declare const LINK_DISPLAY_SYMBOL: unique symbol;
13
+ export declare const LINK_COLOR_SYMBOL: unique symbol;
14
+ export type LinkButtonColor = "blue";
15
+ export interface LinkButtonOptions {
16
+ readonly color?: LinkButtonColor;
17
+ }
18
+ export interface DynamicTextBlockOptions {
19
+ /** Placeholder content shown when render-time resolution fails. */
20
+ readonly text: string;
21
+ /**
22
+ * Resolves the rendered text when form metadata is requested. Resolution
23
+ * failures are logged by the renderer and leave `text` in place. Any
24
+ * services used by the Effect must be available in the form metadata runtime;
25
+ * this is not compile-time enforced because the environment type is unknown.
26
+ */
27
+ readonly resolve: () => Effect.Effect<string, unknown, unknown>;
28
+ }
29
+ export type MetricBreakdownColor = "amber" | "emerald" | "rose" | "sky" | "slate" | "violet";
30
+ export interface MetricBreakdownBucket {
31
+ readonly label: string;
32
+ readonly amount?: number;
33
+ readonly description?: string;
34
+ readonly color?: MetricBreakdownColor;
35
+ }
36
+ export interface MetricBreakdownField {
37
+ readonly label: string;
38
+ readonly value?: string;
39
+ }
40
+ export interface MetricBreakdownSelectorOption {
41
+ readonly label: string;
42
+ readonly value: string;
43
+ }
44
+ export interface MetricBreakdownSelectorControl {
45
+ readonly type: "selector";
46
+ /** Item-query/GraphQL argument name for this control. */
47
+ readonly name: string;
48
+ /** Optional readable URL parameter key; value wiring is handled by callers. */
49
+ readonly urlParameter?: string;
50
+ readonly label: string;
51
+ readonly value?: string;
52
+ readonly options: readonly [
53
+ MetricBreakdownSelectorOption,
54
+ ...MetricBreakdownSelectorOption[]
55
+ ];
56
+ }
57
+ export type MetricBreakdownControl = MetricBreakdownSelectorControl;
58
+ export interface MetricBreakdownDataBucket {
59
+ readonly label: string;
60
+ readonly amount: number;
61
+ readonly description?: string;
62
+ readonly color?: MetricBreakdownColor;
63
+ }
64
+ export interface MetricBreakdownDataField {
65
+ readonly label: string;
66
+ readonly value: string;
67
+ }
68
+ export interface MetricBreakdownData {
69
+ readonly total: number;
70
+ readonly currency: string;
71
+ readonly badge?: string;
72
+ readonly fields: readonly MetricBreakdownDataField[];
73
+ readonly buckets: readonly MetricBreakdownDataBucket[];
74
+ }
75
+ export interface MetricBreakdownOptions {
76
+ readonly title: string;
77
+ readonly buckets: readonly MetricBreakdownBucket[];
78
+ readonly badge?: string;
79
+ readonly currency?: string;
80
+ readonly fields?: readonly MetricBreakdownField[];
81
+ readonly controls?: readonly MetricBreakdownControl[];
82
+ readonly contextFields?: readonly string[];
83
+ readonly dataSource?: "item";
84
+ readonly rendererPluginType?: string;
85
+ readonly rendererPluginData?: Record<string, unknown>;
86
+ }
87
+ export declare const CurrentProviderUser: unique symbol;
88
+ export type FlattenMarker = {
89
+ readonly __flatten: unique symbol;
90
+ };
91
+ export type StructuralOnlyMarker = {
92
+ readonly __structuralOnly: unique symbol;
93
+ };
94
+ export type ReadOnlyMarker = {
95
+ readonly __readOnly: unique symbol;
96
+ };
97
+ export type ProviderUserMarker = {
98
+ readonly __providerUser: unique symbol;
99
+ };
100
+ export type LookupMarker = {
101
+ readonly __lookup: unique symbol;
102
+ };
103
+ export type CalendarSlotMarker = {
104
+ readonly __calendarSlot: unique symbol;
105
+ };
106
+ /** Preserve read-only classification in downstream process-state inference. */
107
+ export declare const ReadOnly: <A, I, R>(schema: Schema.Schema<A, I, R>) => Schema.Schema<A, I, R> & ReadOnlyMarker;
108
+ type PresentationOnly<Field> = Field extends StructuralOnlyMarker ? true : Field extends FlattenMarker & {
109
+ readonly fields: infer Fields;
110
+ } ? Exclude<{
111
+ [Key in keyof Fields]-?: PresentationOnly<Exclude<Fields[Key], undefined>>;
112
+ }[keyof Fields], true> extends never ? true : false : false;
113
+ /** Optional definition keys are presentation only; optional values use Schema.optional. */
114
+ export type StableFormFields<Fields> = {
115
+ [Key in keyof Fields]: undefined extends Fields[Key] ? PresentationOnly<Exclude<Fields[Key], undefined>> extends true ? Fields[Key] : never : Fields[Key] extends {
116
+ readonly fields: infer Nested;
117
+ } ? Fields[Key] & {
118
+ readonly fields: StableFormFields<Nested>;
119
+ } : Fields[Key];
120
+ };
121
+ export declare const Wrapper: <Fields extends Schema.Struct.Fields>(fields: Fields & StableFormFields<NoInfer<Fields>>) => Schema.Struct<Fields> & FlattenMarker;
122
+ export declare const StructuralOnly: Schema.Schema.Any & StructuralOnlyMarker;
123
+ export declare const Divider: Schema.Schema.Any & StructuralOnlyMarker;
124
+ export declare const TextBlock: (text: string) => Schema.Schema.Any & StructuralOnlyMarker;
125
+ export declare const DynamicTextBlock: (options: DynamicTextBlockOptions) => Schema.Schema.Any & StructuralOnlyMarker;
126
+ export declare const Image: (src: string, alt?: string) => Schema.Schema.Any & StructuralOnlyMarker;
127
+ export declare const Link: (url: string, text: string) => Schema.Schema.Any & StructuralOnlyMarker;
128
+ export declare const LinkButton: (url: string, text: string, options?: LinkButtonOptions) => Schema.Schema.Any & StructuralOnlyMarker;
129
+ export declare const MetricBreakdown: (options: MetricBreakdownOptions) => Schema.Schema.Any & StructuralOnlyMarker;
130
+ export declare const isMetricBreakdownOptions: (value: unknown) => value is MetricBreakdownOptions;
131
+ /**
132
+ * Type for field options, generic over the field's value type.
133
+ * This ensures type safety for default values.
134
+ */
135
+ export interface FieldOptions<T = unknown> {
136
+ label?: FormValue<string>;
137
+ description?: FormValue<string>;
138
+ autoComplete?: FormValue<string>;
139
+ readOnly?: boolean;
140
+ permission?: FieldPermissionMetadata;
141
+ /**
142
+ * Default value for the field.
143
+ * Can be a static value or a function (closure) that returns the value.
144
+ * Must match the field's value type.
145
+ *
146
+ * @example Static default
147
+ * ```typescript
148
+ * TextField({ default: "N/A" })
149
+ * ```
150
+ *
151
+ * @example Lazy default using execution state
152
+ * ```typescript
153
+ * const flow = process.start(prevStep)
154
+ * new Form(flow, "Approval", {
155
+ * form: ({ value }) => ({
156
+ * cost: TextField({ default: value((state) => String(state.value)) }),
157
+ * count: NumberField({ default: value((state) => state.count) }),
158
+ * }),
159
+ * })
160
+ * ```
161
+ */
162
+ default?: FormValue<T> | (() => T);
163
+ }
164
+ export interface ListFieldMetadata {
165
+ readonly addButtonLabel?: string;
166
+ }
167
+ export declare const isListFieldMetadata: (value: unknown) => value is ListFieldMetadata;
168
+ export interface ListFieldOptions<T> extends FieldOptions<T> {
169
+ readonly addButtonLabel?: string;
170
+ }
171
+ export interface FieldPermissionRoleRef {
172
+ readonly node: {
173
+ readonly path: string;
174
+ };
175
+ }
176
+ export interface FieldPermissionMetadata {
177
+ readonly modify: FieldPermissionRoleRef;
178
+ }
179
+ export declare const isFieldPermissionMetadata: (value: unknown) => value is FieldPermissionMetadata;
180
+ export declare const applyFieldAnnotations: <A, I, R>(schema: Schema.Schema<A, I, R>, options?: FieldOptions<unknown>) => Schema.Schema<A, I, R>;
181
+ /**
182
+ * Create a text field with optional label and description
183
+ *
184
+ * @example
185
+ * ```typescript
186
+ * const schema = Schema.Struct({
187
+ * street: TextField({ label: "Street name", description: "Your street address" })
188
+ * })
189
+ * ```
190
+ */
191
+ export declare function TextField(options: FieldOptions<string> & {
192
+ readonly readOnly: true;
193
+ }): Schema.Schema<string, string, never> & ReadOnlyMarker;
194
+ export declare function TextField(options?: FieldOptions<string>): Schema.Schema<string, string, never>;
195
+ export declare function TextArea(options: FieldOptions<string> & {
196
+ readonly readOnly: true;
197
+ }): Schema.Schema<string, string, never> & ReadOnlyMarker;
198
+ export declare function TextArea(options?: FieldOptions<string>): Schema.Schema<string, string, never>;
199
+ /**
200
+ * Create a text field from a transformation schema
201
+ *
202
+ * @example
203
+ * ```typescript
204
+ * const schema = Schema.Struct({
205
+ * date: TextFieldFrom(Schema.DateFromString, { label: "Birth date" })
206
+ * })
207
+ * ```
208
+ */
209
+ export declare const TextFieldFrom: <I, R>(schema: Schema.Schema<string, I, R>, options?: FieldOptions<I>) => Schema.Schema<string, I, R>;
210
+ /**
211
+ * Validate that a string is a well-formed HTTPS URL.
212
+ *
213
+ * Uses `validator/lib/isURL` with `protocols: ["https"]` and
214
+ * `require_protocol: true` so bare hostnames and non-HTTPS schemes are
215
+ * rejected. TLDs are required to catch typos like `https://x`.
216
+ *
217
+ * Exported so server-side code (e.g. `updateRegion`) can reuse the same
218
+ * check without pulling in the full form-schema field constructor.
219
+ */
220
+ export declare const isHttpsUrl: (value: string) => boolean;
221
+ /**
222
+ * Create an HTTPS URL text field with built-in validation via
223
+ * `validator.js`.
224
+ *
225
+ * The pattern annotation guides Effect's arbitrary generator so that
226
+ * auto-generated test data produces valid HTTPS URLs. The `isHttpsUrl`
227
+ * filter then performs the real validation using `validator/lib/isURL`.
228
+ *
229
+ * @example
230
+ * ```typescript
231
+ * const schema = Schema.Struct({
232
+ * endpoint: HttpsUrlField({ label: "OTLP Endpoint" })
233
+ * })
234
+ * ```
235
+ */
236
+ export declare const HttpsUrlField: (options?: FieldOptions<string>) => Schema.Schema<string, string, never>;
237
+ /**
238
+ * Create a number field with optional label and description
239
+ *
240
+ * @example
241
+ * ```typescript
242
+ * const schema = Schema.Struct({
243
+ * age: NumberField({ label: "Your age", description: "Age in years" })
244
+ * })
245
+ * ```
246
+ */
247
+ export declare const NumberField: (options?: FieldOptions<number>) => Schema.Schema<number, number, never>;
248
+ /**
249
+ * Create a number field from a transformation schema
250
+ *
251
+ * @example
252
+ * ```typescript
253
+ * const schema = Schema.Struct({
254
+ * age: NumberFieldFrom(Schema.NumberFromString, { label: "Your age" })
255
+ * })
256
+ * ```
257
+ */
258
+ export declare const NumberFieldFrom: <I, R>(schema: Schema.Schema<number, I, R>, options?: FieldOptions<I> & {
259
+ required?: boolean;
260
+ }) => Schema.Schema<number, I, R>;
261
+ export declare const DateField: (options?: FieldOptions<string>) => Schema.Schema<DateTime.Utc, string, never>;
262
+ /**
263
+ * Create a boolean field with optional label and description
264
+ *
265
+ * When `required: true`, the field must be checked (true) to pass validation.
266
+ *
267
+ * @example
268
+ * ```typescript
269
+ * const schema = Schema.Struct({
270
+ * acceptTerms: BooleanField({ label: "Accept terms and conditions" }),
271
+ * approved: BooleanField({ label: "I approve", required: true })
272
+ * })
273
+ * ```
274
+ */
275
+ export declare const BooleanField: (options?: FieldOptions<boolean> & {
276
+ required?: boolean;
277
+ }) => Schema.Schema<boolean, boolean, never>;
278
+ /**
279
+ * File upload metadata embedded in the FormFileInput annotation.
280
+ * Flows through the AST walker to the client representation.
281
+ */
282
+ export interface FileFieldMetadata {
283
+ readonly documentStore: string;
284
+ readonly accept?: string;
285
+ readonly maxSize?: number;
286
+ }
287
+ export interface DocumentStoreRef {
288
+ readonly node: {
289
+ readonly path: string;
290
+ };
291
+ }
292
+ /**
293
+ * Create a file upload field with optional accept filter and max size.
294
+ *
295
+ * The underlying value is a `fileId` string (returned by the document store
296
+ * after upload). The frontend renders this as a file picker that handles
297
+ * upload automatically.
298
+ *
299
+ * @example
300
+ * ```typescript
301
+ * const schema = Schema.Struct({
302
+ * artifact: FileField({ label: "Deployment artifact", accept: ".zip", maxSize: 100_000_000 })
303
+ * })
304
+ * ```
305
+ */
306
+ export declare const FileField: (options: FieldOptions<string> & {
307
+ documentStore: DocumentStoreRef;
308
+ accept?: string;
309
+ maxSize?: number;
310
+ }) => Schema.Schema<string, string, never>;
311
+ /**
312
+ * Create a list/array field whose items are structs.
313
+ *
314
+ * Produces `Schema.Array(Schema.Struct(itemFields))` with optional annotations.
315
+ *
316
+ * @example
317
+ * ```typescript
318
+ * const schema = Schema.Struct({
319
+ * students: ListField({
320
+ * first_name: TextField({ label: "First name" }),
321
+ * parent_email: TextField({ label: "Parent email" }),
322
+ * }, { label: "Students" }),
323
+ * })
324
+ * ```
325
+ */
326
+ export declare const ListField: <Fields extends Schema.Struct.Fields>(itemFields: Fields & StableFormFields<NoInfer<Fields>>, options?: ListFieldOptions<ReadonlyArray<Schema.Struct.Encoded<Fields>>>) => Schema.Schema<ReadonlyArray<Schema.Struct.Type<Fields>>, ReadonlyArray<Schema.Struct.Encoded<Fields>>, Schema.Struct.Context<Fields>> & ListFieldMarker<Fields>;
327
+ export type ListFieldMarker<Fields extends Schema.Struct.Fields> = {
328
+ readonly __listFields: Fields;
329
+ };
330
+ export type TableFieldMarker = {
331
+ readonly __tableField: unique symbol;
332
+ };
333
+ /**
334
+ * Create a read-only table field whose rows are structs.
335
+ *
336
+ * The row field labels become the table column headings. Table fields are for
337
+ * display only and are excluded from form submissions via the read-only marker.
338
+ */
339
+ export declare const TableField: <Fields extends Schema.Struct.Fields>(itemFields: Fields & StableFormFields<NoInfer<Fields>>, options?: Omit<FieldOptions<ReadonlyArray<Schema.Struct.Encoded<Fields>>>, "permission" | "readOnly">) => Schema.Schema<ReadonlyArray<Schema.Schema.Type<Schema.Struct<Fields>>>, ReadonlyArray<Schema.Schema.Encoded<Schema.Struct<Fields>>>, never> & TableFieldMarker & ReadOnlyMarker;
340
+ /**
341
+ * An item returned by a lookup query.
342
+ */
343
+ export interface LookupItem {
344
+ readonly value: string;
345
+ readonly label: string;
346
+ }
347
+ export interface RadioFieldOption<Value extends string = string> {
348
+ readonly value: Value;
349
+ readonly label: string;
350
+ }
351
+ export interface RadioFieldMetadata<Value extends string = string> {
352
+ readonly options: readonly [
353
+ RadioFieldOption<Value>,
354
+ ...RadioFieldOption<Value>[]
355
+ ];
356
+ }
357
+ export type RadioFieldMarker = {
358
+ readonly __radioField: unique symbol;
359
+ };
360
+ type RadioOptionValues<Options extends readonly [
361
+ RadioFieldOption<string>,
362
+ ...RadioFieldOption<string>[]
363
+ ]> = Options[number]["value"];
364
+ export declare const RadioField: <const Options extends readonly [RadioFieldOption<string>, ...RadioFieldOption<string>[]]>(options: FieldOptions<RadioOptionValues<Options>> & {
365
+ readonly options: Options;
366
+ }) => Schema.Schema<RadioOptionValues<Options>, RadioOptionValues<Options>, never> & RadioFieldMarker;
367
+ /**
368
+ * Metadata stored in the FormLookupInput annotation.
369
+ * Contains the optional query function that searches for matching items.
370
+ * When no query is provided, the field is still marked as a lookup
371
+ * but the query must be supplied via `Form.lookups.<field>.setQuery()`.
372
+ */
373
+ export interface LookupFieldMetadata {
374
+ readonly query?: (filter: string, limit: number) => Effect.Effect<ReadonlyArray<LookupItem>, unknown, unknown>;
375
+ }
376
+ type QueryValue<Query> = Query | DeferredValue<Query>;
377
+ export interface CalendarSlotItem {
378
+ readonly value: string;
379
+ readonly startsAt: string;
380
+ readonly endsAt: string;
381
+ readonly label?: string | undefined;
382
+ }
383
+ export type CalendarSlotWeekday = 0 | 1 | 2 | 3 | 4 | 5 | 6;
384
+ export interface CalendarSlotCalendarMetadata {
385
+ readonly weekStartsOn?: CalendarSlotWeekday | undefined;
386
+ readonly businessDays?: readonly CalendarSlotWeekday[] | undefined;
387
+ }
388
+ export interface CalendarSlotFieldMetadata {
389
+ readonly timeZone: string;
390
+ readonly locale: string;
391
+ readonly query?: () => Effect.Effect<ReadonlyArray<CalendarSlotItem>, unknown, unknown>;
392
+ readonly calendar?: CalendarSlotCalendarMetadata | undefined;
393
+ readonly emptyMessageHtml?: string | undefined;
394
+ readonly loadErrorMessageHtml?: string | undefined;
395
+ }
396
+ export type CalendarSlotFieldOptions = FieldOptions<string> & {
397
+ readonly timeZone: string;
398
+ /** BCP 47 locale used for date/time display, e.g. "en-NZ". */
399
+ readonly locale?: string | undefined;
400
+ readonly query?: QueryValue<() => Effect.Effect<ReadonlyArray<CalendarSlotItem>, unknown, unknown>>;
401
+ readonly calendar?: CalendarSlotCalendarMetadata | undefined;
402
+ readonly emptyMessageHtml?: string | undefined;
403
+ readonly loadErrorMessageHtml?: string | undefined;
404
+ };
405
+ /**
406
+ * Create a searchable lookup/select field.
407
+ *
408
+ * The underlying value is a string (the selected item's value/ID).
409
+ * The `query` function is embedded in the schema annotation and executed
410
+ * server-side by the `lookupSuggestions` GraphQL resolver, which calls
411
+ * `Form.executeLookup()` to provide the Effect runtime context. Any
412
+ * service dependencies used via `yield*` are resolved automatically.
413
+ *
414
+ * @param options - Standard field options (label, description, etc.) plus
415
+ * a `query` function receiving a search filter and max result count,
416
+ * returning an Effect that yields {@link LookupItem LookupItem[]}.
417
+ *
418
+ * @example
419
+ * ```typescript
420
+ * const schema = Schema.Struct({
421
+ * regionId: LookupField({
422
+ * label: "Region",
423
+ * description: "AWS region for this project",
424
+ * query: (filter, limit) =>
425
+ * Effect.gen(function* () {
426
+ * const ops = yield* OrgOperations
427
+ * return yield* ops.searchRegions(filter, limit)
428
+ * }),
429
+ * }),
430
+ * })
431
+ * ```
432
+ */
433
+ export declare const LookupField: (options: FieldOptions<string> & {
434
+ query?: QueryValue<(filter: string, limit: number) => Effect.Effect<ReadonlyArray<LookupItem>, unknown, unknown>>;
435
+ }) => Schema.Schema<string, string, never> & LookupMarker;
436
+ /**
437
+ * Create a text field with searchable suggestions.
438
+ *
439
+ * Unlike {@link LookupField}, the submitted value can be either one of the
440
+ * suggestion values or arbitrary text entered by the user. Use this for fields
441
+ * where known records are helpful but not exhaustive.
442
+ */
443
+ export declare const SuggestionField: (options: FieldOptions<string> & {
444
+ query?: QueryValue<(filter: string, limit: number) => Effect.Effect<ReadonlyArray<LookupItem>, unknown, unknown>>;
445
+ }) => Schema.Schema<string, string, never> & LookupMarker;
446
+ export declare const CalendarSlotField: (options: CalendarSlotFieldOptions) => Schema.Schema<string, string, never> & CalendarSlotMarker;
447
+ export type ProviderUserDefault = string | typeof CurrentProviderUser;
448
+ export type ProviderUserFieldOptions = Omit<FieldOptions<ProviderUserDefault>, "default"> & {
449
+ readonly default?: FormValue<ProviderUserDefault> | (() => ProviderUserDefault);
450
+ };
451
+ /**
452
+ * Create a provider-user field.
453
+ *
454
+ * The submitted value is still a string: the selected provider user's id or
455
+ * email. `CurrentProviderUser` can be used as a symbolic default for later
456
+ * runtime resolution.
457
+ */
458
+ export declare const ProviderUserField: (options?: ProviderUserFieldOptions) => Schema.Schema<string, string, never> & ProviderUserMarker;
459
+ export {};
@@ -0,0 +1,4 @@
1
+ import { Schema } from "effect";
2
+ import { type FieldOptions } from "./form-schema.js";
3
+ export declare const Phone: Schema.refine<string, typeof Schema.Trim>;
4
+ export declare const PhoneField: (options?: FieldOptions<string>) => Schema.Schema<string, string, never>;
@@ -0,0 +1,3 @@
1
+ import { Schema, type SchemaAST } from "effect";
2
+ /** Map field schemas while retaining Effect's property-level decoding contract. */
3
+ export declare const mapFormPropertySignature: (field: Schema.PropertySignature.All, map: (ast: SchemaAST.AST, side: "input" | "output") => SchemaAST.AST, mapAnnotations?: (annotations: SchemaAST.Annotations, input: SchemaAST.AST, side: "input" | "output") => SchemaAST.Annotations) => Schema.PropertySignature.All;
@@ -0,0 +1,2 @@
1
+ export * from "./lib/form-submission-schema.js";
2
+ export * from "./lib/schema-defaults.js";
@@ -0,0 +1,49 @@
1
+ import { Effect, Schema } from "effect";
2
+ import { type FlattenMarker, type ListFieldMarker, type ReadOnlyMarker, type StructuralOnlyMarker } from "../../../form-schema/src/index.js";
3
+ declare const FieldNameCollisionError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
4
+ readonly _tag: "FieldNameCollisionError";
5
+ } & Readonly<A>;
6
+ export declare class FieldNameCollisionError extends FieldNameCollisionError_base<{
7
+ readonly fieldName: string;
8
+ readonly wrapperField: string;
9
+ }> {
10
+ get message(): string;
11
+ }
12
+ declare const InvalidFlattenAnnotationError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
13
+ readonly _tag: "InvalidFlattenAnnotationError";
14
+ } & Readonly<A>;
15
+ export declare class InvalidFlattenAnnotationError extends InvalidFlattenAnnotationError_base<{
16
+ readonly fieldName: string;
17
+ readonly astTag: string;
18
+ }> {
19
+ get message(): string;
20
+ }
21
+ type UnionToIntersection<U> = (U extends unknown ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
22
+ type IsExcluded<Field> = Field extends StructuralOnlyMarker | ReadOnlyMarker ? true : Field extends {
23
+ readonly from: infer From;
24
+ } ? IsExcluded<From> : Field extends {
25
+ readonly members: ReadonlyArray<infer Member>;
26
+ } ? true extends IsExcluded<Member> ? true : false : false;
27
+ type ProjectedStruct<Fields extends Schema.Struct.Fields> = Schema.Struct<FlattenFields<Fields> extends infer F extends Schema.Struct.Fields ? F : never>;
28
+ type ProjectSchema<S extends Schema.Schema.All> = S extends Schema.Struct<infer Fields> ? ProjectedStruct<Fields> : S extends ListFieldMarker<infer Items> ? Schema.Array$<ProjectedStruct<Items>> : S extends Schema.Union<infer Members> ? Schema.Union<{
29
+ [K in keyof Members]: ProjectSchema<Members[K]>;
30
+ }> : S extends Schema.transformOrFail<infer From, infer To, infer R> ? Schema.Schema<Schema.Schema.Type<ProjectSchema<To>>, Schema.Schema.Encoded<ProjectSchema<From>>, R | Schema.Schema.Context<ProjectSchema<From>> | Schema.Schema.Context<ProjectSchema<To>>> : S extends Schema.refine<infer A, infer From> ? Schema.Schema<Schema.Schema.Type<ProjectSchema<From>> & Omit<A, keyof Schema.Schema.Type<From>>, Schema.Schema.Encoded<ProjectSchema<From>>, Schema.Schema.Context<ProjectSchema<From>>> : S;
31
+ type ProjectField<Field extends Schema.Struct.Fields[string]> = Field extends Schema.PropertySignature<infer TT, infer A, infer Key, infer ET, infer I, infer Default, infer _R> & {
32
+ readonly from: infer From extends Schema.Schema.All;
33
+ } ? Schema.PropertySignature<TT, Schema.Schema.Type<ProjectSchema<From>> | Exclude<A, Schema.Schema.Type<From>>, Key, ET, Schema.Schema.Encoded<ProjectSchema<From>> | Exclude<I, Schema.Schema.Encoded<From>>, Default, Schema.Schema.Context<ProjectSchema<From>>> : Field extends Schema.Schema.All ? ProjectSchema<Field> : Field;
34
+ export type FlattenFields<Fields extends Schema.Struct.Fields> = UnionToIntersection<{
35
+ [K in keyof Fields]: IsExcluded<Fields[K]> extends true ? never : Fields[K] extends Schema.Struct<infer F> & FlattenMarker ? FlattenFields<F> : {
36
+ [P in K]: ProjectField<Fields[K]>;
37
+ };
38
+ }[keyof Fields]>;
39
+ export declare const isStructSchema: (field: Schema.Schema.Any) => field is Schema.Struct<Schema.Struct.Fields>;
40
+ type FlattenedSubmissionStruct<Fields extends Schema.Struct.Fields> = Schema.Struct<FlattenFields<Fields> extends infer F extends Schema.Struct.Fields ? F : never>;
41
+ export type SubmissionSchemaError = FieldNameCollisionError | InvalidFlattenAnnotationError;
42
+ export declare const submissionSchema: <Fields extends Schema.Struct.Fields>(schema: Schema.Struct<Fields>) => Effect.Effect<FlattenedSubmissionStruct<Fields>, SubmissionSchemaError>;
43
+ /**
44
+ * Synchronous boundary for model construction and other non-Effect call sites.
45
+ * Rethrows the original TaggedError on failure (not a FiberFailure wrapper).
46
+ */
47
+ export declare const submissionSchemaSync: <Fields extends Schema.Struct.Fields>(schema: Schema.Struct<Fields>) => FlattenedSubmissionStruct<Fields>;
48
+ export declare const expandSubmissionInput: <Fields extends Schema.Struct.Fields>(schema: Schema.Struct<Fields>, input: Record<string, unknown>) => Record<string, unknown>;
49
+ export {};
@@ -0,0 +1,16 @@
1
+ import { type Schema } from "effect";
2
+ /**
3
+ * Recursively removes readonly modifiers from all properties
4
+ */
5
+ export type DeepWritable<T> = T extends object ? {
6
+ -readonly [K in keyof T]: DeepWritable<T[K]>;
7
+ } : T;
8
+ /**
9
+ * Generate type-compatible default values from Effect Schema fields.
10
+ *
11
+ * This creates empty/zero values to satisfy Tanstack Form's type requirements.
12
+ * Values are NOT validated - they're just type-compatible placeholders.
13
+ *
14
+ * Without this we have an uncontrolled input error.
15
+ */
16
+ export declare const getSchemaDefaults: <Fields extends Schema.Struct.Fields>(fields: Fields) => { [K in keyof Fields]: DeepWritable<Schema.Schema.Type<Fields[K]>>; };
@@ -0,0 +1 @@
1
+ export * from "./form-schema/src/index.js";
package/dist/forms.mjs ADDED
@@ -0,0 +1,2 @@
1
+ import { $ as Wrapper, A as LINK_URL_SYMBOL, B as RadioField, C as FLATTEN_SYMBOL, Ct as FormRequired, D as LINK_COLOR_SYMBOL, Dt as FormTextAreaInput, E as Image, Et as FormTableInput, F as METRIC_BREAKDOWN_SYMBOL, G as SuggestionField, H as STRUCTURAL_ONLY_SYMBOL, I as MetricBreakdown, J as TableField, K as TEXTBLOCK_CONTENT_SYMBOL, L as NumberField, M as LinkButton, N as ListField, O as LINK_DISPLAY_SYMBOL, P as LookupField, Q as TextFieldFrom, R as NumberFieldFrom, S as DynamicTextBlock, St as FormReadOnly, T as HttpsUrlField, Tt as FormSuggestionInput, U as STRUCTURAL_TYPE_SYMBOL, V as ReadOnly, W as StructuralOnly, X as TextBlock, Y as TextArea, Z as TextField, _ as BooleanField, _t as FormNumberInput, a as countInvalidFields, at as FormAutoComplete, b as DateField, bt as FormProviderUserInput, c as EmailField, ct as FormDateInput, d as isDeferredValue, dt as FormEmailInput, et as applyFieldAnnotations, f as fieldAnnotation, ft as FormFileInput, g as isReadOnlyField, gt as FormMessage, h as hasStructuralOnlyAnnotation, ht as FormLookupInput, i as calculateFieldCompletion, it as isMetricBreakdownOptions, j as Link, k as LINK_TEXT_SYMBOL, l as DeferredValueTypeId, lt as FormDefault, m as hasFlattenAnnotation, mt as FormListInput, n as Phone, nt as isHttpsUrl, o as countTotalFields, ot as FormCalendarSlotInput, p as fieldInputAst, pt as FormLabel, q as TEXTBLOCK_DYNAMIC_CONTENT_SYMBOL, r as PhoneField, rt as isListFieldMetadata, s as Email, st as FormComponentPluginType, t as mapFormPropertySignature, tt as isFieldPermissionMetadata, u as FormDeferredContent, ut as FormDescription, v as CalendarSlotField, vt as FormPermission, w as FileField, wt as FormStaticText, x as Divider, xt as FormRadioInput, y as CurrentProviderUser, yt as FormPhoneInput, z as ProviderUserField } from "./src-C-909PVQ.mjs";
2
+ export { BooleanField, CalendarSlotField, CurrentProviderUser, DateField, DeferredValueTypeId, Divider, DynamicTextBlock, Email, EmailField, FLATTEN_SYMBOL, FileField, FormAutoComplete, FormCalendarSlotInput, FormComponentPluginType, FormDateInput, FormDefault, FormDeferredContent, FormDescription, FormEmailInput, FormFileInput, FormLabel, FormListInput, FormLookupInput, FormMessage, FormNumberInput, FormPermission, FormPhoneInput, FormProviderUserInput, FormRadioInput, FormReadOnly, FormRequired, FormStaticText, FormSuggestionInput, FormTableInput, FormTextAreaInput, HttpsUrlField, Image, LINK_COLOR_SYMBOL, LINK_DISPLAY_SYMBOL, LINK_TEXT_SYMBOL, LINK_URL_SYMBOL, Link, LinkButton, ListField, LookupField, METRIC_BREAKDOWN_SYMBOL, MetricBreakdown, NumberField, NumberFieldFrom, Phone, PhoneField, ProviderUserField, RadioField, ReadOnly, STRUCTURAL_ONLY_SYMBOL, STRUCTURAL_TYPE_SYMBOL, StructuralOnly, SuggestionField, TEXTBLOCK_CONTENT_SYMBOL, TEXTBLOCK_DYNAMIC_CONTENT_SYMBOL, TableField, TextArea, TextBlock, TextField, TextFieldFrom, Wrapper, applyFieldAnnotations, calculateFieldCompletion, countInvalidFields, countTotalFields, fieldAnnotation, fieldInputAst, hasFlattenAnnotation, hasStructuralOnlyAnnotation, isDeferredValue, isFieldPermissionMetadata, isHttpsUrl, isListFieldMetadata, isMetricBreakdownOptions, isReadOnlyField, mapFormPropertySignature };
@@ -0,0 +1,2 @@
1
+ export * from "./lib/browser-plugin-artifact.js";
2
+ export * from "./lib/frontend-manifest.js";
@@ -0,0 +1,25 @@
1
+ export declare const BROWSER_PLUGIN_ARTIFACT_MANIFEST_FORMAT = "processfocus/browser-plugins";
2
+ export declare const BROWSER_PLUGIN_ARTIFACT_MANIFEST_VERSION: 1;
3
+ export declare const BROWSER_PLUGIN_ARTIFACT_MANIFEST_FILE = "browser-plugins.json";
4
+ export declare const BROWSER_PLUGIN_CATEGORIES: readonly ["analytics", "formComponents"];
5
+ export type BrowserPluginCategory = (typeof BROWSER_PLUGIN_CATEGORIES)[number];
6
+ export declare const isBrowserPluginCategory: (value: unknown) => value is BrowserPluginCategory;
7
+ export interface BrowserPluginArtifactEntry {
8
+ readonly identity: string;
9
+ readonly category: BrowserPluginCategory;
10
+ readonly hostInterfaceVersion: number;
11
+ readonly path: string;
12
+ readonly sha256: string;
13
+ readonly preparation?: BrowserPluginPreparationArtifact;
14
+ }
15
+ export interface BrowserPluginPreparationArtifact {
16
+ readonly kind: "stylesheet";
17
+ readonly path: string;
18
+ readonly sha256: string;
19
+ }
20
+ export interface BrowserPluginArtifactManifest {
21
+ readonly format: typeof BROWSER_PLUGIN_ARTIFACT_MANIFEST_FORMAT;
22
+ readonly version: typeof BROWSER_PLUGIN_ARTIFACT_MANIFEST_VERSION;
23
+ readonly plugins: ReadonlyArray<BrowserPluginArtifactEntry>;
24
+ }
25
+ export declare const parseBrowserPluginArtifactManifest: (value: unknown) => BrowserPluginArtifactManifest;
@@ -0,0 +1,83 @@
1
+ export type OrganisationFrontendPluginManifestJson = string | number | boolean | null | ReadonlyArray<OrganisationFrontendPluginManifestJson> | {
2
+ readonly [key: string]: OrganisationFrontendPluginManifestJson;
3
+ };
4
+ export interface OrganisationFrontendPluginManifestClientPlugin {
5
+ readonly module: string;
6
+ readonly type: string;
7
+ readonly config: OrganisationFrontendPluginManifestJson;
8
+ }
9
+ export interface OrganisationFrontendManifestFormComponentPluginDeclaration {
10
+ readonly module: string;
11
+ readonly type: string;
12
+ }
13
+ export interface OrganisationFrontendManifestAnalyticsPlugin extends OrganisationFrontendPluginManifestClientPlugin {
14
+ }
15
+ export interface OrganisationFrontendManifestFormComponentPlugin extends OrganisationFrontendManifestFormComponentPluginDeclaration {
16
+ }
17
+ export interface OrganisationFrontendManifestProcessDocumentation {
18
+ readonly processPath: string;
19
+ readonly documentationPath: string;
20
+ }
21
+ export interface OrganisationFrontendManifestMetadataIcon {
22
+ readonly url: string;
23
+ readonly rel: string;
24
+ readonly type?: string | undefined;
25
+ readonly sizes?: string | undefined;
26
+ }
27
+ export interface OrganisationFrontendManifestWebAppManifestIcon {
28
+ readonly src: string;
29
+ readonly sizes: string;
30
+ readonly type?: string | undefined;
31
+ readonly purpose?: string | undefined;
32
+ }
33
+ export interface OrganisationFrontendManifestAppIcons {
34
+ readonly metadata: ReadonlyArray<OrganisationFrontendManifestMetadataIcon>;
35
+ readonly manifest: ReadonlyArray<OrganisationFrontendManifestWebAppManifestIcon>;
36
+ }
37
+ export interface OrganisationFrontendManifestPublicFormBranding {
38
+ readonly headerHtml?: string | undefined;
39
+ readonly footerHtml?: string | undefined;
40
+ }
41
+ export interface OrganisationFrontendManifestClientFormDefinition {
42
+ readonly components: Readonly<Record<string, unknown>>;
43
+ readonly rules: readonly unknown[];
44
+ }
45
+ export interface OrganisationFrontendManifestEmbedEntry {
46
+ readonly stepPath: string;
47
+ readonly processName: string;
48
+ readonly processPath: string;
49
+ readonly mutationName: string;
50
+ readonly inputTypeName: string;
51
+ readonly totalFields: number;
52
+ readonly formDefinition: OrganisationFrontendManifestClientFormDefinition | null;
53
+ readonly defaultValues: Record<string, unknown> | null;
54
+ readonly jsonSchema: Record<string, unknown> | null;
55
+ readonly sites: readonly string[];
56
+ readonly thankYou: string;
57
+ }
58
+ export interface OrganisationFrontendManifest {
59
+ readonly version: typeof ORGANISATION_FRONTEND_MANIFEST_VERSION;
60
+ readonly organisation: {
61
+ readonly name: string;
62
+ readonly acronym?: string;
63
+ };
64
+ readonly appIcons: OrganisationFrontendManifestAppIcons;
65
+ readonly publicFormBranding: OrganisationFrontendManifestPublicFormBranding | null;
66
+ readonly embed: {
67
+ readonly entries: ReadonlyArray<OrganisationFrontendManifestEmbedEntry>;
68
+ };
69
+ readonly processes: {
70
+ readonly documentation: ReadonlyArray<OrganisationFrontendManifestProcessDocumentation>;
71
+ };
72
+ readonly plugins: {
73
+ readonly analytics: ReadonlyArray<OrganisationFrontendManifestAnalyticsPlugin>;
74
+ readonly formComponents: ReadonlyArray<OrganisationFrontendManifestFormComponentPlugin>;
75
+ };
76
+ }
77
+ export declare const ORGANISATION_FRONTEND_MANIFEST_FILE = "frontend-manifest.json";
78
+ export declare const ORGANISATION_FRONTEND_MANIFEST_VERSION: 3;
79
+ export declare const isRecord: (value: unknown) => value is Record<string, unknown>;
80
+ export declare const ensureRecord: (value: unknown, path: string) => Record<string, unknown>;
81
+ export declare const ensureNonEmptyString: (value: unknown, path: string) => string;
82
+ export declare const ensureJsonValue: (value: unknown, path: string) => OrganisationFrontendPluginManifestJson;
83
+ export declare const parseOrganisationFrontendManifest: (value: unknown) => OrganisationFrontendManifest;