@data-client/rest 0.12.7 → 0.13.4
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/README.md +1 -1
- package/legacy/NetworkError.js +1 -1
- package/legacy/RestEndpoint.js +1 -1
- package/legacy/RestEndpointTypes.js +1 -1
- package/legacy/RestHelpers.js +1 -1
- package/legacy/createResource.js +1 -1
- package/legacy/hookifyResource.js +1 -1
- package/legacy/next/index.js +1 -1
- package/legacy/paginatedCollections.js +1 -1
- package/legacy/resourceTypes.js +1 -1
- package/lib/NetworkError.js +1 -1
- package/lib/RestEndpoint.js +1 -1
- package/lib/RestEndpointTypes.d.ts +4 -4
- package/lib/RestEndpointTypes.js +1 -1
- package/lib/RestHelpers.js +1 -1
- package/lib/createResource.js +1 -1
- package/lib/hookifyResource.js +1 -1
- package/lib/next/index.js +1 -1
- package/lib/paginatedCollections.js +1 -1
- package/lib/resourceTypes.d.ts +2 -2
- package/lib/resourceTypes.js +1 -1
- package/package.json +7 -6
- package/src/RestEndpointTypes.ts +4 -4
- package/src/resourceTypes.ts +2 -2
- package/ts4.0/RestEndpointTypes.d.ts +4 -4
- package/ts4.0/resourceTypes.d.ts +2 -2
- package/ts4.1/RestEndpointTypes.d.ts +4 -4
- package/ts4.1/resourceTypes.d.ts +2 -2
|
@@ -86,26 +86,26 @@ export interface RestInstance<F extends FetchFunction = FetchFunction, S extends
|
|
|
86
86
|
...Parameters<E>
|
|
87
87
|
]): PaginationEndpoint<E, A>;
|
|
88
88
|
paginated<E extends RestInstanceBase<FetchFunction, any, undefined>, C extends string>(this: E, cursorField: C): PaginationFieldEndpoint<E, C>;
|
|
89
|
-
/**
|
|
89
|
+
/** Concatinate the next page of results (GET)
|
|
90
90
|
* @see https://dataclient.io/rest/api/RestEndpoint#getPage
|
|
91
91
|
*/
|
|
92
92
|
getPage: 'paginationField' extends keyof O ? O['paginationField'] extends string ? PaginationFieldEndpoint<F & {
|
|
93
93
|
schema: S;
|
|
94
94
|
sideEffect: M;
|
|
95
95
|
} & O, O['paginationField']> : undefined : undefined;
|
|
96
|
-
/**
|
|
96
|
+
/** Create a new item (POST) and `push` to the end
|
|
97
97
|
* @see https://dataclient.io/rest/api/RestEndpoint#push
|
|
98
98
|
*/
|
|
99
99
|
push: AddEndpoint<F, ExtractCollection<S>['push'], Exclude<O, 'body' | 'method'> & {
|
|
100
100
|
body: OptionsToAdderBodyArgument<O> | OptionsToAdderBodyArgument<O>[] | FormData;
|
|
101
101
|
}>;
|
|
102
|
-
/**
|
|
102
|
+
/** Create a new item (POST) and `unshift` to the beginning
|
|
103
103
|
* @see https://dataclient.io/rest/api/RestEndpoint#unshift
|
|
104
104
|
*/
|
|
105
105
|
unshift: AddEndpoint<F, ExtractCollection<S>['unshift'], Exclude<O, 'body' | 'method'> & {
|
|
106
106
|
body: OptionsToAdderBodyArgument<O> | OptionsToAdderBodyArgument<O>[] | FormData;
|
|
107
107
|
}>;
|
|
108
|
-
/**
|
|
108
|
+
/** Create new item(s) (POST) and `Object.assign` merge
|
|
109
109
|
* @see https://dataclient.io/rest/api/RestEndpoint#assign
|
|
110
110
|
*/
|
|
111
111
|
assign: AddEndpoint<F, ExtractCollection<S>, Exclude<O, 'body' | 'method'> & {
|
package/ts4.0/resourceTypes.d.ts
CHANGED
|
@@ -55,7 +55,7 @@ export interface Resource<O extends ResourceGenerics = {
|
|
|
55
55
|
path: ResourcePath;
|
|
56
56
|
schema: any;
|
|
57
57
|
}> extends Extendable<O> {
|
|
58
|
-
/** Get
|
|
58
|
+
/** Get one item (GET)
|
|
59
59
|
*
|
|
60
60
|
* @see https://dataclient.io/rest/api/createResource#get
|
|
61
61
|
*/
|
|
@@ -63,7 +63,7 @@ export interface Resource<O extends ResourceGenerics = {
|
|
|
63
63
|
path: O['path'];
|
|
64
64
|
schema: O['schema'];
|
|
65
65
|
}>;
|
|
66
|
-
/** Get
|
|
66
|
+
/** Get an Array of items (GET)
|
|
67
67
|
*
|
|
68
68
|
* @see https://dataclient.io/rest/api/createResource#getlist
|
|
69
69
|
*/
|
|
@@ -86,26 +86,26 @@ export interface RestInstance<F extends FetchFunction = FetchFunction, S extends
|
|
|
86
86
|
...Parameters<E>
|
|
87
87
|
]): PaginationEndpoint<E, A>;
|
|
88
88
|
paginated<E extends RestInstanceBase<FetchFunction, any, undefined>, C extends string>(this: E, cursorField: C): PaginationFieldEndpoint<E, C>;
|
|
89
|
-
/**
|
|
89
|
+
/** Concatinate the next page of results (GET)
|
|
90
90
|
* @see https://dataclient.io/rest/api/RestEndpoint#getPage
|
|
91
91
|
*/
|
|
92
92
|
getPage: 'paginationField' extends keyof O ? O['paginationField'] extends string ? PaginationFieldEndpoint<F & {
|
|
93
93
|
schema: S;
|
|
94
94
|
sideEffect: M;
|
|
95
95
|
} & O, O['paginationField']> : undefined : undefined;
|
|
96
|
-
/**
|
|
96
|
+
/** Create a new item (POST) and `push` to the end
|
|
97
97
|
* @see https://dataclient.io/rest/api/RestEndpoint#push
|
|
98
98
|
*/
|
|
99
99
|
push: AddEndpoint<F, ExtractCollection<S>['push'], Exclude<O, 'body' | 'method'> & {
|
|
100
100
|
body: OptionsToAdderBodyArgument<O> | OptionsToAdderBodyArgument<O>[] | FormData;
|
|
101
101
|
}>;
|
|
102
|
-
/**
|
|
102
|
+
/** Create a new item (POST) and `unshift` to the beginning
|
|
103
103
|
* @see https://dataclient.io/rest/api/RestEndpoint#unshift
|
|
104
104
|
*/
|
|
105
105
|
unshift: AddEndpoint<F, ExtractCollection<S>['unshift'], Exclude<O, 'body' | 'method'> & {
|
|
106
106
|
body: OptionsToAdderBodyArgument<O> | OptionsToAdderBodyArgument<O>[] | FormData;
|
|
107
107
|
}>;
|
|
108
|
-
/**
|
|
108
|
+
/** Create new item(s) (POST) and `Object.assign` merge
|
|
109
109
|
* @see https://dataclient.io/rest/api/RestEndpoint#assign
|
|
110
110
|
*/
|
|
111
111
|
assign: AddEndpoint<F, ExtractCollection<S>, Exclude<O, 'body' | 'method'> & {
|
package/ts4.1/resourceTypes.d.ts
CHANGED
|
@@ -55,7 +55,7 @@ export interface Resource<O extends ResourceGenerics = {
|
|
|
55
55
|
path: ResourcePath;
|
|
56
56
|
schema: any;
|
|
57
57
|
}> extends Extendable<O> {
|
|
58
|
-
/** Get
|
|
58
|
+
/** Get one item (GET)
|
|
59
59
|
*
|
|
60
60
|
* @see https://dataclient.io/rest/api/createResource#get
|
|
61
61
|
*/
|
|
@@ -63,7 +63,7 @@ export interface Resource<O extends ResourceGenerics = {
|
|
|
63
63
|
path: O['path'];
|
|
64
64
|
schema: O['schema'];
|
|
65
65
|
}>;
|
|
66
|
-
/** Get
|
|
66
|
+
/** Get an Array of items (GET)
|
|
67
67
|
*
|
|
68
68
|
* @see https://dataclient.io/rest/api/createResource#getlist
|
|
69
69
|
*/
|