@nice-code/action 0.0.15
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/index.js +3753 -0
- package/build/types/ActionDomain/NiceActionDomain.d.ts +67 -0
- package/build/types/ActionDomain/NiceActionDomain.types.d.ts +79 -0
- package/build/types/ActionDomain/createActionDomain.d.ts +5 -0
- package/build/types/ActionRequestResponse/ActionRequester/NiceActionRequester.d.ts +31 -0
- package/build/types/ActionRequestResponse/ActionResponder/NiceActionResponder.d.ts +49 -0
- package/build/types/ActionRequestResponse/ActionResponder/NiceActionResponder.types.d.ts +7 -0
- package/build/types/ActionRequestResponse/ActionResponder/NiceActionResponderEnvironment.d.ts +42 -0
- package/build/types/ActionSchema/NiceActionSchema.d.ts +101 -0
- package/build/types/ActionSchema/NiceActionSchema.types.d.ts +32 -0
- package/build/types/ActionSchema/action.d.ts +2 -0
- package/build/types/NiceAction/ActionSchema/NiceActionSchema.d.ts +99 -0
- package/build/types/NiceAction/ActionSchema/NiceActionSchema.types.d.ts +31 -0
- package/build/types/NiceAction/ActionSchema/NiceActionSchemaBuilder.d.ts +1 -0
- package/build/types/NiceAction/ActionSchema/action.d.ts +2 -0
- package/build/types/NiceAction/NiceAction.d.ts +64 -0
- package/build/types/NiceAction/NiceAction.types.d.ts +81 -0
- package/build/types/NiceAction/NiceActionPrimed.d.ts +59 -0
- package/build/types/NiceAction/NiceActionPrimed.schema.d.ts +8 -0
- package/build/types/NiceAction/NiceActionResponse.d.ts +32 -0
- package/build/types/errors/err_nice_action.d.ts +62 -0
- package/build/types/index.d.ts +18 -0
- package/build/types/test/nice_action_test_schema.d.ts +30 -0
- package/build/types/utils/isActionResponseJsonObject.d.ts +2 -0
- package/build/types/utils/isPrimedActionJsonObject.d.ts +2 -0
- package/package.json +41 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { INiceErrorJsonObject } from "@nice-code/error";
|
|
2
|
+
import type { INiceActionDomain, TInferInputFromSchema, TInferOutputFromSchema } from "../ActionDomain/NiceActionDomain.types";
|
|
3
|
+
export declare enum EActionState {
|
|
4
|
+
empty = "empty",
|
|
5
|
+
primed = "primed",
|
|
6
|
+
response = "response"
|
|
7
|
+
}
|
|
8
|
+
export interface INiceAction<DOM extends INiceActionDomain, ID extends keyof DOM["actions"] & string> {
|
|
9
|
+
id: ID;
|
|
10
|
+
domain: DOM["domain"];
|
|
11
|
+
allDomains: DOM["allDomains"];
|
|
12
|
+
schema: DOM["actions"][ID];
|
|
13
|
+
cuid: string;
|
|
14
|
+
timeCreated: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Wire format for a serialized NiceActionPrimed — safe to JSON.stringify / transmit.
|
|
18
|
+
*/
|
|
19
|
+
export type INiceAction_JsonObject<DOM extends INiceActionDomain = INiceActionDomain, ID extends keyof DOM["actions"] & string = keyof DOM["actions"] & string> = {
|
|
20
|
+
type: EActionState.empty;
|
|
21
|
+
domain: DOM["domain"];
|
|
22
|
+
allDomains: DOM["allDomains"];
|
|
23
|
+
id: ID;
|
|
24
|
+
cuid: string;
|
|
25
|
+
timeCreated: number;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Wire format for a serialized NiceActionPrimed — safe to JSON.stringify / transmit.
|
|
29
|
+
*/
|
|
30
|
+
export type INiceActionPrimed_JsonObject<DOM extends INiceActionDomain = INiceActionDomain, ID extends keyof DOM["actions"] & string = keyof DOM["actions"] & string> = Omit<INiceAction_JsonObject<DOM, ID>, "type"> & {
|
|
31
|
+
type: EActionState.primed;
|
|
32
|
+
input: TInferInputFromSchema<DOM["actions"][ID]>["SerdeInput"];
|
|
33
|
+
timePrimed: number;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Return type of `executeSafe` — a discriminated union of success and failure.
|
|
37
|
+
*
|
|
38
|
+
* - `{ ok: true; value: OUT }` — the action completed and returned `OUT`
|
|
39
|
+
* - `{ ok: false; error: ERR }` — the action threw; `ERR` is the declared error union
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* const result = await domain.action("getUser").executeSafe({ userId: "123" });
|
|
44
|
+
* if (!result.ok) {
|
|
45
|
+
* result.error.handleWith([
|
|
46
|
+
* forDomain(err_auth, (h) => res.status(401).end()),
|
|
47
|
+
* ]);
|
|
48
|
+
* return;
|
|
49
|
+
* }
|
|
50
|
+
* console.log(result.value); // typed as the action's OUTPUT
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
export type NiceActionResult<OUT, ERR> = {
|
|
54
|
+
ok: true;
|
|
55
|
+
output: OUT;
|
|
56
|
+
} | {
|
|
57
|
+
ok: false;
|
|
58
|
+
error: ERR;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Wire format for a serialized NiceActionResponse — safe to JSON.stringify / transmit.
|
|
62
|
+
*
|
|
63
|
+
* Carries the original action identity (domain + actionId + serialized input) alongside
|
|
64
|
+
* either the serialized output value or a serialized NiceError.
|
|
65
|
+
*
|
|
66
|
+
* Produced by `NiceActionResponse.toJsonObject()`.
|
|
67
|
+
* Reconstructed by `NiceActionDomain.hydrateResponse()`.
|
|
68
|
+
*/
|
|
69
|
+
export interface INiceActionResponse_JsonObject_Base<DOM extends INiceActionDomain, ID extends keyof DOM["actions"] & string> extends Omit<INiceActionPrimed_JsonObject<DOM, ID>, "type"> {
|
|
70
|
+
type: EActionState.response;
|
|
71
|
+
timeResponded: number;
|
|
72
|
+
}
|
|
73
|
+
export type INiceActionResponse_JsonObject_Success<DOM extends INiceActionDomain = INiceActionDomain, ID extends keyof DOM["actions"] & string = keyof DOM["actions"] & string> = INiceActionResponse_JsonObject_Base<DOM, ID> & {
|
|
74
|
+
ok: true;
|
|
75
|
+
output: TInferOutputFromSchema<DOM["actions"][ID]>["SerdeOutput"];
|
|
76
|
+
};
|
|
77
|
+
export type INiceActionResponse_JsonObject_Failure<DOM extends INiceActionDomain = INiceActionDomain, ID extends keyof DOM["actions"] & string = keyof DOM["actions"] & string> = INiceActionResponse_JsonObject_Base<DOM, ID> & {
|
|
78
|
+
ok: false;
|
|
79
|
+
error: INiceErrorJsonObject;
|
|
80
|
+
};
|
|
81
|
+
export type TNiceActionResponse_JsonObject<DOM extends INiceActionDomain = INiceActionDomain, ID extends keyof DOM["actions"] & string = keyof DOM["actions"] & string> = INiceActionResponse_JsonObject_Success<DOM, ID> | INiceActionResponse_JsonObject_Failure<DOM, ID>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { INiceActionDomain, TInferInputFromSchema, TInferOutputFromSchema } from "../ActionDomain/NiceActionDomain.types";
|
|
2
|
+
import type { TInferActionError } from "../ActionSchema/NiceActionSchema";
|
|
3
|
+
import type { NiceAction } from "./NiceAction";
|
|
4
|
+
import { EActionState, type INiceAction, type INiceActionPrimed_JsonObject, type NiceActionResult, type TNiceActionResponse_JsonObject } from "./NiceAction.types";
|
|
5
|
+
import { NiceActionResponse } from "./NiceActionResponse";
|
|
6
|
+
export declare class NiceActionPrimed<DOM extends INiceActionDomain, ID extends keyof DOM["actions"] & string, SCH extends DOM["actions"][ID]> implements Omit<INiceAction<DOM, ID>, "schema" | "cuid" | "timeCreated"> {
|
|
7
|
+
readonly coreAction: NiceAction<DOM, ID, SCH>;
|
|
8
|
+
readonly input: TInferInputFromSchema<SCH>["Input"];
|
|
9
|
+
readonly type = EActionState.primed;
|
|
10
|
+
readonly domain: DOM["domain"];
|
|
11
|
+
readonly allDomains: DOM["allDomains"];
|
|
12
|
+
readonly id: ID;
|
|
13
|
+
readonly timePrimed: number;
|
|
14
|
+
constructor(coreAction: NiceAction<DOM, ID, SCH>, input: TInferInputFromSchema<SCH>["Input"], hydrationData?: Pick<INiceActionPrimed_JsonObject<DOM, ID>, "timePrimed">);
|
|
15
|
+
/**
|
|
16
|
+
* Serialize this primed action to a JSON-safe wire format.
|
|
17
|
+
* The input is passed through the schema's serialize function if one is defined,
|
|
18
|
+
* otherwise the (already JSON-native) input is used as-is.
|
|
19
|
+
*/
|
|
20
|
+
toJsonObject(): INiceActionPrimed_JsonObject<DOM, ID>;
|
|
21
|
+
toJsonString(): string;
|
|
22
|
+
setOutput(output: TInferOutputFromSchema<SCH>["Output"]): NiceActionResponse<DOM, ID, SCH>;
|
|
23
|
+
/**
|
|
24
|
+
* Process a wire response returned by a remote `NiceActionResponderEnvironment`.
|
|
25
|
+
*
|
|
26
|
+
* Deserializes the output using the schema's deserialization if defined, and throws
|
|
27
|
+
* the error (via `castNiceError`) if the response indicates failure.
|
|
28
|
+
*
|
|
29
|
+
* Intended for use inside `NiceActionRequester` handlers that receive a
|
|
30
|
+
* `TNiceActionResponse_JsonObject` from a network call, so the caller of `execute()`
|
|
31
|
+
* always gets the raw output type without manually deserializing.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* dom.setActionRequester().forDomain(dom, async (act) => {
|
|
36
|
+
* const wire = await fetch("/api/actions", {
|
|
37
|
+
* method: "POST",
|
|
38
|
+
* body: JSON.stringify(act.toJsonObject()),
|
|
39
|
+
* }).then((r) => r.json());
|
|
40
|
+
* return act.processResponse(wire);
|
|
41
|
+
* });
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
processResponse(wire: TNiceActionResponse_JsonObject): TInferOutputFromSchema<SCH>["Output"];
|
|
45
|
+
/**
|
|
46
|
+
* Re-execute this primed action through the domain handler or resolver.
|
|
47
|
+
* Useful for deferred or cross-environment execution of a hydrated action.
|
|
48
|
+
*
|
|
49
|
+
* Pass `envId` to target a specific named handler/resolver on the domain.
|
|
50
|
+
*/
|
|
51
|
+
execute(envId?: string): Promise<TInferOutputFromSchema<SCH>["Output"]>;
|
|
52
|
+
/**
|
|
53
|
+
* Like `execute`, but catches thrown errors and returns a `NiceActionResult` discriminated union
|
|
54
|
+
* instead of propagating. On success: `{ ok: true, value }`. On failure: `{ ok: false, error }`.
|
|
55
|
+
*
|
|
56
|
+
* Mirrors `NiceAction.executeSafe` — useful when re-executing a hydrated primed action.
|
|
57
|
+
*/
|
|
58
|
+
executeSafe(envId?: string): Promise<NiceActionResult<TInferOutputFromSchema<SCH>["Output"], TInferActionError<SCH>>>;
|
|
59
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { JSONSerializableValue } from "@nice-code/error";
|
|
2
|
+
import * as v from "valibot";
|
|
3
|
+
export declare const vNiceActionPrimedJsonObject: v.ObjectSchema<{
|
|
4
|
+
readonly id: v.StringSchema<undefined>;
|
|
5
|
+
readonly domain: v.StringSchema<undefined>;
|
|
6
|
+
readonly allDomains: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
7
|
+
readonly input: v.CustomSchema<JSONSerializableValue, undefined>;
|
|
8
|
+
}, undefined>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { INiceActionDomain, TInferOutputFromSchema } from "../ActionDomain/NiceActionDomain.types";
|
|
2
|
+
import type { TInferActionError } from "../ActionSchema/NiceActionSchema";
|
|
3
|
+
import type { NiceAction } from "./NiceAction";
|
|
4
|
+
import { EActionState, type INiceAction, type NiceActionResult, type TNiceActionResponse_JsonObject } from "./NiceAction.types";
|
|
5
|
+
import { NiceActionPrimed } from "./NiceActionPrimed";
|
|
6
|
+
export declare class NiceActionResponse<DOM extends INiceActionDomain, ID extends keyof DOM["actions"] & string, SCH extends DOM["actions"][ID]> implements Omit<INiceAction<DOM, ID>, "schema" | "cuid" | "timeCreated"> {
|
|
7
|
+
readonly type = EActionState.response;
|
|
8
|
+
readonly domain: DOM["domain"];
|
|
9
|
+
readonly allDomains: DOM["allDomains"];
|
|
10
|
+
readonly id: ID;
|
|
11
|
+
readonly primed: NiceActionPrimed<DOM, ID, SCH>;
|
|
12
|
+
readonly result: NiceActionResult<TInferOutputFromSchema<SCH>["Output"], TInferActionError<SCH>>;
|
|
13
|
+
readonly timeResponded: number;
|
|
14
|
+
constructor(primed: NiceActionPrimed<DOM, ID, SCH>, result: NiceActionResult<TInferOutputFromSchema<SCH>["Output"], TInferActionError<SCH>>, hydrationData?: Pick<TNiceActionResponse_JsonObject<DOM, ID>, "timeResponded">);
|
|
15
|
+
/**
|
|
16
|
+
* Serialize this response to a JSON-safe wire format.
|
|
17
|
+
*
|
|
18
|
+
* On success, the output is passed through the schema's serialize function
|
|
19
|
+
* if one is defined, otherwise used as-is.
|
|
20
|
+
* On failure, the error is serialized via `NiceError.toJsonObject()`.
|
|
21
|
+
*/
|
|
22
|
+
toJsonObject(): TNiceActionResponse_JsonObject;
|
|
23
|
+
toJsonString(): string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Reconstruct a loosely-typed NiceActionResponse from its wire format.
|
|
27
|
+
* Called by `NiceActionDomain.hydrateResponse` — not part of the public API.
|
|
28
|
+
*
|
|
29
|
+
* The result's error type is `NiceError<TUnknownNiceErrorDef>` (from `castNiceError`).
|
|
30
|
+
* Use `handleWith` / `forDomain` / `isExact` to narrow on the receiving end.
|
|
31
|
+
*/
|
|
32
|
+
export declare function hydrateNiceActionResponse<DOM extends INiceActionDomain>(wire: TNiceActionResponse_JsonObject, coreAction: NiceAction<DOM, keyof DOM["actions"] & string, DOM["actions"][keyof DOM["actions"] & string]>): NiceActionResponse<DOM, keyof DOM["actions"] & string, DOM["actions"][keyof DOM["actions"] & string]>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { EActionState } from "../NiceAction/NiceAction.types";
|
|
2
|
+
export declare enum EErrId_NiceAction {
|
|
3
|
+
action_id_not_in_domain = "action_id_not_in_domain",
|
|
4
|
+
domain_action_requester_conflict = "domain_action_handler_conflict",
|
|
5
|
+
domain_no_handler = "domain_no_handler",
|
|
6
|
+
hydration_domain_mismatch = "hydration_domain_mismatch",
|
|
7
|
+
hydration_action_state_mismatch = "hydration_action_state_mismatch",
|
|
8
|
+
hydration_action_id_not_found = "hydration_action_id_not_found",
|
|
9
|
+
resolver_domain_not_registered = "resolver_domain_not_registered",
|
|
10
|
+
resolver_action_not_registered = "resolver_action_not_registered",
|
|
11
|
+
action_environment_not_found = "action_environment_not_found",
|
|
12
|
+
environment_already_registered = "environment_already_registered",
|
|
13
|
+
action_input_validation_failed = "action_input_validation_failed"
|
|
14
|
+
}
|
|
15
|
+
export declare const err_nice_action: import("@nice-code/error").NiceErrorDefined<{
|
|
16
|
+
domain: string;
|
|
17
|
+
allDomains: [string, "err_nice"];
|
|
18
|
+
schema: {
|
|
19
|
+
action_id_not_in_domain: import("@nice-code/error").INiceErrorIdMetadata<{
|
|
20
|
+
domain: string;
|
|
21
|
+
actionId: string;
|
|
22
|
+
}, import("@nice-code/error").JSONSerializableValue>;
|
|
23
|
+
domain_action_handler_conflict: import("@nice-code/error").INiceErrorIdMetadata<{
|
|
24
|
+
domain: string;
|
|
25
|
+
}, import("@nice-code/error").JSONSerializableValue>;
|
|
26
|
+
domain_no_handler: import("@nice-code/error").INiceErrorIdMetadata<{
|
|
27
|
+
domain: string;
|
|
28
|
+
}, import("@nice-code/error").JSONSerializableValue>;
|
|
29
|
+
hydration_domain_mismatch: import("@nice-code/error").INiceErrorIdMetadata<{
|
|
30
|
+
expected: string;
|
|
31
|
+
received: string;
|
|
32
|
+
}, import("@nice-code/error").JSONSerializableValue>;
|
|
33
|
+
hydration_action_state_mismatch: import("@nice-code/error").INiceErrorIdMetadata<{
|
|
34
|
+
expected: EActionState;
|
|
35
|
+
received: EActionState;
|
|
36
|
+
}, import("@nice-code/error").JSONSerializableValue>;
|
|
37
|
+
hydration_action_id_not_found: import("@nice-code/error").INiceErrorIdMetadata<{
|
|
38
|
+
domain: string;
|
|
39
|
+
actionId: string;
|
|
40
|
+
}, import("@nice-code/error").JSONSerializableValue>;
|
|
41
|
+
resolver_domain_not_registered: import("@nice-code/error").INiceErrorIdMetadata<{
|
|
42
|
+
domain: string;
|
|
43
|
+
}, import("@nice-code/error").JSONSerializableValue>;
|
|
44
|
+
resolver_action_not_registered: import("@nice-code/error").INiceErrorIdMetadata<{
|
|
45
|
+
domain: string;
|
|
46
|
+
actionId: string;
|
|
47
|
+
}, import("@nice-code/error").JSONSerializableValue>;
|
|
48
|
+
action_environment_not_found: import("@nice-code/error").INiceErrorIdMetadata<{
|
|
49
|
+
domain: string;
|
|
50
|
+
envId: string;
|
|
51
|
+
}, import("@nice-code/error").JSONSerializableValue>;
|
|
52
|
+
environment_already_registered: import("@nice-code/error").INiceErrorIdMetadata<{
|
|
53
|
+
domain: string;
|
|
54
|
+
envId: string;
|
|
55
|
+
}, import("@nice-code/error").JSONSerializableValue>;
|
|
56
|
+
action_input_validation_failed: import("@nice-code/error").INiceErrorIdMetadata<{
|
|
57
|
+
domain: string;
|
|
58
|
+
actionId: string;
|
|
59
|
+
validationMessage: string;
|
|
60
|
+
}, import("@nice-code/error").JSONSerializableValue>;
|
|
61
|
+
};
|
|
62
|
+
}>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export { createActionDomain } from "./ActionDomain/createActionDomain";
|
|
2
|
+
export { NiceActionDomain } from "./ActionDomain/NiceActionDomain";
|
|
3
|
+
export type { INiceActionDomain, INiceActionDomainChildOptions, MaybePromise, TActionHandlerForDomain, TActionIdHandlerForDomain, TActionListener, TDomainActionId, TInferInputFromSchema, TInferOutputFromSchema, TNiceActionDomainChildDef, TNiceActionDomainSchema, TPossibleDomainId, TPossibleDomainIdList, } from "./ActionDomain/NiceActionDomain.types";
|
|
4
|
+
export { NiceActionRequester } from "./ActionRequestResponse/ActionRequester/NiceActionRequester";
|
|
5
|
+
export { createDomainResolver, NiceActionDomainResponder, } from "./ActionRequestResponse/ActionResponder/NiceActionResponder";
|
|
6
|
+
export type { TActionResponderFn } from "./ActionRequestResponse/ActionResponder/NiceActionResponder.types";
|
|
7
|
+
export { createResponderEnvironment, NiceActionResponderEnvironment, } from "./ActionRequestResponse/ActionResponder/NiceActionResponderEnvironment";
|
|
8
|
+
export { action } from "./ActionSchema/action";
|
|
9
|
+
export type { TInferActionError } from "./ActionSchema/NiceActionSchema";
|
|
10
|
+
export { NiceActionSchema } from "./ActionSchema/NiceActionSchema";
|
|
11
|
+
export type { TNiceActionSerializationDefinition, TNiceActonSchemaInputOptions, TTransportedValue, } from "./ActionSchema/NiceActionSchema.types";
|
|
12
|
+
export { EErrId_NiceAction, err_nice_action } from "./errors/err_nice_action";
|
|
13
|
+
export { NiceAction } from "./NiceAction/NiceAction";
|
|
14
|
+
export type { INiceAction, INiceAction_JsonObject, INiceActionPrimed_JsonObject, NiceActionResult, TNiceActionResponse_JsonObject, } from "./NiceAction/NiceAction.types";
|
|
15
|
+
export { NiceActionPrimed } from "./NiceAction/NiceActionPrimed";
|
|
16
|
+
export { NiceActionResponse } from "./NiceAction/NiceActionResponse";
|
|
17
|
+
export * from "./utils/isActionResponseJsonObject";
|
|
18
|
+
export * from "./utils/isPrimedActionJsonObject";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { JSONSerializableValue } from "@nice-code/error";
|
|
2
|
+
export declare const demo_domain: import("..").NiceActionDomain<{
|
|
3
|
+
domain: string;
|
|
4
|
+
actions: {
|
|
5
|
+
action1: import("..").NiceActionSchema<[{
|
|
6
|
+
a: string;
|
|
7
|
+
cust: JSONSerializableValue;
|
|
8
|
+
}] | [{
|
|
9
|
+
a: string;
|
|
10
|
+
cust: JSONSerializableValue;
|
|
11
|
+
}, any], [any] | [any, never], readonly []>;
|
|
12
|
+
action2: import("..").NiceActionSchema<[{
|
|
13
|
+
b: string;
|
|
14
|
+
custBad: Omit<import("..").INiceAction_JsonObject<import("..").INiceActionDomain<import("..").TPossibleDomainIdList, import("..").TNiceActionDomainSchema>, string>, "type"> & {
|
|
15
|
+
type: import("../NiceAction/NiceAction.types").EActionState.primed;
|
|
16
|
+
input: any;
|
|
17
|
+
timePrimed: number;
|
|
18
|
+
};
|
|
19
|
+
}] | [{
|
|
20
|
+
b: string;
|
|
21
|
+
custBad: Omit<import("..").INiceAction_JsonObject<import("..").INiceActionDomain<import("..").TPossibleDomainIdList, import("..").TNiceActionDomainSchema>, string>, "type"> & {
|
|
22
|
+
type: import("../NiceAction/NiceAction.types").EActionState.primed;
|
|
23
|
+
input: any;
|
|
24
|
+
timePrimed: number;
|
|
25
|
+
};
|
|
26
|
+
}, any], [any] | [any, never], readonly []>;
|
|
27
|
+
};
|
|
28
|
+
} & {
|
|
29
|
+
allDomains: [string];
|
|
30
|
+
}>;
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nice-code/action",
|
|
3
|
+
"version": "0.0.15",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"types": "./build/types/index.d.ts",
|
|
9
|
+
"import": "./build/index.js"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"build",
|
|
14
|
+
"package.json",
|
|
15
|
+
"README.md"
|
|
16
|
+
],
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"access": "public"
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"type-check": "bunx tsc --noEmit",
|
|
22
|
+
"type-check-watch": "bunx tsc --noEmit --watch",
|
|
23
|
+
"clean-build": "bunx rimraf build",
|
|
24
|
+
"vitest": "vitest --typecheck",
|
|
25
|
+
"vitest-agent": "vitest --typecheck --reporter=agent",
|
|
26
|
+
"build": "bun run clean-build && bun run build.ts && bun run build-types",
|
|
27
|
+
"build-watch": "bun run clean-build && bun run build.ts --watch && bun run build-types --watch",
|
|
28
|
+
"build-types": "tsc --project tsconfig.build.json"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@nice-code/error": "0.0.14",
|
|
32
|
+
"@nice-code/common-errors": "0.0.14",
|
|
33
|
+
"@standard-schema/spec": "^1.1.0",
|
|
34
|
+
"http-status-codes": "^2.3.0",
|
|
35
|
+
"nanoid": "^5.1.9"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"valibot": "^1.3.1"
|
|
40
|
+
}
|
|
41
|
+
}
|