@kellanjs/actioncraft 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +411 -302
- package/dist/actioncraft-error.d.ts +23 -0
- package/dist/actioncraft-error.js +60 -0
- package/dist/actioncraft-error.js.map +1 -0
- package/dist/actioncraft-prev.d.ts +93 -0
- package/dist/actioncraft-prev.js +387 -0
- package/dist/actioncraft-prev.js.map +1 -0
- package/dist/actioncraft.d.ts +94 -44
- package/dist/actioncraft.js +281 -55
- package/dist/actioncraft.js.map +1 -1
- package/dist/api.d.ts +49 -0
- package/dist/api.js +84 -0
- package/dist/api.js.map +1 -0
- package/dist/classes/action-builder.d.ts +59 -0
- package/dist/classes/action-builder.js +95 -0
- package/dist/classes/action-builder.js.map +1 -0
- package/dist/classes/craft-builder.d.ts +66 -0
- package/dist/classes/craft-builder.js +129 -0
- package/dist/classes/craft-builder.js.map +1 -0
- package/dist/classes/crafter.d.ts +66 -0
- package/dist/classes/crafter.js +129 -0
- package/dist/classes/crafter.js.map +1 -0
- package/dist/classes/error.d.ts +23 -0
- package/dist/classes/error.js +60 -0
- package/dist/classes/error.js.map +1 -0
- package/dist/classes/executor/callbacks.d.ts +6 -0
- package/dist/classes/executor/callbacks.js +20 -0
- package/dist/classes/executor/callbacks.js.map +1 -0
- package/dist/classes/executor/errors.d.ts +29 -0
- package/dist/classes/executor/errors.js +114 -0
- package/dist/classes/executor/errors.js.map +1 -0
- package/dist/classes/executor/executor.d.ts +68 -0
- package/dist/classes/executor/executor.js +391 -0
- package/dist/classes/executor/executor.js.map +1 -0
- package/dist/classes/executor/logging.d.ts +2 -0
- package/dist/classes/executor/logging.js +8 -0
- package/dist/classes/executor/logging.js.map +1 -0
- package/dist/classes/executor/transformation.d.ts +17 -0
- package/dist/classes/executor/transformation.js +43 -0
- package/dist/classes/executor/transformation.js.map +1 -0
- package/dist/classes/executor/validation.d.ts +16 -0
- package/dist/classes/executor/validation.js +70 -0
- package/dist/classes/executor/validation.js.map +1 -0
- package/dist/classes/executor.d.ts +64 -0
- package/dist/classes/executor.js +354 -0
- package/dist/classes/executor.js.map +1 -0
- package/dist/classes/internal.d.ts +10 -0
- package/dist/classes/internal.js +5 -0
- package/dist/classes/internal.js.map +1 -0
- package/dist/core/errors.d.ts +2 -2
- package/dist/core/errors.js +5 -5
- package/dist/core/errors.js.map +1 -1
- package/dist/core/logging.d.ts +1 -1
- package/dist/core/transformation.d.ts +2 -2
- package/dist/core/validation.d.ts +4 -4
- package/dist/core/validation.js +14 -14
- package/dist/core/validation.js.map +1 -1
- package/dist/craft.d.ts +29 -0
- package/dist/craft.js +62 -0
- package/dist/craft.js.map +1 -0
- package/dist/error.d.ts +21 -6
- package/dist/error.js +59 -10
- package/dist/error.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/initial.d.ts +14 -0
- package/dist/initial.js +47 -0
- package/dist/initial.js.map +1 -0
- package/dist/types/actions.d.ts +67 -25
- package/dist/types/builder.d.ts +92 -0
- package/dist/types/builder.js +2 -0
- package/dist/types/builder.js.map +1 -0
- package/dist/types/crafter.d.ts +87 -0
- package/dist/types/crafter.js +2 -0
- package/dist/types/crafter.js.map +1 -0
- package/dist/types/errors.d.ts +25 -17
- package/dist/types/inference.d.ts +41 -8
- package/dist/types/result.d.ts +8 -14
- package/dist/types/result.js +36 -4
- package/dist/types/result.js.map +1 -1
- package/dist/types/schemas.d.ts +7 -7
- package/dist/types/shared.d.ts +14 -6
- package/dist/utils.d.ts +30 -6
- package/dist/utils.js +68 -8
- package/dist/utils.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crafter.js","sourceRoot":"","sources":["../../src/types/crafter.ts"],"names":[],"mappings":""}
|
package/dist/types/errors.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { StandardSchemaV1 } from "../standard-schema.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { Config, Schemas, Errors } from "./builder.js";
|
|
3
3
|
import type { Result } from "./result.js";
|
|
4
4
|
import type { Prettify } from "./shared.js";
|
|
5
5
|
/**
|
|
@@ -28,7 +28,7 @@ export declare const EXTERNAL_ERROR_TYPES: {
|
|
|
28
28
|
*/
|
|
29
29
|
export type ExternalErrorType = (typeof EXTERNAL_ERROR_TYPES)[keyof typeof EXTERNAL_ERROR_TYPES];
|
|
30
30
|
/**
|
|
31
|
-
* Base structure for all
|
|
31
|
+
* Base structure for all Actioncraft error objects.
|
|
32
32
|
*/
|
|
33
33
|
export type BaseError = {
|
|
34
34
|
type: string;
|
|
@@ -47,14 +47,14 @@ export type ErrorDefinition = (...args: any[]) => UserDefinedError;
|
|
|
47
47
|
*/
|
|
48
48
|
export type ErrorDefToResult<T> = T extends (...args: infer P) => any ? (...args: P) => Result<never, ReturnType<T>> : never;
|
|
49
49
|
/**
|
|
50
|
-
* Error when action
|
|
50
|
+
* Error when action handler returns undefined.
|
|
51
51
|
*/
|
|
52
52
|
export type ImplicitReturnError = BaseError & {
|
|
53
53
|
type: typeof INTERNAL_ERROR_TYPES.IMPLICIT_RETURN;
|
|
54
|
-
message: "Action
|
|
54
|
+
message: "Action handler must return a value";
|
|
55
55
|
};
|
|
56
56
|
/**
|
|
57
|
-
* Error indicating a bug in the
|
|
57
|
+
* Error indicating a bug in the Actioncraft library.
|
|
58
58
|
*/
|
|
59
59
|
export type InternalLogicError = BaseError & {
|
|
60
60
|
type: typeof INTERNAL_ERROR_TYPES.INTERNAL_LOGIC;
|
|
@@ -74,6 +74,14 @@ export type UnhandledError = BaseError & {
|
|
|
74
74
|
type: typeof EXTERNAL_ERROR_TYPES.UNHANDLED;
|
|
75
75
|
message: "An unhandled error occurred";
|
|
76
76
|
};
|
|
77
|
+
/**
|
|
78
|
+
* Error when no input schema is defined for an action.
|
|
79
|
+
* Used by `$validate` for client-side data validation.
|
|
80
|
+
*/
|
|
81
|
+
export type NoInputSchemaError = BaseError & {
|
|
82
|
+
type: "NO_INPUT_SCHEMA";
|
|
83
|
+
message: "Cannot validate input: no input schema defined for this action";
|
|
84
|
+
};
|
|
77
85
|
/**
|
|
78
86
|
* Base structure for validation errors with nested field organization.
|
|
79
87
|
*/
|
|
@@ -149,59 +157,59 @@ export type ValidationErrorFormat = {
|
|
|
149
157
|
}[];
|
|
150
158
|
};
|
|
151
159
|
/**
|
|
152
|
-
* Error functions object provided to action
|
|
160
|
+
* Error functions object provided to action handlers.
|
|
153
161
|
*/
|
|
154
|
-
export type ErrorFunctions<TErrors extends
|
|
162
|
+
export type ErrorFunctions<TErrors extends Errors> = Prettify<{
|
|
155
163
|
[K in keyof TErrors]: ErrorDefToResult<TErrors[K]>;
|
|
156
164
|
}>;
|
|
157
165
|
/**
|
|
158
166
|
* Input validation error format based on configuration.
|
|
159
167
|
*/
|
|
160
|
-
export type InferInputValidationErrorFormat<TConfig extends
|
|
168
|
+
export type InferInputValidationErrorFormat<TConfig extends Config> = TConfig["validationErrorFormat"] extends "nested" ? NestedInputValidationError : FlattenedInputValidationError;
|
|
161
169
|
/**
|
|
162
170
|
* Output validation error format based on configuration.
|
|
163
171
|
*/
|
|
164
|
-
export type InferOutputValidationErrorFormat<TConfig extends
|
|
172
|
+
export type InferOutputValidationErrorFormat<TConfig extends Config> = TConfig["validationErrorFormat"] extends "nested" ? NestedOutputValidationError : FlattenedOutputValidationError;
|
|
165
173
|
/**
|
|
166
174
|
* Bind arguments validation error format based on configuration.
|
|
167
175
|
*/
|
|
168
|
-
export type InferBindArgsValidationErrorFormat<TConfig extends
|
|
176
|
+
export type InferBindArgsValidationErrorFormat<TConfig extends Config> = TConfig["validationErrorFormat"] extends "nested" ? NestedBindArgsValidationError : FlattenedBindArgsValidationError;
|
|
169
177
|
/**
|
|
170
178
|
* All error types from user-defined error functions.
|
|
171
179
|
*/
|
|
172
|
-
export type InferUserDefinedErrorTypes<TErrors extends
|
|
180
|
+
export type InferUserDefinedErrorTypes<TErrors extends Errors> = {
|
|
173
181
|
[K in keyof TErrors]: ReturnType<TErrors[K]>;
|
|
174
182
|
}[keyof TErrors];
|
|
175
183
|
/**
|
|
176
184
|
* Error type for thrown exceptions based on custom handler configuration.
|
|
177
185
|
*/
|
|
178
|
-
export type InferThrownErrorType<TConfig extends
|
|
186
|
+
export type InferThrownErrorType<TConfig extends Config> = TConfig extends {
|
|
179
187
|
handleThrownError: (error: unknown) => infer R;
|
|
180
188
|
} ? R : UnhandledError;
|
|
181
189
|
/**
|
|
182
190
|
* Input validation error type when input schema is present.
|
|
183
191
|
*/
|
|
184
|
-
type InferInputValidationErrorType<TConfig extends
|
|
192
|
+
type InferInputValidationErrorType<TConfig extends Config, TSchemas extends Schemas> = TSchemas extends {
|
|
185
193
|
inputSchema: StandardSchemaV1;
|
|
186
194
|
} ? InferInputValidationErrorFormat<TConfig> : never;
|
|
187
195
|
/**
|
|
188
196
|
* Bind arguments validation error type when bind schemas are present.
|
|
189
197
|
*/
|
|
190
|
-
type InferBindArgsValidationErrorType<TConfig extends
|
|
198
|
+
type InferBindArgsValidationErrorType<TConfig extends Config, TSchemas extends Schemas> = TSchemas extends {
|
|
191
199
|
bindSchemas: readonly StandardSchemaV1[];
|
|
192
200
|
} ? InferBindArgsValidationErrorFormat<TConfig> : never;
|
|
193
201
|
/**
|
|
194
202
|
* Possible errors that clients should expect when calling an action.
|
|
195
203
|
*/
|
|
196
|
-
export type PossibleErrors<TErrors extends
|
|
204
|
+
export type PossibleErrors<TErrors extends Errors, TConfig extends Config, TSchemas extends Schemas> = InitialStateMarker | InferThrownErrorType<TConfig> | InferInputValidationErrorType<TConfig, TSchemas> | InferBindArgsValidationErrorType<TConfig, TSchemas> | InferUserDefinedErrorTypes<TErrors>;
|
|
197
205
|
/**
|
|
198
206
|
* Output validation error type when output schema is present.
|
|
199
207
|
*/
|
|
200
|
-
type InferOutputValidationErrorType<TConfig extends
|
|
208
|
+
type InferOutputValidationErrorType<TConfig extends Config, TSchemas extends Schemas> = TSchemas extends {
|
|
201
209
|
outputSchema: StandardSchemaV1;
|
|
202
210
|
} ? InferOutputValidationErrorFormat<TConfig> : never;
|
|
203
211
|
/**
|
|
204
212
|
* All possible errors, both internal and external.
|
|
205
213
|
*/
|
|
206
|
-
export type AllPossibleErrors<TErrors extends
|
|
214
|
+
export type AllPossibleErrors<TErrors extends Errors, TConfig extends Config, TSchemas extends Schemas> = PossibleErrors<TErrors, TConfig, TSchemas> | ImplicitReturnError | InternalLogicError | InferOutputValidationErrorType<TConfig, TSchemas>;
|
|
207
215
|
export {};
|
|
@@ -1,20 +1,53 @@
|
|
|
1
|
-
import type { CraftedAction,
|
|
2
|
-
import type { PossibleErrors } from "./errors.js";
|
|
3
|
-
import type { InferRawInput } from "./schemas.js";
|
|
1
|
+
import type { CraftedAction, CraftedActionInfer } from "./actions.js";
|
|
4
2
|
/**
|
|
5
3
|
* Extracts the raw input type from a crafted action.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```typescript
|
|
7
|
+
* // Traditional approach
|
|
8
|
+
* type MyInput = InferInput<typeof myAction>
|
|
9
|
+
*
|
|
10
|
+
* // Alternative using $Infer (recommended)
|
|
11
|
+
* type MyInput = typeof myAction.$Infer.Input
|
|
12
|
+
* ```
|
|
6
13
|
*/
|
|
7
|
-
export type InferInput<T> = T extends CraftedAction<infer
|
|
8
|
-
any> ? InferRawInput<TSchemas> : never;
|
|
14
|
+
export type InferInput<T> = T extends CraftedAction<infer TConfig, infer TSchemas, infer TErrors, infer TData> ? CraftedActionInfer<TConfig, TSchemas, TErrors, TData>["Input"] : never;
|
|
9
15
|
/**
|
|
10
16
|
* Extracts the complete result type from a crafted action.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* // Traditional approach
|
|
21
|
+
* type MyResult = InferResult<typeof myAction>
|
|
22
|
+
*
|
|
23
|
+
* // Alternative using $Infer (recommended)
|
|
24
|
+
* type MyResult = typeof myAction.$Infer.Result
|
|
25
|
+
* ```
|
|
11
26
|
*/
|
|
12
|
-
export type InferResult<T> = T extends CraftedAction<infer TConfig, infer TSchemas, infer TErrors, infer TData> ?
|
|
27
|
+
export type InferResult<T> = T extends CraftedAction<infer TConfig, infer TSchemas, infer TErrors, infer TData> ? CraftedActionInfer<TConfig, TSchemas, TErrors, TData>["Result"] : never;
|
|
13
28
|
/**
|
|
14
29
|
* Extracts the success data type from a crafted action.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```typescript
|
|
33
|
+
* // Traditional approach
|
|
34
|
+
* type MyData = InferData<typeof myAction>
|
|
35
|
+
*
|
|
36
|
+
* // Alternative using $Infer (recommended)
|
|
37
|
+
* type MyData = typeof myAction.$Infer.Data
|
|
38
|
+
* ```
|
|
15
39
|
*/
|
|
16
|
-
export type InferData<T> = T extends CraftedAction<
|
|
40
|
+
export type InferData<T> = T extends CraftedAction<infer TConfig, infer TSchemas, infer TErrors, infer TData> ? CraftedActionInfer<TConfig, TSchemas, TErrors, TData>["Data"] : never;
|
|
17
41
|
/**
|
|
18
42
|
* Extracts possible error types from a crafted action.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```typescript
|
|
46
|
+
* // Traditional approach
|
|
47
|
+
* type MyErrors = InferErrors<typeof myAction>
|
|
48
|
+
*
|
|
49
|
+
* // Alternative using $Infer (recommended)
|
|
50
|
+
* type MyErrors = typeof myAction.$Infer.Errors
|
|
51
|
+
* ```
|
|
19
52
|
*/
|
|
20
|
-
export type InferErrors<T> = T extends CraftedAction<infer TConfig, infer TSchemas, infer TErrors,
|
|
53
|
+
export type InferErrors<T> = T extends CraftedAction<infer TConfig, infer TSchemas, infer TErrors, infer TData> ? CraftedActionInfer<TConfig, TSchemas, TErrors, TData>["Errors"] : never;
|
package/dist/types/result.d.ts
CHANGED
|
@@ -7,11 +7,13 @@
|
|
|
7
7
|
export type Ok<T> = {
|
|
8
8
|
readonly type: "ok";
|
|
9
9
|
readonly value: T;
|
|
10
|
+
readonly __ac_id: string;
|
|
10
11
|
};
|
|
11
12
|
/** A failed result containing an error of type E */
|
|
12
13
|
export type Err<E> = {
|
|
13
14
|
readonly type: "err";
|
|
14
15
|
readonly error: E;
|
|
16
|
+
readonly __ac_id: string;
|
|
15
17
|
};
|
|
16
18
|
/**
|
|
17
19
|
* A Result represents an operation that can either succeed (Ok) or fail (Err).
|
|
@@ -20,26 +22,18 @@ export type Err<E> = {
|
|
|
20
22
|
export type Result<T, E> = Ok<T> | Err<E>;
|
|
21
23
|
/**
|
|
22
24
|
* Creates a successful result.
|
|
23
|
-
* @param value The success value
|
|
25
|
+
* @param value The success value (optional)
|
|
26
|
+
* @param actionId The action ID that created this result (optional, will be set to "unknown" if not provided)
|
|
24
27
|
* @returns Ok result containing the value
|
|
25
28
|
*/
|
|
26
|
-
export declare function ok<T>(value
|
|
27
|
-
/**
|
|
28
|
-
* Creates a successful result with no value.
|
|
29
|
-
* @returns Ok result with void
|
|
30
|
-
*/
|
|
31
|
-
export declare function ok(): Ok<void>;
|
|
29
|
+
export declare function ok<T>(value?: T, actionId?: string): Ok<T>;
|
|
32
30
|
/**
|
|
33
31
|
* Creates a failed result.
|
|
34
|
-
* @param error The error value
|
|
32
|
+
* @param error The error value (optional)
|
|
33
|
+
* @param actionId The action ID that created this result (optional, will be set to "unknown" if not provided)
|
|
35
34
|
* @returns Err result containing the error
|
|
36
35
|
*/
|
|
37
|
-
export declare function err<E>(error
|
|
38
|
-
/**
|
|
39
|
-
* Creates a failed result with no error value.
|
|
40
|
-
* @returns Err result with void
|
|
41
|
-
*/
|
|
42
|
-
export declare function err(): Err<void>;
|
|
36
|
+
export declare function err<E>(error?: E, actionId?: string): Err<E>;
|
|
43
37
|
/**
|
|
44
38
|
* Tests if a Result is successful.
|
|
45
39
|
* @param result The Result to check
|
package/dist/types/result.js
CHANGED
|
@@ -1,11 +1,43 @@
|
|
|
1
1
|
// ============================================================================
|
|
2
2
|
// Core Result Type
|
|
3
3
|
// ============================================================================
|
|
4
|
-
export function ok(
|
|
5
|
-
|
|
4
|
+
export function ok(valueOrActionId, actionId) {
|
|
5
|
+
// Handle overloads: ok() vs ok(value) vs ok(value, actionId)
|
|
6
|
+
if (arguments.length === 0) {
|
|
7
|
+
// ok() - no arguments
|
|
8
|
+
return { type: "ok", value: undefined, __ac_id: "unknown" };
|
|
9
|
+
}
|
|
10
|
+
else if (arguments.length === 1) {
|
|
11
|
+
// ok(value) - single argument treated as value (including strings)
|
|
12
|
+
return { type: "ok", value: valueOrActionId, __ac_id: "unknown" };
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
// ok(value, actionId) - two arguments
|
|
16
|
+
return {
|
|
17
|
+
type: "ok",
|
|
18
|
+
value: valueOrActionId,
|
|
19
|
+
__ac_id: actionId || "unknown",
|
|
20
|
+
};
|
|
21
|
+
}
|
|
6
22
|
}
|
|
7
|
-
export function err(
|
|
8
|
-
|
|
23
|
+
export function err(errorOrActionId, actionId) {
|
|
24
|
+
// Handle overloads: err() vs err(error) vs err(error, actionId)
|
|
25
|
+
if (arguments.length === 0) {
|
|
26
|
+
// err() - no arguments
|
|
27
|
+
return { type: "err", error: undefined, __ac_id: "unknown" };
|
|
28
|
+
}
|
|
29
|
+
else if (arguments.length === 1) {
|
|
30
|
+
// err(error) - single argument treated as error (including strings)
|
|
31
|
+
return { type: "err", error: errorOrActionId, __ac_id: "unknown" };
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
// err(error, actionId) - two arguments
|
|
35
|
+
return {
|
|
36
|
+
type: "err",
|
|
37
|
+
error: errorOrActionId,
|
|
38
|
+
__ac_id: actionId || "unknown",
|
|
39
|
+
};
|
|
40
|
+
}
|
|
9
41
|
}
|
|
10
42
|
/**
|
|
11
43
|
* Tests if a Result is successful.
|
package/dist/types/result.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result.js","sourceRoot":"","sources":["../../src/types/result.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,mBAAmB;AACnB,+EAA+E;
|
|
1
|
+
{"version":3,"file":"result.js","sourceRoot":"","sources":["../../src/types/result.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,mBAAmB;AACnB,+EAA+E;AAiC/E,MAAM,UAAU,EAAE,CAChB,eAA4B,EAC5B,QAAiB;IAEjB,6DAA6D;IAC7D,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3B,sBAAsB;QACtB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAExD,CAAC;IACJ,CAAC;SAAM,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAClC,mEAAmE;QACnE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,SAAS,EAE9D,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,sCAAsC;QACtC,OAAO;YACL,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,eAAe;YACtB,OAAO,EAAE,QAAQ,IAAI,SAAS;SACE,CAAC;IACrC,CAAC;AACH,CAAC;AASD,MAAM,UAAU,GAAG,CACjB,eAA4B,EAC5B,QAAiB;IAEjB,gEAAgE;IAChE,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3B,uBAAuB;QACvB,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAEzD,CAAC;IACJ,CAAC;SAAM,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAClC,oEAAoE;QACpE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,SAAS,EAE/D,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,uCAAuC;QACvC,OAAO;YACL,IAAI,EAAE,KAAK;YACX,KAAK,EAAE,eAAe;YACtB,OAAO,EAAE,QAAQ,IAAI,SAAS;SACG,CAAC;IACtC,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,IAAI,CAAO,MAAoB;IAC7C,OAAO,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC;AAC9B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,KAAK,CAAO,MAAoB;IAC9C,OAAO,MAAM,CAAC,IAAI,KAAK,KAAK,CAAC;AAC/B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CACtB,KAAc;IAEd,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,MAAM,IAAI,KAAK;QACf,CAAC,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK,CAAC;YACxC,CAAC,KAAK,CAAC,IAAI,KAAK,KAAK,IAAI,OAAO,IAAI,KAAK,CAAC,CAAC,CAC9C,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU,CACxB,KAAc;IAEd,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,MAAM,IAAI,KAAK;QACf,KAAK,CAAC,IAAI,KAAK,IAAI;QACnB,OAAO,IAAI,KAAK,CACjB,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,WAAW,CACzB,KAAc;IAEd,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,MAAM,IAAI,KAAK;QACf,KAAK,CAAC,IAAI,KAAK,KAAK;QACpB,OAAO,IAAI,KAAK,CACjB,CAAC;AACJ,CAAC"}
|
package/dist/types/schemas.d.ts
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import type { StandardSchemaV1 } from "../standard-schema.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { Schemas } from "./builder.js";
|
|
3
3
|
import type { MapSchemasToRawInput, MapSchemasToValidatedOutput } from "./shared.js";
|
|
4
4
|
/**
|
|
5
5
|
* Converts input schema to function parameter tuple for the crafted action.
|
|
6
6
|
*/
|
|
7
|
-
export type InferRawInputTuple<TSchemas extends
|
|
7
|
+
export type InferRawInputTuple<TSchemas extends Schemas> = TSchemas extends {
|
|
8
8
|
inputSchema: StandardSchemaV1;
|
|
9
9
|
} ? [InferRawInput<TSchemas>] : [InferRawInput<TSchemas>?];
|
|
10
10
|
/**
|
|
11
11
|
* Raw input type that users pass to the action before validation.
|
|
12
12
|
*/
|
|
13
|
-
export type InferRawInput<TSchemas extends
|
|
13
|
+
export type InferRawInput<TSchemas extends Schemas> = TSchemas extends {
|
|
14
14
|
inputSchema: StandardSchemaV1;
|
|
15
15
|
} ? StandardSchemaV1.InferInput<TSchemas["inputSchema"]> : unknown;
|
|
16
16
|
/**
|
|
17
|
-
* Validated input type that action
|
|
17
|
+
* Validated input type that action handlers receive.
|
|
18
18
|
*/
|
|
19
|
-
export type InferValidatedInput<TSchemas extends
|
|
19
|
+
export type InferValidatedInput<TSchemas extends Schemas> = TSchemas extends {
|
|
20
20
|
inputSchema: StandardSchemaV1;
|
|
21
21
|
} ? StandardSchemaV1.InferOutput<TSchemas["inputSchema"]> : undefined;
|
|
22
22
|
/**
|
|
23
23
|
* Raw input types for bound arguments before validation.
|
|
24
24
|
*/
|
|
25
|
-
export type InferRawBindArgs<TSchemas extends
|
|
25
|
+
export type InferRawBindArgs<TSchemas extends Schemas> = TSchemas extends {
|
|
26
26
|
bindSchemas: readonly StandardSchemaV1[];
|
|
27
27
|
} ? MapSchemasToRawInput<TSchemas["bindSchemas"]> : [];
|
|
28
28
|
/**
|
|
29
29
|
* Validated output types for bound arguments after validation.
|
|
30
30
|
*/
|
|
31
|
-
export type InferValidatedBindArgs<TSchemas extends
|
|
31
|
+
export type InferValidatedBindArgs<TSchemas extends Schemas> = TSchemas extends {
|
|
32
32
|
bindSchemas: readonly StandardSchemaV1[];
|
|
33
33
|
} ? MapSchemasToValidatedOutput<TSchemas["bindSchemas"]> : [];
|
package/dist/types/shared.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { StandardSchemaV1 } from "../standard-schema.js";
|
|
2
2
|
import type { InferPrevStateArg } from "./actions.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { Config, Errors, Schemas } from "./builder.js";
|
|
4
4
|
import type { InferData } from "./inference.js";
|
|
5
5
|
import type { InferValidatedInput, InferValidatedBindArgs, InferRawInput, InferRawBindArgs } from "./schemas.js";
|
|
6
6
|
/**
|
|
@@ -15,9 +15,11 @@ export type Prettify<T> = {
|
|
|
15
15
|
export type ApiResult<TData, TError> = {
|
|
16
16
|
success: true;
|
|
17
17
|
data: TData;
|
|
18
|
+
__ac_id: string;
|
|
18
19
|
} | {
|
|
19
20
|
success: false;
|
|
20
21
|
error: TError;
|
|
22
|
+
__ac_id: string;
|
|
21
23
|
};
|
|
22
24
|
/**
|
|
23
25
|
* Result format for actions using useActionState.
|
|
@@ -27,10 +29,12 @@ export type StatefulApiResult<TData, TError, TSuccessValues = unknown, TErrorVal
|
|
|
27
29
|
success: true;
|
|
28
30
|
data: TData;
|
|
29
31
|
values?: TSuccessValues;
|
|
32
|
+
__ac_id: string;
|
|
30
33
|
} | {
|
|
31
34
|
success: false;
|
|
32
35
|
error: TError;
|
|
33
36
|
values?: TErrorValues;
|
|
37
|
+
__ac_id: string;
|
|
34
38
|
};
|
|
35
39
|
/**
|
|
36
40
|
* Maps schema array to tuple of raw input types.
|
|
@@ -47,9 +51,13 @@ export type MapSchemasToValidatedOutput<T> = T extends readonly [
|
|
|
47
51
|
...infer Tail
|
|
48
52
|
] ? Head extends StandardSchemaV1 ? [StandardSchemaV1.InferOutput<Head>, ...MapSchemasToValidatedOutput<Tail>] : [] : [];
|
|
49
53
|
/**
|
|
50
|
-
* Base metadata available in action
|
|
54
|
+
* Base metadata available in action handlers and callbacks.
|
|
51
55
|
*/
|
|
52
|
-
export type BaseMetadata<TConfig extends
|
|
56
|
+
export type BaseMetadata<TConfig extends Config, TSchemas extends Schemas, TErrors extends Errors, TData> = {
|
|
57
|
+
/** Unique identifier for this action instance */
|
|
58
|
+
actionId: string;
|
|
59
|
+
/** Optional user-provided name for this action */
|
|
60
|
+
actionName?: string;
|
|
53
61
|
/** Original input before validation */
|
|
54
62
|
rawInput?: InferRawInput<TSchemas>;
|
|
55
63
|
/** Original bind arguments before validation */
|
|
@@ -58,13 +66,13 @@ export type BaseMetadata<TConfig extends CrafterConfig, TSchemas extends Crafter
|
|
|
58
66
|
prevState?: InferPrevStateArg<TConfig, TSchemas, TErrors, TData>;
|
|
59
67
|
};
|
|
60
68
|
/**
|
|
61
|
-
* Metadata passed to action
|
|
69
|
+
* Metadata passed to action handler functions.
|
|
62
70
|
*/
|
|
63
|
-
export type
|
|
71
|
+
export type HandlerMetadata<TConfig extends Config, TSchemas extends Schemas, TErrors extends Errors, TData> = BaseMetadata<TConfig, TSchemas, TErrors, TData>;
|
|
64
72
|
/**
|
|
65
73
|
* Enhanced metadata passed to lifecycle callbacks.
|
|
66
74
|
*/
|
|
67
|
-
export type CallbackMetadata<TConfig extends
|
|
75
|
+
export type CallbackMetadata<TConfig extends Config, TSchemas extends Schemas, TErrors extends Errors, TData> = BaseMetadata<TConfig, TSchemas, TErrors, TData> & {
|
|
68
76
|
/** Input data after validation */
|
|
69
77
|
validatedInput?: InferValidatedInput<TSchemas>;
|
|
70
78
|
/** Bind arguments after validation */
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,15 +1,39 @@
|
|
|
1
1
|
import type { CraftedAction } from "./types/actions.js";
|
|
2
2
|
import type { BaseError } from "./types/errors.js";
|
|
3
|
+
import type { InferResult } from "./types/inference.js";
|
|
3
4
|
import type { Result } from "./types/result.js";
|
|
4
|
-
import type { ApiResult, ThrowableAction } from "./types/shared.js";
|
|
5
|
+
import type { ApiResult, StatefulApiResult, ThrowableAction } from "./types/shared.js";
|
|
5
6
|
/**
|
|
6
|
-
* Unwraps an
|
|
7
|
+
* Unwraps an Actioncraft result, returning the data or throwing an error.
|
|
7
8
|
* Supports both async and sync usage patterns.
|
|
9
|
+
* Thrown errors automatically include action ID for verification when available.
|
|
8
10
|
*/
|
|
9
|
-
export declare function unwrap<TData, TError extends BaseError>(promiseResult: Promise<ApiResult<TData, TError> | Result<TData, TError>>): Promise<TData>;
|
|
10
|
-
export declare function unwrap<TData, TError extends BaseError>(result: ApiResult<TData, TError> | Result<TData, TError>): TData;
|
|
11
|
+
export declare function unwrap<TData, TError extends BaseError>(promiseResult: Promise<ApiResult<TData, TError> | StatefulApiResult<TData, TError> | Result<TData, TError>>): Promise<TData>;
|
|
12
|
+
export declare function unwrap<TData, TError extends BaseError>(result: ApiResult<TData, TError> | StatefulApiResult<TData, TError> | Result<TData, TError>): TData;
|
|
11
13
|
/**
|
|
12
|
-
* Creates a throwable version of an
|
|
13
|
-
* The returned function throws
|
|
14
|
+
* Creates a throwable version of an Actioncraft action.
|
|
15
|
+
* The returned function throws ActioncraftErrors with automatic action ID verification support.
|
|
16
|
+
* Errors thrown by this function can be verified with isActioncraftError(error, action).
|
|
14
17
|
*/
|
|
15
18
|
export declare function throwable<TAction extends CraftedAction<any, any, any, any>>(action: TAction): ThrowableAction<TAction>;
|
|
19
|
+
/**
|
|
20
|
+
* Creates an appropriate initial state for any action based on its configuration.
|
|
21
|
+
* The initial state uses the action's real ID for consistency with actual results.
|
|
22
|
+
*
|
|
23
|
+
* For useActionState actions: returns StatefulApiResult with error and values
|
|
24
|
+
* For functional format actions: returns Result.err() with error
|
|
25
|
+
* For regular actions: returns ApiResult with error
|
|
26
|
+
*
|
|
27
|
+
* Usage:
|
|
28
|
+
* - useActionState: const [state, action] = useActionState(myAction, initial(myAction))
|
|
29
|
+
* - useState: const [state, setState] = useState(initial(myAction))
|
|
30
|
+
*/
|
|
31
|
+
export declare function initial<TAction>(action: TAction): InferResult<TAction>;
|
|
32
|
+
/**
|
|
33
|
+
* Utility to extract the action ID from a crafted action.
|
|
34
|
+
* Useful for debugging and logging purposes.
|
|
35
|
+
*
|
|
36
|
+
* @param action - The crafted action
|
|
37
|
+
* @returns The action ID if available, undefined otherwise
|
|
38
|
+
*/
|
|
39
|
+
export declare function getActionId<TAction extends CraftedAction<any, any, any, any>>(action: TAction): string | undefined;
|
package/dist/utils.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ActioncraftError } from "./classes/error.js";
|
|
2
|
+
import { EXTERNAL_ERROR_TYPES } from "./types/errors.js";
|
|
3
|
+
import { err } from "./types/result.js";
|
|
2
4
|
export function unwrap(resultOrPromise) {
|
|
3
5
|
// Handle Promise case
|
|
4
6
|
if (resultOrPromise instanceof Promise) {
|
|
@@ -8,16 +10,18 @@ export function unwrap(resultOrPromise) {
|
|
|
8
10
|
return _unwrapSync(resultOrPromise);
|
|
9
11
|
}
|
|
10
12
|
/**
|
|
11
|
-
* Synchronously unwraps a result, throwing on error.
|
|
13
|
+
* Synchronously unwraps a result, throwing on error with embedded action ID.
|
|
12
14
|
*/
|
|
13
15
|
function _unwrapSync(result) {
|
|
14
|
-
//
|
|
16
|
+
// Extract action ID from result if present
|
|
17
|
+
const actionId = "__ac_id" in result ? result.__ac_id : undefined;
|
|
18
|
+
// Handle api-style results ({ success: true/false }) - includes both ApiResult and StatefulApiResult
|
|
15
19
|
if (typeof result === "object" && result !== null && "success" in result) {
|
|
16
20
|
const apiResult = result;
|
|
17
21
|
if (apiResult.success) {
|
|
18
22
|
return apiResult.data;
|
|
19
23
|
}
|
|
20
|
-
throw new
|
|
24
|
+
throw new ActioncraftError(apiResult.error, actionId);
|
|
21
25
|
}
|
|
22
26
|
// Handle functional-style results ({ type: "ok"/"err" })
|
|
23
27
|
if (typeof result === "object" && result !== null && "type" in result) {
|
|
@@ -25,13 +29,14 @@ function _unwrapSync(result) {
|
|
|
25
29
|
if (functionalResult.type === "ok") {
|
|
26
30
|
return functionalResult.value;
|
|
27
31
|
}
|
|
28
|
-
throw new
|
|
32
|
+
throw new ActioncraftError(functionalResult.error, actionId);
|
|
29
33
|
}
|
|
30
|
-
throw new Error("Invalid result format from
|
|
34
|
+
throw new Error("Invalid result format from Actioncraft action");
|
|
31
35
|
}
|
|
32
36
|
/**
|
|
33
|
-
* Creates a throwable version of an
|
|
34
|
-
* The returned function throws
|
|
37
|
+
* Creates a throwable version of an Actioncraft action.
|
|
38
|
+
* The returned function throws ActioncraftErrors with automatic action ID verification support.
|
|
39
|
+
* Errors thrown by this function can be verified with isActioncraftError(error, action).
|
|
35
40
|
*/
|
|
36
41
|
export function throwable(action) {
|
|
37
42
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -41,4 +46,59 @@ export function throwable(action) {
|
|
|
41
46
|
return unwrap(result);
|
|
42
47
|
});
|
|
43
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Creates an appropriate initial state for any action based on its configuration.
|
|
51
|
+
* The initial state uses the action's real ID for consistency with actual results.
|
|
52
|
+
*
|
|
53
|
+
* For useActionState actions: returns StatefulApiResult with error and values
|
|
54
|
+
* For functional format actions: returns Result.err() with error
|
|
55
|
+
* For regular actions: returns ApiResult with error
|
|
56
|
+
*
|
|
57
|
+
* Usage:
|
|
58
|
+
* - useActionState: const [state, action] = useActionState(myAction, initial(myAction))
|
|
59
|
+
* - useState: const [state, setState] = useState(initial(myAction))
|
|
60
|
+
*/
|
|
61
|
+
export function initial(action) {
|
|
62
|
+
const error = {
|
|
63
|
+
type: EXTERNAL_ERROR_TYPES.INITIAL_STATE,
|
|
64
|
+
message: "Action has not been executed yet",
|
|
65
|
+
};
|
|
66
|
+
// Attempt to read the action ID created during craft()
|
|
67
|
+
const actionId =
|
|
68
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
69
|
+
action?.__ac_id ?? "unknown";
|
|
70
|
+
// Attempt to read the Actioncraft config attached during craft()
|
|
71
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
72
|
+
const cfg = action?.__ac_config;
|
|
73
|
+
// Functional format -> Result<_, _>
|
|
74
|
+
if (cfg?.resultFormat === "functional") {
|
|
75
|
+
return err(error, actionId);
|
|
76
|
+
}
|
|
77
|
+
// useActionState enabled -> StatefulApiResult
|
|
78
|
+
if (cfg?.useActionState) {
|
|
79
|
+
return {
|
|
80
|
+
success: false,
|
|
81
|
+
error,
|
|
82
|
+
values: undefined,
|
|
83
|
+
__ac_id: actionId,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
// Default ApiResult shape
|
|
87
|
+
return {
|
|
88
|
+
success: false,
|
|
89
|
+
error,
|
|
90
|
+
__ac_id: actionId,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Utility to extract the action ID from a crafted action.
|
|
95
|
+
* Useful for debugging and logging purposes.
|
|
96
|
+
*
|
|
97
|
+
* @param action - The crafted action
|
|
98
|
+
* @returns The action ID if available, undefined otherwise
|
|
99
|
+
*/
|
|
100
|
+
export function getActionId(action) {
|
|
101
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
102
|
+
return action.__ac_id;
|
|
103
|
+
}
|
|
44
104
|
//# sourceMappingURL=utils.js.map
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kellanjs/actioncraft",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Fluent, type-safe builder for Next.js server actions.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"next.js",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"typescript": "^5.8.3",
|
|
69
69
|
"typescript-eslint": "^8.35.1",
|
|
70
70
|
"vitest": "^3.2.4",
|
|
71
|
-
"zod": "^
|
|
72
|
-
"zod-form-data": "^3.0.
|
|
71
|
+
"zod": "^4.1.5",
|
|
72
|
+
"zod-form-data": "^3.0.1"
|
|
73
73
|
}
|
|
74
74
|
}
|