@conduit-client/model 5.67.0-dev1
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/main/index.js +6 -0
- package/dist/main/index.js.map +1 -0
- package/dist/types/index.d.ts +0 -0
- package/dist/types/v1/__tests__/validation.spec.d.ts +1 -0
- package/dist/types/v1/__tests__/zod-utils.spec.d.ts +1 -0
- package/dist/types/v1/amf/AMFAPI.d.ts +44 -0
- package/dist/types/v1/amf/__tests__/AMFAPI.spec.d.ts +1 -0
- package/dist/types/v1/amf/__tests__/amf-api-service.spec.d.ts +1 -0
- package/dist/types/v1/amf/__tests__/amf-extensions-services.spec.d.ts +1 -0
- package/dist/types/v1/amf/__tests__/amf-extensions.spec.d.ts +1 -0
- package/dist/types/v1/amf/__tests__/amf-utils.spec.d.ts +1 -0
- package/dist/types/v1/amf/__tests__/parser.spec.d.ts +1 -0
- package/dist/types/v1/amf/__tests__/test-utils.d.ts +211 -0
- package/dist/types/v1/amf/__tests__/validation.spec.d.ts +1 -0
- package/dist/types/v1/amf/__tests__/version.spec.d.ts +1 -0
- package/dist/types/v1/amf/amf-api-service.d.ts +15 -0
- package/dist/types/v1/amf/amf-extensions.d.ts +2 -0
- package/dist/types/v1/amf/amf-utils.d.ts +36 -0
- package/dist/types/v1/amf/endpoints/__tests__/amf-endpoint.spec.d.ts +1 -0
- package/dist/types/v1/amf/endpoints/__tests__/amf-operation.spec.d.ts +1 -0
- package/dist/types/v1/amf/endpoints/amf-endpoint.d.ts +32 -0
- package/dist/types/v1/amf/endpoints/amf-operation.d.ts +4112 -0
- package/dist/types/v1/amf/index.d.ts +5 -0
- package/dist/types/v1/amf/parser.d.ts +6 -0
- package/dist/types/v1/amf/types/AMFAllOfType.d.ts +23 -0
- package/dist/types/v1/amf/types/AMFAnyType.d.ts +7 -0
- package/dist/types/v1/amf/types/AMFArrayType.d.ts +10 -0
- package/dist/types/v1/amf/types/AMFBaseType.d.ts +25 -0
- package/dist/types/v1/amf/types/AMFDiscriminatedObjectType.d.ts +34 -0
- package/dist/types/v1/amf/types/AMFEnumType.d.ts +18 -0
- package/dist/types/v1/amf/types/AMFNilType.d.ts +7 -0
- package/dist/types/v1/amf/types/AMFNotType.d.ts +18 -0
- package/dist/types/v1/amf/types/AMFObjectType.d.ts +14 -0
- package/dist/types/v1/amf/types/AMFOneOfType.d.ts +17 -0
- package/dist/types/v1/amf/types/AMFRefType.d.ts +10 -0
- package/dist/types/v1/amf/types/AMFScalarTypes.d.ts +47 -0
- package/dist/types/v1/amf/types/__tests__/AMFAnyType.spec.d.ts +1 -0
- package/dist/types/v1/amf/types/__tests__/AMFArrayType.spec.d.ts +1 -0
- package/dist/types/v1/amf/types/__tests__/AMFBaseType.spec.d.ts +1 -0
- package/dist/types/v1/amf/types/__tests__/AMFDiscriminatedObjectType.spec.d.ts +1 -0
- package/dist/types/v1/amf/types/__tests__/AMFEnumType.spec.d.ts +1 -0
- package/dist/types/v1/amf/types/__tests__/AMFNilType.spec.d.ts +1 -0
- package/dist/types/v1/amf/types/__tests__/AMFNotType.spec.d.ts +1 -0
- package/dist/types/v1/amf/types/__tests__/AMFObjectType.spec.d.ts +1 -0
- package/dist/types/v1/amf/types/__tests__/AMFOneOfType.spec.d.ts +1 -0
- package/dist/types/v1/amf/types/__tests__/AMFScalarType.spec.d.ts +1 -0
- package/dist/types/v1/amf/types/__tests__/annotations-schemas.spec.d.ts +1 -0
- package/dist/types/v1/amf/types/__tests__/factory.spec.d.ts +1 -0
- package/dist/types/v1/amf/types/annotations-schemas.d.ts +172 -0
- package/dist/types/v1/amf/types/factory.d.ts +23 -0
- package/dist/types/v1/amf/types/index.d.ts +16 -0
- package/dist/types/v1/amf/validation.d.ts +11 -0
- package/dist/types/v1/amf/version.d.ts +3 -0
- package/dist/types/v1/api/__tests__/api.spec.d.ts +1 -0
- package/dist/types/v1/api/__tests__/index.spec.d.ts +0 -0
- package/dist/types/v1/api/api.d.ts +37 -0
- package/dist/types/v1/api/endpoint.d.ts +162 -0
- package/dist/types/v1/api/index.d.ts +5 -0
- package/dist/types/v1/api/service-overrides.d.ts +249 -0
- package/dist/types/v1/api/service.d.ts +23 -0
- package/dist/types/v1/api/validation/bindings.d.ts +6 -0
- package/dist/types/v1/api/validation/endpoint/__tests__/index.spec.d.ts +1 -0
- package/dist/types/v1/api/validation/endpoint/index.d.ts +3 -0
- package/dist/types/v1/api/validation/index.d.ts +16 -0
- package/dist/types/v1/api/validation/operation/BodyDataValidator.d.ts +13 -0
- package/dist/types/v1/api/validation/operation/InvalidationValidator.d.ts +39 -0
- package/dist/types/v1/api/validation/operation/KeyMatchValidator.d.ts +7 -0
- package/dist/types/v1/api/validation/operation/KeySourceValidator.d.ts +25 -0
- package/dist/types/v1/api/validation/operation/NoNormalizedTypesValidator.d.ts +19 -0
- package/dist/types/v1/api/validation/operation/Response200Validator.d.ts +96 -0
- package/dist/types/v1/api/validation/operation/__tests__/BodyDataValidator.spec.d.ts +1 -0
- package/dist/types/v1/api/validation/operation/__tests__/InvalidationValidator.spec.d.ts +1 -0
- package/dist/types/v1/api/validation/operation/__tests__/KeyMatchValidator.spec.d.ts +1 -0
- package/dist/types/v1/api/validation/operation/__tests__/KeySourceValidator.spec.d.ts +1 -0
- package/dist/types/v1/api/validation/operation/__tests__/NoNormalizedTypesValidator.spec.d.ts +1 -0
- package/dist/types/v1/api/validation/operation/__tests__/Response200Validator.spec.d.ts +1 -0
- package/dist/types/v1/api/validation/operation/__tests__/index.spec.d.ts +1 -0
- package/dist/types/v1/api/validation/operation/__tests__/utils.spec.d.ts +1 -0
- package/dist/types/v1/api/validation/operation/index.d.ts +3 -0
- package/dist/types/v1/api/validation/operation/utils.d.ts +4 -0
- package/dist/types/v1/index.d.ts +3 -0
- package/dist/types/v1/types/Type.d.ts +106 -0
- package/dist/types/v1/types/TypeRegistry.d.ts +19 -0
- package/dist/types/v1/types/__tests__/TypeRegistry.spec.d.ts +1 -0
- package/dist/types/v1/types/__tests__/types-equal.spec.d.ts +1 -0
- package/dist/types/v1/types/__tests__/utils.spec.d.ts +1 -0
- package/dist/types/v1/types/index.d.ts +5 -0
- package/dist/types/v1/types/types-equal.d.ts +2 -0
- package/dist/types/v1/types/utils.d.ts +27 -0
- package/dist/types/v1/types/validators/__tests__/common.spec.d.ts +1 -0
- package/dist/types/v1/types/validators/__tests__/index.spec.d.ts +1 -0
- package/dist/types/v1/types/validators/common.d.ts +4 -0
- package/dist/types/v1/types/validators/extensions/KeyFieldReferenceValidator.d.ts +11 -0
- package/dist/types/v1/types/validators/extensions/KeyIsDefinedInSupportedTypeValidator.d.ts +20 -0
- package/dist/types/v1/types/validators/extensions/KeySourcesValidator.d.ts +25 -0
- package/dist/types/v1/types/validators/extensions/__tests__/KeyFieldReferenceValidator.spec.d.ts +1 -0
- package/dist/types/v1/types/validators/extensions/__tests__/KeyIsDefinedInSupportedTypeValidator.spec.d.ts +1 -0
- package/dist/types/v1/types/validators/extensions/__tests__/KeySourcesValidator.spec.d.ts +1 -0
- package/dist/types/v1/types/validators/extensions/index.d.ts +3 -0
- package/dist/types/v1/types/validators/index.d.ts +4 -0
- package/dist/types/v1/validation.d.ts +29 -0
- package/dist/types/v1/zod-utils.d.ts +2 -0
- package/dist/v1/index.js +7346 -0
- package/dist/v1/index.js.map +1 -0
- package/package.json +42 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import amf from 'amf-client-js';
|
|
2
|
+
import { AMFAPI } from './AMFAPI';
|
|
3
|
+
import type { FileParserLogger, NamedLoggerService } from '@conduit-client/utils';
|
|
4
|
+
import type { NamedFeatureFlagsService } from '@conduit-client/service-feature-flags/v1';
|
|
5
|
+
export declare function parseAmfDocument(source: URL, logger: FileParserLogger): Promise<amf.Document>;
|
|
6
|
+
export declare function parseUrl(source: URL, services: NamedLoggerService & NamedFeatureFlagsService, fileParserLogger: FileParserLogger): Promise<AMFAPI>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { AMFBaseType } from './AMFBaseType';
|
|
2
|
+
import type { AMFType } from '.';
|
|
3
|
+
import type { AllOfType, DiscriminatedObjectType, Type } from '../../types';
|
|
4
|
+
import type amf from 'amf-client-js';
|
|
5
|
+
export type AMFAllOfType = AMFType & AllOfType;
|
|
6
|
+
export declare class AMFAllOfTypeImpl extends AMFBaseType<'allOf', amf.AnyShape> implements AMFAllOfType {
|
|
7
|
+
type: "allOf";
|
|
8
|
+
values?: (string | number | boolean | null)[] | undefined;
|
|
9
|
+
allOf: AMFType[];
|
|
10
|
+
typeResolve(): void;
|
|
11
|
+
includes(t: Type): boolean;
|
|
12
|
+
get discriminatedParent(): DiscriminatedObjectType | undefined;
|
|
13
|
+
protected validateDiscriminators(): void;
|
|
14
|
+
get extensions(): {
|
|
15
|
+
type: "unidentifiable";
|
|
16
|
+
} | {
|
|
17
|
+
type: "identifiable";
|
|
18
|
+
key: {
|
|
19
|
+
fields: Record<string, string>;
|
|
20
|
+
};
|
|
21
|
+
'cache-control': import("../..").TypeCacheControlExtension;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AMFBaseType } from './AMFBaseType';
|
|
2
|
+
import type { AMFType } from '.';
|
|
3
|
+
import type { AnyType } from '../../types';
|
|
4
|
+
export type AMFAnyType = AMFType & AnyType;
|
|
5
|
+
export declare class AMFAnyTypeImpl extends AMFBaseType<'any'> implements AMFAnyType {
|
|
6
|
+
type: "any";
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AMFBaseType } from './AMFBaseType';
|
|
2
|
+
import type amf from 'amf-client-js';
|
|
3
|
+
import type { AMFType } from '.';
|
|
4
|
+
import type { ArrayType, Type } from '../../types';
|
|
5
|
+
export type AMFArrayType = AMFType & ArrayType;
|
|
6
|
+
export declare class AMFArrayTypeImpl extends AMFBaseType<'array', amf.ArrayShape> implements AMFArrayType {
|
|
7
|
+
type: "array";
|
|
8
|
+
items: Type;
|
|
9
|
+
typeResolve(): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { AMFTypeFactory } from './factory';
|
|
2
|
+
import type amf from 'amf-client-js';
|
|
3
|
+
import type { BaseType, Type, TypeExtensions, TypeRegistry } from '../../types';
|
|
4
|
+
import type { AMFType } from '.';
|
|
5
|
+
import type { FileParserLogger, LoggerService } from '@conduit-client/utils';
|
|
6
|
+
import type { API } from '../../api';
|
|
7
|
+
export declare abstract class AMFBaseType<T extends Type['type'], S extends amf.AnyShape = amf.AnyShape> implements BaseType {
|
|
8
|
+
api: API;
|
|
9
|
+
shape: S;
|
|
10
|
+
protected typeRegistry: TypeRegistry<AMFType>;
|
|
11
|
+
protected factory: AMFTypeFactory;
|
|
12
|
+
protected logger: LoggerService;
|
|
13
|
+
protected fileParserLogger: FileParserLogger;
|
|
14
|
+
resolved: boolean;
|
|
15
|
+
abstract type: T;
|
|
16
|
+
parsedExtensions: TypeExtensions;
|
|
17
|
+
shapePosition: {
|
|
18
|
+
line: number;
|
|
19
|
+
column: number;
|
|
20
|
+
};
|
|
21
|
+
constructor(api: API, shape: S, typeRegistry: TypeRegistry<AMFType>, factory: AMFTypeFactory, logger: LoggerService, fileParserLogger: FileParserLogger);
|
|
22
|
+
resolve(): void;
|
|
23
|
+
typeResolve(): void;
|
|
24
|
+
get extensions(): TypeExtensions;
|
|
25
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { AMFObjectType, type AMFType, type AMFTypeFactory, AMFTypeProps } from './index';
|
|
2
|
+
import type amf from 'amf-client-js';
|
|
3
|
+
import type { DiscriminatedObjectType, Type, TypeRegistry } from '../../types';
|
|
4
|
+
import type { API } from '../../api';
|
|
5
|
+
import type { FileParserLogger, LoggerService } from '@conduit-client/utils';
|
|
6
|
+
import { AMFBaseType } from './AMFBaseType';
|
|
7
|
+
export type AMFDiscriminatedObjectType = AMFTypeProps<amf.NodeShape> & DiscriminatedObjectType;
|
|
8
|
+
export declare class AMFDiscriminatedObjectTypeImpl extends AMFBaseType<'discriminatedObject', amf.NodeShape> implements AMFDiscriminatedObjectType {
|
|
9
|
+
shape: amf.NodeShape;
|
|
10
|
+
protected typeRegistry: TypeRegistry<AMFType>;
|
|
11
|
+
protected factory: AMFTypeFactory;
|
|
12
|
+
protected logger: LoggerService;
|
|
13
|
+
protected fileParserLogger: FileParserLogger;
|
|
14
|
+
readonly type = "discriminatedObject";
|
|
15
|
+
readonly baseType: AMFObjectType;
|
|
16
|
+
readonly discriminator: string;
|
|
17
|
+
protected _mapping: Record<string, Type> | undefined;
|
|
18
|
+
constructor(api: API, shape: amf.NodeShape, typeRegistry: TypeRegistry<AMFType>, factory: AMFTypeFactory, logger: LoggerService, fileParserLogger: FileParserLogger);
|
|
19
|
+
typeResolve(): void;
|
|
20
|
+
get mapping(): Record<string, Type>;
|
|
21
|
+
private resolveDiscriminator;
|
|
22
|
+
/**
|
|
23
|
+
* Adds implicit discriminator values (i.e., type names) as mappings to types
|
|
24
|
+
*
|
|
25
|
+
* @private
|
|
26
|
+
*/
|
|
27
|
+
private buildImplicitMapping;
|
|
28
|
+
/**
|
|
29
|
+
* Adds explicit discriminator values as mappings to types
|
|
30
|
+
*
|
|
31
|
+
* @private
|
|
32
|
+
*/
|
|
33
|
+
private buildExplicitMapping;
|
|
34
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AMFBaseType } from './AMFBaseType';
|
|
2
|
+
import type { AMFType, AMFTypeFactory, AMFTypeProps } from '.';
|
|
3
|
+
import type { EnumType } from '../../types';
|
|
4
|
+
import type amf from 'amf-client-js';
|
|
5
|
+
import type { TypeRegistry } from '../../types';
|
|
6
|
+
import type { FileParserLogger, LoggerService } from '@conduit-client/utils';
|
|
7
|
+
import type { API } from '../../api';
|
|
8
|
+
export type AMFEnumType = AMFTypeProps & EnumType;
|
|
9
|
+
export declare class AMFEnumTypeImpl extends AMFBaseType<'enum'> implements AMFEnumType {
|
|
10
|
+
shape: amf.NodeShape;
|
|
11
|
+
protected typeRegistry: TypeRegistry<AMFType>;
|
|
12
|
+
protected factory: AMFTypeFactory;
|
|
13
|
+
protected logger: LoggerService;
|
|
14
|
+
protected fileParserLogger: FileParserLogger;
|
|
15
|
+
type: "enum";
|
|
16
|
+
values: never[];
|
|
17
|
+
constructor(api: API, shape: amf.NodeShape, typeRegistry: TypeRegistry<AMFType>, factory: AMFTypeFactory, logger: LoggerService, fileParserLogger: FileParserLogger);
|
|
18
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AMFBaseType } from './AMFBaseType';
|
|
2
|
+
import type { AMFTypeProps } from '.';
|
|
3
|
+
import type { NilType } from '../../types';
|
|
4
|
+
export type AMFNilType = AMFTypeProps & NilType;
|
|
5
|
+
export declare class AMFNilTypeImpl extends AMFBaseType<'nil'> implements AMFNilType {
|
|
6
|
+
type: "nil";
|
|
7
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AMFBaseType } from './AMFBaseType';
|
|
2
|
+
import type { AMFType, AMFTypeFactory, AMFTypeProps } from '.';
|
|
3
|
+
import type { NotType, Type } from '../../types';
|
|
4
|
+
import type amf from 'amf-client-js';
|
|
5
|
+
import type { TypeRegistry } from '../../types';
|
|
6
|
+
import type { FileParserLogger, LoggerService } from '@conduit-client/utils';
|
|
7
|
+
import type { API } from '../../api';
|
|
8
|
+
export type AMFNotType = AMFTypeProps<amf.NodeShape> & NotType;
|
|
9
|
+
export declare class AMFNotTypeImpl extends AMFBaseType<'not', amf.NodeShape> implements AMFNotType {
|
|
10
|
+
shape: amf.NodeShape;
|
|
11
|
+
protected typeRegistry: TypeRegistry<AMFType>;
|
|
12
|
+
protected factory: AMFTypeFactory;
|
|
13
|
+
protected logger: LoggerService;
|
|
14
|
+
protected fileParserLogger: FileParserLogger;
|
|
15
|
+
type: "not";
|
|
16
|
+
not: Type;
|
|
17
|
+
constructor(api: API, shape: amf.NodeShape, typeRegistry: TypeRegistry<AMFType>, factory: AMFTypeFactory, logger: LoggerService, fileParserLogger: FileParserLogger);
|
|
18
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AMFBaseType } from './AMFBaseType';
|
|
2
|
+
import type amf from 'amf-client-js';
|
|
3
|
+
import type { AMFTypeProps } from '.';
|
|
4
|
+
import type { Property, ObjectType, Type } from '../../types';
|
|
5
|
+
export type AMFObjectType = AMFTypeProps<amf.NodeShape> & ObjectType;
|
|
6
|
+
export declare class AMFObjectTypeImpl extends AMFBaseType<'object', amf.NodeShape> implements AMFObjectType {
|
|
7
|
+
type: "object";
|
|
8
|
+
properties: Record<string, Property>;
|
|
9
|
+
resolved: boolean;
|
|
10
|
+
additionalProperties: Type;
|
|
11
|
+
typeResolve(): void;
|
|
12
|
+
private resolveProperties;
|
|
13
|
+
private resolveAdditionalProperties;
|
|
14
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AMFBaseType } from './AMFBaseType';
|
|
2
|
+
import type { AMFType } from '.';
|
|
3
|
+
import type { OneOf } from '../../types';
|
|
4
|
+
import type amf from 'amf-client-js';
|
|
5
|
+
export type AMFOneOfType = AMFType & OneOf;
|
|
6
|
+
export declare class AMFOneOfTypeImpl extends AMFBaseType<'oneOf', amf.UnionShape> implements AMFOneOfType {
|
|
7
|
+
type: "oneOf";
|
|
8
|
+
values?: (string | number | boolean | null)[] | undefined;
|
|
9
|
+
oneOf: AMFType[];
|
|
10
|
+
typeResolve(): void;
|
|
11
|
+
/**
|
|
12
|
+
* When AMF encounters 'nullable: true' on an object with identifiable extensions,
|
|
13
|
+
* it converts it to a oneOf with [object, null]. This method detects this pattern
|
|
14
|
+
* and preserves the identifiable extensions from the object member on the union.
|
|
15
|
+
*/
|
|
16
|
+
private preserveIdentifiableExtensionsFromNullablePattern;
|
|
17
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AMFBaseType } from './AMFBaseType';
|
|
2
|
+
import type { RefType, AMFType, Type } from '../..';
|
|
3
|
+
import type amf from 'amf-client-js';
|
|
4
|
+
export type AMFRefType = AMFType & RefType;
|
|
5
|
+
export declare class AMFRefTypeImpl extends AMFBaseType<'ref', amf.AnyShape> implements AMFRefType {
|
|
6
|
+
type: "ref";
|
|
7
|
+
$ref: Type;
|
|
8
|
+
resolved: boolean;
|
|
9
|
+
typeResolve(): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { AMFBaseType } from './AMFBaseType';
|
|
2
|
+
import type amf from 'amf-client-js';
|
|
3
|
+
import type { AMFTypeProps, AMFType, AMFTypeFactory } from '.';
|
|
4
|
+
import type { BooleanType, DateTimeOnlyType, DateTimeType, DateType, DoubleType, IntegerType, NumberType, ScalarType, StringType, TimeType } from '../../types';
|
|
5
|
+
import type { TypeRegistry } from '../../types';
|
|
6
|
+
import type { FileParserLogger, LoggerService } from '@conduit-client/utils';
|
|
7
|
+
import type { API } from '../../api';
|
|
8
|
+
export type AMFBooleanType = AMFTypeProps & BooleanType;
|
|
9
|
+
export type AMFDoubleType = AMFTypeProps & DoubleType;
|
|
10
|
+
export type AMFIntegerType = AMFTypeProps & IntegerType;
|
|
11
|
+
export type AMFNumberType = AMFTypeProps & NumberType;
|
|
12
|
+
export type AMFStringType = AMFTypeProps & StringType;
|
|
13
|
+
export type AMFDateType = AMFTypeProps & DateType;
|
|
14
|
+
export type AMFTimeType = AMFTypeProps & TimeType;
|
|
15
|
+
export type AMFDateTimeOnlyType = AMFTypeProps & DateTimeOnlyType;
|
|
16
|
+
export type AMFDateTimeType = AMFTypeProps & DateTimeType;
|
|
17
|
+
export declare abstract class AMFEnumerableScalarType<T extends string | number | boolean | null, S extends ScalarType['type']> extends AMFBaseType<S> {
|
|
18
|
+
values?: Array<T>;
|
|
19
|
+
typeResolve(): void;
|
|
20
|
+
}
|
|
21
|
+
export declare class AMFBooleanTypeImpl extends AMFEnumerableScalarType<boolean, 'boolean'> implements AMFBooleanType {
|
|
22
|
+
type: "boolean";
|
|
23
|
+
}
|
|
24
|
+
export declare class AMFDoubleTypeImpl extends AMFEnumerableScalarType<number, 'double'> implements AMFDoubleType {
|
|
25
|
+
type: "double";
|
|
26
|
+
}
|
|
27
|
+
export declare class AMFIntegerTypeImpl extends AMFEnumerableScalarType<number, 'integer'> implements AMFIntegerType {
|
|
28
|
+
type: "integer";
|
|
29
|
+
}
|
|
30
|
+
export declare class AMFNumberTypeImpl extends AMFEnumerableScalarType<number, 'number'> implements AMFNumberType {
|
|
31
|
+
type: "number";
|
|
32
|
+
}
|
|
33
|
+
export declare class AMFStringTypeImpl extends AMFEnumerableScalarType<string, 'string'> implements AMFStringType {
|
|
34
|
+
type: "string";
|
|
35
|
+
}
|
|
36
|
+
export declare class AMFDateTypeImpl extends AMFEnumerableScalarType<string, 'date'> implements AMFDateType {
|
|
37
|
+
type: "date";
|
|
38
|
+
}
|
|
39
|
+
declare const DATE = "date";
|
|
40
|
+
declare const DATE_TIME = "date-time";
|
|
41
|
+
export declare class AMFDateTimeImpl extends AMFEnumerableScalarType<string, 'datetime'> implements AMFDateTimeType {
|
|
42
|
+
shape: amf.ScalarShape;
|
|
43
|
+
type: "datetime";
|
|
44
|
+
format: typeof DATE | typeof DATE_TIME;
|
|
45
|
+
constructor(api: API, shape: amf.ScalarShape, typeRegistry: TypeRegistry<AMFType>, factory: AMFTypeFactory, logger: LoggerService, fileParserLogger: FileParserLogger);
|
|
46
|
+
}
|
|
47
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { CacheStrategy } from '../..';
|
|
3
|
+
export declare const cacheControl: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
4
|
+
type: z.ZodLiteral<"max-age">;
|
|
5
|
+
'max-age': z.ZodNumber;
|
|
6
|
+
'stale-while-revalidate': z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
}, "strict", z.ZodTypeAny, {
|
|
8
|
+
'max-age': number;
|
|
9
|
+
type: "max-age";
|
|
10
|
+
'stale-while-revalidate'?: number | undefined;
|
|
11
|
+
}, {
|
|
12
|
+
'max-age': number;
|
|
13
|
+
type: "max-age";
|
|
14
|
+
'stale-while-revalidate'?: number | undefined;
|
|
15
|
+
}>, z.ZodObject<{
|
|
16
|
+
type: z.ZodLiteral<"no-cache">;
|
|
17
|
+
}, "strip", z.ZodTypeAny, {
|
|
18
|
+
type: "no-cache";
|
|
19
|
+
}, {
|
|
20
|
+
type: "no-cache";
|
|
21
|
+
}>]>;
|
|
22
|
+
export declare const resourceCacheControl: z.ZodObject<{
|
|
23
|
+
'max-age': z.ZodNumber;
|
|
24
|
+
'stale-while-revalidate': z.ZodOptional<z.ZodNumber>;
|
|
25
|
+
}, "strict", z.ZodTypeAny, {
|
|
26
|
+
'max-age': number;
|
|
27
|
+
'stale-while-revalidate'?: number | undefined;
|
|
28
|
+
}, {
|
|
29
|
+
'max-age': number;
|
|
30
|
+
'stale-while-revalidate'?: number | undefined;
|
|
31
|
+
}>;
|
|
32
|
+
export declare const operationCacheStrategy: (defaultCacheStrategyType?: Pick<CacheStrategy, "type">) => z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
33
|
+
type: z.ZodLiteral<"none">;
|
|
34
|
+
}, "strict", z.ZodTypeAny, {
|
|
35
|
+
type: "none";
|
|
36
|
+
}, {
|
|
37
|
+
type: "none";
|
|
38
|
+
}>, z.ZodObject<{
|
|
39
|
+
type: z.ZodLiteral<"resource">;
|
|
40
|
+
config: z.ZodObject<{
|
|
41
|
+
'max-age': z.ZodNumber;
|
|
42
|
+
'stale-while-revalidate': z.ZodOptional<z.ZodNumber>;
|
|
43
|
+
}, "strict", z.ZodTypeAny, {
|
|
44
|
+
'max-age': number;
|
|
45
|
+
'stale-while-revalidate'?: number | undefined;
|
|
46
|
+
}, {
|
|
47
|
+
'max-age': number;
|
|
48
|
+
'stale-while-revalidate'?: number | undefined;
|
|
49
|
+
}>;
|
|
50
|
+
}, "strict", z.ZodTypeAny, {
|
|
51
|
+
type: "resource";
|
|
52
|
+
config: {
|
|
53
|
+
'max-age': number;
|
|
54
|
+
'stale-while-revalidate'?: number | undefined;
|
|
55
|
+
};
|
|
56
|
+
}, {
|
|
57
|
+
type: "resource";
|
|
58
|
+
config: {
|
|
59
|
+
'max-age': number;
|
|
60
|
+
'stale-while-revalidate'?: number | undefined;
|
|
61
|
+
};
|
|
62
|
+
}>, z.ZodObject<{
|
|
63
|
+
type: z.ZodLiteral<"normalized">;
|
|
64
|
+
'cache-control': z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
65
|
+
type: z.ZodLiteral<"max-age">;
|
|
66
|
+
'max-age': z.ZodNumber;
|
|
67
|
+
'stale-while-revalidate': z.ZodOptional<z.ZodNumber>;
|
|
68
|
+
}, "strict", z.ZodTypeAny, {
|
|
69
|
+
'max-age': number;
|
|
70
|
+
type: "max-age";
|
|
71
|
+
'stale-while-revalidate'?: number | undefined;
|
|
72
|
+
}, {
|
|
73
|
+
'max-age': number;
|
|
74
|
+
type: "max-age";
|
|
75
|
+
'stale-while-revalidate'?: number | undefined;
|
|
76
|
+
}>, z.ZodObject<{
|
|
77
|
+
type: z.ZodLiteral<"no-cache">;
|
|
78
|
+
}, "strip", z.ZodTypeAny, {
|
|
79
|
+
type: "no-cache";
|
|
80
|
+
}, {
|
|
81
|
+
type: "no-cache";
|
|
82
|
+
}>]>>;
|
|
83
|
+
key: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodString>, Record<string, string>, Record<string, string>>>;
|
|
84
|
+
}, "strict", z.ZodTypeAny, {
|
|
85
|
+
type: "normalized";
|
|
86
|
+
key?: Record<string, string> | undefined;
|
|
87
|
+
'cache-control'?: {
|
|
88
|
+
'max-age': number;
|
|
89
|
+
type: "max-age";
|
|
90
|
+
'stale-while-revalidate'?: number | undefined;
|
|
91
|
+
} | {
|
|
92
|
+
type: "no-cache";
|
|
93
|
+
} | undefined;
|
|
94
|
+
}, {
|
|
95
|
+
type: "normalized";
|
|
96
|
+
key?: Record<string, string> | undefined;
|
|
97
|
+
'cache-control'?: {
|
|
98
|
+
'max-age': number;
|
|
99
|
+
type: "max-age";
|
|
100
|
+
'stale-while-revalidate'?: number | undefined;
|
|
101
|
+
} | {
|
|
102
|
+
type: "no-cache";
|
|
103
|
+
} | undefined;
|
|
104
|
+
}>]>, {
|
|
105
|
+
type: "none";
|
|
106
|
+
} | {
|
|
107
|
+
type: "resource";
|
|
108
|
+
config: {
|
|
109
|
+
'max-age': number;
|
|
110
|
+
'stale-while-revalidate'?: number | undefined;
|
|
111
|
+
};
|
|
112
|
+
} | {
|
|
113
|
+
type: "normalized";
|
|
114
|
+
key?: Record<string, string> | undefined;
|
|
115
|
+
'cache-control'?: {
|
|
116
|
+
'max-age': number;
|
|
117
|
+
type: "max-age";
|
|
118
|
+
'stale-while-revalidate'?: number | undefined;
|
|
119
|
+
} | {
|
|
120
|
+
type: "no-cache";
|
|
121
|
+
} | undefined;
|
|
122
|
+
}, unknown>;
|
|
123
|
+
export declare const typeExtensions: z.ZodObject<{
|
|
124
|
+
key: z.ZodObject<{
|
|
125
|
+
fields: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
126
|
+
}, "strip", z.ZodTypeAny, {
|
|
127
|
+
fields: Record<string, string>;
|
|
128
|
+
}, {
|
|
129
|
+
fields: Record<string, string>;
|
|
130
|
+
}>;
|
|
131
|
+
'cache-control': z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
132
|
+
type: z.ZodLiteral<"max-age">;
|
|
133
|
+
'max-age': z.ZodNumber;
|
|
134
|
+
'stale-while-revalidate': z.ZodOptional<z.ZodNumber>;
|
|
135
|
+
}, "strict", z.ZodTypeAny, {
|
|
136
|
+
'max-age': number;
|
|
137
|
+
type: "max-age";
|
|
138
|
+
'stale-while-revalidate'?: number | undefined;
|
|
139
|
+
}, {
|
|
140
|
+
'max-age': number;
|
|
141
|
+
type: "max-age";
|
|
142
|
+
'stale-while-revalidate'?: number | undefined;
|
|
143
|
+
}>, z.ZodObject<{
|
|
144
|
+
type: z.ZodLiteral<"no-cache">;
|
|
145
|
+
}, "strip", z.ZodTypeAny, {
|
|
146
|
+
type: "no-cache";
|
|
147
|
+
}, {
|
|
148
|
+
type: "no-cache";
|
|
149
|
+
}>]>;
|
|
150
|
+
}, "strict", z.ZodTypeAny, {
|
|
151
|
+
key: {
|
|
152
|
+
fields: Record<string, string>;
|
|
153
|
+
};
|
|
154
|
+
'cache-control': {
|
|
155
|
+
'max-age': number;
|
|
156
|
+
type: "max-age";
|
|
157
|
+
'stale-while-revalidate'?: number | undefined;
|
|
158
|
+
} | {
|
|
159
|
+
type: "no-cache";
|
|
160
|
+
};
|
|
161
|
+
}, {
|
|
162
|
+
key: {
|
|
163
|
+
fields: Record<string, string>;
|
|
164
|
+
};
|
|
165
|
+
'cache-control': {
|
|
166
|
+
'max-age': number;
|
|
167
|
+
type: "max-age";
|
|
168
|
+
'stale-while-revalidate'?: number | undefined;
|
|
169
|
+
} | {
|
|
170
|
+
type: "no-cache";
|
|
171
|
+
};
|
|
172
|
+
}>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type amf from 'amf-client-js';
|
|
2
|
+
import type { AMFType } from '.';
|
|
3
|
+
import type { TypeRegistry, Type } from '../../types';
|
|
4
|
+
import type { FileParserLogger, LoggerService } from '@conduit-client/utils';
|
|
5
|
+
import type { API } from '../../api';
|
|
6
|
+
/**
|
|
7
|
+
* Constructs an AMFType based on the provided AMF Shape and a set of parameters that guide the creation process.
|
|
8
|
+
*
|
|
9
|
+
* @param api The API
|
|
10
|
+
* @param shape The AMF Shape for which an AMFType is to be created.
|
|
11
|
+
* @param typeRegistry The TypeRegistry is searched for an existing AMFType that corresponds to the shape.
|
|
12
|
+
* If a match is found based on shape IDs, it is returned instead of creating a new AMFType.
|
|
13
|
+
* @param logger A LoggerService for logging standard operations.
|
|
14
|
+
* @param fileParserLogger A FileParserLogger for logging file parsing specific operations.
|
|
15
|
+
* @param resolve Optional boolean flag to determine if the constructed type should resolve references (default: false).
|
|
16
|
+
* @param allowedTypes Optional set of allowed type categories (e.g., 'allOf', 'oneOf') to limit the types constructed (default: empty set).
|
|
17
|
+
* @param skipRegistry Optional boolean flag to bypass type registry cache lookup for an existing type (default: false).
|
|
18
|
+
* @returns The constructed or retrieved AMFType based on the provided shape and conditions.
|
|
19
|
+
*
|
|
20
|
+
* @throws Error if the shape type is unsupported, unrecognized, or if specific conditions like 'oneOf' are encountered without support.
|
|
21
|
+
*/
|
|
22
|
+
export declare function amfTypeFactory(api: API, shape: amf.Shape, typeRegistry: TypeRegistry<AMFType>, logger: LoggerService, fileParserLogger: FileParserLogger, resolve?: boolean, allowedTypes?: Set<Type['type']> | undefined, skipRegistry?: boolean): AMFType;
|
|
23
|
+
export type AMFTypeFactory = typeof amfTypeFactory;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type amf from 'amf-client-js';
|
|
2
|
+
import type { Type } from '../../types';
|
|
3
|
+
export type AMFTypeProps<S extends amf.AnyShape = amf.AnyShape> = {
|
|
4
|
+
shape: S;
|
|
5
|
+
resolve: () => void;
|
|
6
|
+
resolved: boolean;
|
|
7
|
+
};
|
|
8
|
+
export type AMFType = AMFTypeProps & Type;
|
|
9
|
+
export * from './AMFAnyType';
|
|
10
|
+
export * from './AMFArrayType';
|
|
11
|
+
export * from './AMFObjectType';
|
|
12
|
+
export * from './AMFNilType';
|
|
13
|
+
export * from './AMFScalarTypes';
|
|
14
|
+
export * from './AMFOneOfType';
|
|
15
|
+
export * from './factory';
|
|
16
|
+
export * from './annotations-schemas';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { FileParserLogger } from '@conduit-client/utils';
|
|
2
|
+
import type { AMFAPI } from './AMFAPI';
|
|
3
|
+
/**
|
|
4
|
+
* Validates the @api and logs any information related to validation. Returns
|
|
5
|
+
* true when the @api model is valid and false otherwise.
|
|
6
|
+
*
|
|
7
|
+
* @param api
|
|
8
|
+
* @param fileParserlogger
|
|
9
|
+
* @returns true when the @api model is valid, false otherwise.
|
|
10
|
+
*/
|
|
11
|
+
export declare function isValidAmfAPI(api: AMFAPI, fileParserlogger: FileParserLogger): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
File without changes
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { CacheStrategy, EndPoint, UrlParameter } from './endpoint';
|
|
2
|
+
import type { ResolvedOperationServices, ResolvedServiceOverrides } from './service-overrides';
|
|
3
|
+
import type { ReadOnlyTypeRegistry } from '../types';
|
|
4
|
+
import type { TypeCacheControlExtension } from '../types';
|
|
5
|
+
export type API = {
|
|
6
|
+
/**
|
|
7
|
+
* The set of types defined by the API.
|
|
8
|
+
*/
|
|
9
|
+
types: ReadOnlyTypeRegistry;
|
|
10
|
+
/**
|
|
11
|
+
* EndPoints exposed by this API.
|
|
12
|
+
*/
|
|
13
|
+
endpoints: ReadonlyArray<EndPoint>;
|
|
14
|
+
/**
|
|
15
|
+
* Servers defined by the API.
|
|
16
|
+
*/
|
|
17
|
+
servers: ReadonlyArray<Server>;
|
|
18
|
+
defaults: {
|
|
19
|
+
operationCacheStrategy: Pick<CacheStrategy, 'type'>;
|
|
20
|
+
typeCacheControl?: Partial<TypeCacheControlExtension>;
|
|
21
|
+
services?: ResolvedOperationServices;
|
|
22
|
+
};
|
|
23
|
+
namespace: string;
|
|
24
|
+
/**
|
|
25
|
+
* The base path used for resolving relative file references in extensions.
|
|
26
|
+
* For YAML/JSON APIs, this is typically the directory containing the API definition file.
|
|
27
|
+
*/
|
|
28
|
+
basePath: string;
|
|
29
|
+
/**
|
|
30
|
+
* Parsed and validated components-level services catalog, if provided.
|
|
31
|
+
*/
|
|
32
|
+
serviceOverrides?: ResolvedServiceOverrides;
|
|
33
|
+
};
|
|
34
|
+
export type Server = {
|
|
35
|
+
url: string;
|
|
36
|
+
uriParameters: Record<string, UrlParameter>;
|
|
37
|
+
};
|