@carrot-foundation/schemas 0.1.18 β†’ 0.1.19

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.
Files changed (36) hide show
  1. package/README.md +49 -3
  2. package/dist/index.cjs +1104 -0
  3. package/dist/index.cjs.map +1 -0
  4. package/dist/index.d.cts +552 -0
  5. package/dist/index.d.ts +552 -2
  6. package/dist/index.js +1100 -1
  7. package/dist/index.js.map +1 -0
  8. package/package.json +6 -4
  9. package/dist/index.d.ts.map +0 -1
  10. package/dist/mass-id/index.d.ts +0 -3
  11. package/dist/mass-id/index.d.ts.map +0 -1
  12. package/dist/mass-id/index.js +0 -2
  13. package/dist/mass-id/mass-id.data.schema.d.ts +0 -256
  14. package/dist/mass-id/mass-id.data.schema.d.ts.map +0 -1
  15. package/dist/mass-id/mass-id.data.schema.js +0 -348
  16. package/dist/mass-id/mass-id.schema.d.ts +0 -297
  17. package/dist/mass-id/mass-id.schema.d.ts.map +0 -1
  18. package/dist/mass-id/mass-id.schema.js +0 -163
  19. package/dist/shared/base.schema.d.ts +0 -111
  20. package/dist/shared/base.schema.d.ts.map +0 -1
  21. package/dist/shared/base.schema.js +0 -127
  22. package/dist/shared/definitions.schema.d.ts +0 -96
  23. package/dist/shared/definitions.schema.d.ts.map +0 -1
  24. package/dist/shared/definitions.schema.js +0 -283
  25. package/dist/shared/entities/location.schema.d.ts +0 -55
  26. package/dist/shared/entities/location.schema.d.ts.map +0 -1
  27. package/dist/shared/entities/location.schema.js +0 -68
  28. package/dist/shared/entities/participant.schema.d.ts +0 -8
  29. package/dist/shared/entities/participant.schema.d.ts.map +0 -1
  30. package/dist/shared/entities/participant.schema.js +0 -24
  31. package/dist/shared/helpers.schema.d.ts +0 -4
  32. package/dist/shared/helpers.schema.d.ts.map +0 -1
  33. package/dist/shared/helpers.schema.js +0 -16
  34. package/dist/shared/nft.schema.d.ts +0 -116
  35. package/dist/shared/nft.schema.d.ts.map +0 -1
  36. package/dist/shared/nft.schema.js +0 -193
package/README.md CHANGED
@@ -2,18 +2,19 @@
2
2
 
3
3
  This repository contains all JSON Schemas used across the Carrot ecosystem.
4
4
 
5
- These schemas define the structure of IPFS metadata for tokenized assets.
5
+ These schemas define the structure of IPFS metadata for tokenized assets and other schemas.
6
+
6
7
  They are versioned, publicly referenceable, and used for validation, traceability, and frontend/backend integration.
7
8
 
8
9
  ## πŸ“¦ Structure
9
10
 
10
11
  - Schemas are organized by type (e.g., `mass-id`, `gas-id`, `shared`) and follow [Semantic Versioning](https://semver.org/), but folder names are not versioned.
11
12
  - Each schema lives in its own folder and includes an `example.json` for testing and documentation.
12
- - Shared components like `signature`, `attribute`, and the `root` schema are located in `schemas/ipfs/shared`.
13
+ - Shared components are located in `src/shared/**`.
13
14
 
14
15
  ## πŸ”– Versioning
15
16
 
16
- - Schemas are versioned using Git tags (`vX.Y.Z`); directory names are not versioned.
17
+ - Schemas are versioned using isolated versioning; each schema can evolve independently.
17
18
  - For released versions, each schema’s `$id` must point to the tagged raw URL to remain immutable.
18
19
  - During development on `main`, `$id` may reference `refs/heads/main`, but consumers should pin to tags in production.
19
20
  - Keep `$ref` paths relative; they resolve against the `$id` base (the tag) at validation time.
@@ -24,6 +25,51 @@ Example `$id` pinned to a tag:
24
25
  "$id": "https://raw.githubusercontent.com/carrot-foundation/schemas/refs/tags/v0.1.0/schemas/ipfs/collection/collection.schema.json"
25
26
  ```
26
27
 
28
+ ## πŸ“š Package Usage
29
+
30
+ This package is published to npm as `@carrot-foundation/schemas` and supports both **ESM** and **CommonJS** module formats.
31
+
32
+ ### Installation
33
+
34
+ ```bash
35
+ npm install @carrot-foundation/schemas
36
+ # or
37
+ pnpm add @carrot-foundation/schemas
38
+ # or
39
+ yarn add @carrot-foundation/schemas
40
+ ```
41
+
42
+ ### ESM (ECMAScript Modules)
43
+
44
+ ```typescript
45
+ import { MassIDIpfsSchema, MassIDDataSchema } from '@carrot-foundation/schemas';
46
+
47
+ // Use the schemas for validation
48
+ const result = MassIDIpfsSchema.safeParse(data);
49
+ ```
50
+
51
+ ### CommonJS
52
+
53
+ ```javascript
54
+ const { MassIDIpfsSchema, MassIDDataSchema } = require('@carrot-foundation/schemas');
55
+
56
+ // Use the schemas for validation
57
+ const result = MassIDIpfsSchema.safeParse(data);
58
+ ```
59
+
60
+ ### TypeScript Support
61
+
62
+ The package includes full TypeScript definitions:
63
+
64
+ ```typescript
65
+ import { MassIDIpfs, MassIDData } from '@carrot-foundation/schemas';
66
+
67
+ // Types are automatically inferred from the schemas
68
+ const massIdData: MassIDData = {
69
+ // ...
70
+ };
71
+ ```
72
+
27
73
  ## βœ… Usage
28
74
 
29
75
  You may: