@povio/openapi-codegen-cli 2.0.8-rc.5 → 2.0.8-rc.8
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.
- package/README.md +63 -0
- package/dist/acl.d.mts +48 -0
- package/dist/acl.mjs +62 -7
- package/dist/auth.context-DKjzWiaA.mjs +59 -0
- package/dist/config-Cu_GYfai.d.mts +6 -0
- package/dist/generate.runner-DNldmk0f.mjs +98 -0
- package/dist/generateCodeFromOpenAPIDoc-B5lnFNGB.mjs +4522 -0
- package/dist/generator.d.mts +65 -0
- package/dist/generator.mjs +144 -0
- package/dist/index.d.mts +246 -0
- package/dist/index.mjs +365 -22
- package/dist/options-DBz5YE3s.d.mts +90 -0
- package/dist/sh.d.mts +1 -0
- package/dist/sh.mjs +439 -0
- package/dist/vite.d.mts +8 -0
- package/dist/vite.mjs +50 -0
- package/package.json +50 -45
- package/src/assets/useMutationEffects.ts +6 -1
- package/src/generators/templates/endpoints.hbs +0 -1
- package/dist/acl.d.ts +0 -4
- package/dist/commands/check.command.d.ts +0 -2
- package/dist/commands/check.d.ts +0 -7
- package/dist/commands/generate.command.d.ts +0 -2
- package/dist/commands/generate.d.ts +0 -8
- package/dist/generator.d.ts +0 -3
- package/dist/generator.js +0 -78
- package/dist/generators/checkOpenAPIDoc.d.ts +0 -3
- package/dist/generators/const/acl.const.d.ts +0 -13
- package/dist/generators/const/buildConfigs.const.d.ts +0 -1
- package/dist/generators/const/deps.const.d.ts +0 -38
- package/dist/generators/const/endpoints.const.d.ts +0 -11
- package/dist/generators/const/js.const.d.ts +0 -1
- package/dist/generators/const/openapi.const.d.ts +0 -7
- package/dist/generators/const/options.const.d.ts +0 -2
- package/dist/generators/const/package.const.d.ts +0 -2
- package/dist/generators/const/queries.const.d.ts +0 -8
- package/dist/generators/const/validation.const.d.ts +0 -53
- package/dist/generators/const/zod.const.d.ts +0 -19
- package/dist/generators/core/SchemaResolver.class.d.ts +0 -71
- package/dist/generators/core/endpoints/getEndpointAcl.d.ts +0 -8
- package/dist/generators/core/endpoints/getEndpointBody.d.ts +0 -13
- package/dist/generators/core/endpoints/getEndpointParameter.d.ts +0 -11
- package/dist/generators/core/endpoints/getEndpointsFromOpenAPIDoc.d.ts +0 -3
- package/dist/generators/core/endpoints/getEndpointsFromOpenAPIDoc.test.d.ts +0 -1
- package/dist/generators/core/getDataFromOpenAPIDoc.d.ts +0 -8
- package/dist/generators/core/getMetadataFromOpenAPIDoc.d.ts +0 -4
- package/dist/generators/core/getMetadataFromOpenAPIDoc.test.d.ts +0 -1
- package/dist/generators/core/openapi/getOpenAPISchemaComplexity.d.ts +0 -2
- package/dist/generators/core/openapi/getOpenAPISchemaComplexity.test.d.ts +0 -1
- package/dist/generators/core/openapi/getOpenAPISchemaDependencyGraph.d.ts +0 -6
- package/dist/generators/core/openapi/getOpenAPISchemaDependencyGraph.test.d.ts +0 -1
- package/dist/generators/core/openapi/getSchemaRefObjs.d.ts +0 -4
- package/dist/generators/core/openapi/iterateSchema.d.ts +0 -22
- package/dist/generators/core/resolveConfig.d.ts +0 -7
- package/dist/generators/core/zod/ZodSchema.class.d.ts +0 -26
- package/dist/generators/core/zod/enumExtraction/resolveExtractedEnumZodSchemaNames.d.ts +0 -2
- package/dist/generators/core/zod/enumExtraction/resolveExtractedEnumZodSchemaTags.d.ts +0 -2
- package/dist/generators/core/zod/enumExtraction/updateExtractedEnumZodSchemaData.d.ts +0 -17
- package/dist/generators/core/zod/getZodChain.d.ts +0 -8
- package/dist/generators/core/zod/getZodSchema.d.ts +0 -17
- package/dist/generators/core/zod/getZodSchema.test.d.ts +0 -1
- package/dist/generators/core/zod/getZodSchemaRefs.d.ts +0 -6
- package/dist/generators/core/zod/getZodSchemasFromOpenAPIDoc.d.ts +0 -6
- package/dist/generators/core/zod/resolveZodSchemaName.d.ts +0 -10
- package/dist/generators/core/zod/sortZodSchemasByTopology.d.ts +0 -4
- package/dist/generators/generate/generateAcl.d.ts +0 -3
- package/dist/generators/generate/generateAclCheck.d.ts +0 -2
- package/dist/generators/generate/generateAppRestClient.d.ts +0 -2
- package/dist/generators/generate/generateConfigs.d.ts +0 -2
- package/dist/generators/generate/generateEndpoints.d.ts +0 -2
- package/dist/generators/generate/generateModels.d.ts +0 -2
- package/dist/generators/generate/generateQueries.d.ts +0 -2
- package/dist/generators/generate/generateQueryModules.d.ts +0 -2
- package/dist/generators/generate/generateZodExtended.d.ts +0 -2
- package/dist/generators/generateCodeFromOpenAPIDoc.d.ts +0 -4
- package/dist/generators/types/builder-config.d.ts +0 -48
- package/dist/generators/types/common.d.ts +0 -27
- package/dist/generators/types/config.d.ts +0 -2
- package/dist/generators/types/endpoint.d.ts +0 -50
- package/dist/generators/types/generate.d.ts +0 -39
- package/dist/generators/types/metadata.d.ts +0 -51
- package/dist/generators/types/openapi.d.ts +0 -22
- package/dist/generators/types/options.d.ts +0 -66
- package/dist/generators/types/validation.d.ts +0 -5
- package/dist/generators/utils/array.utils.d.ts +0 -1
- package/dist/generators/utils/endpoint.utils.d.ts +0 -12
- package/dist/generators/utils/endpoint.utils.test.d.ts +0 -1
- package/dist/generators/utils/file.utils.d.ts +0 -8
- package/dist/generators/utils/generate/generate.acl.utils.d.ts +0 -23
- package/dist/generators/utils/generate/generate.configs.utils.d.ts +0 -15
- package/dist/generators/utils/generate/generate.endpoints.utils.d.ts +0 -39
- package/dist/generators/utils/generate/generate.imports.utils.d.ts +0 -39
- package/dist/generators/utils/generate/generate.imports.utils.test.d.ts +0 -1
- package/dist/generators/utils/generate/generate.openapi.utils.d.ts +0 -2
- package/dist/generators/utils/generate/generate.query.utils.d.ts +0 -6
- package/dist/generators/utils/generate/generate.utils.d.ts +0 -18
- package/dist/generators/utils/generate/generate.zod.utils.d.ts +0 -13
- package/dist/generators/utils/generate-files.utils.d.ts +0 -6
- package/dist/generators/utils/hbs/hbs-template.utils.d.ts +0 -3
- package/dist/generators/utils/hbs/hbs.acl.utils.d.ts +0 -2
- package/dist/generators/utils/hbs/hbs.common.utils.d.ts +0 -1
- package/dist/generators/utils/hbs/hbs.endpoints.utils.d.ts +0 -2
- package/dist/generators/utils/hbs/hbs.imports.utils.d.ts +0 -1
- package/dist/generators/utils/hbs/hbs.partials.utils.d.ts +0 -2
- package/dist/generators/utils/hbs/hbs.query.utils.d.ts +0 -2
- package/dist/generators/utils/hbs/hbs.zod.utils.d.ts +0 -2
- package/dist/generators/utils/js.utils.d.ts +0 -2
- package/dist/generators/utils/js.utils.test.d.ts +0 -1
- package/dist/generators/utils/math.utils.d.ts +0 -1
- package/dist/generators/utils/namespace.utils.d.ts +0 -7
- package/dist/generators/utils/object.utils.d.ts +0 -13
- package/dist/generators/utils/object.utils.test.d.ts +0 -1
- package/dist/generators/utils/openapi-schema.utils.d.ts +0 -15
- package/dist/generators/utils/openapi.utils.d.ts +0 -23
- package/dist/generators/utils/openapi.utils.test.d.ts +0 -1
- package/dist/generators/utils/operation.utils.d.ts +0 -22
- package/dist/generators/utils/operation.utils.test.d.ts +0 -1
- package/dist/generators/utils/query.utils.d.ts +0 -7
- package/dist/generators/utils/sort.utils.d.ts +0 -7
- package/dist/generators/utils/string.utils.d.ts +0 -14
- package/dist/generators/utils/string.utils.test.d.ts +0 -1
- package/dist/generators/utils/tag.utils.d.ts +0 -7
- package/dist/generators/utils/ts.utils.d.ts +0 -16
- package/dist/generators/utils/validation.utils.d.ts +0 -17
- package/dist/generators/utils/zod-schema.utils.d.ts +0 -15
- package/dist/helpers/cli.helper.d.ts +0 -22
- package/dist/helpers/config.helper.d.ts +0 -3
- package/dist/helpers/version.helper.d.ts +0 -4
- package/dist/helpers/yargs.helper.d.ts +0 -10
- package/dist/index.d.ts +0 -15
- package/dist/lib/acl/AclGuard.d.ts +0 -8
- package/dist/lib/acl/AclGuard.mjs +0 -14
- package/dist/lib/acl/Can.d.ts +0 -9
- package/dist/lib/acl/Can.mjs +0 -11
- package/dist/lib/acl/ability.context.d.ts +0 -15
- package/dist/lib/acl/ability.context.mjs +0 -37
- package/dist/lib/acl/appAbility.types.d.ts +0 -3
- package/dist/lib/assets/locales/en/translation.json.mjs +0 -8
- package/dist/lib/assets/locales/sl/translation.json.mjs +0 -8
- package/dist/lib/auth/AuthGuard.d.ts +0 -6
- package/dist/lib/auth/AuthGuard.mjs +0 -26
- package/dist/lib/auth/auth.context.d.ts +0 -22
- package/dist/lib/auth/auth.context.mjs +0 -41
- package/dist/lib/config/i18n.d.ts +0 -32
- package/dist/lib/config/i18n.mjs +0 -31
- package/dist/lib/config/queryConfig.context.d.ts +0 -17
- package/dist/lib/config/queryConfig.context.mjs +0 -26
- package/dist/lib/config/router.context.d.ts +0 -9
- package/dist/lib/config/router.context.mjs +0 -20
- package/dist/lib/react-query.types.d.ts +0 -10
- package/dist/lib/rest/error-handling.d.ts +0 -30
- package/dist/lib/rest/error-handling.mjs +0 -132
- package/dist/lib/rest/rest-client.d.ts +0 -22
- package/dist/lib/rest/rest-client.mjs +0 -62
- package/dist/lib/rest/rest-client.types.d.ts +0 -23
- package/dist/lib/rest/rest-interceptor.d.ts +0 -8
- package/dist/lib/rest/rest-interceptor.mjs +0 -21
- package/dist/lib/rest/rest.utils.d.ts +0 -7
- package/dist/lib/rest/rest.utils.mjs +0 -51
- package/dist/sh.d.ts +0 -2
- package/dist/sh.js +0 -635
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { GenerateFile, Import } from '../types/generate';
|
|
2
|
-
export declare const ACL_APP_ABILITY_FILE: GenerateFile;
|
|
3
|
-
export declare const ACL_APP_ABILITIES = "AppAbilities";
|
|
4
|
-
export declare const ACL_CHECK_FILE: GenerateFile;
|
|
5
|
-
export declare const ACL_CHECK_HOOK = "useAclCheck";
|
|
6
|
-
export declare const CASL_ABILITY_BINDING: {
|
|
7
|
-
abilityTuple: string;
|
|
8
|
-
pureAbility: string;
|
|
9
|
-
forcedSubject: string;
|
|
10
|
-
subjectType: string;
|
|
11
|
-
subject: string;
|
|
12
|
-
};
|
|
13
|
-
export declare const CASL_ABILITY_IMPORT: Import;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const BUILD_CONFIG_SUFFIX = "config";
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { GenerateFile, Import } from '../types/generate';
|
|
2
|
-
export declare const APP_REST_CLIENT_NAME = "AppRestClient";
|
|
3
|
-
export declare const APP_REST_CLIENT_FILE: GenerateFile;
|
|
4
|
-
export declare const QUERY_OPTIONS_TYPES: {
|
|
5
|
-
query: string;
|
|
6
|
-
infiniteQuery: string;
|
|
7
|
-
mutation: string;
|
|
8
|
-
};
|
|
9
|
-
export declare const TEMPLATE_DATA_FILE_PATH = "src/data";
|
|
10
|
-
export declare const ERROR_HANDLERS: {
|
|
11
|
-
ErrorHandler: string;
|
|
12
|
-
SharedErrorHandler: string;
|
|
13
|
-
};
|
|
14
|
-
export declare const ERROR_HANDLING_IMPORT: Import;
|
|
15
|
-
export declare const ABILITY_CONTEXT = "AbilityContext";
|
|
16
|
-
export declare const ABILITY_CONTEXT_IMPORT: Import;
|
|
17
|
-
export declare const BUILDERS_UTILS: {
|
|
18
|
-
dynamicInputs: string;
|
|
19
|
-
dynamicColumns: string;
|
|
20
|
-
};
|
|
21
|
-
export declare const QUERY_MODULE_ENUM = "QueryModule";
|
|
22
|
-
export declare const QUERY_MODULES_FILE: GenerateFile;
|
|
23
|
-
export declare const QUERY_CONFIG_FILE: GenerateFile;
|
|
24
|
-
export declare const MUTATION_EFFECTS: {
|
|
25
|
-
optionsType: string;
|
|
26
|
-
hookName: string;
|
|
27
|
-
runFunctionName: string;
|
|
28
|
-
};
|
|
29
|
-
export declare const MUTATION_EFFECTS_FILE: GenerateFile;
|
|
30
|
-
export declare const CROSS_TAB_QUERY_INVALIDATION_FILE: GenerateFile;
|
|
31
|
-
export declare const ZOD_EXTENDED: {
|
|
32
|
-
namespace: string;
|
|
33
|
-
exports: {
|
|
34
|
-
parse: string;
|
|
35
|
-
sortExp: string;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
export declare const ZOD_EXTENDED_FILE: GenerateFile;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Import } from '../types/generate';
|
|
2
|
-
export declare const JSON_APPLICATION_FORMAT = "application/json";
|
|
3
|
-
export declare const DEFAULT_HEADERS: {
|
|
4
|
-
"Content-Type": string;
|
|
5
|
-
Accept: string;
|
|
6
|
-
};
|
|
7
|
-
export declare const BODY_PARAMETER_NAME = "data";
|
|
8
|
-
export declare const AXIOS_DEFAULT_IMPORT_NAME = "axios";
|
|
9
|
-
export declare const AXIOS_REQUEST_CONFIG_NAME = "config";
|
|
10
|
-
export declare const AXIOS_REQUEST_CONFIG_TYPE = "AxiosRequestConfig";
|
|
11
|
-
export declare const AXIOS_IMPORT: Import;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const RESERVED_WORDS: string[];
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { OpenAPIV3 } from 'openapi-types';
|
|
2
|
-
export declare const COMPLEXITY_THRESHOLD = 2;
|
|
3
|
-
export declare const ALLOWED_PARAM_MEDIA_TYPES: string[];
|
|
4
|
-
export declare const ALLOWED_PATH_IN: Array<OpenAPIV3.ParameterObject["in"]>;
|
|
5
|
-
export declare const ALLOWED_METHODS: Array<OpenAPIV3.HttpMethods>;
|
|
6
|
-
export declare const PRIMITIVE_TYPE_LIST: string[];
|
|
7
|
-
export declare const COMPOSITE_KEYWORDS: (keyof OpenAPIV3.SchemaObject)[];
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { ValidationErrorType } from '../types/validation';
|
|
2
|
-
export declare const HTTP_STATUS_CODES: {
|
|
3
|
-
"100": string;
|
|
4
|
-
"101": string;
|
|
5
|
-
"102": string;
|
|
6
|
-
"103": string;
|
|
7
|
-
"200": string;
|
|
8
|
-
"201": string;
|
|
9
|
-
"202": string;
|
|
10
|
-
"203": string;
|
|
11
|
-
"204": string;
|
|
12
|
-
"205": string;
|
|
13
|
-
"206": string;
|
|
14
|
-
"300": string;
|
|
15
|
-
"301": string;
|
|
16
|
-
"302": string;
|
|
17
|
-
"303": string;
|
|
18
|
-
"304": string;
|
|
19
|
-
"307": string;
|
|
20
|
-
"308": string;
|
|
21
|
-
"400": string;
|
|
22
|
-
"401": string;
|
|
23
|
-
"402": string;
|
|
24
|
-
"403": string;
|
|
25
|
-
"404": string;
|
|
26
|
-
"405": string;
|
|
27
|
-
"406": string;
|
|
28
|
-
"407": string;
|
|
29
|
-
"408": string;
|
|
30
|
-
"409": string;
|
|
31
|
-
"410": string;
|
|
32
|
-
"411": string;
|
|
33
|
-
"412": string;
|
|
34
|
-
"413": string;
|
|
35
|
-
"414": string;
|
|
36
|
-
"415": string;
|
|
37
|
-
"416": string;
|
|
38
|
-
"417": string;
|
|
39
|
-
"418": string;
|
|
40
|
-
"421": string;
|
|
41
|
-
"422": string;
|
|
42
|
-
"424": string;
|
|
43
|
-
"428": string;
|
|
44
|
-
"429": string;
|
|
45
|
-
"500": string;
|
|
46
|
-
"501": string;
|
|
47
|
-
"502": string;
|
|
48
|
-
"503": string;
|
|
49
|
-
"504": string;
|
|
50
|
-
"505": string;
|
|
51
|
-
};
|
|
52
|
-
export type HttpStatusCode = keyof typeof HTTP_STATUS_CODES;
|
|
53
|
-
export declare const VALIDATION_ERROR_TYPE_TITLE: Record<ValidationErrorType, string>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Import } from '../types/generate';
|
|
2
|
-
export declare const SCHEMA_SUFFIX = "Schema";
|
|
3
|
-
export declare const ENUM_SUFFIX = "Enum";
|
|
4
|
-
export declare const BODY_SCHEMA_SUFFIX = "Body";
|
|
5
|
-
export declare const PARAM_SCHEMA_SUFFIX = "Param";
|
|
6
|
-
export declare const RESPONSE_SCHEMA_SUFFIX = "Response";
|
|
7
|
-
export declare const ERROR_RESPONSE_SCHEMA_SUFFIX = "ErrorResponse";
|
|
8
|
-
export declare const VOID_SCHEMA = "z.void()";
|
|
9
|
-
export declare const ANY_SCHEMA = "z.any()";
|
|
10
|
-
export declare const BLOB_SCHEMA = "z.instanceof(Blob)";
|
|
11
|
-
export declare const ENUM_SCHEMA = "z.enum";
|
|
12
|
-
export declare const INT_SCHEMA = "z.int()";
|
|
13
|
-
export declare const NUMBER_SCHEMA = "z.number()";
|
|
14
|
-
export declare const STRING_SCHEMA = "z.string()";
|
|
15
|
-
export declare const EMAIL_SCHEMA = "z.email()";
|
|
16
|
-
export declare const URL_SCHEMA = "z.url()";
|
|
17
|
-
export declare const UUID_SCHEMA = "z.uuid()";
|
|
18
|
-
export declare const DATETIME_SCHEMA = "z.iso.datetime({ offset: true })";
|
|
19
|
-
export declare const ZOD_IMPORT: Import;
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { OpenAPIV3 } from 'openapi-types';
|
|
2
|
-
import { OperationObject } from '../types/openapi';
|
|
3
|
-
import { GenerateOptions } from '../types/options';
|
|
4
|
-
import { ValidationError } from '../types/validation';
|
|
5
|
-
import { DependencyGraph } from './openapi/getOpenAPISchemaDependencyGraph';
|
|
6
|
-
import { ZodSchema } from './zod/ZodSchema.class';
|
|
7
|
-
interface SchemaData {
|
|
8
|
-
ref: string;
|
|
9
|
-
name: string;
|
|
10
|
-
zodSchemaName: string;
|
|
11
|
-
tags: string[];
|
|
12
|
-
deepRefOperations: OperationObject[];
|
|
13
|
-
}
|
|
14
|
-
export interface EnumZodSchemaData {
|
|
15
|
-
code: string;
|
|
16
|
-
zodSchemaName: string;
|
|
17
|
-
tag?: string;
|
|
18
|
-
}
|
|
19
|
-
export interface ExtractedEnumZodSchemaData {
|
|
20
|
-
code: string;
|
|
21
|
-
zodSchemaName?: string;
|
|
22
|
-
tag?: string;
|
|
23
|
-
meta: {
|
|
24
|
-
zodSchemaNameSegments: string[][];
|
|
25
|
-
tags: string[];
|
|
26
|
-
schemaRefs: string[];
|
|
27
|
-
schemas: (OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject)[];
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
export declare class SchemaResolver {
|
|
31
|
-
readonly openApiDoc: OpenAPIV3.Document;
|
|
32
|
-
readonly options: GenerateOptions;
|
|
33
|
-
private readonly schemaData;
|
|
34
|
-
private readonly zodSchemaData;
|
|
35
|
-
private readonly compositeZodSchemaData;
|
|
36
|
-
readonly dependencyGraph: DependencyGraph;
|
|
37
|
-
readonly enumZodSchemas: EnumZodSchemaData[];
|
|
38
|
-
readonly extractedEnumZodSchemaData: ExtractedEnumZodSchemaData[];
|
|
39
|
-
readonly operationsByTag: Record<string, OperationObject[]>;
|
|
40
|
-
readonly operationNames: string[];
|
|
41
|
-
readonly validationErrors: ValidationError[];
|
|
42
|
-
private get docSchemas();
|
|
43
|
-
private get schemaRefs();
|
|
44
|
-
constructor(openApiDoc: OpenAPIV3.Document, options: GenerateOptions);
|
|
45
|
-
getSchemaByRef(ref: string): OpenAPIV3.SchemaObject;
|
|
46
|
-
getSchemaDataByName(name: string): SchemaData | undefined;
|
|
47
|
-
getZodSchemaNameByRef(ref: string): string;
|
|
48
|
-
getRefByZodSchemaName(zodSchemaName: string): string | undefined;
|
|
49
|
-
getTagByZodSchemaName(zodSchemaName: string): string;
|
|
50
|
-
getCodeByZodSchemaName(name: string): string | undefined;
|
|
51
|
-
getZodSchemaNamesByCompositeCode(code: string): string[] | undefined;
|
|
52
|
-
setZodSchema(name: string, code: string, tag: string): void;
|
|
53
|
-
addZodSchemaForCompositeCode(code: string, zodSchema: ZodSchema, zodSchemaName: string, schema?: OpenAPIV3.SchemaObject): void;
|
|
54
|
-
getCompositeZodSchemaByZodSchemaName(zodSchemaName: string): ZodSchema | undefined;
|
|
55
|
-
getSchemaByCompositeZodSchemaName(compositeZodSchemaName: string): OpenAPIV3.SchemaObject | undefined;
|
|
56
|
-
getEnumZodSchemaDataByCode(code: string): EnumZodSchemaData | undefined;
|
|
57
|
-
getExtractedEnumZodSchemaDataByCode(code: string): ExtractedEnumZodSchemaData | undefined;
|
|
58
|
-
getExtractedEnumZodSchemaNamesReferencedBySchemaRef(schemaRef: string): string[];
|
|
59
|
-
getZodSchemas(): {};
|
|
60
|
-
getExtractedEnumZodSchemas(): {};
|
|
61
|
-
resolveObject<T>(obj: OpenAPIV3.ReferenceObject | T): T;
|
|
62
|
-
isSchemaCircular(ref: string): boolean;
|
|
63
|
-
getCircularSchemaChain(ref: string, currentRef?: string, chain?: never[], visited?: string[]): string[];
|
|
64
|
-
getBaseUrl(): string;
|
|
65
|
-
getZodSchemaObj(zodSchemaName: string): OpenAPIV3.SchemaObject | OpenAPIV3.ReferenceObject | undefined;
|
|
66
|
-
private getSchemaDataByRef;
|
|
67
|
-
private getExtractedEnumZodSchemaDataByName;
|
|
68
|
-
private initialize;
|
|
69
|
-
private handleDuplicateEnumZodSchemas;
|
|
70
|
-
}
|
|
71
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { SchemaResolver } from '../SchemaResolver.class';
|
|
2
|
-
import { Endpoint, EndpointAclInfo } from '../../types/endpoint';
|
|
3
|
-
import { OperationObject } from '../../types/openapi';
|
|
4
|
-
export declare function getEndpointAcl({ resolver, endpoint, operation, }: {
|
|
5
|
-
resolver: SchemaResolver;
|
|
6
|
-
endpoint: Endpoint;
|
|
7
|
-
operation: OperationObject;
|
|
8
|
-
}): EndpointAclInfo[] | undefined;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { SchemaResolver } from '../SchemaResolver.class';
|
|
2
|
-
import { EndpointParameter } from '../../types/endpoint';
|
|
3
|
-
import { OperationObject } from '../../types/openapi';
|
|
4
|
-
export declare function getEndpointBody({ resolver, operation, operationName, isUniqueOperationName, tag, }: {
|
|
5
|
-
resolver: SchemaResolver;
|
|
6
|
-
operation: OperationObject;
|
|
7
|
-
operationName: string;
|
|
8
|
-
isUniqueOperationName: boolean;
|
|
9
|
-
tag: string;
|
|
10
|
-
}): {
|
|
11
|
-
endpointParameter: EndpointParameter;
|
|
12
|
-
requestFormat: string;
|
|
13
|
-
} | undefined;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { OpenAPIV3 } from 'openapi-types';
|
|
2
|
-
import { SchemaResolver } from '../SchemaResolver.class';
|
|
3
|
-
import { EndpointParameter } from '../../types/endpoint';
|
|
4
|
-
import { ParameterObject } from '../../types/openapi';
|
|
5
|
-
export declare function getEndpointParameter({ resolver, param, operationName, isUniqueOperationName, tag, }: {
|
|
6
|
-
resolver: SchemaResolver;
|
|
7
|
-
param: OpenAPIV3.ReferenceObject | ParameterObject;
|
|
8
|
-
operationName: string;
|
|
9
|
-
isUniqueOperationName: boolean;
|
|
10
|
-
tag: string;
|
|
11
|
-
}): EndpointParameter | undefined;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { OpenAPIV3 } from 'openapi-types';
|
|
2
|
-
import { GenerateData } from '../types/generate';
|
|
3
|
-
import { GenerateOptions } from '../types/options';
|
|
4
|
-
import { SchemaResolver } from './SchemaResolver.class';
|
|
5
|
-
export declare function getDataFromOpenAPIDoc(openApiDoc: OpenAPIV3.Document, options: GenerateOptions): {
|
|
6
|
-
resolver: SchemaResolver;
|
|
7
|
-
data: GenerateData;
|
|
8
|
-
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { OpenAPIV3 } from 'openapi-types';
|
|
2
|
-
import { GenerateMetadata } from '../types/metadata';
|
|
3
|
-
import { GenerateOptions } from '../types/options';
|
|
4
|
-
export declare function getMetadataFromOpenAPIDoc(openApiDoc: OpenAPIV3.Document, options: GenerateOptions): Promise<GenerateMetadata>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { OpenAPIV3 } from 'openapi-types';
|
|
2
|
-
export interface DependencyGraph {
|
|
3
|
-
refsDependencyGraph: Record<string, Set<string>>;
|
|
4
|
-
deepDependencyGraph: Record<string, Set<string>>;
|
|
5
|
-
}
|
|
6
|
-
export declare function getOpenAPISchemaDependencyGraph(schemaRef: string[], getSchemaByRef: (ref: string) => OpenAPIV3.SchemaObject | OpenAPIV3.ReferenceObject): DependencyGraph;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { OpenAPIV3 } from 'openapi-types';
|
|
2
|
-
import { SchemaResolver } from '../SchemaResolver.class';
|
|
3
|
-
export declare function getSchemaRefObjs(resolver: SchemaResolver, schema: OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject | undefined, schemaInfo: string): OpenAPIV3.ReferenceObject[];
|
|
4
|
-
export declare function getDeepSchemaRefObjs(resolver: SchemaResolver, schemaRefs: OpenAPIV3.ReferenceObject[]): string[];
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { OpenAPIV3 } from 'openapi-types';
|
|
2
|
-
export type OnSchemaCallbackData<TData> = {
|
|
3
|
-
data?: TData;
|
|
4
|
-
} & ({
|
|
5
|
-
type: "reference";
|
|
6
|
-
schema: OpenAPIV3.ReferenceObject;
|
|
7
|
-
} | {
|
|
8
|
-
type: "property";
|
|
9
|
-
parentSchema: OpenAPIV3.SchemaObject | OpenAPIV3.ReferenceObject;
|
|
10
|
-
schema: OpenAPIV3.SchemaObject | OpenAPIV3.ReferenceObject;
|
|
11
|
-
propertyName: string;
|
|
12
|
-
} | {
|
|
13
|
-
type: "composite" | "array" | "additionalProperties";
|
|
14
|
-
parentSchema: OpenAPIV3.SchemaObject | OpenAPIV3.ReferenceObject;
|
|
15
|
-
schema: OpenAPIV3.SchemaObject | OpenAPIV3.ReferenceObject;
|
|
16
|
-
});
|
|
17
|
-
type OnSchemaCallbackType<TData> = (data: OnSchemaCallbackData<TData>) => unknown;
|
|
18
|
-
export declare function iterateSchema<TData>(schema: OpenAPIV3.SchemaObject | OpenAPIV3.ReferenceObject | undefined, options: {
|
|
19
|
-
data?: TData;
|
|
20
|
-
onSchema: OnSchemaCallbackType<TData>;
|
|
21
|
-
}): void;
|
|
22
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { GenerateOptions } from '../types/options';
|
|
2
|
-
export declare function resolveConfig({ fileConfig, params: { excludeTags, ...options }, }: {
|
|
3
|
-
fileConfig?: Partial<GenerateOptions> | null;
|
|
4
|
-
params: Partial<Omit<GenerateOptions, "excludeTags"> & {
|
|
5
|
-
excludeTags: string;
|
|
6
|
-
}>;
|
|
7
|
-
}): GenerateOptions;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { OpenAPIV3 } from 'openapi-types';
|
|
2
|
-
import { SchemaResolver } from '../SchemaResolver.class';
|
|
3
|
-
import { WithRequired } from '../../types/common';
|
|
4
|
-
import { GenerateOptions } from '../../types/options';
|
|
5
|
-
export interface ZodSchemaMetaData {
|
|
6
|
-
isRequired?: boolean;
|
|
7
|
-
name?: string;
|
|
8
|
-
parent?: ZodSchema;
|
|
9
|
-
referencedBy?: ZodSchema[];
|
|
10
|
-
isParentPartial?: boolean;
|
|
11
|
-
}
|
|
12
|
-
export declare class ZodSchema {
|
|
13
|
-
schema: OpenAPIV3.SchemaObject | OpenAPIV3.ReferenceObject;
|
|
14
|
-
resolver: SchemaResolver;
|
|
15
|
-
private code?;
|
|
16
|
-
ref?: string;
|
|
17
|
-
enumRef?: string;
|
|
18
|
-
children: ZodSchema[];
|
|
19
|
-
meta: WithRequired<ZodSchemaMetaData, "referencedBy">;
|
|
20
|
-
constructor(schema: OpenAPIV3.SchemaObject | OpenAPIV3.ReferenceObject, resolver: SchemaResolver, meta?: ZodSchemaMetaData, enumRef?: string);
|
|
21
|
-
getCodeString(tag?: string, options?: GenerateOptions): string;
|
|
22
|
-
get complexity(): number;
|
|
23
|
-
assign(code: string): this;
|
|
24
|
-
inherit(parent?: ZodSchema): this;
|
|
25
|
-
}
|
|
26
|
-
export declare function getParentRef(meta: ZodSchemaMetaData | undefined): string | undefined;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { OpenAPIV3 } from 'openapi-types';
|
|
2
|
-
import { SchemaResolver } from '../../SchemaResolver.class';
|
|
3
|
-
type SchemaInfo = {
|
|
4
|
-
schemaRef: string;
|
|
5
|
-
schemaInfo?: string;
|
|
6
|
-
} | {
|
|
7
|
-
schemaRef?: string;
|
|
8
|
-
schemaInfo: string;
|
|
9
|
-
};
|
|
10
|
-
export declare function updateExtractedEnumZodSchemaData({ schema, nameSegments, includeSelf, ...params }: {
|
|
11
|
-
resolver: SchemaResolver;
|
|
12
|
-
schema: OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject | undefined;
|
|
13
|
-
tags: string[];
|
|
14
|
-
nameSegments?: string[];
|
|
15
|
-
includeSelf?: boolean;
|
|
16
|
-
} & SchemaInfo): void;
|
|
17
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { OpenAPIV3 } from 'openapi-types';
|
|
2
|
-
import { GenerateOptions } from '../../types/options';
|
|
3
|
-
import { ZodSchemaMetaData } from './ZodSchema.class';
|
|
4
|
-
export declare function getZodChain({ schema, meta, options, }: {
|
|
5
|
-
schema: OpenAPIV3.SchemaObject;
|
|
6
|
-
meta?: ZodSchemaMetaData;
|
|
7
|
-
options: GenerateOptions;
|
|
8
|
-
}): string;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { OpenAPIV3 } from 'openapi-types';
|
|
2
|
-
import { SchemaResolver } from '../SchemaResolver.class';
|
|
3
|
-
import { ZodSchema, ZodSchemaMetaData } from './ZodSchema.class';
|
|
4
|
-
type GetZodSchemaParams = {
|
|
5
|
-
schema: OpenAPIV3.SchemaObject | OpenAPIV3.ReferenceObject;
|
|
6
|
-
resolver: SchemaResolver;
|
|
7
|
-
meta?: ZodSchemaMetaData;
|
|
8
|
-
tag: string;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#schemaObject
|
|
12
|
-
* @see https://github.com/colinhacks/zod
|
|
13
|
-
*/
|
|
14
|
-
export declare function getZodSchema({ schema, resolver, meta: inheritedMeta, tag }: GetZodSchemaParams): ZodSchema;
|
|
15
|
-
export declare function getEnumZodSchemaCode(schema: OpenAPIV3.SchemaObject): string;
|
|
16
|
-
export declare function getEnumZodSchemaCodeFromEnumNames(enumNames: string[]): string;
|
|
17
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { SchemaResolver } from '../SchemaResolver.class';
|
|
2
|
-
import { ZodSchema } from './ZodSchema.class';
|
|
3
|
-
export declare function getZodSchemaRefs(resolver: SchemaResolver, zodSchemaName: string): string[];
|
|
4
|
-
export declare function getSchemaRefs(zodSchema: ZodSchema, { skipObjectSchema }?: {
|
|
5
|
-
skipObjectSchema?: boolean;
|
|
6
|
-
}): Set<string>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { EnumZodSchemaData, SchemaResolver } from '../SchemaResolver.class';
|
|
2
|
-
export declare function getZodSchemasFromOpenAPIDoc(resolver: SchemaResolver): {
|
|
3
|
-
zodSchemas: Record<string, string>;
|
|
4
|
-
enumZodSchemas: Record<string, string>;
|
|
5
|
-
};
|
|
6
|
-
export declare function getEnumZodSchemasFromOpenAPIDoc(resolver: SchemaResolver): EnumZodSchemaData[];
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { OpenAPIV3 } from 'openapi-types';
|
|
2
|
-
import { SchemaResolver } from '../SchemaResolver.class';
|
|
3
|
-
import { ZodSchema } from './ZodSchema.class';
|
|
4
|
-
export declare function resolveZodSchemaName({ schema, zodSchema, fallbackName, resolver, tag, }: {
|
|
5
|
-
schema?: OpenAPIV3.SchemaObject;
|
|
6
|
-
zodSchema: ZodSchema;
|
|
7
|
-
fallbackName?: string;
|
|
8
|
-
resolver: SchemaResolver;
|
|
9
|
-
tag: string;
|
|
10
|
-
}): string;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { OpenAPIV3 } from 'openapi-types';
|
|
2
|
-
import { GenerateFileData } from './types/generate';
|
|
3
|
-
import { GenerateOptions } from './types/options';
|
|
4
|
-
export declare function generateCodeFromOpenAPIDoc(openApiDoc: OpenAPIV3.Document, options: GenerateOptions): GenerateFileData[];
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
export interface DynamicInputsConfig {
|
|
2
|
-
schema: string;
|
|
3
|
-
options: {
|
|
4
|
-
inputs: Record<string, boolean>;
|
|
5
|
-
};
|
|
6
|
-
}
|
|
7
|
-
export interface DynamicColumnsConfig {
|
|
8
|
-
schema: string;
|
|
9
|
-
options: {
|
|
10
|
-
columns: Record<string, boolean>;
|
|
11
|
-
sortable?: string;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
export interface BuilderConfig {
|
|
15
|
-
name: string;
|
|
16
|
-
title: string;
|
|
17
|
-
readAll: {
|
|
18
|
-
acl?: string;
|
|
19
|
-
paginated: string;
|
|
20
|
-
infinite?: string;
|
|
21
|
-
filters?: DynamicInputsConfig;
|
|
22
|
-
columns: DynamicColumnsConfig;
|
|
23
|
-
};
|
|
24
|
-
read?: {
|
|
25
|
-
acl?: string;
|
|
26
|
-
schema: string;
|
|
27
|
-
query: string;
|
|
28
|
-
};
|
|
29
|
-
create?: {
|
|
30
|
-
acl?: string;
|
|
31
|
-
mutation: string;
|
|
32
|
-
inputDefs?: DynamicInputsConfig;
|
|
33
|
-
};
|
|
34
|
-
update?: {
|
|
35
|
-
acl?: string;
|
|
36
|
-
mutation: string;
|
|
37
|
-
inputDefs?: DynamicInputsConfig;
|
|
38
|
-
};
|
|
39
|
-
delete?: {
|
|
40
|
-
acl?: string;
|
|
41
|
-
mutation: string;
|
|
42
|
-
};
|
|
43
|
-
bulkDelete?: {
|
|
44
|
-
acl?: string;
|
|
45
|
-
mutation: string;
|
|
46
|
-
inputDefs?: DynamicInputsConfig;
|
|
47
|
-
};
|
|
48
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export type ObjectLiteral<T = any> = Record<string, T>;
|
|
2
|
-
export type List<A = any> = ReadonlyArray<A>;
|
|
3
|
-
export type Length<L extends List> = L["length"];
|
|
4
|
-
/**
|
|
5
|
-
Represents an array of strings split using a given character or character set.
|
|
6
|
-
|
|
7
|
-
Use-case: Defining the return type of a method like `String.prototype.split`.
|
|
8
|
-
|
|
9
|
-
@example
|
|
10
|
-
```
|
|
11
|
-
declare function split<S extends string, D extends string>(string: S, separator: D): Split<S, D>;
|
|
12
|
-
|
|
13
|
-
type Item = 'foo' | 'bar' | 'baz' | 'waldo';
|
|
14
|
-
const items = 'foo,bar,baz,waldo';
|
|
15
|
-
let array: Item[];
|
|
16
|
-
|
|
17
|
-
array = split(items, ',');
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
@category String
|
|
21
|
-
@category Template literal
|
|
22
|
-
*/
|
|
23
|
-
export type Split<S extends string, Delimiter extends string> = S extends `${infer Head}${Delimiter}${infer Tail}` ? [Head, ...Split<Tail, Delimiter>] : S extends Delimiter ? [] : [S];
|
|
24
|
-
export type HasNestedPath<Path extends string> = Length<Split<Path, ".">> extends 1 ? false : true;
|
|
25
|
-
export type WithRequired<T, K extends keyof T> = T & {
|
|
26
|
-
[P in K]-?: T[P];
|
|
27
|
-
};
|