@carrot-foundation/schemas 0.1.63 → 0.1.64
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 +41 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +41 -1
- package/dist/index.d.ts +41 -1
- package/dist/index.js +41 -6
- 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 +19 -13
- package/schemas/ipfs/gas-id/gas-id.schema.json +47 -5
- package/schemas/ipfs/mass-id/mass-id.example.json +4 -4
- package/schemas/ipfs/mass-id/mass-id.schema.json +2 -2
- 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 +10 -4
- package/schemas/ipfs/recycled-id/recycled-id.schema.json +45 -3
- package/schemas/schema-hashes.json +10 -10
package/dist/index.cjs
CHANGED
|
@@ -29062,6 +29062,11 @@ var CertificateIssuanceDateAttributeSchema = createDateAttributeSchema(
|
|
|
29062
29062
|
description: "Unix timestamp in milliseconds when the certificate was issued"
|
|
29063
29063
|
}
|
|
29064
29064
|
);
|
|
29065
|
+
var RecyclingDateAttributeSchema = createDateAttributeSchema({
|
|
29066
|
+
traitType: "Recycling Date",
|
|
29067
|
+
title: "Recycling Date",
|
|
29068
|
+
description: "Unix timestamp in milliseconds when the recycling occurred (when the environmental gain was achieved)"
|
|
29069
|
+
});
|
|
29065
29070
|
var OriginCityAttributeSchema = NftAttributeSchema.safeExtend({
|
|
29066
29071
|
trait_type: zod.z.literal("Origin City"),
|
|
29067
29072
|
value: CitySchema
|
|
@@ -29554,7 +29559,7 @@ function buildSchemaUrl(schemaPath) {
|
|
|
29554
29559
|
return `${getSchemaBaseUrl()}/${cleanPath}`;
|
|
29555
29560
|
}
|
|
29556
29561
|
function getSchemaVersionOrDefault() {
|
|
29557
|
-
return "0.1.
|
|
29562
|
+
return "0.1.64";
|
|
29558
29563
|
}
|
|
29559
29564
|
|
|
29560
29565
|
// src/shared/schema-validation.ts
|
|
@@ -30532,6 +30537,7 @@ var GasIDAttributeOriginCitySchema = OriginCityAttributeSchema;
|
|
|
30532
30537
|
var GasIDAttributeOriginCountrySubdivisionSchema = OriginCountrySubdivisionAttributeSchema;
|
|
30533
30538
|
var GasIDAttributeMassIDTokenIdSchema = MassIDTokenIdAttributeSchema;
|
|
30534
30539
|
var GasIDAttributeMassIDRecyclingDateSchema = MassIDRecyclingDateAttributeSchema;
|
|
30540
|
+
var GasIDAttributeRecyclingDateSchema = RecyclingDateAttributeSchema;
|
|
30535
30541
|
var GasIDAttributeCertificateIssuanceDateSchema = CertificateIssuanceDateAttributeSchema;
|
|
30536
30542
|
var GasIDAttributesSchema = zod.z.tuple([
|
|
30537
30543
|
GasIDAttributeMethodologySchema,
|
|
@@ -30545,10 +30551,11 @@ var GasIDAttributesSchema = zod.z.tuple([
|
|
|
30545
30551
|
GasIDAttributeOriginCountrySubdivisionSchema,
|
|
30546
30552
|
GasIDAttributeMassIDTokenIdSchema,
|
|
30547
30553
|
GasIDAttributeMassIDRecyclingDateSchema,
|
|
30554
|
+
GasIDAttributeRecyclingDateSchema,
|
|
30548
30555
|
GasIDAttributeCertificateIssuanceDateSchema
|
|
30549
30556
|
]).meta({
|
|
30550
30557
|
title: "GasID NFT Attribute Array",
|
|
30551
|
-
description: "Schema for the fixed set of GasID NFT attributes, enforcing order and type for each trait.\n\nRequired attributes (
|
|
30558
|
+
description: "Schema for the fixed set of GasID NFT attributes, enforcing order and type for each trait.\n\nRequired attributes (13, in order): Methodology, Gas Type, CO\u2082e Prevented (kg), Credit Amount, Credit Type, Source Waste Type, Source Weight (kg), Origin City, Origin Country Subdivision, MassID, MassID Recycling Date, Recycling Date, Certificate Issuance Date."
|
|
30552
30559
|
});
|
|
30553
30560
|
var GasIDSummarySchema = zod.z.strictObject({
|
|
30554
30561
|
gas_type: GasTypeSchema,
|
|
@@ -30558,6 +30565,10 @@ var GasIDSummarySchema = zod.z.strictObject({
|
|
|
30558
30565
|
title: "Prevented Emissions (CO\u2082e)",
|
|
30559
30566
|
description: "CO\u2082e weight of the prevented emissions in kilograms (kg)"
|
|
30560
30567
|
}),
|
|
30568
|
+
recycling_date: IsoDateTimeSchema.meta({
|
|
30569
|
+
title: "Recycling Date",
|
|
30570
|
+
description: "ISO 8601 timestamp when the recycling occurred (when the environmental gain was achieved)"
|
|
30571
|
+
}),
|
|
30561
30572
|
issued_at: IsoDateTimeSchema.meta({
|
|
30562
30573
|
title: "Issued At",
|
|
30563
30574
|
description: "ISO 8601 timestamp when the certificate was issued"
|
|
@@ -30581,7 +30592,7 @@ var CalculationValueSchema = zod.z.strictObject({
|
|
|
30581
30592
|
description: "Human-readable label for this calculation value",
|
|
30582
30593
|
examples: [
|
|
30583
30594
|
"Exceeding Emission Coefficient",
|
|
30584
|
-
"Prevented Emissions by Waste Subtype and Baseline Per Ton",
|
|
30595
|
+
"Prevented Emissions by Waste Subtype and Emissions Baseline Per Ton",
|
|
30585
30596
|
"Waste Weight",
|
|
30586
30597
|
"Prevented Emissions (CO\u2082e kg)"
|
|
30587
30598
|
]
|
|
@@ -30594,7 +30605,7 @@ var PreventedEmissionsCalculationSchema = zod.z.strictObject({
|
|
|
30594
30605
|
formula: NonEmptyStringSchema.max(100).meta({
|
|
30595
30606
|
title: "Calculation Formula",
|
|
30596
30607
|
description: "Formula used to calculate the prevented emissions",
|
|
30597
|
-
examples: ["
|
|
30608
|
+
examples: ["W * B - W * E"]
|
|
30598
30609
|
}),
|
|
30599
30610
|
method: NonEmptyStringSchema.max(100).meta({
|
|
30600
30611
|
title: "Calculation Method",
|
|
@@ -30761,6 +30772,15 @@ var GasIDIpfsSchema = NftIpfsSchema.safeExtend({
|
|
|
30761
30772
|
invalidDateMessage: "data.summary.issued_at must be a valid ISO 8601 date-time string",
|
|
30762
30773
|
mismatchMessage: "MassID Recycling Date attribute must equal data.summary.issued_at as a Unix timestamp in milliseconds"
|
|
30763
30774
|
});
|
|
30775
|
+
validateDateTimeAttribute({
|
|
30776
|
+
ctx,
|
|
30777
|
+
attributeByTraitType,
|
|
30778
|
+
traitType: "Recycling Date",
|
|
30779
|
+
dateTimeValue: data.summary.recycling_date,
|
|
30780
|
+
missingMessage: "Recycling Date attribute must be present and match data.summary.recycling_date",
|
|
30781
|
+
invalidDateMessage: "data.summary.recycling_date must be a valid ISO 8601 date-time string",
|
|
30782
|
+
mismatchMessage: "Recycling Date attribute must equal data.summary.recycling_date as a Unix timestamp in milliseconds"
|
|
30783
|
+
});
|
|
30764
30784
|
validateDateTimeAttribute({
|
|
30765
30785
|
ctx,
|
|
30766
30786
|
attributeByTraitType,
|
|
@@ -30803,6 +30823,7 @@ var RecycledIDAttributeOriginCitySchema = OriginCityAttributeSchema;
|
|
|
30803
30823
|
var RecycledIDAttributeOriginCountrySubdivisionSchema = OriginCountrySubdivisionAttributeSchema;
|
|
30804
30824
|
var RecycledIDAttributeMassIDTokenIdSchema = MassIDTokenIdAttributeSchema;
|
|
30805
30825
|
var RecycledIDAttributeMassIDRecyclingDateSchema = MassIDRecyclingDateAttributeSchema;
|
|
30826
|
+
var RecycledIDAttributeRecyclingDateSchema = RecyclingDateAttributeSchema;
|
|
30806
30827
|
var RecycledIDAttributeCertificateIssuanceDateSchema = CertificateIssuanceDateAttributeSchema;
|
|
30807
30828
|
var RecycledIDAttributesSchema = zod.z.tuple([
|
|
30808
30829
|
RecycledIDAttributeMethodologySchema,
|
|
@@ -30815,10 +30836,11 @@ var RecycledIDAttributesSchema = zod.z.tuple([
|
|
|
30815
30836
|
RecycledIDAttributeOriginCountrySubdivisionSchema,
|
|
30816
30837
|
RecycledIDAttributeMassIDTokenIdSchema,
|
|
30817
30838
|
RecycledIDAttributeMassIDRecyclingDateSchema,
|
|
30839
|
+
RecycledIDAttributeRecyclingDateSchema,
|
|
30818
30840
|
RecycledIDAttributeCertificateIssuanceDateSchema
|
|
30819
30841
|
]).meta({
|
|
30820
30842
|
title: "RecycledID NFT Attribute Array",
|
|
30821
|
-
description: "Schema for the fixed set of RecycledID NFT attributes, enforcing order and type for each trait.\n\nRequired attributes (
|
|
30843
|
+
description: "Schema for the fixed set of RecycledID NFT attributes, enforcing order and type for each trait.\n\nRequired attributes (12, in order): Methodology, Recycled Weight (kg), Credit Amount, Credit Type, Source Waste Type, Source Weight (kg), Origin City, Origin Country Subdivision, MassID, MassID Recycling Date, Recycling Date, Certificate Issuance Date."
|
|
30822
30844
|
});
|
|
30823
30845
|
var RecycledIDSummarySchema = zod.z.strictObject({
|
|
30824
30846
|
recycled_mass_kg: WeightKgSchema.meta({
|
|
@@ -30827,6 +30849,10 @@ var RecycledIDSummarySchema = zod.z.strictObject({
|
|
|
30827
30849
|
}),
|
|
30828
30850
|
credit_type: CreditTypeSchema,
|
|
30829
30851
|
credit_amount: CreditAmountSchema,
|
|
30852
|
+
recycling_date: IsoDateTimeSchema.meta({
|
|
30853
|
+
title: "Recycling Date",
|
|
30854
|
+
description: "ISO 8601 timestamp when the recycling occurred (when the environmental gain was achieved)"
|
|
30855
|
+
}),
|
|
30830
30856
|
issued_at: IsoDateTimeSchema.meta({
|
|
30831
30857
|
title: "Issued At",
|
|
30832
30858
|
description: "ISO 8601 timestamp when the certificate was issued"
|
|
@@ -30974,6 +31000,15 @@ var RecycledIDIpfsSchema = NftIpfsSchema.safeExtend({
|
|
|
30974
31000
|
invalidDateMessage: "data.summary.issued_at must be a valid ISO 8601 date-time string",
|
|
30975
31001
|
mismatchMessage: "MassID Recycling Date attribute must equal data.summary.issued_at as a Unix timestamp in milliseconds"
|
|
30976
31002
|
});
|
|
31003
|
+
validateDateTimeAttribute({
|
|
31004
|
+
ctx,
|
|
31005
|
+
attributeByTraitType,
|
|
31006
|
+
traitType: "Recycling Date",
|
|
31007
|
+
dateTimeValue: data.summary.recycling_date,
|
|
31008
|
+
missingMessage: "Recycling Date attribute must be present and match data.summary.recycling_date",
|
|
31009
|
+
invalidDateMessage: "data.summary.recycling_date must be a valid ISO 8601 date-time string",
|
|
31010
|
+
mismatchMessage: "Recycling Date attribute must equal data.summary.recycling_date as a Unix timestamp in milliseconds"
|
|
31011
|
+
});
|
|
30977
31012
|
validateDateTimeAttribute({
|
|
30978
31013
|
ctx,
|
|
30979
31014
|
attributeByTraitType,
|
|
@@ -32205,6 +32240,7 @@ exports.RecycledIDIpfsSchemaMeta = RecycledIDIpfsSchemaMeta;
|
|
|
32205
32240
|
exports.RecycledIDNameSchema = RecycledIDNameSchema;
|
|
32206
32241
|
exports.RecycledIDReferenceSchema = RecycledIDReferenceSchema;
|
|
32207
32242
|
exports.RecycledIDShortNameSchema = RecycledIDShortNameSchema;
|
|
32243
|
+
exports.RecyclingDateAttributeSchema = RecyclingDateAttributeSchema;
|
|
32208
32244
|
exports.ScaleTypeSchema = ScaleTypeSchema;
|
|
32209
32245
|
exports.SchemaInfoSchema = SchemaInfoSchema;
|
|
32210
32246
|
exports.SemanticVersionSchema = SemanticVersionSchema;
|