@carrot-foundation/schemas 0.1.30 → 0.1.32
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/README.md +6 -6
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +4 -1
- package/schemas/ipfs/mass-id/mass-id.schema.json +2 -2
package/README.md
CHANGED
|
@@ -19,15 +19,15 @@ This project uses automated schema reference versioning with a **unified version
|
|
|
19
19
|
### How It Works
|
|
20
20
|
|
|
21
21
|
- **All builds**: Schemas reference `refs/tags/{version}` where version is set via `SCHEMA_VERSION` environment variable
|
|
22
|
-
- **Default version**: If `SCHEMA_VERSION` is not set, defaults to `
|
|
22
|
+
- **Default version**: If `SCHEMA_VERSION` is not set, defaults to the version from `package.json`
|
|
23
23
|
- **No special cases**: Development and production use the exact same versioning mechanism
|
|
24
24
|
|
|
25
25
|
### Local Development
|
|
26
26
|
|
|
27
|
-
For local development, the
|
|
27
|
+
For local development, the version from `package.json` is used automatically:
|
|
28
28
|
|
|
29
29
|
```bash
|
|
30
|
-
# Build with
|
|
30
|
+
# Build with package.json version as default
|
|
31
31
|
pnpm build
|
|
32
32
|
pnpm generate-ipfs-schemas
|
|
33
33
|
```
|
|
@@ -58,13 +58,13 @@ All of this happens automatically via the GitHub Actions workflow when you push
|
|
|
58
58
|
|
|
59
59
|
### Example Schema References
|
|
60
60
|
|
|
61
|
-
**Development (default):**
|
|
61
|
+
**Development (uses package.json version by default):**
|
|
62
62
|
|
|
63
63
|
```json
|
|
64
|
-
"$id": "https://raw.githubusercontent.com/carrot-foundation/schemas/refs/tags/0.
|
|
64
|
+
"$id": "https://raw.githubusercontent.com/carrot-foundation/schemas/refs/tags/0.1.28/schemas/ipfs/mass-id/mass-id.schema.json"
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
-
**Production (versioned):**
|
|
67
|
+
**Production (versioned via SCHEMA_VERSION env var):**
|
|
68
68
|
|
|
69
69
|
```json
|
|
70
70
|
"$id": "https://raw.githubusercontent.com/carrot-foundation/schemas/refs/tags/1.2.3/schemas/ipfs/mass-id/mass-id.schema.json"
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var zod = require('zod');
|
|
4
|
+
require('fs');
|
|
5
|
+
require('path');
|
|
4
6
|
|
|
5
7
|
// src/mass-id/mass-id.attributes.ts
|
|
6
8
|
var UuidSchema = zod.z.uuidv4("Must be a valid UUID v4 string").meta({
|
|
@@ -1140,8 +1142,6 @@ var MassIDDataSchema = zod.z.strictObject({
|
|
|
1140
1142
|
title: "MassID Data",
|
|
1141
1143
|
description: "MassID data containing waste tracking and chain of custody information"
|
|
1142
1144
|
});
|
|
1143
|
-
|
|
1144
|
-
// src/shared/schema-version.ts
|
|
1145
1145
|
function getSchemaBaseUrl() {
|
|
1146
1146
|
return `https://raw.githubusercontent.com/carrot-foundation/schemas/refs/tags/${getSchemaVersionOrDefault()}/schemas/ipfs`;
|
|
1147
1147
|
}
|
|
@@ -1150,7 +1150,7 @@ function buildSchemaUrl(schemaPath) {
|
|
|
1150
1150
|
return `${getSchemaBaseUrl()}/${cleanPath}`;
|
|
1151
1151
|
}
|
|
1152
1152
|
function getSchemaVersionOrDefault() {
|
|
1153
|
-
return "0.
|
|
1153
|
+
return "0.1.32";
|
|
1154
1154
|
}
|
|
1155
1155
|
|
|
1156
1156
|
// src/mass-id/mass-id.schema.ts
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/shared/definitions.schema.ts","../src/shared/base.schema.ts","../src/shared/helpers.schema.ts","../src/shared/nft.schema.ts","../src/mass-id/mass-id.attributes.ts","../src/shared/entities/location.schema.ts","../src/shared/entities/participant.schema.ts","../src/mass-id/mass-id.data.schema.ts","../src/shared/schema-version.ts","../src/mass-id/mass-id.schema.ts"],"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W,KAAA,CAAM,CAAC,CAAA,GAClB,UAAA;AACJ,EAAA,OAAO,CAAA,EAAG,gBAAA,EAAkB,CAAA,CAAA,EAAI,SAAS,CAAA,CAAA;AAC3C;AAEO,SAAS,yBAAA,GAAoC;AAClD,EAAA,OAAO,WAAA;AACT;;;ACJO,IAAM,oBAAA,GAAuB;AAAA,EAClC,KAAA,EAAO,wBAAA;AAAA,EACP,WAAA,EACE,6FAAA;AAAA,EACF,GAAA,EAAK,eAAe,6BAA6B,CAAA;AAAA,EACjD,SAAS,yBAAA;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,sBAAA;AAAA,EACZ,IAAA,EAAM;AACR,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.max(100).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 MinutesSchema = z\n .number()\n .int()\n .min(0)\n .meta({\n title: 'Minutes',\n description: 'Time duration in minutes',\n examples: [4350, 1440, 10110],\n });\n\nexport type Minutes = z.infer<typeof MinutesSchema>;\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 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';\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 { 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\nexport const 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","import { z } from 'zod';\nimport {\n WasteTypeSchema,\n WasteSubtypeSchema,\n WeightKgSchema,\n UnixTimestampSchema,\n NonEmptyStringSchema,\n HoursSchema,\n} from '../shared/definitions.schema';\nimport { NftAttributeSchema } from '../shared/nft.schema';\nimport { uniqueBy } from '../shared/helpers.schema';\n\nconst MassIDAttributeWasteTypeSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Waste Type'),\n value: WasteTypeSchema,\n}).meta({\n title: 'Waste Type Attribute',\n description: 'Waste type attribute',\n});\n\nexport type MassIDAttributeWasteType = z.infer<\n typeof MassIDAttributeWasteTypeSchema\n>;\n\nconst MassIDAttributeWasteSubtypeSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Waste Subtype'),\n value: WasteSubtypeSchema,\n}).meta({\n title: 'Waste Subtype Attribute',\n description: 'Waste subtype attribute',\n});\n\nexport type MassIDAttributeWasteSubtype = z.infer<\n typeof MassIDAttributeWasteSubtypeSchema\n>;\n\nconst MassIDAttributeWeightSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Weight (kg)'),\n value: WeightKgSchema,\n display_type: z.literal('number'),\n}).meta({\n title: 'Weight Attribute',\n description: 'Weight attribute with numeric display',\n});\n\nexport type MassIDAttributeWeight = z.infer<typeof MassIDAttributeWeightSchema>;\n\nconst MassIDAttributeOriginCountrySchema = NftAttributeSchema.extend({\n trait_type: z.literal('Origin Country'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Origin Country Value',\n description: 'Country where the waste was generated',\n examples: ['Brazil', 'United States', 'Germany', 'Japan'],\n }),\n}).meta({\n title: 'Origin Country Attribute',\n description: 'Origin country attribute',\n});\n\nexport type MassIDAttributeOriginCountry = z.infer<\n typeof MassIDAttributeOriginCountrySchema\n>;\n\nconst MassIDAttributeOriginMunicipalitySchema = NftAttributeSchema.extend({\n trait_type: z.literal('Origin Municipality'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Origin Municipality Value',\n description: 'Municipality where the waste was generated',\n examples: ['São Paulo', 'New York', 'Berlin', 'Tokyo'],\n }),\n}).meta({\n title: 'Origin Municipality Attribute',\n description: 'Origin municipality attribute',\n});\n\nexport type MassIDAttributeOriginMunicipality = z.infer<\n typeof MassIDAttributeOriginMunicipalitySchema\n>;\n\nconst MassIDAttributeOriginDivisionSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Origin Administrative Division'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Origin Division Value',\n description:\n 'Administrative division (state/province) where the waste was generated',\n examples: ['São Paulo', 'California', 'Bavaria'],\n }),\n}).meta({\n title: 'Origin Administrative Division Attribute',\n description: 'Origin administrative division attribute',\n});\n\nexport type MassIDAttributeOriginDivision = z.infer<\n typeof MassIDAttributeOriginDivisionSchema\n>;\n\nconst MassIDAttributeVehicleTypeSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Vehicle Type'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Vehicle Type Value',\n description: 'Type of vehicle used for waste transportation',\n examples: ['Garbage Truck', 'Box Truck', 'Flatbed Truck', 'Roll-off Truck'],\n }),\n}).meta({\n title: 'Vehicle Type Attribute',\n description: 'Vehicle type attribute',\n});\n\nexport type MassIDAttributeVehicleType = z.infer<\n typeof MassIDAttributeVehicleTypeSchema\n>;\n\nconst MassIDAttributeRecyclingMethodSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Recycling Method'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Recycling Method Value',\n description: 'Method used for recycling or processing the waste',\n examples: [\n 'Composting',\n 'Mechanical Recycling',\n 'Incineration with Energy Recovery',\n ],\n }),\n}).meta({\n title: 'Recycling Method Attribute',\n description: 'Recycling method attribute',\n});\n\nexport type MassIDAttributeRecyclingMethod = z.infer<\n typeof MassIDAttributeRecyclingMethodSchema\n>;\n\nconst MassIDAttributeProcessingTimeSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Processing Time (hours)'),\n value: HoursSchema,\n trait_description: NonEmptyStringSchema.max(200).optional().meta({\n title: 'Processing Time Description',\n description: 'Custom description for the processing time',\n }),\n}).meta({\n title: 'Processing Time Attribute',\n description: 'Processing time attribute with optional trait description',\n});\n\nexport type MassIDAttributeProcessingTime = z.infer<\n typeof MassIDAttributeProcessingTimeSchema\n>;\n\nconst MassIDAttributeLocalWasteClassificationIdSchema =\n NftAttributeSchema.extend({\n trait_type: z.literal('Local Waste Classification ID'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Local Waste Classification ID Value',\n description: 'Local or regional waste classification identifier',\n examples: ['04 02 20', 'IBAMA-A001', 'EWC-150101'],\n }),\n }).meta({\n title: 'Local Waste Classification ID Attribute',\n description: 'Local waste classification ID attribute',\n });\n\nexport type MassIDAttributeLocalWasteClassificationId = z.infer<\n typeof MassIDAttributeLocalWasteClassificationIdSchema\n>;\n\nconst MassIDAttributeRecyclingManifestCodeSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Recycling Manifest Code'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Recycling Manifest Code Value',\n description:\n 'Concatenated recycling manifest code (Document Type + Document Number)',\n examples: ['CDF-2353', 'RC-12345', 'REC-MANIFEST-789'],\n }),\n}).meta({\n title: 'Recycling Manifest Code Attribute',\n description: 'Recycling manifest code attribute (optional)',\n});\n\nexport type MassIDAttributeRecyclingManifestCode = z.infer<\n typeof MassIDAttributeRecyclingManifestCodeSchema\n>;\n\nconst MassIDAttributeTransportManifestCodeSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Transport Manifest Code'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Transport Manifest Code Value',\n description:\n 'Concatenated transport manifest code (Document Type + Document Number)',\n examples: ['MTR-4126', 'TRN-67890', 'TRANS-MANIFEST-456'],\n }),\n}).meta({\n title: 'Transport Manifest Code Attribute',\n description: 'Transport manifest code attribute (optional)',\n});\n\nexport type MassIDAttributeTransportManifestCode = z.infer<\n typeof MassIDAttributeTransportManifestCodeSchema\n>;\n\nconst MassIDAttributeWeighingCaptureMethodSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Weighing Capture Method'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Weighing Capture Method Value',\n description: 'Method used to capture weight data',\n examples: ['Digital', 'Manual', 'Automated', 'Electronic Scale'],\n }),\n}).meta({\n title: 'Weighing Capture Method Attribute',\n description: 'Weighing capture method attribute (optional)',\n});\n\nexport type MassIDAttributeWeighingCaptureMethod = z.infer<\n typeof MassIDAttributeWeighingCaptureMethodSchema\n>;\n\nconst MassIDAttributeScaleTypeSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Scale Type'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Scale Type Value',\n description: 'Type of scale used for weighing',\n examples: [\n 'Weighbridge (Truck Scale)',\n 'Floor Scale',\n 'Bench Scale',\n 'Crane Scale',\n ],\n }),\n}).meta({\n title: 'Scale Type Attribute',\n description: 'Scale type attribute (optional)',\n});\n\nexport type MassIDAttributeScaleType = z.infer<\n typeof MassIDAttributeScaleTypeSchema\n>;\n\nconst MassIDAttributeContainerTypeSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Container Type'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Container Type Value',\n description: 'Type of container used for waste storage or transport',\n examples: ['Truck', 'Dumpster', 'Roll-off Container', 'Compactor', 'Bin'],\n }),\n}).meta({\n title: 'Container Type Attribute',\n description: 'Container type attribute (optional)',\n});\n\nexport type MassIDAttributeContainerType = z.infer<\n typeof MassIDAttributeContainerTypeSchema\n>;\n\nconst MassIDAttributePickUpDateSchema = NftAttributeSchema.extend({\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 examples: [1710518400000, 1704067200000, 1715270400000],\n }),\n display_type: z.literal('date'),\n}).meta({\n title: 'Pick-up Date Attribute',\n description: 'Pick-up date attribute with Unix timestamp',\n});\n\nexport type MassIDAttributePickUpDate = z.infer<\n typeof MassIDAttributePickUpDateSchema\n>;\n\nconst MassIDAttributeRecyclingDateSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Recycling Date'),\n value: UnixTimestampSchema.meta({\n title: 'Recycling Date Value',\n description:\n 'Unix timestamp in milliseconds when the waste was recycled/processed',\n examples: [1710604800000, 1704153600000, 1715356800000],\n }),\n display_type: z.literal('date'),\n}).meta({\n title: 'Recycling Date Attribute',\n description: 'Recycling date attribute with Unix timestamp',\n});\n\nexport type MassIDAttributeRecyclingDate = z.infer<\n typeof MassIDAttributeRecyclingDateSchema\n>;\n\nexport const MassIDAttributesSchema = uniqueBy(\n z.union([\n MassIDAttributeWasteTypeSchema,\n MassIDAttributeWasteSubtypeSchema,\n MassIDAttributeWeightSchema,\n MassIDAttributeOriginCountrySchema,\n MassIDAttributeOriginMunicipalitySchema,\n MassIDAttributeOriginDivisionSchema,\n MassIDAttributeVehicleTypeSchema,\n MassIDAttributeRecyclingMethodSchema,\n MassIDAttributeProcessingTimeSchema,\n MassIDAttributeLocalWasteClassificationIdSchema,\n MassIDAttributeRecyclingManifestCodeSchema,\n MassIDAttributeTransportManifestCodeSchema,\n MassIDAttributeWeighingCaptureMethodSchema,\n MassIDAttributeScaleTypeSchema,\n MassIDAttributeContainerTypeSchema,\n MassIDAttributePickUpDateSchema,\n MassIDAttributeRecyclingDateSchema,\n ]),\n (attr) => attr.trait_type,\n)\n .min(12)\n .max(17)\n .meta({\n title: 'MassID Attributes',\n description:\n 'MassID NFT attributes array containing attributes selected from the available attribute types. The schema validates array length but does not enforce which specific attributes must be present.',\n });\n\nexport type MassIDAttributes = z.infer<typeof MassIDAttributesSchema>;\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';\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 UnixTimestampSchema,\n MinutesSchema,\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 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 })\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 EventAttachmentSchema = z\n .strictObject({\n type: NonEmptyStringSchema.max(50).meta({\n title: 'Attachment Type',\n description: 'Type of supporting attachment',\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: 'Attachment Reference',\n description:\n 'Reference to attachment (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_timestamp: UnixTimestampSchema.optional().meta({\n title: 'Issue Timestamp',\n description:\n 'Unix timestamp in milliseconds when the attachment was issued',\n examples: [1710518400000, 1704067200000, 1715270400000],\n }),\n issuer: NonEmptyStringSchema.max(100)\n .optional()\n .meta({\n title: 'Attachment Issuer',\n description: 'Entity that issued the attachment',\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 Attachment',\n description: 'Supporting event attachment',\n });\nexport type EventAttachment = z.infer<typeof EventAttachmentSchema>;\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: UnixTimestampSchema.meta({\n title: 'Event Timestamp',\n description: 'Unix timestamp in milliseconds when the event occurred',\n examples: [1710518400000, 1704067200000, 1715270400000],\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 attachments: z.array(EventAttachmentSchema).optional().meta({\n title: 'Event Attachments',\n description: 'Associated attachments for 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_duration_minutes: MinutesSchema.meta({\n title: 'Total Duration (minutes)',\n description: 'Total time from first to last event in minutes',\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: UnixTimestampSchema.meta({\n title: 'First Reported Timestamp',\n description:\n 'Unix timestamp in milliseconds when the waste was first reported/collected at the origin location',\n examples: [1710518400000, 1704067200000, 1715270400000],\n }),\n last_reported_timestamp: UnixTimestampSchema.meta({\n title: 'Last Reported Timestamp',\n description:\n 'Unix timestamp in milliseconds when the waste was last reported/processed at the destination location',\n examples: [1710604800000, 1704153600000, 1715356800000],\n }),\n })\n .refine((data) => {\n return data.first_reported_timestamp <= data.last_reported_timestamp;\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","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 { MassIDAttributesSchema } from './mass-id.attributes';\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,\n data: MassIDDataSchema,\n}).meta(MassIDIpfsSchemaMeta);\n\nexport type MassIDIpfs = z.infer<typeof MassIDIpfsSchema>;\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/shared/definitions.schema.ts","../src/shared/base.schema.ts","../src/shared/helpers.schema.ts","../src/shared/nft.schema.ts","../src/mass-id/mass-id.attributes.ts","../src/shared/entities/location.schema.ts","../src/shared/entities/participant.schema.ts","../src/mass-id/mass-id.data.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;AA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O,SAAS,yBAAA,GAAoC;AAClD,EAAA,OAAO,QAAA;AACT;;;ACjBO,IAAM,oBAAA,GAAuB;AAAA,EAClC,KAAA,EAAO,wBAAA;AAAA,EACP,WAAA,EACE,6FAAA;AAAA,EACF,GAAA,EAAK,eAAe,6BAA6B,CAAA;AAAA,EACjD,SAAS,yBAAA;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,sBAAA;AAAA,EACZ,IAAA,EAAM;AACR,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.max(100).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 MinutesSchema = z\n .number()\n .int()\n .min(0)\n .meta({\n title: 'Minutes',\n description: 'Time duration in minutes',\n examples: [4350, 1440, 10110],\n });\n\nexport type Minutes = z.infer<typeof MinutesSchema>;\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 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';\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 { 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\nexport const 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","import { z } from 'zod';\nimport {\n WasteTypeSchema,\n WasteSubtypeSchema,\n WeightKgSchema,\n UnixTimestampSchema,\n NonEmptyStringSchema,\n HoursSchema,\n} from '../shared/definitions.schema';\nimport { NftAttributeSchema } from '../shared/nft.schema';\nimport { uniqueBy } from '../shared/helpers.schema';\n\nconst MassIDAttributeWasteTypeSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Waste Type'),\n value: WasteTypeSchema,\n}).meta({\n title: 'Waste Type Attribute',\n description: 'Waste type attribute',\n});\n\nexport type MassIDAttributeWasteType = z.infer<\n typeof MassIDAttributeWasteTypeSchema\n>;\n\nconst MassIDAttributeWasteSubtypeSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Waste Subtype'),\n value: WasteSubtypeSchema,\n}).meta({\n title: 'Waste Subtype Attribute',\n description: 'Waste subtype attribute',\n});\n\nexport type MassIDAttributeWasteSubtype = z.infer<\n typeof MassIDAttributeWasteSubtypeSchema\n>;\n\nconst MassIDAttributeWeightSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Weight (kg)'),\n value: WeightKgSchema,\n display_type: z.literal('number'),\n}).meta({\n title: 'Weight Attribute',\n description: 'Weight attribute with numeric display',\n});\n\nexport type MassIDAttributeWeight = z.infer<typeof MassIDAttributeWeightSchema>;\n\nconst MassIDAttributeOriginCountrySchema = NftAttributeSchema.extend({\n trait_type: z.literal('Origin Country'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Origin Country Value',\n description: 'Country where the waste was generated',\n examples: ['Brazil', 'United States', 'Germany', 'Japan'],\n }),\n}).meta({\n title: 'Origin Country Attribute',\n description: 'Origin country attribute',\n});\n\nexport type MassIDAttributeOriginCountry = z.infer<\n typeof MassIDAttributeOriginCountrySchema\n>;\n\nconst MassIDAttributeOriginMunicipalitySchema = NftAttributeSchema.extend({\n trait_type: z.literal('Origin Municipality'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Origin Municipality Value',\n description: 'Municipality where the waste was generated',\n examples: ['São Paulo', 'New York', 'Berlin', 'Tokyo'],\n }),\n}).meta({\n title: 'Origin Municipality Attribute',\n description: 'Origin municipality attribute',\n});\n\nexport type MassIDAttributeOriginMunicipality = z.infer<\n typeof MassIDAttributeOriginMunicipalitySchema\n>;\n\nconst MassIDAttributeOriginDivisionSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Origin Administrative Division'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Origin Division Value',\n description:\n 'Administrative division (state/province) where the waste was generated',\n examples: ['São Paulo', 'California', 'Bavaria'],\n }),\n}).meta({\n title: 'Origin Administrative Division Attribute',\n description: 'Origin administrative division attribute',\n});\n\nexport type MassIDAttributeOriginDivision = z.infer<\n typeof MassIDAttributeOriginDivisionSchema\n>;\n\nconst MassIDAttributeVehicleTypeSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Vehicle Type'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Vehicle Type Value',\n description: 'Type of vehicle used for waste transportation',\n examples: ['Garbage Truck', 'Box Truck', 'Flatbed Truck', 'Roll-off Truck'],\n }),\n}).meta({\n title: 'Vehicle Type Attribute',\n description: 'Vehicle type attribute',\n});\n\nexport type MassIDAttributeVehicleType = z.infer<\n typeof MassIDAttributeVehicleTypeSchema\n>;\n\nconst MassIDAttributeRecyclingMethodSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Recycling Method'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Recycling Method Value',\n description: 'Method used for recycling or processing the waste',\n examples: [\n 'Composting',\n 'Mechanical Recycling',\n 'Incineration with Energy Recovery',\n ],\n }),\n}).meta({\n title: 'Recycling Method Attribute',\n description: 'Recycling method attribute',\n});\n\nexport type MassIDAttributeRecyclingMethod = z.infer<\n typeof MassIDAttributeRecyclingMethodSchema\n>;\n\nconst MassIDAttributeProcessingTimeSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Processing Time (hours)'),\n value: HoursSchema,\n trait_description: NonEmptyStringSchema.max(200).optional().meta({\n title: 'Processing Time Description',\n description: 'Custom description for the processing time',\n }),\n}).meta({\n title: 'Processing Time Attribute',\n description: 'Processing time attribute with optional trait description',\n});\n\nexport type MassIDAttributeProcessingTime = z.infer<\n typeof MassIDAttributeProcessingTimeSchema\n>;\n\nconst MassIDAttributeLocalWasteClassificationIdSchema =\n NftAttributeSchema.extend({\n trait_type: z.literal('Local Waste Classification ID'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Local Waste Classification ID Value',\n description: 'Local or regional waste classification identifier',\n examples: ['04 02 20', 'IBAMA-A001', 'EWC-150101'],\n }),\n }).meta({\n title: 'Local Waste Classification ID Attribute',\n description: 'Local waste classification ID attribute',\n });\n\nexport type MassIDAttributeLocalWasteClassificationId = z.infer<\n typeof MassIDAttributeLocalWasteClassificationIdSchema\n>;\n\nconst MassIDAttributeRecyclingManifestCodeSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Recycling Manifest Code'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Recycling Manifest Code Value',\n description:\n 'Concatenated recycling manifest code (Document Type + Document Number)',\n examples: ['CDF-2353', 'RC-12345', 'REC-MANIFEST-789'],\n }),\n}).meta({\n title: 'Recycling Manifest Code Attribute',\n description: 'Recycling manifest code attribute (optional)',\n});\n\nexport type MassIDAttributeRecyclingManifestCode = z.infer<\n typeof MassIDAttributeRecyclingManifestCodeSchema\n>;\n\nconst MassIDAttributeTransportManifestCodeSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Transport Manifest Code'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Transport Manifest Code Value',\n description:\n 'Concatenated transport manifest code (Document Type + Document Number)',\n examples: ['MTR-4126', 'TRN-67890', 'TRANS-MANIFEST-456'],\n }),\n}).meta({\n title: 'Transport Manifest Code Attribute',\n description: 'Transport manifest code attribute (optional)',\n});\n\nexport type MassIDAttributeTransportManifestCode = z.infer<\n typeof MassIDAttributeTransportManifestCodeSchema\n>;\n\nconst MassIDAttributeWeighingCaptureMethodSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Weighing Capture Method'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Weighing Capture Method Value',\n description: 'Method used to capture weight data',\n examples: ['Digital', 'Manual', 'Automated', 'Electronic Scale'],\n }),\n}).meta({\n title: 'Weighing Capture Method Attribute',\n description: 'Weighing capture method attribute (optional)',\n});\n\nexport type MassIDAttributeWeighingCaptureMethod = z.infer<\n typeof MassIDAttributeWeighingCaptureMethodSchema\n>;\n\nconst MassIDAttributeScaleTypeSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Scale Type'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Scale Type Value',\n description: 'Type of scale used for weighing',\n examples: [\n 'Weighbridge (Truck Scale)',\n 'Floor Scale',\n 'Bench Scale',\n 'Crane Scale',\n ],\n }),\n}).meta({\n title: 'Scale Type Attribute',\n description: 'Scale type attribute (optional)',\n});\n\nexport type MassIDAttributeScaleType = z.infer<\n typeof MassIDAttributeScaleTypeSchema\n>;\n\nconst MassIDAttributeContainerTypeSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Container Type'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Container Type Value',\n description: 'Type of container used for waste storage or transport',\n examples: ['Truck', 'Dumpster', 'Roll-off Container', 'Compactor', 'Bin'],\n }),\n}).meta({\n title: 'Container Type Attribute',\n description: 'Container type attribute (optional)',\n});\n\nexport type MassIDAttributeContainerType = z.infer<\n typeof MassIDAttributeContainerTypeSchema\n>;\n\nconst MassIDAttributePickUpDateSchema = NftAttributeSchema.extend({\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 examples: [1710518400000, 1704067200000, 1715270400000],\n }),\n display_type: z.literal('date'),\n}).meta({\n title: 'Pick-up Date Attribute',\n description: 'Pick-up date attribute with Unix timestamp',\n});\n\nexport type MassIDAttributePickUpDate = z.infer<\n typeof MassIDAttributePickUpDateSchema\n>;\n\nconst MassIDAttributeRecyclingDateSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Recycling Date'),\n value: UnixTimestampSchema.meta({\n title: 'Recycling Date Value',\n description:\n 'Unix timestamp in milliseconds when the waste was recycled/processed',\n examples: [1710604800000, 1704153600000, 1715356800000],\n }),\n display_type: z.literal('date'),\n}).meta({\n title: 'Recycling Date Attribute',\n description: 'Recycling date attribute with Unix timestamp',\n});\n\nexport type MassIDAttributeRecyclingDate = z.infer<\n typeof MassIDAttributeRecyclingDateSchema\n>;\n\nexport const MassIDAttributesSchema = uniqueBy(\n z.union([\n MassIDAttributeWasteTypeSchema,\n MassIDAttributeWasteSubtypeSchema,\n MassIDAttributeWeightSchema,\n MassIDAttributeOriginCountrySchema,\n MassIDAttributeOriginMunicipalitySchema,\n MassIDAttributeOriginDivisionSchema,\n MassIDAttributeVehicleTypeSchema,\n MassIDAttributeRecyclingMethodSchema,\n MassIDAttributeProcessingTimeSchema,\n MassIDAttributeLocalWasteClassificationIdSchema,\n MassIDAttributeRecyclingManifestCodeSchema,\n MassIDAttributeTransportManifestCodeSchema,\n MassIDAttributeWeighingCaptureMethodSchema,\n MassIDAttributeScaleTypeSchema,\n MassIDAttributeContainerTypeSchema,\n MassIDAttributePickUpDateSchema,\n MassIDAttributeRecyclingDateSchema,\n ]),\n (attr) => attr.trait_type,\n)\n .min(12)\n .max(17)\n .meta({\n title: 'MassID Attributes',\n description:\n 'MassID NFT attributes array containing attributes selected from the available attribute types. The schema validates array length but does not enforce which specific attributes must be present.',\n });\n\nexport type MassIDAttributes = z.infer<typeof MassIDAttributesSchema>;\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';\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 UnixTimestampSchema,\n MinutesSchema,\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 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 })\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 EventAttachmentSchema = z\n .strictObject({\n type: NonEmptyStringSchema.max(50).meta({\n title: 'Attachment Type',\n description: 'Type of supporting attachment',\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: 'Attachment Reference',\n description:\n 'Reference to attachment (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_timestamp: UnixTimestampSchema.optional().meta({\n title: 'Issue Timestamp',\n description:\n 'Unix timestamp in milliseconds when the attachment was issued',\n examples: [1710518400000, 1704067200000, 1715270400000],\n }),\n issuer: NonEmptyStringSchema.max(100)\n .optional()\n .meta({\n title: 'Attachment Issuer',\n description: 'Entity that issued the attachment',\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 Attachment',\n description: 'Supporting event attachment',\n });\nexport type EventAttachment = z.infer<typeof EventAttachmentSchema>;\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: UnixTimestampSchema.meta({\n title: 'Event Timestamp',\n description: 'Unix timestamp in milliseconds when the event occurred',\n examples: [1710518400000, 1704067200000, 1715270400000],\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 attachments: z.array(EventAttachmentSchema).optional().meta({\n title: 'Event Attachments',\n description: 'Associated attachments for 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_duration_minutes: MinutesSchema.meta({\n title: 'Total Duration (minutes)',\n description: 'Total time from first to last event in minutes',\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: UnixTimestampSchema.meta({\n title: 'First Reported Timestamp',\n description:\n 'Unix timestamp in milliseconds when the waste was first reported/collected at the origin location',\n examples: [1710518400000, 1704067200000, 1715270400000],\n }),\n last_reported_timestamp: UnixTimestampSchema.meta({\n title: 'Last Reported Timestamp',\n description:\n 'Unix timestamp in milliseconds when the waste was last reported/processed at the destination location',\n examples: [1710604800000, 1704153600000, 1715356800000],\n }),\n })\n .refine((data) => {\n return data.first_reported_timestamp <= data.last_reported_timestamp;\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 { readFileSync } from 'node:fs';\nimport { resolve } from 'node:path';\n\nfunction getPackageJsonVersion(): string {\n try {\n const packageJsonPath = resolve(process.cwd(), 'package.json');\n const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'));\n return packageJson.version || '0.0.0-dev';\n } catch {\n return '0.0.0-dev';\n }\n}\n\nexport 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'] || getPackageJsonVersion();\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 { MassIDAttributesSchema } from './mass-id.attributes';\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,\n data: MassIDDataSchema,\n}).meta(MassIDIpfsSchemaMeta);\n\nexport type MassIDIpfs = z.infer<typeof MassIDIpfsSchema>;\n"]}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import 'fs';
|
|
3
|
+
import 'path';
|
|
2
4
|
|
|
3
5
|
// src/mass-id/mass-id.attributes.ts
|
|
4
6
|
var UuidSchema = z.uuidv4("Must be a valid UUID v4 string").meta({
|
|
@@ -1138,8 +1140,6 @@ var MassIDDataSchema = z.strictObject({
|
|
|
1138
1140
|
title: "MassID Data",
|
|
1139
1141
|
description: "MassID data containing waste tracking and chain of custody information"
|
|
1140
1142
|
});
|
|
1141
|
-
|
|
1142
|
-
// src/shared/schema-version.ts
|
|
1143
1143
|
function getSchemaBaseUrl() {
|
|
1144
1144
|
return `https://raw.githubusercontent.com/carrot-foundation/schemas/refs/tags/${getSchemaVersionOrDefault()}/schemas/ipfs`;
|
|
1145
1145
|
}
|
|
@@ -1148,7 +1148,7 @@ function buildSchemaUrl(schemaPath) {
|
|
|
1148
1148
|
return `${getSchemaBaseUrl()}/${cleanPath}`;
|
|
1149
1149
|
}
|
|
1150
1150
|
function getSchemaVersionOrDefault() {
|
|
1151
|
-
return "0.
|
|
1151
|
+
return "0.1.32";
|
|
1152
1152
|
}
|
|
1153
1153
|
|
|
1154
1154
|
// src/mass-id/mass-id.schema.ts
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/shared/definitions.schema.ts","../src/shared/base.schema.ts","../src/shared/helpers.schema.ts","../src/shared/nft.schema.ts","../src/mass-id/mass-id.attributes.ts","../src/shared/entities/location.schema.ts","../src/shared/entities/participant.schema.ts","../src/mass-id/mass-id.data.schema.ts","../src/shared/schema-version.ts","../src/mass-id/mass-id.schema.ts"],"names":["z"],"mappings":";;;AAEO,IAAM,UAAA,GAAa,CAAA,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,GAAwB,CAAA,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;A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,EAAMA,CAAAA,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,sBAAA;AAAA,EACZ,IAAA,EAAM;AACR,CAAC,CAAA,CAAE,KAAK,oBAAoB","file":"index.js","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.max(100).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 MinutesSchema = z\n .number()\n .int()\n .min(0)\n .meta({\n title: 'Minutes',\n description: 'Time duration in minutes',\n examples: [4350, 1440, 10110],\n });\n\nexport type Minutes = z.infer<typeof MinutesSchema>;\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 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';\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 { 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\nexport const 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","import { z } from 'zod';\nimport {\n WasteTypeSchema,\n WasteSubtypeSchema,\n WeightKgSchema,\n UnixTimestampSchema,\n NonEmptyStringSchema,\n HoursSchema,\n} from '../shared/definitions.schema';\nimport { NftAttributeSchema } from '../shared/nft.schema';\nimport { uniqueBy } from '../shared/helpers.schema';\n\nconst MassIDAttributeWasteTypeSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Waste Type'),\n value: WasteTypeSchema,\n}).meta({\n title: 'Waste Type Attribute',\n description: 'Waste type attribute',\n});\n\nexport type MassIDAttributeWasteType = z.infer<\n typeof MassIDAttributeWasteTypeSchema\n>;\n\nconst MassIDAttributeWasteSubtypeSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Waste Subtype'),\n value: WasteSubtypeSchema,\n}).meta({\n title: 'Waste Subtype Attribute',\n description: 'Waste subtype attribute',\n});\n\nexport type MassIDAttributeWasteSubtype = z.infer<\n typeof MassIDAttributeWasteSubtypeSchema\n>;\n\nconst MassIDAttributeWeightSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Weight (kg)'),\n value: WeightKgSchema,\n display_type: z.literal('number'),\n}).meta({\n title: 'Weight Attribute',\n description: 'Weight attribute with numeric display',\n});\n\nexport type MassIDAttributeWeight = z.infer<typeof MassIDAttributeWeightSchema>;\n\nconst MassIDAttributeOriginCountrySchema = NftAttributeSchema.extend({\n trait_type: z.literal('Origin Country'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Origin Country Value',\n description: 'Country where the waste was generated',\n examples: ['Brazil', 'United States', 'Germany', 'Japan'],\n }),\n}).meta({\n title: 'Origin Country Attribute',\n description: 'Origin country attribute',\n});\n\nexport type MassIDAttributeOriginCountry = z.infer<\n typeof MassIDAttributeOriginCountrySchema\n>;\n\nconst MassIDAttributeOriginMunicipalitySchema = NftAttributeSchema.extend({\n trait_type: z.literal('Origin Municipality'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Origin Municipality Value',\n description: 'Municipality where the waste was generated',\n examples: ['São Paulo', 'New York', 'Berlin', 'Tokyo'],\n }),\n}).meta({\n title: 'Origin Municipality Attribute',\n description: 'Origin municipality attribute',\n});\n\nexport type MassIDAttributeOriginMunicipality = z.infer<\n typeof MassIDAttributeOriginMunicipalitySchema\n>;\n\nconst MassIDAttributeOriginDivisionSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Origin Administrative Division'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Origin Division Value',\n description:\n 'Administrative division (state/province) where the waste was generated',\n examples: ['São Paulo', 'California', 'Bavaria'],\n }),\n}).meta({\n title: 'Origin Administrative Division Attribute',\n description: 'Origin administrative division attribute',\n});\n\nexport type MassIDAttributeOriginDivision = z.infer<\n typeof MassIDAttributeOriginDivisionSchema\n>;\n\nconst MassIDAttributeVehicleTypeSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Vehicle Type'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Vehicle Type Value',\n description: 'Type of vehicle used for waste transportation',\n examples: ['Garbage Truck', 'Box Truck', 'Flatbed Truck', 'Roll-off Truck'],\n }),\n}).meta({\n title: 'Vehicle Type Attribute',\n description: 'Vehicle type attribute',\n});\n\nexport type MassIDAttributeVehicleType = z.infer<\n typeof MassIDAttributeVehicleTypeSchema\n>;\n\nconst MassIDAttributeRecyclingMethodSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Recycling Method'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Recycling Method Value',\n description: 'Method used for recycling or processing the waste',\n examples: [\n 'Composting',\n 'Mechanical Recycling',\n 'Incineration with Energy Recovery',\n ],\n }),\n}).meta({\n title: 'Recycling Method Attribute',\n description: 'Recycling method attribute',\n});\n\nexport type MassIDAttributeRecyclingMethod = z.infer<\n typeof MassIDAttributeRecyclingMethodSchema\n>;\n\nconst MassIDAttributeProcessingTimeSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Processing Time (hours)'),\n value: HoursSchema,\n trait_description: NonEmptyStringSchema.max(200).optional().meta({\n title: 'Processing Time Description',\n description: 'Custom description for the processing time',\n }),\n}).meta({\n title: 'Processing Time Attribute',\n description: 'Processing time attribute with optional trait description',\n});\n\nexport type MassIDAttributeProcessingTime = z.infer<\n typeof MassIDAttributeProcessingTimeSchema\n>;\n\nconst MassIDAttributeLocalWasteClassificationIdSchema =\n NftAttributeSchema.extend({\n trait_type: z.literal('Local Waste Classification ID'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Local Waste Classification ID Value',\n description: 'Local or regional waste classification identifier',\n examples: ['04 02 20', 'IBAMA-A001', 'EWC-150101'],\n }),\n }).meta({\n title: 'Local Waste Classification ID Attribute',\n description: 'Local waste classification ID attribute',\n });\n\nexport type MassIDAttributeLocalWasteClassificationId = z.infer<\n typeof MassIDAttributeLocalWasteClassificationIdSchema\n>;\n\nconst MassIDAttributeRecyclingManifestCodeSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Recycling Manifest Code'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Recycling Manifest Code Value',\n description:\n 'Concatenated recycling manifest code (Document Type + Document Number)',\n examples: ['CDF-2353', 'RC-12345', 'REC-MANIFEST-789'],\n }),\n}).meta({\n title: 'Recycling Manifest Code Attribute',\n description: 'Recycling manifest code attribute (optional)',\n});\n\nexport type MassIDAttributeRecyclingManifestCode = z.infer<\n typeof MassIDAttributeRecyclingManifestCodeSchema\n>;\n\nconst MassIDAttributeTransportManifestCodeSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Transport Manifest Code'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Transport Manifest Code Value',\n description:\n 'Concatenated transport manifest code (Document Type + Document Number)',\n examples: ['MTR-4126', 'TRN-67890', 'TRANS-MANIFEST-456'],\n }),\n}).meta({\n title: 'Transport Manifest Code Attribute',\n description: 'Transport manifest code attribute (optional)',\n});\n\nexport type MassIDAttributeTransportManifestCode = z.infer<\n typeof MassIDAttributeTransportManifestCodeSchema\n>;\n\nconst MassIDAttributeWeighingCaptureMethodSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Weighing Capture Method'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Weighing Capture Method Value',\n description: 'Method used to capture weight data',\n examples: ['Digital', 'Manual', 'Automated', 'Electronic Scale'],\n }),\n}).meta({\n title: 'Weighing Capture Method Attribute',\n description: 'Weighing capture method attribute (optional)',\n});\n\nexport type MassIDAttributeWeighingCaptureMethod = z.infer<\n typeof MassIDAttributeWeighingCaptureMethodSchema\n>;\n\nconst MassIDAttributeScaleTypeSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Scale Type'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Scale Type Value',\n description: 'Type of scale used for weighing',\n examples: [\n 'Weighbridge (Truck Scale)',\n 'Floor Scale',\n 'Bench Scale',\n 'Crane Scale',\n ],\n }),\n}).meta({\n title: 'Scale Type Attribute',\n description: 'Scale type attribute (optional)',\n});\n\nexport type MassIDAttributeScaleType = z.infer<\n typeof MassIDAttributeScaleTypeSchema\n>;\n\nconst MassIDAttributeContainerTypeSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Container Type'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Container Type Value',\n description: 'Type of container used for waste storage or transport',\n examples: ['Truck', 'Dumpster', 'Roll-off Container', 'Compactor', 'Bin'],\n }),\n}).meta({\n title: 'Container Type Attribute',\n description: 'Container type attribute (optional)',\n});\n\nexport type MassIDAttributeContainerType = z.infer<\n typeof MassIDAttributeContainerTypeSchema\n>;\n\nconst MassIDAttributePickUpDateSchema = NftAttributeSchema.extend({\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 examples: [1710518400000, 1704067200000, 1715270400000],\n }),\n display_type: z.literal('date'),\n}).meta({\n title: 'Pick-up Date Attribute',\n description: 'Pick-up date attribute with Unix timestamp',\n});\n\nexport type MassIDAttributePickUpDate = z.infer<\n typeof MassIDAttributePickUpDateSchema\n>;\n\nconst MassIDAttributeRecyclingDateSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Recycling Date'),\n value: UnixTimestampSchema.meta({\n title: 'Recycling Date Value',\n description:\n 'Unix timestamp in milliseconds when the waste was recycled/processed',\n examples: [1710604800000, 1704153600000, 1715356800000],\n }),\n display_type: z.literal('date'),\n}).meta({\n title: 'Recycling Date Attribute',\n description: 'Recycling date attribute with Unix timestamp',\n});\n\nexport type MassIDAttributeRecyclingDate = z.infer<\n typeof MassIDAttributeRecyclingDateSchema\n>;\n\nexport const MassIDAttributesSchema = uniqueBy(\n z.union([\n MassIDAttributeWasteTypeSchema,\n MassIDAttributeWasteSubtypeSchema,\n MassIDAttributeWeightSchema,\n MassIDAttributeOriginCountrySchema,\n MassIDAttributeOriginMunicipalitySchema,\n MassIDAttributeOriginDivisionSchema,\n MassIDAttributeVehicleTypeSchema,\n MassIDAttributeRecyclingMethodSchema,\n MassIDAttributeProcessingTimeSchema,\n MassIDAttributeLocalWasteClassificationIdSchema,\n MassIDAttributeRecyclingManifestCodeSchema,\n MassIDAttributeTransportManifestCodeSchema,\n MassIDAttributeWeighingCaptureMethodSchema,\n MassIDAttributeScaleTypeSchema,\n MassIDAttributeContainerTypeSchema,\n MassIDAttributePickUpDateSchema,\n MassIDAttributeRecyclingDateSchema,\n ]),\n (attr) => attr.trait_type,\n)\n .min(12)\n .max(17)\n .meta({\n title: 'MassID Attributes',\n description:\n 'MassID NFT attributes array containing attributes selected from the available attribute types. The schema validates array length but does not enforce which specific attributes must be present.',\n });\n\nexport type MassIDAttributes = z.infer<typeof MassIDAttributesSchema>;\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';\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 UnixTimestampSchema,\n MinutesSchema,\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 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 })\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 EventAttachmentSchema = z\n .strictObject({\n type: NonEmptyStringSchema.max(50).meta({\n title: 'Attachment Type',\n description: 'Type of supporting attachment',\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: 'Attachment Reference',\n description:\n 'Reference to attachment (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_timestamp: UnixTimestampSchema.optional().meta({\n title: 'Issue Timestamp',\n description:\n 'Unix timestamp in milliseconds when the attachment was issued',\n examples: [1710518400000, 1704067200000, 1715270400000],\n }),\n issuer: NonEmptyStringSchema.max(100)\n .optional()\n .meta({\n title: 'Attachment Issuer',\n description: 'Entity that issued the attachment',\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 Attachment',\n description: 'Supporting event attachment',\n });\nexport type EventAttachment = z.infer<typeof EventAttachmentSchema>;\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: UnixTimestampSchema.meta({\n title: 'Event Timestamp',\n description: 'Unix timestamp in milliseconds when the event occurred',\n examples: [1710518400000, 1704067200000, 1715270400000],\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 attachments: z.array(EventAttachmentSchema).optional().meta({\n title: 'Event Attachments',\n description: 'Associated attachments for 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_duration_minutes: MinutesSchema.meta({\n title: 'Total Duration (minutes)',\n description: 'Total time from first to last event in minutes',\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: UnixTimestampSchema.meta({\n title: 'First Reported Timestamp',\n description:\n 'Unix timestamp in milliseconds when the waste was first reported/collected at the origin location',\n examples: [1710518400000, 1704067200000, 1715270400000],\n }),\n last_reported_timestamp: UnixTimestampSchema.meta({\n title: 'Last Reported Timestamp',\n description:\n 'Unix timestamp in milliseconds when the waste was last reported/processed at the destination location',\n examples: [1710604800000, 1704153600000, 1715356800000],\n }),\n })\n .refine((data) => {\n return data.first_reported_timestamp <= data.last_reported_timestamp;\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","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 { MassIDAttributesSchema } from './mass-id.attributes';\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,\n data: MassIDDataSchema,\n}).meta(MassIDIpfsSchemaMeta);\n\nexport type MassIDIpfs = z.infer<typeof MassIDIpfsSchema>;\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/shared/definitions.schema.ts","../src/shared/base.schema.ts","../src/shared/helpers.schema.ts","../src/shared/nft.schema.ts","../src/mass-id/mass-id.attributes.ts","../src/shared/entities/location.schema.ts","../src/shared/entities/participant.schema.ts","../src/mass-id/mass-id.data.schema.ts","../src/shared/schema-version.ts","../src/mass-id/mass-id.schema.ts"],"names":["z"],"mappings":";;;;;AAEO,IAAM,UAAA,GAAa,CAAA,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,GAAwB,CAAA,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,GAAqB,CAAA,CAAE,GAAA,CACjC,QAAA,CAAS;AAAA,EACR,OAAA,EAAS;AACX,CAAC,EACA,IAAA,C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AAY,sBAAA;AAAA,EACZ,IAAA,EAAM;AACR,CAAC,CAAA,CAAE,KAAK,oBAAoB","file":"index.js","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.max(100).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 MinutesSchema = z\n .number()\n .int()\n .min(0)\n .meta({\n title: 'Minutes',\n description: 'Time duration in minutes',\n examples: [4350, 1440, 10110],\n });\n\nexport type Minutes = z.infer<typeof MinutesSchema>;\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 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';\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 { 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\nexport const 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","import { z } from 'zod';\nimport {\n WasteTypeSchema,\n WasteSubtypeSchema,\n WeightKgSchema,\n UnixTimestampSchema,\n NonEmptyStringSchema,\n HoursSchema,\n} from '../shared/definitions.schema';\nimport { NftAttributeSchema } from '../shared/nft.schema';\nimport { uniqueBy } from '../shared/helpers.schema';\n\nconst MassIDAttributeWasteTypeSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Waste Type'),\n value: WasteTypeSchema,\n}).meta({\n title: 'Waste Type Attribute',\n description: 'Waste type attribute',\n});\n\nexport type MassIDAttributeWasteType = z.infer<\n typeof MassIDAttributeWasteTypeSchema\n>;\n\nconst MassIDAttributeWasteSubtypeSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Waste Subtype'),\n value: WasteSubtypeSchema,\n}).meta({\n title: 'Waste Subtype Attribute',\n description: 'Waste subtype attribute',\n});\n\nexport type MassIDAttributeWasteSubtype = z.infer<\n typeof MassIDAttributeWasteSubtypeSchema\n>;\n\nconst MassIDAttributeWeightSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Weight (kg)'),\n value: WeightKgSchema,\n display_type: z.literal('number'),\n}).meta({\n title: 'Weight Attribute',\n description: 'Weight attribute with numeric display',\n});\n\nexport type MassIDAttributeWeight = z.infer<typeof MassIDAttributeWeightSchema>;\n\nconst MassIDAttributeOriginCountrySchema = NftAttributeSchema.extend({\n trait_type: z.literal('Origin Country'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Origin Country Value',\n description: 'Country where the waste was generated',\n examples: ['Brazil', 'United States', 'Germany', 'Japan'],\n }),\n}).meta({\n title: 'Origin Country Attribute',\n description: 'Origin country attribute',\n});\n\nexport type MassIDAttributeOriginCountry = z.infer<\n typeof MassIDAttributeOriginCountrySchema\n>;\n\nconst MassIDAttributeOriginMunicipalitySchema = NftAttributeSchema.extend({\n trait_type: z.literal('Origin Municipality'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Origin Municipality Value',\n description: 'Municipality where the waste was generated',\n examples: ['São Paulo', 'New York', 'Berlin', 'Tokyo'],\n }),\n}).meta({\n title: 'Origin Municipality Attribute',\n description: 'Origin municipality attribute',\n});\n\nexport type MassIDAttributeOriginMunicipality = z.infer<\n typeof MassIDAttributeOriginMunicipalitySchema\n>;\n\nconst MassIDAttributeOriginDivisionSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Origin Administrative Division'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Origin Division Value',\n description:\n 'Administrative division (state/province) where the waste was generated',\n examples: ['São Paulo', 'California', 'Bavaria'],\n }),\n}).meta({\n title: 'Origin Administrative Division Attribute',\n description: 'Origin administrative division attribute',\n});\n\nexport type MassIDAttributeOriginDivision = z.infer<\n typeof MassIDAttributeOriginDivisionSchema\n>;\n\nconst MassIDAttributeVehicleTypeSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Vehicle Type'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Vehicle Type Value',\n description: 'Type of vehicle used for waste transportation',\n examples: ['Garbage Truck', 'Box Truck', 'Flatbed Truck', 'Roll-off Truck'],\n }),\n}).meta({\n title: 'Vehicle Type Attribute',\n description: 'Vehicle type attribute',\n});\n\nexport type MassIDAttributeVehicleType = z.infer<\n typeof MassIDAttributeVehicleTypeSchema\n>;\n\nconst MassIDAttributeRecyclingMethodSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Recycling Method'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Recycling Method Value',\n description: 'Method used for recycling or processing the waste',\n examples: [\n 'Composting',\n 'Mechanical Recycling',\n 'Incineration with Energy Recovery',\n ],\n }),\n}).meta({\n title: 'Recycling Method Attribute',\n description: 'Recycling method attribute',\n});\n\nexport type MassIDAttributeRecyclingMethod = z.infer<\n typeof MassIDAttributeRecyclingMethodSchema\n>;\n\nconst MassIDAttributeProcessingTimeSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Processing Time (hours)'),\n value: HoursSchema,\n trait_description: NonEmptyStringSchema.max(200).optional().meta({\n title: 'Processing Time Description',\n description: 'Custom description for the processing time',\n }),\n}).meta({\n title: 'Processing Time Attribute',\n description: 'Processing time attribute with optional trait description',\n});\n\nexport type MassIDAttributeProcessingTime = z.infer<\n typeof MassIDAttributeProcessingTimeSchema\n>;\n\nconst MassIDAttributeLocalWasteClassificationIdSchema =\n NftAttributeSchema.extend({\n trait_type: z.literal('Local Waste Classification ID'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Local Waste Classification ID Value',\n description: 'Local or regional waste classification identifier',\n examples: ['04 02 20', 'IBAMA-A001', 'EWC-150101'],\n }),\n }).meta({\n title: 'Local Waste Classification ID Attribute',\n description: 'Local waste classification ID attribute',\n });\n\nexport type MassIDAttributeLocalWasteClassificationId = z.infer<\n typeof MassIDAttributeLocalWasteClassificationIdSchema\n>;\n\nconst MassIDAttributeRecyclingManifestCodeSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Recycling Manifest Code'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Recycling Manifest Code Value',\n description:\n 'Concatenated recycling manifest code (Document Type + Document Number)',\n examples: ['CDF-2353', 'RC-12345', 'REC-MANIFEST-789'],\n }),\n}).meta({\n title: 'Recycling Manifest Code Attribute',\n description: 'Recycling manifest code attribute (optional)',\n});\n\nexport type MassIDAttributeRecyclingManifestCode = z.infer<\n typeof MassIDAttributeRecyclingManifestCodeSchema\n>;\n\nconst MassIDAttributeTransportManifestCodeSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Transport Manifest Code'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Transport Manifest Code Value',\n description:\n 'Concatenated transport manifest code (Document Type + Document Number)',\n examples: ['MTR-4126', 'TRN-67890', 'TRANS-MANIFEST-456'],\n }),\n}).meta({\n title: 'Transport Manifest Code Attribute',\n description: 'Transport manifest code attribute (optional)',\n});\n\nexport type MassIDAttributeTransportManifestCode = z.infer<\n typeof MassIDAttributeTransportManifestCodeSchema\n>;\n\nconst MassIDAttributeWeighingCaptureMethodSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Weighing Capture Method'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Weighing Capture Method Value',\n description: 'Method used to capture weight data',\n examples: ['Digital', 'Manual', 'Automated', 'Electronic Scale'],\n }),\n}).meta({\n title: 'Weighing Capture Method Attribute',\n description: 'Weighing capture method attribute (optional)',\n});\n\nexport type MassIDAttributeWeighingCaptureMethod = z.infer<\n typeof MassIDAttributeWeighingCaptureMethodSchema\n>;\n\nconst MassIDAttributeScaleTypeSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Scale Type'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Scale Type Value',\n description: 'Type of scale used for weighing',\n examples: [\n 'Weighbridge (Truck Scale)',\n 'Floor Scale',\n 'Bench Scale',\n 'Crane Scale',\n ],\n }),\n}).meta({\n title: 'Scale Type Attribute',\n description: 'Scale type attribute (optional)',\n});\n\nexport type MassIDAttributeScaleType = z.infer<\n typeof MassIDAttributeScaleTypeSchema\n>;\n\nconst MassIDAttributeContainerTypeSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Container Type'),\n value: NonEmptyStringSchema.max(100).meta({\n title: 'Container Type Value',\n description: 'Type of container used for waste storage or transport',\n examples: ['Truck', 'Dumpster', 'Roll-off Container', 'Compactor', 'Bin'],\n }),\n}).meta({\n title: 'Container Type Attribute',\n description: 'Container type attribute (optional)',\n});\n\nexport type MassIDAttributeContainerType = z.infer<\n typeof MassIDAttributeContainerTypeSchema\n>;\n\nconst MassIDAttributePickUpDateSchema = NftAttributeSchema.extend({\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 examples: [1710518400000, 1704067200000, 1715270400000],\n }),\n display_type: z.literal('date'),\n}).meta({\n title: 'Pick-up Date Attribute',\n description: 'Pick-up date attribute with Unix timestamp',\n});\n\nexport type MassIDAttributePickUpDate = z.infer<\n typeof MassIDAttributePickUpDateSchema\n>;\n\nconst MassIDAttributeRecyclingDateSchema = NftAttributeSchema.extend({\n trait_type: z.literal('Recycling Date'),\n value: UnixTimestampSchema.meta({\n title: 'Recycling Date Value',\n description:\n 'Unix timestamp in milliseconds when the waste was recycled/processed',\n examples: [1710604800000, 1704153600000, 1715356800000],\n }),\n display_type: z.literal('date'),\n}).meta({\n title: 'Recycling Date Attribute',\n description: 'Recycling date attribute with Unix timestamp',\n});\n\nexport type MassIDAttributeRecyclingDate = z.infer<\n typeof MassIDAttributeRecyclingDateSchema\n>;\n\nexport const MassIDAttributesSchema = uniqueBy(\n z.union([\n MassIDAttributeWasteTypeSchema,\n MassIDAttributeWasteSubtypeSchema,\n MassIDAttributeWeightSchema,\n MassIDAttributeOriginCountrySchema,\n MassIDAttributeOriginMunicipalitySchema,\n MassIDAttributeOriginDivisionSchema,\n MassIDAttributeVehicleTypeSchema,\n MassIDAttributeRecyclingMethodSchema,\n MassIDAttributeProcessingTimeSchema,\n MassIDAttributeLocalWasteClassificationIdSchema,\n MassIDAttributeRecyclingManifestCodeSchema,\n MassIDAttributeTransportManifestCodeSchema,\n MassIDAttributeWeighingCaptureMethodSchema,\n MassIDAttributeScaleTypeSchema,\n MassIDAttributeContainerTypeSchema,\n MassIDAttributePickUpDateSchema,\n MassIDAttributeRecyclingDateSchema,\n ]),\n (attr) => attr.trait_type,\n)\n .min(12)\n .max(17)\n .meta({\n title: 'MassID Attributes',\n description:\n 'MassID NFT attributes array containing attributes selected from the available attribute types. The schema validates array length but does not enforce which specific attributes must be present.',\n });\n\nexport type MassIDAttributes = z.infer<typeof MassIDAttributesSchema>;\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';\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 UnixTimestampSchema,\n MinutesSchema,\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 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 })\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 EventAttachmentSchema = z\n .strictObject({\n type: NonEmptyStringSchema.max(50).meta({\n title: 'Attachment Type',\n description: 'Type of supporting attachment',\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: 'Attachment Reference',\n description:\n 'Reference to attachment (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_timestamp: UnixTimestampSchema.optional().meta({\n title: 'Issue Timestamp',\n description:\n 'Unix timestamp in milliseconds when the attachment was issued',\n examples: [1710518400000, 1704067200000, 1715270400000],\n }),\n issuer: NonEmptyStringSchema.max(100)\n .optional()\n .meta({\n title: 'Attachment Issuer',\n description: 'Entity that issued the attachment',\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 Attachment',\n description: 'Supporting event attachment',\n });\nexport type EventAttachment = z.infer<typeof EventAttachmentSchema>;\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: UnixTimestampSchema.meta({\n title: 'Event Timestamp',\n description: 'Unix timestamp in milliseconds when the event occurred',\n examples: [1710518400000, 1704067200000, 1715270400000],\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 attachments: z.array(EventAttachmentSchema).optional().meta({\n title: 'Event Attachments',\n description: 'Associated attachments for 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_duration_minutes: MinutesSchema.meta({\n title: 'Total Duration (minutes)',\n description: 'Total time from first to last event in minutes',\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: UnixTimestampSchema.meta({\n title: 'First Reported Timestamp',\n description:\n 'Unix timestamp in milliseconds when the waste was first reported/collected at the origin location',\n examples: [1710518400000, 1704067200000, 1715270400000],\n }),\n last_reported_timestamp: UnixTimestampSchema.meta({\n title: 'Last Reported Timestamp',\n description:\n 'Unix timestamp in milliseconds when the waste was last reported/processed at the destination location',\n examples: [1710604800000, 1704153600000, 1715356800000],\n }),\n })\n .refine((data) => {\n return data.first_reported_timestamp <= data.last_reported_timestamp;\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 { readFileSync } from 'node:fs';\nimport { resolve } from 'node:path';\n\nfunction getPackageJsonVersion(): string {\n try {\n const packageJsonPath = resolve(process.cwd(), 'package.json');\n const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'));\n return packageJson.version || '0.0.0-dev';\n } catch {\n return '0.0.0-dev';\n }\n}\n\nexport 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'] || getPackageJsonVersion();\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 { MassIDAttributesSchema } from './mass-id.attributes';\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,\n data: MassIDDataSchema,\n}).meta(MassIDIpfsSchemaMeta);\n\nexport type MassIDIpfs = z.infer<typeof MassIDIpfsSchema>;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carrot-foundation/schemas",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.32",
|
|
4
4
|
"description": "Carrot schema definitions and zod validation schemas",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"private": false,
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
"@vitest/ui": "4.0.15",
|
|
58
58
|
"ajv": "8.17.1",
|
|
59
59
|
"ajv-formats": "3.0.1",
|
|
60
|
+
"concurrently": "9.2.1",
|
|
60
61
|
"cspell": "9.4.0",
|
|
61
62
|
"eslint": "9.39.1",
|
|
62
63
|
"eslint-plugin-vitest-globals": "1.5.0",
|
|
@@ -78,7 +79,9 @@
|
|
|
78
79
|
},
|
|
79
80
|
"scripts": {
|
|
80
81
|
"build": "tsup",
|
|
82
|
+
"check": "pnpm lint:fix && pnpm format && pnpm type-check && pnpm spell-check && pnpm pkgJsonLint && pnpm build && pnpm validate-schemas && pnpm verify-schema-versions && pnpm check-refs && pnpm test",
|
|
81
83
|
"check-refs": "node scripts/check-refs.js",
|
|
84
|
+
"check:parallel": "concurrently -n lint:fix,format,type-check,spell-check,pkgJsonLint,test,build,validate-schemas,verify-schema-versions,check-refs \"pnpm lint:fix\" \"pnpm format\" \"pnpm type-check\" \"pnpm spell-check\" \"pnpm pkgJsonLint\" \"pnpm test\" \"pnpm build\" \"pnpm validate-schemas\" \"pnpm verify-schema-versions\" \"pnpm check-refs\"",
|
|
82
85
|
"clean": "rm -rf dist",
|
|
83
86
|
"format": "prettier --write .",
|
|
84
87
|
"format:check": "prettier --check .",
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"title": "MassID NFT IPFS Record",
|
|
4
4
|
"description": "Complete MassID NFT IPFS record including fixed attributes and detailed waste tracking data",
|
|
5
|
-
"$id": "https://raw.githubusercontent.com/carrot-foundation/schemas/refs/tags/0.1.
|
|
6
|
-
"version": "0.1.
|
|
5
|
+
"$id": "https://raw.githubusercontent.com/carrot-foundation/schemas/refs/tags/0.1.32/schemas/ipfs/mass-id/mass-id.schema.json",
|
|
6
|
+
"version": "0.1.32",
|
|
7
7
|
"type": "object",
|
|
8
8
|
"properties": {
|
|
9
9
|
"$schema": {
|