@elysiajs/eden 1.0.0-rc.4 → 1.0.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/dist/index.d.mts CHANGED
@@ -54,11 +54,12 @@ declare namespace Treaty {
54
54
  query?: Record<string, unknown>;
55
55
  } : {
56
56
  query: Query;
57
- }) extends infer Param ? {} extends Param ? undefined extends Body ? K extends 'get' | 'head' ? (options?: Prettify<Param & TreatyParam>) => Promise<TreatyResponse<Response>> : (body?: Body, options?: Prettify<Param & TreatyParam>) => Promise<TreatyResponse<Response>> : (body: Body extends Record<string, unknown> ? ReplaceBlobWithFiles<Body> : Body, options?: Prettify<Param & TreatyParam>) => Promise<TreatyResponse<Response>> : K extends 'get' | 'head' ? (options: Prettify<Param & TreatyParam>) => Promise<TreatyResponse<Response>> : (body: Body extends Record<string, unknown> ? ReplaceBlobWithFiles<Body> : Body, options: Prettify<Param & TreatyParam>) => Promise<TreatyResponse<Response>> : never : Extract<keyof Route[K], `:${string}`> extends infer Path extends string ? IsNever<Path> extends true ? Prettify<Sign<Route[K]>> : // ! DO NOT USE PRETTIFY ON THIS LINE, OTHERWISE FUNCTION CALLING WILL BE OMITTED
58
- ((params: {
59
- [param in Path extends `:${infer Param}` ? Param : never]: string | number;
60
- }) => Prettify<Sign<Route[K][Path]>>) & Prettify<Sign<Route[K]>> : never;
57
+ }) extends infer Param ? {} extends Param ? undefined extends Body ? K extends 'get' | 'head' ? (options?: Prettify<Param & TreatyParam>) => Promise<TreatyResponse<Response>> : (body?: Body, options?: Prettify<Param & TreatyParam>) => Promise<TreatyResponse<Response>> : (body: Body extends Record<string, unknown> ? ReplaceBlobWithFiles<Body> : Body, options?: Prettify<Param & TreatyParam>) => Promise<TreatyResponse<Response>> : K extends 'get' | 'head' ? (options: Prettify<Param & TreatyParam>) => Promise<TreatyResponse<Response>> : (body: Body extends Record<string, unknown> ? ReplaceBlobWithFiles<Body> : Body, options: Prettify<Param & TreatyParam>) => Promise<TreatyResponse<Response>> : never : CreateParams<Route[K]>;
61
58
  };
59
+ type CreateParams<Route extends Record<string, any>> = Extract<keyof Route, `:${string}`> extends infer Path extends string ? IsNever<Path> extends true ? Prettify<Sign<Route>> : // ! DO NOT USE PRETTIFY ON THIS LINE, OTHERWISE FUNCTION CALLING WILL BE OMITTED
60
+ ((params: {
61
+ [param in Path extends `:${infer Param}` ? Param : never]: string | number;
62
+ }) => Prettify<Sign<Route[Path]>> & CreateParams<Route[Path]>) & Prettify<Sign<Route>> : never;
62
63
  export interface Config {
63
64
  fetch?: Omit<RequestInit, 'headers' | 'method'>;
64
65
  fetcher?: typeof fetch;
package/dist/index.d.ts CHANGED
@@ -54,11 +54,12 @@ declare namespace Treaty {
54
54
  query?: Record<string, unknown>;
55
55
  } : {
56
56
  query: Query;
57
- }) extends infer Param ? {} extends Param ? undefined extends Body ? K extends 'get' | 'head' ? (options?: Prettify<Param & TreatyParam>) => Promise<TreatyResponse<Response>> : (body?: Body, options?: Prettify<Param & TreatyParam>) => Promise<TreatyResponse<Response>> : (body: Body extends Record<string, unknown> ? ReplaceBlobWithFiles<Body> : Body, options?: Prettify<Param & TreatyParam>) => Promise<TreatyResponse<Response>> : K extends 'get' | 'head' ? (options: Prettify<Param & TreatyParam>) => Promise<TreatyResponse<Response>> : (body: Body extends Record<string, unknown> ? ReplaceBlobWithFiles<Body> : Body, options: Prettify<Param & TreatyParam>) => Promise<TreatyResponse<Response>> : never : Extract<keyof Route[K], `:${string}`> extends infer Path extends string ? IsNever<Path> extends true ? Prettify<Sign<Route[K]>> : // ! DO NOT USE PRETTIFY ON THIS LINE, OTHERWISE FUNCTION CALLING WILL BE OMITTED
58
- ((params: {
59
- [param in Path extends `:${infer Param}` ? Param : never]: string | number;
60
- }) => Prettify<Sign<Route[K][Path]>>) & Prettify<Sign<Route[K]>> : never;
57
+ }) extends infer Param ? {} extends Param ? undefined extends Body ? K extends 'get' | 'head' ? (options?: Prettify<Param & TreatyParam>) => Promise<TreatyResponse<Response>> : (body?: Body, options?: Prettify<Param & TreatyParam>) => Promise<TreatyResponse<Response>> : (body: Body extends Record<string, unknown> ? ReplaceBlobWithFiles<Body> : Body, options?: Prettify<Param & TreatyParam>) => Promise<TreatyResponse<Response>> : K extends 'get' | 'head' ? (options: Prettify<Param & TreatyParam>) => Promise<TreatyResponse<Response>> : (body: Body extends Record<string, unknown> ? ReplaceBlobWithFiles<Body> : Body, options: Prettify<Param & TreatyParam>) => Promise<TreatyResponse<Response>> : never : CreateParams<Route[K]>;
61
58
  };
59
+ type CreateParams<Route extends Record<string, any>> = Extract<keyof Route, `:${string}`> extends infer Path extends string ? IsNever<Path> extends true ? Prettify<Sign<Route>> : // ! DO NOT USE PRETTIFY ON THIS LINE, OTHERWISE FUNCTION CALLING WILL BE OMITTED
60
+ ((params: {
61
+ [param in Path extends `:${infer Param}` ? Param : never]: string | number;
62
+ }) => Prettify<Sign<Route[Path]>> & CreateParams<Route[Path]>) & Prettify<Sign<Route>> : never;
62
63
  export interface Config {
63
64
  fetch?: Omit<RequestInit, 'headers' | 'method'>;
64
65
  fetcher?: typeof fetch;
@@ -39,11 +39,12 @@ export declare namespace Treaty {
39
39
  query?: Record<string, unknown>;
40
40
  } : {
41
41
  query: Query;
42
- }) extends infer Param ? {} extends Param ? undefined extends Body ? K extends 'get' | 'head' ? (options?: Prettify<Param & TreatyParam>) => Promise<TreatyResponse<Response>> : (body?: Body, options?: Prettify<Param & TreatyParam>) => Promise<TreatyResponse<Response>> : (body: Body extends Record<string, unknown> ? ReplaceBlobWithFiles<Body> : Body, options?: Prettify<Param & TreatyParam>) => Promise<TreatyResponse<Response>> : K extends 'get' | 'head' ? (options: Prettify<Param & TreatyParam>) => Promise<TreatyResponse<Response>> : (body: Body extends Record<string, unknown> ? ReplaceBlobWithFiles<Body> : Body, options: Prettify<Param & TreatyParam>) => Promise<TreatyResponse<Response>> : never : Extract<keyof Route[K], `:${string}`> extends infer Path extends string ? IsNever<Path> extends true ? Prettify<Sign<Route[K]>> : // ! DO NOT USE PRETTIFY ON THIS LINE, OTHERWISE FUNCTION CALLING WILL BE OMITTED
43
- ((params: {
44
- [param in Path extends `:${infer Param}` ? Param : never]: string | number;
45
- }) => Prettify<Sign<Route[K][Path]>>) & Prettify<Sign<Route[K]>> : never;
42
+ }) extends infer Param ? {} extends Param ? undefined extends Body ? K extends 'get' | 'head' ? (options?: Prettify<Param & TreatyParam>) => Promise<TreatyResponse<Response>> : (body?: Body, options?: Prettify<Param & TreatyParam>) => Promise<TreatyResponse<Response>> : (body: Body extends Record<string, unknown> ? ReplaceBlobWithFiles<Body> : Body, options?: Prettify<Param & TreatyParam>) => Promise<TreatyResponse<Response>> : K extends 'get' | 'head' ? (options: Prettify<Param & TreatyParam>) => Promise<TreatyResponse<Response>> : (body: Body extends Record<string, unknown> ? ReplaceBlobWithFiles<Body> : Body, options: Prettify<Param & TreatyParam>) => Promise<TreatyResponse<Response>> : never : CreateParams<Route[K]>;
46
43
  };
44
+ type CreateParams<Route extends Record<string, any>> = Extract<keyof Route, `:${string}`> extends infer Path extends string ? IsNever<Path> extends true ? Prettify<Sign<Route>> : // ! DO NOT USE PRETTIFY ON THIS LINE, OTHERWISE FUNCTION CALLING WILL BE OMITTED
45
+ ((params: {
46
+ [param in Path extends `:${infer Param}` ? Param : never]: string | number;
47
+ }) => Prettify<Sign<Route[Path]>> & CreateParams<Route[Path]>) & Prettify<Sign<Route>> : never;
47
48
  export interface Config {
48
49
  fetch?: Omit<RequestInit, 'headers' | 'method'>;
49
50
  fetcher?: typeof fetch;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elysiajs/eden",
3
- "version": "1.0.0-rc.4",
3
+ "version": "1.0.0",
4
4
  "description": "Fully type-safe Elysia client",
5
5
  "author": {
6
6
  "name": "saltyAom",
@@ -53,13 +53,13 @@
53
53
  "release": "npm run build && npm run test && npm publish --access public"
54
54
  },
55
55
  "peerDependencies": {
56
- "elysia": ">= 1.0.0-rc.0"
56
+ "elysia": ">= 1.0.0"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@elysiajs/cors": "0.7.0",
60
60
  "@types/bun": "^1.0.3",
61
61
  "@types/node": "^18.15.5",
62
- "elysia": "1.0.0-rc.11",
62
+ "elysia": "^1.0.0",
63
63
  "esbuild": "^0.19.3",
64
64
  "eslint": "^8.26.0",
65
65
  "expect-type": "^0.17.3",
@@ -72,5 +72,8 @@
72
72
  "tabWidth": 4,
73
73
  "singleQuote": true,
74
74
  "trailingComma": "none"
75
+ },
76
+ "dependencies": {
77
+ "@elysiajs/stream": "rc"
75
78
  }
76
79
  }