feathers-utils 1.14.0 → 1.14.2

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.
@@ -19,7 +19,7 @@ export declare type InferFindResult<S> = S extends {
19
19
  } ? Awaited<R> : never;
20
20
  export declare type InferCreateResult<S, D = unknown> = S extends {
21
21
  create: (data: any, params: any) => infer R;
22
- } ? D extends unknown ? Awaited<R> : D extends any[] ? Awaited<AsArray<R>> : Awaited<Single<R>> : never;
22
+ } ? D extends any[] ? Awaited<AsArray<R>> : D extends InferCreateDataSingle<S> ? Awaited<Single<R>> : Awaited<R> : never;
23
23
  export declare type InferCreateResultSingle<S> = Single<InferCreateResult<S>>;
24
24
  export declare type InferUpdateResult<S> = S extends {
25
25
  update: (id: any, data: any, params: any) => infer R;
@@ -35,7 +35,7 @@ export declare type InferGetResultFromPath<App extends Application, Path extends
35
35
  export declare type InferFindResultFromPath<App extends Application, Path extends string> = InferFindResult<GetService<App, Path>>;
36
36
  export declare type InferCreateDataFromPath<App extends Application, Path extends string> = InferCreateData<GetService<App, Path>>;
37
37
  export declare type InferCreateDataSingleFromPath<App extends Application, Path extends string> = InferCreateDataSingle<GetService<App, Path>>;
38
- export declare type InferCreateResultFromPath<App extends Application, Path extends string> = InferCreateResult<GetService<App, Path>>;
38
+ export declare type InferCreateResultFromPath<App extends Application, Path extends string, D = unknown> = InferCreateResult<GetService<App, Path>, D>;
39
39
  export declare type InferCreateResultSingleFromPath<App extends Application, Path extends string> = InferCreateResultSingle<GetService<App, Path>>;
40
40
  export declare type InferUpdateDataFromPath<App extends Application, Path extends string> = InferUpdateData<GetService<App, Path>>;
41
41
  export declare type InferPatchDataFromPath<App extends Application, Path extends string> = InferPatchData<GetService<App, Path>>;
@@ -19,7 +19,7 @@ export declare type InferFindResult<S> = S extends {
19
19
  } ? Awaited<R> : never;
20
20
  export declare type InferCreateResult<S, D = unknown> = S extends {
21
21
  create: (data: any, params: any) => infer R;
22
- } ? D extends unknown ? Awaited<R> : D extends any[] ? Awaited<AsArray<R>> : Awaited<Single<R>> : never;
22
+ } ? D extends any[] ? Awaited<AsArray<R>> : D extends InferCreateDataSingle<S> ? Awaited<Single<R>> : Awaited<R> : never;
23
23
  export declare type InferCreateResultSingle<S> = Single<InferCreateResult<S>>;
24
24
  export declare type InferUpdateResult<S> = S extends {
25
25
  update: (id: any, data: any, params: any) => infer R;
@@ -35,7 +35,7 @@ export declare type InferGetResultFromPath<App extends Application, Path extends
35
35
  export declare type InferFindResultFromPath<App extends Application, Path extends string> = InferFindResult<GetService<App, Path>>;
36
36
  export declare type InferCreateDataFromPath<App extends Application, Path extends string> = InferCreateData<GetService<App, Path>>;
37
37
  export declare type InferCreateDataSingleFromPath<App extends Application, Path extends string> = InferCreateDataSingle<GetService<App, Path>>;
38
- export declare type InferCreateResultFromPath<App extends Application, Path extends string> = InferCreateResult<GetService<App, Path>>;
38
+ export declare type InferCreateResultFromPath<App extends Application, Path extends string, D = unknown> = InferCreateResult<GetService<App, Path>, D>;
39
39
  export declare type InferCreateResultSingleFromPath<App extends Application, Path extends string> = InferCreateResultSingle<GetService<App, Path>>;
40
40
  export declare type InferUpdateDataFromPath<App extends Application, Path extends string> = InferUpdateData<GetService<App, Path>>;
41
41
  export declare type InferPatchDataFromPath<App extends Application, Path extends string> = InferPatchData<GetService<App, Path>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "feathers-utils",
3
- "version": "1.14.0",
3
+ "version": "1.14.2",
4
4
  "description": "Some utils for projects using '@feathersjs/feathers'",
5
5
  "author": "fratzinger",
6
6
  "repository": {
@@ -38,11 +38,11 @@ export type InferFindResult<S> = S extends {
38
38
  export type InferCreateResult<S, D = unknown> = S extends {
39
39
  create: (data: any, params: any) => infer R;
40
40
  }
41
- ? D extends unknown
42
- ? Awaited<R>
43
- : D extends any[]
44
- ? Awaited<AsArray<R>>
45
- : Awaited<Single<R>>
41
+ ? D extends any[]
42
+ ? Awaited<AsArray<R>>
43
+ : D extends InferCreateDataSingle<S>
44
+ ? Awaited<Single<R>>
45
+ : Awaited<R>
46
46
  : never;
47
47
 
48
48
  export type InferCreateResultSingle<S> = Single<InferCreateResult<S>>;
@@ -80,7 +80,8 @@ export type InferFindResultFromPath<App extends Application, Path extends string
80
80
 
81
81
  export type InferCreateDataFromPath<App extends Application, Path extends string> = InferCreateData<GetService<App, Path>>
82
82
  export type InferCreateDataSingleFromPath<App extends Application, Path extends string> = InferCreateDataSingle<GetService<App, Path>>;
83
- export type InferCreateResultFromPath<App extends Application, Path extends string> = InferCreateResult<GetService<App, Path>>;
83
+
84
+ export type InferCreateResultFromPath<App extends Application, Path extends string, D = unknown> = InferCreateResult<GetService<App, Path>, D>;
84
85
  export type InferCreateResultSingleFromPath<App extends Application, Path extends string> = InferCreateResultSingle<GetService<App, Path>>;
85
86
 
86
87
  export type InferUpdateDataFromPath<App extends Application, Path extends string> = InferUpdateData<GetService<App, Path>>