@dappworks/urpc
Advanced tools
Comparing version 0.0.32 to 0.0.33
@@ -40,8 +40,16 @@ // Generated by dts-bundle-generator v9.5.1 | ||
export type UnwrapPromise<T> = T extends Promise<infer U> ? U : T; | ||
export type SchemaItem<T> = { | ||
export type SchemaItem<T extends Object = {}, R extends any = any> = { | ||
type?: string; | ||
uiConfig?: FormConfigItem; | ||
call?: (val: Item<T>) => any; | ||
} | URPC_Action<T, R>; | ||
export type URPC_Action<T extends Object = {}, R extends any = any> = { | ||
type?: "action"; | ||
input?: T; | ||
func?: (args: { | ||
val: Item<R>; | ||
input: T; | ||
}) => any; | ||
uiConfig?: FormConfigItem; | ||
}; | ||
export interface URPC_Variable<G extends () => any = () => any, T extends UnwrapPromise<ReturnType<G>> = UnwrapPromise<ReturnType<G>>> { | ||
export interface URPC_Variable<G extends () => any = () => any, R extends UnwrapPromise<ReturnType<G>> = UnwrapPromise<ReturnType<G>>> { | ||
uid: string; | ||
@@ -52,9 +60,10 @@ type?: "var"; | ||
get: G; | ||
schema?: (val: T) => { | ||
[F in keyof Item<T>]?: SchemaItem<T>; | ||
schema?: (val: R) => { | ||
[F in keyof Item<R>]?: SchemaItem<any, R>; | ||
} & { | ||
[key: string]: SchemaItem<T>; | ||
[key: string]: SchemaItem<any, R>; | ||
}; | ||
_schema?: ReturnType<Required<URPC_Variable<T>>["schema"]>; | ||
_schema?: ReturnType<Required<URPC_Variable<R>>["schema"]>; | ||
patch?: { | ||
enable?: boolean; | ||
allowCreate?: boolean; | ||
@@ -66,3 +75,3 @@ allowDelete?: boolean; | ||
}; | ||
onCreate?: (value: Item<T>) => any; | ||
onCreate?: (value: Item<R>) => any; | ||
onUpdate?: (key: any, value: any) => any; | ||
@@ -72,3 +81,3 @@ onDelete?: (key: any) => any; | ||
}; | ||
set?: (val: T) => any; | ||
set?: (val: R) => any; | ||
} | ||
@@ -85,2 +94,3 @@ export type URPC_Entity = URPC_Function<any, any> | URPC_Variable<any>; | ||
static Func<T extends Object = {}, R = any>(args: Partial<URPC_Function<T, R>>): URPC_Function<T, R>; | ||
static Action<T extends Object = {}, R = any>(args: Partial<URPC_Action<T, R>>): URPC_Action<T, R>; | ||
constructor(args?: Partial<URPC<T>>); | ||
@@ -97,2 +107,3 @@ loadFull(): Promise<({ | ||
patch?: undefined; | ||
schema?: undefined; | ||
} | { | ||
@@ -107,2 +118,3 @@ uid: string; | ||
patch: { | ||
enable?: boolean | undefined; | ||
allowCreate?: boolean | undefined; | ||
@@ -119,2 +131,7 @@ allowDelete?: boolean | undefined; | ||
} | undefined; | ||
schema: ({ | ||
[x: string]: SchemaItem<any, any> | undefined; | ||
} & { | ||
[key: string]: SchemaItem<any, any>; | ||
}) | null; | ||
input?: undefined; | ||
@@ -131,2 +148,3 @@ } | { | ||
patch?: undefined; | ||
schema?: undefined; | ||
})[]>; | ||
@@ -164,3 +182,8 @@ loadVars(): Promise<{ | ||
value: any; | ||
input?: any; | ||
}): Promise<any>; | ||
call<R_2 extends keyof T>(params: { | ||
method: R_2; | ||
input: Partial<T[R_2] extends URPC_Function<infer Z_3 extends Object, any> ? Z_3 : never>; | ||
}): Promise<T[R_2] extends URPC_Function<any, infer Z_4> ? Z_4 : never>; | ||
}; | ||
@@ -187,2 +210,3 @@ }; | ||
patch?: undefined; | ||
schema?: undefined; | ||
} | { | ||
@@ -197,2 +221,3 @@ uid: string; | ||
patch: { | ||
enable?: boolean | undefined; | ||
allowCreate?: boolean | undefined; | ||
@@ -209,2 +234,13 @@ allowDelete?: boolean | undefined; | ||
} | undefined; | ||
schema: ({ | ||
[x: string]: ({ | ||
type?: string | undefined; | ||
uiConfig?: FormConfigItem | undefined; | ||
} | URPC_Action<any, any>) | undefined; | ||
} & { | ||
[key: string]: { | ||
type?: string | undefined; | ||
uiConfig?: FormConfigItem | undefined; | ||
} | URPC_Action<any, any>; | ||
}) | null; | ||
input?: undefined; | ||
@@ -221,2 +257,3 @@ } | { | ||
patch?: undefined; | ||
schema?: undefined; | ||
})[]>; | ||
@@ -247,3 +284,9 @@ loadVars(): Promise<{ | ||
value: any; | ||
input?: any; | ||
}): Promise<any>; | ||
call(params: { | ||
name: string; | ||
method: string; | ||
input?: any; | ||
}): Promise<any>; | ||
}; | ||
@@ -250,0 +293,0 @@ }; |
{ | ||
"name": "@dappworks/urpc", | ||
"version": "0.0.32", | ||
"version": "0.0.33", | ||
"module": "index.ts", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
123963
720
7