@carrot-foundation/schemas 0.1.22 → 0.1.24

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 CHANGED
@@ -271,9 +271,9 @@ var CoordinatesSchema = zod.z.strictObject({
271
271
  description: "GPS coordinates of the location"
272
272
  });
273
273
  var LocationSchema = zod.z.strictObject({
274
- id: UuidSchema.meta({
275
- title: "Location ID",
276
- description: "Unique identifier for the location"
274
+ id_hash: Sha256HashSchema.meta({
275
+ title: "Location ID Hash",
276
+ description: "Anonymized identifier for the location"
277
277
  }),
278
278
  municipality: NonEmptyStringSchema.max(50).meta({
279
279
  title: "Municipality",
@@ -298,9 +298,9 @@ var LocationSchema = zod.z.strictObject({
298
298
  title: "Country Code",
299
299
  description: "ISO 3166-1 alpha-2 country code"
300
300
  }),
301
- responsible_participant_id: UuidSchema.meta({
302
- title: "Responsible Participant ID",
303
- description: "ID of the participant responsible for this location"
301
+ responsible_participant_id_hash: Sha256HashSchema.meta({
302
+ title: "Responsible Participant ID Hash",
303
+ description: "Anonymized ID of the participant responsible for this location"
304
304
  }),
305
305
  coordinates: CoordinatesSchema,
306
306
  facility_type: FacilityTypeSchema.optional().meta({
@@ -330,9 +330,9 @@ function uniqueBy(schema, selector, errorMessage = "Items must be unique") {
330
330
 
331
331
  // src/shared/entities/participant.schema.ts
332
332
  var ParticipantSchema = zod.z.strictObject({
333
- id: UuidSchema.meta({
334
- title: "Participant ID",
335
- description: "Unique identifier for the participant"
333
+ id_hash: Sha256HashSchema.meta({
334
+ title: "Participant ID Hash",
335
+ description: "Anonymized identifier for the participant"
336
336
  }),
337
337
  name: ParticipantNameSchema.meta({
338
338
  title: "Participant Name",
@@ -532,12 +532,12 @@ var MassIDChainOfCustodyEventSchema = zod.z.strictObject({
532
532
  title: "Event Timestamp",
533
533
  description: "ISO 8601 timestamp when the event occurred"
534
534
  }),
535
- participant_id: UuidSchema.meta({
536
- title: "Participant ID",
535
+ participant_id_hash: Sha256HashSchema.meta({
536
+ title: "Participant ID Hash",
537
537
  description: "Reference to participant in the participants array"
538
538
  }),
539
- location_id: UuidSchema.meta({
540
- title: "Location ID",
539
+ location_id_hash: Sha256HashSchema.meta({
540
+ title: "Location ID Hash",
541
541
  description: "Reference to location in the locations array"
542
542
  }),
543
543
  weight: NonNegativeFloatSchema.optional().meta({
@@ -577,76 +577,45 @@ var MassIDChainOfCustodySchema = zod.z.strictObject({
577
577
  title: "Chain of Custody",
578
578
  description: "Complete chain of custody tracking from waste generation to final processing"
579
579
  });
580
- var MassIDTransportRouteSchema = zod.z.strictObject({
581
- from_location_id: UuidSchema.meta({
582
- title: "From Location ID",
583
- description: "Reference to the origin location in the locations array"
584
- }),
585
- to_location_id: UuidSchema.meta({
586
- title: "To Location ID",
587
- description: "Reference to the destination location in the locations array"
588
- }),
589
- distance_km: NonNegativeFloatSchema.meta({
590
- title: "Distance (km)",
591
- description: "Distance for this route segment in kilometers"
592
- }),
593
- transport_method: NonEmptyStringSchema.max(50).meta({
594
- title: "Transport Method",
595
- description: "Method of transportation for this segment",
596
- examples: [
597
- "Truck",
598
- "Rail",
599
- "Barge",
600
- "Container Ship",
601
- "Conveyor Belt",
602
- "Pipeline",
603
- "Walking",
604
- "Forklift"
605
- ]
606
- }),
607
- duration_hours: HoursSchema.meta({
608
- title: "Duration (hours)",
609
- description: "Time taken for this route segment in hours"
610
- })
611
- }).meta({
612
- title: "Transport Route",
613
- description: "Transport route segment information"
614
- });
615
580
  var MassIDGeographicDataSchema = zod.z.strictObject({
616
- origin_location_id: UuidSchema.meta({
617
- title: "Origin Location ID",
618
- description: "Reference to origin location in the locations array"
581
+ from_location_id_hash: Sha256HashSchema.meta({
582
+ title: "From Location ID Hash",
583
+ description: "Reference hash of the location where the waste started movement"
619
584
  }),
620
- processing_location_ids: zod.z.array(UuidSchema).optional().meta({
621
- title: "Processing Location IDs",
622
- description: "Locations where the waste was processed or handled"
585
+ to_location_id_hash: Sha256HashSchema.meta({
586
+ title: "To Location ID Hash",
587
+ description: "Reference hash of the location where the waste ended movement"
623
588
  }),
624
- final_destination_id: UuidSchema.meta({
625
- title: "Final Destination ID",
626
- description: "Reference to final destination in the locations array"
589
+ first_reported_timestamp: IsoTimestampSchema.meta({
590
+ title: "First Reported Timestamp",
591
+ description: "ISO 8601 timestamp when the waste was first reported/collected at the origin location"
627
592
  }),
628
- transport_routes: zod.z.array(MassIDTransportRouteSchema).meta({
629
- title: "Transport Routes",
630
- description: "Detailed transport route information"
593
+ last_reported_timestamp: IsoTimestampSchema.meta({
594
+ title: "Last Reported Timestamp",
595
+ description: "ISO 8601 timestamp when the waste was last reported/processed at the destination location"
631
596
  })
632
- }).meta({
597
+ }).refine((data) => {
598
+ const first = new Date(data.first_reported_timestamp);
599
+ const last = new Date(data.last_reported_timestamp);
600
+ return first <= last;
601
+ }, "first_reported_timestamp must be before or equal to last_reported_timestamp").meta({
633
602
  title: "Geographic Data",
634
- description: "Geographic information about waste origin and processing locations"
603
+ description: "Simplified geographic information tracking waste movement from origin to destination with temporal bounds"
635
604
  });
636
605
  var MassIDDataSchema = zod.z.strictObject({
637
606
  waste_properties: MassIDWastePropertiesSchema,
638
607
  locations: uniqueBy(
639
608
  LocationSchema,
640
- (loc) => loc.id,
641
- "Location IDs must be unique"
609
+ (loc) => loc.id_hash,
610
+ "Location ID hashes must be unique"
642
611
  ).min(1).meta({
643
612
  title: "Locations",
644
613
  description: "All locations referenced in this MassID, indexed by ID"
645
614
  }),
646
615
  participants: uniqueBy(
647
616
  ParticipantSchema,
648
- (p) => p.id,
649
- "Participant IDs must be unique"
617
+ (p) => p.id_hash,
618
+ "Participant ID hashes must be unique"
650
619
  ).min(1).meta({
651
620
  title: "Participants",
652
621
  description: "All participants referenced in this MassID, indexed by ID"
@@ -655,27 +624,27 @@ var MassIDDataSchema = zod.z.strictObject({
655
624
  geographic_data: MassIDGeographicDataSchema
656
625
  }).refine((data) => {
657
626
  const participantIdSet = new Set(
658
- data.participants.map((participant) => participant.id)
627
+ data.participants.map((participant) => participant.id_hash)
659
628
  );
660
629
  const eventParticipantIds = data.chain_of_custody.events.map(
661
- (event) => event.participant_id
630
+ (event) => event.participant_id_hash
662
631
  );
663
632
  const allEventParticipantsExist = eventParticipantIds.every(
664
633
  (participantId) => participantIdSet.has(participantId)
665
634
  );
666
635
  return allEventParticipantsExist;
667
- }, "All participant IDs in chain of custody events must exist in participants array").refine((data) => {
636
+ }, "All participant ID hashes in chain of custody events must exist in participants array").refine((data) => {
668
637
  const locationIdSet = new Set(
669
- data.locations.map((location) => location.id)
638
+ data.locations.map((location) => location.id_hash)
670
639
  );
671
640
  const eventLocationIds = data.chain_of_custody.events.map(
672
- (event) => event.location_id
641
+ (event) => event.location_id_hash
673
642
  );
674
643
  const allEventLocationsExist = eventLocationIds.every(
675
644
  (locationId) => locationIdSet.has(locationId)
676
645
  );
677
646
  return allEventLocationsExist;
678
- }, "All location IDs in chain of custody events must exist in locations array").meta({
647
+ }, "All location ID hashes in chain of custody events must exist in locations array").meta({
679
648
  title: "MassID Data",
680
649
  description: "MassID data containing waste tracking and chain of custody information"
681
650
  });
@@ -699,7 +668,7 @@ var RecordCreatorSchema = zod.z.strictObject({
699
668
  name: zod.z.string().meta({
700
669
  title: "Creator Name",
701
670
  description: "Company or individual name that created this record",
702
- examples: ["Carrot Foundation", "Alice", "Bob"]
671
+ examples: ["Carrot Foundation"]
703
672
  }),
704
673
  id: UuidSchema.meta({
705
674
  title: "Creator ID",
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/shared/definitions.schema.ts","../src/shared/entities/location.schema.ts","../src/shared/helpers.schema.ts","../src/shared/entities/participant.schema.ts","../src/mass-id/mass-id.data.schema.ts","../src/shared/base.schema.ts","../src/shared/nft.schema.ts","../src/shared/schema-version.ts","../src/mass-id/mass-id.schema.ts"],"names":["z"],"mappings":";;;;;AAEO,IAAM,UAAA,GAAaA,KAAA,CAAE,MAAA,CAAO,gCAAgC,EAAE,IAAA,CAAK;AA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,gBAAA,GAAmB,cAAc,UAAA,CAAW;AAAA,EACvD,MAAA,EAAQ,aAAA,CAAc,KAAA,CAAM,MAAA,CAAO,UAAA,CAAW;AAAA,IAC5C,IAAA,EAAMA,KAAAA,CAAE,OAAA,CAAQ,QAAQ,EAAE,IAAA,CAAK;AAAA,MAC7B,KAAA,EAAO,oBAAA;AAAA,MACP,WAAA,EAAa;AAAA,KACd;AAAA,GACF,CAAA;AAAA,EACD,UAAA,EAAY,uBAAuB,IAAA,CAAK;AAAA,IACtC,KAAA,EAAO,uBAAA;AAAA,IACP,WAAA,EACE;AAAA,GACH,CAAA,CAAE,KAAA,CAAMA,KAAAA,CAAE,SAAA,CAAU,EAAE,CAAA,EAAGA,KAAAA,CAAE,SAAA,CAAU,EAAE,CAAC,CAAA;AAAA,EACzC,IAAA,EAAM,iBAAiB,IAAA,CAAK;AAAA,IAC1B,KAAA,EAAO,aAAA;AAAA,IACP,WAAA,EACE;AAAA,GACH;AACH,CAAC,CAAA,CAAE,KAAK,oBAAoB","file":"index.cjs","sourcesContent":["import { z } from 'zod';\n\nexport const UuidSchema = z.uuidv4('Must be a valid UUID v4 string').meta({\n title: 'UUID',\n description: 'A universally unique identifier version 4',\n examples: [\n 'ad44dd3f-f176-4b98-bf78-5ee6e77d0530',\n '6f520d88-864d-432d-bf9f-5c3166c4818f',\n 'f77afa89-1c58-40fd-9bf5-8a86703a8af4',\n ],\n});\n\nexport type Uuid = z.infer<typeof UuidSchema>;\n\nexport const EthereumAddressSchema = z\n .string()\n .regex(\n /^0x[a-fA-F0-9]{40}$/,\n 'Must be a valid Ethereum address in lowercase hexadecimal format',\n )\n .meta({\n title: 'Ethereum Address',\n description: 'A valid Ethereum address in hexadecimal format',\n examples: [\n '0x1234567890abcdef1234567890abcdef12345678',\n '0xabcdef1234567890abcdef1234567890abcdef12',\n ],\n });\n\nexport type EthereumAddress = z.infer<typeof EthereumAddressSchema>;\n\nexport const IsoTimestampSchema = z.iso\n .datetime({\n message: 'Must be a valid ISO 8601 timestamp with timezone',\n })\n .meta({\n title: 'ISO Timestamp',\n description: 'ISO 8601 formatted timestamp with timezone information',\n examples: ['2024-12-05T11:02:47.000Z', '2025-02-22T10:35:12.000Z'],\n });\n\nexport type IsoTimestamp = z.infer<typeof IsoTimestampSchema>;\n\nexport const IsoDateSchema = z.iso\n .date('Must be a valid ISO 8601 date (YYYY-MM-DD)')\n .meta({\n title: 'ISO Date',\n description: 'ISO 8601 formatted date in YYYY-MM-DD format',\n examples: ['2024-12-05', '2025-02-22', '2024-02-10'],\n });\n\nexport type IsoDate = z.infer<typeof IsoDateSchema>;\n\nexport const UnixTimestampSchema = z\n .number()\n .int()\n .positive()\n .meta({\n title: 'Unix Timestamp',\n description:\n 'Unix timestamp in milliseconds since epoch (January 1, 1970 00:00:00 UTC)',\n examples: [1704067200000, 1735689600000, 1762371245149],\n });\n\nexport type UnixTimestamp = z.infer<typeof UnixTimestampSchema>;\n\nexport const IsoCountryCodeSchema = z\n .string()\n .regex(/^[A-Z]{2}$/, 'Must be a valid ISO 3166-1 alpha-2 country code')\n .meta({\n title: 'ISO Country Code',\n description:\n 'Two-letter country code following ISO 3166-1 alpha-2 standard',\n examples: ['BR', 'US', 'DE'],\n });\n\nexport type IsoCountryCode = z.infer<typeof IsoCountryCodeSchema>;\n\nexport const IsoAdministrativeDivisionCodeSchema = z\n .string()\n .regex(\n /^[A-Z]{2}-[A-Z0-9]{1,3}$/,\n 'Must be a valid ISO 3166-2 administrative division code',\n )\n .meta({\n title: 'ISO Administrative Division Code',\n description: 'Administrative division code following ISO 3166-2 standard',\n examples: ['BR-AP', 'BR-ES', 'US-CA'],\n });\n\nexport type IsoAdministrativeDivisionCode = z.infer<\n typeof IsoAdministrativeDivisionCodeSchema\n>;\n\nexport const LatitudeSchema = z\n .number()\n .min(-90)\n .max(90)\n .multipleOf(0.001)\n .meta({\n title: 'Latitude',\n description:\n 'Geographic latitude coordinate in decimal degrees with maximum 3 decimal places precision (~100m-1km accuracy for city-level, non-PII compliance)',\n examples: [-0.02, -20.38, 40.713],\n });\n\nexport type Latitude = z.infer<typeof LatitudeSchema>;\n\nexport const LongitudeSchema = z\n .number()\n .min(-180)\n .max(180)\n .multipleOf(0.001)\n .meta({\n title: 'Longitude',\n description:\n 'Geographic longitude coordinate in decimal degrees with maximum 3 decimal places precision (~100m-1km accuracy for city-level, non-PII compliance)',\n examples: [-51.06, -40.34, -74.006],\n });\n\nexport type Longitude = z.infer<typeof LongitudeSchema>;\n\nexport const WeightKgSchema = z\n .number()\n .min(0)\n .meta({\n title: 'Weight (kg)',\n description: 'Weight measurement in kilograms',\n examples: [3000, 1500, 500],\n });\n\nexport type WeightKg = z.infer<typeof WeightKgSchema>;\n\nexport const NonEmptyStringSchema = z\n .string()\n .min(1, 'Cannot be empty')\n .meta({\n title: 'Non-Empty String',\n description: 'A string that contains at least one character',\n examples: ['Example text', 'Sample value', 'Test string'],\n });\n\nexport type NonEmptyString = z.infer<typeof NonEmptyStringSchema>;\n\nexport const SlugSchema = NonEmptyStringSchema.regex(\n /^[a-z0-9-]+$/,\n 'Must contain only lowercase letters, numbers, and hyphens',\n)\n .max(100)\n .meta({\n title: 'Slug',\n description:\n 'URL-friendly identifier with lowercase letters, numbers, and hyphens',\n examples: ['mass-id-123', 'recycled-plastic', 'organic-waste'],\n });\nexport type Slug = z.infer<typeof SlugSchema>;\n\nexport const WasteTypeSchema = NonEmptyStringSchema.meta({\n title: 'Waste Type',\n description: 'Category or type of waste material',\n examples: ['Organic', 'Plastic', 'Metal'],\n});\nexport type WasteType = z.infer<typeof WasteTypeSchema>;\n\nexport const WasteSubtypeSchema = NonEmptyStringSchema.max(100).meta({\n title: 'Waste Subtype',\n description: 'Specific subcategory of waste within a waste type',\n examples: ['Food, Food Waste and Beverages', 'PET Bottles', 'Aluminum Cans'],\n});\nexport type WasteSubtype = z.infer<typeof WasteSubtypeSchema>;\n\nexport const ParticipantRoleSchema = NonEmptyStringSchema.max(100).meta({\n title: 'Participant Role',\n description:\n 'Role that a participant plays in the waste management supply chain',\n examples: ['Waste Generator', 'Hauler', 'Recycler'],\n});\nexport type ParticipantRole = z.infer<typeof ParticipantRoleSchema>;\n\nexport const ParticipantNameSchema = NonEmptyStringSchema.max(100).meta({\n title: 'Participant Name',\n description: 'Name of a participant in the waste management system',\n examples: ['Enlatados Produção', 'Eco Reciclagem', 'Green Tech Corp'],\n});\nexport type ParticipantName = z.infer<typeof ParticipantNameSchema>;\n\nexport const FacilityTypeSchema = z\n .enum([\n 'Collection Point',\n 'Recycling Facility',\n 'Administrative Office',\n 'Other',\n ])\n .meta({\n title: 'Facility Type',\n description: 'Type of facility in the waste management chain',\n examples: [\n 'Collection Point',\n 'Recycling Facility',\n 'Administrative Office',\n ],\n });\nexport type FacilityType = z.infer<typeof FacilityTypeSchema>;\n\nexport const BlockchainChainIdSchema = z\n .number()\n .int()\n .min(1)\n .meta({\n title: 'Chain ID',\n description: 'Blockchain network identifier',\n examples: [1, 137, 11155111],\n });\nexport type BlockchainChainId = z.infer<typeof BlockchainChainIdSchema>;\n\nexport const PercentageSchema = z\n .number()\n .min(0)\n .max(100)\n .meta({\n title: 'Percentage',\n description: 'Percentage value between 0 and 100',\n examples: [50, 75.5, 100],\n });\n\nexport type Percentage = z.infer<typeof PercentageSchema>;\n\nexport const NonNegativeIntegerSchema = z\n .number()\n .int()\n .min(0)\n .meta({\n title: 'Non-Negative Integer',\n description: 'Integer value that is zero or positive',\n examples: [0, 123, 4126],\n });\n\nexport type NonNegativeInteger = z.infer<typeof NonNegativeIntegerSchema>;\n\nexport const PositiveIntegerSchema = z\n .number()\n .int()\n .min(1)\n .meta({\n title: 'Positive Integer',\n description: 'Integer value that is greater than zero',\n examples: [1, 123, 456],\n });\n\nexport type PositiveInteger = z.infer<typeof PositiveIntegerSchema>;\n\nexport const NonNegativeFloatSchema = z\n .number()\n .min(0)\n .meta({\n title: 'Non-Negative Float',\n description: 'Floating-point number that is zero or positive',\n examples: [0.0, 45.2, 72.5],\n });\n\nexport type NonNegativeFloat = z.infer<typeof NonNegativeFloatSchema>;\n\nexport const HoursSchema = z\n .number()\n .min(0)\n .multipleOf(0.1)\n .meta({\n title: 'Hours',\n description: 'Time duration in hours with 0.1 hour precision',\n examples: [72.5, 24.0, 168.5],\n });\n\nexport type Hours = z.infer<typeof HoursSchema>;\n\nexport const IpfsUriSchema = NonEmptyStringSchema.regex(\n /^ipfs:\\/\\/[a-zA-Z0-9]+(\\/.*)?$/,\n 'Must be a valid IPFS URI with CID',\n).meta({\n title: 'IPFS URI',\n description: 'InterPlanetary File System URI pointing to distributed content',\n examples: [\n 'ipfs://QmTy8w65yBXgyfG2ZBg5TrfB2hPjrDQH3RCQFJGkARStJb/mass-id-organic.png',\n 'ipfs://QmYjtig7VJQ6XsnUjqqJvj7QaMcCAwtrgNdahSiFofrE7o',\n ],\n});\n\nexport type IpfsUri = z.infer<typeof IpfsUriSchema>;\n\nexport const SemanticVersionSchema = NonEmptyStringSchema.regex(\n /^v?\\d+\\.\\d+\\.\\d+(-[a-zA-Z0-9.-]+)?(\\+[a-zA-Z0-9.-]+)?$/,\n 'Must be a valid semantic version string',\n).meta({\n title: 'Semantic Version',\n description: 'Version string following semantic versioning specification',\n examples: ['0.1.0', '1.0.0', '2.1.3'],\n});\n\nexport type SemanticVersion = z.infer<typeof SemanticVersionSchema>;\n\nexport const TokenIdSchema = NonEmptyStringSchema.regex(\n /^\\d+$/,\n 'Must be a numeric string (supports uint256)',\n).meta({\n title: 'Token ID',\n description: 'Numeric identifier for blockchain tokens as string',\n examples: ['123', '456789', '1000000'],\n});\n\nexport type TokenId = z.infer<typeof TokenIdSchema>;\n\nexport const HexColorSchema = NonEmptyStringSchema.regex(\n /^#[0-9A-F]{6}$/,\n 'Must be a hex color code with # prefix and uppercase',\n).meta({\n title: 'Hex Color',\n description: 'Hexadecimal color code with hash prefix',\n examples: ['#2D5A27', '#FF5733', '#1E90FF'],\n});\n\nexport type HexColor = z.infer<typeof HexColorSchema>;\n\nexport const Sha256HashSchema = z\n .hash('sha256', {\n error: 'Must be a SHA256 hash as 32-byte hex string',\n })\n .meta({\n format: undefined,\n title: 'SHA256 Hash',\n description: 'SHA-256 cryptographic hash as hexadecimal string',\n examples: [\n '87f633634cc4b02f628685651f0a29b7bfa22a0bd841f725c6772dd00a58d489',\n '6e83b8e6373847bbdc056549bedda38dc88854ce41ba4fca11e0fc6ce3e07ef6',\n ],\n });\n\nexport type Sha256Hash = z.infer<typeof Sha256HashSchema>;\n\nexport const Keccak256HashSchema = Sha256HashSchema.meta({\n title: 'Keccak256 Hash',\n description: 'Keccak256 cryptographic hash as hexadecimal string',\n examples: [\n 'ac08c3cf2e175e55961d6affdb38bc24591b84ceef7f3707c69ae3d52c148b2f',\n 'b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2',\n ],\n});\n\nexport type Keccak256Hash = z.infer<typeof Keccak256HashSchema>;\n\nexport const ExternalIdSchema = UuidSchema.meta({\n title: 'External ID',\n description: 'UUID identifier for external system references',\n examples: [\n 'ad44dd3f-f176-4b98-bf78-5ee6e77d0530',\n 'b2c4e6f8-a1b3-4c5d-9e8f-123456789abc',\n ],\n});\n\nexport type ExternalId = z.infer<typeof ExternalIdSchema>;\n\nexport const ExternalUrlSchema = z.url('Must be a valid URL').meta({\n title: 'External URL',\n description: 'Valid URL pointing to external resources',\n examples: [\n 'https://explore.carrot.eco/document/ad44dd3f-f176-4b98-bf78-5ee6e77d0530',\n 'https://carrot.eco/whitepaper.pdf',\n ],\n});\n\nexport type ExternalUrl = z.infer<typeof ExternalUrlSchema>;\n\nexport const RecordSchemaTypeSchema = z\n .enum([\n 'MassID',\n 'MassID Audit',\n 'RecycledID',\n 'GasID',\n 'PurchaseID',\n 'Methodology',\n 'Credit',\n 'Collection',\n ])\n .meta({\n title: 'Schema Type',\n description: 'Type of schema in the Carrot ecosystem',\n examples: ['MassID', 'RecycledID', 'GasID'],\n });\n\nexport type RecordSchemaType = z.infer<typeof RecordSchemaTypeSchema>;\n\nexport const TokenSymbolSchema = NonEmptyStringSchema.max(10)\n .regex(\n /^[A-Z0-9-]+$/,\n 'Must contain only uppercase letters, numbers, and hyphens',\n )\n .meta({\n title: 'Token Symbol',\n description: 'Symbol representing a token or cryptocurrency',\n examples: ['MASS', 'REC', 'GAS'],\n });\n\nexport type TokenSymbol = z.infer<typeof TokenSymbolSchema>;\n\nexport const RecordRelationshipTypeSchema = z\n .enum([\n 'collection',\n 'credit',\n 'gas-id',\n 'mass-id',\n 'mass-id-audit',\n 'methodology',\n 'purchase-id',\n 'recycled-id',\n ])\n .meta({\n title: 'Relationship Type',\n description:\n 'Type of relationship between different entities in the system',\n examples: ['mass-id', 'audit', 'collection'],\n });\n\nexport type RecordRelationshipType = z.infer<\n typeof RecordRelationshipTypeSchema\n>;\n","import { z } from 'zod';\nimport {\n UuidSchema,\n NonEmptyStringSchema,\n LatitudeSchema,\n LongitudeSchema,\n IsoCountryCodeSchema,\n IsoAdministrativeDivisionCodeSchema,\n FacilityTypeSchema,\n} from '../definitions.schema';\n\nconst PrecisionLevelSchema = z\n .enum(['exact', 'neighborhood', 'city', 'region', 'country'])\n .meta({\n title: 'Precision Level',\n description: 'Level of coordinate precision',\n examples: ['city', 'exact', 'neighborhood'],\n });\n\nexport type PrecisionLevel = z.infer<typeof PrecisionLevelSchema>;\n\nexport const CoordinatesSchema = z\n .strictObject({\n latitude: LatitudeSchema.meta({\n title: 'Latitude',\n description: 'GPS latitude coordinate',\n }),\n longitude: LongitudeSchema.meta({\n title: 'Longitude',\n description: 'GPS longitude coordinate',\n }),\n precision_level: PrecisionLevelSchema,\n })\n .meta({\n title: 'Coordinates',\n description: 'GPS coordinates of the location',\n });\nexport type Coordinates = z.infer<typeof CoordinatesSchema>;\n\nexport const LocationSchema = z\n .strictObject({\n id: UuidSchema.meta({\n title: 'Location ID',\n description: 'Unique identifier for the location',\n }),\n municipality: NonEmptyStringSchema.max(50).meta({\n title: 'Municipality',\n description: 'Municipality or city name',\n examples: ['New York', 'São Paulo', 'London', 'Tokyo'],\n }),\n administrative_division: NonEmptyStringSchema.max(50).meta({\n title: 'Administrative Division',\n description: 'State, province, or administrative region',\n examples: ['California', 'Ontario', 'Bavaria', 'Queensland'],\n }),\n administrative_division_code:\n IsoAdministrativeDivisionCodeSchema.optional().meta({\n title: 'Administrative Division Code',\n description: 'ISO 3166-2 administrative division code',\n }),\n country: NonEmptyStringSchema.max(50).meta({\n title: 'Country',\n description: 'Full country name in English',\n examples: ['United States', 'Canada', 'Germany', 'Australia'],\n }),\n country_code: IsoCountryCodeSchema.meta({\n title: 'Country Code',\n description: 'ISO 3166-1 alpha-2 country code',\n }),\n responsible_participant_id: UuidSchema.meta({\n title: 'Responsible Participant ID',\n description: 'ID of the participant responsible for this location',\n }),\n coordinates: CoordinatesSchema,\n facility_type: FacilityTypeSchema.optional().meta({\n title: 'Facility Type',\n description: 'Type of facility at this location',\n }),\n })\n .meta({\n title: 'Location',\n description: 'Geographic location with address and coordinate information',\n });\n\nexport type Location = z.infer<typeof LocationSchema>;\n","import { z } from 'zod';\n\nexport function uniqueArrayItems<T extends z.ZodTypeAny>(\n schema: T,\n errorMessage: string = 'Array items must be unique',\n) {\n return z\n .array(schema)\n .refine((items) => new Set(items).size === items.length, {\n message: errorMessage,\n });\n}\n\nexport function uniqueBy<T extends z.ZodTypeAny, K>(\n schema: T,\n selector: (item: z.infer<T>) => K,\n errorMessage: string = 'Items must be unique',\n) {\n return z.array(schema).refine(\n (items) => {\n const values = items.map(selector);\n return new Set(values).size === values.length;\n },\n {\n message: errorMessage,\n },\n );\n}\n","import { z } from 'zod';\nimport {\n UuidSchema,\n ParticipantNameSchema,\n ParticipantRoleSchema,\n} from '../definitions.schema';\nimport { uniqueArrayItems } from '../helpers.schema';\n\nexport const ParticipantSchema = z\n .strictObject({\n id: UuidSchema.meta({\n title: 'Participant ID',\n description: 'Unique identifier for the participant',\n }),\n name: ParticipantNameSchema.meta({\n title: 'Participant Name',\n description: 'Name of the participant',\n }),\n roles: uniqueArrayItems(\n ParticipantRoleSchema,\n 'Participant roles must be unique',\n )\n .min(1)\n .meta({\n title: 'Participant Roles',\n description:\n 'Roles of the participant in the waste management supply chain',\n }),\n })\n .meta({\n title: 'Participant',\n description: 'A participant in the waste management supply chain',\n });\n\nexport type Participant = z.infer<typeof ParticipantSchema>;\n","import { z } from 'zod';\nimport {\n UuidSchema,\n WasteTypeSchema,\n WasteSubtypeSchema,\n NonEmptyStringSchema,\n NonNegativeFloatSchema,\n IsoTimestampSchema,\n IsoDateSchema,\n HoursSchema,\n} from '../shared/definitions.schema';\nimport { LocationSchema } from '../shared/entities/location.schema';\nimport { ParticipantSchema } from '../shared/entities/participant.schema';\nimport { uniqueBy } from '../shared/helpers.schema';\n\nconst MassIDLocalClassificationSchema = z\n .strictObject({\n code: NonEmptyStringSchema.max(20).meta({\n title: 'Classification Code',\n description: 'Local waste classification code',\n examples: ['20 01 01', 'D001', 'EWC-150101', 'IBAMA-A001'],\n }),\n description: NonEmptyStringSchema.max(200).meta({\n title: 'Classification Description',\n description: 'Local waste classification description',\n examples: [\n 'Paper and cardboard packaging',\n 'Ignitable waste',\n 'Paper and cardboard packaging waste',\n 'Municipal solid waste - organic fraction',\n ],\n }),\n system: z.enum(['IBAMA']).meta({\n title: 'Classification System',\n description:\n 'Classification system name - currently supports IBAMA (Instituto Brasileiro do Meio Ambiente e dos Recursos Naturais Renováveis)',\n examples: ['IBAMA'],\n }),\n })\n .meta({\n title: 'Local Classification',\n description:\n 'Local or regional waste classification codes and descriptions',\n });\n\nexport type MassIDLocalClassification = z.infer<\n typeof MassIDLocalClassificationSchema\n>;\n\nconst MassIDMeasurementUnitSchema = z.enum(['kg', 'ton']).meta({\n title: 'Measurement Unit',\n description: 'Unit of measurement for the waste quantity',\n examples: ['kg', 'ton'],\n});\n\nexport type MassIDMeasurementUnit = z.infer<typeof MassIDMeasurementUnitSchema>;\n\nconst ContaminationLevelSchema = z\n .enum(['None', 'Low', 'Medium', 'High'])\n .meta({\n title: 'Contamination Level',\n description: 'Level of contamination in the waste batch',\n examples: ['Low', 'Medium', 'None'],\n });\n\nexport type ContaminationLevel = z.infer<typeof ContaminationLevelSchema>;\n\nconst MassIDWastePropertiesSchema = z\n .strictObject({\n type: WasteTypeSchema.meta({\n title: 'Waste Type',\n description: 'Waste material category',\n }),\n subtype: WasteSubtypeSchema.meta({\n title: 'Waste Subtype',\n description: 'Specific subcategory of waste material',\n }),\n local_classification: MassIDLocalClassificationSchema.optional(),\n measurement_unit: MassIDMeasurementUnitSchema,\n net_weight: NonNegativeFloatSchema.meta({\n title: 'Net Weight',\n description:\n 'Net weight of the waste batch in the specified measurement unit',\n }),\n contamination_level: ContaminationLevelSchema.optional(),\n })\n .meta({\n title: 'Waste Properties',\n description:\n 'Standardized waste material properties and regulatory information',\n });\n\nexport type MassIDWasteProperties = z.infer<typeof MassIDWastePropertiesSchema>;\n\nconst EventAttributeFormatSchema = z\n .enum(['KILOGRAM', 'DATE', 'CURRENCY', 'PERCENTAGE', 'COORDINATE'])\n .meta({\n title: 'Event Attribute Format',\n description: 'Data format hint for proper display',\n examples: ['KILOGRAM', 'DATE', 'PERCENTAGE'],\n });\n\nexport type EventAttributeFormat = z.infer<typeof EventAttributeFormatSchema>;\n\nconst EventAttributeSchema = z\n .strictObject({\n name: NonEmptyStringSchema.max(100).meta({\n title: 'Attribute Name',\n description: 'Event attribute name',\n examples: [\n 'temperature',\n 'humidity',\n 'contamination_percentage',\n 'quality_grade',\n 'batch_number',\n 'operator_id',\n 'equipment_used',\n 'processing_cost',\n ],\n }),\n value: z\n .union([z.string(), z.number(), z.boolean()])\n .optional()\n .meta({\n title: 'Attribute Value',\n description: 'Event attribute value',\n examples: [\n 25.5,\n 'Grade A',\n true,\n 'BATCH-2024-001',\n 12.75,\n 'Shredder-X200',\n false,\n 'OP-456',\n ],\n }),\n preserved_sensitivity: z.boolean().optional().meta({\n title: 'Preserved Sensitivity',\n description:\n 'Indicates if the attribute contains sensitive information that was preserved',\n }),\n format: EventAttributeFormatSchema.optional(),\n })\n .meta({\n title: 'Event Attribute',\n description: 'Additional attribute specific to an event',\n });\nexport type EventAttribute = z.infer<typeof EventAttributeSchema>;\n\nconst EventDocumentSchema = z\n .strictObject({\n type: NonEmptyStringSchema.max(50).meta({\n title: 'Document Type',\n description: 'Type of supporting documentation',\n examples: [\n 'Waste Transfer Note',\n 'Certificate of Disposal',\n 'Certificate of Final Destination',\n 'Quality Assessment Report',\n 'Transport Manifest',\n 'Processing Receipt',\n 'Environmental Permit',\n 'Invoice',\n ],\n }),\n document_number: NonEmptyStringSchema.max(50)\n .optional()\n .meta({\n title: 'Document Number',\n description: 'Official document number if applicable',\n examples: [\n 'WTN-2024-001234',\n 'CD-ENV-456789',\n 'INV-2024-QTR1-789',\n 'PERMIT-EPA-2024-001',\n 'MANIFEST-DOT-567890',\n ],\n }),\n reference: NonEmptyStringSchema.meta({\n title: 'Document Reference',\n description:\n 'Reference to document (IPFS hash, file name, or external URL)',\n examples: [\n 'QmYjtig7VJQ6XsnUjqqJvj7QaMcCAwtrgNdahSiFofrE7o',\n 'waste_transfer_note_2024_001.pdf',\n 'https://docs.example.com/certificates/disposal_cert_456.pdf',\n 'bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi',\n 'processing_receipt_20240315.jpg',\n ],\n }),\n issue_date: IsoDateSchema.optional().meta({\n title: 'Issue Date',\n description: 'Date the document was issued',\n }),\n issuer: NonEmptyStringSchema.max(100)\n .optional()\n .meta({\n title: 'Document Issuer',\n description: 'Entity that issued the document',\n examples: [\n 'Environmental Protection Agency',\n 'Waste Management Solutions Ltd',\n 'Green Recycling Corp',\n 'City Waste Authority',\n 'EcoProcess Industries',\n 'Regional Environmental Office',\n ],\n }),\n })\n .meta({\n title: 'Event Document',\n description: 'Supporting event document',\n });\nexport type EventDocumentation = z.infer<typeof EventDocumentSchema>;\n\nconst MassIDChainOfCustodyEventSchema = z\n .strictObject({\n event_id: UuidSchema.meta({\n title: 'Event ID',\n description: 'Unique event identifier',\n }),\n event_name: NonEmptyStringSchema.max(50).meta({\n title: 'Event Name',\n description: 'Name of custody or processing event',\n examples: ['Sorting', 'Processing', 'Recycling', 'Weighing'],\n }),\n description: NonEmptyStringSchema.max(200)\n .optional()\n .meta({\n title: 'Event Description',\n description: 'Detailed description of what happened during this event',\n examples: [\n 'Waste collected from residential area using collection truck',\n 'Material sorted into recyclable and non-recyclable fractions',\n 'Plastic waste processed through shredding and washing',\n 'Waste transferred to authorized recycling facility',\n 'Final disposal at licensed landfill site',\n 'Quality inspection and contamination assessment completed',\n ],\n }),\n timestamp: IsoTimestampSchema.meta({\n title: 'Event Timestamp',\n description: 'ISO 8601 timestamp when the event occurred',\n }),\n participant_id: UuidSchema.meta({\n title: 'Participant ID',\n description: 'Reference to participant in the participants array',\n }),\n location_id: UuidSchema.meta({\n title: 'Location ID',\n description: 'Reference to location in the locations array',\n }),\n weight: NonNegativeFloatSchema.optional().meta({\n title: 'Event Weight',\n description: 'Mass weight after this event',\n }),\n attributes: z.array(EventAttributeSchema).optional().meta({\n title: 'Event Attributes',\n description: 'Additional attributes specific to this event',\n }),\n documentation: z.array(EventDocumentSchema).optional().meta({\n title: 'Event Documentation',\n description: 'Associated documentation for this event',\n }),\n notes: NonEmptyStringSchema.max(500).optional().meta({\n title: 'Event Notes',\n description: 'Additional notes or comments about this event',\n }),\n })\n .meta({\n title: 'Chain of Custody Event',\n description: 'Chain of custody event',\n });\n\nexport type MassIDChainOfCustodyEvent = z.infer<\n typeof MassIDChainOfCustodyEventSchema\n>;\n\nconst MassIDChainOfCustodySchema = z\n .strictObject({\n events: z.array(MassIDChainOfCustodyEventSchema).min(1).meta({\n title: 'Custody Events',\n description:\n 'Chronological sequence of custody transfer and processing events',\n }),\n total_distance_km: NonNegativeFloatSchema.meta({\n title: 'Total Distance (km)',\n description: 'Total distance traveled across all transport events',\n }),\n total_duration_hours: HoursSchema.meta({\n title: 'Total Duration (hours)',\n description: 'Total time from first to last event in hours',\n }),\n })\n .meta({\n title: 'Chain of Custody',\n description:\n 'Complete chain of custody tracking from waste generation to final processing',\n });\n\nexport type MassIDChainOfCustody = z.infer<typeof MassIDChainOfCustodySchema>;\n\nconst MassIDTransportRouteSchema = z\n .strictObject({\n from_location_id: UuidSchema.meta({\n title: 'From Location ID',\n description: 'Reference to the origin location in the locations array',\n }),\n to_location_id: UuidSchema.meta({\n title: 'To Location ID',\n description:\n 'Reference to the destination location in the locations array',\n }),\n distance_km: NonNegativeFloatSchema.meta({\n title: 'Distance (km)',\n description: 'Distance for this route segment in kilometers',\n }),\n transport_method: NonEmptyStringSchema.max(50).meta({\n title: 'Transport Method',\n description: 'Method of transportation for this segment',\n examples: [\n 'Truck',\n 'Rail',\n 'Barge',\n 'Container Ship',\n 'Conveyor Belt',\n 'Pipeline',\n 'Walking',\n 'Forklift',\n ],\n }),\n duration_hours: HoursSchema.meta({\n title: 'Duration (hours)',\n description: 'Time taken for this route segment in hours',\n }),\n })\n .meta({\n title: 'Transport Route',\n description: 'Transport route segment information',\n });\n\nexport type MassIDTransportRoute = z.infer<typeof MassIDTransportRouteSchema>;\n\nconst MassIDGeographicDataSchema = z\n .strictObject({\n origin_location_id: UuidSchema.meta({\n title: 'Origin Location ID',\n description: 'Reference to origin location in the locations array',\n }),\n processing_location_ids: z.array(UuidSchema).optional().meta({\n title: 'Processing Location IDs',\n description: 'Locations where the waste was processed or handled',\n }),\n final_destination_id: UuidSchema.meta({\n title: 'Final Destination ID',\n description: 'Reference to final destination in the locations array',\n }),\n transport_routes: z.array(MassIDTransportRouteSchema).meta({\n title: 'Transport Routes',\n description: 'Detailed transport route information',\n }),\n })\n .meta({\n title: 'Geographic Data',\n description:\n 'Geographic information about waste origin and processing locations',\n });\n\nexport type MassIDGeographicData = z.infer<typeof MassIDGeographicDataSchema>;\n\nexport const MassIDDataSchema = z\n .strictObject({\n waste_properties: MassIDWastePropertiesSchema,\n locations: uniqueBy(\n LocationSchema,\n (loc) => loc.id,\n 'Location IDs must be unique',\n )\n .min(1)\n .meta({\n title: 'Locations',\n description: 'All locations referenced in this MassID, indexed by ID',\n }),\n participants: uniqueBy(\n ParticipantSchema,\n (p) => p.id,\n 'Participant IDs must be unique',\n )\n .min(1)\n .meta({\n title: 'Participants',\n description:\n 'All participants referenced in this MassID, indexed by ID',\n }),\n chain_of_custody: MassIDChainOfCustodySchema,\n geographic_data: MassIDGeographicDataSchema,\n })\n .refine((data) => {\n const participantIdSet = new Set(\n data.participants.map((participant) => participant.id),\n );\n\n const eventParticipantIds = data.chain_of_custody.events.map(\n (event) => event.participant_id,\n );\n\n const allEventParticipantsExist = eventParticipantIds.every(\n (participantId) => participantIdSet.has(participantId),\n );\n\n return allEventParticipantsExist;\n }, 'All participant IDs in chain of custody events must exist in participants array')\n\n .refine((data) => {\n const locationIdSet = new Set(\n data.locations.map((location) => location.id),\n );\n\n const eventLocationIds = data.chain_of_custody.events.map(\n (event) => event.location_id,\n );\n\n const allEventLocationsExist = eventLocationIds.every((locationId) =>\n locationIdSet.has(locationId),\n );\n\n return allEventLocationsExist;\n }, 'All location IDs in chain of custody events must exist in locations array')\n .meta({\n title: 'MassID Data',\n description:\n 'MassID data containing waste tracking and chain of custody information',\n });\n\nexport type MassIDData = z.infer<typeof MassIDDataSchema>;\n","import { z } from 'zod';\nimport {\n Keccak256HashSchema,\n SemanticVersionSchema,\n Sha256HashSchema,\n IsoTimestampSchema,\n ExternalIdSchema,\n ExternalUrlSchema,\n UuidSchema,\n RecordSchemaTypeSchema,\n IpfsUriSchema,\n RecordRelationshipTypeSchema,\n} from './definitions.schema';\n\nconst SchemaInfoSchema = z\n .strictObject({\n hash: Keccak256HashSchema.meta({\n title: 'Schema Hash',\n description:\n 'Keccak256 hash of the JSON Schema this record was validated against',\n }),\n type: RecordSchemaTypeSchema.meta({\n title: 'Schema Type',\n description: 'Type/category of this schema',\n }),\n version: SemanticVersionSchema.meta({\n title: 'Schema Version',\n description: 'Version of the schema, using semantic versioning',\n }),\n })\n .meta({\n title: 'Schema Information',\n });\n\nexport type SchemaInfo = z.infer<typeof SchemaInfoSchema>;\n\nconst RecordCreatorSchema = z\n .strictObject({\n name: z.string().meta({\n title: 'Creator Name',\n description: 'Company or individual name that created this record',\n examples: ['Carrot Foundation', 'Alice', 'Bob'],\n }),\n id: UuidSchema.meta({\n title: 'Creator ID',\n description: 'Unique identifier for the creator',\n }),\n })\n .meta({\n title: 'Creator',\n description: 'Entity that created this record',\n });\n\nexport type RecordCreator = z.infer<typeof RecordCreatorSchema>;\n\nconst RecordRelationshipSchema = z\n .strictObject({\n target_uri: IpfsUriSchema.meta({\n title: 'Target IPFS URI',\n description: 'Target IPFS URI of the referenced record',\n }),\n type: RecordRelationshipTypeSchema.meta({\n title: 'Relationship Type',\n description: 'Type of relationship to the referenced record',\n }),\n description: z\n .string()\n .optional()\n .meta({\n title: 'Relationship Description',\n description: 'Human-readable description of the relationship',\n examples: [\n 'This record supersedes the previous version',\n 'Related carbon credit batch',\n 'Source document for this verification',\n 'Child record derived from this parent',\n 'Updated version of original record',\n ],\n }),\n })\n .meta({\n title: 'Relationship',\n description: 'Relationship to another IPFS record',\n });\n\nexport type RecordRelationship = z.infer<typeof RecordRelationshipSchema>;\n\nexport const RecordEnvironmentSchema = z\n .strictObject({\n blockchain_network: z.enum(['mainnet', 'testnet']).meta({\n title: 'Blockchain Network',\n description: 'Blockchain Network Environment',\n }),\n deployment: z.enum(['production', 'development', 'testing']).meta({\n title: 'Deployment Environment',\n description: 'System environment where this record was generated',\n }),\n data_set_name: z.enum(['TEST', 'PROD']).meta({\n title: 'Data Set Name',\n description: 'Name of the data set for this record',\n }),\n })\n .meta({\n title: 'Environment',\n description: 'Environment information',\n });\n\nexport type RecordEnvironment = z.infer<typeof RecordEnvironmentSchema>;\n\nexport const BaseIpfsSchema = z\n .strictObject({\n $schema: z.url('Must be a valid URI').meta({\n title: 'JSON Schema URI',\n description: 'URI of the JSON Schema used to validate this record',\n example:\n 'https://raw.githubusercontent.com/carrot-foundation/schemas/refs/heads/main/schemas/ipfs/shared/base/base.schema.json',\n }),\n schema: SchemaInfoSchema,\n created_at: IsoTimestampSchema.meta({\n title: 'Created At',\n description: 'ISO 8601 creation timestamp for this record',\n }),\n external_id: ExternalIdSchema.meta({\n title: 'External ID',\n description: 'Off-chain reference ID (UUID from Carrot backend)',\n }),\n external_url: ExternalUrlSchema.meta({\n title: 'External URL',\n description: 'External URL of the content',\n }),\n original_content_hash: Sha256HashSchema.meta({\n title: 'Original Content Hash',\n description:\n 'SHA-256 hash of the original JSON content including private data before schema validation',\n }),\n content_hash: Sha256HashSchema.meta({\n title: 'Content Hash',\n description:\n 'SHA-256 hash of RFC 8785 canonicalized JSON after schema validation',\n }),\n creator: RecordCreatorSchema.optional(),\n relationships: z.array(RecordRelationshipSchema).optional().meta({\n title: 'Relationships',\n description: 'References to other IPFS records this record relates to',\n }),\n environment: RecordEnvironmentSchema.optional(),\n data: z.record(z.string(), z.unknown()).optional().meta({\n title: 'Custom Data',\n description: \"Custom data block that includes the record's data\",\n }),\n })\n .meta({\n title: 'Base IPFS Record',\n description:\n 'Base fields for all Carrot IPFS records, providing common structure for any JSON content stored in IPFS',\n });\n\nexport type BaseIpfs = z.infer<typeof BaseIpfsSchema>;\n","import { z } from 'zod';\nimport { BaseIpfsSchema } from './base.schema';\nimport {\n EthereumAddressSchema,\n BlockchainChainIdSchema,\n TokenIdSchema,\n IpfsUriSchema,\n HexColorSchema,\n NonNegativeFloatSchema,\n RecordSchemaTypeSchema,\n} from './definitions.schema';\nimport { uniqueBy } from './helpers.schema';\n\nconst NftSchemaTypeSchema = RecordSchemaTypeSchema.extract([\n 'MassID',\n 'RecycledID',\n 'GasID',\n 'PurchaseID',\n]).meta({\n title: 'NFT Schema Type',\n description: 'Type of schema for NFT records',\n});\n\nexport type NftSchemaType = z.infer<typeof NftSchemaTypeSchema>;\n\nconst BlockchainReferenceSchema = z\n .strictObject({\n smart_contract_address: EthereumAddressSchema.meta({\n title: 'Smart Contract Address',\n }),\n chain_id: BlockchainChainIdSchema.meta({\n title: 'Chain ID',\n description: 'Blockchain chain ID',\n }),\n network_name: z.string().min(5).max(100).meta({\n title: 'Network Name',\n description: 'Name of the blockchain network',\n }),\n token_id: TokenIdSchema.meta({\n title: 'Token ID',\n description: 'NFT token ID',\n }),\n })\n .meta({\n title: 'Blockchain Information',\n description: 'Blockchain-specific information for the NFT',\n });\n\nexport type BlockchainReference = z.infer<typeof BlockchainReferenceSchema>;\n\nconst ExternalLinkSchema = z\n .strictObject({\n label: z.string().min(1).max(50).meta({\n title: 'Link Label',\n description: 'Display name for the external link',\n }),\n url: z.url('Must be a valid URI').meta({\n title: 'Link URL',\n description: 'Direct URI to the linked resource',\n }),\n description: z.string().min(10).max(100).optional().meta({\n title: 'Link Description',\n description: 'Optional context about what the link provides',\n }),\n })\n .meta({\n title: 'External Link',\n description: 'External link with label and description',\n });\n\nexport type ExternalLink = z.infer<typeof ExternalLinkSchema>;\n\nconst NftAttributeSchema = z\n .strictObject({\n trait_type: z.string().max(50).meta({\n title: 'Trait Type',\n description: 'Name of the trait or attribute',\n }),\n value: z.union([z.string(), z.number(), z.boolean()]).meta({\n title: 'Trait Value',\n description: 'Value of the trait - can be string, number, or boolean',\n }),\n display_type: z\n .enum(['number', 'date', 'boost_number', 'boost_percentage'])\n .optional()\n .meta({\n title: 'Display Type',\n description: 'How the trait should be displayed in marketplace UIs',\n }),\n max_value: NonNegativeFloatSchema.optional().meta({\n title: 'Max Value',\n description: 'Maximum possible value for numeric traits',\n }),\n })\n .meta({\n title: 'NFT Attribute',\n description: 'NFT attribute or trait with type and value',\n });\n\nexport type NftAttribute = z.infer<typeof NftAttributeSchema>;\n\nexport const NftIpfsSchema = BaseIpfsSchema.safeExtend({\n schema: BaseIpfsSchema.shape.schema.safeExtend({\n type: NftSchemaTypeSchema.meta({\n title: 'NFT Schema Type',\n description: 'Type/category of this NFT schema',\n }),\n }),\n blockchain: BlockchainReferenceSchema,\n name: z\n .string()\n .min(1)\n .max(100)\n .meta({\n title: 'NFT Name',\n description: 'Full display name for this NFT, including extra context',\n examples: [\n 'MassID #123 • Organic • 3.0t',\n 'RecycledID #456 • Plastic • 2.5t',\n 'GasID #789 • Methane • 1000 m³',\n ],\n }),\n short_name: z\n .string()\n .min(1)\n .max(50)\n .meta({\n title: 'Short Name',\n description: 'Compact name for UI summaries, tables, or tooltips',\n examples: ['MassID #123', 'RecycledID #456', 'GasID #789'],\n }),\n description: z\n .string()\n .min(10)\n .max(500)\n .meta({\n title: 'Description',\n description:\n \"Human-readable summary of the NFT's role and context. Ideally, maximum 300 characters.\",\n examples: [\n 'This MassID represents 3 metric tons of organic food waste from Enlatados Produção, tracked through complete chain of custody from generation to composting.',\n 'This RecycledID represents 2.5 metric tons of recycled plastic bottles processed by Green Solutions Ltd.',\n ],\n }),\n image: IpfsUriSchema.meta({\n title: 'Image URI',\n description: 'IPFS URI pointing to the preview image',\n }),\n background_color: HexColorSchema.optional().meta({\n title: 'Background Color',\n description: 'Hex color code for marketplace background display',\n }),\n animation_url: IpfsUriSchema.optional().meta({\n title: 'Animation URL',\n description: 'IPFS URI pointing to an animated or interactive media file',\n examples: [\n 'ipfs://QmAnimation123/mass-id-animation.mp4',\n 'ipfs://QmInteractive456/recycled-visualization.webm',\n ],\n }),\n external_links: uniqueBy(\n ExternalLinkSchema,\n (link) => link.url,\n 'External link URLs must be unique',\n )\n .max(10)\n .optional()\n .meta({\n title: 'External Links',\n description: 'Optional list of public resource links with labels',\n examples: [\n [\n {\n label: 'Carrot Explorer',\n url: 'https://explore.carrot.eco/document/ad44dd3f-f176-4b98-bf78-5ee6e77d0530',\n description: 'Complete chain of custody and audit trail',\n },\n {\n label: 'Carrot White Paper',\n url: 'https://carrot.eco/whitepaper.pdf',\n description: 'Carrot Foundation technical and impact white paper',\n },\n ],\n ],\n }),\n attributes: uniqueBy(\n NftAttributeSchema,\n (attr) => attr.trait_type,\n 'Attribute trait_type values must be unique',\n ).meta({\n title: 'NFT Attributes',\n description:\n 'List of visual traits and filterable attributes compatible with NFT marketplaces',\n examples: [\n [\n {\n trait_type: 'Waste Type',\n value: 'Organic',\n },\n {\n trait_type: 'Waste Subtype',\n value: 'Food, Food Waste and Beverages',\n },\n {\n trait_type: 'Weight (kg)',\n value: 3000,\n display_type: 'number',\n },\n {\n trait_type: 'Origin Country',\n value: 'Brazil',\n },\n {\n trait_type: 'Pick-up Date',\n value: '2024-12-05',\n display_type: 'date',\n },\n ],\n ],\n }),\n}).meta({\n title: 'NFT IPFS Record',\n description: 'NFT-specific fields for Carrot IPFS records',\n});\n\nexport type NftIpfs = z.infer<typeof NftIpfsSchema>;\n","export function getSchemaBaseUrl(): string {\n return `https://raw.githubusercontent.com/carrot-foundation/schemas/refs/tags/${getSchemaVersionOrDefault()}/schemas/ipfs`;\n}\n\nexport function buildSchemaUrl(schemaPath: string): string {\n const cleanPath = schemaPath.startsWith('/')\n ? schemaPath.slice(1)\n : schemaPath;\n return `${getSchemaBaseUrl()}/${cleanPath}`;\n}\n\nexport function getSchemaVersionOrDefault(): string {\n return process.env['SCHEMA_VERSION'] || '0.0.0-dev';\n}\n","import { z } from 'zod';\nimport { NftIpfsSchema } from '../shared/nft.schema';\nimport { MassIDDataSchema } from './mass-id.data.schema';\nimport {\n buildSchemaUrl,\n getSchemaVersionOrDefault,\n} from '../shared/schema-version';\nimport {\n WasteTypeSchema,\n WasteSubtypeSchema,\n WeightKgSchema,\n UnixTimestampSchema,\n} from '../shared/definitions.schema';\n\nconst AttributeWasteTypeSchema = z\n .strictObject({\n trait_type: z.literal('Waste Type'),\n value: WasteTypeSchema,\n })\n .meta({\n title: 'Waste Type Attribute',\n description: 'Waste type attribute',\n });\n\nexport type AttributeWasteType = z.infer<typeof AttributeWasteTypeSchema>;\n\nconst AttributeWasteSubtypeSchema = z\n .strictObject({\n trait_type: z.literal('Waste Subtype'),\n value: WasteSubtypeSchema,\n })\n .meta({\n title: 'Waste Subtype Attribute',\n description: 'Waste subtype attribute',\n });\n\nexport type AttributeWasteSubtype = z.infer<typeof AttributeWasteSubtypeSchema>;\n\nconst AttributeWeightSchema = z\n .strictObject({\n trait_type: z.literal('Weight (kg)'),\n value: WeightKgSchema,\n display_type: z.literal('number'),\n })\n .meta({\n title: 'Weight Attribute',\n description: 'Weight attribute with numeric display',\n });\n\nexport type AttributeWeight = z.infer<typeof AttributeWeightSchema>;\n\nconst AttributeOriginCountrySchema = z\n .strictObject({\n trait_type: z.literal('Origin Country'),\n value: z.string().max(100).meta({\n title: 'Origin Country Value',\n description: 'Country where the waste was generated',\n }),\n })\n .meta({\n title: 'Origin Country Attribute',\n description: 'Origin country attribute',\n });\n\nexport type AttributeOriginCountry = z.infer<\n typeof AttributeOriginCountrySchema\n>;\n\nconst AttributeOriginMunicipalitySchema = z\n .strictObject({\n trait_type: z.literal('Origin Municipality'),\n value: z.string().max(100).meta({\n title: 'Origin Municipality Value',\n description: 'Municipality where the waste was generated',\n }),\n })\n .meta({\n title: 'Origin Municipality Attribute',\n description: 'Origin municipality attribute',\n });\n\nexport type AttributeOriginMunicipality = z.infer<\n typeof AttributeOriginMunicipalitySchema\n>;\n\nconst AttributeOriginDivisionSchema = z\n .strictObject({\n trait_type: z.literal('Origin Administrative Division'),\n value: z.string().max(100).meta({\n title: 'Origin Division Value',\n description:\n 'Administrative division (state/province) where the waste was generated',\n }),\n })\n .meta({\n title: 'Origin Administrative Division Attribute',\n description: 'Origin administrative division attribute',\n });\n\nexport type AttributeOriginDivision = z.infer<\n typeof AttributeOriginDivisionSchema\n>;\n\nconst AttributeRecyclerSchema = z\n .strictObject({\n trait_type: z.literal('Recycler'),\n value: z.string().max(100).meta({\n title: 'Recycler Value',\n description: 'Organization that processed the waste',\n }),\n })\n .meta({\n title: 'Recycler Attribute',\n description: 'Recycler attribute',\n });\n\nexport type AttributeRecycler = z.infer<typeof AttributeRecyclerSchema>;\n\nconst AttributeIntegratorSchema = z\n .strictObject({\n trait_type: z.literal('Integrator'),\n value: z.string().max(100).meta({\n title: 'Integrator Value',\n description:\n 'Organization that integrated the waste into the Carrot network',\n }),\n })\n .meta({\n title: 'Integrator Attribute',\n description: 'Integrator attribute',\n });\n\nexport type AttributeIntegrator = z.infer<typeof AttributeIntegratorSchema>;\n\nconst AttributePickUpDateSchema = z\n .strictObject({\n trait_type: z.literal('Pick-up Date'),\n value: UnixTimestampSchema.meta({\n title: 'Pick-up Date Value',\n description:\n 'Unix timestamp in milliseconds when the waste was picked up from the source',\n }),\n display_type: z.literal('date'),\n })\n .meta({\n title: 'Pick-up Date Attribute',\n description: 'Pick-up date attribute with Unix timestamp',\n });\n\nexport type AttributePickUpDate = z.infer<typeof AttributePickUpDateSchema>;\n\nconst AttributeRecyclingDateSchema = z\n .strictObject({\n trait_type: z.literal('Recycling Date'),\n value: z\n .string()\n .regex(/^\\d{4}-\\d{2}-\\d{2}$/, 'Must be a valid date in YYYY-MM-DD format')\n .meta({\n title: 'Recycling Date Value',\n description: 'Date when the waste was recycled/processed',\n }),\n display_type: z.literal('date'),\n })\n .meta({\n title: 'Recycling Date Attribute',\n description: 'Recycling date attribute',\n });\n\nexport type AttributeRecyclingDate = z.infer<\n typeof AttributeRecyclingDateSchema\n>;\n\nconst MassIDAttributesSchema = z\n .tuple([\n AttributeWasteTypeSchema,\n AttributeWasteSubtypeSchema,\n AttributeWeightSchema,\n AttributeOriginCountrySchema,\n AttributeOriginMunicipalitySchema,\n AttributeOriginDivisionSchema,\n AttributeRecyclerSchema,\n AttributeIntegratorSchema,\n AttributePickUpDateSchema,\n AttributeRecyclingDateSchema,\n ])\n .meta({\n title: 'MassID Attributes',\n description: 'Fixed set of MassID NFT attributes in required order',\n });\n\nexport type MassIDAttributes = z.infer<typeof MassIDAttributesSchema>;\n\nexport const MassIDIpfsSchemaMeta = {\n title: 'MassID NFT IPFS Record',\n description:\n 'Complete MassID NFT IPFS record including fixed attributes and detailed waste tracking data',\n $id: buildSchemaUrl('mass-id/mass-id.schema.json'),\n version: getSchemaVersionOrDefault(),\n} as const;\n\nexport const MassIDIpfsSchema = NftIpfsSchema.safeExtend({\n schema: NftIpfsSchema.shape.schema.safeExtend({\n type: z.literal('MassID').meta({\n title: 'MassID Schema Type',\n description: 'MassID NFT schema type',\n }),\n }),\n attributes: MassIDAttributesSchema.meta({\n title: 'MassID NFT Attributes',\n description:\n 'Fixed set of MassID NFT attributes enforcing order and type for each trait',\n }).check(z.minLength(10), z.maxLength(10)),\n data: MassIDDataSchema.meta({\n title: 'MassID Data',\n description:\n 'MassID-specific data containing waste tracking and chain of custody information',\n }),\n}).meta(MassIDIpfsSchemaMeta);\n\nexport type MassIDIpfs = z.infer<typeof MassIDIpfsSchema>;\n"]}
1
+ {"version":3,"sources":["../src/shared/definitions.schema.ts","../src/shared/entities/location.schema.ts","../src/shared/helpers.schema.ts","../src/shared/entities/participant.schema.ts","../src/mass-id/mass-id.data.schema.ts","../src/shared/base.schema.ts","../src/shared/nft.schema.ts","../src/shared/schema-version.ts","../src/mass-id/mass-id.schema.ts"],"names":["z"],"mappings":";;;;;AAEO,IAAM,UAAA,GAAaA,KAAA,CAAE,MAAA,CAAO,gCAAgC,EAAE,IAAA,CAAK;AAAA,EACxE,KAAA,EAAO,MAAA;AAAA,EACP,WAAA,EAAa,2CAAA;AAAA,EACb,QAAA,EAAU;AAAA,IACR,sCAAA;AAAA,IACA,sCAAA;AAAA,IACA;AAAA;AAEJ,CAAC,CAAA;AAIM,IAAM,qBAAA,GAAwBA,KAAA,CAClC,MAAA,EAAO,CACP,KAAA;AAAA,EACC,qBAAA;AAAA,EACA;AACF,CAAA,CACC,IAAA,CAAK;AAAA,EACJ,KAAA,EAAO,kBAAA;AAAA,EACP,WAAA,EAAa,gDAAA;AAAA,EACb,QAAA,EAAU;AAAA,IACR,4CAAA;AAAA,IACA;AAAA;AAEJ,CAAC,CAAA;AAII,IAAM,kBAAA,GAAqBA,KAAA,CAAE,GAAA,CACjC,QAAA,CAAS;AAAA,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AAA;AACX;AAEO,IAAM,gBAAA,GAAmB,cAAc,UAAA,CAAW;AAAA,EACvD,MAAA,EAAQ,aAAA,CAAc,KAAA,CAAM,MAAA,CAAO,UAAA,CAAW;AAAA,IAC5C,IAAA,EAAMA,KAAAA,CAAE,OAAA,CAAQ,QAAQ,EAAE,IAAA,CAAK;AAAA,MAC7B,KAAA,EAAO,oBAAA;AAAA,MACP,WAAA,EAAa;AAAA,KACd;AAAA,GACF,CAAA;AAAA,EACD,UAAA,EAAY,uBAAuB,IAAA,CAAK;AAAA,IACtC,KAAA,EAAO,uBAAA;AAAA,IACP,WAAA,EACE;AAAA,GACH,CAAA,CAAE,KAAA,CAAMA,KAAAA,CAAE,SAAA,CAAU,EAAE,CAAA,EAAGA,KAAAA,CAAE,SAAA,CAAU,EAAE,CAAC,CAAA;AAAA,EACzC,IAAA,EAAM,iBAAiB,IAAA,CAAK;AAAA,IAC1B,KAAA,EAAO,aAAA;AAAA,IACP,WAAA,EACE;AAAA,GACH;AACH,CAAC,CAAA,CAAE,KAAK,oBAAoB","file":"index.cjs","sourcesContent":["import { z } from 'zod';\n\nexport const UuidSchema = z.uuidv4('Must be a valid UUID v4 string').meta({\n title: 'UUID',\n description: 'A universally unique identifier version 4',\n examples: [\n 'ad44dd3f-f176-4b98-bf78-5ee6e77d0530',\n '6f520d88-864d-432d-bf9f-5c3166c4818f',\n 'f77afa89-1c58-40fd-9bf5-8a86703a8af4',\n ],\n});\n\nexport type Uuid = z.infer<typeof UuidSchema>;\n\nexport const EthereumAddressSchema = z\n .string()\n .regex(\n /^0x[a-fA-F0-9]{40}$/,\n 'Must be a valid Ethereum address in lowercase hexadecimal format',\n )\n .meta({\n title: 'Ethereum Address',\n description: 'A valid Ethereum address in hexadecimal format',\n examples: [\n '0x1234567890abcdef1234567890abcdef12345678',\n '0xabcdef1234567890abcdef1234567890abcdef12',\n ],\n });\n\nexport type EthereumAddress = z.infer<typeof EthereumAddressSchema>;\n\nexport const IsoTimestampSchema = z.iso\n .datetime({\n message: 'Must be a valid ISO 8601 timestamp with timezone',\n })\n .meta({\n title: 'ISO Timestamp',\n description: 'ISO 8601 formatted timestamp with timezone information',\n examples: ['2024-12-05T11:02:47.000Z', '2025-02-22T10:35:12.000Z'],\n });\n\nexport type IsoTimestamp = z.infer<typeof IsoTimestampSchema>;\n\nexport const IsoDateSchema = z.iso\n .date('Must be a valid ISO 8601 date (YYYY-MM-DD)')\n .meta({\n title: 'ISO Date',\n description: 'ISO 8601 formatted date in YYYY-MM-DD format',\n examples: ['2024-12-05', '2025-02-22', '2024-02-10'],\n });\n\nexport type IsoDate = z.infer<typeof IsoDateSchema>;\n\nexport const UnixTimestampSchema = z\n .number()\n .int()\n .positive()\n .meta({\n title: 'Unix Timestamp',\n description:\n 'Unix timestamp in milliseconds since epoch (January 1, 1970 00:00:00 UTC)',\n examples: [1704067200000, 1735689600000, 1762371245149],\n });\n\nexport type UnixTimestamp = z.infer<typeof UnixTimestampSchema>;\n\nexport const IsoCountryCodeSchema = z\n .string()\n .regex(/^[A-Z]{2}$/, 'Must be a valid ISO 3166-1 alpha-2 country code')\n .meta({\n title: 'ISO Country Code',\n description:\n 'Two-letter country code following ISO 3166-1 alpha-2 standard',\n examples: ['BR', 'US', 'DE'],\n });\n\nexport type IsoCountryCode = z.infer<typeof IsoCountryCodeSchema>;\n\nexport const IsoAdministrativeDivisionCodeSchema = z\n .string()\n .regex(\n /^[A-Z]{2}-[A-Z0-9]{1,3}$/,\n 'Must be a valid ISO 3166-2 administrative division code',\n )\n .meta({\n title: 'ISO Administrative Division Code',\n description: 'Administrative division code following ISO 3166-2 standard',\n examples: ['BR-AP', 'BR-ES', 'US-CA'],\n });\n\nexport type IsoAdministrativeDivisionCode = z.infer<\n typeof IsoAdministrativeDivisionCodeSchema\n>;\n\nexport const LatitudeSchema = z\n .number()\n .min(-90)\n .max(90)\n .multipleOf(0.001)\n .meta({\n title: 'Latitude',\n description:\n 'Geographic latitude coordinate in decimal degrees with maximum 3 decimal places precision (~100m-1km accuracy for city-level, non-PII compliance)',\n examples: [-0.02, -20.38, 40.713],\n });\n\nexport type Latitude = z.infer<typeof LatitudeSchema>;\n\nexport const LongitudeSchema = z\n .number()\n .min(-180)\n .max(180)\n .multipleOf(0.001)\n .meta({\n title: 'Longitude',\n description:\n 'Geographic longitude coordinate in decimal degrees with maximum 3 decimal places precision (~100m-1km accuracy for city-level, non-PII compliance)',\n examples: [-51.06, -40.34, -74.006],\n });\n\nexport type Longitude = z.infer<typeof LongitudeSchema>;\n\nexport const WeightKgSchema = z\n .number()\n .min(0)\n .meta({\n title: 'Weight (kg)',\n description: 'Weight measurement in kilograms',\n examples: [3000, 1500, 500],\n });\n\nexport type WeightKg = z.infer<typeof WeightKgSchema>;\n\nexport const NonEmptyStringSchema = z\n .string()\n .min(1, 'Cannot be empty')\n .meta({\n title: 'Non-Empty String',\n description: 'A string that contains at least one character',\n examples: ['Example text', 'Sample value', 'Test string'],\n });\n\nexport type NonEmptyString = z.infer<typeof NonEmptyStringSchema>;\n\nexport const SlugSchema = NonEmptyStringSchema.regex(\n /^[a-z0-9-]+$/,\n 'Must contain only lowercase letters, numbers, and hyphens',\n)\n .max(100)\n .meta({\n title: 'Slug',\n description:\n 'URL-friendly identifier with lowercase letters, numbers, and hyphens',\n examples: ['mass-id-123', 'recycled-plastic', 'organic-waste'],\n });\nexport type Slug = z.infer<typeof SlugSchema>;\n\nexport const WasteTypeSchema = NonEmptyStringSchema.meta({\n title: 'Waste Type',\n description: 'Category or type of waste material',\n examples: ['Organic', 'Plastic', 'Metal'],\n});\nexport type WasteType = z.infer<typeof WasteTypeSchema>;\n\nexport const WasteSubtypeSchema = NonEmptyStringSchema.max(100).meta({\n title: 'Waste Subtype',\n description: 'Specific subcategory of waste within a waste type',\n examples: ['Food, Food Waste and Beverages', 'PET Bottles', 'Aluminum Cans'],\n});\nexport type WasteSubtype = z.infer<typeof WasteSubtypeSchema>;\n\nexport const ParticipantRoleSchema = NonEmptyStringSchema.max(100).meta({\n title: 'Participant Role',\n description:\n 'Role that a participant plays in the waste management supply chain',\n examples: ['Waste Generator', 'Hauler', 'Recycler'],\n});\nexport type ParticipantRole = z.infer<typeof ParticipantRoleSchema>;\n\nexport const ParticipantNameSchema = NonEmptyStringSchema.max(100).meta({\n title: 'Participant Name',\n description: 'Name of a participant in the waste management system',\n examples: ['Enlatados Produção', 'Eco Reciclagem', 'Green Tech Corp'],\n});\nexport type ParticipantName = z.infer<typeof ParticipantNameSchema>;\n\nexport const FacilityTypeSchema = z\n .enum([\n 'Collection Point',\n 'Recycling Facility',\n 'Administrative Office',\n 'Other',\n ])\n .meta({\n title: 'Facility Type',\n description: 'Type of facility in the waste management chain',\n examples: [\n 'Collection Point',\n 'Recycling Facility',\n 'Administrative Office',\n ],\n });\nexport type FacilityType = z.infer<typeof FacilityTypeSchema>;\n\nexport const BlockchainChainIdSchema = z\n .number()\n .int()\n .min(1)\n .meta({\n title: 'Chain ID',\n description: 'Blockchain network identifier',\n examples: [1, 137, 11155111],\n });\nexport type BlockchainChainId = z.infer<typeof BlockchainChainIdSchema>;\n\nexport const PercentageSchema = z\n .number()\n .min(0)\n .max(100)\n .meta({\n title: 'Percentage',\n description: 'Percentage value between 0 and 100',\n examples: [50, 75.5, 100],\n });\n\nexport type Percentage = z.infer<typeof PercentageSchema>;\n\nexport const NonNegativeIntegerSchema = z\n .number()\n .int()\n .min(0)\n .meta({\n title: 'Non-Negative Integer',\n description: 'Integer value that is zero or positive',\n examples: [0, 123, 4126],\n });\n\nexport type NonNegativeInteger = z.infer<typeof NonNegativeIntegerSchema>;\n\nexport const PositiveIntegerSchema = z\n .number()\n .int()\n .min(1)\n .meta({\n title: 'Positive Integer',\n description: 'Integer value that is greater than zero',\n examples: [1, 123, 456],\n });\n\nexport type PositiveInteger = z.infer<typeof PositiveIntegerSchema>;\n\nexport const NonNegativeFloatSchema = z\n .number()\n .min(0)\n .meta({\n title: 'Non-Negative Float',\n description: 'Floating-point number that is zero or positive',\n examples: [0.0, 45.2, 72.5],\n });\n\nexport type NonNegativeFloat = z.infer<typeof NonNegativeFloatSchema>;\n\nexport const HoursSchema = z\n .number()\n .min(0)\n .multipleOf(0.1)\n .meta({\n title: 'Hours',\n description: 'Time duration in hours with 0.1 hour precision',\n examples: [72.5, 24.0, 168.5],\n });\n\nexport type Hours = z.infer<typeof HoursSchema>;\n\nexport const IpfsUriSchema = NonEmptyStringSchema.regex(\n /^ipfs:\\/\\/[a-zA-Z0-9]+(\\/.*)?$/,\n 'Must be a valid IPFS URI with CID',\n).meta({\n title: 'IPFS URI',\n description: 'InterPlanetary File System URI pointing to distributed content',\n examples: [\n 'ipfs://QmTy8w65yBXgyfG2ZBg5TrfB2hPjrDQH3RCQFJGkARStJb/mass-id-organic.png',\n 'ipfs://QmYjtig7VJQ6XsnUjqqJvj7QaMcCAwtrgNdahSiFofrE7o',\n ],\n});\n\nexport type IpfsUri = z.infer<typeof IpfsUriSchema>;\n\nexport const SemanticVersionSchema = NonEmptyStringSchema.regex(\n /^v?\\d+\\.\\d+\\.\\d+(-[a-zA-Z0-9.-]+)?(\\+[a-zA-Z0-9.-]+)?$/,\n 'Must be a valid semantic version string',\n).meta({\n title: 'Semantic Version',\n description: 'Version string following semantic versioning specification',\n examples: ['0.1.0', '1.0.0', '2.1.3'],\n});\n\nexport type SemanticVersion = z.infer<typeof SemanticVersionSchema>;\n\nexport const TokenIdSchema = NonEmptyStringSchema.regex(\n /^\\d+$/,\n 'Must be a numeric string (supports uint256)',\n).meta({\n title: 'Token ID',\n description: 'Numeric identifier for blockchain tokens as string',\n examples: ['123', '456789', '1000000'],\n});\n\nexport type TokenId = z.infer<typeof TokenIdSchema>;\n\nexport const HexColorSchema = NonEmptyStringSchema.regex(\n /^#[0-9A-F]{6}$/,\n 'Must be a hex color code with # prefix and uppercase',\n).meta({\n title: 'Hex Color',\n description: 'Hexadecimal color code with hash prefix',\n examples: ['#2D5A27', '#FF5733', '#1E90FF'],\n});\n\nexport type HexColor = z.infer<typeof HexColorSchema>;\n\nexport const Sha256HashSchema = z\n .hash('sha256', {\n error: 'Must be a SHA256 hash as 32-byte hex string',\n })\n .meta({\n format: undefined,\n title: 'SHA256 Hash',\n description: 'SHA-256 cryptographic hash as hexadecimal string',\n examples: [\n '87f633634cc4b02f628685651f0a29b7bfa22a0bd841f725c6772dd00a58d489',\n '6e83b8e6373847bbdc056549bedda38dc88854ce41ba4fca11e0fc6ce3e07ef6',\n ],\n });\n\nexport type Sha256Hash = z.infer<typeof Sha256HashSchema>;\n\nexport const Keccak256HashSchema = Sha256HashSchema.meta({\n title: 'Keccak256 Hash',\n description: 'Keccak256 cryptographic hash as hexadecimal string',\n examples: [\n 'ac08c3cf2e175e55961d6affdb38bc24591b84ceef7f3707c69ae3d52c148b2f',\n 'b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2',\n ],\n});\n\nexport type Keccak256Hash = z.infer<typeof Keccak256HashSchema>;\n\nexport const ExternalIdSchema = UuidSchema.meta({\n title: 'External ID',\n description: 'UUID identifier for external system references',\n examples: [\n 'ad44dd3f-f176-4b98-bf78-5ee6e77d0530',\n 'b2c4e6f8-a1b3-4c5d-9e8f-123456789abc',\n ],\n});\n\nexport type ExternalId = z.infer<typeof ExternalIdSchema>;\n\nexport const ExternalUrlSchema = z.url('Must be a valid URL').meta({\n title: 'External URL',\n description: 'Valid URL pointing to external resources',\n examples: [\n 'https://explore.carrot.eco/document/ad44dd3f-f176-4b98-bf78-5ee6e77d0530',\n 'https://carrot.eco/whitepaper.pdf',\n ],\n});\n\nexport type ExternalUrl = z.infer<typeof ExternalUrlSchema>;\n\nexport const RecordSchemaTypeSchema = z\n .enum([\n 'MassID',\n 'MassID Audit',\n 'RecycledID',\n 'GasID',\n 'PurchaseID',\n 'Methodology',\n 'Credit',\n 'Collection',\n ])\n .meta({\n title: 'Schema Type',\n description: 'Type of schema in the Carrot ecosystem',\n examples: ['MassID', 'RecycledID', 'GasID'],\n });\n\nexport type RecordSchemaType = z.infer<typeof RecordSchemaTypeSchema>;\n\nexport const TokenSymbolSchema = NonEmptyStringSchema.max(10)\n .regex(\n /^[A-Z0-9-]+$/,\n 'Must contain only uppercase letters, numbers, and hyphens',\n )\n .meta({\n title: 'Token Symbol',\n description: 'Symbol representing a token or cryptocurrency',\n examples: ['MASS', 'REC', 'GAS'],\n });\n\nexport type TokenSymbol = z.infer<typeof TokenSymbolSchema>;\n\nexport const RecordRelationshipTypeSchema = z\n .enum([\n 'collection',\n 'credit',\n 'gas-id',\n 'mass-id',\n 'mass-id-audit',\n 'methodology',\n 'purchase-id',\n 'recycled-id',\n ])\n .meta({\n title: 'Relationship Type',\n description:\n 'Type of relationship between different entities in the system',\n examples: ['mass-id', 'audit', 'collection'],\n });\n\nexport type RecordRelationshipType = z.infer<\n typeof RecordRelationshipTypeSchema\n>;\n","import { z } from 'zod';\nimport {\n Sha256HashSchema,\n NonEmptyStringSchema,\n LatitudeSchema,\n LongitudeSchema,\n IsoCountryCodeSchema,\n IsoAdministrativeDivisionCodeSchema,\n FacilityTypeSchema,\n} from '../definitions.schema';\n\nconst PrecisionLevelSchema = z\n .enum(['exact', 'neighborhood', 'city', 'region', 'country'])\n .meta({\n title: 'Precision Level',\n description: 'Level of coordinate precision',\n examples: ['city', 'exact', 'neighborhood'],\n });\n\nexport type PrecisionLevel = z.infer<typeof PrecisionLevelSchema>;\n\nexport const CoordinatesSchema = z\n .strictObject({\n latitude: LatitudeSchema.meta({\n title: 'Latitude',\n description: 'GPS latitude coordinate',\n }),\n longitude: LongitudeSchema.meta({\n title: 'Longitude',\n description: 'GPS longitude coordinate',\n }),\n precision_level: PrecisionLevelSchema,\n })\n .meta({\n title: 'Coordinates',\n description: 'GPS coordinates of the location',\n });\nexport type Coordinates = z.infer<typeof CoordinatesSchema>;\n\nexport const LocationSchema = z\n .strictObject({\n id_hash: Sha256HashSchema.meta({\n title: 'Location ID Hash',\n description: 'Anonymized identifier for the location',\n }),\n municipality: NonEmptyStringSchema.max(50).meta({\n title: 'Municipality',\n description: 'Municipality or city name',\n examples: ['New York', 'São Paulo', 'London', 'Tokyo'],\n }),\n administrative_division: NonEmptyStringSchema.max(50).meta({\n title: 'Administrative Division',\n description: 'State, province, or administrative region',\n examples: ['California', 'Ontario', 'Bavaria', 'Queensland'],\n }),\n administrative_division_code:\n IsoAdministrativeDivisionCodeSchema.optional().meta({\n title: 'Administrative Division Code',\n description: 'ISO 3166-2 administrative division code',\n }),\n country: NonEmptyStringSchema.max(50).meta({\n title: 'Country',\n description: 'Full country name in English',\n examples: ['United States', 'Canada', 'Germany', 'Australia'],\n }),\n country_code: IsoCountryCodeSchema.meta({\n title: 'Country Code',\n description: 'ISO 3166-1 alpha-2 country code',\n }),\n responsible_participant_id_hash: Sha256HashSchema.meta({\n title: 'Responsible Participant ID Hash',\n description:\n 'Anonymized ID of the participant responsible for this location',\n }),\n coordinates: CoordinatesSchema,\n facility_type: FacilityTypeSchema.optional().meta({\n title: 'Facility Type',\n description: 'Type of facility at this location',\n }),\n })\n .meta({\n title: 'Location',\n description: 'Geographic location with address and coordinate information',\n });\n\nexport type Location = z.infer<typeof LocationSchema>;\n","import { z } from 'zod';\n\nexport function uniqueArrayItems<T extends z.ZodTypeAny>(\n schema: T,\n errorMessage: string = 'Array items must be unique',\n) {\n return z\n .array(schema)\n .refine((items) => new Set(items).size === items.length, {\n message: errorMessage,\n });\n}\n\nexport function uniqueBy<T extends z.ZodTypeAny, K>(\n schema: T,\n selector: (item: z.infer<T>) => K,\n errorMessage: string = 'Items must be unique',\n) {\n return z.array(schema).refine(\n (items) => {\n const values = items.map(selector);\n return new Set(values).size === values.length;\n },\n {\n message: errorMessage,\n },\n );\n}\n","import { z } from 'zod';\nimport {\n Sha256HashSchema,\n ParticipantNameSchema,\n ParticipantRoleSchema,\n} from '../definitions.schema';\nimport { uniqueArrayItems } from '../helpers.schema';\n\nexport const ParticipantSchema = z\n .strictObject({\n id_hash: Sha256HashSchema.meta({\n title: 'Participant ID Hash',\n description: 'Anonymized identifier for the participant',\n }),\n name: ParticipantNameSchema.meta({\n title: 'Participant Name',\n description: 'Name of the participant',\n }),\n roles: uniqueArrayItems(\n ParticipantRoleSchema,\n 'Participant roles must be unique',\n )\n .min(1)\n .meta({\n title: 'Participant Roles',\n description:\n 'Roles of the participant in the waste management supply chain',\n }),\n })\n .meta({\n title: 'Participant',\n description: 'A participant in the waste management supply chain',\n });\n\nexport type Participant = z.infer<typeof ParticipantSchema>;\n","import { z } from 'zod';\nimport {\n UuidSchema,\n Sha256HashSchema,\n WasteTypeSchema,\n WasteSubtypeSchema,\n NonEmptyStringSchema,\n NonNegativeFloatSchema,\n IsoTimestampSchema,\n IsoDateSchema,\n HoursSchema,\n} from '../shared/definitions.schema';\nimport { LocationSchema } from '../shared/entities/location.schema';\nimport { ParticipantSchema } from '../shared/entities/participant.schema';\nimport { uniqueBy } from '../shared/helpers.schema';\n\nconst MassIDLocalClassificationSchema = z\n .strictObject({\n code: NonEmptyStringSchema.max(20).meta({\n title: 'Classification Code',\n description: 'Local waste classification code',\n examples: ['20 01 01', 'D001', 'EWC-150101', 'IBAMA-A001'],\n }),\n description: NonEmptyStringSchema.max(200).meta({\n title: 'Classification Description',\n description: 'Local waste classification description',\n examples: [\n 'Paper and cardboard packaging',\n 'Ignitable waste',\n 'Paper and cardboard packaging waste',\n 'Municipal solid waste - organic fraction',\n ],\n }),\n system: z.enum(['IBAMA']).meta({\n title: 'Classification System',\n description:\n 'Classification system name - currently supports IBAMA (Instituto Brasileiro do Meio Ambiente e dos Recursos Naturais Renováveis)',\n examples: ['IBAMA'],\n }),\n })\n .meta({\n title: 'Local Classification',\n description:\n 'Local or regional waste classification codes and descriptions',\n });\n\nexport type MassIDLocalClassification = z.infer<\n typeof MassIDLocalClassificationSchema\n>;\n\nconst MassIDMeasurementUnitSchema = z.enum(['kg', 'ton']).meta({\n title: 'Measurement Unit',\n description: 'Unit of measurement for the waste quantity',\n examples: ['kg', 'ton'],\n});\n\nexport type MassIDMeasurementUnit = z.infer<typeof MassIDMeasurementUnitSchema>;\n\nconst ContaminationLevelSchema = z\n .enum(['None', 'Low', 'Medium', 'High'])\n .meta({\n title: 'Contamination Level',\n description: 'Level of contamination in the waste batch',\n examples: ['Low', 'Medium', 'None'],\n });\n\nexport type ContaminationLevel = z.infer<typeof ContaminationLevelSchema>;\n\nconst MassIDWastePropertiesSchema = z\n .strictObject({\n type: WasteTypeSchema.meta({\n title: 'Waste Type',\n description: 'Waste material category',\n }),\n subtype: WasteSubtypeSchema.meta({\n title: 'Waste Subtype',\n description: 'Specific subcategory of waste material',\n }),\n local_classification: MassIDLocalClassificationSchema.optional(),\n measurement_unit: MassIDMeasurementUnitSchema,\n net_weight: NonNegativeFloatSchema.meta({\n title: 'Net Weight',\n description:\n 'Net weight of the waste batch in the specified measurement unit',\n }),\n contamination_level: ContaminationLevelSchema.optional(),\n })\n .meta({\n title: 'Waste Properties',\n description:\n 'Standardized waste material properties and regulatory information',\n });\n\nexport type MassIDWasteProperties = z.infer<typeof MassIDWastePropertiesSchema>;\n\nconst EventAttributeFormatSchema = z\n .enum(['KILOGRAM', 'DATE', 'CURRENCY', 'PERCENTAGE', 'COORDINATE'])\n .meta({\n title: 'Event Attribute Format',\n description: 'Data format hint for proper display',\n examples: ['KILOGRAM', 'DATE', 'PERCENTAGE'],\n });\n\nexport type EventAttributeFormat = z.infer<typeof EventAttributeFormatSchema>;\n\nconst EventAttributeSchema = z\n .strictObject({\n name: NonEmptyStringSchema.max(100).meta({\n title: 'Attribute Name',\n description: 'Event attribute name',\n examples: [\n 'temperature',\n 'humidity',\n 'contamination_percentage',\n 'quality_grade',\n 'batch_number',\n 'operator_id',\n 'equipment_used',\n 'processing_cost',\n ],\n }),\n value: z\n .union([z.string(), z.number(), z.boolean()])\n .optional()\n .meta({\n title: 'Attribute Value',\n description: 'Event attribute value',\n examples: [\n 25.5,\n 'Grade A',\n true,\n 'BATCH-2024-001',\n 12.75,\n 'Shredder-X200',\n false,\n 'OP-456',\n ],\n }),\n preserved_sensitivity: z.boolean().optional().meta({\n title: 'Preserved Sensitivity',\n description:\n 'Indicates if the attribute contains sensitive information that was preserved',\n }),\n format: EventAttributeFormatSchema.optional(),\n })\n .meta({\n title: 'Event Attribute',\n description: 'Additional attribute specific to an event',\n });\nexport type EventAttribute = z.infer<typeof EventAttributeSchema>;\n\nconst EventDocumentSchema = z\n .strictObject({\n type: NonEmptyStringSchema.max(50).meta({\n title: 'Document Type',\n description: 'Type of supporting documentation',\n examples: [\n 'Waste Transfer Note',\n 'Certificate of Disposal',\n 'Certificate of Final Destination',\n 'Quality Assessment Report',\n 'Transport Manifest',\n 'Processing Receipt',\n 'Environmental Permit',\n 'Invoice',\n ],\n }),\n document_number: NonEmptyStringSchema.max(50)\n .optional()\n .meta({\n title: 'Document Number',\n description: 'Official document number if applicable',\n examples: [\n 'WTN-2024-001234',\n 'CD-ENV-456789',\n 'INV-2024-QTR1-789',\n 'PERMIT-EPA-2024-001',\n 'MANIFEST-DOT-567890',\n ],\n }),\n reference: NonEmptyStringSchema.meta({\n title: 'Document Reference',\n description:\n 'Reference to document (IPFS hash, file name, or external URL)',\n examples: [\n 'QmYjtig7VJQ6XsnUjqqJvj7QaMcCAwtrgNdahSiFofrE7o',\n 'waste_transfer_note_2024_001.pdf',\n 'https://docs.example.com/certificates/disposal_cert_456.pdf',\n 'bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi',\n 'processing_receipt_20240315.jpg',\n ],\n }),\n issue_date: IsoDateSchema.optional().meta({\n title: 'Issue Date',\n description: 'Date the document was issued',\n }),\n issuer: NonEmptyStringSchema.max(100)\n .optional()\n .meta({\n title: 'Document Issuer',\n description: 'Entity that issued the document',\n examples: [\n 'Environmental Protection Agency',\n 'Waste Management Solutions Ltd',\n 'Green Recycling Corp',\n 'City Waste Authority',\n 'EcoProcess Industries',\n 'Regional Environmental Office',\n ],\n }),\n })\n .meta({\n title: 'Event Document',\n description: 'Supporting event document',\n });\nexport type EventDocumentation = z.infer<typeof EventDocumentSchema>;\n\nconst MassIDChainOfCustodyEventSchema = z\n .strictObject({\n event_id: UuidSchema.meta({\n title: 'Event ID',\n description: 'Unique event identifier',\n }),\n event_name: NonEmptyStringSchema.max(50).meta({\n title: 'Event Name',\n description: 'Name of custody or processing event',\n examples: ['Sorting', 'Processing', 'Recycling', 'Weighing'],\n }),\n description: NonEmptyStringSchema.max(200)\n .optional()\n .meta({\n title: 'Event Description',\n description: 'Detailed description of what happened during this event',\n examples: [\n 'Waste collected from residential area using collection truck',\n 'Material sorted into recyclable and non-recyclable fractions',\n 'Plastic waste processed through shredding and washing',\n 'Waste transferred to authorized recycling facility',\n 'Final disposal at licensed landfill site',\n 'Quality inspection and contamination assessment completed',\n ],\n }),\n timestamp: IsoTimestampSchema.meta({\n title: 'Event Timestamp',\n description: 'ISO 8601 timestamp when the event occurred',\n }),\n participant_id_hash: Sha256HashSchema.meta({\n title: 'Participant ID Hash',\n description: 'Reference to participant in the participants array',\n }),\n location_id_hash: Sha256HashSchema.meta({\n title: 'Location ID Hash',\n description: 'Reference to location in the locations array',\n }),\n weight: NonNegativeFloatSchema.optional().meta({\n title: 'Event Weight',\n description: 'Mass weight after this event',\n }),\n attributes: z.array(EventAttributeSchema).optional().meta({\n title: 'Event Attributes',\n description: 'Additional attributes specific to this event',\n }),\n documentation: z.array(EventDocumentSchema).optional().meta({\n title: 'Event Documentation',\n description: 'Associated documentation for this event',\n }),\n notes: NonEmptyStringSchema.max(500).optional().meta({\n title: 'Event Notes',\n description: 'Additional notes or comments about this event',\n }),\n })\n .meta({\n title: 'Chain of Custody Event',\n description: 'Chain of custody event',\n });\n\nexport type MassIDChainOfCustodyEvent = z.infer<\n typeof MassIDChainOfCustodyEventSchema\n>;\n\nconst MassIDChainOfCustodySchema = z\n .strictObject({\n events: z.array(MassIDChainOfCustodyEventSchema).min(1).meta({\n title: 'Custody Events',\n description:\n 'Chronological sequence of custody transfer and processing events',\n }),\n total_distance_km: NonNegativeFloatSchema.meta({\n title: 'Total Distance (km)',\n description: 'Total distance traveled across all transport events',\n }),\n total_duration_hours: HoursSchema.meta({\n title: 'Total Duration (hours)',\n description: 'Total time from first to last event in hours',\n }),\n })\n .meta({\n title: 'Chain of Custody',\n description:\n 'Complete chain of custody tracking from waste generation to final processing',\n });\n\nexport type MassIDChainOfCustody = z.infer<typeof MassIDChainOfCustodySchema>;\n\nconst MassIDGeographicDataSchema = z\n .strictObject({\n from_location_id_hash: Sha256HashSchema.meta({\n title: 'From Location ID Hash',\n description:\n 'Reference hash of the location where the waste started movement',\n }),\n to_location_id_hash: Sha256HashSchema.meta({\n title: 'To Location ID Hash',\n description:\n 'Reference hash of the location where the waste ended movement',\n }),\n first_reported_timestamp: IsoTimestampSchema.meta({\n title: 'First Reported Timestamp',\n description:\n 'ISO 8601 timestamp when the waste was first reported/collected at the origin location',\n }),\n last_reported_timestamp: IsoTimestampSchema.meta({\n title: 'Last Reported Timestamp',\n description:\n 'ISO 8601 timestamp when the waste was last reported/processed at the destination location',\n }),\n })\n .refine((data) => {\n const first = new Date(data.first_reported_timestamp);\n const last = new Date(data.last_reported_timestamp);\n return first <= last;\n }, 'first_reported_timestamp must be before or equal to last_reported_timestamp')\n .meta({\n title: 'Geographic Data',\n description:\n 'Simplified geographic information tracking waste movement from origin to destination with temporal bounds',\n });\n\nexport type MassIDGeographicData = z.infer<typeof MassIDGeographicDataSchema>;\n\nexport const MassIDDataSchema = z\n .strictObject({\n waste_properties: MassIDWastePropertiesSchema,\n locations: uniqueBy(\n LocationSchema,\n (loc) => loc.id_hash,\n 'Location ID hashes must be unique',\n )\n .min(1)\n .meta({\n title: 'Locations',\n description: 'All locations referenced in this MassID, indexed by ID',\n }),\n participants: uniqueBy(\n ParticipantSchema,\n (p) => p.id_hash,\n 'Participant ID hashes must be unique',\n )\n .min(1)\n .meta({\n title: 'Participants',\n description:\n 'All participants referenced in this MassID, indexed by ID',\n }),\n chain_of_custody: MassIDChainOfCustodySchema,\n geographic_data: MassIDGeographicDataSchema,\n })\n .refine((data) => {\n const participantIdSet = new Set(\n data.participants.map((participant) => participant.id_hash),\n );\n\n const eventParticipantIds = data.chain_of_custody.events.map(\n (event) => event.participant_id_hash,\n );\n\n const allEventParticipantsExist = eventParticipantIds.every(\n (participantId) => participantIdSet.has(participantId),\n );\n\n return allEventParticipantsExist;\n }, 'All participant ID hashes in chain of custody events must exist in participants array')\n\n .refine((data) => {\n const locationIdSet = new Set(\n data.locations.map((location) => location.id_hash),\n );\n\n const eventLocationIds = data.chain_of_custody.events.map(\n (event) => event.location_id_hash,\n );\n\n const allEventLocationsExist = eventLocationIds.every((locationId) =>\n locationIdSet.has(locationId),\n );\n\n return allEventLocationsExist;\n }, 'All location ID hashes in chain of custody events must exist in locations array')\n .meta({\n title: 'MassID Data',\n description:\n 'MassID data containing waste tracking and chain of custody information',\n });\n\nexport type MassIDData = z.infer<typeof MassIDDataSchema>;\n","import { z } from 'zod';\nimport {\n Keccak256HashSchema,\n SemanticVersionSchema,\n Sha256HashSchema,\n IsoTimestampSchema,\n ExternalIdSchema,\n ExternalUrlSchema,\n UuidSchema,\n RecordSchemaTypeSchema,\n IpfsUriSchema,\n RecordRelationshipTypeSchema,\n} from './definitions.schema';\n\nconst SchemaInfoSchema = z\n .strictObject({\n hash: Keccak256HashSchema.meta({\n title: 'Schema Hash',\n description:\n 'Keccak256 hash of the JSON Schema this record was validated against',\n }),\n type: RecordSchemaTypeSchema.meta({\n title: 'Schema Type',\n description: 'Type/category of this schema',\n }),\n version: SemanticVersionSchema.meta({\n title: 'Schema Version',\n description: 'Version of the schema, using semantic versioning',\n }),\n })\n .meta({\n title: 'Schema Information',\n });\n\nexport type SchemaInfo = z.infer<typeof SchemaInfoSchema>;\n\nconst RecordCreatorSchema = z\n .strictObject({\n name: z.string().meta({\n title: 'Creator Name',\n description: 'Company or individual name that created this record',\n examples: ['Carrot Foundation'],\n }),\n id: UuidSchema.meta({\n title: 'Creator ID',\n description: 'Unique identifier for the creator',\n }),\n })\n .meta({\n title: 'Creator',\n description: 'Entity that created this record',\n });\n\nexport type RecordCreator = z.infer<typeof RecordCreatorSchema>;\n\nconst RecordRelationshipSchema = z\n .strictObject({\n target_uri: IpfsUriSchema.meta({\n title: 'Target IPFS URI',\n description: 'Target IPFS URI of the referenced record',\n }),\n type: RecordRelationshipTypeSchema.meta({\n title: 'Relationship Type',\n description: 'Type of relationship to the referenced record',\n }),\n description: z\n .string()\n .optional()\n .meta({\n title: 'Relationship Description',\n description: 'Human-readable description of the relationship',\n examples: [\n 'This record supersedes the previous version',\n 'Related carbon credit batch',\n 'Source document for this verification',\n 'Child record derived from this parent',\n 'Updated version of original record',\n ],\n }),\n })\n .meta({\n title: 'Relationship',\n description: 'Relationship to another IPFS record',\n });\n\nexport type RecordRelationship = z.infer<typeof RecordRelationshipSchema>;\n\nexport const RecordEnvironmentSchema = z\n .strictObject({\n blockchain_network: z.enum(['mainnet', 'testnet']).meta({\n title: 'Blockchain Network',\n description: 'Blockchain Network Environment',\n }),\n deployment: z.enum(['production', 'development', 'testing']).meta({\n title: 'Deployment Environment',\n description: 'System environment where this record was generated',\n }),\n data_set_name: z.enum(['TEST', 'PROD']).meta({\n title: 'Data Set Name',\n description: 'Name of the data set for this record',\n }),\n })\n .meta({\n title: 'Environment',\n description: 'Environment information',\n });\n\nexport type RecordEnvironment = z.infer<typeof RecordEnvironmentSchema>;\n\nexport const BaseIpfsSchema = z\n .strictObject({\n $schema: z.url('Must be a valid URI').meta({\n title: 'JSON Schema URI',\n description: 'URI of the JSON Schema used to validate this record',\n example:\n 'https://raw.githubusercontent.com/carrot-foundation/schemas/refs/heads/main/schemas/ipfs/shared/base/base.schema.json',\n }),\n schema: SchemaInfoSchema,\n created_at: IsoTimestampSchema.meta({\n title: 'Created At',\n description: 'ISO 8601 creation timestamp for this record',\n }),\n external_id: ExternalIdSchema.meta({\n title: 'External ID',\n description: 'Off-chain reference ID (UUID from Carrot backend)',\n }),\n external_url: ExternalUrlSchema.meta({\n title: 'External URL',\n description: 'External URL of the content',\n }),\n original_content_hash: Sha256HashSchema.meta({\n title: 'Original Content Hash',\n description:\n 'SHA-256 hash of the original JSON content including private data before schema validation',\n }),\n content_hash: Sha256HashSchema.meta({\n title: 'Content Hash',\n description:\n 'SHA-256 hash of RFC 8785 canonicalized JSON after schema validation',\n }),\n creator: RecordCreatorSchema.optional(),\n relationships: z.array(RecordRelationshipSchema).optional().meta({\n title: 'Relationships',\n description: 'References to other IPFS records this record relates to',\n }),\n environment: RecordEnvironmentSchema.optional(),\n data: z.record(z.string(), z.unknown()).optional().meta({\n title: 'Custom Data',\n description: \"Custom data block that includes the record's data\",\n }),\n })\n .meta({\n title: 'Base IPFS Record',\n description:\n 'Base fields for all Carrot IPFS records, providing common structure for any JSON content stored in IPFS',\n });\n\nexport type BaseIpfs = z.infer<typeof BaseIpfsSchema>;\n","import { z } from 'zod';\nimport { BaseIpfsSchema } from './base.schema';\nimport {\n EthereumAddressSchema,\n BlockchainChainIdSchema,\n TokenIdSchema,\n IpfsUriSchema,\n HexColorSchema,\n NonNegativeFloatSchema,\n RecordSchemaTypeSchema,\n} from './definitions.schema';\nimport { uniqueBy } from './helpers.schema';\n\nconst NftSchemaTypeSchema = RecordSchemaTypeSchema.extract([\n 'MassID',\n 'RecycledID',\n 'GasID',\n 'PurchaseID',\n]).meta({\n title: 'NFT Schema Type',\n description: 'Type of schema for NFT records',\n});\n\nexport type NftSchemaType = z.infer<typeof NftSchemaTypeSchema>;\n\nconst BlockchainReferenceSchema = z\n .strictObject({\n smart_contract_address: EthereumAddressSchema.meta({\n title: 'Smart Contract Address',\n }),\n chain_id: BlockchainChainIdSchema.meta({\n title: 'Chain ID',\n description: 'Blockchain chain ID',\n }),\n network_name: z.string().min(5).max(100).meta({\n title: 'Network Name',\n description: 'Name of the blockchain network',\n }),\n token_id: TokenIdSchema.meta({\n title: 'Token ID',\n description: 'NFT token ID',\n }),\n })\n .meta({\n title: 'Blockchain Information',\n description: 'Blockchain-specific information for the NFT',\n });\n\nexport type BlockchainReference = z.infer<typeof BlockchainReferenceSchema>;\n\nconst ExternalLinkSchema = z\n .strictObject({\n label: z.string().min(1).max(50).meta({\n title: 'Link Label',\n description: 'Display name for the external link',\n }),\n url: z.url('Must be a valid URI').meta({\n title: 'Link URL',\n description: 'Direct URI to the linked resource',\n }),\n description: z.string().min(10).max(100).optional().meta({\n title: 'Link Description',\n description: 'Optional context about what the link provides',\n }),\n })\n .meta({\n title: 'External Link',\n description: 'External link with label and description',\n });\n\nexport type ExternalLink = z.infer<typeof ExternalLinkSchema>;\n\nconst NftAttributeSchema = z\n .strictObject({\n trait_type: z.string().max(50).meta({\n title: 'Trait Type',\n description: 'Name of the trait or attribute',\n }),\n value: z.union([z.string(), z.number(), z.boolean()]).meta({\n title: 'Trait Value',\n description: 'Value of the trait - can be string, number, or boolean',\n }),\n display_type: z\n .enum(['number', 'date', 'boost_number', 'boost_percentage'])\n .optional()\n .meta({\n title: 'Display Type',\n description: 'How the trait should be displayed in marketplace UIs',\n }),\n max_value: NonNegativeFloatSchema.optional().meta({\n title: 'Max Value',\n description: 'Maximum possible value for numeric traits',\n }),\n })\n .meta({\n title: 'NFT Attribute',\n description: 'NFT attribute or trait with type and value',\n });\n\nexport type NftAttribute = z.infer<typeof NftAttributeSchema>;\n\nexport const NftIpfsSchema = BaseIpfsSchema.safeExtend({\n schema: BaseIpfsSchema.shape.schema.safeExtend({\n type: NftSchemaTypeSchema.meta({\n title: 'NFT Schema Type',\n description: 'Type/category of this NFT schema',\n }),\n }),\n blockchain: BlockchainReferenceSchema,\n name: z\n .string()\n .min(1)\n .max(100)\n .meta({\n title: 'NFT Name',\n description: 'Full display name for this NFT, including extra context',\n examples: [\n 'MassID #123 • Organic • 3.0t',\n 'RecycledID #456 • Plastic • 2.5t',\n 'GasID #789 • Methane • 1000 m³',\n ],\n }),\n short_name: z\n .string()\n .min(1)\n .max(50)\n .meta({\n title: 'Short Name',\n description: 'Compact name for UI summaries, tables, or tooltips',\n examples: ['MassID #123', 'RecycledID #456', 'GasID #789'],\n }),\n description: z\n .string()\n .min(10)\n .max(500)\n .meta({\n title: 'Description',\n description:\n \"Human-readable summary of the NFT's role and context. Ideally, maximum 300 characters.\",\n examples: [\n 'This MassID represents 3 metric tons of organic food waste from Enlatados Produção, tracked through complete chain of custody from generation to composting.',\n 'This RecycledID represents 2.5 metric tons of recycled plastic bottles processed by Green Solutions Ltd.',\n ],\n }),\n image: IpfsUriSchema.meta({\n title: 'Image URI',\n description: 'IPFS URI pointing to the preview image',\n }),\n background_color: HexColorSchema.optional().meta({\n title: 'Background Color',\n description: 'Hex color code for marketplace background display',\n }),\n animation_url: IpfsUriSchema.optional().meta({\n title: 'Animation URL',\n description: 'IPFS URI pointing to an animated or interactive media file',\n examples: [\n 'ipfs://QmAnimation123/mass-id-animation.mp4',\n 'ipfs://QmInteractive456/recycled-visualization.webm',\n ],\n }),\n external_links: uniqueBy(\n ExternalLinkSchema,\n (link) => link.url,\n 'External link URLs must be unique',\n )\n .max(10)\n .optional()\n .meta({\n title: 'External Links',\n description: 'Optional list of public resource links with labels',\n examples: [\n [\n {\n label: 'Carrot Explorer',\n url: 'https://explore.carrot.eco/document/ad44dd3f-f176-4b98-bf78-5ee6e77d0530',\n description: 'Complete chain of custody and audit trail',\n },\n {\n label: 'Carrot White Paper',\n url: 'https://carrot.eco/whitepaper.pdf',\n description: 'Carrot Foundation technical and impact white paper',\n },\n ],\n ],\n }),\n attributes: uniqueBy(\n NftAttributeSchema,\n (attr) => attr.trait_type,\n 'Attribute trait_type values must be unique',\n ).meta({\n title: 'NFT Attributes',\n description:\n 'List of visual traits and filterable attributes compatible with NFT marketplaces',\n examples: [\n [\n {\n trait_type: 'Waste Type',\n value: 'Organic',\n },\n {\n trait_type: 'Waste Subtype',\n value: 'Food, Food Waste and Beverages',\n },\n {\n trait_type: 'Weight (kg)',\n value: 3000,\n display_type: 'number',\n },\n {\n trait_type: 'Origin Country',\n value: 'Brazil',\n },\n {\n trait_type: 'Pick-up Date',\n value: '2024-12-05',\n display_type: 'date',\n },\n ],\n ],\n }),\n}).meta({\n title: 'NFT IPFS Record',\n description: 'NFT-specific fields for Carrot IPFS records',\n});\n\nexport type NftIpfs = z.infer<typeof NftIpfsSchema>;\n","export function getSchemaBaseUrl(): string {\n return `https://raw.githubusercontent.com/carrot-foundation/schemas/refs/tags/${getSchemaVersionOrDefault()}/schemas/ipfs`;\n}\n\nexport function buildSchemaUrl(schemaPath: string): string {\n const cleanPath = schemaPath.startsWith('/')\n ? schemaPath.slice(1)\n : schemaPath;\n return `${getSchemaBaseUrl()}/${cleanPath}`;\n}\n\nexport function getSchemaVersionOrDefault(): string {\n return process.env['SCHEMA_VERSION'] || '0.0.0-dev';\n}\n","import { z } from 'zod';\nimport { NftIpfsSchema } from '../shared/nft.schema';\nimport { MassIDDataSchema } from './mass-id.data.schema';\nimport {\n buildSchemaUrl,\n getSchemaVersionOrDefault,\n} from '../shared/schema-version';\nimport {\n WasteTypeSchema,\n WasteSubtypeSchema,\n WeightKgSchema,\n UnixTimestampSchema,\n} from '../shared/definitions.schema';\n\nconst AttributeWasteTypeSchema = z\n .strictObject({\n trait_type: z.literal('Waste Type'),\n value: WasteTypeSchema,\n })\n .meta({\n title: 'Waste Type Attribute',\n description: 'Waste type attribute',\n });\n\nexport type AttributeWasteType = z.infer<typeof AttributeWasteTypeSchema>;\n\nconst AttributeWasteSubtypeSchema = z\n .strictObject({\n trait_type: z.literal('Waste Subtype'),\n value: WasteSubtypeSchema,\n })\n .meta({\n title: 'Waste Subtype Attribute',\n description: 'Waste subtype attribute',\n });\n\nexport type AttributeWasteSubtype = z.infer<typeof AttributeWasteSubtypeSchema>;\n\nconst AttributeWeightSchema = z\n .strictObject({\n trait_type: z.literal('Weight (kg)'),\n value: WeightKgSchema,\n display_type: z.literal('number'),\n })\n .meta({\n title: 'Weight Attribute',\n description: 'Weight attribute with numeric display',\n });\n\nexport type AttributeWeight = z.infer<typeof AttributeWeightSchema>;\n\nconst AttributeOriginCountrySchema = z\n .strictObject({\n trait_type: z.literal('Origin Country'),\n value: z.string().max(100).meta({\n title: 'Origin Country Value',\n description: 'Country where the waste was generated',\n }),\n })\n .meta({\n title: 'Origin Country Attribute',\n description: 'Origin country attribute',\n });\n\nexport type AttributeOriginCountry = z.infer<\n typeof AttributeOriginCountrySchema\n>;\n\nconst AttributeOriginMunicipalitySchema = z\n .strictObject({\n trait_type: z.literal('Origin Municipality'),\n value: z.string().max(100).meta({\n title: 'Origin Municipality Value',\n description: 'Municipality where the waste was generated',\n }),\n })\n .meta({\n title: 'Origin Municipality Attribute',\n description: 'Origin municipality attribute',\n });\n\nexport type AttributeOriginMunicipality = z.infer<\n typeof AttributeOriginMunicipalitySchema\n>;\n\nconst AttributeOriginDivisionSchema = z\n .strictObject({\n trait_type: z.literal('Origin Administrative Division'),\n value: z.string().max(100).meta({\n title: 'Origin Division Value',\n description:\n 'Administrative division (state/province) where the waste was generated',\n }),\n })\n .meta({\n title: 'Origin Administrative Division Attribute',\n description: 'Origin administrative division attribute',\n });\n\nexport type AttributeOriginDivision = z.infer<\n typeof AttributeOriginDivisionSchema\n>;\n\nconst AttributeRecyclerSchema = z\n .strictObject({\n trait_type: z.literal('Recycler'),\n value: z.string().max(100).meta({\n title: 'Recycler Value',\n description: 'Organization that processed the waste',\n }),\n })\n .meta({\n title: 'Recycler Attribute',\n description: 'Recycler attribute',\n });\n\nexport type AttributeRecycler = z.infer<typeof AttributeRecyclerSchema>;\n\nconst AttributeIntegratorSchema = z\n .strictObject({\n trait_type: z.literal('Integrator'),\n value: z.string().max(100).meta({\n title: 'Integrator Value',\n description:\n 'Organization that integrated the waste into the Carrot network',\n }),\n })\n .meta({\n title: 'Integrator Attribute',\n description: 'Integrator attribute',\n });\n\nexport type AttributeIntegrator = z.infer<typeof AttributeIntegratorSchema>;\n\nconst AttributePickUpDateSchema = z\n .strictObject({\n trait_type: z.literal('Pick-up Date'),\n value: UnixTimestampSchema.meta({\n title: 'Pick-up Date Value',\n description:\n 'Unix timestamp in milliseconds when the waste was picked up from the source',\n }),\n display_type: z.literal('date'),\n })\n .meta({\n title: 'Pick-up Date Attribute',\n description: 'Pick-up date attribute with Unix timestamp',\n });\n\nexport type AttributePickUpDate = z.infer<typeof AttributePickUpDateSchema>;\n\nconst AttributeRecyclingDateSchema = z\n .strictObject({\n trait_type: z.literal('Recycling Date'),\n value: z\n .string()\n .regex(/^\\d{4}-\\d{2}-\\d{2}$/, 'Must be a valid date in YYYY-MM-DD format')\n .meta({\n title: 'Recycling Date Value',\n description: 'Date when the waste was recycled/processed',\n }),\n display_type: z.literal('date'),\n })\n .meta({\n title: 'Recycling Date Attribute',\n description: 'Recycling date attribute',\n });\n\nexport type AttributeRecyclingDate = z.infer<\n typeof AttributeRecyclingDateSchema\n>;\n\nconst MassIDAttributesSchema = z\n .tuple([\n AttributeWasteTypeSchema,\n AttributeWasteSubtypeSchema,\n AttributeWeightSchema,\n AttributeOriginCountrySchema,\n AttributeOriginMunicipalitySchema,\n AttributeOriginDivisionSchema,\n AttributeRecyclerSchema,\n AttributeIntegratorSchema,\n AttributePickUpDateSchema,\n AttributeRecyclingDateSchema,\n ])\n .meta({\n title: 'MassID Attributes',\n description: 'Fixed set of MassID NFT attributes in required order',\n });\n\nexport type MassIDAttributes = z.infer<typeof MassIDAttributesSchema>;\n\nexport const MassIDIpfsSchemaMeta = {\n title: 'MassID NFT IPFS Record',\n description:\n 'Complete MassID NFT IPFS record including fixed attributes and detailed waste tracking data',\n $id: buildSchemaUrl('mass-id/mass-id.schema.json'),\n version: getSchemaVersionOrDefault(),\n} as const;\n\nexport const MassIDIpfsSchema = NftIpfsSchema.safeExtend({\n schema: NftIpfsSchema.shape.schema.safeExtend({\n type: z.literal('MassID').meta({\n title: 'MassID Schema Type',\n description: 'MassID NFT schema type',\n }),\n }),\n attributes: MassIDAttributesSchema.meta({\n title: 'MassID NFT Attributes',\n description:\n 'Fixed set of MassID NFT attributes enforcing order and type for each trait',\n }).check(z.minLength(10), z.maxLength(10)),\n data: MassIDDataSchema.meta({\n title: 'MassID Data',\n description:\n 'MassID-specific data containing waste tracking and chain of custody information',\n }),\n}).meta(MassIDIpfsSchemaMeta);\n\nexport type MassIDIpfs = z.infer<typeof MassIDIpfsSchema>;\n"]}