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
package/dist/manifest.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// ../frontend-manifest/src/lib/frontend-manifest.ts
|
|
2
2
|
const ORGANISATION_FRONTEND_MANIFEST_FILE = "frontend-manifest.json";
|
|
3
3
|
const ORGANISATION_FRONTEND_MANIFEST_VERSION = 3;
|
|
4
|
-
//#endregion
|
|
5
4
|
export { ORGANISATION_FRONTEND_MANIFEST_FILE, ORGANISATION_FRONTEND_MANIFEST_VERSION };
|
package/dist/plugin.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// ../frontend-plugin-host/src/lib/frontend-plugin-host.ts
|
|
2
2
|
const FRONTEND_PLUGIN_HOST_INTERFACE_VERSION = 1;
|
|
3
3
|
var DuplicatePluginRegistrationError = class extends Error {
|
|
4
4
|
key;
|
|
@@ -80,5 +80,4 @@ const activateOrganisationFrontendPlugins = async (plugins, host, onFailure) =>
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
};
|
|
83
|
-
//#endregion
|
|
84
83
|
export { DuplicatePluginRegistrationError, FRONTEND_PLUGIN_HOST_INTERFACE_VERSION, activateOrganisationFrontendPlugin, activateOrganisationFrontendPlugins, createRegistrationRegistry };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
import { type DeferredValue, type StructuralOnlyMarker } from "../../../form-schema/src/index.js";
|
|
3
3
|
import type { FlowContext, FormStepMeta, StepMeta } from "./flow-context.js";
|
|
4
|
-
type StructuralContent = Schema.
|
|
4
|
+
type StructuralContent = Schema.Top & StructuralOnlyMarker;
|
|
5
5
|
type Resolver<State, Steps extends Record<string, StepMeta | FormStepMeta>, Item, A> = (state: State, ctx: FlowContext<Steps>, item: Item) => A;
|
|
6
6
|
export interface FormAuthoring<State, Steps extends Record<string, StepMeta | FormStepMeta>, Item> {
|
|
7
7
|
readonly value: <A>(resolve: Resolver<State, Steps, Item, A>, fallback?: NoInfer<A>) => DeferredValue<A>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Schema, SchemaAST } from "effect";
|
|
1
|
+
import { Schema, type SchemaAST } from "effect";
|
|
2
2
|
declare const FormDecorationError_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 & {
|
|
3
3
|
readonly _tag: "FormDecorationError";
|
|
4
4
|
} & Readonly<A>;
|
|
@@ -7,7 +7,7 @@ export declare class FormDecorationError extends FormDecorationError_base<{
|
|
|
7
7
|
readonly message: string;
|
|
8
8
|
}> {
|
|
9
9
|
}
|
|
10
|
-
export declare const decorateAst: (original: SchemaAST.AST, value: unknown, path: string) => SchemaAST.AST;
|
|
10
|
+
export declare const decorateAst: (original: SchemaAST.AST, value: unknown, path: string, inputAst?: SchemaAST.AST) => SchemaAST.AST;
|
|
11
11
|
/** Preserve property transformations and exact field types during safe resolution. */
|
|
12
|
-
export declare const mapFormFields: <Fields extends Schema.Struct.Fields>(fields: Fields, map: (ast: SchemaAST.AST, name: string) => SchemaAST.AST, mapAnnotations?: (annotations:
|
|
12
|
+
export declare const mapFormFields: <Fields extends Schema.Struct.Fields>(fields: Fields, map: (ast: SchemaAST.AST, name: string) => SchemaAST.AST, mapAnnotations?: (annotations: Record<PropertyKey, unknown>, ast: SchemaAST.AST, name: string, side: "input" | "output") => Record<PropertyKey, unknown>, mapOutput?: (ast: SchemaAST.AST, name: string) => SchemaAST.AST) => Fields;
|
|
13
13
|
export {};
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import type { StoredEmailAttachment } from "@processfocus/runtime";
|
|
2
|
-
import { type DateTime, Effect, Schema } from "effect";
|
|
3
|
-
import { type
|
|
4
|
-
import { type FormRule, type FormRuleEvaluationResult, type FormRuleExpression, type FormRuleLiteral, type FormRulePath, type FormRuleTargetState, type FormRuleValues } from "../../../form-rule/src/index.js";
|
|
5
|
-
import { type CalendarSlotItem, type FlattenMarker, type LookupItem, type ReadOnlyMarker, type StableFormFields, type StructuralOnlyMarker, type TableFieldMarker } from "../../../form-schema/src/index.js";
|
|
2
|
+
import { type DateTime, type Duration, Effect, Schema } from "effect";
|
|
3
|
+
import { type CalendarSlotItem, type FormPresentation, type LookupFieldMetadata, type LookupItem, type LookupMarker, type StableFormFields } from "../../../form-schema/src/index.js";
|
|
6
4
|
import { type DeepWritable } from "../../../form-submission-schema/src/index.js";
|
|
7
|
-
import type { FlowContext, FormStepMeta, StepMeta, SummaryContext } from "./flow-context.js";
|
|
8
|
-
import type
|
|
5
|
+
import type { FlowContext, FormStepMeta, MergeFormStep, MergeSteps, StepMeta, SummaryContext } from "./flow-context.js";
|
|
6
|
+
import { type FlowPath, type MergeState } from "./flow-path.js";
|
|
9
7
|
import { type FormAuthoring } from "./form-authoring.js";
|
|
10
8
|
import { LookupAccessor, type LookupOverride, type LookupOverrideStore } from "./lookup-accessor.js";
|
|
11
|
-
import type { InferFormSchemaType, Process } from "./process.js";
|
|
9
|
+
import type { InferFormSchemaType, Process, ResolveStepOutput } from "./process.js";
|
|
12
10
|
import type { Role } from "./role.js";
|
|
13
11
|
import { type IStepScope, Step, type StepProps } from "./step.js";
|
|
14
12
|
import { type AuthorTaggedError, type ForEachConfig, NotAForEachStepError } from "./system-step.js";
|
|
@@ -30,52 +28,6 @@ export declare const countLeafFields: (value: unknown) => number;
|
|
|
30
28
|
type FormDefaults<TInput extends Schema.Struct.Fields> = {
|
|
31
29
|
[K in keyof TInput]: DeepWritable<Schema.Schema.Type<TInput[K]>>;
|
|
32
30
|
};
|
|
33
|
-
export declare const FormRuleSelf: unique symbol;
|
|
34
|
-
type RuleLiteralFor<T> = Extract<T, FormRuleLiteral>;
|
|
35
|
-
type RuleComparable<T> = RuleLiteralFor<Exclude<T, undefined>>;
|
|
36
|
-
type RuleOrderComparable<T> = Extract<RuleComparable<T>, string | number>;
|
|
37
|
-
type Prettify<T> = {
|
|
38
|
-
readonly [K in keyof T]: T[K];
|
|
39
|
-
} & {};
|
|
40
|
-
type UnionToIntersection<T> = (T extends unknown ? (value: T) => void : never) extends (value: infer I) => void ? I : never;
|
|
41
|
-
interface FormRuleValueAccessor<T> {
|
|
42
|
-
readonly equals: (value: RuleComparable<T>) => FormRuleExpression;
|
|
43
|
-
readonly notEquals: (value: RuleComparable<T>) => FormRuleExpression;
|
|
44
|
-
readonly in: (values: readonly RuleComparable<T>[]) => FormRuleExpression;
|
|
45
|
-
readonly notIn: (values: readonly RuleComparable<T>[]) => FormRuleExpression;
|
|
46
|
-
readonly blank: () => FormRuleExpression;
|
|
47
|
-
readonly present: () => FormRuleExpression;
|
|
48
|
-
readonly lt: (value: RuleOrderComparable<T>) => FormRuleExpression;
|
|
49
|
-
readonly lte: (value: RuleOrderComparable<T>) => FormRuleExpression;
|
|
50
|
-
readonly gt: (value: RuleOrderComparable<T>) => FormRuleExpression;
|
|
51
|
-
readonly gte: (value: RuleOrderComparable<T>) => FormRuleExpression;
|
|
52
|
-
}
|
|
53
|
-
type RuleField<Field> = Field extends {
|
|
54
|
-
readonly from: infer From;
|
|
55
|
-
} ? RuleField<From> : Field;
|
|
56
|
-
type FormRuleValueAccessorEntry<TInput extends Schema.Struct.Fields, K extends keyof TInput & string> = RuleField<TInput[K]> extends ReadOnlyMarker | StructuralOnlyMarker ? Record<never, never> : TInput[K] extends FlattenMarker ? TInput[K] extends Schema.Struct<infer NestedFields> ? FormRuleValueAccessors<NestedFields> : Record<never, never> : {
|
|
57
|
-
readonly [P in K]: RuleField<TInput[K]> extends Schema.Struct<infer NestedFields> ? FormRuleValueAccessors<NestedFields> : FormRuleValueAccessor<Schema.Schema.Type<TInput[K]>>;
|
|
58
|
-
};
|
|
59
|
-
type FormRuleValueAccessors<TInput extends Schema.Struct.Fields> = Prettify<UnionToIntersection<{
|
|
60
|
-
readonly [K in keyof TInput & string]: FormRuleValueAccessorEntry<TInput, K>;
|
|
61
|
-
}[keyof TInput & string]>>;
|
|
62
|
-
type LeafFormRuleTargetState = FormRuleTargetState;
|
|
63
|
-
type ContainerFormRuleTargetState = Omit<FormRuleTargetState, "required">;
|
|
64
|
-
type StaticDisplayFormRuleTargetState = Omit<FormRuleTargetState, "required">;
|
|
65
|
-
export type FormRuleTargetTree<TInput extends Schema.Struct.Fields> = {
|
|
66
|
-
readonly [K in keyof TInput & string]?: RuleField<TInput[K]> extends StructuralOnlyMarker | ReadOnlyMarker ? StaticDisplayFormRuleTargetState : RuleField<TInput[K]> extends TableFieldMarker ? StaticDisplayFormRuleTargetState : RuleField<TInput[K]> extends Schema.Struct<infer NestedFields> ? (FormRuleTargetTree<NestedFields> & {
|
|
67
|
-
readonly [FormRuleSelf]?: ContainerFormRuleTargetState;
|
|
68
|
-
}) | (TInput[K] extends Schema.Struct<infer _Fields> ? never : LeafFormRuleTargetState) : LeafFormRuleTargetState;
|
|
69
|
-
};
|
|
70
|
-
interface AuthoredFormRule<TInput extends Schema.Struct.Fields> {
|
|
71
|
-
readonly effects: (effects: FormRuleTargetTree<TInput>, otherwise?: FormRuleTargetTree<TInput>) => FormRule;
|
|
72
|
-
}
|
|
73
|
-
interface FormRuleAuthor<TInput extends Schema.Struct.Fields> {
|
|
74
|
-
readonly when: (condition: FormRuleExpression) => AuthoredFormRule<TInput>;
|
|
75
|
-
readonly and: (...expressions: readonly FormRuleExpression[]) => FormRuleExpression;
|
|
76
|
-
readonly or: (...expressions: readonly FormRuleExpression[]) => FormRuleExpression;
|
|
77
|
-
readonly not: (expression: FormRuleExpression) => FormRuleExpression;
|
|
78
|
-
}
|
|
79
31
|
/**
|
|
80
32
|
* Summary type for todo cards.
|
|
81
33
|
* Record where keys are labels and values are the display strings.
|
|
@@ -91,6 +43,12 @@ export declare class FormSubmissionError extends FormSubmissionError_base<{
|
|
|
91
43
|
readonly message: string;
|
|
92
44
|
}> {
|
|
93
45
|
}
|
|
46
|
+
/** An unauthenticated process start, independent of External Participants. */
|
|
47
|
+
export interface FormAnonymousPageConfig {
|
|
48
|
+
/** Stable address segment. Use an unguessable value for private reception pages. */
|
|
49
|
+
readonly address: string;
|
|
50
|
+
readonly afterSubmit: "restart" | "thank-you";
|
|
51
|
+
}
|
|
94
52
|
export interface FormEmbedConfig {
|
|
95
53
|
readonly sites: readonly string[];
|
|
96
54
|
readonly thankYou: string;
|
|
@@ -143,6 +101,13 @@ export interface FormPublicCompletionConfig<TState, TSteps extends Record<string
|
|
|
143
101
|
/** Public form supporting copy override for this completion link. */
|
|
144
102
|
readonly formDescription?: string;
|
|
145
103
|
}
|
|
104
|
+
type FormBindings<F extends Schema.Struct.Fields> = {
|
|
105
|
+
readonly [K in keyof F]?: FormPresentation & {
|
|
106
|
+
readonly default?: F[K]["Encoded"];
|
|
107
|
+
} & (F[K] extends LookupMarker ? {
|
|
108
|
+
readonly query?: LookupFieldMetadata["query"];
|
|
109
|
+
} : unknown);
|
|
110
|
+
};
|
|
146
111
|
/**
|
|
147
112
|
* Base props shared by all Form steps.
|
|
148
113
|
*/
|
|
@@ -202,7 +167,16 @@ interface FormStepPropsBase<TState, TSteps extends Record<string, StepMeta | For
|
|
|
202
167
|
* })
|
|
203
168
|
* ```
|
|
204
169
|
*/
|
|
205
|
-
readonly form: (helpers: FormAuthoring<TState, TSteps, TItem>) => StaticFormDeclaration<TInput
|
|
170
|
+
readonly form: Schema.Struct<TInput> | ((helpers: FormAuthoring<TState, TSteps, TItem>) => StaticFormDeclaration<TInput>);
|
|
171
|
+
/** Server-only request bindings; fields and their value contracts remain static. */
|
|
172
|
+
readonly bindings?: (state: TState, ctx: FlowContext<TSteps>, item: TItem) => FormBindings<TInput>;
|
|
173
|
+
/** Browser-safe module exporting the same static schema supplied to form. */
|
|
174
|
+
readonly browser?: {
|
|
175
|
+
readonly entrypoint: string;
|
|
176
|
+
readonly exportName: string;
|
|
177
|
+
/** Server-only, request-local public data keyed by submitted field path. */
|
|
178
|
+
readonly resolvePluginConfiguration?: () => Effect.Effect<Readonly<Record<string, unknown>>, never, unknown>;
|
|
179
|
+
};
|
|
206
180
|
/**
|
|
207
181
|
* Function to compute summary for todo cards.
|
|
208
182
|
* Returns contextual information displayed on the todo card.
|
|
@@ -270,6 +244,7 @@ interface FormStepPropsBase<TState, TSteps extends Record<string, StepMeta | For
|
|
|
270
244
|
* Optional configuration for rendering this start form as an anonymous embed.
|
|
271
245
|
* Allowed sites are exact origins only.
|
|
272
246
|
*/
|
|
247
|
+
readonly anonymousPage?: FormAnonymousPageConfig;
|
|
273
248
|
readonly embed?: FormEmbedConfig;
|
|
274
249
|
/**
|
|
275
250
|
* Optional external completion email for non-start forms. The regular role
|
|
@@ -382,17 +357,27 @@ export declare class Form<TState = Record<string, never>, TSteps extends Record<
|
|
|
382
357
|
* Lookup query overrides set via `this.lookups.<field>.setQuery()`.
|
|
383
358
|
*/
|
|
384
359
|
private _lookupOverrides;
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
* `this.lookups.<field>.dependsOn([...]).setQuery()` for dependent lookups.
|
|
389
|
-
*/
|
|
390
|
-
static readonly self: symbol;
|
|
360
|
+
private _lookupResolvers;
|
|
361
|
+
_setLookupResolver(fieldName: string, resolve: NonNullable<LookupFieldMetadata["resolve"]>): void;
|
|
362
|
+
resolveLookupSelection(fieldName: string, value: string, fields?: Schema.Struct.Fields): Effect.Effect<LookupItem | null, unknown, unknown>;
|
|
391
363
|
readonly isForm = true;
|
|
364
|
+
/** Attach a deadline. The owner output is not yet available. */
|
|
365
|
+
onDeadline<TOutput extends Schema.Struct.Fields | undefined, THandlerId extends string, THandlerIsForm extends boolean = false>(name: string, options: {
|
|
366
|
+
readonly handler: Step<TState, TOutput, THandlerId, THandlerIsForm, false>;
|
|
367
|
+
readonly interrupting?: boolean;
|
|
368
|
+
} & ({
|
|
369
|
+
readonly after: Duration.Duration;
|
|
370
|
+
readonly at?: never;
|
|
371
|
+
} | {
|
|
372
|
+
readonly at: (state: TState) => DateTime.DateTime;
|
|
373
|
+
readonly after?: never;
|
|
374
|
+
})): FlowPath<MergeState<TState, ResolveStepOutput<TOutput, THandlerIsForm>>, TOutput, THandlerIsForm extends true ? MergeFormStep<TSteps, THandlerId> : MergeSteps<TSteps, THandlerId>>;
|
|
392
375
|
readonly lookups: {
|
|
393
376
|
readonly [K in keyof TInput & string]: LookupAccessor<TInput, K>;
|
|
394
377
|
};
|
|
395
|
-
|
|
378
|
+
readonly sharedSchema: Schema.Struct<TInput>;
|
|
379
|
+
readonly browser: FormProps<TState, TSteps, TInput, TItem>["browser"];
|
|
380
|
+
readonly anonymousPage: FormAnonymousPageConfig | undefined;
|
|
396
381
|
readonly embed: FormEmbedConfig | undefined;
|
|
397
382
|
readonly supportingRoles: readonly Role[] | undefined;
|
|
398
383
|
readonly publicCompletion: FormPublicCompletionConfig<TState, TSteps, TItem> | undefined;
|
|
@@ -411,14 +396,16 @@ export declare class Form<TState = Record<string, never>, TSteps extends Record<
|
|
|
411
396
|
* Used by the schema generator to emit per-lookup GraphQL queries.
|
|
412
397
|
*/
|
|
413
398
|
lookupOverrides(): ReadonlyMap<string, LookupOverride>;
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
399
|
+
private _prefill;
|
|
400
|
+
/** Fresh selection-dependent values. Concealed fields still travel on submission. */
|
|
401
|
+
prefillOn<const K extends keyof TInput & string, const F extends keyof Schema.Struct.Type<TInput> & keyof TInput & string>(dependency: K, options: {
|
|
402
|
+
fields: readonly F[];
|
|
403
|
+
concealed?: readonly F[];
|
|
404
|
+
load: (value: string) => Effect.Effect<Pick<Schema.Struct.Type<TInput>, F>, unknown, unknown>;
|
|
405
|
+
}): this;
|
|
406
|
+
prefillQuery(): typeof this._prefill;
|
|
407
|
+
prefillQueryName(): string;
|
|
408
|
+
submissionPath(path: readonly (string | number)[]): readonly (string | number)[];
|
|
422
409
|
/**
|
|
423
410
|
* Returns the GraphQL query name for a dependent lookup field.
|
|
424
411
|
* E.g. `lookupDevopsAddEnvironmentInputEnvironmentDetailsStageId`
|
|
@@ -434,7 +421,7 @@ export declare class Form<TState = Record<string, never>, TSteps extends Record<
|
|
|
434
421
|
* Returns Schema.Struct(fields), optionally refined with a struct-level
|
|
435
422
|
* filterEffect when a `validate` callback was provided.
|
|
436
423
|
*/
|
|
437
|
-
get outputSchema(): Schema.
|
|
424
|
+
get outputSchema(): Schema.Top;
|
|
438
425
|
/** Invoke only after the runtime has validated and authorized the submission. */
|
|
439
426
|
executeSubmit(input: InferFormSchemaType<TInput>): Effect.Effect<void, FormSubmissionError, unknown>;
|
|
440
427
|
/**
|
|
@@ -446,7 +433,7 @@ export declare class Form<TState = Record<string, never>, TSteps extends Record<
|
|
|
446
433
|
* Used by start/complete resolvers for server-side validation where
|
|
447
434
|
* wrapper nesting should not affect persisted state shape.
|
|
448
435
|
*/
|
|
449
|
-
get submissionEffectSchema(): Schema.
|
|
436
|
+
get submissionEffectSchema(): Schema.Top;
|
|
450
437
|
/**
|
|
451
438
|
* Get the forEach items for this form.
|
|
452
439
|
* Returns the array of items, where each item is context data for one form instance.
|
|
@@ -517,32 +504,6 @@ export declare class Form<TState = Record<string, never>, TSteps extends Record<
|
|
|
517
504
|
* This keeps start-step metadata from leaking symbolic defaults to clients.
|
|
518
505
|
*/
|
|
519
506
|
resolveInitialDefaults(currentProviderUser?: string): Effect.Effect<Record<string, unknown>, never>;
|
|
520
|
-
/**
|
|
521
|
-
* Get the client representation for this form's fields.
|
|
522
|
-
* Used for rendering the form in the UI.
|
|
523
|
-
*
|
|
524
|
-
* Post-processes the representation to add `dependencies` and `queryName`
|
|
525
|
-
* to any lookup components that have dependent overrides.
|
|
526
|
-
*
|
|
527
|
-
* @returns Effect that produces the client representation
|
|
528
|
-
*/
|
|
529
|
-
private buildClientComponents;
|
|
530
|
-
private buildClientFormDefinition;
|
|
531
|
-
private resolveDynamicTextBlockComponent;
|
|
532
|
-
private resolveDynamicTextBlocks;
|
|
533
|
-
private buildRenderableClientFormDefinition;
|
|
534
|
-
clientFormDefinition(): Effect.Effect<ClientFormDefinition, WalkError>;
|
|
535
|
-
renderableClientFormDefinition(): Effect.Effect<ClientFormDefinition, WalkError, unknown>;
|
|
536
|
-
clientFormDefinitionWithState(state: Record<string, unknown>, ctx: FlowContext<TSteps>, item?: unknown): Effect.Effect<ClientFormDefinition, WalkError>;
|
|
537
|
-
renderableClientFormDefinitionWithState(state: Record<string, unknown>, ctx: FlowContext<TSteps>, item?: unknown): Effect.Effect<ClientFormDefinition, WalkError, unknown>;
|
|
538
|
-
/**
|
|
539
|
-
* Get the submission schema for form validation.
|
|
540
|
-
* Excludes read-only fields and removes additionalProperties constraint
|
|
541
|
-
* to allow form values to include read-only fields.
|
|
542
|
-
*
|
|
543
|
-
* @returns JSON schema object
|
|
544
|
-
*/
|
|
545
|
-
submissionSchema(): Record<string, unknown>;
|
|
546
507
|
/**
|
|
547
508
|
* Execute a lookup query for a specific field in this form.
|
|
548
509
|
*
|
|
@@ -561,6 +522,9 @@ export declare class Form<TState = Record<string, never>, TSteps extends Record<
|
|
|
561
522
|
private _runCalendarSlotQuery;
|
|
562
523
|
executeCalendarSlots(fieldName: string): Effect.Effect<ReadonlyArray<CalendarSlotItem>, unknown, unknown>;
|
|
563
524
|
executeCalendarSlotsWithState(fieldName: string, state: TState, ctx: FlowContext<TSteps>, item?: TItem): Effect.Effect<ReadonlyArray<CalendarSlotItem>, unknown, unknown>;
|
|
525
|
+
/** Encoded authoritative values, without form-initialization placeholders. */
|
|
526
|
+
resolveOriginalValues(processState: Record<string, unknown>, ctx: FlowContext<TSteps>, item?: unknown, currentProviderUser?: string): Effect.Effect<Record<string, unknown>, never>;
|
|
527
|
+
resolvePresentation(processState: Record<string, unknown>, ctx: FlowContext<TSteps>, item?: unknown): Record<string, FormPresentation>;
|
|
564
528
|
/**
|
|
565
529
|
* Resolves all default values for this Form given the current process state.
|
|
566
530
|
* Re-executes the form function with state to get fields with state-based defaults.
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { Construct } from "constructs";
|
|
2
2
|
import type { Schema } from "effect";
|
|
3
3
|
import { type Effect, Effect as EffectModule } from "effect";
|
|
4
|
-
import type { JsonSchema7Root } from "effect/JSONSchema";
|
|
5
|
-
import { type ClientFormDefinition, type WalkError } from "../../../form-client-representation/src/index.js";
|
|
6
4
|
import { type MetricBreakdownControl } from "../../../form-schema/src/index.js";
|
|
7
|
-
import { type DeepWritable, type FlattenFields, submissionSchemaSync as makeSubmissionSchema } from "../../../form-submission-schema/src/index.js";
|
|
5
|
+
import { type DeepWritable, type FlattenFields, type FlattenFieldsKeepingReadOnly, submissionSchemaSync as makeSubmissionSchema } from "../../../form-submission-schema/src/index.js";
|
|
8
6
|
import type { OrgUnit } from "./org-unit.js";
|
|
9
7
|
import type { Process } from "./process.js";
|
|
10
8
|
import type { Role } from "./role.js";
|
|
@@ -139,8 +137,18 @@ export type ListQueryFunction<TOutput extends Schema.Struct.Fields, R = never> =
|
|
|
139
137
|
/**
|
|
140
138
|
* Function type for fetching a single list item by ID.
|
|
141
139
|
* Returns the item or null if not found.
|
|
140
|
+
*
|
|
141
|
+
* The returned data is flat: wrapper fields are visual-only containers whose
|
|
142
|
+
* children flatten into the parent, structural-only elements are omitted, and
|
|
143
|
+
* read-only fields stay because they are display data. This matches the
|
|
144
|
+
* flattened GraphQL detail type and the browser renderer's value paths.
|
|
145
|
+
*/
|
|
146
|
+
export type ListItemQueryFunction<TForm extends Schema.Struct.Fields, R = never> = (id: string, ctx?: ListItemQueryContext) => Effect.Effect<ListItemDetail<TForm> | null, never, R>;
|
|
147
|
+
/**
|
|
148
|
+
* Type for the data an item query returns for a list form: flattened wrapper
|
|
149
|
+
* fields, no structural-only elements, read-only fields kept.
|
|
142
150
|
*/
|
|
143
|
-
export type
|
|
151
|
+
export type ListItemDetail<TForm extends Schema.Struct.Fields> = FlattenFieldsKeepingReadOnly<TForm> extends infer F extends Schema.Struct.Fields ? Schema.Schema.Type<Schema.Struct<F>> : never;
|
|
144
152
|
/**
|
|
145
153
|
* Type for the update input, flattening wrapper fields and excluding
|
|
146
154
|
* structural/read-only elements.
|
|
@@ -177,6 +185,10 @@ export interface ListProps<TOutput extends Schema.Struct.Fields, R = never, TFor
|
|
|
177
185
|
readonly output: TOutput;
|
|
178
186
|
/** Optional button opening this process's single start form. Uses its start permission. */
|
|
179
187
|
readonly startProcess?: Process;
|
|
188
|
+
/** Additional starts alongside the primary start button. */
|
|
189
|
+
readonly additionalStartProcesses?: readonly Process[];
|
|
190
|
+
/** Reveal this process's Anonymous Page to callers who may view the List. */
|
|
191
|
+
readonly anonymousPage?: Process;
|
|
180
192
|
/** Default page size (default: 20, max: 100) */
|
|
181
193
|
readonly defaultPageSize?: number;
|
|
182
194
|
/** Query function returning paginated results */
|
|
@@ -185,7 +197,12 @@ export interface ListProps<TOutput extends Schema.Struct.Fields, R = never, TFor
|
|
|
185
197
|
readonly exportOutput?: TExportOutput;
|
|
186
198
|
/** Optional export query overriding the normal list query for CSV exports */
|
|
187
199
|
readonly exportQuery?: ListQueryFunction<ListExportOutputFields<TOutput, TExportOutput>, R>;
|
|
188
|
-
/**
|
|
200
|
+
/** Portable detail/edit schema export, loaded from the organisation artifact. */
|
|
201
|
+
readonly browser?: {
|
|
202
|
+
readonly entrypoint: string;
|
|
203
|
+
readonly exportName: string;
|
|
204
|
+
};
|
|
205
|
+
/** Static detail/edit fields from the same exported schema. */
|
|
189
206
|
readonly form?: () => TForm;
|
|
190
207
|
/** Optional query function for fetching a single item by ID */
|
|
191
208
|
readonly itemQuery?: ListItemQueryFunction<TForm, R>;
|
|
@@ -195,6 +212,10 @@ export interface ListProps<TOutput extends Schema.Struct.Fields, R = never, TFor
|
|
|
195
212
|
readonly delete?: ListDeleteFunction<R>;
|
|
196
213
|
/** Opt-in creation, with an independent form and server-owned record ID. */
|
|
197
214
|
readonly create?: {
|
|
215
|
+
readonly browser?: {
|
|
216
|
+
readonly entrypoint: string;
|
|
217
|
+
readonly exportName: string;
|
|
218
|
+
};
|
|
198
219
|
readonly form: () => TCreate;
|
|
199
220
|
readonly submit: (input: ListCreateInput<TCreate>) => Effect.Effect<string, ListCreateError, R>;
|
|
200
221
|
};
|
|
@@ -238,6 +259,8 @@ export declare const MAX_PAGE_SIZE = 100;
|
|
|
238
259
|
export declare class List<TOutput extends Schema.Struct.Fields = Schema.Struct.Fields, R = never, TId extends string = string, TForm extends Schema.Struct.Fields = Schema.Struct.Fields, TExportOutput extends Schema.Struct.Fields | undefined = undefined, TCreate extends Schema.Struct.Fields = Schema.Struct.Fields> extends Construct {
|
|
239
260
|
readonly isList = true;
|
|
240
261
|
private readonly _create?;
|
|
262
|
+
readonly browser: ListProps<TOutput, R, TForm, TExportOutput, TCreate>["browser"];
|
|
263
|
+
readonly createBrowser: NonNullable<ListProps<TOutput, R, TForm, TExportOutput, TCreate>["create"]>["browser"];
|
|
241
264
|
readonly createFormFields: TCreate | undefined;
|
|
242
265
|
/** Display name for the list */
|
|
243
266
|
readonly name: string;
|
|
@@ -255,6 +278,11 @@ export declare class List<TOutput extends Schema.Struct.Fields = Schema.Struct.F
|
|
|
255
278
|
readonly name: string;
|
|
256
279
|
readonly startStepPath: string;
|
|
257
280
|
} | undefined;
|
|
281
|
+
readonly additionalStartProcesses: ReadonlyArray<NonNullable<List["startProcess"]>>;
|
|
282
|
+
readonly anonymousPage: {
|
|
283
|
+
readonly name: string;
|
|
284
|
+
readonly path: string;
|
|
285
|
+
} | undefined;
|
|
258
286
|
/** Default page size */
|
|
259
287
|
readonly defaultPageSize: number;
|
|
260
288
|
/** The query function */
|
|
@@ -286,12 +314,10 @@ export declare class List<TOutput extends Schema.Struct.Fields = Schema.Struct.F
|
|
|
286
314
|
createInputTypeName(): string;
|
|
287
315
|
createSubmissionSchema(): ReturnType<typeof makeSubmissionSchema<TCreate>> | null;
|
|
288
316
|
createFormMetadata(currentProviderUser?: string): EffectModule.Effect<{
|
|
289
|
-
readonly formDefinition: ClientFormDefinition;
|
|
290
317
|
readonly defaultValues: Record<string, DeepWritable<unknown>>;
|
|
291
|
-
readonly jsonSchema: JsonSchema7Root;
|
|
292
318
|
readonly createMutationName: string;
|
|
293
319
|
readonly createInputTypeName: string;
|
|
294
|
-
} | null,
|
|
320
|
+
} | null, never>;
|
|
295
321
|
executeCreate(input: ListCreateInput<TCreate>): Effect.Effect<string, ListCreateError | ListCreateNotDefinedError, R>;
|
|
296
322
|
/**
|
|
297
323
|
* Get the GraphQL query name for this list.
|
|
@@ -355,7 +381,7 @@ export declare class List<TOutput extends Schema.Struct.Fields = Schema.Struct.F
|
|
|
355
381
|
* @param id - The ID of the item to fetch
|
|
356
382
|
* @returns Effect producing the item or null
|
|
357
383
|
*/
|
|
358
|
-
executeItemQuery(id: string, ctx?: ListItemQueryContext): Effect.Effect<
|
|
384
|
+
executeItemQuery(id: string, ctx?: ListItemQueryContext): Effect.Effect<ListItemDetail<TForm> | null, ListItemQueryNotDefinedError, R>;
|
|
359
385
|
/**
|
|
360
386
|
* Get declared generic controls that can be passed to the item query.
|
|
361
387
|
*/
|
|
@@ -370,19 +396,6 @@ export declare class List<TOutput extends Schema.Struct.Fields = Schema.Struct.F
|
|
|
370
396
|
* Returns empty array if no form is defined.
|
|
371
397
|
*/
|
|
372
398
|
formColumns(): ListColumn[];
|
|
373
|
-
/**
|
|
374
|
-
* Generate the browser-safe form definition for the form fields.
|
|
375
|
-
* List forms do not currently support dynamic rules, so the canonical rule
|
|
376
|
-
* channel is always an empty array.
|
|
377
|
-
* Returns null if no form is defined.
|
|
378
|
-
*/
|
|
379
|
-
clientFormDefinition(): EffectModule.Effect<ClientFormDefinition | null, WalkError>;
|
|
380
|
-
/**
|
|
381
|
-
* Generate JSON Schema for the form's submittable fields.
|
|
382
|
-
* Strips read-only and structural-only fields; removes additionalProperties.
|
|
383
|
-
* Returns null if no form is defined.
|
|
384
|
-
*/
|
|
385
|
-
formSubmissionSchema(): Record<string, unknown> | null;
|
|
386
399
|
/**
|
|
387
400
|
* Get default values for the form fields.
|
|
388
401
|
* Returns null if no form is defined.
|
|
@@ -437,7 +450,7 @@ export declare class List<TOutput extends Schema.Struct.Fields = Schema.Struct.F
|
|
|
437
450
|
* Get editable form fields as a record (excludes FormReadOnly fields).
|
|
438
451
|
* Useful for schema generation where the full field schemas are needed.
|
|
439
452
|
*/
|
|
440
|
-
editableFormFields(): Record<string, Schema.
|
|
453
|
+
editableFormFields(): Record<string, Schema.Codec<unknown, unknown>>;
|
|
441
454
|
/**
|
|
442
455
|
* Get column metadata for editable form fields only.
|
|
443
456
|
* Returns columns for fields NOT annotated with FormReadOnly.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Effect, Schema } from "effect";
|
|
2
|
-
import type { LookupItem } from "../../../form-schema/src/index.js";
|
|
2
|
+
import type { LookupFieldMetadata, LookupItem } from "../../../form-schema/src/index.js";
|
|
3
3
|
/**
|
|
4
4
|
* Input for independent lookup queries — just filter.
|
|
5
5
|
*/
|
|
@@ -29,6 +29,7 @@ export interface LookupOverride {
|
|
|
29
29
|
* Storage interface so accessors can write back without depending on Form.
|
|
30
30
|
*/
|
|
31
31
|
export interface LookupOverrideStore {
|
|
32
|
+
_setLookupResolver(fieldName: string, resolve: NonNullable<LookupFieldMetadata["resolve"]>): void;
|
|
32
33
|
_setLookupOverride(fieldName: string, override: LookupOverride): void;
|
|
33
34
|
}
|
|
34
35
|
/**
|
|
@@ -45,6 +46,8 @@ export declare class LookupAccessor<TInput extends Schema.Struct.Fields, K exten
|
|
|
45
46
|
* Set the query for an independent lookup (no dependencies).
|
|
46
47
|
*/
|
|
47
48
|
setQuery(query: (input: QueryInput, limit: number) => Effect.Effect<ReadonlyArray<LookupItem>, unknown, unknown>): void;
|
|
49
|
+
/** Server-owned eligibility and label lookup, independent of search mode. */
|
|
50
|
+
setResolver(resolve: NonNullable<LookupFieldMetadata["resolve"]>): void;
|
|
48
51
|
/**
|
|
49
52
|
* Declare dependencies on other lookup fields, returning a builder
|
|
50
53
|
* whose `setQuery` receives the dependency values as typed input.
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import type { DocumentStoreService, EmailSender, NotificationDeliveryConfig } from "@processfocus/runtime";
|
|
2
|
+
import type { Layer } from "effect";
|
|
3
|
+
import type { HttpClient } from "effect/http";
|
|
1
4
|
import type { BusinessCalendarConfig } from "../../../business-calendar/src/index.js";
|
|
2
5
|
import type { DocumentStore } from "./document-store.js";
|
|
3
6
|
import type { Form } from "./form.js";
|
|
@@ -17,7 +20,12 @@ export declare const validateTimeZone: (timeZone: string) => void;
|
|
|
17
20
|
* The real organisation lives in the organisation package, and has
|
|
18
21
|
* various helper methods to use it.
|
|
19
22
|
*/
|
|
23
|
+
type NotificationEmailLayer = Layer.Layer<EmailSender | NotificationDeliveryConfig, unknown, DocumentStoreService | HttpClient.HttpClient>;
|
|
20
24
|
export interface OrganisationProps {
|
|
25
|
+
/** Platform branch or exact commit selected for a hosted deploy. */
|
|
26
|
+
readonly platformRef?: string | undefined;
|
|
27
|
+
/** Official repository for platformRef. Defaults to the private monorepo. */
|
|
28
|
+
readonly platformSource?: "private" | "public" | undefined;
|
|
21
29
|
/**
|
|
22
30
|
* Full name of organisation.
|
|
23
31
|
*/
|
|
@@ -45,6 +53,8 @@ export interface OrganisationProps {
|
|
|
45
53
|
* Default when no calendar is specified: a 24/7 calendar.
|
|
46
54
|
*/
|
|
47
55
|
readonly businessCalendar?: BusinessCalendarConfig | undefined;
|
|
56
|
+
/** The same notification layer used by the job worker, independent of other job services. */
|
|
57
|
+
readonly notificationEmailLayer?: (() => NotificationEmailLayer) | undefined;
|
|
48
58
|
}
|
|
49
59
|
/**
|
|
50
60
|
* Represents the root organizational unit.
|
|
@@ -70,6 +80,8 @@ export declare class Organisation extends OrgUnitClass {
|
|
|
70
80
|
* IANA timezone identifier (e.g., "Europe/Amsterdam", "America/New_York").
|
|
71
81
|
*/
|
|
72
82
|
readonly timeZone: string;
|
|
83
|
+
readonly platformRef: string | undefined;
|
|
84
|
+
readonly platformSource: OrganisationProps["platformSource"];
|
|
73
85
|
/**
|
|
74
86
|
* BCP 47 locale used for organisation-authored date/time display.
|
|
75
87
|
*/
|
|
@@ -79,6 +91,7 @@ export declare class Organisation extends OrgUnitClass {
|
|
|
79
91
|
* Defines working hours, holidays, and special periods.
|
|
80
92
|
*/
|
|
81
93
|
readonly businessCalendar?: BusinessCalendarConfig | undefined;
|
|
94
|
+
readonly notificationEmailLayer: OrganisationProps["notificationEmailLayer"];
|
|
82
95
|
constructor(props: OrganisationProps);
|
|
83
96
|
/**
|
|
84
97
|
* Find a step by its path relative to the organisation root.
|
|
@@ -164,3 +177,4 @@ export declare class Organisation extends OrgUnitClass {
|
|
|
164
177
|
orphanElse: string[];
|
|
165
178
|
}>;
|
|
166
179
|
}
|
|
180
|
+
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Construct } from "constructs";
|
|
2
|
-
import type
|
|
2
|
+
import { type Effect, type Schema } from "effect";
|
|
3
3
|
import { MultiDirectedGraph as DirectedGraph } from "graphology";
|
|
4
4
|
import type { DayOfMonth, TimeOfDay } from "../../../business-calendar/src/index.js";
|
|
5
5
|
import type { FlattenFields } from "../../../form-submission-schema/src/index.js";
|
|
6
6
|
import type { CamelCase, FlowContext, FormStepMeta, StepMeta } from "./flow-context.js";
|
|
7
7
|
import { type FlowPath } from "./flow-path.js";
|
|
8
|
-
import type { Form } from "./form.js";
|
|
8
|
+
import type { Form, FormSubmissionError } from "./form.js";
|
|
9
9
|
import type { OrgUnit } from "./org-unit.js";
|
|
10
10
|
import type { Role } from "./role.js";
|
|
11
11
|
import type { ScheduledTime } from "./schedule.js";
|
|
@@ -43,6 +43,14 @@ export interface MonthlyProcessCron {
|
|
|
43
43
|
readonly timeZone?: string | undefined;
|
|
44
44
|
}
|
|
45
45
|
export type ProcessCron = HourlyProcessCron | DailyProcessCron | WeeklyProcessCron | MonthlyProcessCron;
|
|
46
|
+
declare const ProcessActivationConflict_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 & {
|
|
47
|
+
readonly _tag: "ProcessActivationConflict";
|
|
48
|
+
} & Readonly<A>;
|
|
49
|
+
export declare class ProcessActivationConflict extends ProcessActivationConflict_base<{
|
|
50
|
+
readonly executionId: string;
|
|
51
|
+
readonly message: string;
|
|
52
|
+
}> {
|
|
53
|
+
}
|
|
46
54
|
export interface ProcessProps {
|
|
47
55
|
/**
|
|
48
56
|
* Name of process.
|
|
@@ -75,6 +83,17 @@ export interface ProcessProps {
|
|
|
75
83
|
* Only supported for processes with exactly one system start step.
|
|
76
84
|
*/
|
|
77
85
|
readonly cron?: ProcessCron;
|
|
86
|
+
/**
|
|
87
|
+
* Check domain admission after writing the active execution, before committing
|
|
88
|
+
* or dispatching work. Also check caller-supplied receipt replays before
|
|
89
|
+
* returning the receipt or recovering dispatch. This callback must only do
|
|
90
|
+
* transactional database work.
|
|
91
|
+
*/
|
|
92
|
+
readonly validateActivation?: (input: {
|
|
93
|
+
readonly kind: "activation" | "receipt";
|
|
94
|
+
readonly executionId: string;
|
|
95
|
+
readonly state: Readonly<Record<string, unknown>>;
|
|
96
|
+
}) => Effect.Effect<void, FormSubmissionError | ProcessActivationConflict, unknown>;
|
|
78
97
|
}
|
|
79
98
|
/**
|
|
80
99
|
* Condition function type for flow edges.
|
|
@@ -95,6 +114,8 @@ export type Condition<TState, TSteps extends Record<string, StepMeta> = Record<s
|
|
|
95
114
|
*/
|
|
96
115
|
export type ScheduleFn<TState, TSteps extends Record<string, StepMeta> = Record<string, never>> = (state: TState, ctx: FlowContext<TSteps>) => ScheduledTime;
|
|
97
116
|
export interface EdgeAttributes<TState> {
|
|
117
|
+
deadlineName?: string | undefined;
|
|
118
|
+
interrupting?: boolean | undefined;
|
|
98
119
|
condition?: Condition<TState> | undefined;
|
|
99
120
|
conditionText?: string | undefined;
|
|
100
121
|
schedule?: ScheduleFn<TState, any> | undefined;
|
|
@@ -194,3 +215,4 @@ export declare class Process extends Construct implements IProcessHolder {
|
|
|
194
215
|
path: string;
|
|
195
216
|
}>;
|
|
196
217
|
}
|
|
218
|
+
export {};
|
|
@@ -172,7 +172,7 @@ export declare const Schedule: {
|
|
|
172
172
|
* @param duration - Duration to add (DurationInput accepts string like "1 hour")
|
|
173
173
|
* @returns A ClockTimeSchedule marker resolved at execution time
|
|
174
174
|
*/
|
|
175
|
-
clockTime(from: DateTime.DateTime, duration: Duration.
|
|
175
|
+
clockTime(from: DateTime.DateTime, duration: Duration.Input): ClockTimeSchedule;
|
|
176
176
|
/**
|
|
177
177
|
* Create a from-point schedule marker.
|
|
178
178
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Construct } from "constructs";
|
|
2
|
-
import { Schema } from "effect";
|
|
2
|
+
import { type DateTime, type Duration, Schema } from "effect";
|
|
3
3
|
import type { ForEachOutput, FormStepMeta, MergeFormStep, MergeSteps, StepMeta } from "./flow-context.js";
|
|
4
4
|
import { type FlowPath, type TransitionOptions } from "./flow-path.js";
|
|
5
5
|
import type { Phase } from "./phase.js";
|
|
@@ -94,12 +94,22 @@ export declare abstract class Step<TState = Record<string, never>, TOutput exten
|
|
|
94
94
|
* which fails when org.js is compiled separately from the job worker.
|
|
95
95
|
*/
|
|
96
96
|
readonly isSystemStep: boolean;
|
|
97
|
+
/** One-shot timing, evaluated against state before this activation completes. */
|
|
98
|
+
readonly deadlines: {
|
|
99
|
+
readonly name: string;
|
|
100
|
+
readonly interrupting: boolean;
|
|
101
|
+
readonly timing: {
|
|
102
|
+
readonly after: Duration.Duration;
|
|
103
|
+
} | {
|
|
104
|
+
at(state: TState): DateTime.DateTime;
|
|
105
|
+
};
|
|
106
|
+
}[];
|
|
97
107
|
/**
|
|
98
108
|
* The output validation schema for this step.
|
|
99
109
|
* Lazily builds Schema.Struct from output fields on first access.
|
|
100
110
|
* Form overrides this to include struct-level validation refinements.
|
|
101
111
|
*/
|
|
102
|
-
get outputSchema(): Schema.
|
|
112
|
+
get outputSchema(): Schema.Top | undefined;
|
|
103
113
|
/**
|
|
104
114
|
* The flat submission validation schema for this step.
|
|
105
115
|
* Returns `undefined` for non-Form steps. Form overrides this to return
|
|
@@ -108,7 +118,7 @@ export declare abstract class Step<TState = Record<string, never>, TOutput exten
|
|
|
108
118
|
*
|
|
109
119
|
* Used by start/complete resolvers for server-side validation.
|
|
110
120
|
*/
|
|
111
|
-
get submissionEffectSchema(): Schema.
|
|
121
|
+
get submissionEffectSchema(): Schema.Top | undefined;
|
|
112
122
|
/**
|
|
113
123
|
* Brand property to identify forEach steps across bundle boundaries.
|
|
114
124
|
* Overridden to `true` in SystemStep/Form when forEach is configured.
|