@nice-code/action 0.2.0 → 0.2.1
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/build/types/ActionDefinition/Action/Action.combined.types.d.ts +10 -0
- package/build/types/ActionDefinition/Action/Context/ActionContext.d.ts +3 -4
- package/build/types/ActionDefinition/Action/Core/ActionCore.d.ts +2 -3
- package/build/types/ActionDefinition/Action/RunningAction.types.d.ts +6 -0
- package/build/types/ActionDefinition/Domain/ActionDomain.d.ts +5 -6
- package/build/types/ActionDefinition/Domain/ActionDomain.types.d.ts +4 -1
- package/build/types/ActionDefinition/Domain/ActionDomainBase.d.ts +2 -2
- package/build/types/ActionDefinition/Schema/ActionSchema.d.ts +7 -7
- package/build/types/ActionDefinition/Schema/ActionSchema.types.d.ts +4 -8
- package/build/types/ActionRuntime/Handler/Local/ActionLocalHandler.types.d.ts +3 -2
- package/build/types/ActionRuntime/test/helpers/new_action_test_data.d.ts +60 -154
- package/package.json +1 -1
|
@@ -8,6 +8,16 @@ import type { IActionPayload_Progress_JsonObject, IActionPayload_Request_JsonObj
|
|
|
8
8
|
import type { ActionPayload_Progress } from "./Payload/ActionPayload_Progress";
|
|
9
9
|
import type { ActionPayload_Request } from "./Payload/ActionPayload_Request";
|
|
10
10
|
import type { ActionPayload_Result } from "./Payload/ActionPayload_Result";
|
|
11
|
+
/**
|
|
12
|
+
* Distributes a union ID into a proper discriminated union of ActionPayload_Request instances,
|
|
13
|
+
* so that narrowing on `.id` also narrows `.input`.
|
|
14
|
+
*/
|
|
15
|
+
export type TDistributeActionPayload_Request<DOM extends IActionDomain, ID extends keyof DOM["actions"] & string> = ID extends keyof DOM["actions"] & string ? ActionPayload_Request<DOM, ID> : never;
|
|
16
|
+
/**
|
|
17
|
+
* Distributes a union ID into a proper discriminated union of ActionPayload_Result instances,
|
|
18
|
+
* so that narrowing on `.id` also narrows `.result`.
|
|
19
|
+
*/
|
|
20
|
+
export type TDistributeActionPayload_Result<DOM extends IActionDomain, ID extends keyof DOM["actions"] & string> = ID extends keyof DOM["actions"] & string ? ActionPayload_Result<DOM, ID> : never;
|
|
11
21
|
export type TAction_Any_Instance<DOM extends IActionDomain, ID extends keyof DOM["actions"] & string = keyof DOM["actions"] & string> = ActionCore<DOM, ID> | TActionPayload_Any_Instance<DOM, ID> | ActionContext<DOM, ID>;
|
|
12
22
|
/**
|
|
13
23
|
*
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ActionClientSpecifier } from "../../../ActionRuntime/Client/ActionClientSpecifier";
|
|
2
2
|
import type { ActionDomain } from "../../Domain/ActionDomain";
|
|
3
3
|
import type { IActionDomain, TInferInputFromSchema, TInferOutputFromSchema } from "../../Domain/ActionDomain.types";
|
|
4
4
|
import { ActionBase } from "../ActionBase";
|
|
5
5
|
import { EActionForm } from "../ActionBase.types";
|
|
6
|
-
import { ActionClientSpecifier } from "../../../ActionRuntime/Client/ActionClientSpecifier";
|
|
7
6
|
import type { IActionContext, IActionContext_Data, IActionContext_Data_JsonObject, IActionContext_JsonObject, IActionRouteItem } from "./ActionContext.types";
|
|
8
7
|
export declare class ActionContext<DOM extends IActionDomain, ID extends keyof DOM["actions"] & string = keyof DOM["actions"] & string> extends ActionBase<EActionForm.context, DOM, ID> implements IActionContext<DOM, ID> {
|
|
9
8
|
readonly _domain: ActionDomain<DOM>;
|
|
@@ -19,8 +18,8 @@ export declare class ActionContext<DOM extends IActionDomain, ID extends keyof D
|
|
|
19
18
|
toJsonObject(): IActionContext_JsonObject<DOM, ID>;
|
|
20
19
|
get routing(): IActionRouteItem[];
|
|
21
20
|
addRouteItem(item: IActionRouteItem): void;
|
|
22
|
-
deserializeInput(serialized:
|
|
23
|
-
serializeInput(raw: TInferInputFromSchema<DOM["actions"][ID]>["Input"]):
|
|
21
|
+
deserializeInput(serialized: TInferInputFromSchema<DOM["actions"][ID]>["SerdeInput"]): TInferInputFromSchema<DOM["actions"][ID]>["Input"];
|
|
22
|
+
serializeInput(raw: TInferInputFromSchema<DOM["actions"][ID]>["Input"]): TInferInputFromSchema<DOM["actions"][ID]>["SerdeInput"];
|
|
24
23
|
validateInput(input: unknown): TInferInputFromSchema<DOM["actions"][ID]>["Input"];
|
|
25
24
|
validateOutput(output: unknown): TInferOutputFromSchema<DOM["actions"][ID]>["Output"];
|
|
26
25
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { JSONSerializableValue } from "@nice-code/error";
|
|
2
1
|
import type { ActionDomain } from "../../Domain/ActionDomain";
|
|
3
2
|
import type { IActionDomain, TInferInputFromSchema, TInferOutputFromSchema } from "../../Domain/ActionDomain.types";
|
|
4
3
|
import type { TNarrowActionType } from "../Action.combined.types";
|
|
@@ -13,8 +12,8 @@ export declare class ActionCore<DOM extends IActionDomain, ID extends keyof DOM[
|
|
|
13
12
|
is<ACT extends IActionBase<any, any, any>>(action: ACT | unknown | null | undefined): action is TNarrowActionType<DOM, ACT, ID>;
|
|
14
13
|
toJsonObject(): IActionBase_JsonObject<EActionForm.core, DOM, ID>;
|
|
15
14
|
request(input: TInferInputFromSchema<DOM["actions"][ID]>["Input"]): ActionPayload_Request<DOM, ID>;
|
|
16
|
-
deserializeInput(serialized:
|
|
17
|
-
serializeInput(raw: TInferInputFromSchema<DOM["actions"][ID]>["Input"]):
|
|
15
|
+
deserializeInput(serialized: TInferInputFromSchema<DOM["actions"][ID]>["SerdeInput"]): TInferInputFromSchema<DOM["actions"][ID]>["Input"];
|
|
16
|
+
serializeInput(raw: TInferInputFromSchema<DOM["actions"][ID]>["Input"]): TInferInputFromSchema<DOM["actions"][ID]>["SerdeInput"];
|
|
18
17
|
validateInput(input: unknown): TInferInputFromSchema<DOM["actions"][ID]>["Input"];
|
|
19
18
|
validateOutput(output: unknown): TInferOutputFromSchema<DOM["actions"][ID]>["Output"];
|
|
20
19
|
}
|
|
@@ -57,6 +57,12 @@ export interface IRunningActionUpdate_Success<DOM extends IActionDomain, ID exte
|
|
|
57
57
|
export type TRunningActionUpdateFinished<DOM extends IActionDomain, ID extends keyof DOM["actions"] & string = keyof DOM["actions"] & string> = IRunningActionUpdate_Abort<DOM, ID> | IRunningActionUpdate_Failed<DOM, ID> | IRunningActionUpdate_Success<DOM, ID>;
|
|
58
58
|
export type TRunningActionUpdate<DOM extends IActionDomain, ID extends keyof DOM["actions"] & string = keyof DOM["actions"] & string> = IRunningActionUpdate_Started<DOM, ID> | IRunningActionUpdate_Progress<DOM, ID> | TRunningActionUpdateFinished<DOM, ID>;
|
|
59
59
|
export type TRunningActionUpdateListener<DOM extends IActionDomain, ID extends keyof DOM["actions"] & string = keyof DOM["actions"] & string> = (update: TRunningActionUpdate<DOM, ID>) => void;
|
|
60
|
+
/**
|
|
61
|
+
* Distributes a union ID into a proper discriminated union of RunningAction update events,
|
|
62
|
+
* so that narrowing on `update.runningAction.id` also narrows `update.runningAction`'s input/output types.
|
|
63
|
+
*/
|
|
64
|
+
export type TDistributeRunningActionUpdate<DOM extends IActionDomain, ID extends keyof DOM["actions"] & string = keyof DOM["actions"] & string> = ID extends keyof DOM["actions"] & string ? TRunningActionUpdate<DOM, ID> : never;
|
|
65
|
+
export type TDistributeRunningActionUpdateListener<DOM extends IActionDomain, ID extends keyof DOM["actions"] & string = keyof DOM["actions"] & string> = (update: TDistributeRunningActionUpdate<DOM, ID>) => void;
|
|
60
66
|
export interface IRunningActionUserMethods<DOM extends IActionDomain, ID extends keyof DOM["actions"] & string> {
|
|
61
67
|
waitForResultPayload(): Promise<ActionPayload_Result<DOM, ID>>;
|
|
62
68
|
addUpdateListeners(listeners: TRunningActionUpdateListener<DOM, ID>[]): () => void;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import type { IExecuteActionOptions } from "../../ActionRuntime/Handler/ActionHandler.types";
|
|
2
|
-
import type { TAction_Any_JsonObject, TDistributedDomainActions, TNarrowActionJsonTypeToActionInstanceType } from "../Action/Action.combined.types";
|
|
2
|
+
import type { TAction_Any_JsonObject, TDistributeActionPayload_Request, TDistributeActionPayload_Result, TDistributedDomainActions, TNarrowActionJsonTypeToActionInstanceType } from "../Action/Action.combined.types";
|
|
3
3
|
import { type IActionBase } from "../Action/ActionBase.types";
|
|
4
4
|
import { ActionContext } from "../Action/Context/ActionContext";
|
|
5
5
|
import type { IActionContext_Data_JsonObject } from "../Action/Context/ActionContext.types";
|
|
6
6
|
import { ActionCore } from "../Action/Core/ActionCore";
|
|
7
7
|
import { type IActionPayload_Request_JsonObject, type IActionPayload_Result_JsonObject } from "../Action/Payload/ActionPayload.types";
|
|
8
8
|
import { ActionPayload_Request } from "../Action/Payload/ActionPayload_Request";
|
|
9
|
-
import { ActionPayload_Result } from "../Action/Payload/ActionPayload_Result";
|
|
10
9
|
import type { RunningAction } from "../Action/RunningAction";
|
|
11
10
|
import type { IActionDomain, IActionDomainChildOptions, TActionDomainChildDef } from "./ActionDomain.types";
|
|
12
11
|
import { ActionDomainBase } from "./ActionDomainBase";
|
|
@@ -14,17 +13,17 @@ import { type ActionRootDomain } from "./ActionRootDomain";
|
|
|
14
13
|
export declare class ActionDomain<ACT_DOM extends IActionDomain = IActionDomain> extends ActionDomainBase<ACT_DOM> {
|
|
15
14
|
private _rootDomain;
|
|
16
15
|
constructor(definition: ACT_DOM, { rootDomain, }: {
|
|
17
|
-
rootDomain: ActionRootDomain
|
|
16
|
+
rootDomain: ActionRootDomain<any>;
|
|
18
17
|
});
|
|
19
|
-
get rootDomain(): ActionRootDomain<
|
|
18
|
+
get rootDomain(): ActionRootDomain<any>;
|
|
20
19
|
createChildDomain<SUB_DOM extends IActionDomainChildOptions>(subDomainDef: SUB_DOM & {
|
|
21
20
|
[K in Exclude<keyof SUB_DOM, keyof IActionDomainChildOptions>]: never;
|
|
22
21
|
}): ActionDomain<TActionDomainChildDef<ACT_DOM, SUB_DOM>>;
|
|
23
22
|
action<ID extends keyof ACT_DOM["actions"] & string>(id: ID): ActionCore<ACT_DOM, ID>;
|
|
24
23
|
hydrateContext<ID extends keyof ACT_DOM["actions"] & string>(id: ID, contextData: IActionContext_Data_JsonObject): ActionContext<ACT_DOM, ID>;
|
|
25
24
|
isDomainAction<ACT extends IActionBase<any, ACT_DOM, any>>(action: ACT | unknown | null | undefined): action is TDistributedDomainActions<ACT_DOM, ACT>;
|
|
26
|
-
hydrateRequest<ID extends keyof ACT_DOM["actions"] & string, P extends IActionPayload_Request_JsonObject<ACT_DOM, ID>>(serialized: P):
|
|
27
|
-
hydrateResultPayload<ID extends keyof ACT_DOM["actions"] & string, R extends IActionPayload_Result_JsonObject<ACT_DOM, ID>>(serialized: R):
|
|
25
|
+
hydrateRequest<ID extends keyof ACT_DOM["actions"] & string, P extends IActionPayload_Request_JsonObject<ACT_DOM, ID>>(serialized: P): TDistributeActionPayload_Request<ACT_DOM, ID>;
|
|
26
|
+
hydrateResultPayload<ID extends keyof ACT_DOM["actions"] & string, R extends IActionPayload_Result_JsonObject<ACT_DOM, ID>>(serialized: R): TDistributeActionPayload_Result<ACT_DOM, ID>;
|
|
28
27
|
hydrateAnyAction<ID extends keyof ACT_DOM["actions"] & string, AJ extends TAction_Any_JsonObject<ACT_DOM, ID>>(actionJson: AJ): TNarrowActionJsonTypeToActionInstanceType<ACT_DOM, AJ, ID>;
|
|
29
28
|
runAction<ID extends keyof ACT_DOM["actions"] & string, ACT extends ActionPayload_Request<ACT_DOM, ID>>(request: ACT, options?: IExecuteActionOptions<ACT_DOM, ID>): Promise<RunningAction<ACT_DOM, ID>>;
|
|
30
29
|
}
|
|
@@ -30,7 +30,10 @@ export type TDomainActionId<DOM extends IActionDomain> = keyof DOM["actions"] &
|
|
|
30
30
|
export type TInferInputFromSchema<SCH extends ActionSchema<any, any, any>> = SCH extends ActionSchema<infer IN, any, any> ? {
|
|
31
31
|
Input: IN[0];
|
|
32
32
|
SerdeInput: IN[1];
|
|
33
|
-
} :
|
|
33
|
+
} : {
|
|
34
|
+
Input: never;
|
|
35
|
+
SerdeInput: never;
|
|
36
|
+
};
|
|
34
37
|
export type TInferOutputFromSchema<SCH extends ActionSchema<any, any, any>> = SCH extends ActionSchema<any, infer OUT, any> ? {
|
|
35
38
|
Output: OUT[0];
|
|
36
39
|
SerdeOutput: OUT[1];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TRunningActionUpdateListener } from "../Action/RunningAction.types";
|
|
1
|
+
import type { TDistributeRunningActionUpdateListener, TRunningActionUpdateListener } from "../Action/RunningAction.types";
|
|
2
2
|
import type { IActionDomain } from "./ActionDomain.types";
|
|
3
3
|
export declare abstract class ActionDomainBase<ACT_DOM extends IActionDomain = IActionDomain> implements IActionDomain<ACT_DOM["allDomains"], ACT_DOM["actions"]> {
|
|
4
4
|
readonly domain: ACT_DOM["domain"];
|
|
@@ -10,5 +10,5 @@ export declare abstract class ActionDomainBase<ACT_DOM extends IActionDomain = I
|
|
|
10
10
|
* Add an observer that is called after every action dispatched through this domain.
|
|
11
11
|
* Returns an unsubscribe function — call it to remove the listener.
|
|
12
12
|
*/
|
|
13
|
-
addActionListener(listener:
|
|
13
|
+
addActionListener(listener: TDistributeRunningActionUpdateListener<ACT_DOM, keyof ACT_DOM["actions"] & string>): () => void;
|
|
14
14
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { err_cast_not_nice, type INiceErrorDomainProps, type InferNiceError, type
|
|
1
|
+
import { err_cast_not_nice, type INiceErrorDomainProps, type InferNiceError, type NiceErrorDomain } from "@nice-code/error";
|
|
2
2
|
import type { StandardSchemaV1 } from "@standard-schema/spec";
|
|
3
3
|
import type { IActionErrorDeclaration, TActionSchemaOptions, TInferDeclaredErrors, TTransportedValue } from "./ActionSchema.types";
|
|
4
4
|
export declare class ActionSchema<INPUT extends TTransportedValue<any, any> = never, OUTPUT extends TTransportedValue<any, any> = never, ERRORS extends readonly IActionErrorDeclaration<any, any>[] = readonly []> {
|
|
@@ -12,14 +12,14 @@ export declare class ActionSchema<INPUT extends TTransportedValue<any, any> = ne
|
|
|
12
12
|
* For non-JSON-native inputs, prefer the 3-argument form below to avoid
|
|
13
13
|
* needing explicit type parameters.
|
|
14
14
|
*/
|
|
15
|
-
input<VS extends StandardSchemaV1 = StandardSchemaV1, SERDE_IN
|
|
15
|
+
input<VS extends StandardSchemaV1 = StandardSchemaV1, SERDE_IN = any>(options: TActionSchemaOptions<VS, SERDE_IN>): ActionSchema<TTransportedValue<StandardSchemaV1.InferInput<VS>, SERDE_IN>, OUTPUT, ERRORS>;
|
|
16
16
|
/**
|
|
17
17
|
* Declare the input schema with serialization via sequential parameters.
|
|
18
18
|
* TypeScript infers SERDE_IN from `serialize`'s return type (left-to-right),
|
|
19
19
|
* then provides it as the contextual type for `deserialize`'s parameter —
|
|
20
20
|
* no explicit type parameters or casts needed.
|
|
21
21
|
*/
|
|
22
|
-
input<VS extends StandardSchemaV1, SERDE_IN
|
|
22
|
+
input<VS extends StandardSchemaV1, SERDE_IN = any>(options: {
|
|
23
23
|
schema: VS;
|
|
24
24
|
}, serialize: (raw: StandardSchemaV1.InferInput<VS>) => SERDE_IN, deserialize: (serde: SERDE_IN) => StandardSchemaV1.InferInput<VS>): ActionSchema<TTransportedValue<StandardSchemaV1.InferInput<VS>, SERDE_IN>, OUTPUT, ERRORS>;
|
|
25
25
|
/**
|
|
@@ -27,14 +27,14 @@ export declare class ActionSchema<INPUT extends TTransportedValue<any, any> = ne
|
|
|
27
27
|
* For non-JSON-native outputs, prefer the 3-argument form below to avoid
|
|
28
28
|
* needing explicit type parameters.
|
|
29
29
|
*/
|
|
30
|
-
output<VS extends StandardSchemaV1 = StandardSchemaV1, SERDE_OUT
|
|
30
|
+
output<VS extends StandardSchemaV1 = StandardSchemaV1, SERDE_OUT = any>(options: TActionSchemaOptions<VS, SERDE_OUT>): ActionSchema<INPUT, TTransportedValue<StandardSchemaV1.InferInput<VS>, SERDE_OUT>, ERRORS>;
|
|
31
31
|
/**
|
|
32
32
|
* Declare the output schema with serialization via sequential parameters.
|
|
33
33
|
* TypeScript infers SERDE_OUT from `serialize`'s return type (left-to-right),
|
|
34
34
|
* then provides it as the contextual type for `deserialize`'s parameter —
|
|
35
35
|
* no explicit type parameters or casts needed.
|
|
36
36
|
*/
|
|
37
|
-
output<VS extends StandardSchemaV1, SERDE_OUT
|
|
37
|
+
output<VS extends StandardSchemaV1, SERDE_OUT = any>(options: {
|
|
38
38
|
schema: VS;
|
|
39
39
|
}, serialize: (raw: StandardSchemaV1.InferInput<VS>) => SERDE_OUT, deserialize: (serde: SERDE_OUT) => StandardSchemaV1.InferInput<VS>): ActionSchema<INPUT, TTransportedValue<StandardSchemaV1.InferInput<VS>, SERDE_OUT>, ERRORS>;
|
|
40
40
|
/**
|
|
@@ -52,13 +52,13 @@ export declare class ActionSchema<INPUT extends TTransportedValue<any, any> = ne
|
|
|
52
52
|
* Uses the schema's serialization.serialize if defined; otherwise the input
|
|
53
53
|
* is already JSON-native and is returned as-is.
|
|
54
54
|
*/
|
|
55
|
-
serializeInput(rawInput: INPUT[0]):
|
|
55
|
+
serializeInput(rawInput: INPUT[0]): INPUT[1];
|
|
56
56
|
/**
|
|
57
57
|
* Deserialize a JSON value back into the raw input type.
|
|
58
58
|
* Uses serialization.deserialize if defined; otherwise the value is cast
|
|
59
59
|
* directly (it's already in the correct shape).
|
|
60
60
|
*/
|
|
61
|
-
deserializeInput(serialized:
|
|
61
|
+
deserializeInput(serialized: INPUT[1]): INPUT[0];
|
|
62
62
|
/**
|
|
63
63
|
* Validate raw input against the schema defined via `.input({ schema })`.
|
|
64
64
|
* Throws `action_input_validation_failed` if validation fails.
|
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
import { type INiceErrorDomainProps, type
|
|
1
|
+
import { type INiceErrorDomainProps, type NiceErrorDomain } from "@nice-code/error";
|
|
2
2
|
import type { StandardSchemaV1 } from "@standard-schema/spec";
|
|
3
|
-
export type
|
|
4
|
-
export type
|
|
5
|
-
export type TActionSerializationDefinition<RAW_VAL = any, SERDE_VAL extends TActionJsonSerializableValue = TActionJsonSerializableValue> = {
|
|
3
|
+
export type TTransportedValue<RAW_VAL, SERDE_VAL> = [RAW_VAL] | [RAW_VAL, SERDE_VAL];
|
|
4
|
+
export type TActionSerializationDefinition<RAW_VAL = any, SERDE_VAL = any> = {
|
|
6
5
|
serialize: (value: RAW_VAL) => SERDE_VAL;
|
|
7
6
|
deserialize: (value: SERDE_VAL) => RAW_VAL;
|
|
8
7
|
};
|
|
9
|
-
export type TActionSchemaOptions<VS extends StandardSchemaV1 = StandardSchemaV1, SERDE_IN
|
|
8
|
+
export type TActionSchemaOptions<VS extends StandardSchemaV1 = StandardSchemaV1, SERDE_IN = any> = {
|
|
10
9
|
schema: VS;
|
|
11
10
|
serialization?: TActionSerializationDefinition<StandardSchemaV1.InferInput<VS>, SERDE_IN>;
|
|
12
|
-
} : {
|
|
13
|
-
schema: VS;
|
|
14
|
-
serialization: TActionSerializationDefinition<StandardSchemaV1.InferInput<VS>, SERDE_IN>;
|
|
15
11
|
};
|
|
16
12
|
/**
|
|
17
13
|
* One error declaration on an action schema.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { MaybePromise } from "bun";
|
|
2
|
+
import type { TDistributeActionPayload_Request } from "../../../ActionDefinition/Action/Action.combined.types";
|
|
2
3
|
import type { IActionPayload_Result_JsonObject } from "../../../ActionDefinition/Action/Payload/ActionPayload.types";
|
|
3
|
-
import type { ActionPayload_Request } from "../../../ActionDefinition/Action/Payload/ActionPayload_Request";
|
|
4
4
|
import type { ActionPayload_Result } from "../../../ActionDefinition/Action/Payload/ActionPayload_Result";
|
|
5
5
|
import type { IActionDomain, TInferOutputFromSchema } from "../../../ActionDefinition/Domain/ActionDomain.types";
|
|
6
|
-
export type
|
|
6
|
+
export type { TDistributeActionPayload_Request };
|
|
7
|
+
export type THandleActionExecutionFn<DOM extends IActionDomain, ID extends keyof DOM["actions"] & string = keyof DOM["actions"] & string> = (action: TDistributeActionPayload_Request<DOM, ID>) => MaybePromise<ActionPayload_Result<DOM, ID> | IActionPayload_Result_JsonObject<DOM, ID> | TInferOutputFromSchema<DOM["actions"][ID]>["Output"] | undefined>;
|
|
@@ -9,58 +9,39 @@ export declare function _test_createActions(): {
|
|
|
9
9
|
test_dom_user: import("../../..").ActionDomain<import("../../..").TActionDomainChildDef<import("../../..").IActionRootDomain<"test_root">, {
|
|
10
10
|
domain: string;
|
|
11
11
|
actions: {
|
|
12
|
-
sign_in: import("../../..").ActionSchema<
|
|
12
|
+
sign_in: import("../../..").ActionSchema<import("../../..").TTransportedValue<{
|
|
13
13
|
username: string;
|
|
14
14
|
password: string;
|
|
15
|
-
}
|
|
16
|
-
username: string;
|
|
17
|
-
password: string;
|
|
18
|
-
}, never], [{
|
|
15
|
+
}, any>, import("../../..").TTransportedValue<{
|
|
19
16
|
success: boolean;
|
|
20
|
-
}
|
|
21
|
-
success: boolean;
|
|
22
|
-
}, any], readonly []>;
|
|
17
|
+
}, any>, readonly []>;
|
|
23
18
|
};
|
|
24
19
|
}>>;
|
|
25
20
|
test_dom_edit_doc: import("../../..").ActionDomain<import("../../..").TActionDomainChildDef<import("../../..").IActionRootDomain<"test_root">, {
|
|
26
21
|
domain: string;
|
|
27
22
|
actions: {
|
|
28
|
-
edit_doc: import("../../..").ActionSchema<
|
|
23
|
+
edit_doc: import("../../..").ActionSchema<import("../../..").TTransportedValue<{
|
|
29
24
|
docId: string;
|
|
30
25
|
newContent: string;
|
|
31
|
-
}
|
|
32
|
-
docId: string;
|
|
33
|
-
newContent: string;
|
|
34
|
-
}, never], [{
|
|
35
|
-
success: boolean;
|
|
36
|
-
}] | [{
|
|
26
|
+
}, any>, import("../../..").TTransportedValue<{
|
|
37
27
|
success: boolean;
|
|
38
|
-
}, any
|
|
39
|
-
get_doc: import("../../..").ActionSchema<
|
|
40
|
-
docId: string;
|
|
41
|
-
}] | [{
|
|
28
|
+
}, any>, readonly []>;
|
|
29
|
+
get_doc: import("../../..").ActionSchema<import("../../..").TTransportedValue<{
|
|
42
30
|
docId: string;
|
|
43
|
-
},
|
|
31
|
+
}, any>, import("../../..").TTransportedValue<{
|
|
44
32
|
content: string;
|
|
45
|
-
}
|
|
46
|
-
content: string;
|
|
47
|
-
}, any], readonly []>;
|
|
33
|
+
}, any>, readonly []>;
|
|
48
34
|
};
|
|
49
35
|
}>>;
|
|
50
36
|
test_dom_push_doc: import("../../..").ActionDomain<import("../../..").TActionDomainChildDef<import("../../..").IActionRootDomain<"test_root">, {
|
|
51
37
|
domain: string;
|
|
52
38
|
actions: {
|
|
53
|
-
push_doc_update: import("../../..").ActionSchema<
|
|
54
|
-
docId: string;
|
|
55
|
-
updateContent: string;
|
|
56
|
-
}] | [{
|
|
39
|
+
push_doc_update: import("../../..").ActionSchema<import("../../..").TTransportedValue<{
|
|
57
40
|
docId: string;
|
|
58
41
|
updateContent: string;
|
|
59
|
-
},
|
|
60
|
-
updated: boolean;
|
|
61
|
-
}] | [{
|
|
42
|
+
}, any>, import("../../..").TTransportedValue<{
|
|
62
43
|
updated: boolean;
|
|
63
|
-
}, any
|
|
44
|
+
}, any>, readonly []>;
|
|
64
45
|
};
|
|
65
46
|
}>>;
|
|
66
47
|
};
|
|
@@ -68,83 +49,55 @@ export declare function _test_createActions(): {
|
|
|
68
49
|
action_user_sign_in: import("../../..").ActionCore<import("../../..").TActionDomainChildDef<import("../../..").IActionRootDomain<"test_root">, {
|
|
69
50
|
domain: string;
|
|
70
51
|
actions: {
|
|
71
|
-
sign_in: import("../../..").ActionSchema<
|
|
52
|
+
sign_in: import("../../..").ActionSchema<import("../../..").TTransportedValue<{
|
|
72
53
|
username: string;
|
|
73
54
|
password: string;
|
|
74
|
-
}
|
|
75
|
-
username: string;
|
|
76
|
-
password: string;
|
|
77
|
-
}, never], [{
|
|
78
|
-
success: boolean;
|
|
79
|
-
}] | [{
|
|
55
|
+
}, any>, import("../../..").TTransportedValue<{
|
|
80
56
|
success: boolean;
|
|
81
|
-
}, any
|
|
57
|
+
}, any>, readonly []>;
|
|
82
58
|
};
|
|
83
59
|
}>, "sign_in">;
|
|
84
60
|
action_edit_doc_edit: import("../../..").ActionCore<import("../../..").TActionDomainChildDef<import("../../..").IActionRootDomain<"test_root">, {
|
|
85
61
|
domain: string;
|
|
86
62
|
actions: {
|
|
87
|
-
edit_doc: import("../../..").ActionSchema<
|
|
63
|
+
edit_doc: import("../../..").ActionSchema<import("../../..").TTransportedValue<{
|
|
88
64
|
docId: string;
|
|
89
65
|
newContent: string;
|
|
90
|
-
}
|
|
91
|
-
docId: string;
|
|
92
|
-
newContent: string;
|
|
93
|
-
}, never], [{
|
|
66
|
+
}, any>, import("../../..").TTransportedValue<{
|
|
94
67
|
success: boolean;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
}, any], readonly []>;
|
|
98
|
-
get_doc: import("../../..").ActionSchema<[{
|
|
99
|
-
docId: string;
|
|
100
|
-
}] | [{
|
|
68
|
+
}, any>, readonly []>;
|
|
69
|
+
get_doc: import("../../..").ActionSchema<import("../../..").TTransportedValue<{
|
|
101
70
|
docId: string;
|
|
102
|
-
},
|
|
71
|
+
}, any>, import("../../..").TTransportedValue<{
|
|
103
72
|
content: string;
|
|
104
|
-
}
|
|
105
|
-
content: string;
|
|
106
|
-
}, any], readonly []>;
|
|
73
|
+
}, any>, readonly []>;
|
|
107
74
|
};
|
|
108
75
|
}>, "edit_doc">;
|
|
109
76
|
action_edit_doc_get: import("../../..").ActionCore<import("../../..").TActionDomainChildDef<import("../../..").IActionRootDomain<"test_root">, {
|
|
110
77
|
domain: string;
|
|
111
78
|
actions: {
|
|
112
|
-
edit_doc: import("../../..").ActionSchema<
|
|
113
|
-
docId: string;
|
|
114
|
-
newContent: string;
|
|
115
|
-
}] | [{
|
|
79
|
+
edit_doc: import("../../..").ActionSchema<import("../../..").TTransportedValue<{
|
|
116
80
|
docId: string;
|
|
117
81
|
newContent: string;
|
|
118
|
-
},
|
|
82
|
+
}, any>, import("../../..").TTransportedValue<{
|
|
119
83
|
success: boolean;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
}, any], readonly []>;
|
|
123
|
-
get_doc: import("../../..").ActionSchema<[{
|
|
124
|
-
docId: string;
|
|
125
|
-
}] | [{
|
|
84
|
+
}, any>, readonly []>;
|
|
85
|
+
get_doc: import("../../..").ActionSchema<import("../../..").TTransportedValue<{
|
|
126
86
|
docId: string;
|
|
127
|
-
},
|
|
128
|
-
content: string;
|
|
129
|
-
}] | [{
|
|
87
|
+
}, any>, import("../../..").TTransportedValue<{
|
|
130
88
|
content: string;
|
|
131
|
-
}, any
|
|
89
|
+
}, any>, readonly []>;
|
|
132
90
|
};
|
|
133
91
|
}>, "get_doc">;
|
|
134
92
|
action_push_doc_update: import("../../..").ActionCore<import("../../..").TActionDomainChildDef<import("../../..").IActionRootDomain<"test_root">, {
|
|
135
93
|
domain: string;
|
|
136
94
|
actions: {
|
|
137
|
-
push_doc_update: import("../../..").ActionSchema<
|
|
95
|
+
push_doc_update: import("../../..").ActionSchema<import("../../..").TTransportedValue<{
|
|
138
96
|
docId: string;
|
|
139
97
|
updateContent: string;
|
|
140
|
-
}
|
|
141
|
-
docId: string;
|
|
142
|
-
updateContent: string;
|
|
143
|
-
}, never], [{
|
|
144
|
-
updated: boolean;
|
|
145
|
-
}] | [{
|
|
98
|
+
}, any>, import("../../..").TTransportedValue<{
|
|
146
99
|
updated: boolean;
|
|
147
|
-
}, any
|
|
100
|
+
}, any>, readonly []>;
|
|
148
101
|
};
|
|
149
102
|
}>, "push_doc_update">;
|
|
150
103
|
};
|
|
@@ -155,58 +108,39 @@ export declare const _test_createTestActionRuntimeData: () => {
|
|
|
155
108
|
test_dom_user: import("../../..").ActionDomain<import("../../..").TActionDomainChildDef<import("../../..").IActionRootDomain<"test_root">, {
|
|
156
109
|
domain: string;
|
|
157
110
|
actions: {
|
|
158
|
-
sign_in: import("../../..").ActionSchema<
|
|
111
|
+
sign_in: import("../../..").ActionSchema<import("../../..").TTransportedValue<{
|
|
159
112
|
username: string;
|
|
160
113
|
password: string;
|
|
161
|
-
}
|
|
162
|
-
username: string;
|
|
163
|
-
password: string;
|
|
164
|
-
}, never], [{
|
|
114
|
+
}, any>, import("../../..").TTransportedValue<{
|
|
165
115
|
success: boolean;
|
|
166
|
-
}
|
|
167
|
-
success: boolean;
|
|
168
|
-
}, any], readonly []>;
|
|
116
|
+
}, any>, readonly []>;
|
|
169
117
|
};
|
|
170
118
|
}>>;
|
|
171
119
|
test_dom_edit_doc: import("../../..").ActionDomain<import("../../..").TActionDomainChildDef<import("../../..").IActionRootDomain<"test_root">, {
|
|
172
120
|
domain: string;
|
|
173
121
|
actions: {
|
|
174
|
-
edit_doc: import("../../..").ActionSchema<
|
|
122
|
+
edit_doc: import("../../..").ActionSchema<import("../../..").TTransportedValue<{
|
|
175
123
|
docId: string;
|
|
176
124
|
newContent: string;
|
|
177
|
-
}
|
|
178
|
-
docId: string;
|
|
179
|
-
newContent: string;
|
|
180
|
-
}, never], [{
|
|
181
|
-
success: boolean;
|
|
182
|
-
}] | [{
|
|
125
|
+
}, any>, import("../../..").TTransportedValue<{
|
|
183
126
|
success: boolean;
|
|
184
|
-
}, any
|
|
185
|
-
get_doc: import("../../..").ActionSchema<
|
|
186
|
-
docId: string;
|
|
187
|
-
}] | [{
|
|
127
|
+
}, any>, readonly []>;
|
|
128
|
+
get_doc: import("../../..").ActionSchema<import("../../..").TTransportedValue<{
|
|
188
129
|
docId: string;
|
|
189
|
-
},
|
|
130
|
+
}, any>, import("../../..").TTransportedValue<{
|
|
190
131
|
content: string;
|
|
191
|
-
}
|
|
192
|
-
content: string;
|
|
193
|
-
}, any], readonly []>;
|
|
132
|
+
}, any>, readonly []>;
|
|
194
133
|
};
|
|
195
134
|
}>>;
|
|
196
135
|
test_dom_push_doc: import("../../..").ActionDomain<import("../../..").TActionDomainChildDef<import("../../..").IActionRootDomain<"test_root">, {
|
|
197
136
|
domain: string;
|
|
198
137
|
actions: {
|
|
199
|
-
push_doc_update: import("../../..").ActionSchema<
|
|
200
|
-
docId: string;
|
|
201
|
-
updateContent: string;
|
|
202
|
-
}] | [{
|
|
138
|
+
push_doc_update: import("../../..").ActionSchema<import("../../..").TTransportedValue<{
|
|
203
139
|
docId: string;
|
|
204
140
|
updateContent: string;
|
|
205
|
-
},
|
|
206
|
-
updated: boolean;
|
|
207
|
-
}] | [{
|
|
141
|
+
}, any>, import("../../..").TTransportedValue<{
|
|
208
142
|
updated: boolean;
|
|
209
|
-
}, any
|
|
143
|
+
}, any>, readonly []>;
|
|
210
144
|
};
|
|
211
145
|
}>>;
|
|
212
146
|
};
|
|
@@ -214,83 +148,55 @@ export declare const _test_createTestActionRuntimeData: () => {
|
|
|
214
148
|
action_user_sign_in: import("../../..").ActionCore<import("../../..").TActionDomainChildDef<import("../../..").IActionRootDomain<"test_root">, {
|
|
215
149
|
domain: string;
|
|
216
150
|
actions: {
|
|
217
|
-
sign_in: import("../../..").ActionSchema<
|
|
151
|
+
sign_in: import("../../..").ActionSchema<import("../../..").TTransportedValue<{
|
|
218
152
|
username: string;
|
|
219
153
|
password: string;
|
|
220
|
-
}
|
|
221
|
-
username: string;
|
|
222
|
-
password: string;
|
|
223
|
-
}, never], [{
|
|
224
|
-
success: boolean;
|
|
225
|
-
}] | [{
|
|
154
|
+
}, any>, import("../../..").TTransportedValue<{
|
|
226
155
|
success: boolean;
|
|
227
|
-
}, any
|
|
156
|
+
}, any>, readonly []>;
|
|
228
157
|
};
|
|
229
158
|
}>, "sign_in">;
|
|
230
159
|
action_edit_doc_edit: import("../../..").ActionCore<import("../../..").TActionDomainChildDef<import("../../..").IActionRootDomain<"test_root">, {
|
|
231
160
|
domain: string;
|
|
232
161
|
actions: {
|
|
233
|
-
edit_doc: import("../../..").ActionSchema<
|
|
162
|
+
edit_doc: import("../../..").ActionSchema<import("../../..").TTransportedValue<{
|
|
234
163
|
docId: string;
|
|
235
164
|
newContent: string;
|
|
236
|
-
}
|
|
237
|
-
docId: string;
|
|
238
|
-
newContent: string;
|
|
239
|
-
}, never], [{
|
|
165
|
+
}, any>, import("../../..").TTransportedValue<{
|
|
240
166
|
success: boolean;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
}, any], readonly []>;
|
|
244
|
-
get_doc: import("../../..").ActionSchema<[{
|
|
245
|
-
docId: string;
|
|
246
|
-
}] | [{
|
|
167
|
+
}, any>, readonly []>;
|
|
168
|
+
get_doc: import("../../..").ActionSchema<import("../../..").TTransportedValue<{
|
|
247
169
|
docId: string;
|
|
248
|
-
},
|
|
170
|
+
}, any>, import("../../..").TTransportedValue<{
|
|
249
171
|
content: string;
|
|
250
|
-
}
|
|
251
|
-
content: string;
|
|
252
|
-
}, any], readonly []>;
|
|
172
|
+
}, any>, readonly []>;
|
|
253
173
|
};
|
|
254
174
|
}>, "edit_doc">;
|
|
255
175
|
action_edit_doc_get: import("../../..").ActionCore<import("../../..").TActionDomainChildDef<import("../../..").IActionRootDomain<"test_root">, {
|
|
256
176
|
domain: string;
|
|
257
177
|
actions: {
|
|
258
|
-
edit_doc: import("../../..").ActionSchema<
|
|
259
|
-
docId: string;
|
|
260
|
-
newContent: string;
|
|
261
|
-
}] | [{
|
|
178
|
+
edit_doc: import("../../..").ActionSchema<import("../../..").TTransportedValue<{
|
|
262
179
|
docId: string;
|
|
263
180
|
newContent: string;
|
|
264
|
-
},
|
|
181
|
+
}, any>, import("../../..").TTransportedValue<{
|
|
265
182
|
success: boolean;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
}, any], readonly []>;
|
|
269
|
-
get_doc: import("../../..").ActionSchema<[{
|
|
270
|
-
docId: string;
|
|
271
|
-
}] | [{
|
|
183
|
+
}, any>, readonly []>;
|
|
184
|
+
get_doc: import("../../..").ActionSchema<import("../../..").TTransportedValue<{
|
|
272
185
|
docId: string;
|
|
273
|
-
},
|
|
274
|
-
content: string;
|
|
275
|
-
}] | [{
|
|
186
|
+
}, any>, import("../../..").TTransportedValue<{
|
|
276
187
|
content: string;
|
|
277
|
-
}, any
|
|
188
|
+
}, any>, readonly []>;
|
|
278
189
|
};
|
|
279
190
|
}>, "get_doc">;
|
|
280
191
|
action_push_doc_update: import("../../..").ActionCore<import("../../..").TActionDomainChildDef<import("../../..").IActionRootDomain<"test_root">, {
|
|
281
192
|
domain: string;
|
|
282
193
|
actions: {
|
|
283
|
-
push_doc_update: import("../../..").ActionSchema<
|
|
194
|
+
push_doc_update: import("../../..").ActionSchema<import("../../..").TTransportedValue<{
|
|
284
195
|
docId: string;
|
|
285
196
|
updateContent: string;
|
|
286
|
-
}
|
|
287
|
-
docId: string;
|
|
288
|
-
updateContent: string;
|
|
289
|
-
}, never], [{
|
|
290
|
-
updated: boolean;
|
|
291
|
-
}] | [{
|
|
197
|
+
}, any>, import("../../..").TTransportedValue<{
|
|
292
198
|
updated: boolean;
|
|
293
|
-
}, any
|
|
199
|
+
}, any>, readonly []>;
|
|
294
200
|
};
|
|
295
201
|
}>, "push_doc_update">;
|
|
296
202
|
};
|