server-act 1.3.0 → 1.3.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/dist/index.d.mts CHANGED
@@ -27,7 +27,7 @@ interface ActionBuilder<TParams extends ActionParams> {
27
27
  */
28
28
  input: <TParser extends z.ZodType>(input: ((params: {
29
29
  ctx: InferContextType<TParams["_context"]>;
30
- }) => TParser) | TParser) => Omit<ActionBuilder<{
30
+ }) => Promise<TParser> | TParser) | TParser) => Omit<ActionBuilder<{
31
31
  _input: TParser;
32
32
  _context: TParams["_context"];
33
33
  }>, "input">;
package/dist/index.d.ts CHANGED
@@ -27,7 +27,7 @@ interface ActionBuilder<TParams extends ActionParams> {
27
27
  */
28
28
  input: <TParser extends z.ZodType>(input: ((params: {
29
29
  ctx: InferContextType<TParams["_context"]>;
30
- }) => TParser) | TParser) => Omit<ActionBuilder<{
30
+ }) => Promise<TParser> | TParser) | TParser) => Omit<ActionBuilder<{
31
31
  _input: TParser;
32
32
  _context: TParams["_context"];
33
33
  }>, "input">;
package/dist/index.js CHANGED
@@ -63,7 +63,7 @@ function createServerActionBuilder(initDef = {}) {
63
63
  return /*#__PURE__*/ _async_to_generator(function*(input) {
64
64
  const ctx = yield _def.middleware == null ? void 0 : _def.middleware.call(_def);
65
65
  if (_def.input) {
66
- const inputSchema = typeof _def.input === "function" ? _def.input({
66
+ const inputSchema = typeof _def.input === "function" ? yield _def.input({
67
67
  ctx
68
68
  }) : _def.input;
69
69
  const result = yield inputSchema.safeParseAsync(input);
@@ -86,7 +86,7 @@ function createServerActionBuilder(initDef = {}) {
86
86
  return /*#__PURE__*/ _async_to_generator(function*(prevState, formData) {
87
87
  const ctx = yield _def.middleware == null ? void 0 : _def.middleware.call(_def);
88
88
  if (_def.input) {
89
- const inputSchema = typeof _def.input === "function" ? _def.input({
89
+ const inputSchema = typeof _def.input === "function" ? yield _def.input({
90
90
  ctx
91
91
  }) : _def.input;
92
92
  const result = yield inputSchema.safeParseAsync(formData);
package/dist/index.mjs CHANGED
@@ -61,7 +61,7 @@ function createServerActionBuilder(initDef = {}) {
61
61
  return /*#__PURE__*/ _async_to_generator(function*(input) {
62
62
  const ctx = yield _def.middleware == null ? void 0 : _def.middleware.call(_def);
63
63
  if (_def.input) {
64
- const inputSchema = typeof _def.input === "function" ? _def.input({
64
+ const inputSchema = typeof _def.input === "function" ? yield _def.input({
65
65
  ctx
66
66
  }) : _def.input;
67
67
  const result = yield inputSchema.safeParseAsync(input);
@@ -84,7 +84,7 @@ function createServerActionBuilder(initDef = {}) {
84
84
  return /*#__PURE__*/ _async_to_generator(function*(prevState, formData) {
85
85
  const ctx = yield _def.middleware == null ? void 0 : _def.middleware.call(_def);
86
86
  if (_def.input) {
87
- const inputSchema = typeof _def.input === "function" ? _def.input({
87
+ const inputSchema = typeof _def.input === "function" ? yield _def.input({
88
88
  ctx
89
89
  }) : _def.input;
90
90
  const result = yield inputSchema.safeParseAsync(formData);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "server-act",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "homepage": "https://github.com/chungweileong94/server-act#readme",
5
5
  "author": "chungweileong94",
6
6
  "license": "MIT",