UNPKG

1.97 kBTypeScriptView Raw
1import * as ts from 'typescript';
2import * as TJS from 'typescript-json-schema';
3export declare function isFunctionClass(tsNode: ts.Node): boolean;
4export declare function getIdentifier(tsNode: ts.ClassDeclaration | ts.PropertyDeclaration): ts.Identifier;
5export declare function getFunctionName(tsSourceFile: ts.SourceFile): string;
6export declare function getPropertyValue(tsNode: ts.ClassDeclaration, propertyName: string): any;
7export declare function transformer(generator: TJS.JsonSchemaGenerator): ts.TransformerFactory<ts.SourceFile>;
8export declare class FunctionCodeProcessor {
9 private readonly srcFunctionsDir;
10 private readonly transformer;
11 constructor(srcFunctionsDir: string, transformer: any);
12 run(): Promise<void>;
13}
14export declare class OpenApiSpecGenerator {
15 private readonly srcFunctionsDir;
16 private readonly bearerConfig;
17 constructor(srcFunctionsDir: string, bearerConfig: {
18 integrationTitle: string | undefined;
19 buid: string;
20 });
21 build(): Promise<string>;
22}
23export interface ISchemaParam {
24 in: 'query' | 'header';
25 schema: {
26 type: 'string';
27 format?: 'uuid';
28 };
29 description: string;
30 required: boolean;
31 name: string;
32}
33export interface IOpenApiSpec {
34 openapi: string;
35 info: any;
36 servers: any[];
37 tags: any[];
38 paths: {
39 [key: string]: {
40 post: {
41 parameters: any[];
42 summary: any[];
43 requestBody: {
44 content: {
45 'application/json': {
46 schema: any;
47 };
48 };
49 };
50 responses: Record<TStatus, TResponse>;
51 };
52 };
53 };
54}
55declare type TStatus = '200' | '401' | '403';
56declare type TResponse = {
57 description: string;
58 content: {
59 'application/json': {
60 schema: any;
61 };
62 };
63};
64export {};