@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.
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,96 @@
1
+ import type { Operation } from '../../..';
2
+ import { Validator } from '../../../validation';
3
+ /**
4
+ * Validates that normalized operations define a 200-level JSON response
5
+ */
6
+ export declare class Response200Validator<T extends Operation = Operation> implements Validator<T, Operation> {
7
+ validate(operation: T): import("@conduit-client/utils").Ok<never[], never> | import("@conduit-client/utils").Err<never, import("../../../validation").ValidationMessage<(T & import("../..").BaseOperation<import("../../..").Type, import("../../..").Type> & {
8
+ type: "aura";
9
+ aura: {
10
+ methodName: string;
11
+ };
12
+ } & {
13
+ cacheStrategy: {
14
+ type: "normalized";
15
+ };
16
+ }) | (T & import("../..").BaseOperation<import("../../..").Type, import("../../..").Type> & {
17
+ configBodyParam: string;
18
+ } & {
19
+ type: "aura";
20
+ aura: {
21
+ methodName: string;
22
+ };
23
+ } & {
24
+ aura: import("../..").BaseAuraOperation["aura"] & {
25
+ bodyParam: string;
26
+ };
27
+ } & {
28
+ cacheStrategy: {
29
+ type: "normalized";
30
+ };
31
+ }) | (T & import("../..").BaseOperation<import("../../..").Type, import("../../..").Type> & {
32
+ type: "http";
33
+ } & {
34
+ cacheStrategy: {
35
+ type: "normalized";
36
+ };
37
+ }) | (T & import("../..").BaseOperation<import("../../..").Type, import("../../..").Type> & {
38
+ type: "http";
39
+ } & {
40
+ configBodyParam: string;
41
+ } & {
42
+ cacheStrategy: {
43
+ type: "normalized";
44
+ };
45
+ }) | (T & import("../..").BaseOperation<import("../../..").Type, import("../../..").Type> & {
46
+ type: "aura";
47
+ aura: {
48
+ methodName: string;
49
+ };
50
+ } & {
51
+ operationType: "graphql";
52
+ graphqlConfig: import("../..").GraphQLConfig;
53
+ } & {
54
+ cacheStrategy: {
55
+ type: "normalized";
56
+ };
57
+ }) | (T & import("../..").BaseOperation<import("../../..").Type, import("../../..").Type> & {
58
+ configBodyParam: string;
59
+ } & {
60
+ type: "aura";
61
+ aura: {
62
+ methodName: string;
63
+ };
64
+ } & {
65
+ aura: import("../..").BaseAuraOperation["aura"] & {
66
+ bodyParam: string;
67
+ };
68
+ } & {
69
+ operationType: "graphql";
70
+ graphqlConfig: import("../..").GraphQLConfig;
71
+ } & {
72
+ cacheStrategy: {
73
+ type: "normalized";
74
+ };
75
+ }) | (T & import("../..").BaseOperation<import("../../..").Type, import("../../..").Type> & {
76
+ type: "http";
77
+ } & {
78
+ operationType: "graphql";
79
+ graphqlConfig: import("../..").GraphQLConfig;
80
+ } & {
81
+ cacheStrategy: {
82
+ type: "normalized";
83
+ };
84
+ }) | (T & import("../..").BaseOperation<import("../../..").Type, import("../../..").Type> & {
85
+ type: "http";
86
+ } & {
87
+ configBodyParam: string;
88
+ } & {
89
+ operationType: "graphql";
90
+ graphqlConfig: import("../..").GraphQLConfig;
91
+ } & {
92
+ cacheStrategy: {
93
+ type: "normalized";
94
+ };
95
+ })>[]>;
96
+ }
@@ -0,0 +1,3 @@
1
+ import { API, Operation, Type } from '../../..';
2
+ import { Validator } from '../../../validation';
3
+ export declare function buildOperationValidator(api: API): Validator<Operation, Operation | Type>;
@@ -0,0 +1,4 @@
1
+ import { NormalizedOperation, Operation } from '../../endpoint';
2
+ import { ValidationMessage, ValidationSeverity } from '../../../validation';
3
+ export declare function isNormalizedOperation(operation: Operation): operation is NormalizedOperation;
4
+ export declare function getFormattedMessage<T = Operation>(subject: T, message: string, severity?: ValidationSeverity): ValidationMessage<T>;
@@ -0,0 +1,3 @@
1
+ export * from './api';
2
+ export * from './types';
3
+ export * from './amf';
@@ -0,0 +1,106 @@
1
+ export type TypeCacheControlExtension = {
2
+ type: 'max-age';
3
+ 'max-age': number;
4
+ 'stale-while-revalidate'?: number;
5
+ } | {
6
+ type: 'no-cache';
7
+ };
8
+ export type TypeExtensions = {
9
+ type: 'unidentifiable';
10
+ } | {
11
+ type: 'identifiable';
12
+ key: {
13
+ fields: Record<string, string>;
14
+ };
15
+ 'cache-control': TypeCacheControlExtension;
16
+ };
17
+ export type BaseType = {
18
+ type: string;
19
+ extensions?: TypeExtensions;
20
+ };
21
+ export type NilType = {
22
+ type: 'nil';
23
+ } & BaseType;
24
+ export type BooleanType = {
25
+ type: 'boolean';
26
+ } & BaseType;
27
+ export type DoubleType = {
28
+ type: 'double';
29
+ } & BaseType;
30
+ export type IntegerType = {
31
+ type: 'integer';
32
+ } & BaseType;
33
+ export type NumberType = {
34
+ type: 'number';
35
+ } & BaseType;
36
+ export type StringType = {
37
+ type: 'string';
38
+ } & BaseType;
39
+ export type DateType = {
40
+ type: 'date';
41
+ } & BaseType;
42
+ export type TimeType = {
43
+ type: 'time';
44
+ } & BaseType;
45
+ export type DateTimeOnlyType = {
46
+ type: 'datetime-only';
47
+ } & BaseType;
48
+ export type DateTimeType = {
49
+ type: 'datetime';
50
+ format: 'date' | 'date-time';
51
+ } & BaseType;
52
+ export type EnumType = {
53
+ type: 'enum';
54
+ values: Array<string | number | boolean | null>;
55
+ } & BaseType;
56
+ export type ScalarType = BooleanType | DoubleType | IntegerType | NumberType | StringType | DateType | TimeType | DateTimeOnlyType | DateTimeType;
57
+ export type Property = {
58
+ type: Type;
59
+ required: boolean;
60
+ };
61
+ export type ObjectType = {
62
+ type: 'object';
63
+ properties: Record<string, Property>;
64
+ additionalProperties: Type;
65
+ } & BaseType;
66
+ export type DiscriminatedObjectType = {
67
+ type: 'discriminatedObject';
68
+ discriminator: string;
69
+ mapping: Record<string, Type>;
70
+ baseType: ObjectType;
71
+ } & BaseType;
72
+ export type ArrayType = {
73
+ type: 'array';
74
+ items: Type;
75
+ } & BaseType;
76
+ export type OneOf = {
77
+ type: 'oneOf';
78
+ oneOf: Type[];
79
+ } & BaseType;
80
+ export type AllOfType = {
81
+ type: 'allOf';
82
+ allOf: Type[];
83
+ includes: (t: Type) => boolean;
84
+ } & BaseType;
85
+ export type AnyType = {
86
+ type: 'any';
87
+ } & BaseType;
88
+ export type NotType = {
89
+ type: 'not';
90
+ not: Type;
91
+ } & BaseType;
92
+ export type RefType = {
93
+ type: 'ref';
94
+ $ref: Type;
95
+ } & BaseType;
96
+ export type Type = ScalarType | NilType | DiscriminatedObjectType | ObjectType | ArrayType | OneOf | AllOfType | AnyType | NotType | EnumType | RefType;
97
+ export type IdentifiableType = Type & {
98
+ extensions: {
99
+ type: 'identifiable';
100
+ };
101
+ };
102
+ export type UnidentifiableType = Type & {
103
+ extensions?: {
104
+ type: 'unidentifiable';
105
+ };
106
+ };
@@ -0,0 +1,19 @@
1
+ import type { Type } from './Type';
2
+ type TypeRegistryExtensions<SupportedTypes> = {
3
+ /**
4
+ * Returns the name of the given type within this regstry; undefined if the type is not
5
+ * present in the registry.
6
+ *
7
+ * @param t SupportedType
8
+ */
9
+ nameOf(t: SupportedTypes): string | undefined;
10
+ };
11
+ export type ReadOnlyTypeRegistry<SupportedTypes extends Type = Type> = ReadonlyMap<string, SupportedTypes> & TypeRegistryExtensions<SupportedTypes>;
12
+ export type TypeRegistry<SupportedTypes extends Type = Type> = Map<string, SupportedTypes> & TypeRegistryExtensions<SupportedTypes>;
13
+ /**
14
+ * Base implementation of TypeRegistry.
15
+ */
16
+ export declare class BaseTypeRegistry<SupportedTypes extends Type = Type> extends Map<string, SupportedTypes> implements TypeRegistry<SupportedTypes> {
17
+ nameOf(t: SupportedTypes): string | undefined;
18
+ }
19
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ export * from './Type';
2
+ export * from './TypeRegistry';
3
+ export { buildTypeValidator } from './validators';
4
+ export * from './utils';
5
+ export * from './types-equal';
@@ -0,0 +1,2 @@
1
+ import { Type } from './Type';
2
+ export declare function typesEqual(a: Type, b: Type): boolean;
@@ -0,0 +1,27 @@
1
+ import { AllOfType, AnyType, ArrayType, BooleanType, DateTimeOnlyType, DateTimeType, DateType, DiscriminatedObjectType, DoubleType, EnumType, IdentifiableType, IntegerType, NilType, NotType, NumberType, ObjectType, OneOf, RefType, ScalarType, StringType, TimeType, Type } from './Type';
2
+ export declare function isRefType(type: Type): type is RefType;
3
+ export declare function isNilType(type: Type): type is NilType;
4
+ export declare function isBooleanType(type: Type): type is BooleanType;
5
+ export declare function isDoubleType(type: Type): type is DoubleType;
6
+ export declare function isIntegerType(type: Type): type is IntegerType;
7
+ export declare function isNumberType(type: Type): type is NumberType;
8
+ export declare function isStringType(type: Type): type is StringType;
9
+ export declare function isDateType(type: Type): type is DateType;
10
+ export declare function isTimeType(type: Type): type is TimeType;
11
+ export declare function isDateTimeOnlyType(type: Type): type is DateTimeOnlyType;
12
+ export declare function isDateTimeType(type: Type): type is DateTimeType;
13
+ export declare function isEnumType(type: Type): type is EnumType;
14
+ export declare function isObjectType(type: Type): type is ObjectType;
15
+ export declare function isDiscriminatedObjectType(type: Type): type is DiscriminatedObjectType;
16
+ export declare function isArrayType(type: Type): type is ArrayType;
17
+ export declare function isOneOfType(type: Type): type is OneOf;
18
+ export declare function isAllOfType(type: Type): type is AllOfType;
19
+ export declare function isAnyType(type: Type): type is AnyType;
20
+ export declare function isNotType(type: Type): type is NotType;
21
+ export declare function isScalar(type: Type): type is ScalarType;
22
+ export declare function isCanonicalStringType(type: Type): type is Type & {
23
+ type: 'string' | 'date' | 'time' | 'datetime-only' | 'datetime';
24
+ };
25
+ export declare function isCanonicalNumberType(type: Type): boolean;
26
+ export declare function isIdentifiableType(type: Type): type is IdentifiableType;
27
+ export declare function canonicalizeType(type: Type): Type;
@@ -0,0 +1,4 @@
1
+ import { ValidationSeverity } from '../../validation';
2
+ import type { ValidationMessage } from '../../validation';
3
+ import type { Type } from '../Type';
4
+ export declare function getFormattedMessage(subject: Type, message: string, severity?: ValidationSeverity): ValidationMessage<Type>;
@@ -0,0 +1,11 @@
1
+ import { type Validator } from '../../../validation';
2
+ import type { Type } from '../../Type';
3
+ import { KeySourcesValidator } from './KeySourcesValidator';
4
+ /**
5
+ * Validates that the fields in a key are valid.
6
+ */
7
+ export declare class KeyFieldReferenceValidator implements Validator<Type, Type> {
8
+ private keySourcesValidatorSupplier;
9
+ constructor(keySourcesValidatorSupplier: (sources: string[]) => KeySourcesValidator);
10
+ validate(type: Type): import("../../../validation").ValidationResult<Type>;
11
+ }
@@ -0,0 +1,20 @@
1
+ import type { ValidationMessage, Validator } from '../../../validation';
2
+ import type { Type } from '../../Type';
3
+ import type { ReadOnlyTypeRegistry } from '../../TypeRegistry';
4
+ /**
5
+ * Validates that a given type does not include a `key` annotation in unsupported types,
6
+ * such as scalar or array types.
7
+ */
8
+ export declare class KeyIsDefinedInSupportedTypeValidator implements Validator<Type, Type> {
9
+ private typeRegistry;
10
+ constructor(typeRegistry: ReadOnlyTypeRegistry);
11
+ /**
12
+ * Validates the specified type to ensure the `key` annotation is not defined on scalar
13
+ * or array types. Returns a validation result indicating if the type is valid and any
14
+ * error messages if it is not.
15
+ *
16
+ * @param type - The type to validate.
17
+ * @returns A `ValidationResult<Type>` object containing the validation outcome and any error messages.
18
+ */
19
+ validate(type: Type): import("@conduit-client/utils").Ok<ValidationMessage<Type>[], never> | import("@conduit-client/utils").Err<never, ValidationMessage<Type>[]>;
20
+ }
@@ -0,0 +1,25 @@
1
+ import { ValidationResult, Validator } from '../../../validation';
2
+ import type { Type } from '../../Type';
3
+ import { ReadOnlyTypeRegistry } from '../../TypeRegistry';
4
+ /**
5
+ * Validates that sources used by a types key are valid
6
+ */
7
+ export declare class KeySourcesValidator implements Validator<Type, Type> {
8
+ private types;
9
+ private sources;
10
+ constructor(types: ReadOnlyTypeRegistry, sources: string[]);
11
+ validate(type: Type): ValidationResult<Type>;
12
+ private getNameOf;
13
+ private isValidFieldKeyForType;
14
+ private validateFieldInOneOfType;
15
+ private validateFieldInAllOfType;
16
+ private validateFieldForDiscriminatedObjectType;
17
+ private validateFieldInSubTypes;
18
+ private validateFieldForObjectType;
19
+ private validateAccessors;
20
+ /**
21
+ * Detects the nullable identifiable pattern: a oneOf type with exactly
22
+ * two members (object + null) where the type has identifiable extensions.
23
+ */
24
+ private isNullableIdentifiablePattern;
25
+ }
@@ -0,0 +1,3 @@
1
+ export { KeyFieldReferenceValidator } from './KeyFieldReferenceValidator';
2
+ export { KeyIsDefinedInSupportedTypeValidator } from './KeyIsDefinedInSupportedTypeValidator';
3
+ export { KeySourcesValidator } from './KeySourcesValidator';
@@ -0,0 +1,4 @@
1
+ import { type Validator } from '../../validation';
2
+ import type { Type } from '../Type';
3
+ import type { ReadOnlyTypeRegistry } from '../TypeRegistry';
4
+ export declare function buildTypeValidator(types: ReadOnlyTypeRegistry): Validator<Type, Type>;
@@ -0,0 +1,29 @@
1
+ import { type Result } from '@conduit-client/utils';
2
+ export declare enum ValidationType {
3
+ Api = "api",
4
+ Type = "type",
5
+ Operation = "operation",
6
+ EndPoint = "endpoint"
7
+ }
8
+ export declare enum ValidationSeverity {
9
+ Info = "info",
10
+ Warning = "warn",
11
+ Error = "error"
12
+ }
13
+ export type ValidationMessage<T> = {
14
+ validationType: ValidationType;
15
+ subject: T;
16
+ severity: ValidationSeverity;
17
+ message: string;
18
+ subValidationMessages?: ValidationMessage<T>[];
19
+ };
20
+ export type ValidationResult<T> = Result<ValidationMessage<T>[], ValidationMessage<T>[]>;
21
+ export interface Validator<Subject, MessageSource> {
22
+ validate(subject: Subject): ValidationResult<MessageSource>;
23
+ }
24
+ export declare function combineValidationResults<T>(results: ValidationResult<T>[]): ValidationResult<T>;
25
+ /**
26
+ * Composes multiple validators into a single validator whose result is the
27
+ * combination of all individual validation results.
28
+ */
29
+ export declare function compose<T, R>(validators: Validator<T, R>[]): Validator<T, R>;
@@ -0,0 +1,2 @@
1
+ import type { z } from 'zod';
2
+ export declare function formatZodError(err: z.ZodError): string;