UNPKG

1.49 kBTypeScriptView Raw
1import { Except } from 'type-fest';
2import { BasicMetaSysProps, DefaultElements, MakeRequest, SysLink } from '../common-types';
3declare type AppSignedRequestSys = Except<BasicMetaSysProps, 'version' | 'id'> & {
4 appDefinition: SysLink;
5 space: SysLink;
6 environment: SysLink;
7};
8export declare type AppSignedRequestProps = {
9 /**
10 * System metadata
11 */
12 sys: AppSignedRequestSys;
13 /** new headers to be included in the request */
14 additionalHeaders: {
15 'x-contentful-signature': string;
16 'x-contentful-signed-headers': string;
17 'x-contentful-timestamp': string;
18 'x-contentful-space-id': string;
19 'x-contentful-environment-id': string;
20 'x-contentful-user-id': string;
21 };
22};
23export declare type CreateAppSignedRequestProps = {
24 /** the request method */
25 method: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'PATCH' | 'HEAD';
26 /** the path of the request method */
27 path: string;
28 /** optional stringified body of the request */
29 body?: string;
30 /** optional headers of the request */
31 headers?: Record<string, string>;
32};
33export interface AppSignedRequest extends AppSignedRequestProps, DefaultElements<AppSignedRequestProps> {
34}
35/**
36 * @private
37 * @param http - HTTP client instance
38 * @param data - Raw AppSignedRequest data
39 * @return Wrapped AppSignedRequest data
40 */
41export declare function wrapAppSignedRequest(_makeRequest: MakeRequest, data: AppSignedRequestProps): AppSignedRequest;
42export {};