UNPKG

1.48 kBTypeScriptView Raw
1import type { Except } from 'type-fest';
2import type { BasicMetaSysProps, DefaultElements, MakeRequest, SysLink } from '../common-types';
3type AppSignedRequestSys = Except<BasicMetaSysProps, 'version' | 'id'> & {
4 appDefinition: SysLink;
5 space: SysLink;
6 environment: SysLink;
7};
8export 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 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 {};