@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.
Files changed (105) hide show
  1. package/dist/main/index.js +6 -0
  2. package/dist/main/index.js.map +1 -0
  3. package/dist/types/index.d.ts +0 -0
  4. package/dist/types/v1/__tests__/validation.spec.d.ts +1 -0
  5. package/dist/types/v1/__tests__/zod-utils.spec.d.ts +1 -0
  6. package/dist/types/v1/amf/AMFAPI.d.ts +44 -0
  7. package/dist/types/v1/amf/__tests__/AMFAPI.spec.d.ts +1 -0
  8. package/dist/types/v1/amf/__tests__/amf-api-service.spec.d.ts +1 -0
  9. package/dist/types/v1/amf/__tests__/amf-extensions-services.spec.d.ts +1 -0
  10. package/dist/types/v1/amf/__tests__/amf-extensions.spec.d.ts +1 -0
  11. package/dist/types/v1/amf/__tests__/amf-utils.spec.d.ts +1 -0
  12. package/dist/types/v1/amf/__tests__/parser.spec.d.ts +1 -0
  13. package/dist/types/v1/amf/__tests__/test-utils.d.ts +211 -0
  14. package/dist/types/v1/amf/__tests__/validation.spec.d.ts +1 -0
  15. package/dist/types/v1/amf/__tests__/version.spec.d.ts +1 -0
  16. package/dist/types/v1/amf/amf-api-service.d.ts +15 -0
  17. package/dist/types/v1/amf/amf-extensions.d.ts +2 -0
  18. package/dist/types/v1/amf/amf-utils.d.ts +36 -0
  19. package/dist/types/v1/amf/endpoints/__tests__/amf-endpoint.spec.d.ts +1 -0
  20. package/dist/types/v1/amf/endpoints/__tests__/amf-operation.spec.d.ts +1 -0
  21. package/dist/types/v1/amf/endpoints/amf-endpoint.d.ts +32 -0
  22. package/dist/types/v1/amf/endpoints/amf-operation.d.ts +4112 -0
  23. package/dist/types/v1/amf/index.d.ts +5 -0
  24. package/dist/types/v1/amf/parser.d.ts +6 -0
  25. package/dist/types/v1/amf/types/AMFAllOfType.d.ts +23 -0
  26. package/dist/types/v1/amf/types/AMFAnyType.d.ts +7 -0
  27. package/dist/types/v1/amf/types/AMFArrayType.d.ts +10 -0
  28. package/dist/types/v1/amf/types/AMFBaseType.d.ts +25 -0
  29. package/dist/types/v1/amf/types/AMFDiscriminatedObjectType.d.ts +34 -0
  30. package/dist/types/v1/amf/types/AMFEnumType.d.ts +18 -0
  31. package/dist/types/v1/amf/types/AMFNilType.d.ts +7 -0
  32. package/dist/types/v1/amf/types/AMFNotType.d.ts +18 -0
  33. package/dist/types/v1/amf/types/AMFObjectType.d.ts +14 -0
  34. package/dist/types/v1/amf/types/AMFOneOfType.d.ts +17 -0
  35. package/dist/types/v1/amf/types/AMFRefType.d.ts +10 -0
  36. package/dist/types/v1/amf/types/AMFScalarTypes.d.ts +47 -0
  37. package/dist/types/v1/amf/types/__tests__/AMFAnyType.spec.d.ts +1 -0
  38. package/dist/types/v1/amf/types/__tests__/AMFArrayType.spec.d.ts +1 -0
  39. package/dist/types/v1/amf/types/__tests__/AMFBaseType.spec.d.ts +1 -0
  40. package/dist/types/v1/amf/types/__tests__/AMFDiscriminatedObjectType.spec.d.ts +1 -0
  41. package/dist/types/v1/amf/types/__tests__/AMFEnumType.spec.d.ts +1 -0
  42. package/dist/types/v1/amf/types/__tests__/AMFNilType.spec.d.ts +1 -0
  43. package/dist/types/v1/amf/types/__tests__/AMFNotType.spec.d.ts +1 -0
  44. package/dist/types/v1/amf/types/__tests__/AMFObjectType.spec.d.ts +1 -0
  45. package/dist/types/v1/amf/types/__tests__/AMFOneOfType.spec.d.ts +1 -0
  46. package/dist/types/v1/amf/types/__tests__/AMFScalarType.spec.d.ts +1 -0
  47. package/dist/types/v1/amf/types/__tests__/annotations-schemas.spec.d.ts +1 -0
  48. package/dist/types/v1/amf/types/__tests__/factory.spec.d.ts +1 -0
  49. package/dist/types/v1/amf/types/annotations-schemas.d.ts +172 -0
  50. package/dist/types/v1/amf/types/factory.d.ts +23 -0
  51. package/dist/types/v1/amf/types/index.d.ts +16 -0
  52. package/dist/types/v1/amf/validation.d.ts +11 -0
  53. package/dist/types/v1/amf/version.d.ts +3 -0
  54. package/dist/types/v1/api/__tests__/api.spec.d.ts +1 -0
  55. package/dist/types/v1/api/__tests__/index.spec.d.ts +0 -0
  56. package/dist/types/v1/api/api.d.ts +37 -0
  57. package/dist/types/v1/api/endpoint.d.ts +162 -0
  58. package/dist/types/v1/api/index.d.ts +5 -0
  59. package/dist/types/v1/api/service-overrides.d.ts +249 -0
  60. package/dist/types/v1/api/service.d.ts +23 -0
  61. package/dist/types/v1/api/validation/bindings.d.ts +6 -0
  62. package/dist/types/v1/api/validation/endpoint/__tests__/index.spec.d.ts +1 -0
  63. package/dist/types/v1/api/validation/endpoint/index.d.ts +3 -0
  64. package/dist/types/v1/api/validation/index.d.ts +16 -0
  65. package/dist/types/v1/api/validation/operation/BodyDataValidator.d.ts +13 -0
  66. package/dist/types/v1/api/validation/operation/InvalidationValidator.d.ts +39 -0
  67. package/dist/types/v1/api/validation/operation/KeyMatchValidator.d.ts +7 -0
  68. package/dist/types/v1/api/validation/operation/KeySourceValidator.d.ts +25 -0
  69. package/dist/types/v1/api/validation/operation/NoNormalizedTypesValidator.d.ts +19 -0
  70. package/dist/types/v1/api/validation/operation/Response200Validator.d.ts +96 -0
  71. package/dist/types/v1/api/validation/operation/__tests__/BodyDataValidator.spec.d.ts +1 -0
  72. package/dist/types/v1/api/validation/operation/__tests__/InvalidationValidator.spec.d.ts +1 -0
  73. package/dist/types/v1/api/validation/operation/__tests__/KeyMatchValidator.spec.d.ts +1 -0
  74. package/dist/types/v1/api/validation/operation/__tests__/KeySourceValidator.spec.d.ts +1 -0
  75. package/dist/types/v1/api/validation/operation/__tests__/NoNormalizedTypesValidator.spec.d.ts +1 -0
  76. package/dist/types/v1/api/validation/operation/__tests__/Response200Validator.spec.d.ts +1 -0
  77. package/dist/types/v1/api/validation/operation/__tests__/index.spec.d.ts +1 -0
  78. package/dist/types/v1/api/validation/operation/__tests__/utils.spec.d.ts +1 -0
  79. package/dist/types/v1/api/validation/operation/index.d.ts +3 -0
  80. package/dist/types/v1/api/validation/operation/utils.d.ts +4 -0
  81. package/dist/types/v1/index.d.ts +3 -0
  82. package/dist/types/v1/types/Type.d.ts +106 -0
  83. package/dist/types/v1/types/TypeRegistry.d.ts +19 -0
  84. package/dist/types/v1/types/__tests__/TypeRegistry.spec.d.ts +1 -0
  85. package/dist/types/v1/types/__tests__/types-equal.spec.d.ts +1 -0
  86. package/dist/types/v1/types/__tests__/utils.spec.d.ts +1 -0
  87. package/dist/types/v1/types/index.d.ts +5 -0
  88. package/dist/types/v1/types/types-equal.d.ts +2 -0
  89. package/dist/types/v1/types/utils.d.ts +27 -0
  90. package/dist/types/v1/types/validators/__tests__/common.spec.d.ts +1 -0
  91. package/dist/types/v1/types/validators/__tests__/index.spec.d.ts +1 -0
  92. package/dist/types/v1/types/validators/common.d.ts +4 -0
  93. package/dist/types/v1/types/validators/extensions/KeyFieldReferenceValidator.d.ts +11 -0
  94. package/dist/types/v1/types/validators/extensions/KeyIsDefinedInSupportedTypeValidator.d.ts +20 -0
  95. package/dist/types/v1/types/validators/extensions/KeySourcesValidator.d.ts +25 -0
  96. package/dist/types/v1/types/validators/extensions/__tests__/KeyFieldReferenceValidator.spec.d.ts +1 -0
  97. package/dist/types/v1/types/validators/extensions/__tests__/KeyIsDefinedInSupportedTypeValidator.spec.d.ts +1 -0
  98. package/dist/types/v1/types/validators/extensions/__tests__/KeySourcesValidator.spec.d.ts +1 -0
  99. package/dist/types/v1/types/validators/extensions/index.d.ts +3 -0
  100. package/dist/types/v1/types/validators/index.d.ts +4 -0
  101. package/dist/types/v1/validation.d.ts +29 -0
  102. package/dist/types/v1/zod-utils.d.ts +2 -0
  103. package/dist/v1/index.js +7346 -0
  104. package/dist/v1/index.js.map +1 -0
  105. package/package.json +42 -0
@@ -0,0 +1,162 @@
1
+ import type { ArrayType, ScalarType, Type, TypeCacheControlExtension } from '../types';
2
+ import type { Server, API } from './api';
3
+ import type { ResolvedOperationServices } from './service-overrides';
4
+ import type { InvalidateConfig } from '@conduit-client/utils';
5
+ export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'CONNECT' | 'OPTIONS' | 'TRACE';
6
+ export type StatusCode = '100' | '101' | '102' | '103' | '200' | '201' | '202' | '203' | '204' | '205' | '206' | '207' | '208' | '226' | '300' | '301' | '302' | '303' | '304' | '305' | '306' | '307' | '308' | '400' | '401' | '402' | '403' | '404' | '405' | '406' | '407' | '408' | '409' | '410' | '411' | '412' | '413' | '414' | '415' | '416' | '417' | '418' | '421' | '422' | '423' | '424' | '425' | '426' | '428' | '429' | '431' | '451' | '500' | '501' | '502' | '503' | '504' | '505' | '506' | '507' | '508' | '510' | '511';
7
+ export type Parameter<T extends Type = ScalarType> = {
8
+ type: T;
9
+ required: boolean;
10
+ explode?: boolean;
11
+ defaultValue?: T;
12
+ };
13
+ export type UrlParameter = Parameter<ScalarType>;
14
+ export type QueryParameter = Parameter<ScalarType | (ArrayType & {
15
+ items?: ScalarType;
16
+ })>;
17
+ export type TypeOfParameter<P extends Parameter<any>> = P extends Parameter<infer T> ? T : never;
18
+ export type ApplicationJsonContent<T extends Type> = {
19
+ mediaType: 'application/json';
20
+ data: T;
21
+ };
22
+ export type ApplicationXmlContent<T extends Type> = {
23
+ mediaType: 'application/xml';
24
+ data: T;
25
+ };
26
+ export type Payload<T extends Type = Type> = ApplicationJsonContent<T> | ApplicationXmlContent<T>;
27
+ export type Request<T extends Type = Type> = {
28
+ queryParameters: Record<string, QueryParameter>;
29
+ uriParameters: Record<string, Parameter>;
30
+ payloads: Array<Payload<T>>;
31
+ cookies: Record<string, Parameter>;
32
+ headers: Record<string, Parameter>;
33
+ };
34
+ export type Response<T extends Type = Type> = {
35
+ statusCode: StatusCode;
36
+ payloads: Array<Payload<T>>;
37
+ headers: Record<string, Parameter>;
38
+ invalidation?: InvalidateConfig[];
39
+ };
40
+ export declare const BindingTypesEnum: readonly ["wire", "imperative", "imperative-legacy", "mutation"];
41
+ export type BindingType = (typeof BindingTypesEnum)[number];
42
+ export type Binding = {
43
+ type: BindingType;
44
+ identifier: string;
45
+ };
46
+ export type ConfigSchemaType = 'default' | 'flattened';
47
+ export type OperationType = 'query' | 'mutation' | 'graphql';
48
+ export type ResourceLevelCacheControl = {
49
+ 'max-age': number;
50
+ };
51
+ export type OperationCacheControl = {
52
+ type: 'max-age';
53
+ 'max-age': number;
54
+ } | {
55
+ type: 'no-cache';
56
+ };
57
+ export type CacheStrategy = {
58
+ type: 'none';
59
+ } | {
60
+ type: 'resource';
61
+ config: ResourceLevelCacheControl;
62
+ } | {
63
+ type: 'normalized';
64
+ 'cache-control': OperationCacheControl;
65
+ key?: Record<string, string>;
66
+ };
67
+ export type ErrorStrategy = {
68
+ type: 'stringified';
69
+ } | {
70
+ type: 'fetchResponse';
71
+ };
72
+ export type BaseOperation<ResponseType extends Type = Type, RequestType extends Type = Type> = {
73
+ readonly type: 'aura' | 'http';
74
+ method: HttpMethod;
75
+ operationType: OperationType;
76
+ operationId: string | undefined;
77
+ configSchemaType: ConfigSchemaType;
78
+ requests: Request<RequestType>[];
79
+ responses: Response<ResponseType>[];
80
+ cacheStrategy: CacheStrategy;
81
+ errorStrategy: ErrorStrategy;
82
+ endpoint: EndPoint;
83
+ server: Server;
84
+ bindings: Binding[];
85
+ exposeRefresh: boolean;
86
+ basePath: string;
87
+ defaults: API['defaults'];
88
+ serviceOverrides: ResolvedOperationServices;
89
+ };
90
+ export type BaseOperationWithRequestBody<ResponseType extends Type = Type, RequestType extends Type = Type> = BaseOperation & {
91
+ configBodyParam: string;
92
+ };
93
+ export type BaseAuraOperation = BaseOperation & {
94
+ type: 'aura';
95
+ aura: {
96
+ methodName: string;
97
+ };
98
+ };
99
+ export type AuraOperationWithRequestBody = BaseOperationWithRequestBody & BaseAuraOperation & {
100
+ aura: BaseAuraOperation['aura'] & {
101
+ bodyParam: string;
102
+ };
103
+ };
104
+ export type BaseGraphQLOperation = BaseOperation & {
105
+ operationType: 'graphql';
106
+ graphqlConfig: GraphQLConfig;
107
+ };
108
+ export type BaseHttpOperation = BaseOperation & {
109
+ type: 'http';
110
+ };
111
+ export type HttpOperationWithRequestBody = BaseHttpOperation & BaseOperationWithRequestBody;
112
+ export type HttpOperation = BaseHttpOperation | HttpOperationWithRequestBody;
113
+ export type AuraOperation = BaseAuraOperation | AuraOperationWithRequestBody;
114
+ export type AuraGraphQLOperation = AuraOperation & BaseGraphQLOperation;
115
+ export type HttpGraphQLOperation = HttpOperation & BaseGraphQLOperation;
116
+ export type GraphQLOperation = AuraGraphQLOperation | HttpGraphQLOperation;
117
+ export type Operation = HttpOperation | AuraOperation | GraphQLOperation;
118
+ export type NoCacheOperation = Operation & {
119
+ cacheStrategy: {
120
+ type: 'none';
121
+ };
122
+ };
123
+ export type ResourceCacheOperation = Operation & {
124
+ cacheStrategy: {
125
+ type: 'resource';
126
+ };
127
+ };
128
+ export type NormalizedOperation = Operation & {
129
+ cacheStrategy: {
130
+ type: 'normalized';
131
+ };
132
+ };
133
+ export type AuraController = {
134
+ name: string;
135
+ };
136
+ export type NetworkPreference = 'aura' | 'http';
137
+ /**
138
+ * A particular endpoint provided by an API.
139
+ */
140
+ export type BaseEndPoint = {
141
+ readonly type: 'aura' | 'http';
142
+ path: string;
143
+ uriParameters: Record<string, Parameter>;
144
+ operations: ReadonlyArray<Operation>;
145
+ };
146
+ export type AuraEndPoint = BaseEndPoint & {
147
+ auraController: AuraController;
148
+ networkPreference: NetworkPreference;
149
+ };
150
+ export type HttpEndPoint = BaseEndPoint & {
151
+ type: 'http';
152
+ };
153
+ export type EndPoint = HttpEndPoint | AuraEndPoint;
154
+ export type GraphQLTypeMetadata = {
155
+ typename: string;
156
+ 'cache-control': OperationCacheControl;
157
+ };
158
+ export type GraphQLConfig = {
159
+ schemaFilePath: string;
160
+ 'type-metadata': GraphQLTypeMetadata[];
161
+ defaults?: Partial<TypeCacheControlExtension>;
162
+ };
@@ -0,0 +1,5 @@
1
+ export * from './api';
2
+ export * from './endpoint';
3
+ export * from './service';
4
+ export { buildApiValidatorFor } from './validation';
5
+ export * from './service-overrides';
@@ -0,0 +1,249 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Service Overrides parsing utilities for OAS `x-onestore` extensions.
4
+ *
5
+ * This module only provides schemas and helpers. Wiring into AMF parsing
6
+ * happens separately in the endpoint/operation builders.
7
+ */
8
+ export type ServiceTypeName = string;
9
+ export type ServiceVariantDescriptor = {
10
+ type: ServiceTypeName;
11
+ version: string;
12
+ tags?: Record<string, string>;
13
+ default?: boolean;
14
+ };
15
+ export type ServicesCatalog = Record<string, ServiceVariantDescriptor>;
16
+ export type OperationServiceRef = {
17
+ ref: string;
18
+ };
19
+ export type OperationServiceInline = {
20
+ version: string;
21
+ tags?: Record<string, string>;
22
+ };
23
+ export type OperationServices = Record<ServiceTypeName, OperationServiceRef | OperationServiceInline>;
24
+ export type ResolvedServiceOverrides = {
25
+ catalog: ServicesCatalog;
26
+ /** Map of service type -> alias key that is marked default */
27
+ defaultsByType: Record<ServiceTypeName, string>;
28
+ };
29
+ export declare const serviceVariantDescriptorSchema: z.ZodObject<{
30
+ type: z.ZodString;
31
+ version: z.ZodString;
32
+ tags: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
33
+ default: z.ZodOptional<z.ZodBoolean>;
34
+ }, "strict", z.ZodTypeAny, {
35
+ type: string;
36
+ version: string;
37
+ tags?: Record<string, string> | undefined;
38
+ default?: boolean | undefined;
39
+ }, {
40
+ type: string;
41
+ version: string;
42
+ tags?: Record<string, string> | undefined;
43
+ default?: boolean | undefined;
44
+ }>;
45
+ export declare const servicesCatalogSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
46
+ type: z.ZodString;
47
+ version: z.ZodString;
48
+ tags: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
49
+ default: z.ZodOptional<z.ZodBoolean>;
50
+ }, "strict", z.ZodTypeAny, {
51
+ type: string;
52
+ version: string;
53
+ tags?: Record<string, string> | undefined;
54
+ default?: boolean | undefined;
55
+ }, {
56
+ type: string;
57
+ version: string;
58
+ tags?: Record<string, string> | undefined;
59
+ default?: boolean | undefined;
60
+ }>>;
61
+ export declare const operationServiceRefSchema: z.ZodObject<{
62
+ ref: z.ZodString;
63
+ }, "strict", z.ZodTypeAny, {
64
+ ref: string;
65
+ }, {
66
+ ref: string;
67
+ }>;
68
+ export declare const operationServiceInlineSchema: z.ZodEffects<z.ZodObject<{
69
+ version: z.ZodString;
70
+ tags: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
71
+ optional: z.ZodOptional<z.ZodBoolean>;
72
+ }, "strict", z.ZodTypeAny, {
73
+ version: string;
74
+ tags?: Record<string, string> | undefined;
75
+ optional?: boolean | undefined;
76
+ }, {
77
+ version: string;
78
+ tags?: Record<string, string> | undefined;
79
+ optional?: boolean | undefined;
80
+ }>, {
81
+ version: string;
82
+ tags?: Record<string, string> | undefined;
83
+ optional?: boolean | undefined;
84
+ }, {
85
+ version: string;
86
+ tags?: Record<string, string> | undefined;
87
+ optional?: boolean | undefined;
88
+ }>;
89
+ export declare const operationServicesSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
90
+ ref: z.ZodString;
91
+ }, "strict", z.ZodTypeAny, {
92
+ ref: string;
93
+ }, {
94
+ ref: string;
95
+ }>, z.ZodEffects<z.ZodObject<{
96
+ version: z.ZodString;
97
+ tags: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
98
+ optional: z.ZodOptional<z.ZodBoolean>;
99
+ }, "strict", z.ZodTypeAny, {
100
+ version: string;
101
+ tags?: Record<string, string> | undefined;
102
+ optional?: boolean | undefined;
103
+ }, {
104
+ version: string;
105
+ tags?: Record<string, string> | undefined;
106
+ optional?: boolean | undefined;
107
+ }>, {
108
+ version: string;
109
+ tags?: Record<string, string> | undefined;
110
+ optional?: boolean | undefined;
111
+ }, {
112
+ version: string;
113
+ tags?: Record<string, string> | undefined;
114
+ optional?: boolean | undefined;
115
+ }>]>>;
116
+ export declare const componentsOnestoreServicesSchema: z.ZodObject<{
117
+ onestore: z.ZodObject<{
118
+ services: z.ZodRecord<z.ZodString, z.ZodObject<{
119
+ type: z.ZodString;
120
+ version: z.ZodString;
121
+ tags: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
122
+ default: z.ZodOptional<z.ZodBoolean>;
123
+ }, "strict", z.ZodTypeAny, {
124
+ type: string;
125
+ version: string;
126
+ tags?: Record<string, string> | undefined;
127
+ default?: boolean | undefined;
128
+ }, {
129
+ type: string;
130
+ version: string;
131
+ tags?: Record<string, string> | undefined;
132
+ default?: boolean | undefined;
133
+ }>>;
134
+ }, "strict", z.ZodTypeAny, {
135
+ services: Record<string, {
136
+ type: string;
137
+ version: string;
138
+ tags?: Record<string, string> | undefined;
139
+ default?: boolean | undefined;
140
+ }>;
141
+ }, {
142
+ services: Record<string, {
143
+ type: string;
144
+ version: string;
145
+ tags?: Record<string, string> | undefined;
146
+ default?: boolean | undefined;
147
+ }>;
148
+ }>;
149
+ }, "strict", z.ZodTypeAny, {
150
+ onestore: {
151
+ services: Record<string, {
152
+ type: string;
153
+ version: string;
154
+ tags?: Record<string, string> | undefined;
155
+ default?: boolean | undefined;
156
+ }>;
157
+ };
158
+ }, {
159
+ onestore: {
160
+ services: Record<string, {
161
+ type: string;
162
+ version: string;
163
+ tags?: Record<string, string> | undefined;
164
+ default?: boolean | undefined;
165
+ }>;
166
+ };
167
+ }>;
168
+ export declare const operationOnestoreServicesSchema: z.ZodObject<{
169
+ onestore: z.ZodObject<{
170
+ services: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
171
+ ref: z.ZodString;
172
+ }, "strict", z.ZodTypeAny, {
173
+ ref: string;
174
+ }, {
175
+ ref: string;
176
+ }>, z.ZodEffects<z.ZodObject<{
177
+ version: z.ZodString;
178
+ tags: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
179
+ optional: z.ZodOptional<z.ZodBoolean>;
180
+ }, "strict", z.ZodTypeAny, {
181
+ version: string;
182
+ tags?: Record<string, string> | undefined;
183
+ optional?: boolean | undefined;
184
+ }, {
185
+ version: string;
186
+ tags?: Record<string, string> | undefined;
187
+ optional?: boolean | undefined;
188
+ }>, {
189
+ version: string;
190
+ tags?: Record<string, string> | undefined;
191
+ optional?: boolean | undefined;
192
+ }, {
193
+ version: string;
194
+ tags?: Record<string, string> | undefined;
195
+ optional?: boolean | undefined;
196
+ }>]>>;
197
+ }, "strict", z.ZodTypeAny, {
198
+ services: Record<string, {
199
+ ref: string;
200
+ } | {
201
+ version: string;
202
+ tags?: Record<string, string> | undefined;
203
+ optional?: boolean | undefined;
204
+ }>;
205
+ }, {
206
+ services: Record<string, {
207
+ ref: string;
208
+ } | {
209
+ version: string;
210
+ tags?: Record<string, string> | undefined;
211
+ optional?: boolean | undefined;
212
+ }>;
213
+ }>;
214
+ }, "strict", z.ZodTypeAny, {
215
+ onestore: {
216
+ services: Record<string, {
217
+ ref: string;
218
+ } | {
219
+ version: string;
220
+ tags?: Record<string, string> | undefined;
221
+ optional?: boolean | undefined;
222
+ }>;
223
+ };
224
+ }, {
225
+ onestore: {
226
+ services: Record<string, {
227
+ ref: string;
228
+ } | {
229
+ version: string;
230
+ tags?: Record<string, string> | undefined;
231
+ optional?: boolean | undefined;
232
+ }>;
233
+ };
234
+ }>;
235
+ /**
236
+ * Validates and normalizes a components-level services catalog.
237
+ * Enforces single default per service type.
238
+ */
239
+ export declare function validateAndNormalizeCatalog(catalog: ServicesCatalog): ResolvedServiceOverrides;
240
+ /**
241
+ * Given an operation-level services object and a catalog, produce a normalized mapping
242
+ * of canonical service type -> alias key (when $ref used) or inline descriptor.
243
+ *
244
+ * This does not perform runtime resolution or merging — it only standardizes shape.
245
+ */
246
+ export type ResolvedServiceDescriptor = Pick<ServiceVariantDescriptor, 'type' | 'version' | 'tags' | 'default'>;
247
+ export type ResolvedOperationServices = Record<ServiceTypeName, ResolvedServiceDescriptor>;
248
+ export declare function resolveOperationServices(services: OperationServices, catalog?: ResolvedServiceOverrides): ResolvedOperationServices;
249
+ export declare function resolveDefaultServiceOverrides(catalog?: ResolvedServiceOverrides): ResolvedOperationServices;
@@ -0,0 +1,23 @@
1
+ import type { NamedService } from '@conduit-client/utils';
2
+ import type { API } from '../api';
3
+ /**
4
+ * A Service that provides an API definition.
5
+ */
6
+ export type APIService = {
7
+ /**
8
+ * Most recently-created API.
9
+ */
10
+ api: API;
11
+ /**
12
+ * Loads an IDL & creates an API model from it.
13
+ *
14
+ * @param args filename or url of the IDL from which to construct the API
15
+ * @returns API
16
+ */
17
+ build(args: {
18
+ url: URL;
19
+ } | {
20
+ filename: string;
21
+ }): Promise<API>;
22
+ };
23
+ export type NamedAPIService<Name extends string = 'api'> = NamedService<Name, APIService>;
@@ -0,0 +1,6 @@
1
+ import { type ValidationResult, type Validator } from '../../validation';
2
+ import { API, Operation } from '..';
3
+ export declare class BindingsValidation<S extends API = API> implements Validator<S, Operation> {
4
+ constructor();
5
+ validate(api: S): ValidationResult<Operation>;
6
+ }
@@ -0,0 +1,3 @@
1
+ import type { API, EndPoint, Operation, Type } from '../../..';
2
+ import { Validator } from '../../../validation';
3
+ export declare function buildEndpointValidator(api: API): Validator<EndPoint, EndPoint | Operation | Type>;
@@ -0,0 +1,16 @@
1
+ import type { API } from '../api';
2
+ import { type Validator } from '../../validation';
3
+ import type { Type } from '../../types';
4
+ import type { EndPoint, Operation } from '../endpoint';
5
+ type MessageSourceTypes = API | Type | EndPoint | Operation;
6
+ export declare class ApiValidator implements Validator<API, MessageSourceTypes> {
7
+ private apiValidators;
8
+ private typeValidator;
9
+ private endpointValidator;
10
+ constructor(apiValidators: Validator<API, MessageSourceTypes>[], typeValidator: Validator<Type, Type>, endpointValidator: Validator<EndPoint, MessageSourceTypes>);
11
+ validate(subject: API): import("../../validation").ValidationResult<MessageSourceTypes>;
12
+ private validateCollection;
13
+ }
14
+ export declare function buildApiValidatorFor(api: API): Validator<API, MessageSourceTypes>;
15
+ export declare function validateUniqueBindingIdentfiers(operations: readonly Operation[]): boolean;
16
+ export {};
@@ -0,0 +1,13 @@
1
+ import type { Operation, Type, Request, Response } from '../../..';
2
+ import { Validator } from '../../../validation';
3
+ import { KeySourcesValidator } from '../../../types/validators/extensions';
4
+ /**
5
+ * Validates the body of a request or response supports a key path
6
+ */
7
+ export declare class BodyDataValidator<T extends Operation = Operation> implements Validator<Operation, Operation | Type> {
8
+ private target;
9
+ private keys;
10
+ private keySourcesValidatorSupplier;
11
+ constructor(target: Response | Request, keys: string[], keySourcesValidatorSupplier: (sources: string[]) => KeySourcesValidator);
12
+ validate(operation: T): import("@conduit-client/utils").Ok<never[], never> | import("@conduit-client/utils").Err<never, import("../../../validation").ValidationMessage<Type | Operation>[]>;
13
+ }
@@ -0,0 +1,39 @@
1
+ import { ValidationMessage, Validator } from '../../../validation';
2
+ import { Operation, type Response } from '../../endpoint';
3
+ import { type ReadOnlyTypeRegistry, Type } from '../../..';
4
+ import { BodyDataValidator } from './BodyDataValidator';
5
+ /**
6
+ * Validates the configuration of 'invalidation'
7
+ */
8
+ export declare class InvalidationValidator implements Validator<Operation, Operation | Type> {
9
+ private types;
10
+ private bodyDataValidatorSupplier;
11
+ constructor(types: ReadOnlyTypeRegistry, bodyDataValidatorSupplier: (response: Response, sources: string[]) => BodyDataValidator);
12
+ validate(operation: Operation): import("@conduit-client/utils").Ok<never[], never> | import("@conduit-client/utils").Err<never, ValidationMessage<Type | Operation>[]>;
13
+ /**
14
+ * Returns the last parameter from a open api string ref.
15
+ *
16
+ * @param path - Fully qualified path: ex: '#/components/schemas/Post'
17
+ * @returns string - the type name
18
+ */
19
+ private parseTypeNameFromRef;
20
+ /**
21
+ * Validates that the defined key on the invalidation config is present as a key on the type.
22
+ *
23
+ * @param type - the AMFType
24
+ * @param key - the key defined on the invalidation config
25
+ * @param operation - the current operation
26
+ * @param response - the response
27
+ * @returns boolean - true if valid, false if invalid
28
+ */
29
+ private validateInvalidationTypeCacheKey;
30
+ /**
31
+ * Validates that the key value on the invalidation config is valid.
32
+ *
33
+ * @param v - the value
34
+ * @param operation - the operation
35
+ * @param response - the response
36
+ * @returns boolean - true if valid, false if invalid.
37
+ */
38
+ private validateInvalidationKeyValue;
39
+ }
@@ -0,0 +1,7 @@
1
+ import type { Operation, ReadOnlyTypeRegistry } from '../../..';
2
+ import { ValidationMessage, Validator } from '../../../validation';
3
+ export declare class KeyMatchValidator<T extends Operation = Operation> implements Validator<T, Operation> {
4
+ private types;
5
+ constructor(types: ReadOnlyTypeRegistry);
6
+ validate(operation: T): import("@conduit-client/utils").Err<never, ValidationMessage<Operation>[]> | import("@conduit-client/utils").Ok<ValidationMessage<Operation>[], never>;
7
+ }
@@ -0,0 +1,25 @@
1
+ import { type ValidationMessage, type Validator } from '../../../validation';
2
+ import { Operation, Parameter, QueryParameter, Request } from '../../endpoint';
3
+ import { Type } from '../../..';
4
+ import { BodyDataValidator } from './BodyDataValidator';
5
+ type KeyBySourceCollection = {
6
+ path: string[];
7
+ query: string[];
8
+ body: string[];
9
+ cookie: string[];
10
+ header: string[];
11
+ _extras: string[];
12
+ };
13
+ /**
14
+ * Validates that the sources (i.e., the value) for all key entries are valid
15
+ */
16
+ export declare class KeySourceValidator implements Validator<Operation, Operation | Type> {
17
+ private bodyDataValidatorSupplier;
18
+ constructor(bodyDataValidatorSupplier: (request: Request, sources: string[]) => BodyDataValidator);
19
+ validate(operation: Operation): import("../../../validation").ValidationResult<Type | Operation>;
20
+ getKeysBySource(key: Record<string, string>): KeyBySourceCollection;
21
+ validateParameter(operation: Operation, bag: Record<string, QueryParameter | Parameter>, keys: KeyBySourceCollection, source: keyof KeyBySourceCollection): import("@conduit-client/utils").Err<never, ValidationMessage<Type | Operation>[]> | import("@conduit-client/utils").Ok<ValidationMessage<Type | Operation>[], never>;
22
+ validateBody(operation: Operation, bodyDataValidator: BodyDataValidator): import("@conduit-client/utils").Ok<never[], never> | import("@conduit-client/utils").Err<never, ValidationMessage<Type | Operation>[]>;
23
+ validateKeysWhenMissingRequest(keysBySource: KeyBySourceCollection, operation: Operation): import("@conduit-client/utils").Ok<never[], never> | import("@conduit-client/utils").Err<never, ValidationMessage<Operation>[]>;
24
+ }
25
+ export {};
@@ -0,0 +1,19 @@
1
+ import type { Operation, ReadOnlyTypeRegistry, Type } from '../../..';
2
+ import { ValidationMessage, Validator } from '../../../validation';
3
+ /**
4
+ * Validates that if an operation is not normalized, its responses payloads has
5
+ * NO references to identifiable (i.e., normalized) types
6
+ */
7
+ export declare class NoNormalizedTypesValidator implements Validator<Operation, Operation | Type> {
8
+ private types;
9
+ constructor(types: ReadOnlyTypeRegistry);
10
+ validate(operation: Operation): import("@conduit-client/utils").Ok<never[], never> | import("@conduit-client/utils").Err<never, ValidationMessage<Type | Operation>[]>;
11
+ /**
12
+ * Completes a breadth-first search of a Type to locate any nested types that are identifiable.
13
+ *
14
+ * @returns a Set of all nested types that are identifiable.
15
+ * @param start
16
+ * @protected
17
+ */
18
+ findNestedIdentifiableTypes(start: Type): Set<Type>;
19
+ }