@povio/openapi-codegen-cli 2.0.2 → 2.0.3-rc.2
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/dist/acl.d.ts +4 -4
- package/dist/acl.mjs +8 -0
- package/dist/commands/check.command.d.ts +1 -1
- package/dist/commands/check.d.ts +1 -1
- package/dist/commands/generate.command.d.ts +1 -1
- package/dist/commands/generate.d.ts +1 -1
- package/dist/generator.d.ts +3 -3
- package/dist/generators/checkOpenAPIDoc.d.ts +3 -3
- package/dist/generators/const/acl.const.d.ts +1 -1
- package/dist/generators/const/deps.const.d.ts +1 -1
- package/dist/generators/const/endpoints.const.d.ts +1 -1
- package/dist/generators/const/openapi.const.d.ts +1 -1
- package/dist/generators/const/options.const.d.ts +1 -1
- package/dist/generators/const/queries.const.d.ts +1 -1
- package/dist/generators/const/validation.const.d.ts +1 -1
- package/dist/generators/const/zod.const.d.ts +1 -1
- package/dist/generators/core/SchemaResolver.class.d.ts +6 -6
- package/dist/generators/core/endpoints/getEndpointAcl.d.ts +3 -3
- package/dist/generators/core/endpoints/getEndpointBody.d.ts +3 -3
- package/dist/generators/core/endpoints/getEndpointParameter.d.ts +4 -4
- package/dist/generators/core/endpoints/getEndpointsFromOpenAPIDoc.d.ts +2 -2
- package/dist/generators/core/getDataFromOpenAPIDoc.d.ts +4 -4
- package/dist/generators/core/getMetadataFromOpenAPIDoc.d.ts +3 -3
- package/dist/generators/core/openapi/getOpenAPISchemaComplexity.d.ts +1 -1
- package/dist/generators/core/openapi/getOpenAPISchemaDependencyGraph.d.ts +1 -1
- package/dist/generators/core/openapi/getSchemaRefObjs.d.ts +2 -2
- package/dist/generators/core/openapi/iterateSchema.d.ts +1 -1
- package/dist/generators/core/resolveConfig.d.ts +1 -1
- package/dist/generators/core/zod/ZodSchema.class.d.ts +4 -4
- package/dist/generators/core/zod/enumExtraction/resolveExtractedEnumZodSchemaNames.d.ts +1 -1
- package/dist/generators/core/zod/enumExtraction/resolveExtractedEnumZodSchemaTags.d.ts +1 -1
- package/dist/generators/core/zod/enumExtraction/updateExtractedEnumZodSchemaData.d.ts +2 -2
- package/dist/generators/core/zod/getZodChain.d.ts +3 -3
- package/dist/generators/core/zod/getZodSchema.d.ts +3 -3
- package/dist/generators/core/zod/getZodSchemaRefs.d.ts +2 -2
- package/dist/generators/core/zod/getZodSchemasFromOpenAPIDoc.d.ts +1 -1
- package/dist/generators/core/zod/resolveZodSchemaName.d.ts +3 -3
- package/dist/generators/core/zod/sortZodSchemasByTopology.d.ts +1 -1
- package/dist/generators/generate/generateAcl.d.ts +1 -1
- package/dist/generators/generate/generateAclCheck.d.ts +1 -1
- package/dist/generators/generate/generateAppRestClient.d.ts +1 -1
- package/dist/generators/generate/generateConfigs.d.ts +1 -1
- package/dist/generators/generate/generateEndpoints.d.ts +1 -1
- package/dist/generators/generate/generateModels.d.ts +1 -1
- package/dist/generators/generate/generateQueries.d.ts +1 -1
- package/dist/generators/generate/generateQueryModules.d.ts +1 -1
- package/dist/generators/generate/generateZodExtended.d.ts +1 -1
- package/dist/generators/generateCodeFromOpenAPIDoc.d.ts +3 -3
- package/dist/generators/types/config.d.ts +1 -1
- package/dist/generators/types/endpoint.d.ts +2 -2
- package/dist/generators/types/generate.d.ts +3 -3
- package/dist/generators/types/metadata.d.ts +2 -2
- package/dist/generators/types/openapi.d.ts +1 -1
- package/dist/generators/types/options.d.ts +1 -1
- package/dist/generators/utils/endpoint.utils.d.ts +2 -2
- package/dist/generators/utils/file.utils.d.ts +1 -1
- package/dist/generators/utils/generate/generate.acl.utils.d.ts +4 -4
- package/dist/generators/utils/generate/generate.configs.utils.d.ts +5 -5
- package/dist/generators/utils/generate/generate.endpoints.utils.d.ts +7 -7
- package/dist/generators/utils/generate/generate.imports.utils.d.ts +4 -4
- package/dist/generators/utils/generate/generate.openapi.utils.d.ts +1 -1
- package/dist/generators/utils/generate/generate.query.utils.d.ts +2 -2
- package/dist/generators/utils/generate/generate.utils.d.ts +2 -2
- package/dist/generators/utils/generate/generate.zod.utils.d.ts +4 -4
- package/dist/generators/utils/generate-files.utils.d.ts +2 -2
- package/dist/generators/utils/hbs/hbs-template.utils.d.ts +1 -1
- package/dist/generators/utils/hbs/hbs.acl.utils.d.ts +1 -1
- package/dist/generators/utils/hbs/hbs.endpoints.utils.d.ts +1 -1
- package/dist/generators/utils/hbs/hbs.partials.utils.d.ts +1 -1
- package/dist/generators/utils/hbs/hbs.query.utils.d.ts +1 -1
- package/dist/generators/utils/hbs/hbs.zod.utils.d.ts +1 -1
- package/dist/generators/utils/namespace.utils.d.ts +2 -2
- package/dist/generators/utils/object.utils.d.ts +2 -2
- package/dist/generators/utils/openapi-schema.utils.d.ts +1 -1
- package/dist/generators/utils/openapi.utils.d.ts +2 -2
- package/dist/generators/utils/operation.utils.d.ts +3 -3
- package/dist/generators/utils/query.utils.d.ts +3 -3
- package/dist/generators/utils/sort.utils.d.ts +1 -1
- package/dist/generators/utils/tag.utils.d.ts +3 -3
- package/dist/generators/utils/ts.utils.d.ts +4 -4
- package/dist/generators/utils/validation.utils.d.ts +4 -4
- package/dist/helpers/config.helper.d.ts +1 -1
- package/dist/helpers/yargs.helper.d.ts +1 -2
- package/dist/index.d.ts +14 -16
- package/dist/index.mjs +23 -0
- package/dist/lib/acl/AclGuard.d.ts +3 -3
- package/dist/lib/acl/AclGuard.mjs +14 -0
- package/dist/lib/acl/Can.d.ts +3 -3
- package/dist/lib/acl/Can.mjs +11 -0
- package/dist/lib/acl/ability.context.d.ts +4 -4
- package/dist/lib/acl/ability.context.mjs +37 -0
- package/dist/lib/acl/appAbility.types.d.ts +1 -1
- package/dist/lib/assets/locales/en/translation.json.mjs +8 -0
- package/dist/lib/assets/locales/sl/translation.json.mjs +8 -0
- package/dist/lib/auth/AuthGuard.d.ts +2 -2
- package/dist/lib/auth/AuthGuard.mjs +26 -0
- package/dist/lib/auth/auth.context.d.ts +1 -1
- package/dist/lib/auth/auth.context.mjs +41 -0
- package/dist/lib/config/i18n.d.ts +1 -1
- package/dist/lib/config/i18n.mjs +31 -0
- package/dist/lib/config/queryConfig.context.mjs +17 -0
- package/dist/lib/config/router.context.d.ts +1 -1
- package/dist/lib/config/router.context.mjs +20 -0
- package/dist/lib/react-query.types.d.ts +2 -2
- package/dist/lib/rest/error-handling.d.ts +1 -1
- package/dist/lib/rest/error-handling.mjs +129 -0
- package/dist/lib/rest/rest-client.d.ts +4 -4
- package/dist/lib/rest/rest-client.mjs +62 -0
- package/dist/lib/rest/rest-client.types.d.ts +4 -4
- package/dist/lib/rest/rest-interceptor.d.ts +1 -1
- package/dist/lib/rest/rest-interceptor.mjs +21 -0
- package/dist/lib/rest/rest.utils.d.ts +1 -1
- package/dist/lib/rest/rest.utils.mjs +51 -0
- package/dist/sh.js +178 -182
- package/package.json +12 -9
- package/dist/acl.js +0 -1
- package/dist/helpers/chalk.helper.d.ts +0 -1
- package/dist/index.js +0 -3
- package/dist/tsconfig.tsbuildinfo +0 -1
package/dist/acl.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AbilityContext } from
|
|
2
|
-
export { createAclGuard } from
|
|
3
|
-
export { Can } from
|
|
4
|
-
export type { AppAbilities, AppAbility } from
|
|
1
|
+
export { AbilityContext } from './lib/acl/ability.context';
|
|
2
|
+
export { createAclGuard } from './lib/acl/AclGuard';
|
|
3
|
+
export { Can } from './lib/acl/Can';
|
|
4
|
+
export type { AppAbilities, AppAbility } from './lib/acl/appAbility.types';
|
package/dist/acl.mjs
ADDED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import yargs from
|
|
1
|
+
import { default as yargs } from 'yargs';
|
|
2
2
|
export declare const command: yargs.CommandModule;
|
package/dist/commands/check.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import yargs from
|
|
1
|
+
import { default as yargs } from 'yargs';
|
|
2
2
|
export declare const command: yargs.CommandModule;
|
package/dist/generator.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { GenerateParams } from
|
|
2
|
-
export declare function getGenerateMetadata({ input, options: genOptions }: GenerateParams): Promise<import(
|
|
3
|
-
export declare function getGenerateFilesData({ input, options: genOptions }: GenerateParams): Promise<import(
|
|
1
|
+
import { GenerateParams } from './generators/types/metadata';
|
|
2
|
+
export declare function getGenerateMetadata({ input, options: genOptions }: GenerateParams): Promise<import('./generators/types/metadata').GenerateMetadata>;
|
|
3
|
+
export declare function getGenerateFilesData({ input, options: genOptions }: GenerateParams): Promise<import('./generators/types/generate').GenerateFileData[]>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { OpenAPIV3 } from
|
|
2
|
-
import { GenerateOptions } from
|
|
3
|
-
export declare function checkOpenAPIDoc(openApiDoc: OpenAPIV3.Document, options: GenerateOptions): import(
|
|
1
|
+
import { OpenAPIV3 } from 'openapi-types';
|
|
2
|
+
import { GenerateOptions } from './types/options';
|
|
3
|
+
export declare function checkOpenAPIDoc(openApiDoc: OpenAPIV3.Document, options: GenerateOptions): import('./types/validation').ValidationError[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GenerateFile, Import } from
|
|
1
|
+
import { GenerateFile, Import } from '../types/generate';
|
|
2
2
|
export declare const ACL_APP_ABILITY_FILE: GenerateFile;
|
|
3
3
|
export declare const ACL_APP_ABILITIES = "AppAbilities";
|
|
4
4
|
export declare const ACL_CHECK_FILE: GenerateFile;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GenerateFile, Import } from
|
|
1
|
+
import { GenerateFile, Import } from '../types/generate';
|
|
2
2
|
export declare const APP_REST_CLIENT_NAME = "AppRestClient";
|
|
3
3
|
export declare const APP_REST_CLIENT_FILE: GenerateFile;
|
|
4
4
|
export declare const QUERY_OPTIONS_TYPES: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OpenAPIV3 } from
|
|
1
|
+
import { OpenAPIV3 } from 'openapi-types';
|
|
2
2
|
export declare const COMPLEXITY_THRESHOLD = 2;
|
|
3
3
|
export declare const ALLOWED_PARAM_MEDIA_TYPES: string[];
|
|
4
4
|
export declare const ALLOWED_PATH_IN: Array<OpenAPIV3.ParameterObject["in"]>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { GenerateOptions } from
|
|
1
|
+
import { GenerateOptions } from '../types/options';
|
|
2
2
|
export declare const DEFAULT_GENERATE_OPTIONS: GenerateOptions;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { OpenAPIV3 } from
|
|
2
|
-
import { OperationObject } from
|
|
3
|
-
import { GenerateOptions } from
|
|
4
|
-
import { ValidationError } from
|
|
5
|
-
import { DependencyGraph } from
|
|
6
|
-
import { ZodSchema } from
|
|
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
7
|
interface SchemaData {
|
|
8
8
|
ref: string;
|
|
9
9
|
name: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { SchemaResolver } from
|
|
2
|
-
import { Endpoint, EndpointAclInfo } from
|
|
3
|
-
import { OperationObject } from
|
|
1
|
+
import { SchemaResolver } from '../SchemaResolver.class';
|
|
2
|
+
import { Endpoint, EndpointAclInfo } from '../../types/endpoint';
|
|
3
|
+
import { OperationObject } from '../../types/openapi';
|
|
4
4
|
export declare function getEndpointAcl({ resolver, endpoint, operation, }: {
|
|
5
5
|
resolver: SchemaResolver;
|
|
6
6
|
endpoint: Endpoint;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { SchemaResolver } from
|
|
2
|
-
import { EndpointParameter } from
|
|
3
|
-
import { OperationObject } from
|
|
1
|
+
import { SchemaResolver } from '../SchemaResolver.class';
|
|
2
|
+
import { EndpointParameter } from '../../types/endpoint';
|
|
3
|
+
import { OperationObject } from '../../types/openapi';
|
|
4
4
|
export declare function getEndpointBody({ resolver, operation, operationName, isUniqueOperationName, tag, }: {
|
|
5
5
|
resolver: SchemaResolver;
|
|
6
6
|
operation: OperationObject;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { OpenAPIV3 } from
|
|
2
|
-
import { SchemaResolver } from
|
|
3
|
-
import { EndpointParameter } from
|
|
4
|
-
import { ParameterObject } from
|
|
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
5
|
export declare function getEndpointParameter({ resolver, param, operationName, isUniqueOperationName, tag, }: {
|
|
6
6
|
resolver: SchemaResolver;
|
|
7
7
|
param: OpenAPIV3.ReferenceObject | ParameterObject;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { SchemaResolver } from
|
|
2
|
-
import { Endpoint } from
|
|
1
|
+
import { SchemaResolver } from '../SchemaResolver.class';
|
|
2
|
+
import { Endpoint } from '../../types/endpoint';
|
|
3
3
|
export declare function getEndpointsFromOpenAPIDoc(resolver: SchemaResolver): Endpoint[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { OpenAPIV3 } from
|
|
2
|
-
import { GenerateData } from
|
|
3
|
-
import { GenerateOptions } from
|
|
4
|
-
import { SchemaResolver } from
|
|
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
5
|
export declare function getDataFromOpenAPIDoc(openApiDoc: OpenAPIV3.Document, options: GenerateOptions): {
|
|
6
6
|
resolver: SchemaResolver;
|
|
7
7
|
data: GenerateData;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OpenAPIV3 } from
|
|
2
|
-
import { GenerateMetadata } from
|
|
3
|
-
import { GenerateOptions } from
|
|
1
|
+
import { OpenAPIV3 } from 'openapi-types';
|
|
2
|
+
import { GenerateMetadata } from '../types/metadata';
|
|
3
|
+
import { GenerateOptions } from '../types/options';
|
|
4
4
|
export declare function getMetadataFromOpenAPIDoc(openApiDoc: OpenAPIV3.Document, options: GenerateOptions): Promise<GenerateMetadata>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { OpenAPIV3 } from
|
|
1
|
+
import { OpenAPIV3 } from 'openapi-types';
|
|
2
2
|
export declare function getOpenAPISchemaComplexity(current: number, schema?: OpenAPIV3.SchemaObject | OpenAPIV3.ReferenceObject): number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OpenAPIV3 } from
|
|
2
|
-
import { SchemaResolver } from
|
|
1
|
+
import { OpenAPIV3 } from 'openapi-types';
|
|
2
|
+
import { SchemaResolver } from '../SchemaResolver.class';
|
|
3
3
|
export declare function getSchemaRefObjs(resolver: SchemaResolver, schema: OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject | undefined, schemaInfo: string): OpenAPIV3.ReferenceObject[];
|
|
4
4
|
export declare function getDeepSchemaRefObjs(resolver: SchemaResolver, schemaRefs: OpenAPIV3.ReferenceObject[]): string[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GenerateOptions } from
|
|
1
|
+
import { GenerateOptions } from '../types/options';
|
|
2
2
|
export declare function resolveConfig({ fileConfig, params: { excludeTags, ...options }, }: {
|
|
3
3
|
fileConfig?: Partial<GenerateOptions> | null;
|
|
4
4
|
params: Partial<Omit<GenerateOptions, "excludeTags"> & {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { OpenAPIV3 } from
|
|
2
|
-
import { SchemaResolver } from
|
|
3
|
-
import { WithRequired } from
|
|
4
|
-
import { GenerateOptions } from
|
|
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
5
|
export interface ZodSchemaMetaData {
|
|
6
6
|
isRequired?: boolean;
|
|
7
7
|
name?: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { SchemaResolver } from
|
|
1
|
+
import { SchemaResolver } from '../../SchemaResolver.class';
|
|
2
2
|
export declare function resolveExtractedEnumZodSchemaNames(resolver: SchemaResolver): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { SchemaResolver } from
|
|
1
|
+
import { SchemaResolver } from '../../SchemaResolver.class';
|
|
2
2
|
export declare function resolveExtractedEnumZodSchemaTags(resolver: SchemaResolver): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OpenAPIV3 } from
|
|
2
|
-
import { SchemaResolver } from
|
|
1
|
+
import { OpenAPIV3 } from 'openapi-types';
|
|
2
|
+
import { SchemaResolver } from '../../SchemaResolver.class';
|
|
3
3
|
type SchemaInfo = {
|
|
4
4
|
schemaRef: string;
|
|
5
5
|
schemaInfo?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { OpenAPIV3 } from
|
|
2
|
-
import { GenerateOptions } from
|
|
3
|
-
import { ZodSchemaMetaData } from
|
|
1
|
+
import { OpenAPIV3 } from 'openapi-types';
|
|
2
|
+
import { GenerateOptions } from '../../types/options';
|
|
3
|
+
import { ZodSchemaMetaData } from './ZodSchema.class';
|
|
4
4
|
export declare function getZodChain({ schema, meta, options, }: {
|
|
5
5
|
schema: OpenAPIV3.SchemaObject;
|
|
6
6
|
meta?: ZodSchemaMetaData;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { OpenAPIV3 } from
|
|
2
|
-
import { SchemaResolver } from
|
|
3
|
-
import { ZodSchema, ZodSchemaMetaData } from
|
|
1
|
+
import { OpenAPIV3 } from 'openapi-types';
|
|
2
|
+
import { SchemaResolver } from '../SchemaResolver.class';
|
|
3
|
+
import { ZodSchema, ZodSchemaMetaData } from './ZodSchema.class';
|
|
4
4
|
type GetZodSchemaParams = {
|
|
5
5
|
schema: OpenAPIV3.SchemaObject | OpenAPIV3.ReferenceObject;
|
|
6
6
|
resolver: SchemaResolver;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SchemaResolver } from
|
|
2
|
-
import { ZodSchema } from
|
|
1
|
+
import { SchemaResolver } from '../SchemaResolver.class';
|
|
2
|
+
import { ZodSchema } from './ZodSchema.class';
|
|
3
3
|
export declare function getZodSchemaRefs(resolver: SchemaResolver, zodSchemaName: string): string[];
|
|
4
4
|
export declare function getSchemaRefs(zodSchema: ZodSchema, { skipObjectSchema }?: {
|
|
5
5
|
skipObjectSchema?: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EnumZodSchemaData, SchemaResolver } from
|
|
1
|
+
import { EnumZodSchemaData, SchemaResolver } from '../SchemaResolver.class';
|
|
2
2
|
export declare function getZodSchemasFromOpenAPIDoc(resolver: SchemaResolver): {
|
|
3
3
|
zodSchemas: Record<string, string>;
|
|
4
4
|
enumZodSchemas: Record<string, string>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { OpenAPIV3 } from
|
|
2
|
-
import { SchemaResolver } from
|
|
3
|
-
import { ZodSchema } from
|
|
1
|
+
import { OpenAPIV3 } from 'openapi-types';
|
|
2
|
+
import { SchemaResolver } from '../SchemaResolver.class';
|
|
3
|
+
import { ZodSchema } from './ZodSchema.class';
|
|
4
4
|
export declare function resolveZodSchemaName({ schema, zodSchema, fallbackName, resolver, tag, }: {
|
|
5
5
|
schema?: OpenAPIV3.SchemaObject;
|
|
6
6
|
zodSchema: ZodSchema;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SchemaResolver } from
|
|
1
|
+
import { SchemaResolver } from '../SchemaResolver.class';
|
|
2
2
|
export declare function sortZodSchemasByTopology(resolver: SchemaResolver, zodSchemas: Record<string, string>): {
|
|
3
3
|
[k: string]: string;
|
|
4
4
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { GenerateTypeParams } from
|
|
1
|
+
import { GenerateTypeParams } from '../types/generate';
|
|
2
2
|
export declare function generateAcl({ resolver, data, tag }: GenerateTypeParams): string | undefined;
|
|
3
3
|
export declare function generateAppAcl({ resolver, data }: Omit<GenerateTypeParams, "tag">): string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { SchemaResolver } from
|
|
1
|
+
import { SchemaResolver } from '../core/SchemaResolver.class';
|
|
2
2
|
export declare function generateAclCheck(resolver: SchemaResolver): string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { SchemaResolver } from
|
|
1
|
+
import { SchemaResolver } from '../core/SchemaResolver.class';
|
|
2
2
|
export declare function generateAppRestClient(resolver: SchemaResolver): string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { GenerateTypeParams } from
|
|
1
|
+
import { GenerateTypeParams } from '../types/generate';
|
|
2
2
|
export declare function generateConfigs(generateTypeParams: GenerateTypeParams): string | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { GenerateTypeParams } from
|
|
1
|
+
import { GenerateTypeParams } from '../types/generate';
|
|
2
2
|
export declare function generateEndpoints({ resolver, data, tag }: GenerateTypeParams): string | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { GenerateTypeParams } from
|
|
1
|
+
import { GenerateTypeParams } from '../types/generate';
|
|
2
2
|
export declare function generateModels({ resolver, data, tag }: GenerateTypeParams): string | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { GenerateTypeParams } from
|
|
1
|
+
import { GenerateTypeParams } from '../types/generate';
|
|
2
2
|
export declare function generateQueries({ resolver, data, tag }: GenerateTypeParams): string | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { GenerateTypeParams } from
|
|
1
|
+
import { GenerateTypeParams } from '../types/generate';
|
|
2
2
|
export declare function generateQueryModules({ resolver, data }: Omit<GenerateTypeParams, "tag">): string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { SchemaResolver } from
|
|
1
|
+
import { SchemaResolver } from '../core/SchemaResolver.class';
|
|
2
2
|
export declare function generateZodExtended(resolver: SchemaResolver): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OpenAPIV3 } from
|
|
2
|
-
import { GenerateFileData } from
|
|
3
|
-
import { GenerateOptions } from
|
|
1
|
+
import { OpenAPIV3 } from 'openapi-types';
|
|
2
|
+
import { GenerateFileData } from './types/generate';
|
|
3
|
+
import { GenerateOptions } from './types/options';
|
|
4
4
|
export declare function generateCodeFromOpenAPIDoc(openApiDoc: OpenAPIV3.Document, options: GenerateOptions): GenerateFileData[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { GenerateOptions } from
|
|
1
|
+
import { GenerateOptions } from './options';
|
|
2
2
|
export type OpenAPICodegenConfig = Partial<GenerateOptions>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OpenAPIV3 } from
|
|
2
|
-
import { OperationAclInfo, ParameterObject } from
|
|
1
|
+
import { OpenAPIV3 } from 'openapi-types';
|
|
2
|
+
import { OperationAclInfo, ParameterObject } from './openapi';
|
|
3
3
|
export interface EndpointParameter {
|
|
4
4
|
name: string;
|
|
5
5
|
description?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { OpenAPIV3 } from
|
|
2
|
-
import { SchemaResolver } from
|
|
3
|
-
import { Endpoint } from
|
|
1
|
+
import { OpenAPIV3 } from 'openapi-types';
|
|
2
|
+
import { SchemaResolver } from '../core/SchemaResolver.class';
|
|
3
|
+
import { Endpoint } from './endpoint';
|
|
4
4
|
export interface Import {
|
|
5
5
|
defaultImport?: string;
|
|
6
6
|
bindings: string[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OpenAPIV3 } from
|
|
2
|
-
import { GenerateOptions } from
|
|
1
|
+
import { OpenAPIV3 } from 'openapi-types';
|
|
2
|
+
import { GenerateOptions } from './options';
|
|
3
3
|
export interface GenerateParams {
|
|
4
4
|
input: string;
|
|
5
5
|
options?: Partial<GenerateOptions>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OpenAPIV3 } from
|
|
1
|
+
import { OpenAPIV3 } from 'openapi-types';
|
|
2
2
|
export type CompositeType = "oneOf" | "anyOf" | "allOf" | "enum" | "array" | "empty-object" | "object" | "record";
|
|
3
3
|
export type SingleType = Exclude<OpenAPIV3.SchemaObject["type"], any[] | undefined>;
|
|
4
4
|
export type PrimitiveType = "string" | "number" | "integer" | "boolean";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Endpoint, ExtendedEndpoint } from
|
|
2
|
-
import { GenerateOptions } from
|
|
1
|
+
import { Endpoint, ExtendedEndpoint } from '../types/endpoint';
|
|
2
|
+
import { GenerateOptions } from '../types/options';
|
|
3
3
|
export declare const isGetEndpoint: (endpoint: Endpoint) => boolean;
|
|
4
4
|
export declare const isPaginatedGetEndpoint: (endpoint: Endpoint, options: GenerateOptions) => boolean;
|
|
5
5
|
export declare const isReadAllEndpoint: (endpoint: ExtendedEndpoint, options: GenerateOptions) => boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GenerateFileData } from
|
|
1
|
+
import { GenerateFileData } from '../types/generate';
|
|
2
2
|
export declare function readHbsTemplateSync(fileName: string): string;
|
|
3
3
|
export declare function readAssetSync(fileName: string): string;
|
|
4
4
|
export declare function getOutputFileName({ output, fileName }: {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Endpoint } from
|
|
2
|
-
import { GenerateTypeParams, Import } from
|
|
3
|
-
import { GenerateOptions } from
|
|
1
|
+
import { Endpoint } from '../../types/endpoint';
|
|
2
|
+
import { GenerateTypeParams, Import } from '../../types/generate';
|
|
3
|
+
import { GenerateOptions } from '../../types/options';
|
|
4
4
|
export declare const getAbilityFunctionName: (endpoint: Endpoint) => string;
|
|
5
5
|
export declare const getImportedAbilityFunctionName: (endpoint: Endpoint, options: GenerateOptions) => string;
|
|
6
6
|
export declare const getAbilityAction: (endpoint: Endpoint) => string | undefined;
|
|
7
7
|
export declare const getAbilitySubject: (endpoint: Endpoint) => string | undefined;
|
|
8
8
|
export declare const hasAbilityConditions: (endpoint: Endpoint) => boolean;
|
|
9
|
-
export declare const getAbilityConditionsTypes: (endpoint: Endpoint) => import(
|
|
9
|
+
export declare const getAbilityConditionsTypes: (endpoint: Endpoint) => import('../../types/endpoint').AclConditionsPropertyType[] | undefined;
|
|
10
10
|
export declare const getAbilityDescription: (endpoint: Endpoint) => string | undefined;
|
|
11
11
|
export declare const getAbilitySubjectTypes: (endpoint: Endpoint) => string[];
|
|
12
12
|
export declare function getAclData({ resolver, data, tag }: GenerateTypeParams): {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BuilderConfig } from
|
|
2
|
-
import { GenerateTypeParams } from
|
|
1
|
+
import { BuilderConfig } from '../../types/builder-config';
|
|
2
|
+
import { GenerateTypeParams } from '../../types/generate';
|
|
3
3
|
export declare function getBuilderConfigs({ data, tag, resolver }: GenerateTypeParams): {
|
|
4
4
|
configs: never[];
|
|
5
5
|
hasZodImport?: undefined;
|
|
@@ -9,7 +9,7 @@ export declare function getBuilderConfigs({ data, tag, resolver }: GenerateTypeP
|
|
|
9
9
|
} | {
|
|
10
10
|
configs: BuilderConfig[];
|
|
11
11
|
hasZodImport: boolean;
|
|
12
|
-
modelsImports: import(
|
|
13
|
-
queriesImports: import(
|
|
14
|
-
aclImports: import(
|
|
12
|
+
modelsImports: import('../../types/generate').Import[];
|
|
13
|
+
queriesImports: import('../../types/generate').Import[];
|
|
14
|
+
aclImports: import('../../types/generate').Import[];
|
|
15
15
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { OpenAPIV3 } from
|
|
2
|
-
import { SchemaResolver } from
|
|
3
|
-
import { Endpoint } from
|
|
4
|
-
import { GenerateOptions } from
|
|
1
|
+
import { OpenAPIV3 } from 'openapi-types';
|
|
2
|
+
import { SchemaResolver } from '../../core/SchemaResolver.class';
|
|
3
|
+
import { Endpoint } from '../../types/endpoint';
|
|
4
|
+
import { GenerateOptions } from '../../types/options';
|
|
5
5
|
export declare const getEndpointName: (endpoint: Endpoint) => string;
|
|
6
6
|
export declare function getImportedEndpointName(endpoint: Endpoint, options: GenerateOptions): string;
|
|
7
7
|
export declare const requiresBody: (endpoint: Endpoint) => boolean;
|
|
8
|
-
export declare const getEndpointBody: (endpoint: Endpoint) => import(
|
|
8
|
+
export declare const getEndpointBody: (endpoint: Endpoint) => import('../../types/endpoint').EndpointParameter | undefined;
|
|
9
9
|
export declare const hasEndpointConfig: (endpoint: Endpoint, resolver: SchemaResolver) => boolean | undefined;
|
|
10
10
|
export declare const getEndpointPath: (endpoint: Endpoint) => string;
|
|
11
11
|
export declare function mapEndpointParamsToFunctionParams(resolver: SchemaResolver, endpoint: Endpoint, options?: {
|
|
@@ -20,7 +20,7 @@ export declare function mapEndpointParamsToFunctionParams(resolver: SchemaResolv
|
|
|
20
20
|
required: boolean;
|
|
21
21
|
type: string;
|
|
22
22
|
paramType: "Query" | "Body" | "Header" | "Path";
|
|
23
|
-
parameterObject: import(
|
|
23
|
+
parameterObject: import('../../types/openapi').ParameterObject | undefined;
|
|
24
24
|
bodyObject: OpenAPIV3.RequestBodyObject | undefined;
|
|
25
25
|
}[];
|
|
26
26
|
export declare function getEndpointConfig(endpoint: Endpoint): {
|
|
@@ -31,7 +31,7 @@ export declare function getEndpointConfig(endpoint: Endpoint): {
|
|
|
31
31
|
description?: string;
|
|
32
32
|
type: "Query" | "Body" | "Header" | "Path";
|
|
33
33
|
zodSchema: string;
|
|
34
|
-
parameterObject?: import(
|
|
34
|
+
parameterObject?: import('../../types/openapi').ParameterObject;
|
|
35
35
|
parameterSortingEnumSchemaName?: string;
|
|
36
36
|
bodyObject?: OpenAPIV3.RequestBodyObject;
|
|
37
37
|
}[] | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { SchemaResolver } from
|
|
2
|
-
import { Endpoint } from
|
|
3
|
-
import { GenerateType, Import } from
|
|
4
|
-
import { GenerateOptions } from
|
|
1
|
+
import { SchemaResolver } from '../../core/SchemaResolver.class';
|
|
2
|
+
import { Endpoint } from '../../types/endpoint';
|
|
3
|
+
import { GenerateType, Import } from '../../types/generate';
|
|
4
|
+
import { GenerateOptions } from '../../types/options';
|
|
5
5
|
export declare function getModelsImports({ resolver, tag, zodSchemas, zodSchemasAsTypes, }: {
|
|
6
6
|
resolver: SchemaResolver;
|
|
7
7
|
tag: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { OpenAPIV3 } from
|
|
1
|
+
import { OpenAPIV3 } from 'openapi-types';
|
|
2
2
|
export declare function getSchemaDescriptions(schemaObj: OpenAPIV3.SchemaObject): string[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Endpoint } from
|
|
2
|
-
import { GenerateOptions } from
|
|
1
|
+
import { Endpoint } from '../../types/endpoint';
|
|
2
|
+
import { GenerateOptions } from '../../types/options';
|
|
3
3
|
export declare const getQueryName: (endpoint: Endpoint, mutation?: boolean) => string;
|
|
4
4
|
export declare const getInfiniteQueryName: (endpoint: Endpoint) => string;
|
|
5
5
|
export declare const getImportedQueryName: (endpoint: Endpoint, options: GenerateOptions) => string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { GenerateFile, GenerateType } from
|
|
2
|
-
import { GenerateOptions } from
|
|
1
|
+
import { GenerateFile, GenerateType } from '../../types/generate';
|
|
2
|
+
import { GenerateOptions } from '../../types/options';
|
|
3
3
|
export declare function getFileNameWithExtension({ fileName, extension }: GenerateFile): string;
|
|
4
4
|
declare function getTagFileNameWithoutExtension({ type, tag, options, includeTagDir, }: {
|
|
5
5
|
type: GenerateType;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { OpenAPIV3 } from
|
|
2
|
-
import { SchemaResolver } from
|
|
3
|
-
import { GenerateZodSchemaData } from
|
|
4
|
-
import { GenerateOptions } from
|
|
1
|
+
import { OpenAPIV3 } from 'openapi-types';
|
|
2
|
+
import { SchemaResolver } from '../../core/SchemaResolver.class';
|
|
3
|
+
import { GenerateZodSchemaData } from '../../types/generate';
|
|
4
|
+
import { GenerateOptions } from '../../types/options';
|
|
5
5
|
export declare const getZodSchemaInferedTypeName: (zodSchemaName: string, options: GenerateOptions) => string;
|
|
6
6
|
export declare const getImportedZodSchemaName: (resolver: SchemaResolver, zodSchemaName: string) => string;
|
|
7
7
|
export declare const getImportedZodSchemaInferedTypeName: (resolver: SchemaResolver, zodSchemaName: string, currentTag?: string) => string;
|