@teardown/ingest-api 0.0.21-alpha.5 → 0.0.21-alpha.7

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.
@@ -24,7 +24,7 @@ export declare const client: (server: string, config?: import("@elysiajs/eden/fe
24
24
  };
25
25
  };
26
26
  };
27
- } & { "": {
27
+ } & {
28
28
  "/v1/identify": {
29
29
  post: {
30
30
  body: {
@@ -156,3 +156,4 @@ export type RequestOptions = Omit<NonNullable<Parameters<Client>[1]>, "headers">
156
156
  headers?: Record<string, string>;
157
157
  };
158
158
  export type Endpoints = Parameters<Client>[0];
159
+ export type App = IngestApp;
@@ -17,7 +17,23 @@ export type UnionToIntersect<U> = (U extends any ? (arg: U) => any : never) exte
17
17
  export type IsAny<T> = 0 extends 1 & T ? true : false;
18
18
  export type IsNever<T> = [T] extends [never] ? true : false;
19
19
  export type IsUnknown<T> = IsAny<T> extends true ? false : unknown extends T ? true : false;
20
- export type AnyTypedRoute = {
20
+ export type IsExactlyUnknown<T> = [T] extends [unknown] ? ([unknown] extends [T] ? true : false) : false;
21
+ export type IsUndefined<T> = [T] extends [undefined] ? true : false;
22
+ export type IsMatchingEmptyObject<T> = [T] extends [{}] ? ([{}] extends [T] ? true : false) : false;
23
+ export type MaybeEmptyObject<TObj, TKey extends PropertyKey, TFallback = Record<string, unknown>> = IsUndefined<TObj> extends true ? {
24
+ [K in TKey]?: TFallback;
25
+ } : IsExactlyUnknown<TObj> extends true ? {
26
+ [K in TKey]?: TFallback;
27
+ } : IsMatchingEmptyObject<TObj> extends true ? {
28
+ [K in TKey]?: TObj;
29
+ } : undefined extends TObj ? {
30
+ [K in TKey]?: TObj;
31
+ } : null extends TObj ? {
32
+ [K in TKey]?: TObj;
33
+ } : {
34
+ [K in TKey]: TObj;
35
+ };
36
+ type AnyTypedRoute = {
21
37
  body?: unknown;
22
38
  headers?: unknown;
23
39
  query?: unknown;
@@ -39,36 +55,4 @@ export type TreatyToPath<T, Path extends string = ""> = UnionToIntersect<T exten
39
55
  } : TreatyToPath<T[K], `${Path}/${K & string}`>;
40
56
  }[keyof T] : {}>;
41
57
  export type Not<T> = T extends true ? false : true;
42
- export type Fn<Schema extends Record<string, any>> = <Endpoint extends keyof Schema, Method extends Uppercase<Extract<keyof Schema[Endpoint], string>>, Route extends Schema[Endpoint][Lowercase<Method>]>(endpoint: Endpoint, options: Omit<RequestInit, "body" | "method" | "headers"> & ("GET" extends Method ? {
43
- method?: Method;
44
- } : {
45
- method: Method;
46
- }) & (IsNever<keyof Route["params"]> extends true ? {
47
- params?: Record<never, string>;
48
- } : {
49
- params: Route["params"];
50
- }) & (IsNever<keyof Route["query"]> extends true ? {
51
- query?: Record<never, string>;
52
- } : {
53
- query: Route["query"];
54
- }) & (undefined extends Route["headers"] ? {
55
- headers?: Record<string, string>;
56
- } : {
57
- headers: Route["headers"];
58
- }) & (IsUnknown<Route["body"]> extends false ? {
59
- body: Route["body"];
60
- } : {
61
- body?: unknown;
62
- })) => Promise<Prettify<{
63
- data: Awaited<Route["response"][200]>;
64
- error: null;
65
- status: number;
66
- headers: Record<string, unknown>;
67
- retry(): Promise<void>;
68
- } | {
69
- data: null;
70
- error: MapError<Route["response"]> extends infer Errors ? IsNever<Errors> extends true ? EdenFetchError<number, string> : Errors : EdenFetchError<number, string>;
71
- status: number;
72
- headers: Record<string, unknown>;
73
- retry(): Promise<void>;
74
- }>>;
58
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teardown/ingest-api",
3
- "version": "0.0.21-alpha.5",
3
+ "version": "0.0.21-alpha.7",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -35,7 +35,7 @@
35
35
  "prepublishOnly": "bun run build"
36
36
  },
37
37
  "dependencies": {
38
- "@elysiajs/eden": "1.4.4"
38
+ "@elysiajs/eden": "1.4.5"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "typescript": "^5.9.3",