@goast/core 0.4.2 → 0.5.0-beta.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.
Files changed (91) hide show
  1. package/LICENSE +21 -21
  2. package/esm/mod.d.ts +2 -0
  3. package/esm/mod.d.ts.map +1 -1
  4. package/esm/mod.js +2 -0
  5. package/esm/src/codegen/config.d.ts +11 -0
  6. package/esm/src/codegen/config.d.ts.map +1 -1
  7. package/esm/src/codegen/config.js +1 -0
  8. package/esm/src/parse/parser.js +1 -1
  9. package/esm/src/transform/api-types.d.ts +2 -1
  10. package/esm/src/transform/api-types.d.ts.map +1 -1
  11. package/esm/src/transform/transformer.d.ts.map +1 -1
  12. package/esm/src/transform/transformer.js +1 -0
  13. package/esm/src/transform/types.d.ts +3 -3
  14. package/esm/src/transform/types.d.ts.map +1 -1
  15. package/esm/src/utils/api-data.utils.d.ts +3 -0
  16. package/esm/src/utils/api-data.utils.d.ts.map +1 -0
  17. package/esm/src/utils/api-data.utils.js +38 -0
  18. package/esm/src/utils/file-system.utils.d.ts +2 -0
  19. package/esm/src/utils/file-system.utils.d.ts.map +1 -1
  20. package/esm/src/utils/file-system.utils.js +12 -2
  21. package/esm/src/utils/schema.utils.d.ts +1 -0
  22. package/esm/src/utils/schema.utils.d.ts.map +1 -1
  23. package/esm/src/utils/schema.utils.js +5 -0
  24. package/package.json +2 -2
  25. package/script/mod.d.ts +2 -0
  26. package/script/mod.d.ts.map +1 -1
  27. package/script/mod.js +2 -0
  28. package/script/src/codegen/config.d.ts +11 -0
  29. package/script/src/codegen/config.d.ts.map +1 -1
  30. package/script/src/codegen/config.js +1 -0
  31. package/script/src/parse/parser.js +1 -1
  32. package/script/src/transform/api-types.d.ts +2 -1
  33. package/script/src/transform/api-types.d.ts.map +1 -1
  34. package/script/src/transform/transformer.d.ts.map +1 -1
  35. package/script/src/transform/transformer.js +1 -0
  36. package/script/src/transform/types.d.ts +3 -3
  37. package/script/src/transform/types.d.ts.map +1 -1
  38. package/script/src/utils/api-data.utils.d.ts +3 -0
  39. package/script/src/utils/api-data.utils.d.ts.map +1 -0
  40. package/script/src/utils/api-data.utils.js +42 -0
  41. package/script/src/utils/file-system.utils.d.ts +2 -0
  42. package/script/src/utils/file-system.utils.d.ts.map +1 -1
  43. package/script/src/utils/file-system.utils.js +12 -1
  44. package/script/src/utils/schema.utils.d.ts +1 -0
  45. package/script/src/utils/schema.utils.d.ts.map +1 -1
  46. package/script/src/utils/schema.utils.js +6 -0
  47. package/src/_dnt.shims.ts +0 -69
  48. package/src/mod.ts +0 -33
  49. package/src/src/ast/node.ts +0 -46
  50. package/src/src/codegen/config.ts +0 -28
  51. package/src/src/codegen/endpoints-generator.ts +0 -72
  52. package/src/src/codegen/generator.ts +0 -181
  53. package/src/src/codegen/internal-utils.ts +0 -6
  54. package/src/src/codegen/schemas-generator.ts +0 -87
  55. package/src/src/codegen/services-generator.ts +0 -77
  56. package/src/src/codegen/types.ts +0 -37
  57. package/src/src/collect/collector.ts +0 -142
  58. package/src/src/collect/helpers.ts +0 -36
  59. package/src/src/collect/types.ts +0 -21
  60. package/src/src/internal-utils.ts +0 -5
  61. package/src/src/parse/deref-proxy.ts +0 -64
  62. package/src/src/parse/openapi-types.ts +0 -949
  63. package/src/src/parse/parser.ts +0 -220
  64. package/src/src/parse/types.ts +0 -27
  65. package/src/src/transform/api-types.ts +0 -243
  66. package/src/src/transform/helpers.ts +0 -216
  67. package/src/src/transform/transform-document.ts +0 -35
  68. package/src/src/transform/transform-endpoint.ts +0 -331
  69. package/src/src/transform/transform-schema.ts +0 -217
  70. package/src/src/transform/transformer.ts +0 -52
  71. package/src/src/transform/types.ts +0 -52
  72. package/src/src/utils/action-provider.ts +0 -58
  73. package/src/src/utils/array.utils.ts +0 -7
  74. package/src/src/utils/asset-manager.ts +0 -51
  75. package/src/src/utils/class.utils.ts +0 -40
  76. package/src/src/utils/common.utils.ts +0 -86
  77. package/src/src/utils/condition.ts +0 -7
  78. package/src/src/utils/endpoint.utils.ts +0 -10
  79. package/src/src/utils/error.utils.ts +0 -3
  80. package/src/src/utils/factory.ts +0 -42
  81. package/src/src/utils/file-system.utils.ts +0 -48
  82. package/src/src/utils/generator.utils.ts +0 -6
  83. package/src/src/utils/object.utils.ts +0 -32
  84. package/src/src/utils/schema.utils.ts +0 -142
  85. package/src/src/utils/source-builder.ts +0 -597
  86. package/src/src/utils/string-builder/options.ts +0 -19
  87. package/src/src/utils/string-builder/string-builder.ts +0 -165
  88. package/src/src/utils/string-builder/utils.ts +0 -69
  89. package/src/src/utils/string.utils.ts +0 -369
  90. package/src/src/utils/string.utils.types.ts +0 -179
  91. package/src/src/utils/type.utils.ts +0 -93
@@ -1,220 +0,0 @@
1
- import * as dntShim from "../../_dnt.shims.js";
2
- import path from 'node:path';
3
- import { cwd } from 'node:process';
4
-
5
-
6
- import fs from 'fs-extra';
7
- import * as YAML from 'yaml';
8
-
9
- import { collectOpenApi } from '../collect/collector.js';
10
- import type { ApiData } from '../transform/api-types.js';
11
- import { transformOpenApi } from '../transform/transformer.js';
12
- import { isNullish } from '../utils/common.utils.js';
13
- import { createDerefProxy } from './deref-proxy.js';
14
- import type { OpenApiDocument, OpenApiObject, OpenApiReference, OpenApiSchema } from './openapi-types.js';
15
- import { defaultOpenApiParserOptions, type Deref, type OpenApiParserOptions } from './types.js';
16
-
17
- type LoadedDocument = {
18
- file: string;
19
- document: OpenApiDocument;
20
- dereferencedDocument: Deref<OpenApiDocument>;
21
- dereferencedComponents: Map<string, Deref<OpenApiObject<string>>>;
22
- };
23
-
24
- export class OpenApiParser {
25
- private readonly _loadedDocuments = new Map<string, LoadedDocument>();
26
- private readonly _config: OpenApiParserOptions;
27
-
28
- constructor(config?: Partial<OpenApiParserOptions>) {
29
- this._config = { ...defaultOpenApiParserOptions, ...config };
30
- }
31
-
32
- public async parseApisAndTransform(...fileNames: (string | string[])[]): Promise<ApiData> {
33
- const flatFileNames = ([] as string[]).concat(...fileNames);
34
- const apis = await Promise.all(flatFileNames.map((fileName) => this.parseApi(fileName)));
35
-
36
- const transformed = this.transformApis(apis);
37
-
38
- return transformed;
39
- }
40
-
41
- public async parseApi(fileName: string): Promise<Deref<OpenApiDocument>> {
42
- const absoluteFilePath = this.isUrl(fileName) ? fileName : path.resolve(cwd(), fileName);
43
- const doc = await this.loadDocument(absoluteFilePath);
44
- return await this.dereference(absoluteFilePath, '', doc.document);
45
- }
46
-
47
- public transformApis(apis: Deref<OpenApiDocument>[]): ApiData {
48
- const collectedData = collectOpenApi(apis);
49
- const transformedData = transformOpenApi(collectedData, this._config);
50
- return transformedData;
51
- }
52
-
53
- private async dereference<T extends OpenApiObject<string>>(file: string, path: string, value: T): Promise<Deref<T>> {
54
- let existingDocument = this._loadedDocuments.get(file);
55
- if (existingDocument) {
56
- const existingComponent = existingDocument.dereferencedComponents.get(path);
57
- if (existingComponent) {
58
- return existingComponent as Deref<T>;
59
- }
60
- } else {
61
- existingDocument = await this.loadDocument(file);
62
- }
63
-
64
- const result = createDerefProxy(value, {
65
- file,
66
- path,
67
- document: existingDocument.dereferencedDocument,
68
- originalComponent: value,
69
- });
70
- existingDocument.dereferencedComponents.set(path, result as Deref<OpenApiObject<string>>);
71
-
72
- if (value.$ref) {
73
- // deno-lint-ignore no-explicit-any
74
- result.$ref = await this.resolveReference<T>(file, value as OpenApiReference) as any;
75
- }
76
- for (const key of Object.keys(value) as (keyof T)[]) {
77
- if (key === '$ref') continue;
78
- const v = value[key];
79
- if (isNullish(v)) continue;
80
- if (typeof v === 'object') {
81
- if (Array.isArray(v)) {
82
- (result as Record<keyof T, unknown>)[key] = await Promise.all(
83
- v.map(async (v, index) => {
84
- if (v && typeof v === 'object') {
85
- return await this.dereference(file, `${path}/${String(key)}/${index}`, v);
86
- } else {
87
- return v;
88
- }
89
- }),
90
- );
91
- } else {
92
- (result as Record<keyof T, unknown>)[key] = await this.dereference(
93
- file,
94
- `${path}/${String(key)}`,
95
- v as Record<string, unknown>,
96
- );
97
- }
98
- }
99
- if (typeof v === 'string' && path.endsWith('/discriminator/mapping')) {
100
- (result as Record<keyof T, unknown>)[key] = await this.resolveReference<OpenApiSchema>(file, { $ref: v });
101
- }
102
- }
103
-
104
- return result;
105
- }
106
-
107
- private async resolveReference<T extends OpenApiObject<string>>(
108
- file: string,
109
- ref: OpenApiReference,
110
- ): Promise<Deref<T> | undefined> {
111
- const [refFile, refPath] = ref.$ref.split('#');
112
-
113
- let absoluteRefFile: string = refFile;
114
- if (!/\S/.test(refFile)) {
115
- absoluteRefFile = file;
116
- } else if (!this.isUrl(refFile)) {
117
- absoluteRefFile = path.resolve(path.dirname(file), refFile);
118
- }
119
-
120
- const doc = await this.loadDocument(absoluteRefFile);
121
-
122
- const value = refPath ? getDeepProperty(doc.document, refPath.replace(/[/]/g, '.')) : doc.document;
123
- if (value && typeof value === 'object') {
124
- return this.dereference(absoluteRefFile, refPath ?? '/', value as T);
125
- }
126
-
127
- return undefined;
128
- }
129
-
130
- private async loadDocument(fileOrUrl: string): Promise<LoadedDocument> {
131
- const existingDocument = this._loadedDocuments.get(fileOrUrl);
132
- if (existingDocument) {
133
- return existingDocument;
134
- }
135
-
136
- const documentContent = await this.getDocumentContent(fileOrUrl);
137
- const extname = path.extname(fileOrUrl).toLowerCase();
138
-
139
- let parsedDocument: unknown;
140
- if (extname === '.json') {
141
- parsedDocument = this.tryParseJson(documentContent);
142
- } else if (extname === '.yaml' || extname === '.yml') {
143
- parsedDocument = this.tryParseYaml(documentContent);
144
- } else {
145
- parsedDocument = this.tryParseJson(documentContent);
146
- if (parsedDocument !== undefined) {
147
- parsedDocument = this.tryParseYaml(documentContent);
148
- }
149
- }
150
-
151
- if (parsedDocument === undefined) {
152
- throw new Error(`Unable to parse ${fileOrUrl}`);
153
- }
154
-
155
- const doc = (parsedDocument ?? {}) as OpenApiDocument;
156
- const deref = createDerefProxy(doc, {
157
- file: fileOrUrl,
158
- path: '',
159
- originalComponent: doc,
160
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
161
- document: undefined!,
162
- });
163
- deref.$src.document = deref;
164
- const loadedDocument = {
165
- file: fileOrUrl,
166
- document: doc,
167
- dereferencedDocument: deref,
168
- dereferencedComponents: new Map(),
169
- };
170
- this._loadedDocuments.set(fileOrUrl, loadedDocument);
171
- return loadedDocument;
172
- }
173
-
174
- private async getDocumentContent(fileOrUrl: string): Promise<string> {
175
- if (this.isUrl(fileOrUrl)) {
176
- const res = await dntShim.fetch(fileOrUrl);
177
- if (!res.ok) {
178
- throw new Error(`Unable to download ${fileOrUrl}: ${res.statusText}`);
179
- }
180
- return await res.text();
181
- } else {
182
- return (await fs.readFile(fileOrUrl)).toString();
183
- }
184
- }
185
-
186
- private isUrl(fileOrUrl: string): boolean {
187
- return /^https?:\/\//i.test(fileOrUrl);
188
- }
189
-
190
- private tryParseJson(json: string): unknown {
191
- try {
192
- return JSON.parse(json);
193
- } catch {
194
- return undefined;
195
- }
196
- }
197
-
198
- private tryParseYaml(yaml: string): unknown {
199
- try {
200
- return YAML.parse(yaml);
201
- } catch {
202
- return undefined;
203
- }
204
- }
205
- }
206
-
207
- function getDeepProperty(value: Record<string, unknown>, path: string): unknown {
208
- const parts = path.split('.');
209
- let result: unknown = value;
210
- for (const part of parts) {
211
- if (!/\S/.test(part)) continue;
212
- if (typeof result === 'object') {
213
- result = (result as Record<string, unknown>)[part];
214
- } else {
215
- return undefined;
216
- }
217
- }
218
-
219
- return result;
220
- }
@@ -1,27 +0,0 @@
1
- import type { OpenApiDiscriminator, OpenApiDocument, OpenApiReference, OpenApiSchema } from './openapi-types.js';
2
- import { defaultOpenApiTransformerOptions, type OpenApiTransformerOptions } from '../transform/types.js';
3
-
4
- export type DerefSource<T> = {
5
- file: string;
6
- path: string;
7
- document: Deref<OpenApiDocument>;
8
- originalComponent: T;
9
- };
10
-
11
- type _DerefDiscriminator = Omit<OpenApiDiscriminator, 'mapping'> & {
12
- mapping?: Record<string, Deref<OpenApiSchema>>;
13
- };
14
- type _Deref<T extends object> = T extends OpenApiDiscriminator ? _DerefDiscriminator
15
- :
16
- & {
17
- [K in keyof T as K extends keyof OpenApiReference ? never : K]: Deref<T[K]>;
18
- }
19
- & {
20
- $src: DerefSource<T>;
21
- $ref?: Deref<T>;
22
- };
23
- export type Deref<T> = T extends object ? (T extends (infer A)[] ? Deref<A>[] : _Deref<T>) : T;
24
-
25
- export type OpenApiParserOptions = OpenApiTransformerOptions;
26
-
27
- export const defaultOpenApiParserOptions = { ...defaultOpenApiTransformerOptions };
@@ -1,243 +0,0 @@
1
- import type {
2
- KnownOpenApiParameterTarget,
3
- OpenApiHeader,
4
- OpenApiHttpMethod,
5
- OpenApiMediaType,
6
- OpenApiOperation,
7
- OpenApiParameter,
8
- OpenApiPathItem,
9
- OpenApiRequestBody,
10
- OpenApiResponse,
11
- OpenApiSchema,
12
- OpenApiTag,
13
- } from '../parse/openapi-types.js';
14
- import type { Deref, DerefSource } from '../parse/types.js';
15
- import type { OptionalProperties } from '../utils/type.utils.js';
16
-
17
- export type ApiData = {
18
- services: ApiService[];
19
- endpoints: ApiEndpoint[];
20
- schemas: ApiSchema[];
21
- };
22
-
23
- export type ApiComponentSource<T> = DerefSource<T> & {
24
- component: Deref<T>;
25
- };
26
-
27
- export type Transformed<T> = T extends OpenApiTag ? ApiService
28
- : T extends OpenApiPathItem ? ApiPath
29
- : T extends OpenApiParameter ? ApiParameter
30
- : T extends OpenApiRequestBody ? ApiRequestBody
31
- : T extends OpenApiResponse ? ApiResponse
32
- : T extends OpenApiMediaType ? ApiContent
33
- : T extends OpenApiHeader ? ApiHeader
34
- : T extends OpenApiSchema ? ApiSchema
35
- : undefined;
36
-
37
- export type ApiComponent<T> = {
38
- id: string;
39
- $src: ApiComponentSource<T>;
40
- $ref: Transformed<T> | undefined;
41
- };
42
-
43
- export type ApiMethod = OpenApiHttpMethod;
44
- export type ApiParameterTarget = KnownOpenApiParameterTarget;
45
-
46
- export type ApiServiceComponent = OptionalProperties<ApiComponent<OpenApiTag>, '$src'>;
47
- export type ApiService = ApiServiceComponent & {
48
- name: string;
49
- description: string | undefined;
50
- endpoints: ApiEndpoint[];
51
- };
52
-
53
- export type ApiPathComponent = ApiComponent<OpenApiPathItem>;
54
- export type ApiPath = ApiPathComponent & {
55
- summary: string | undefined;
56
- description: string | undefined;
57
- path: string;
58
- parameters: ApiParameter[];
59
- } & { [K in ApiMethod]: ApiEndpoint | undefined };
60
-
61
- export type ApiEndpointComponent = ApiComponent<OpenApiOperation>;
62
- export type ApiEndpoint = ApiEndpointComponent & {
63
- name: string;
64
- path: string;
65
- pathInfo: ApiPath;
66
- method: ApiMethod;
67
- summary: string | undefined;
68
- description: string | undefined;
69
- parameters: ApiParameter[];
70
- deprecated: boolean;
71
- requestBody: ApiRequestBody | undefined;
72
- responses: ApiResponse[];
73
- tags: string[];
74
- custom: Record<string, unknown>;
75
- };
76
-
77
- export type ApiParameterComponent = ApiComponent<OpenApiParameter>;
78
- export type ApiParameter = ApiParameterComponent & {
79
- name: string;
80
- target: ApiParameterTarget;
81
- description: string | undefined;
82
- required: boolean;
83
- deprecated: boolean;
84
- allowEmptyValue: boolean | undefined;
85
- style: string | undefined;
86
- explode: boolean | undefined;
87
- allowReserved: boolean | undefined;
88
- schema: ApiSchema | undefined;
89
- };
90
-
91
- export type ApiRequestBodyComponent = ApiComponent<OpenApiRequestBody>;
92
- export type ApiRequestBody = ApiRequestBodyComponent & {
93
- description: string | undefined;
94
- content: ApiContent[];
95
- required: boolean;
96
- };
97
-
98
- export type ApiContentComponent = ApiComponent<OpenApiMediaType>;
99
- export type ApiContent = ApiContentComponent & {
100
- type: string;
101
- schema: ApiSchema | undefined;
102
- };
103
-
104
- export type ApiExampleComponent = ApiComponent<OpenApiResponse>;
105
- export type ApiResponse = ApiExampleComponent & {
106
- statusCode: number | undefined;
107
- description: string | undefined;
108
- headers: ApiHeader[];
109
- contentOptions: ApiContent[];
110
- };
111
-
112
- export type ApiHeaderComponent = Omit<ApiComponent<OpenApiHeader> | ApiComponent<OpenApiSchema>, '$ref'> & {
113
- $ref: ApiHeader | undefined;
114
- };
115
- export type ApiHeader = ApiHeaderComponent & Omit<ApiParameter, 'target'>;
116
-
117
- export type ApiSchemaType = 'string' | 'number' | 'integer' | 'array' | 'boolean' | 'null' | 'object' | string;
118
- export type ApiSchemaKind =
119
- | 'oneOf'
120
- | 'multi-type'
121
- | 'string'
122
- | 'number'
123
- | 'integer'
124
- | 'array'
125
- | 'boolean'
126
- | 'null'
127
- | 'object'
128
- | 'combined'
129
- | 'unknown';
130
- export type ApiSchemaAccessibility = 'all' | 'readOnly' | 'writeOnly' | 'none';
131
- export type ApiSchemaProperty = {
132
- name: string;
133
- schema: ApiSchema;
134
- };
135
- export type ApiSchemaDiscriminator = {
136
- propertyName: string;
137
- mapping: Record<string, ApiSchema>;
138
- };
139
- export type ApiSchemaComponent = ApiComponent<OpenApiSchema>;
140
- export type ApiSchemaBase = ApiSchemaComponent & {
141
- name: string;
142
- isNameGenerated: boolean;
143
- description: string | undefined;
144
- deprecated: boolean;
145
- accessibility: ApiSchemaAccessibility;
146
- enum: unknown[] | undefined;
147
- const: unknown | undefined;
148
- default: unknown | undefined;
149
- example: unknown | undefined;
150
- nullable: boolean;
151
- required: Set<string>;
152
- custom: Record<string, unknown>;
153
- not: ApiSchema | undefined;
154
- discriminator: ApiSchemaDiscriminator | undefined;
155
- inheritedSchemas: (ApiSchema & { discriminator: NonNullable<ApiSchema['discriminator']> })[];
156
- };
157
- export type ApiSchema<T extends ApiSchemaKind = ApiSchemaKind> = ApiSchemaBase & ApiSchemaExtensions<T>;
158
- type AdditionalCombinedSchemaProperties = {
159
- allOf: ApiSchema[];
160
- anyOf: ApiSchema[];
161
- };
162
- type AdditionalArraySchemaProperties = {
163
- items: ApiSchema | undefined;
164
- minItems: number | undefined;
165
- maxItems: number | undefined;
166
- };
167
- type AdditionalObjectSchemaProperties = {
168
- properties: Map<string, ApiSchemaProperty>;
169
- additionalProperties: boolean | undefined | ApiSchema;
170
- } & AdditionalCombinedSchemaProperties;
171
- type AdditionalNumberSchemaProperties = {
172
- minimum: number | undefined;
173
- maximum: number | undefined;
174
- };
175
- type AdditionalStringSchemaProperties = {
176
- pattern: string | undefined;
177
- minLength: number | undefined;
178
- maxLength: number | undefined;
179
- };
180
- type AdditionalPrimitiveSchemaProperties = {
181
- format: string | undefined;
182
- };
183
- export type ApiSchemaExtensions<T extends ApiSchemaKind> = T extends 'oneOf' ? { kind: 'oneOf'; oneOf: ApiSchema[] }
184
- : T extends 'multi-type' ?
185
- & {
186
- kind: 'multi-type';
187
- type: ApiSchemaType[];
188
- }
189
- & AdditionalArraySchemaProperties
190
- & AdditionalObjectSchemaProperties
191
- & AdditionalNumberSchemaProperties
192
- & AdditionalStringSchemaProperties
193
- & AdditionalPrimitiveSchemaProperties
194
- : T extends 'string'
195
- ? { kind: 'string'; type: 'string' } & AdditionalStringSchemaProperties & AdditionalPrimitiveSchemaProperties
196
- : T extends 'boolean' ? { kind: 'boolean'; type: 'boolean' } & AdditionalPrimitiveSchemaProperties
197
- : T extends 'null' ? { kind: 'null'; type: 'null' }
198
- : T extends 'number' | 'integer'
199
- ? { kind: 'number' | 'integer'; type: T } & AdditionalNumberSchemaProperties & AdditionalPrimitiveSchemaProperties
200
- : T extends 'array' ? {
201
- kind: 'array';
202
- type: 'array';
203
- } & AdditionalArraySchemaProperties
204
- : T extends 'object' ? {
205
- kind: 'object';
206
- type: 'object';
207
- } & AdditionalObjectSchemaProperties
208
- : T extends 'combined' ? {
209
- kind: 'combined';
210
- } & AdditionalCombinedSchemaProperties
211
- : { kind: 'unknown' };
212
- export type CombinedLikeApiSchema = ApiSchemaBase & {
213
- kind: 'combined' | 'object' | 'multi-type';
214
- type?: 'object' | string[];
215
- } & AdditionalCombinedSchemaProperties;
216
- export type NumberLikeApiSchema =
217
- & ApiSchemaBase
218
- & {
219
- kind: 'number' | 'integer' | 'multi-type';
220
- type: 'number' | 'integer' | string[];
221
- }
222
- & AdditionalNumberSchemaProperties
223
- & AdditionalPrimitiveSchemaProperties;
224
- export type ArrayLikeApiSchema = ApiSchemaBase & {
225
- kind: 'array' | 'multi-type';
226
- type: 'array' | string[];
227
- } & AdditionalArraySchemaProperties;
228
- export type ObjectLikeApiSchema = ApiSchemaBase & {
229
- kind: 'object' | 'multi-type';
230
- type: 'object' | string[];
231
- } & AdditionalObjectSchemaProperties;
232
- export type StringLikeApiSchema =
233
- & ApiSchemaBase
234
- & {
235
- kind: 'string' | 'multi-type';
236
- type: 'string' | string[];
237
- }
238
- & AdditionalStringSchemaProperties
239
- & AdditionalPrimitiveSchemaProperties;
240
- export type PrimitiveLikeApiSchema = ApiSchemaBase & {
241
- kind: 'string' | 'number' | 'integer' | 'boolean' | 'null' | 'multi-type';
242
- type: 'string' | 'number' | 'integer' | 'boolean' | 'null' | string[];
243
- } & AdditionalPrimitiveSchemaProperties;