@conduit-client/model 3.8.0 → 3.9.0
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/types/v1/index.d.ts +1 -0
- package/dist/types/v1/parser/__tests__/test-utils.d.ts +37 -5
- package/dist/types/v1/parser/amf/endpoints/amf-operation.d.ts +1 -4042
- package/dist/types/v1/parser/swagger/SwaggerAPI.d.ts +50 -0
- package/dist/types/v1/parser/swagger/__tests__/parser.spec.d.ts +1 -0
- package/dist/types/v1/parser/swagger/__tests__/swagger-api-service.spec.d.ts +1 -0
- package/dist/types/v1/parser/swagger/__tests__/swagger-extensions.spec.d.ts +1 -0
- package/dist/types/v1/parser/swagger/__tests__/swagger-types.spec.d.ts +1 -0
- package/dist/types/v1/parser/swagger/__tests__/swagger-utils.spec.d.ts +1 -0
- package/dist/types/v1/parser/swagger/__tests__/validation.spec.d.ts +1 -0
- package/dist/types/v1/parser/swagger/__tests__/version.spec.d.ts +1 -0
- package/dist/types/v1/parser/swagger/endpoints/swagger-endpoint.d.ts +30 -0
- package/dist/types/v1/parser/swagger/endpoints/swagger-operation.d.ts +71 -0
- package/dist/types/v1/parser/swagger/index.d.ts +4 -0
- package/dist/types/v1/parser/swagger/parser.d.ts +19 -0
- package/dist/types/v1/parser/swagger/source-position-map.d.ts +39 -0
- package/dist/types/v1/parser/swagger/swagger-api-service.d.ts +8 -0
- package/dist/types/v1/parser/swagger/swagger-extensions.d.ts +8 -0
- package/dist/types/v1/parser/swagger/swagger-utils.d.ts +37 -0
- package/dist/types/v1/parser/swagger/types/SwaggerAllOfType.d.ts +22 -0
- package/dist/types/v1/parser/swagger/types/SwaggerAnyType.d.ts +7 -0
- package/dist/types/v1/parser/swagger/types/SwaggerArrayType.d.ts +9 -0
- package/dist/types/v1/parser/swagger/types/SwaggerBaseType.d.ts +26 -0
- package/dist/types/v1/parser/swagger/types/SwaggerDiscriminatedObjectType.d.ts +26 -0
- package/dist/types/v1/parser/swagger/types/SwaggerEnumType.d.ts +13 -0
- package/dist/types/v1/parser/swagger/types/SwaggerNilType.d.ts +7 -0
- package/dist/types/v1/parser/swagger/types/SwaggerNotType.d.ts +13 -0
- package/dist/types/v1/parser/swagger/types/SwaggerObjectType.d.ts +13 -0
- package/dist/types/v1/parser/swagger/types/SwaggerOneOfType.d.ts +16 -0
- package/dist/types/v1/parser/swagger/types/SwaggerRefType.d.ts +12 -0
- package/dist/types/v1/parser/swagger/types/SwaggerScalarTypes.d.ts +46 -0
- package/dist/types/v1/parser/swagger/types/__tests__/SwaggerAnyType.spec.d.ts +1 -0
- package/dist/types/v1/parser/swagger/types/__tests__/SwaggerArrayType.spec.d.ts +1 -0
- package/dist/types/v1/parser/swagger/types/__tests__/SwaggerBaseType.spec.d.ts +1 -0
- package/dist/types/v1/parser/swagger/types/__tests__/SwaggerDiscriminatedObjectType.spec.d.ts +1 -0
- package/dist/types/v1/parser/swagger/types/__tests__/SwaggerEnumType.spec.d.ts +1 -0
- package/dist/types/v1/parser/swagger/types/__tests__/SwaggerNilType.spec.d.ts +1 -0
- package/dist/types/v1/parser/swagger/types/__tests__/SwaggerNotType.spec.d.ts +1 -0
- package/dist/types/v1/parser/swagger/types/__tests__/SwaggerObjectType.spec.d.ts +1 -0
- package/dist/types/v1/parser/swagger/types/__tests__/SwaggerOneOfType.spec.d.ts +1 -0
- package/dist/types/v1/parser/swagger/types/__tests__/SwaggerScalarType.spec.d.ts +1 -0
- package/dist/types/v1/parser/swagger/types/factory.d.ts +22 -0
- package/dist/types/v1/parser/swagger/types/index.d.ts +21 -0
- package/dist/types/v1/parser/swagger/validation.d.ts +11 -0
- package/dist/types/v1/parser/swagger/version.d.ts +6 -0
- package/dist/types/v1/parser/zod-schemas.d.ts +4206 -0
- package/dist/v1/index.js +7891 -111
- package/dist/v1/index.js.map +1 -1
- package/package.json +5 -3
- /package/dist/types/v1/parser/{amf/__tests__/amf-extensions-services.spec.d.ts → __tests__/extensions-services.spec.d.ts} +0 -0
- /package/dist/types/v1/parser/{amf/endpoints/__tests__/amf-endpoint.spec.d.ts → __tests__/parser-endpoint.spec.d.ts} +0 -0
- /package/dist/types/v1/parser/{amf/endpoints/__tests__/amf-operation.spec.d.ts → __tests__/parser-operation.spec.d.ts} +0 -0
package/dist/types/v1/index.d.ts
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import amf from 'amf-client-js';
|
|
2
|
+
import { OpenAPIV3 } from 'openapi-types';
|
|
2
3
|
import { AMFAPI } from '../amf/AMFAPI';
|
|
3
4
|
import { AMFType } from '../amf/types';
|
|
4
5
|
import { LoggerService } from '@conduit-client/utils';
|
|
5
6
|
import { Mock } from 'vitest';
|
|
6
|
-
import { TypeRegistry } from '../..';
|
|
7
|
-
|
|
7
|
+
import { SwaggerType, TypeRegistry } from '../..';
|
|
8
|
+
import { SwaggerEndPoint } from '../swagger/endpoints/swagger-endpoint';
|
|
9
|
+
import { SourcePositionMap } from '../swagger/source-position-map';
|
|
10
|
+
import { SwaggerAPI } from '../swagger/SwaggerAPI';
|
|
11
|
+
import { AmfEndPoint } from '../amf/endpoints/amf-endpoint';
|
|
12
|
+
import { API, Server } from '../../api';
|
|
13
|
+
export type ParserKind = 'amf' | 'swagger';
|
|
8
14
|
type ClassOfConstructor<T> = T extends new () => infer R ? R : never;
|
|
9
15
|
/**
|
|
10
16
|
* Extracts the shape value types from a TestOAS structure.
|
|
@@ -20,7 +26,23 @@ type TestAmfOAS<T extends Record<string, new () => amf.AnyShape>, E extends Reco
|
|
|
20
26
|
} & {
|
|
21
27
|
[P in keyof E]: amf.EndPoint;
|
|
22
28
|
};
|
|
23
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Swagger path item with path metadata for factory usage.
|
|
31
|
+
* This is the raw OpenAPI path item object with path string attached.
|
|
32
|
+
*/
|
|
33
|
+
export type SwaggerPathItemWithPath = OpenAPIV3.PathItemObject & {
|
|
34
|
+
_path: string;
|
|
35
|
+
};
|
|
36
|
+
type TestSwaggerOAS<T extends Record<string, new () => amf.AnyShape>, E extends Record<string, string>> = {
|
|
37
|
+
document: OpenAPIV3.Document;
|
|
38
|
+
sourceUrl: URL;
|
|
39
|
+
positionMap: SourcePositionMap;
|
|
40
|
+
} & {
|
|
41
|
+
[P in keyof T]: OpenAPIV3.SchemaObject;
|
|
42
|
+
} & {
|
|
43
|
+
[P in keyof E]: SwaggerPathItemWithPath;
|
|
44
|
+
};
|
|
45
|
+
export type TestOAS<K extends ParserKind, T extends Record<string, new () => amf.AnyShape>, E extends Record<string, string>> = K extends 'amf' ? TestAmfOAS<T, E> : K extends 'swagger' ? TestSwaggerOAS<T, E> : never;
|
|
24
46
|
declare const specFileConfigs: {
|
|
25
47
|
readonly amfApi: {
|
|
26
48
|
readonly file: "amf-api.yaml";
|
|
@@ -113,7 +135,7 @@ declare const specFileConfigs: {
|
|
|
113
135
|
readonly scalars: {
|
|
114
136
|
readonly file: "scalars.yaml";
|
|
115
137
|
readonly shapes: {
|
|
116
|
-
readonly Boolean: typeof amf.
|
|
138
|
+
readonly Boolean: typeof amf.AnyShape;
|
|
117
139
|
readonly Integer: typeof amf.ScalarShape;
|
|
118
140
|
readonly Int32: typeof amf.ScalarShape;
|
|
119
141
|
readonly Int64: typeof amf.ScalarShape;
|
|
@@ -305,7 +327,6 @@ declare const specFileConfigs: {
|
|
|
305
327
|
readonly CustomNonScalarOneOf: typeof amf.AnyShape;
|
|
306
328
|
readonly CustomObjectEnumType: typeof amf.NodeShape;
|
|
307
329
|
readonly CustomArrayEnumType: typeof amf.ArrayShape;
|
|
308
|
-
readonly MissingPropertyType: typeof amf.NodeShape;
|
|
309
330
|
};
|
|
310
331
|
readonly endpoints: {};
|
|
311
332
|
};
|
|
@@ -412,7 +433,18 @@ export type SpecFiles<K extends ParserKind> = {
|
|
|
412
433
|
};
|
|
413
434
|
export declare function readSpecFiles<K extends ParserKind>(kind: K): Promise<SpecFiles<K>>;
|
|
414
435
|
export declare function createAmfAPI(oas: TestOAS<'amf', {}, {}>, logger: LoggerService): AMFAPI;
|
|
436
|
+
export declare function createSwaggerAPI(oas: TestOAS<'swagger', {}, {}>, logger: LoggerService): SwaggerAPI;
|
|
415
437
|
export declare function createAmfTypeFactory(shape: amf.Shape, typeRegistry: TypeRegistry<AMFType>, logger: LoggerService, resolve?: boolean): AMFType;
|
|
438
|
+
/**
|
|
439
|
+
* Creates an AMF endpoint using the amfEndpointFactory
|
|
440
|
+
*/
|
|
441
|
+
export declare function createAmfEndpointFactory(endpoint: amf.EndPoint, typeRegistry: TypeRegistry<AMFType>, logger: LoggerService, server: Server, api: API): AmfEndPoint | undefined;
|
|
442
|
+
/**
|
|
443
|
+
* Creates a Swagger endpoint using the swaggerEndpointFactory
|
|
444
|
+
* Requires the endpoint to have _path metadata attached (from parseOASWithSwagger)
|
|
445
|
+
*/
|
|
446
|
+
export declare function createSwaggerEndpointFactory(pathItem: SwaggerPathItemWithPath, typeRegistry: TypeRegistry<SwaggerType>, logger: LoggerService, server: Server, api: SwaggerAPI): SwaggerEndPoint | undefined;
|
|
447
|
+
export declare function createSwaggerTypeFactory(schema: OpenAPIV3.SchemaObject, typeRegistry: TypeRegistry<SwaggerType>, logger: LoggerService, resolve?: boolean, schemaName?: string | undefined): SwaggerType;
|
|
416
448
|
/**
|
|
417
449
|
* Helper to assert that a message was logged containing all specified patterns.
|
|
418
450
|
* This makes tests resilient to changes in log order.
|