@carrot-foundation/schemas 0.3.2 → 0.4.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/dist/index.cjs +27 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -14
- package/dist/index.d.ts +14 -14
- package/dist/index.js +27 -3
- 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 +4 -5
- package/schemas/ipfs/mass-id/mass-id.example.json +4 -4
- package/schemas/ipfs/mass-id/mass-id.schema.json +4 -5
- 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 +4 -5
- package/schemas/schema-hashes.json +10 -10
package/dist/index.cjs
CHANGED
|
@@ -29335,7 +29335,7 @@ var CoordinatesSchema = zod.z.strictObject({
|
|
|
29335
29335
|
longitude: LongitudeSchema
|
|
29336
29336
|
}).meta({
|
|
29337
29337
|
title: "Coordinates",
|
|
29338
|
-
description: "Approximate GPS coordinates of the site (city-level precision for privacy)"
|
|
29338
|
+
description: "Approximate GPS coordinates of the site (city-level precision for privacy). Optional because some records (e.g., MassIDs) may not have geolocation data available."
|
|
29339
29339
|
});
|
|
29340
29340
|
var LocationSchema = zod.z.strictObject({
|
|
29341
29341
|
id_hash: Sha256HashSchema.meta({
|
|
@@ -29349,7 +29349,7 @@ var LocationSchema = zod.z.strictObject({
|
|
|
29349
29349
|
title: "Responsible Participant ID Hash",
|
|
29350
29350
|
description: "SHA-256 hash identifying the participant responsible for operations at this location"
|
|
29351
29351
|
}),
|
|
29352
|
-
coordinates: CoordinatesSchema
|
|
29352
|
+
coordinates: CoordinatesSchema.optional()
|
|
29353
29353
|
}).superRefine((record, ctx) => {
|
|
29354
29354
|
validateLocationBrazilData(record, ctx);
|
|
29355
29355
|
}).meta({
|
|
@@ -29481,7 +29481,7 @@ function buildSchemaUrl(schemaPath) {
|
|
|
29481
29481
|
return `${getSchemaBaseUrl()}/${cleanPath}`;
|
|
29482
29482
|
}
|
|
29483
29483
|
function getSchemaVersionOrDefault() {
|
|
29484
|
-
return "0.
|
|
29484
|
+
return "0.4.1";
|
|
29485
29485
|
}
|
|
29486
29486
|
|
|
29487
29487
|
// src/shared/schema-validation.ts
|
|
@@ -30376,6 +30376,14 @@ var MassIDIpfsSchema = NftIpfsSchema.safeExtend({
|
|
|
30376
30376
|
missingMessage: "Origin City attribute must be omitted when Pick-up event location.city is not provided",
|
|
30377
30377
|
mismatchMessage: "Origin City attribute must equal Pick-up event location.city"
|
|
30378
30378
|
});
|
|
30379
|
+
validateAttributeValue({
|
|
30380
|
+
ctx,
|
|
30381
|
+
attributeByTraitType,
|
|
30382
|
+
traitType: "Origin Country Subdivision",
|
|
30383
|
+
expectedValue: pickUpLocation?.subdivision_code,
|
|
30384
|
+
missingMessage: "Origin Country Subdivision attribute must be omitted when Pick-up event location.subdivision_code is not provided",
|
|
30385
|
+
mismatchMessage: "Origin Country Subdivision attribute must equal Pick-up event location.subdivision_code"
|
|
30386
|
+
});
|
|
30379
30387
|
validateDateTimeAttribute({
|
|
30380
30388
|
ctx,
|
|
30381
30389
|
attributeByTraitType,
|
|
@@ -30693,6 +30701,14 @@ var GasIDIpfsSchema = NftIpfsSchema.safeExtend({
|
|
|
30693
30701
|
missingMessage: "Origin City attribute must be present and match data.origin_location.city",
|
|
30694
30702
|
mismatchMessage: "Origin City attribute must equal data.origin_location.city"
|
|
30695
30703
|
});
|
|
30704
|
+
validateAttributeValue({
|
|
30705
|
+
ctx,
|
|
30706
|
+
attributeByTraitType,
|
|
30707
|
+
traitType: "Origin Country Subdivision",
|
|
30708
|
+
expectedValue: data.origin_location.subdivision_code,
|
|
30709
|
+
missingMessage: "Origin Country Subdivision attribute must be present and match data.origin_location.subdivision_code",
|
|
30710
|
+
mismatchMessage: "Origin Country Subdivision attribute must equal data.origin_location.subdivision_code"
|
|
30711
|
+
});
|
|
30696
30712
|
validateAttributeValue({
|
|
30697
30713
|
ctx,
|
|
30698
30714
|
attributeByTraitType,
|
|
@@ -30921,6 +30937,14 @@ var RecycledIDIpfsSchema = NftIpfsSchema.safeExtend({
|
|
|
30921
30937
|
missingMessage: "Origin City attribute must be present and match data.origin_location.city",
|
|
30922
30938
|
mismatchMessage: "Origin City attribute must equal data.origin_location.city"
|
|
30923
30939
|
});
|
|
30940
|
+
validateAttributeValue({
|
|
30941
|
+
ctx,
|
|
30942
|
+
attributeByTraitType,
|
|
30943
|
+
traitType: "Origin Country Subdivision",
|
|
30944
|
+
expectedValue: data.origin_location.subdivision_code,
|
|
30945
|
+
missingMessage: "Origin Country Subdivision attribute must be present and match data.origin_location.subdivision_code",
|
|
30946
|
+
mismatchMessage: "Origin Country Subdivision attribute must equal data.origin_location.subdivision_code"
|
|
30947
|
+
});
|
|
30924
30948
|
validateAttributeValue({
|
|
30925
30949
|
ctx,
|
|
30926
30950
|
attributeByTraitType,
|