@carrot-foundation/schemas 0.1.51 → 0.1.53
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 +67 -52
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +87 -135
- package/dist/index.d.ts +87 -135
- package/dist/index.js +66 -51
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/schemas/ipfs/collection/collection.example.json +5 -5
- package/schemas/ipfs/collection/collection.schema.json +2 -2
- package/schemas/ipfs/credit/credit.example.json +5 -5
- package/schemas/ipfs/credit/credit.schema.json +2 -2
- package/schemas/ipfs/credit-purchase-receipt/credit-purchase-receipt.example.json +5 -5
- 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 +21 -34
- package/schemas/ipfs/gas-id/gas-id.schema.json +92 -120
- package/schemas/ipfs/mass-id/mass-id.example.json +5 -5
- package/schemas/ipfs/mass-id/mass-id.schema.json +2 -2
- package/schemas/ipfs/mass-id-audit/mass-id-audit.example.json +5 -5
- package/schemas/ipfs/mass-id-audit/mass-id-audit.schema.json +2 -2
- package/schemas/ipfs/methodology/methodology.example.json +5 -5
- package/schemas/ipfs/methodology/methodology.schema.json +2 -2
- package/schemas/ipfs/recycled-id/recycled-id.example.json +21 -34
- package/schemas/ipfs/recycled-id/recycled-id.schema.json +92 -120
- package/schemas/schema-hashes.json +10 -10
package/dist/index.cjs
CHANGED
|
@@ -28606,7 +28606,20 @@ var NftIpfsSchema = BaseIpfsSchema.safeExtend({
|
|
|
28606
28606
|
description: "NFT-specific fields for Carrot IPFS records"
|
|
28607
28607
|
});
|
|
28608
28608
|
function getSchemaMetadata(schema) {
|
|
28609
|
-
|
|
28609
|
+
if (typeof schema.meta === "function") {
|
|
28610
|
+
const meta = schema.meta();
|
|
28611
|
+
if (meta && typeof meta === "object") {
|
|
28612
|
+
return meta;
|
|
28613
|
+
}
|
|
28614
|
+
}
|
|
28615
|
+
try {
|
|
28616
|
+
const meta = zod.z.globalRegistry.get(schema);
|
|
28617
|
+
if (meta && typeof meta === "object") {
|
|
28618
|
+
return meta;
|
|
28619
|
+
}
|
|
28620
|
+
} catch {
|
|
28621
|
+
}
|
|
28622
|
+
return void 0;
|
|
28610
28623
|
}
|
|
28611
28624
|
function mergeSchemaMeta(schema, newMeta) {
|
|
28612
28625
|
const baseMeta = getSchemaMetadata(schema);
|
|
@@ -29067,45 +29080,38 @@ var WastePropertiesSchema = zod.z.strictObject({
|
|
|
29067
29080
|
title: "Waste Properties",
|
|
29068
29081
|
description: "Properties of the source waste (MassID)"
|
|
29069
29082
|
});
|
|
29070
|
-
var
|
|
29071
|
-
|
|
29072
|
-
|
|
29073
|
-
|
|
29074
|
-
|
|
29075
|
-
|
|
29076
|
-
|
|
29077
|
-
|
|
29078
|
-
|
|
29079
|
-
}),
|
|
29080
|
-
role: ParticipantRoleSchema.meta({
|
|
29081
|
-
title: "Participant Role",
|
|
29082
|
-
description: "Role of the participant in the supply chain"
|
|
29083
|
+
var RewardDiscountTypeSchema = zod.z.enum(["large_business", "supply_chain_digitization"]).meta({
|
|
29084
|
+
title: "Discount Type",
|
|
29085
|
+
description: "Type of discount applied to the reward allocation",
|
|
29086
|
+
examples: ["large_business", "supply_chain_digitization"]
|
|
29087
|
+
});
|
|
29088
|
+
var RewardDiscountSchema = zod.z.strictObject({
|
|
29089
|
+
type: RewardDiscountTypeSchema.meta({
|
|
29090
|
+
title: "Discount Type",
|
|
29091
|
+
description: "Type of discount applied"
|
|
29083
29092
|
}),
|
|
29084
|
-
|
|
29085
|
-
title: "
|
|
29086
|
-
description: "
|
|
29093
|
+
percentage: PercentageSchema.meta({
|
|
29094
|
+
title: "Discount Percentage",
|
|
29095
|
+
description: "Percentage reduction applied (e.g., 50 for 50% discount)",
|
|
29096
|
+
examples: [25, 50]
|
|
29087
29097
|
}),
|
|
29088
|
-
|
|
29089
|
-
title: "
|
|
29090
|
-
description: "
|
|
29098
|
+
reason: NonEmptyStringSchema.max(200).meta({
|
|
29099
|
+
title: "Discount Reason",
|
|
29100
|
+
description: "Human-readable explanation of why the discount was applied",
|
|
29101
|
+
examples: [
|
|
29102
|
+
"Waste Generator not identified - Supply Chain Digitization Incentive",
|
|
29103
|
+
"Large business with >$4M annual revenue",
|
|
29104
|
+
"Brazil Tax Authority Group I Large Business classification"
|
|
29105
|
+
]
|
|
29091
29106
|
})
|
|
29092
29107
|
}).meta({
|
|
29093
|
-
title: "
|
|
29094
|
-
description: "
|
|
29095
|
-
});
|
|
29096
|
-
var AccreditedParticipantsSchema = zod.z.array(AccreditedParticipantSchema).min(1).meta({
|
|
29097
|
-
title: "Accredited Participants",
|
|
29098
|
-
description: "List of participants with valid accreditations"
|
|
29108
|
+
title: "Discount",
|
|
29109
|
+
description: "Discount applied to a reward allocation"
|
|
29099
29110
|
});
|
|
29100
29111
|
var RewardAllocationSchema = zod.z.strictObject({
|
|
29101
|
-
|
|
29102
|
-
title: "Participant ID",
|
|
29103
|
-
description: "
|
|
29104
|
-
}),
|
|
29105
|
-
participant_name: NonEmptyStringSchema.max(100).meta({
|
|
29106
|
-
title: "Participant Name",
|
|
29107
|
-
description: "Name of the participant receiving the reward",
|
|
29108
|
-
examples: ["Enlatados Produ\xE7\xE3o", "Eco Reciclagem", "Green Tech Corp"]
|
|
29112
|
+
participant_id_hash: Sha256HashSchema.meta({
|
|
29113
|
+
title: "Participant ID Hash",
|
|
29114
|
+
description: "SHA-256 hash of the unique identifier for the participant receiving the reward"
|
|
29109
29115
|
}),
|
|
29110
29116
|
role: ParticipantRoleSchema.meta({
|
|
29111
29117
|
title: "Participant Role",
|
|
@@ -29115,9 +29121,9 @@ var RewardAllocationSchema = zod.z.strictObject({
|
|
|
29115
29121
|
title: "Reward Percentage",
|
|
29116
29122
|
description: "Reward percentage allocated to the participant"
|
|
29117
29123
|
}),
|
|
29118
|
-
|
|
29119
|
-
title: "
|
|
29120
|
-
description: "
|
|
29124
|
+
discounts: zod.z.array(RewardDiscountSchema).optional().meta({
|
|
29125
|
+
title: "Discounts",
|
|
29126
|
+
description: "Discounts applied to this participant's reward allocation"
|
|
29121
29127
|
}),
|
|
29122
29128
|
effective_percentage: PercentageSchema.meta({
|
|
29123
29129
|
title: "Effective Percentage",
|
|
@@ -29128,23 +29134,33 @@ var RewardAllocationSchema = zod.z.strictObject({
|
|
|
29128
29134
|
description: "Reward allocation for a specific participant"
|
|
29129
29135
|
});
|
|
29130
29136
|
var DistributionNotesSchema = zod.z.strictObject({
|
|
29131
|
-
|
|
29132
|
-
title: "
|
|
29133
|
-
description: "
|
|
29137
|
+
discounts_applied: zod.z.array(NonEmptyStringSchema.max(200)).optional().meta({
|
|
29138
|
+
title: "Discounts Applied",
|
|
29139
|
+
description: "Descriptions of discounts applied to the distribution",
|
|
29134
29140
|
examples: [
|
|
29135
|
-
|
|
29141
|
+
[
|
|
29142
|
+
"50% reduction applied to Waste Generator participants with >$4M annual revenue",
|
|
29143
|
+
"25% Supply Chain Digitization Incentive applied to logistics providers due to unidentified Waste Generator"
|
|
29144
|
+
]
|
|
29136
29145
|
]
|
|
29137
29146
|
}),
|
|
29138
|
-
redirected_rewards: NonEmptyStringSchema.optional().meta({
|
|
29147
|
+
redirected_rewards: NonEmptyStringSchema.max(300).optional().meta({
|
|
29139
29148
|
title: "Redirected Rewards",
|
|
29140
|
-
description: "Description of
|
|
29149
|
+
description: "Description of rewards redirected to community pools or other recipients",
|
|
29150
|
+
examples: [
|
|
29151
|
+
"Discounted rewards from large businesses redirected to the Community Impact Pool managed by Carrot Foundation"
|
|
29152
|
+
]
|
|
29153
|
+
}),
|
|
29154
|
+
special_circumstances: zod.z.array(NonEmptyStringSchema.max(200)).optional().meta({
|
|
29155
|
+
title: "Special Circumstances",
|
|
29156
|
+
description: "Any special circumstances affecting the distribution",
|
|
29141
29157
|
examples: [
|
|
29142
|
-
"
|
|
29158
|
+
"Country-specific threshold applied: Brazil Tax Authority Group I Large Business classification"
|
|
29143
29159
|
]
|
|
29144
29160
|
})
|
|
29145
29161
|
}).meta({
|
|
29146
29162
|
title: "Distribution Notes",
|
|
29147
|
-
description: "Additional notes about the reward distribution"
|
|
29163
|
+
description: "Additional notes about the reward distribution, discounts, and special circumstances"
|
|
29148
29164
|
});
|
|
29149
29165
|
var ParticipantRewardsSchema = zod.z.strictObject({
|
|
29150
29166
|
distribution_basis: NonEmptyStringSchema.max(200).meta({
|
|
@@ -29341,7 +29357,7 @@ function buildSchemaUrl(schemaPath) {
|
|
|
29341
29357
|
return `${getSchemaBaseUrl()}/${cleanPath}`;
|
|
29342
29358
|
}
|
|
29343
29359
|
function getSchemaVersionOrDefault() {
|
|
29344
|
-
return "0.1.
|
|
29360
|
+
return "0.1.53";
|
|
29345
29361
|
}
|
|
29346
29362
|
|
|
29347
29363
|
// src/shared/schema-validation.ts
|
|
@@ -30142,8 +30158,7 @@ var GasIDDataSchema = zod.z.strictObject({
|
|
|
30142
30158
|
description: "Location of the waste origin"
|
|
30143
30159
|
}),
|
|
30144
30160
|
prevented_emissions_calculation: PreventedEmissionsCalculationSchema,
|
|
30145
|
-
|
|
30146
|
-
participant_rewards: ParticipantRewardsSchema.optional()
|
|
30161
|
+
participant_rewards: ParticipantRewardsSchema
|
|
30147
30162
|
}).meta({
|
|
30148
30163
|
title: "GasID Data",
|
|
30149
30164
|
description: "Complete data structure for GasID certificate"
|
|
@@ -30229,8 +30244,7 @@ var RecycledIDDataSchema = zod.z.strictObject({
|
|
|
30229
30244
|
title: "RecycledID Origin Location",
|
|
30230
30245
|
description: "Source waste origin location details"
|
|
30231
30246
|
}),
|
|
30232
|
-
|
|
30233
|
-
participant_rewards: ParticipantRewardsSchema.optional()
|
|
30247
|
+
participant_rewards: ParticipantRewardsSchema
|
|
30234
30248
|
}).meta({
|
|
30235
30249
|
title: "RecycledID Data",
|
|
30236
30250
|
description: "Complete data structure for RecycledID certificate"
|
|
@@ -31459,10 +31473,9 @@ var MassIDAuditSchema = BaseIpfsSchema.safeExtend({
|
|
|
31459
31473
|
}),
|
|
31460
31474
|
data: MassIDAuditDataSchema
|
|
31461
31475
|
}).meta(MassIDAuditSchemaMeta);
|
|
31476
|
+
/* v8 ignore next -- @preserve */
|
|
31462
31477
|
|
|
31463
31478
|
exports.ALLOWED_BLOCKCHAIN_NETWORKS = ALLOWED_BLOCKCHAIN_NETWORKS;
|
|
31464
|
-
exports.AccreditedParticipantSchema = AccreditedParticipantSchema;
|
|
31465
|
-
exports.AccreditedParticipantsSchema = AccreditedParticipantsSchema;
|
|
31466
31479
|
exports.AuditReferenceSchema = AuditReferenceSchema;
|
|
31467
31480
|
exports.AuditResultSchema = AuditResultSchema;
|
|
31468
31481
|
exports.AuditRuleDefinitionSchema = AuditRuleDefinitionSchema;
|
|
@@ -31567,6 +31580,8 @@ exports.RecycledIDDataSchema = RecycledIDDataSchema;
|
|
|
31567
31580
|
exports.RecycledIDIpfsSchema = RecycledIDIpfsSchema;
|
|
31568
31581
|
exports.RecycledIDIpfsSchemaMeta = RecycledIDIpfsSchemaMeta;
|
|
31569
31582
|
exports.RewardAllocationSchema = RewardAllocationSchema;
|
|
31583
|
+
exports.RewardDiscountSchema = RewardDiscountSchema;
|
|
31584
|
+
exports.RewardDiscountTypeSchema = RewardDiscountTypeSchema;
|
|
31570
31585
|
exports.ScaleTypeSchema = ScaleTypeSchema;
|
|
31571
31586
|
exports.SchemaInfoSchema = SchemaInfoSchema;
|
|
31572
31587
|
exports.SemanticVersionSchema = SemanticVersionSchema;
|