@carrot-foundation/schemas 0.3.2 → 0.4.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.
- package/dist/index.cjs +3 -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 +3 -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.d.cts
CHANGED
|
@@ -464,10 +464,10 @@ declare const MassIDDataSchema: z.ZodObject<{
|
|
|
464
464
|
subdivision_code: z.ZodString;
|
|
465
465
|
country_code: z.ZodString & z.ZodType<"BR", string, z.core.$ZodTypeInternals<"BR", string>>;
|
|
466
466
|
responsible_participant_id_hash: z.ZodCustomStringFormat<"sha256_hex">;
|
|
467
|
-
coordinates: z.ZodObject<{
|
|
467
|
+
coordinates: z.ZodOptional<z.ZodObject<{
|
|
468
468
|
latitude: z.ZodNumber;
|
|
469
469
|
longitude: z.ZodNumber;
|
|
470
|
-
}, z.core.$strict
|
|
470
|
+
}, z.core.$strict>>;
|
|
471
471
|
}, z.core.$strict>>;
|
|
472
472
|
participants: z.ZodArray<z.ZodObject<{
|
|
473
473
|
id_hash: z.ZodCustomStringFormat<"sha256_hex">;
|
|
@@ -683,10 +683,10 @@ declare const MassIDIpfsSchema: z.ZodObject<{
|
|
|
683
683
|
subdivision_code: z.ZodString;
|
|
684
684
|
country_code: z.ZodString & z.ZodType<"BR", string, z.core.$ZodTypeInternals<"BR", string>>;
|
|
685
685
|
responsible_participant_id_hash: z.ZodCustomStringFormat<"sha256_hex">;
|
|
686
|
-
coordinates: z.ZodObject<{
|
|
686
|
+
coordinates: z.ZodOptional<z.ZodObject<{
|
|
687
687
|
latitude: z.ZodNumber;
|
|
688
688
|
longitude: z.ZodNumber;
|
|
689
|
-
}, z.core.$strict
|
|
689
|
+
}, z.core.$strict>>;
|
|
690
690
|
}, z.core.$strict>>;
|
|
691
691
|
participants: z.ZodArray<z.ZodObject<{
|
|
692
692
|
id_hash: z.ZodCustomStringFormat<"sha256_hex">;
|
|
@@ -1146,10 +1146,10 @@ declare const GasIDDataSchema: z.ZodObject<{
|
|
|
1146
1146
|
subdivision_code: z.ZodString;
|
|
1147
1147
|
country_code: z.ZodString & z.ZodType<"BR", string, z.core.$ZodTypeInternals<"BR", string>>;
|
|
1148
1148
|
responsible_participant_id_hash: z.ZodCustomStringFormat<"sha256_hex">;
|
|
1149
|
-
coordinates: z.ZodObject<{
|
|
1149
|
+
coordinates: z.ZodOptional<z.ZodObject<{
|
|
1150
1150
|
latitude: z.ZodNumber;
|
|
1151
1151
|
longitude: z.ZodNumber;
|
|
1152
|
-
}, z.core.$strict
|
|
1152
|
+
}, z.core.$strict>>;
|
|
1153
1153
|
}, z.core.$strict>;
|
|
1154
1154
|
prevented_emissions_calculation: z.ZodObject<{
|
|
1155
1155
|
formula: z.ZodString;
|
|
@@ -1392,10 +1392,10 @@ declare const GasIDIpfsSchema: z.ZodObject<{
|
|
|
1392
1392
|
subdivision_code: z.ZodString;
|
|
1393
1393
|
country_code: z.ZodString & z.ZodType<"BR", string, z.core.$ZodTypeInternals<"BR", string>>;
|
|
1394
1394
|
responsible_participant_id_hash: z.ZodCustomStringFormat<"sha256_hex">;
|
|
1395
|
-
coordinates: z.ZodObject<{
|
|
1395
|
+
coordinates: z.ZodOptional<z.ZodObject<{
|
|
1396
1396
|
latitude: z.ZodNumber;
|
|
1397
1397
|
longitude: z.ZodNumber;
|
|
1398
|
-
}, z.core.$strict
|
|
1398
|
+
}, z.core.$strict>>;
|
|
1399
1399
|
}, z.core.$strict>;
|
|
1400
1400
|
prevented_emissions_calculation: z.ZodObject<{
|
|
1401
1401
|
formula: z.ZodString;
|
|
@@ -1699,10 +1699,10 @@ declare const RecycledIDDataSchema: z.ZodObject<{
|
|
|
1699
1699
|
subdivision_code: z.ZodString;
|
|
1700
1700
|
country_code: z.ZodString & z.ZodType<"BR", string, z.core.$ZodTypeInternals<"BR", string>>;
|
|
1701
1701
|
responsible_participant_id_hash: z.ZodCustomStringFormat<"sha256_hex">;
|
|
1702
|
-
coordinates: z.ZodObject<{
|
|
1702
|
+
coordinates: z.ZodOptional<z.ZodObject<{
|
|
1703
1703
|
latitude: z.ZodNumber;
|
|
1704
1704
|
longitude: z.ZodNumber;
|
|
1705
|
-
}, z.core.$strict
|
|
1705
|
+
}, z.core.$strict>>;
|
|
1706
1706
|
}, z.core.$strict>;
|
|
1707
1707
|
}, z.core.$strict>;
|
|
1708
1708
|
type RecycledIDData = z.infer<typeof RecycledIDDataSchema>;
|
|
@@ -1920,10 +1920,10 @@ declare const RecycledIDIpfsSchema: z.ZodObject<{
|
|
|
1920
1920
|
subdivision_code: z.ZodString;
|
|
1921
1921
|
country_code: z.ZodString & z.ZodType<"BR", string, z.core.$ZodTypeInternals<"BR", string>>;
|
|
1922
1922
|
responsible_participant_id_hash: z.ZodCustomStringFormat<"sha256_hex">;
|
|
1923
|
-
coordinates: z.ZodObject<{
|
|
1923
|
+
coordinates: z.ZodOptional<z.ZodObject<{
|
|
1924
1924
|
latitude: z.ZodNumber;
|
|
1925
1925
|
longitude: z.ZodNumber;
|
|
1926
|
-
}, z.core.$strict
|
|
1926
|
+
}, z.core.$strict>>;
|
|
1927
1927
|
}, z.core.$strict>;
|
|
1928
1928
|
}, z.core.$strict>;
|
|
1929
1929
|
}, z.core.$strict>;
|
|
@@ -3755,10 +3755,10 @@ declare const LocationSchema: z.ZodObject<{
|
|
|
3755
3755
|
subdivision_code: z.ZodString;
|
|
3756
3756
|
country_code: z.ZodString & z.ZodType<"BR", string, z.core.$ZodTypeInternals<"BR", string>>;
|
|
3757
3757
|
responsible_participant_id_hash: z.ZodCustomStringFormat<"sha256_hex">;
|
|
3758
|
-
coordinates: z.ZodObject<{
|
|
3758
|
+
coordinates: z.ZodOptional<z.ZodObject<{
|
|
3759
3759
|
latitude: z.ZodNumber;
|
|
3760
3760
|
longitude: z.ZodNumber;
|
|
3761
|
-
}, z.core.$strict
|
|
3761
|
+
}, z.core.$strict>>;
|
|
3762
3762
|
}, z.core.$strict>;
|
|
3763
3763
|
type Location = z.infer<typeof LocationSchema>;
|
|
3764
3764
|
|
package/dist/index.d.ts
CHANGED
|
@@ -464,10 +464,10 @@ declare const MassIDDataSchema: z.ZodObject<{
|
|
|
464
464
|
subdivision_code: z.ZodString;
|
|
465
465
|
country_code: z.ZodString & z.ZodType<"BR", string, z.core.$ZodTypeInternals<"BR", string>>;
|
|
466
466
|
responsible_participant_id_hash: z.ZodCustomStringFormat<"sha256_hex">;
|
|
467
|
-
coordinates: z.ZodObject<{
|
|
467
|
+
coordinates: z.ZodOptional<z.ZodObject<{
|
|
468
468
|
latitude: z.ZodNumber;
|
|
469
469
|
longitude: z.ZodNumber;
|
|
470
|
-
}, z.core.$strict
|
|
470
|
+
}, z.core.$strict>>;
|
|
471
471
|
}, z.core.$strict>>;
|
|
472
472
|
participants: z.ZodArray<z.ZodObject<{
|
|
473
473
|
id_hash: z.ZodCustomStringFormat<"sha256_hex">;
|
|
@@ -683,10 +683,10 @@ declare const MassIDIpfsSchema: z.ZodObject<{
|
|
|
683
683
|
subdivision_code: z.ZodString;
|
|
684
684
|
country_code: z.ZodString & z.ZodType<"BR", string, z.core.$ZodTypeInternals<"BR", string>>;
|
|
685
685
|
responsible_participant_id_hash: z.ZodCustomStringFormat<"sha256_hex">;
|
|
686
|
-
coordinates: z.ZodObject<{
|
|
686
|
+
coordinates: z.ZodOptional<z.ZodObject<{
|
|
687
687
|
latitude: z.ZodNumber;
|
|
688
688
|
longitude: z.ZodNumber;
|
|
689
|
-
}, z.core.$strict
|
|
689
|
+
}, z.core.$strict>>;
|
|
690
690
|
}, z.core.$strict>>;
|
|
691
691
|
participants: z.ZodArray<z.ZodObject<{
|
|
692
692
|
id_hash: z.ZodCustomStringFormat<"sha256_hex">;
|
|
@@ -1146,10 +1146,10 @@ declare const GasIDDataSchema: z.ZodObject<{
|
|
|
1146
1146
|
subdivision_code: z.ZodString;
|
|
1147
1147
|
country_code: z.ZodString & z.ZodType<"BR", string, z.core.$ZodTypeInternals<"BR", string>>;
|
|
1148
1148
|
responsible_participant_id_hash: z.ZodCustomStringFormat<"sha256_hex">;
|
|
1149
|
-
coordinates: z.ZodObject<{
|
|
1149
|
+
coordinates: z.ZodOptional<z.ZodObject<{
|
|
1150
1150
|
latitude: z.ZodNumber;
|
|
1151
1151
|
longitude: z.ZodNumber;
|
|
1152
|
-
}, z.core.$strict
|
|
1152
|
+
}, z.core.$strict>>;
|
|
1153
1153
|
}, z.core.$strict>;
|
|
1154
1154
|
prevented_emissions_calculation: z.ZodObject<{
|
|
1155
1155
|
formula: z.ZodString;
|
|
@@ -1392,10 +1392,10 @@ declare const GasIDIpfsSchema: z.ZodObject<{
|
|
|
1392
1392
|
subdivision_code: z.ZodString;
|
|
1393
1393
|
country_code: z.ZodString & z.ZodType<"BR", string, z.core.$ZodTypeInternals<"BR", string>>;
|
|
1394
1394
|
responsible_participant_id_hash: z.ZodCustomStringFormat<"sha256_hex">;
|
|
1395
|
-
coordinates: z.ZodObject<{
|
|
1395
|
+
coordinates: z.ZodOptional<z.ZodObject<{
|
|
1396
1396
|
latitude: z.ZodNumber;
|
|
1397
1397
|
longitude: z.ZodNumber;
|
|
1398
|
-
}, z.core.$strict
|
|
1398
|
+
}, z.core.$strict>>;
|
|
1399
1399
|
}, z.core.$strict>;
|
|
1400
1400
|
prevented_emissions_calculation: z.ZodObject<{
|
|
1401
1401
|
formula: z.ZodString;
|
|
@@ -1699,10 +1699,10 @@ declare const RecycledIDDataSchema: z.ZodObject<{
|
|
|
1699
1699
|
subdivision_code: z.ZodString;
|
|
1700
1700
|
country_code: z.ZodString & z.ZodType<"BR", string, z.core.$ZodTypeInternals<"BR", string>>;
|
|
1701
1701
|
responsible_participant_id_hash: z.ZodCustomStringFormat<"sha256_hex">;
|
|
1702
|
-
coordinates: z.ZodObject<{
|
|
1702
|
+
coordinates: z.ZodOptional<z.ZodObject<{
|
|
1703
1703
|
latitude: z.ZodNumber;
|
|
1704
1704
|
longitude: z.ZodNumber;
|
|
1705
|
-
}, z.core.$strict
|
|
1705
|
+
}, z.core.$strict>>;
|
|
1706
1706
|
}, z.core.$strict>;
|
|
1707
1707
|
}, z.core.$strict>;
|
|
1708
1708
|
type RecycledIDData = z.infer<typeof RecycledIDDataSchema>;
|
|
@@ -1920,10 +1920,10 @@ declare const RecycledIDIpfsSchema: z.ZodObject<{
|
|
|
1920
1920
|
subdivision_code: z.ZodString;
|
|
1921
1921
|
country_code: z.ZodString & z.ZodType<"BR", string, z.core.$ZodTypeInternals<"BR", string>>;
|
|
1922
1922
|
responsible_participant_id_hash: z.ZodCustomStringFormat<"sha256_hex">;
|
|
1923
|
-
coordinates: z.ZodObject<{
|
|
1923
|
+
coordinates: z.ZodOptional<z.ZodObject<{
|
|
1924
1924
|
latitude: z.ZodNumber;
|
|
1925
1925
|
longitude: z.ZodNumber;
|
|
1926
|
-
}, z.core.$strict
|
|
1926
|
+
}, z.core.$strict>>;
|
|
1927
1927
|
}, z.core.$strict>;
|
|
1928
1928
|
}, z.core.$strict>;
|
|
1929
1929
|
}, z.core.$strict>;
|
|
@@ -3755,10 +3755,10 @@ declare const LocationSchema: z.ZodObject<{
|
|
|
3755
3755
|
subdivision_code: z.ZodString;
|
|
3756
3756
|
country_code: z.ZodString & z.ZodType<"BR", string, z.core.$ZodTypeInternals<"BR", string>>;
|
|
3757
3757
|
responsible_participant_id_hash: z.ZodCustomStringFormat<"sha256_hex">;
|
|
3758
|
-
coordinates: z.ZodObject<{
|
|
3758
|
+
coordinates: z.ZodOptional<z.ZodObject<{
|
|
3759
3759
|
latitude: z.ZodNumber;
|
|
3760
3760
|
longitude: z.ZodNumber;
|
|
3761
|
-
}, z.core.$strict
|
|
3761
|
+
}, z.core.$strict>>;
|
|
3762
3762
|
}, z.core.$strict>;
|
|
3763
3763
|
type Location = z.infer<typeof LocationSchema>;
|
|
3764
3764
|
|
package/dist/index.js
CHANGED
|
@@ -29329,7 +29329,7 @@ var CoordinatesSchema = z.strictObject({
|
|
|
29329
29329
|
longitude: LongitudeSchema
|
|
29330
29330
|
}).meta({
|
|
29331
29331
|
title: "Coordinates",
|
|
29332
|
-
description: "Approximate GPS coordinates of the site (city-level precision for privacy)"
|
|
29332
|
+
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."
|
|
29333
29333
|
});
|
|
29334
29334
|
var LocationSchema = z.strictObject({
|
|
29335
29335
|
id_hash: Sha256HashSchema.meta({
|
|
@@ -29343,7 +29343,7 @@ var LocationSchema = z.strictObject({
|
|
|
29343
29343
|
title: "Responsible Participant ID Hash",
|
|
29344
29344
|
description: "SHA-256 hash identifying the participant responsible for operations at this location"
|
|
29345
29345
|
}),
|
|
29346
|
-
coordinates: CoordinatesSchema
|
|
29346
|
+
coordinates: CoordinatesSchema.optional()
|
|
29347
29347
|
}).superRefine((record, ctx) => {
|
|
29348
29348
|
validateLocationBrazilData(record, ctx);
|
|
29349
29349
|
}).meta({
|
|
@@ -29475,7 +29475,7 @@ function buildSchemaUrl(schemaPath) {
|
|
|
29475
29475
|
return `${getSchemaBaseUrl()}/${cleanPath}`;
|
|
29476
29476
|
}
|
|
29477
29477
|
function getSchemaVersionOrDefault() {
|
|
29478
|
-
return "0.
|
|
29478
|
+
return "0.4.0";
|
|
29479
29479
|
}
|
|
29480
29480
|
|
|
29481
29481
|
// src/shared/schema-validation.ts
|