@goast/core 0.3.5 → 0.3.7
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/esm/index.js +5 -5
- package/esm/lib/ast/index.js +1 -1
- package/esm/lib/codegen/config.js +2 -2
- package/esm/lib/codegen/endpoints-generator.js +2 -2
- package/esm/lib/codegen/generator.js +4 -4
- package/esm/lib/codegen/index.js +6 -6
- package/esm/lib/codegen/schemas-generator.js +3 -3
- package/esm/lib/codegen/services-generator.js +2 -2
- package/esm/lib/collect/collector.js +1 -1
- package/esm/lib/collect/helpers.js +1 -1
- package/esm/lib/collect/index.js +3 -3
- package/esm/lib/parse/deref-proxy.js +1 -1
- package/esm/lib/parse/index.js +3 -3
- package/esm/lib/parse/parser.js +5 -5
- package/esm/lib/parse/types.js +1 -1
- package/esm/lib/transform/helpers.js +3 -3
- package/esm/lib/transform/index.js +2 -2
- package/esm/lib/transform/transform-document.js +1 -1
- package/esm/lib/transform/transform-endpoint.js +3 -3
- package/esm/lib/transform/transform-schema.js +2 -2
- package/esm/lib/transform/transformer.js +5 -5
- package/esm/lib/utils/index.js +14 -14
- package/esm/lib/utils/schema.utils.js +1 -1
- package/esm/lib/utils/source-builder.js +4 -4
- package/esm/lib/utils/string-builder/index.js +3 -3
- package/esm/lib/utils/string-builder/string-builder.js +2 -2
- package/esm/lib/utils/string-builder/utils.js +1 -1
- package/esm/lib/utils/string.utils.js +1 -1
- package/package.json +6 -3
- package/types/lib/transform/api-types.d.ts +2 -2
package/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './lib/ast';
|
|
2
|
-
export * from './lib/codegen';
|
|
3
|
-
export * from './lib/parse';
|
|
4
|
-
export * from './lib/transform';
|
|
5
|
-
export * from './lib/utils';
|
|
1
|
+
export * from './lib/ast/index.js';
|
|
2
|
+
export * from './lib/codegen/index.js';
|
|
3
|
+
export * from './lib/parse/index.js';
|
|
4
|
+
export * from './lib/transform/index.js';
|
|
5
|
+
export * from './lib/utils/index.js';
|
package/esm/lib/ast/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './node';
|
|
1
|
+
export * from './node.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defaultOpenApiTransformerOptions } from '../transform/types';
|
|
2
|
-
import { defaultSourceBuilderOptions } from '../utils/source-builder';
|
|
1
|
+
import { defaultOpenApiTransformerOptions } from '../transform/types.js';
|
|
2
|
+
import { defaultSourceBuilderOptions } from '../utils/source-builder.js';
|
|
3
3
|
export const defaultOpenApiGeneratorConfig = {
|
|
4
4
|
...defaultSourceBuilderOptions,
|
|
5
5
|
...defaultOpenApiTransformerOptions,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OpenApiGenerationProviderBase } from './generator';
|
|
2
|
-
import { addSourceIfTest } from './internal-utils';
|
|
1
|
+
import { OpenApiGenerationProviderBase } from './generator.js';
|
|
2
|
+
import { addSourceIfTest } from './internal-utils.js';
|
|
3
3
|
export class OpenApiEndpointsGenerationProviderBase extends OpenApiGenerationProviderBase {
|
|
4
4
|
getProviderContext(context, config, defaultConfig) {
|
|
5
5
|
const ctx = super.getProviderContext(context, config, defaultConfig);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { resolve } from 'path';
|
|
2
2
|
import { emptyDir, ensureDir } from 'fs-extra';
|
|
3
|
-
import { defaultOpenApiGeneratorConfig } from './config';
|
|
4
|
-
import { OpenApiParser } from '../parse/parser';
|
|
5
|
-
import { ActionProvider } from '../utils/action-provider';
|
|
6
|
-
import { getFiles } from '../utils/file-system.utils';
|
|
3
|
+
import { defaultOpenApiGeneratorConfig } from './config.js';
|
|
4
|
+
import { OpenApiParser } from '../parse/parser.js';
|
|
5
|
+
import { ActionProvider } from '../utils/action-provider.js';
|
|
6
|
+
import { getFiles } from '../utils/file-system.utils.js';
|
|
7
7
|
class _OpenApiGenerator {
|
|
8
8
|
constructor(config, providers, parser) {
|
|
9
9
|
this._providers = providers;
|
package/esm/lib/codegen/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './config';
|
|
2
|
-
export * from './endpoints-generator';
|
|
3
|
-
export * from './generator';
|
|
4
|
-
export * from './schemas-generator';
|
|
5
|
-
export * from './services-generator';
|
|
6
|
-
export * from './types';
|
|
1
|
+
export * from './config.js';
|
|
2
|
+
export * from './endpoints-generator.js';
|
|
3
|
+
export * from './generator.js';
|
|
4
|
+
export * from './schemas-generator.js';
|
|
5
|
+
export * from './services-generator.js';
|
|
6
|
+
export * from './types.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { OpenApiGenerationProviderBase } from './generator';
|
|
2
|
-
import { addSourceIfTest } from './internal-utils';
|
|
3
|
-
import { getSchemaReference } from '../utils';
|
|
1
|
+
import { OpenApiGenerationProviderBase } from './generator.js';
|
|
2
|
+
import { addSourceIfTest } from './internal-utils.js';
|
|
3
|
+
import { getSchemaReference } from '../utils/index.js';
|
|
4
4
|
export class OpenApiSchemasGenerationProviderBase extends OpenApiGenerationProviderBase {
|
|
5
5
|
getProviderContext(context, config, defaultConfig) {
|
|
6
6
|
const ctx = super.getProviderContext(context, config, defaultConfig);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OpenApiGenerationProviderBase } from './generator';
|
|
2
|
-
import { addSourceIfTest } from './internal-utils';
|
|
1
|
+
import { OpenApiGenerationProviderBase } from './generator.js';
|
|
2
|
+
import { addSourceIfTest } from './internal-utils.js';
|
|
3
3
|
export class OpenApiServicesGenerationProviderBase extends OpenApiGenerationProviderBase {
|
|
4
4
|
getProviderContext(context, config, defaultConfig) {
|
|
5
5
|
const ctx = super.getProviderContext(context, config, defaultConfig);
|
package/esm/lib/collect/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './collector';
|
|
2
|
-
export * from './helpers';
|
|
3
|
-
export * from './types';
|
|
1
|
+
export * from './collector.js';
|
|
2
|
+
export * from './helpers.js';
|
|
3
|
+
export * from './types.js';
|
package/esm/lib/parse/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './openapi-types';
|
|
2
|
-
export * from './parser';
|
|
3
|
-
export * from './types';
|
|
1
|
+
export * from './openapi-types.js';
|
|
2
|
+
export * from './parser.js';
|
|
3
|
+
export * from './types.js';
|
package/esm/lib/parse/parser.js
CHANGED
|
@@ -4,11 +4,11 @@ import { cwd } from 'process';
|
|
|
4
4
|
import fs from 'fs-extra';
|
|
5
5
|
import nodeFetch from 'node-fetch';
|
|
6
6
|
import YAML from 'yaml';
|
|
7
|
-
import { createDerefProxy } from './deref-proxy';
|
|
8
|
-
import { defaultOpenApiParserOptions } from './types';
|
|
9
|
-
import { collectOpenApi } from '../collect/collector';
|
|
10
|
-
import { transformOpenApi } from '../transform/transformer';
|
|
11
|
-
import { isNullish } from '../utils';
|
|
7
|
+
import { createDerefProxy } from './deref-proxy.js';
|
|
8
|
+
import { defaultOpenApiParserOptions } from './types.js';
|
|
9
|
+
import { collectOpenApi } from '../collect/collector.js';
|
|
10
|
+
import { transformOpenApi } from '../transform/transformer.js';
|
|
11
|
+
import { isNullish } from '../utils/index.js';
|
|
12
12
|
export class OpenApiParser {
|
|
13
13
|
constructor(config) {
|
|
14
14
|
this._loadedDocuments = new Map();
|
package/esm/lib/parse/types.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { defaultOpenApiTransformerOptions } from '../transform/types';
|
|
1
|
+
import { defaultOpenApiTransformerOptions } from '../transform/types.js';
|
|
2
2
|
export const defaultOpenApiParserOptions = { ...defaultOpenApiTransformerOptions };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { parse as parsePath } from 'path';
|
|
2
|
-
import { isOpenApiObjectProperty } from '../internal-utils';
|
|
3
|
-
import { getDeepProperty } from '../utils';
|
|
4
|
-
import { isNullish } from '../utils/common.utils';
|
|
2
|
+
import { isOpenApiObjectProperty } from '../internal-utils.js';
|
|
3
|
+
import { getDeepProperty } from '../utils/index.js';
|
|
4
|
+
import { isNullish } from '../utils/common.utils.js';
|
|
5
5
|
export function determineSchemaKind(ctx, schema) {
|
|
6
6
|
if (schema.oneOf) {
|
|
7
7
|
return 'oneOf';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './api-types';
|
|
2
|
-
export * from './transformer';
|
|
1
|
+
export * from './api-types.js';
|
|
2
|
+
export * from './transformer.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { determineEndpointName, getCustomFields, getOpenApiObjectIdentifier } from './helpers';
|
|
2
|
-
import { transformSchema } from './transform-schema';
|
|
3
|
-
import { isOpenApiObjectProperty } from '../internal-utils';
|
|
1
|
+
import { determineEndpointName, getCustomFields, getOpenApiObjectIdentifier } from './helpers.js';
|
|
2
|
+
import { transformSchema } from './transform-schema.js';
|
|
3
|
+
import { isOpenApiObjectProperty } from '../internal-utils.js';
|
|
4
4
|
export function transformEndpoint(context, endpointInfo) {
|
|
5
5
|
var _a, _b, _c, _d;
|
|
6
6
|
const apiPath = transformApiPath(context, endpointInfo.path, endpointInfo.pathItem);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { determineSchemaAccessibility, determineSchemaKind, determineSchemaName, getCustomFields, getOpenApiObjectIdentifier, transformAdditionalProperties, transformSchemaProperties, } from './helpers';
|
|
2
|
-
import { createOverwriteProxy } from '../utils';
|
|
1
|
+
import { determineSchemaAccessibility, determineSchemaKind, determineSchemaName, getCustomFields, getOpenApiObjectIdentifier, transformAdditionalProperties, transformSchemaProperties, } from './helpers.js';
|
|
2
|
+
import { createOverwriteProxy } from '../utils/index.js';
|
|
3
3
|
export function transformSchema(ctx, schema) {
|
|
4
4
|
var _a, _b;
|
|
5
5
|
if (!schema) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { IdGenerator } from './helpers';
|
|
2
|
-
import { transformDocument } from './transform-document';
|
|
3
|
-
import { transformEndpoint } from './transform-endpoint';
|
|
4
|
-
import { transformSchema } from './transform-schema';
|
|
5
|
-
import { defaultOpenApiTransformerOptions } from './types';
|
|
1
|
+
import { IdGenerator } from './helpers.js';
|
|
2
|
+
import { transformDocument } from './transform-document.js';
|
|
3
|
+
import { transformEndpoint } from './transform-endpoint.js';
|
|
4
|
+
import { transformSchema } from './transform-schema.js';
|
|
5
|
+
import { defaultOpenApiTransformerOptions } from './types.js';
|
|
6
6
|
export function transformOpenApi(data, options) {
|
|
7
7
|
const context = {
|
|
8
8
|
config: { ...defaultOpenApiTransformerOptions, ...options },
|
package/esm/lib/utils/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export * from './array.utils';
|
|
2
|
-
export * from './class.utils';
|
|
3
|
-
export * from './common.utils';
|
|
4
|
-
export * from './endpoint.utils';
|
|
5
|
-
export * from './error.utils';
|
|
6
|
-
export * from './factory';
|
|
7
|
-
export * from './generator.utils';
|
|
8
|
-
export * from './object.utils';
|
|
9
|
-
export * from './schema.utils';
|
|
10
|
-
export * from './source-builder';
|
|
11
|
-
export * from './string-builder';
|
|
12
|
-
export * from './string.utils';
|
|
13
|
-
export * from './string.utils.types';
|
|
14
|
-
export * from './type.utils';
|
|
1
|
+
export * from './array.utils.js';
|
|
2
|
+
export * from './class.utils.js';
|
|
3
|
+
export * from './common.utils.js';
|
|
4
|
+
export * from './endpoint.utils.js';
|
|
5
|
+
export * from './error.utils.js';
|
|
6
|
+
export * from './factory.js';
|
|
7
|
+
export * from './generator.utils.js';
|
|
8
|
+
export * from './object.utils.js';
|
|
9
|
+
export * from './schema.utils.js';
|
|
10
|
+
export * from './source-builder.js';
|
|
11
|
+
export * from './string-builder/index.js';
|
|
12
|
+
export * from './string.utils.js';
|
|
13
|
+
export * from './string.utils.types.js';
|
|
14
|
+
export * from './type.utils.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isOpenApiObjectProperty } from '../internal-utils';
|
|
1
|
+
import { isOpenApiObjectProperty } from '../internal-utils.js';
|
|
2
2
|
export function resolveAnyOfAndAllOf(schema, ignoreNonObjectParts) {
|
|
3
3
|
if (!ignoreNonObjectParts && (hasInvalidSubSchema(schema.anyOf) || hasInvalidSubSchema(schema.allOf))) {
|
|
4
4
|
return undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { isNullish } from './common.utils';
|
|
2
|
-
import { evalCondition } from './condition';
|
|
3
|
-
import { defaultStringBuilderOptions, StringBuilder, } from './string-builder';
|
|
4
|
-
import { removeStr, trimEnd } from './string.utils';
|
|
1
|
+
import { isNullish } from './common.utils.js';
|
|
2
|
+
import { evalCondition } from './condition.js';
|
|
3
|
+
import { defaultStringBuilderOptions, StringBuilder, } from './string-builder/index.js';
|
|
4
|
+
import { removeStr, trimEnd } from './string.utils.js';
|
|
5
5
|
/**
|
|
6
6
|
* Default options for the `SourceBuilder` class.
|
|
7
7
|
*/
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './options';
|
|
2
|
-
export { StringBuilder } from './string-builder';
|
|
3
|
-
export * from './utils';
|
|
1
|
+
export * from './options.js';
|
|
2
|
+
export { StringBuilder } from './string-builder.js';
|
|
3
|
+
export * from './utils.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defaultStringBuilderOptions } from './options';
|
|
2
|
-
import { isNullish } from '../common.utils';
|
|
1
|
+
import { defaultStringBuilderOptions } from './options.js';
|
|
2
|
+
import { isNullish } from '../common.utils.js';
|
|
3
3
|
export const AdditionalAppendsSymbol = Symbol('AdditionalAppends');
|
|
4
4
|
/**
|
|
5
5
|
* Represents a mutable string of characters.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@goast/core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.7",
|
|
4
4
|
"repository": "https://github.com/MaSch0212/goast.git",
|
|
5
5
|
"description": "A tool designed to transform OpenAPI specifications into various forms with flexibility and extensibility at its core.",
|
|
6
6
|
"keywords": [
|
|
@@ -21,11 +21,10 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"fs-extra": "^11.2.0",
|
|
23
23
|
"node-fetch": "^2.7.0",
|
|
24
|
-
"yaml": "^2.
|
|
24
|
+
"yaml": "^2.6.0",
|
|
25
25
|
"tslib": "2.6.3"
|
|
26
26
|
},
|
|
27
27
|
"packageManager": "pnpm@9.5.0",
|
|
28
|
-
"module": "./esm/index.js",
|
|
29
28
|
"main": "./cjs/index.js",
|
|
30
29
|
"types": "./types/index.d.ts",
|
|
31
30
|
"exports": {
|
|
@@ -40,5 +39,9 @@
|
|
|
40
39
|
"types": "./types/lib/utils/index.d.ts"
|
|
41
40
|
},
|
|
42
41
|
"./package.json": "./package.json"
|
|
42
|
+
},
|
|
43
|
+
"module": "./esm/index.js",
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@types/fs-extra": "^11.0.4"
|
|
43
46
|
}
|
|
44
47
|
}
|
|
@@ -174,7 +174,7 @@ export type CombinedLikeApiSchema = ApiSchemaBase & {
|
|
|
174
174
|
export type NumberLikeApiSchema = ApiSchemaBase & {
|
|
175
175
|
kind: 'number' | 'integer' | 'multi-type';
|
|
176
176
|
type: 'number' | 'integer' | string[];
|
|
177
|
-
} & AdditionalNumberSchemaProperties;
|
|
177
|
+
} & AdditionalNumberSchemaProperties & AdditionalPrimitiveSchemaProperties;
|
|
178
178
|
export type ArrayLikeApiSchema = ApiSchemaBase & {
|
|
179
179
|
kind: 'array' | 'multi-type';
|
|
180
180
|
type: 'array' | string[];
|
|
@@ -186,7 +186,7 @@ export type ObjectLikeApiSchema = ApiSchemaBase & {
|
|
|
186
186
|
export type StringLikeApiSchema = ApiSchemaBase & {
|
|
187
187
|
kind: 'string' | 'multi-type';
|
|
188
188
|
type: 'string' | string[];
|
|
189
|
-
} & AdditionalStringSchemaProperties;
|
|
189
|
+
} & AdditionalStringSchemaProperties & AdditionalPrimitiveSchemaProperties;
|
|
190
190
|
export type PrimitiveLikeApiSchema = ApiSchemaBase & {
|
|
191
191
|
kind: 'string' | 'number' | 'integer' | 'boolean' | 'null' | 'multi-type';
|
|
192
192
|
type: 'string' | 'number' | 'integer' | 'boolean' | 'null' | string[];
|