@conduit-client/model 2.0.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/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 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type FileParserLogger, type NamedLoggerService } from '@conduit-client/utils';
|
|
2
|
+
import { type ResolvedServiceOverrides } from '../api/service-overrides';
|
|
3
|
+
import type { AMFType } from './types';
|
|
4
|
+
import type { API, EndPoint, Server } from '../api';
|
|
5
|
+
import type { ReadOnlyTypeRegistry, TypeRegistry } from '../types';
|
|
6
|
+
import type * as amf from 'amf-client-js';
|
|
7
|
+
import type { NamedFeatureFlagsService } from '@conduit-client/service-feature-flags/v1';
|
|
8
|
+
export declare const V1_VERSION = "1.0.0";
|
|
9
|
+
export declare const ANONYMOUS_TYPE_NAME = "<anonymous>";
|
|
10
|
+
export declare class AMFAPI implements API {
|
|
11
|
+
readonly document: amf.Document;
|
|
12
|
+
private services;
|
|
13
|
+
private fileParserlogger;
|
|
14
|
+
typeRegistry?: TypeRegistry<AMFType>;
|
|
15
|
+
_endpoints?: EndPoint[];
|
|
16
|
+
_servers?: Server[];
|
|
17
|
+
annotationsVersion?: string;
|
|
18
|
+
basePath: string;
|
|
19
|
+
private built;
|
|
20
|
+
private parsedDefaultOperationCacheStrategyType?;
|
|
21
|
+
private parsedDefaultTypeCacheControl?;
|
|
22
|
+
private parsedNamespace?;
|
|
23
|
+
private defaultedNamespace;
|
|
24
|
+
serviceOverrides?: ResolvedServiceOverrides;
|
|
25
|
+
constructor(document: amf.Document, services: NamedLoggerService & NamedFeatureFlagsService, fileParserlogger: FileParserLogger);
|
|
26
|
+
private build;
|
|
27
|
+
private buildEndpoints;
|
|
28
|
+
private buildServers;
|
|
29
|
+
private buildTypes;
|
|
30
|
+
get webApi(): amf.WebApi;
|
|
31
|
+
get endpoints(): ReadonlyArray<EndPoint>;
|
|
32
|
+
get defaults(): API['defaults'];
|
|
33
|
+
get servers(): ReadonlyArray<Server>;
|
|
34
|
+
get types(): ReadOnlyTypeRegistry<AMFType>;
|
|
35
|
+
get namespace(): string;
|
|
36
|
+
checkAnnotationsVersion(): void;
|
|
37
|
+
setRootLevelAnnotations(): void;
|
|
38
|
+
/**
|
|
39
|
+
* Validates all endpoints and types. A validation error will be thrown if any are invalid.
|
|
40
|
+
*
|
|
41
|
+
* @protected
|
|
42
|
+
*/
|
|
43
|
+
validate(): void;
|
|
44
|
+
}
|
|
@@ -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,211 @@
|
|
|
1
|
+
import amf from 'amf-client-js';
|
|
2
|
+
type ClassOfConstructor<T> = T extends new () => infer R ? R : never;
|
|
3
|
+
type TestRaml<T extends Record<string, new () => amf.AnyShape>, E extends Record<string, string>> = {
|
|
4
|
+
document: amf.Document;
|
|
5
|
+
} & {
|
|
6
|
+
[P in keyof T]: ClassOfConstructor<T[P]>;
|
|
7
|
+
} & {
|
|
8
|
+
[P in keyof E]: amf.EndPoint;
|
|
9
|
+
};
|
|
10
|
+
export declare function readSpecFiles(): Promise<{
|
|
11
|
+
amfApi: TestRaml<{
|
|
12
|
+
Object_Simple: typeof amf.NodeShape;
|
|
13
|
+
Object_Flat: typeof amf.NodeShape;
|
|
14
|
+
}, {}>;
|
|
15
|
+
amfEndpoints: TestRaml<{}, {
|
|
16
|
+
entityById: string;
|
|
17
|
+
entity: string;
|
|
18
|
+
auraEntityById: string;
|
|
19
|
+
auraEntity: string;
|
|
20
|
+
entityMissing: string;
|
|
21
|
+
}>;
|
|
22
|
+
any: TestRaml<{
|
|
23
|
+
readonly Any: typeof amf.AnyShape;
|
|
24
|
+
}, {}>;
|
|
25
|
+
arrays: TestRaml<{
|
|
26
|
+
Array_Scalar: typeof amf.ArrayShape;
|
|
27
|
+
Array_NestedObjectArray: typeof amf.ArrayShape;
|
|
28
|
+
Object_Flat: typeof amf.NodeShape;
|
|
29
|
+
Array_NoItems: typeof amf.ArrayShape;
|
|
30
|
+
}, {}>;
|
|
31
|
+
datetimes: TestRaml<{
|
|
32
|
+
birthday: typeof amf.ScalarShape;
|
|
33
|
+
created: typeof amf.ScalarShape;
|
|
34
|
+
}, {}>;
|
|
35
|
+
discriminators: TestRaml<{
|
|
36
|
+
Object_Discriminated: typeof amf.NodeShape;
|
|
37
|
+
Object_Discriminated_Type1: typeof amf.NodeShape;
|
|
38
|
+
Object_Discriminated_Type2: typeof amf.NodeShape;
|
|
39
|
+
Object_Discriminated_Incorrect_Mapping: typeof amf.NodeShape;
|
|
40
|
+
Pet: typeof amf.NodeShape;
|
|
41
|
+
Dog: typeof amf.AnyShape;
|
|
42
|
+
Cat: typeof amf.AnyShape;
|
|
43
|
+
Puppy: typeof amf.AnyShape;
|
|
44
|
+
NewbornPuppy: typeof amf.AnyShape;
|
|
45
|
+
MultipleDiscriminatorInheritance: typeof amf.AnyShape;
|
|
46
|
+
InlineDiscriminator: typeof amf.AnyShape;
|
|
47
|
+
InlineInheritedDiscriminator: typeof amf.AnyShape;
|
|
48
|
+
}, {}>;
|
|
49
|
+
objects: TestRaml<{
|
|
50
|
+
Object_Simple: typeof amf.NodeShape;
|
|
51
|
+
Object_Simple2: typeof amf.NodeShape;
|
|
52
|
+
Object_Flat: typeof amf.NodeShape;
|
|
53
|
+
Object_Nested: typeof amf.NodeShape;
|
|
54
|
+
Object_With_Optional_Properties: typeof amf.NodeShape;
|
|
55
|
+
Object_With_Explicit_Allowed_Additional_Properties: typeof amf.NodeShape;
|
|
56
|
+
Object_No_Additional_Properties: typeof amf.NodeShape;
|
|
57
|
+
Object_With_Inline_Additional_Properties_Schema: typeof amf.NodeShape;
|
|
58
|
+
Object_With_Reference_Additional_Properties_Schema: typeof amf.NodeShape;
|
|
59
|
+
StringType: typeof amf.ScalarShape;
|
|
60
|
+
Object_Ref: typeof amf.NodeShape;
|
|
61
|
+
}, {}>;
|
|
62
|
+
not: TestRaml<{
|
|
63
|
+
Object: typeof amf.NodeShape;
|
|
64
|
+
NotObject: typeof amf.AnyShape;
|
|
65
|
+
}, {}>;
|
|
66
|
+
scalars: TestRaml<{
|
|
67
|
+
Boolean: typeof amf.ScalarShape;
|
|
68
|
+
Integer: typeof amf.ScalarShape;
|
|
69
|
+
Int32: typeof amf.ScalarShape;
|
|
70
|
+
Int64: typeof amf.ScalarShape;
|
|
71
|
+
Number: typeof amf.ScalarShape;
|
|
72
|
+
Float: typeof amf.ScalarShape;
|
|
73
|
+
Double: typeof amf.ScalarShape;
|
|
74
|
+
String: typeof amf.ScalarShape;
|
|
75
|
+
Password: typeof amf.ScalarShape;
|
|
76
|
+
AnyString: typeof amf.ScalarShape;
|
|
77
|
+
Byte: typeof amf.ScalarShape;
|
|
78
|
+
Binary: typeof amf.ScalarShape;
|
|
79
|
+
Nullable_String: typeof amf.UnionShape;
|
|
80
|
+
String_Inherited: typeof amf.ScalarShape;
|
|
81
|
+
}, {}>;
|
|
82
|
+
invalidScalars: TestRaml<{
|
|
83
|
+
IncorrectlyAnnotated: typeof amf.ScalarShape;
|
|
84
|
+
}, {}>;
|
|
85
|
+
amfYamlExtensions: TestRaml<{}, {
|
|
86
|
+
entityById: string;
|
|
87
|
+
entityDetailsById: string;
|
|
88
|
+
entity: string;
|
|
89
|
+
}>;
|
|
90
|
+
amfAllOf: TestRaml<{
|
|
91
|
+
Pet: typeof amf.NodeShape;
|
|
92
|
+
Cat: typeof amf.AnyShape;
|
|
93
|
+
Dog: typeof amf.AnyShape;
|
|
94
|
+
AlternateDog: typeof amf.AnyShape;
|
|
95
|
+
DiscriminatedPet: typeof amf.NodeShape;
|
|
96
|
+
DiscriminatedCat: typeof amf.AnyShape;
|
|
97
|
+
DiscriminatedDog: typeof amf.AnyShape;
|
|
98
|
+
SelfReferencing: typeof amf.AnyShape;
|
|
99
|
+
}, {}>;
|
|
100
|
+
amfOneOf: TestRaml<{
|
|
101
|
+
Pet: typeof amf.AnyShape;
|
|
102
|
+
Cat: typeof amf.NodeShape;
|
|
103
|
+
Dog: typeof amf.NodeShape;
|
|
104
|
+
}, {}>;
|
|
105
|
+
amfAnyOf: TestRaml<{
|
|
106
|
+
Pet: typeof amf.AnyShape;
|
|
107
|
+
Cat: typeof amf.NodeShape;
|
|
108
|
+
Dog: typeof amf.NodeShape;
|
|
109
|
+
}, {}>;
|
|
110
|
+
amfOperationInvalidErrorStrategy: TestRaml<{}, {
|
|
111
|
+
invalidErrorStrategy: string;
|
|
112
|
+
}>;
|
|
113
|
+
amfOperationInvalidOperationType: TestRaml<{}, {
|
|
114
|
+
invalidOperationType: string;
|
|
115
|
+
}>;
|
|
116
|
+
amfOperationExposeRefresh: TestRaml<{}, {
|
|
117
|
+
exposeRefreshDefault: string;
|
|
118
|
+
exposeRefreshTrue: string;
|
|
119
|
+
exposeRefreshFalse: string;
|
|
120
|
+
}>;
|
|
121
|
+
amfOperationExposeRefreshMutationInvalid: TestRaml<{}, {
|
|
122
|
+
exposeRefreshDefault: string;
|
|
123
|
+
exposeRefreshTrue: string;
|
|
124
|
+
exposeRefreshFalse: string;
|
|
125
|
+
}>;
|
|
126
|
+
amfOperationExposeRefreshLegacyInvalid: TestRaml<{}, {
|
|
127
|
+
exposeRefreshDefault: string;
|
|
128
|
+
exposeRefreshTrue: string;
|
|
129
|
+
exposeRefreshFalse: string;
|
|
130
|
+
}>;
|
|
131
|
+
amfBindings: TestRaml<{}, {
|
|
132
|
+
defaultOperationTypeGet: string;
|
|
133
|
+
defaultOperationTypePost: string;
|
|
134
|
+
defaultIdentifierDefaultsToOpId: string;
|
|
135
|
+
defaultBindingMutation: string;
|
|
136
|
+
defaultBindingQuery: string;
|
|
137
|
+
defaultBindingForGetWithMutationOperationType: string;
|
|
138
|
+
successQuery: string;
|
|
139
|
+
successMutation: string;
|
|
140
|
+
successMultipleBindings: string;
|
|
141
|
+
successMultipleOperationsUniqueBindingIdentifier: string;
|
|
142
|
+
failInvalidBindingType: string;
|
|
143
|
+
failMutationWire: string;
|
|
144
|
+
failMutationImperativeInvoker: string;
|
|
145
|
+
failNoIdentifierMulti: string;
|
|
146
|
+
failDuplicateIdentifier: string;
|
|
147
|
+
failGetMethodWithMutationOperationTypeAndWireBinding: string;
|
|
148
|
+
failGetMethodWithMutationOperationTypeAndImperativeInvokerBinding: string;
|
|
149
|
+
failMultipleOperationsShareBindingIdentifier: string;
|
|
150
|
+
}>;
|
|
151
|
+
amfGraphQLBindings: TestRaml<{}, {
|
|
152
|
+
graphqlMutationBindingSuccess: string;
|
|
153
|
+
nonGraphqlWithMutationBinding: string;
|
|
154
|
+
}>;
|
|
155
|
+
bindingsValidation: TestRaml<{}, {}>;
|
|
156
|
+
enums: TestRaml<{
|
|
157
|
+
String_Enumerated: typeof amf.ScalarShape;
|
|
158
|
+
String_Property_Enum: typeof amf.NodeShape;
|
|
159
|
+
CustomDates: typeof amf.AnyShape;
|
|
160
|
+
CustomCursorType: typeof amf.AnyShape;
|
|
161
|
+
}, {}>;
|
|
162
|
+
additionalProperties: TestRaml<{
|
|
163
|
+
Object_Simple: typeof amf.NodeShape;
|
|
164
|
+
AdditionalPropertiesScalar: typeof amf.NodeShape;
|
|
165
|
+
AdditionalPropertiesObject: typeof amf.NodeShape;
|
|
166
|
+
}, {}>;
|
|
167
|
+
oneofs: TestRaml<{
|
|
168
|
+
Object_Simple: typeof amf.NodeShape;
|
|
169
|
+
Object_Simple2: typeof amf.NodeShape;
|
|
170
|
+
OneOf: typeof amf.AnyShape;
|
|
171
|
+
OneOf_Complex: typeof amf.AnyShape;
|
|
172
|
+
OneOf_Inline_Inheritance: typeof amf.AnyShape;
|
|
173
|
+
OneOf_Inline_Helper: typeof amf.NodeShape;
|
|
174
|
+
OneOf_Inline_Properties: typeof amf.AnyShape;
|
|
175
|
+
OneOf_With_Optional_Properties: typeof amf.AnyShape;
|
|
176
|
+
CatOrDog: typeof amf.AnyShape;
|
|
177
|
+
Cat: typeof amf.NodeShape;
|
|
178
|
+
Dog: typeof amf.NodeShape;
|
|
179
|
+
}, {}>;
|
|
180
|
+
errors: TestRaml<{
|
|
181
|
+
CustomNonScalarOneOf: typeof amf.AnyShape;
|
|
182
|
+
CustomObjectEnumType: typeof amf.NodeShape;
|
|
183
|
+
CustomArrayEnumType: typeof amf.ArrayShape;
|
|
184
|
+
MissingPropertyType: typeof amf.NodeShape;
|
|
185
|
+
}, {}>;
|
|
186
|
+
base: TestRaml<{
|
|
187
|
+
Anonymous: typeof amf.AnyShape;
|
|
188
|
+
Identifiable: typeof amf.AnyShape;
|
|
189
|
+
AnnotatedError: typeof amf.AnyShape;
|
|
190
|
+
}, {}>;
|
|
191
|
+
defaults: {
|
|
192
|
+
apiOasUrl: TestRaml<{}, {}>;
|
|
193
|
+
errorRamlUrl: TestRaml<{}, {}>;
|
|
194
|
+
errorRamlUrl2: TestRaml<{}, {}>;
|
|
195
|
+
};
|
|
196
|
+
typeValidation: TestRaml<{}, {}>;
|
|
197
|
+
endpointValidation: TestRaml<{}, {}>;
|
|
198
|
+
invalidation: {
|
|
199
|
+
validOasUrl: TestRaml<{}, {}>;
|
|
200
|
+
keyNameInvalidOasUrl: TestRaml<{}, {}>;
|
|
201
|
+
keyValueInvalidOasUrl: TestRaml<{}, {}>;
|
|
202
|
+
keyValuePrefixInvalidOasUrl: TestRaml<{}, {}>;
|
|
203
|
+
invalidationInvalidOperationType: TestRaml<{}, {}>;
|
|
204
|
+
typeInvalidOasUrl: TestRaml<{}, {}>;
|
|
205
|
+
typeInvalidFormatOasUrl: TestRaml<{}, {}>;
|
|
206
|
+
typeUnidentifiableOasUrl: TestRaml<{}, {}>;
|
|
207
|
+
typeUnidentifiableInlineOasUrl: TestRaml<{}, {}>;
|
|
208
|
+
};
|
|
209
|
+
}>;
|
|
210
|
+
export declare function readSpecFile<T extends Record<string, new () => amf.AnyShape>, E extends Record<string, string>>(specFileName: string, types: T, endpoints: E): Promise<TestRaml<T, E>>;
|
|
211
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { API, APIService } from '../api';
|
|
2
|
+
import type { NamedLoggerService } from '@conduit-client/utils';
|
|
3
|
+
import type { NamedFeatureFlagsService } from '@conduit-client/service-feature-flags/v1';
|
|
4
|
+
/**
|
|
5
|
+
* Returns a new APIService based on the AMF API code.
|
|
6
|
+
* @returns a new APIService
|
|
7
|
+
*/
|
|
8
|
+
export declare function amfAPIService(services: NamedLoggerService & NamedFeatureFlagsService): APIService;
|
|
9
|
+
/**
|
|
10
|
+
* Wraps an already-created API in an APIService.
|
|
11
|
+
*
|
|
12
|
+
* @param api an API
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
export declare function asAPIService(api: API): APIService;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import amf from 'amf-client-js';
|
|
2
|
+
import type { ScalarType } from '../types';
|
|
3
|
+
export declare const STRING_DATA_TYPE = "http://www.w3.org/2001/XMLSchema#string";
|
|
4
|
+
export declare const BOOLEAN_DATA_TYPE = "http://www.w3.org/2001/XMLSchema#boolean";
|
|
5
|
+
export declare const INTEGER_DATA_TYPE = "http://www.w3.org/2001/XMLSchema#integer";
|
|
6
|
+
export declare const LONG_DATA_TYPE = "http://www.w3.org/2001/XMLSchema#long";
|
|
7
|
+
export declare const FLOAT_DATA_TYPE = "http://www.w3.org/2001/XMLSchema#float";
|
|
8
|
+
export declare const DOUBLE_DATA_TYPE = "http://www.w3.org/2001/XMLSchema#double";
|
|
9
|
+
export declare const NUMBER_DATA_TYPE = "http://a.ml/vocabularies/shapes#number";
|
|
10
|
+
export declare const DATE_DATA_TYPE = "http://www.w3.org/2001/XMLSchema#date";
|
|
11
|
+
export declare const TIME_DATA_TYPE = "http://www.w3.org/2001/XMLSchema#time";
|
|
12
|
+
export declare const PASSWORD_DATA_TYPE = "http://a.ml/vocabularies/shapes#password";
|
|
13
|
+
export declare const BYTE_DATA_TYPE = "http://www.w3.org/2001/XMLSchema#byte";
|
|
14
|
+
export declare const BINARY_DATA_TYPE = "http://www.w3.org/2001/XMLSchema#base64Binary";
|
|
15
|
+
export declare const DATETIME_ONLY_TYPE = "http://a.ml/vocabularies/shapes#dateTimeOnly";
|
|
16
|
+
export declare const DATETIME_TYPE = "http://www.w3.org/2001/XMLSchema#dateTime";
|
|
17
|
+
export declare const DATATYPE_TO_SCALAR_TYPE: Record<string, ScalarType['type']>;
|
|
18
|
+
export declare function isDomainElement(maybeDomainElement: any): maybeDomainElement is amf.DomainElement;
|
|
19
|
+
export declare function isTypeShape(domainElement: amf.DomainElement): domainElement is amf.AnyShape;
|
|
20
|
+
export declare function isAnyShape(domainElement: amf.DomainElement): domainElement is amf.AnyShape;
|
|
21
|
+
export declare function isNilShape(shape: amf.Shape): shape is amf.NilShape;
|
|
22
|
+
export declare function isNodeShape(node: amf.Shape): node is amf.NodeShape;
|
|
23
|
+
export declare function isArrayShape(node: amf.Shape): node is amf.ArrayShape;
|
|
24
|
+
export declare function isScalarShape(shape: amf.Shape): shape is amf.ScalarShape;
|
|
25
|
+
export declare function isRefShape(shape: amf.Shape): boolean;
|
|
26
|
+
export declare function isStringScalarShape(shape: amf.ScalarShape): boolean;
|
|
27
|
+
export declare function isAnyOfShape(shape: amf.Shape): boolean;
|
|
28
|
+
export declare function isOneOfShape(shape: amf.Shape): shape is amf.UnionShape;
|
|
29
|
+
export declare function isAllOfShape(shape: amf.Shape): boolean;
|
|
30
|
+
export declare function isNotShape(shape: amf.Shape): boolean;
|
|
31
|
+
export declare function isScalarNode(node: amf.DataNode): node is amf.ScalarNode;
|
|
32
|
+
export declare function isEnumShape(shape: amf.Shape): boolean;
|
|
33
|
+
export declare function getEnumValuesFromShape<T extends string | number | boolean | null>(shape: amf.ScalarShape | amf.UnionShape | amf.NilShape): T[];
|
|
34
|
+
export declare function coerceValueByType<D extends string | any>(value: string, type: {
|
|
35
|
+
type: 'boolean' | 'double' | 'integer' | 'number' | 'string' | 'date' | 'time' | 'datetime-only';
|
|
36
|
+
}): string | boolean | number | null | D;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { AuraController, AuraEndPoint, BaseEndPoint, HttpEndPoint, Parameter, Operation, Server, API } from '../../api';
|
|
2
|
+
import type { AMFType, AMFTypeFactory } from '../types';
|
|
3
|
+
import type { TypeRegistry } from '../../types';
|
|
4
|
+
import type { FileParserLogger, LoggerService } from '@conduit-client/utils';
|
|
5
|
+
import type amf from 'amf-client-js';
|
|
6
|
+
export type AmfEndPoint = AmfAuraEndpoint | AmfHttpEndPoint;
|
|
7
|
+
export type NetworkPreference = 'aura' | 'http';
|
|
8
|
+
export declare function amfEndpointFactory(amfEndpoint: amf.EndPoint, amfTypeFactory: AMFTypeFactory, typeRegistry: TypeRegistry<AMFType>, logger: LoggerService, fileParserLogger: FileParserLogger, server: Server, api: API): AmfEndPoint | undefined;
|
|
9
|
+
export declare abstract class AmfBaseEndpoint implements BaseEndPoint {
|
|
10
|
+
protected amfEndpoint: amf.EndPoint;
|
|
11
|
+
operations: ReadonlyArray<Operation>;
|
|
12
|
+
protected logger: LoggerService;
|
|
13
|
+
protected fileParserLogger: FileParserLogger;
|
|
14
|
+
api: API;
|
|
15
|
+
path: string;
|
|
16
|
+
uriParameters: Record<string, Parameter>;
|
|
17
|
+
abstract type: 'aura' | 'http';
|
|
18
|
+
constructor(amfEndpoint: amf.EndPoint, operations: ReadonlyArray<Operation>, amfTypeFactory: AMFTypeFactory, typeRegistry: TypeRegistry<AMFType>, logger: LoggerService, fileParserLogger: FileParserLogger, api: API);
|
|
19
|
+
}
|
|
20
|
+
export declare class AmfHttpEndPoint extends AmfBaseEndpoint implements HttpEndPoint {
|
|
21
|
+
readonly type = "http";
|
|
22
|
+
}
|
|
23
|
+
export declare class AmfAuraEndpoint extends AmfBaseEndpoint implements AuraEndPoint {
|
|
24
|
+
protected logger: LoggerService;
|
|
25
|
+
protected fileParserLogger: FileParserLogger;
|
|
26
|
+
api: API;
|
|
27
|
+
networkPreference: NetworkPreference;
|
|
28
|
+
readonly type = "aura";
|
|
29
|
+
auraController: AuraController;
|
|
30
|
+
constructor(amfEndPoint: amf.EndPoint, operations: Operation[], amfTypeFactory: AMFTypeFactory, typeRegistry: TypeRegistry<AMFType>, logger: LoggerService, fileParserLogger: FileParserLogger, api: API, networkPreference: NetworkPreference);
|
|
31
|
+
buildAuraController(): AuraController;
|
|
32
|
+
}
|