@carrot-foundation/schemas 0.4.0 → 0.4.2
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/index.cjs +33 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +33 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/schemas/ipfs/collection/collection.example.json +3 -3
- package/schemas/ipfs/collection/collection.schema.json +2 -2
- package/schemas/ipfs/credit/credit.example.json +3 -3
- package/schemas/ipfs/credit/credit.schema.json +2 -2
- package/schemas/ipfs/credit-purchase-receipt/credit-purchase-receipt.example.json +4 -4
- package/schemas/ipfs/credit-purchase-receipt/credit-purchase-receipt.schema.json +2 -2
- package/schemas/ipfs/credit-retirement-receipt/credit-retirement-receipt.example.json +4 -4
- package/schemas/ipfs/credit-retirement-receipt/credit-retirement-receipt.schema.json +2 -2
- package/schemas/ipfs/gas-id/gas-id.example.json +4 -4
- package/schemas/ipfs/gas-id/gas-id.schema.json +5 -5
- package/schemas/ipfs/mass-id/mass-id.example.json +4 -4
- package/schemas/ipfs/mass-id/mass-id.schema.json +10 -10
- package/schemas/ipfs/mass-id-audit/mass-id-audit.example.json +3 -3
- package/schemas/ipfs/mass-id-audit/mass-id-audit.schema.json +2 -2
- package/schemas/ipfs/methodology/methodology.example.json +3 -3
- package/schemas/ipfs/methodology/methodology.schema.json +2 -2
- package/schemas/ipfs/recycled-id/recycled-id.example.json +4 -4
- package/schemas/ipfs/recycled-id/recycled-id.schema.json +6 -6
- package/schemas/schema-hashes.json +10 -10
package/dist/index.cjs
CHANGED
|
@@ -42,9 +42,14 @@ var NonNegativeFloatSchema = zod.z.number().min(0).meta({
|
|
|
42
42
|
description: "Floating-point number that is zero or positive",
|
|
43
43
|
examples: [0, 45.2, 72.5]
|
|
44
44
|
});
|
|
45
|
-
var
|
|
45
|
+
var PositiveFloatSchema = zod.z.number().gt(0).meta({
|
|
46
|
+
title: "Positive Float",
|
|
47
|
+
description: "Floating-point number greater than zero",
|
|
48
|
+
examples: [0.1, 45.2, 72.5]
|
|
49
|
+
});
|
|
50
|
+
var WeightKgSchema = PositiveFloatSchema.meta({
|
|
46
51
|
title: "Weight",
|
|
47
|
-
description: "Weight measurement in kilograms (kg)",
|
|
52
|
+
description: "Weight measurement in kilograms (kg), must be greater than zero",
|
|
48
53
|
examples: [500.35, 3e3]
|
|
49
54
|
});
|
|
50
55
|
var PercentageSchema = NonNegativeFloatSchema.max(100).meta({
|
|
@@ -29481,7 +29486,7 @@ function buildSchemaUrl(schemaPath) {
|
|
|
29481
29486
|
return `${getSchemaBaseUrl()}/${cleanPath}`;
|
|
29482
29487
|
}
|
|
29483
29488
|
function getSchemaVersionOrDefault() {
|
|
29484
|
-
return "0.4.
|
|
29489
|
+
return "0.4.2";
|
|
29485
29490
|
}
|
|
29486
29491
|
|
|
29487
29492
|
// src/shared/schema-validation.ts
|
|
@@ -30376,6 +30381,14 @@ var MassIDIpfsSchema = NftIpfsSchema.safeExtend({
|
|
|
30376
30381
|
missingMessage: "Origin City attribute must be omitted when Pick-up event location.city is not provided",
|
|
30377
30382
|
mismatchMessage: "Origin City attribute must equal Pick-up event location.city"
|
|
30378
30383
|
});
|
|
30384
|
+
validateAttributeValue({
|
|
30385
|
+
ctx,
|
|
30386
|
+
attributeByTraitType,
|
|
30387
|
+
traitType: "Origin Country Subdivision",
|
|
30388
|
+
expectedValue: pickUpLocation?.subdivision_code,
|
|
30389
|
+
missingMessage: "Origin Country Subdivision attribute must be omitted when Pick-up event location.subdivision_code is not provided",
|
|
30390
|
+
mismatchMessage: "Origin Country Subdivision attribute must equal Pick-up event location.subdivision_code"
|
|
30391
|
+
});
|
|
30379
30392
|
validateDateTimeAttribute({
|
|
30380
30393
|
ctx,
|
|
30381
30394
|
attributeByTraitType,
|
|
@@ -30693,6 +30706,14 @@ var GasIDIpfsSchema = NftIpfsSchema.safeExtend({
|
|
|
30693
30706
|
missingMessage: "Origin City attribute must be present and match data.origin_location.city",
|
|
30694
30707
|
mismatchMessage: "Origin City attribute must equal data.origin_location.city"
|
|
30695
30708
|
});
|
|
30709
|
+
validateAttributeValue({
|
|
30710
|
+
ctx,
|
|
30711
|
+
attributeByTraitType,
|
|
30712
|
+
traitType: "Origin Country Subdivision",
|
|
30713
|
+
expectedValue: data.origin_location.subdivision_code,
|
|
30714
|
+
missingMessage: "Origin Country Subdivision attribute must be present and match data.origin_location.subdivision_code",
|
|
30715
|
+
mismatchMessage: "Origin Country Subdivision attribute must equal data.origin_location.subdivision_code"
|
|
30716
|
+
});
|
|
30696
30717
|
validateAttributeValue({
|
|
30697
30718
|
ctx,
|
|
30698
30719
|
attributeByTraitType,
|
|
@@ -30921,6 +30942,14 @@ var RecycledIDIpfsSchema = NftIpfsSchema.safeExtend({
|
|
|
30921
30942
|
missingMessage: "Origin City attribute must be present and match data.origin_location.city",
|
|
30922
30943
|
mismatchMessage: "Origin City attribute must equal data.origin_location.city"
|
|
30923
30944
|
});
|
|
30945
|
+
validateAttributeValue({
|
|
30946
|
+
ctx,
|
|
30947
|
+
attributeByTraitType,
|
|
30948
|
+
traitType: "Origin Country Subdivision",
|
|
30949
|
+
expectedValue: data.origin_location.subdivision_code,
|
|
30950
|
+
missingMessage: "Origin Country Subdivision attribute must be present and match data.origin_location.subdivision_code",
|
|
30951
|
+
mismatchMessage: "Origin Country Subdivision attribute must equal data.origin_location.subdivision_code"
|
|
30952
|
+
});
|
|
30924
30953
|
validateAttributeValue({
|
|
30925
30954
|
ctx,
|
|
30926
30955
|
attributeByTraitType,
|
|
@@ -32174,6 +32203,7 @@ exports.ParticipantIdHashSchema = ParticipantIdHashSchema;
|
|
|
32174
32203
|
exports.ParticipantRoleSchema = ParticipantRoleSchema;
|
|
32175
32204
|
exports.ParticipantSchema = ParticipantSchema;
|
|
32176
32205
|
exports.PercentageSchema = PercentageSchema;
|
|
32206
|
+
exports.PositiveFloatSchema = PositiveFloatSchema;
|
|
32177
32207
|
exports.PositiveIntegerSchema = PositiveIntegerSchema;
|
|
32178
32208
|
exports.ReceiptIdentitySchema = ReceiptIdentitySchema;
|
|
32179
32209
|
exports.RecordEnvironmentSchema = RecordEnvironmentSchema;
|