@convert-buddy/importer-contracts 0.1.0-beta.1
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/LICENSE +64 -0
- package/NOTICE +33 -0
- package/README.md +74 -0
- package/dist/index.d.ts +234 -0
- package/dist/index.js +1125 -0
- package/package.json +49 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
Convert Buddy Free Distribution License 1.0
|
|
2
|
+
|
|
3
|
+
Copyright (c) Convert Buddy copyright holders. All rights reserved, except as
|
|
4
|
+
expressly granted below or by an applicable separate license.
|
|
5
|
+
|
|
6
|
+
1. Scope
|
|
7
|
+
This license applies to first-party material in official Convert Buddy package
|
|
8
|
+
distributions carrying this license (the Software), to the extent its copyright
|
|
9
|
+
holders have authority to license that material on these terms. It does not grant
|
|
10
|
+
access to the private development repository or license undistributed source code.
|
|
11
|
+
Previously licensed material and third-party components are addressed in section 5.
|
|
12
|
+
|
|
13
|
+
2. Free application use
|
|
14
|
+
You may download, install, copy, run, and use the Software without a license fee
|
|
15
|
+
for personal, educational, nonprofit, internal business, and commercial purposes,
|
|
16
|
+
including commercial applications and hosted services. There are no per-user,
|
|
17
|
+
per-record, or revenue limits under this license.
|
|
18
|
+
|
|
19
|
+
You may bundle and redistribute the Software as part of your applications, SDK
|
|
20
|
+
integrations, websites, and hosted services, including through application stores
|
|
21
|
+
and CDNs. You may modify distributed JavaScript and other distributed integration
|
|
22
|
+
files as needed for those uses, including compilation, bundling, and minification.
|
|
23
|
+
You may mirror unmodified official packages for dependency installation and
|
|
24
|
+
archiving, including private registries and public package caches.
|
|
25
|
+
|
|
26
|
+
Keep this license and all applicable copyright and third-party notices with
|
|
27
|
+
redistributed copies, or in an accompanying, accessible legal-notices file or page
|
|
28
|
+
when bundling prevents retaining individual files. Identify your modifications
|
|
29
|
+
without implying that the modified distribution is an official Convert Buddy release.
|
|
30
|
+
|
|
31
|
+
3. Reserved rights
|
|
32
|
+
This is a proprietary distribution license, not an open-source license. Except
|
|
33
|
+
as allowed above, you may not distribute or sublicense the Software as a standalone
|
|
34
|
+
library, engine, or replacement Convert Buddy package, or rebrand or sell it as
|
|
35
|
+
your own standalone software product. This does not restrict selling your own
|
|
36
|
+
applications or services that integrate the Software as permitted in section 2.
|
|
37
|
+
No rights to unpublished source code, trademarks, or an endorsement are granted.
|
|
38
|
+
Rights not expressly granted are reserved. Statutory rights that cannot lawfully
|
|
39
|
+
be excluded or limited by agreement remain unaffected.
|
|
40
|
+
|
|
41
|
+
4. Hosted services
|
|
42
|
+
This license does not include Convert Buddy Cloud subscriptions, hosted quotas,
|
|
43
|
+
support commitments, or service-level guarantees. Those services have separate
|
|
44
|
+
terms. Their availability or pricing does not change the free-use grant for a
|
|
45
|
+
copy of the Software obtained under this license.
|
|
46
|
+
|
|
47
|
+
5. Earlier releases and third-party material
|
|
48
|
+
This license does not revoke, replace, or restrict rights already granted under
|
|
49
|
+
MIT or any other separate license. Earlier Convert Buddy releases and portions
|
|
50
|
+
made available under MIT retain those permissions; see NOTICE and accompanying
|
|
51
|
+
license files. Where that material is included in this distribution, its separate
|
|
52
|
+
license continues to apply to that material. Third-party libraries, models,
|
|
53
|
+
datasets, generated bindings, and other separately licensed material retain their
|
|
54
|
+
own terms. These restrictions apply only to first-party material that is not
|
|
55
|
+
already available to you under a broader applicable license. You must comply with
|
|
56
|
+
the applicable notices and licenses for each included component.
|
|
57
|
+
|
|
58
|
+
6. No warranty or liability
|
|
59
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
60
|
+
IMPLIED, INCLUDING MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND
|
|
61
|
+
NONINFRINGEMENT. TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE COPYRIGHT HOLDERS
|
|
62
|
+
ARE NOT LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY ARISING FROM, OUT OF,
|
|
63
|
+
OR IN CONNECTION WITH THE SOFTWARE OR ITS USE, WHETHER IN CONTRACT, TORT, OR
|
|
64
|
+
OTHERWISE.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
Convert Buddy distribution notices
|
|
2
|
+
|
|
3
|
+
Earlier Convert Buddy releases and portions licensed under MIT retain their
|
|
4
|
+
original permissions. The free distribution license does not revoke those rights.
|
|
5
|
+
The following is the original repository license text, preserved for that material.
|
|
6
|
+
It is not a grant of MIT rights for new proprietary material.
|
|
7
|
+
|
|
8
|
+
MIT License
|
|
9
|
+
|
|
10
|
+
Copyright (c) Convert Buddy contributors
|
|
11
|
+
|
|
12
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
14
|
+
in the Software without restriction, including without limitation the rights
|
|
15
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
17
|
+
furnished to do so, subject to the following conditions:
|
|
18
|
+
|
|
19
|
+
The above copyright notice and this permission notice shall be included in all
|
|
20
|
+
copies or substantial portions of the Software.
|
|
21
|
+
|
|
22
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
28
|
+
SOFTWARE.
|
|
29
|
+
|
|
30
|
+
Third-party components retain their own licenses and copyright notices. Keep all
|
|
31
|
+
accompanying third-party license files when redistributing. OCR model weights and
|
|
32
|
+
other separately obtained assets require their own license review; this notice
|
|
33
|
+
is not a grant of rights to those assets.
|
package/README.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# `@convert-buddy/importer-contracts`
|
|
2
|
+
|
|
3
|
+
Public, versioned data contracts shared by the free importer and Convert
|
|
4
|
+
Buddy Cloud. The package contains plain TypeScript types plus strict runtime
|
|
5
|
+
parsers; persisted configuration is JSON and is not tied to a validation
|
|
6
|
+
framework.
|
|
7
|
+
|
|
8
|
+
## Contracts
|
|
9
|
+
|
|
10
|
+
- `TargetSchemaV1` describes an immutable published target schema.
|
|
11
|
+
- `SourceProfileV1` describes a bounded, privacy-reviewed view of an input file.
|
|
12
|
+
- `TransformPlanV1` describes allowlisted deterministic mapping operations.
|
|
13
|
+
- `AcceptedRecordBatchV1` and `DeliveryReceiptV1` define the no-store delivery
|
|
14
|
+
envelope and acknowledgement.
|
|
15
|
+
|
|
16
|
+
Every parser rejects unknown properties, oversized payloads, non-JSON values,
|
|
17
|
+
prototype-polluting property names, incompatible operations, and invalid
|
|
18
|
+
cross-contract references. `parseTransformPlanV1` requires the exact source
|
|
19
|
+
profile and target schema version that were used for the mapping request.
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import {
|
|
23
|
+
parseSourceProfileV1,
|
|
24
|
+
parseTargetSchemaV1,
|
|
25
|
+
parseTransformPlanV1,
|
|
26
|
+
} from "@convert-buddy/importer-contracts";
|
|
27
|
+
|
|
28
|
+
const schema = parseTargetSchemaV1(schemaJson);
|
|
29
|
+
const profile = parseSourceProfileV1(profileJson);
|
|
30
|
+
const plan = parseTransformPlanV1(modelOutput, {
|
|
31
|
+
sourceProfile: profile,
|
|
32
|
+
targetSchema: schema,
|
|
33
|
+
targetSchemaVersionId: "schema-version-17",
|
|
34
|
+
});
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Sample values are rejected by default. A caller must explicitly pass
|
|
38
|
+
`{ allowSamples: true }`, and the configured count and string-length limits are
|
|
39
|
+
still applied.
|
|
40
|
+
|
|
41
|
+
AI output is always data. This package deliberately has no operation for code,
|
|
42
|
+
general expressions, network access, or dynamic evaluation.
|
|
43
|
+
|
|
44
|
+
## Delivery verification
|
|
45
|
+
|
|
46
|
+
Customer endpoints should verify the exact raw request bytes before parsing the
|
|
47
|
+
JSON body. The helper checks HMAC-SHA-256 authenticity and the default five-minute
|
|
48
|
+
freshness window:
|
|
49
|
+
|
|
50
|
+
```ts
|
|
51
|
+
import {
|
|
52
|
+
DELIVERY_HEADERS,
|
|
53
|
+
verifyDeliverySignatureV1,
|
|
54
|
+
} from "@convert-buddy/importer-contracts";
|
|
55
|
+
|
|
56
|
+
const rawBody = new Uint8Array(await request.arrayBuffer());
|
|
57
|
+
const verified = await verifyDeliverySignatureV1({
|
|
58
|
+
batchId: request.headers.get(DELIVERY_HEADERS.batchId) ?? "",
|
|
59
|
+
importId: request.headers.get(DELIVERY_HEADERS.importId) ?? "",
|
|
60
|
+
rawBody,
|
|
61
|
+
signature: request.headers.get(DELIVERY_HEADERS.signature) ?? "",
|
|
62
|
+
signingSecret: env.CONVERT_BUDDY_SIGNING_SECRET,
|
|
63
|
+
timestamp: request.headers.get(DELIVERY_HEADERS.signatureTimestamp) ?? "",
|
|
64
|
+
});
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Make `batchId` idempotent before applying records. Do not reconstruct or
|
|
68
|
+
re-serialize the body for signature verification.
|
|
69
|
+
|
|
70
|
+
## Distribution and license
|
|
71
|
+
|
|
72
|
+
Free for personal and commercial application use under the [Convert Buddy Free
|
|
73
|
+
Distribution License](LICENSE). Application bundling is allowed with notices
|
|
74
|
+
retained. Development source is private; Cloud services have separate terms.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
type JsonPrimitive = null | boolean | number | string;
|
|
2
|
+
type JsonValue = JsonPrimitive | JsonValue[] | {
|
|
3
|
+
[key: string]: JsonValue;
|
|
4
|
+
};
|
|
5
|
+
declare const TARGET_FIELD_TYPES: readonly ["string", "integer", "number", "boolean", "date", "datetime", "enum"];
|
|
6
|
+
type TargetFieldType = (typeof TARGET_FIELD_TYPES)[number];
|
|
7
|
+
type UnknownFieldPolicyV1 = "ignore" | "reject" | "preserve";
|
|
8
|
+
interface TargetConstraintsV1 {
|
|
9
|
+
min?: number;
|
|
10
|
+
max?: number;
|
|
11
|
+
minLength?: number;
|
|
12
|
+
maxLength?: number;
|
|
13
|
+
pattern?: string;
|
|
14
|
+
values?: string[];
|
|
15
|
+
}
|
|
16
|
+
interface TargetFieldV1 {
|
|
17
|
+
key: string;
|
|
18
|
+
label: string;
|
|
19
|
+
type: TargetFieldType;
|
|
20
|
+
required?: boolean;
|
|
21
|
+
aliases?: string[];
|
|
22
|
+
description?: string;
|
|
23
|
+
defaultValue?: JsonValue;
|
|
24
|
+
constraints?: TargetConstraintsV1;
|
|
25
|
+
}
|
|
26
|
+
interface TargetSchemaV1 {
|
|
27
|
+
version: 1;
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
fields: TargetFieldV1[];
|
|
31
|
+
unknownFields: UnknownFieldPolicyV1;
|
|
32
|
+
}
|
|
33
|
+
declare const SOURCE_FORMATS: readonly ["csv", "xml", "json", "ndjson", "xlsx"];
|
|
34
|
+
type SourceFormatV1 = (typeof SOURCE_FORMATS)[number];
|
|
35
|
+
declare const SOURCE_INFERRED_TYPES: readonly ["string", "integer", "number", "boolean", "date", "datetime", "enum", "null", "object", "array", "unknown"];
|
|
36
|
+
type SourceInferredTypeV1 = (typeof SOURCE_INFERRED_TYPES)[number];
|
|
37
|
+
interface SourceInferredTypeRatioV1 {
|
|
38
|
+
type: SourceInferredTypeV1;
|
|
39
|
+
ratio: number;
|
|
40
|
+
}
|
|
41
|
+
interface SourceFieldProfileV1 {
|
|
42
|
+
path: string;
|
|
43
|
+
normalizedName: string;
|
|
44
|
+
inferredTypes: SourceInferredTypeRatioV1[];
|
|
45
|
+
nullRatio: number;
|
|
46
|
+
distinctEstimate?: number;
|
|
47
|
+
samples?: string[];
|
|
48
|
+
}
|
|
49
|
+
interface SourceProfileV1 {
|
|
50
|
+
version: 1;
|
|
51
|
+
format: SourceFormatV1;
|
|
52
|
+
structureFingerprint: string;
|
|
53
|
+
recordPath?: string;
|
|
54
|
+
fields: SourceFieldProfileV1[];
|
|
55
|
+
}
|
|
56
|
+
type TransformOperationV1 = {
|
|
57
|
+
op: "trim";
|
|
58
|
+
} | {
|
|
59
|
+
op: "lowercase";
|
|
60
|
+
} | {
|
|
61
|
+
op: "uppercase";
|
|
62
|
+
} | {
|
|
63
|
+
op: "coerce";
|
|
64
|
+
type: Exclude<TargetFieldType, "enum">;
|
|
65
|
+
} | {
|
|
66
|
+
op: "parse_date";
|
|
67
|
+
formats: string[];
|
|
68
|
+
} | {
|
|
69
|
+
op: "replace";
|
|
70
|
+
pattern: string;
|
|
71
|
+
replacement: string;
|
|
72
|
+
} | {
|
|
73
|
+
op: "enum_map";
|
|
74
|
+
values: Record<string, string>;
|
|
75
|
+
} | {
|
|
76
|
+
op: "split";
|
|
77
|
+
separator: string;
|
|
78
|
+
index: number;
|
|
79
|
+
} | {
|
|
80
|
+
op: "join";
|
|
81
|
+
separator: string;
|
|
82
|
+
} | {
|
|
83
|
+
op: "default";
|
|
84
|
+
value: JsonValue;
|
|
85
|
+
};
|
|
86
|
+
interface TransformMappingV1 {
|
|
87
|
+
sources: string[];
|
|
88
|
+
target: string;
|
|
89
|
+
confidence: number;
|
|
90
|
+
reasonCode: string;
|
|
91
|
+
operations: TransformOperationV1[];
|
|
92
|
+
}
|
|
93
|
+
interface TransformWarningV1 {
|
|
94
|
+
code: string;
|
|
95
|
+
message: string;
|
|
96
|
+
}
|
|
97
|
+
interface TransformPlanV1 {
|
|
98
|
+
version: 1;
|
|
99
|
+
sourceFingerprint: string;
|
|
100
|
+
targetSchemaVersionId: string;
|
|
101
|
+
mappings: TransformMappingV1[];
|
|
102
|
+
unmappedSources: string[];
|
|
103
|
+
unsatisfiedTargets: string[];
|
|
104
|
+
warnings: TransformWarningV1[];
|
|
105
|
+
}
|
|
106
|
+
interface AcceptedRecordBatchV1 {
|
|
107
|
+
version: 1;
|
|
108
|
+
records: Array<Record<string, JsonValue>>;
|
|
109
|
+
}
|
|
110
|
+
interface DeliveryReceiptV1 {
|
|
111
|
+
version: 1;
|
|
112
|
+
batchId: string;
|
|
113
|
+
recordCount: number;
|
|
114
|
+
status: "delivered" | "duplicate";
|
|
115
|
+
}
|
|
116
|
+
type ContractIssueCode = "invalid_type" | "invalid_value" | "missing_value" | "unknown_property" | "duplicate_value" | "limit_exceeded" | "unsafe_pattern" | "incompatible_operation" | "unknown_source" | "unknown_target" | "fingerprint_mismatch" | "schema_version_mismatch";
|
|
117
|
+
interface ContractIssue {
|
|
118
|
+
code: ContractIssueCode;
|
|
119
|
+
path: string;
|
|
120
|
+
message: string;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
declare function canonicalStringify(value: unknown): string;
|
|
124
|
+
declare function canonicalByteLength(value: unknown): number;
|
|
125
|
+
declare function cloneJsonValue(value: JsonValue): JsonValue;
|
|
126
|
+
|
|
127
|
+
/** Calendar dates are never interpreted in the browser's local timezone. */
|
|
128
|
+
declare function isCalendarDate(value: string): boolean;
|
|
129
|
+
/** Datetimes require an explicit UTC offset; ambiguous local times are rejected. */
|
|
130
|
+
declare function isOffsetDateTime(value: string): boolean;
|
|
131
|
+
/** Explicit numeric calendar formats; conflicting interpretations remain invalid. */
|
|
132
|
+
declare function parseCalendarFormats(value: string, formats: readonly string[]): string | undefined;
|
|
133
|
+
|
|
134
|
+
interface ContractLimits {
|
|
135
|
+
maxAliasesPerField: number;
|
|
136
|
+
maxCanonicalBytes: number;
|
|
137
|
+
maxDescriptionLength: number;
|
|
138
|
+
maxDictionaryEntries: number;
|
|
139
|
+
maxFields: number;
|
|
140
|
+
maxMappings: number;
|
|
141
|
+
maxOperationsPerMapping: number;
|
|
142
|
+
maxPatternLength: number;
|
|
143
|
+
maxRecordPathLength: number;
|
|
144
|
+
maxSamplesPerField: number;
|
|
145
|
+
maxSampleLength: number;
|
|
146
|
+
maxStringLength: number;
|
|
147
|
+
maxWarnings: number;
|
|
148
|
+
}
|
|
149
|
+
declare const DEFAULT_CONTRACT_LIMITS: Readonly<ContractLimits>;
|
|
150
|
+
interface ContractParseOptions {
|
|
151
|
+
allowSamples?: boolean;
|
|
152
|
+
limits?: Partial<ContractLimits>;
|
|
153
|
+
}
|
|
154
|
+
declare function resolveContractLimits(overrides: Partial<ContractLimits> | undefined): Readonly<ContractLimits>;
|
|
155
|
+
|
|
156
|
+
declare const DELIVERY_PROTOCOL_VERSION: 1;
|
|
157
|
+
declare const DEFAULT_MAX_DELIVERY_BATCH_BYTES: number;
|
|
158
|
+
declare const DEFAULT_MAX_DELIVERY_BATCH_RECORDS = 10000;
|
|
159
|
+
declare const DEFAULT_DELIVERY_SIGNATURE_TOLERANCE_SECONDS: number;
|
|
160
|
+
declare const DELIVERY_HEADERS: Readonly<{
|
|
161
|
+
readonly apiKey: "x-convert-buddy-key";
|
|
162
|
+
readonly batchId: "x-convert-buddy-batch-id";
|
|
163
|
+
readonly destination: "x-convert-buddy-destination";
|
|
164
|
+
readonly importId: "x-convert-buddy-import-id";
|
|
165
|
+
readonly signature: "x-convert-buddy-signature";
|
|
166
|
+
readonly signatureTimestamp: "x-convert-buddy-signature-timestamp";
|
|
167
|
+
}>;
|
|
168
|
+
interface DeliveryBatchParseOptions extends ContractParseOptions {
|
|
169
|
+
maxBatchBytes?: number;
|
|
170
|
+
maxRecords?: number;
|
|
171
|
+
}
|
|
172
|
+
interface DeliverySignatureInputV1 {
|
|
173
|
+
batchId: string;
|
|
174
|
+
importId: string;
|
|
175
|
+
rawBody: Uint8Array;
|
|
176
|
+
timestamp: string;
|
|
177
|
+
}
|
|
178
|
+
interface DeliverySignatureVerificationV1 extends DeliverySignatureInputV1 {
|
|
179
|
+
nowEpochSeconds?: number;
|
|
180
|
+
signature: string;
|
|
181
|
+
signingSecret: string | Uint8Array;
|
|
182
|
+
toleranceSeconds?: number;
|
|
183
|
+
}
|
|
184
|
+
declare function parseAcceptedRecordBatchV1(input: unknown, options?: DeliveryBatchParseOptions): AcceptedRecordBatchV1;
|
|
185
|
+
declare function signDeliveryRequestV1(signingSecret: string | Uint8Array, input: DeliverySignatureInputV1): Promise<string>;
|
|
186
|
+
declare function verifyDeliverySignatureV1(input: DeliverySignatureVerificationV1): Promise<boolean>;
|
|
187
|
+
|
|
188
|
+
interface StructureDescriptorV1 {
|
|
189
|
+
version: 1;
|
|
190
|
+
format: SourceProfileV1["format"];
|
|
191
|
+
recordPath?: string;
|
|
192
|
+
fields: Array<{
|
|
193
|
+
path: string;
|
|
194
|
+
normalizedName: string;
|
|
195
|
+
inferredTypes: string[];
|
|
196
|
+
}>;
|
|
197
|
+
}
|
|
198
|
+
declare function describeSourceStructure(profile: SourceProfileV1): StructureDescriptorV1;
|
|
199
|
+
declare function computeStructureFingerprint(profile: SourceProfileV1): Promise<string>;
|
|
200
|
+
|
|
201
|
+
declare function parseSourceProfileV1(input: unknown, options?: ContractParseOptions): SourceProfileV1;
|
|
202
|
+
|
|
203
|
+
declare function parseTargetSchemaV1(input: unknown, options?: ContractParseOptions): TargetSchemaV1;
|
|
204
|
+
declare function isTargetValueCompatible(value: JsonValue, type: TargetFieldType): boolean;
|
|
205
|
+
|
|
206
|
+
interface TargetSchemaBuilderOptionsV1 {
|
|
207
|
+
id: string;
|
|
208
|
+
name: string;
|
|
209
|
+
unknownFields?: UnknownFieldPolicyV1;
|
|
210
|
+
}
|
|
211
|
+
/** Creates validated, immutable schema manifests without coupling consumers to a validator library. */
|
|
212
|
+
declare class TargetSchemaBuilderV1 {
|
|
213
|
+
#private;
|
|
214
|
+
private readonly options;
|
|
215
|
+
constructor(options: Readonly<TargetSchemaBuilderOptionsV1>);
|
|
216
|
+
field(field: Readonly<TargetFieldV1>): this;
|
|
217
|
+
fields(fields: ReadonlyArray<Readonly<TargetFieldV1>>): this;
|
|
218
|
+
build(): Readonly<TargetSchemaV1>;
|
|
219
|
+
}
|
|
220
|
+
declare function defineTargetSchemaV1(schema: Readonly<TargetSchemaV1>): Readonly<TargetSchemaV1>;
|
|
221
|
+
|
|
222
|
+
interface TransformPlanContextV1 {
|
|
223
|
+
sourceProfile: SourceProfileV1;
|
|
224
|
+
targetSchema: TargetSchemaV1;
|
|
225
|
+
targetSchemaVersionId: string;
|
|
226
|
+
}
|
|
227
|
+
declare function parseTransformPlanV1(input: unknown, planContext: TransformPlanContextV1, options?: ContractParseOptions): TransformPlanV1;
|
|
228
|
+
|
|
229
|
+
declare class ContractValidationError extends TypeError {
|
|
230
|
+
readonly issues: readonly ContractIssue[];
|
|
231
|
+
constructor(contractName: string, issues: readonly ContractIssue[]);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
export { type AcceptedRecordBatchV1, type ContractIssue, type ContractIssueCode, type ContractLimits, type ContractParseOptions, ContractValidationError, DEFAULT_CONTRACT_LIMITS, DEFAULT_DELIVERY_SIGNATURE_TOLERANCE_SECONDS, DEFAULT_MAX_DELIVERY_BATCH_BYTES, DEFAULT_MAX_DELIVERY_BATCH_RECORDS, DELIVERY_HEADERS, DELIVERY_PROTOCOL_VERSION, type DeliveryBatchParseOptions, type DeliveryReceiptV1, type DeliverySignatureInputV1, type DeliverySignatureVerificationV1, type JsonPrimitive, type JsonValue, SOURCE_FORMATS, SOURCE_INFERRED_TYPES, type SourceFieldProfileV1, type SourceFormatV1, type SourceInferredTypeRatioV1, type SourceInferredTypeV1, type SourceProfileV1, TARGET_FIELD_TYPES, type TargetConstraintsV1, type TargetFieldType, type TargetFieldV1, type TargetSchemaBuilderOptionsV1, TargetSchemaBuilderV1, type TargetSchemaV1, type TransformMappingV1, type TransformOperationV1, type TransformPlanContextV1, type TransformPlanV1, type TransformWarningV1, type UnknownFieldPolicyV1, canonicalByteLength, canonicalStringify, cloneJsonValue, computeStructureFingerprint, defineTargetSchemaV1, describeSourceStructure, isCalendarDate, isOffsetDateTime, isTargetValueCompatible, parseAcceptedRecordBatchV1, parseCalendarFormats, parseSourceProfileV1, parseTargetSchemaV1, parseTransformPlanV1, resolveContractLimits, signDeliveryRequestV1, verifyDeliverySignatureV1 };
|