UNPKG

2.88 kBTypeScriptView Raw
1declare type THeader = {
2 openapi: string;
3 info: {
4 description: string;
5 version: string;
6 title: string;
7 contact: {
8 email: string;
9 };
10 license: {
11 name: string;
12 };
13 };
14 servers: {
15 url: string;
16 }[];
17 tags: {
18 name: string;
19 description: string;
20 externalDocs: {
21 description: string;
22 url: string;
23 };
24 }[];
25};
26declare type TParam = {
27 name: string;
28 schema: {
29 type: string;
30 format: string;
31 };
32 in: string;
33 description: string;
34 required?: boolean;
35};
36export declare function specPath({ integrationUuid, functionName, requestBody, response, oauth }: {
37 integrationUuid: string;
38 functionName: string;
39 requestBody: any;
40 response: any;
41 oauth: boolean;
42}): {
43 [x: string]: {
44 post: {
45 parameters: (TParam | {
46 in: string;
47 name: string;
48 schema: {
49 type: string;
50 };
51 description: string;
52 required: boolean;
53 } | undefined)[];
54 summary: string;
55 requestBody: {
56 content: {
57 'application/json': {
58 schema: any;
59 };
60 };
61 };
62 responses: {
63 '200': {
64 description: string;
65 content: {
66 'application/json': {
67 schema: any;
68 };
69 };
70 };
71 '401': {
72 description: string;
73 content: {
74 'application/json': {
75 schema: {
76 type: string;
77 properties: {
78 error: {
79 type: string;
80 };
81 };
82 };
83 };
84 };
85 };
86 '403': {
87 description: string;
88 content: {
89 'application/json': {
90 schema: {
91 type: string;
92 properties: {
93 error: {
94 type: string;
95 };
96 };
97 };
98 };
99 };
100 };
101 };
102 };
103 };
104};
105export declare function topOfSpec(integrationName: string): THeader;
106export {};