@mstuercke/api-utils 0.0.17 → 0.0.18
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.
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
import { RestApiRequest, RestApiRoute, RestPathParams, RestQueryParams, RestRequestBody, RestRequestHeaders, RestResponseBody } from './types';
|
|
1
|
+
import { RestApiRequest, RestApiRoute, RestPathParams, RestQueryParams, RestRequestBody, RestRequestHeaders, RestRequireAuthentication, RestResponseBody } from './types';
|
|
2
2
|
import { RequiredOnly } from './types/RequiredOnly';
|
|
3
|
-
|
|
3
|
+
type AuthenticationHeaders<RequireAuthentication extends RestRequireAuthentication> = RequireAuthentication extends true ? {
|
|
4
|
+
Authentication: `Bearer ${string}`;
|
|
5
|
+
} : never;
|
|
6
|
+
export declare function fetchRestApi<PathParams extends RestPathParams, QueryParams extends RestQueryParams, RequestHeaders extends RestRequestHeaders, RequestBody extends RestRequestBody, ResponseBody extends RestResponseBody, RequireAuthentication extends RestRequireAuthentication>(restApiUrl: string, route: RestApiRoute<PathParams, QueryParams, RequestHeaders, RequestBody, ResponseBody, RequireAuthentication>, request: RequiredOnly<RestApiRequest<PathParams, QueryParams, RequestHeaders & AuthenticationHeaders<RequireAuthentication>, RequestBody, RequireAuthentication>>): Promise<ResponseBody>;
|
|
7
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchRestApi.js","sourceRoot":"","sources":["../../src/rest/fetchRestApi.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fetchRestApi.js","sourceRoot":"","sources":["../../src/rest/fetchRestApi.ts"],"names":[],"mappings":"AAiBA,MAAM,CAAC,KAAK,UAAU,YAAY,CAO9B,UAAkB,EAClB,KAA8G,EAC9G,OAAiK;IAEnK,MAAM,UAAU,GAAG,YAAY,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,UAAwB,CAAC,CAAC,CAAC,SAAkB,CA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