@deessejs/functions 0.0.14 → 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.
@@ -9,12 +9,12 @@ export declare function defineContext<TContext extends Record<string, unknown>>(
9
9
  query: <TArgs extends ZodType<any, any, any>, TOutput, TError extends Exception = Exception>(options: {
10
10
  name: string;
11
11
  args: TArgs;
12
- handler: (args: z.infer<TArgs>, ctx: TContext) => AsyncResult<TOutput, TError>;
12
+ handler: (ctx: TContext, args: z.infer<TArgs>) => AsyncResult<TOutput, TError>;
13
13
  }) => QueryDefinition<TContext, TArgs, TOutput, TError>;
14
14
  mutation: <TArgs extends ZodType<any, any, any>, TOutput, TError extends Exception = Exception>(options: {
15
15
  name: string;
16
16
  args: TArgs;
17
- handler: (args: z.infer<TArgs>, ctx: TContext) => AsyncResult<TOutput, TError>;
17
+ handler: (ctx: TContext, args: z.infer<TArgs>) => AsyncResult<TOutput, TError>;
18
18
  }) => MutationDefinition<TContext, TArgs, TOutput, TError>;
19
19
  group: <T extends Record<string, APINode>>(definitions: T) => T;
20
20
  };
@@ -5,7 +5,7 @@ export type Context = Record<string, unknown>;
5
5
  export type CommandDefinition<TContext, TArgs extends ZodType, TOutput, TError extends Exception> = {
6
6
  name: string;
7
7
  args: TArgs;
8
- handler: (args: z.infer<TArgs>, ctx: TContext) => AsyncResult<TOutput, TError>;
8
+ handler: (ctx: TContext, args: z.infer<TArgs>) => AsyncResult<TOutput, TError>;
9
9
  };
10
10
  export type QueryDefinition<TContext, TArgs extends ZodType, TOutput, TError extends Exception> = CommandDefinition<TContext, TArgs, TOutput, TError> & {
11
11
  _type: "query";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deessejs/functions",
3
- "version": "0.0.14",
3
+ "version": "0.0.15",
4
4
  "description": "A powerful utility library for building type-safe APIs and functions with context management",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",