@deessejs/functions 0.0.8 → 0.0.11

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.
@@ -1,14 +1,8 @@
1
- import z, { ZodType } from "zod";
2
- import { Exception } from "../errors/types";
3
1
  import type { AsyncResult } from "../types";
4
2
  export type QueryFn<TArgs, TOutput, TError> = (input: TArgs) => AsyncResult<TOutput, TError>;
5
3
  export declare const createAPI: <TContext extends Record<string, unknown>>(config: {
6
4
  context: TContext;
7
5
  }) => {
8
- readonly query: <TArgs extends ZodType<any, any, any>, TOutput, TError extends Exception = Exception>(options: {
9
- name: string;
10
- args: TArgs;
11
- handler: (args: z.infer<TArgs>, ctx: TContext) => AsyncResult<TOutput, TError>;
12
- }) => (input: z.core.output<TArgs>, context?: TContext | undefined) => AsyncResult<TOutput, TError>;
13
- readonly context: TContext;
14
- };
6
+ [key: string]: TContext | QueryFn<any, any, any>;
7
+ context: TContext;
8
+ } & Record<string, QueryFn<any, any, any>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deessejs/functions",
3
- "version": "0.0.8",
3
+ "version": "0.0.11",
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",