@carrot-foundation/schemas 0.1.20 → 0.1.21
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 +45 -0
- package/dist/index.cjs +1104 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +552 -0
- package/dist/index.d.ts +552 -2
- package/dist/index.js +1100 -1
- package/dist/index.js.map +1 -0
- package/package.json +6 -4
- package/dist/index.d.ts.map +0 -1
- package/dist/mass-id/index.d.ts +0 -3
- package/dist/mass-id/index.d.ts.map +0 -1
- package/dist/mass-id/index.js +0 -2
- package/dist/mass-id/mass-id.data.schema.d.ts +0 -256
- package/dist/mass-id/mass-id.data.schema.d.ts.map +0 -1
- package/dist/mass-id/mass-id.data.schema.js +0 -348
- package/dist/mass-id/mass-id.schema.d.ts +0 -297
- package/dist/mass-id/mass-id.schema.d.ts.map +0 -1
- package/dist/mass-id/mass-id.schema.js +0 -163
- package/dist/shared/base.schema.d.ts +0 -111
- package/dist/shared/base.schema.d.ts.map +0 -1
- package/dist/shared/base.schema.js +0 -127
- package/dist/shared/definitions.schema.d.ts +0 -96
- package/dist/shared/definitions.schema.d.ts.map +0 -1
- package/dist/shared/definitions.schema.js +0 -283
- package/dist/shared/entities/location.schema.d.ts +0 -55
- package/dist/shared/entities/location.schema.d.ts.map +0 -1
- package/dist/shared/entities/location.schema.js +0 -68
- package/dist/shared/entities/participant.schema.d.ts +0 -8
- package/dist/shared/entities/participant.schema.d.ts.map +0 -1
- package/dist/shared/entities/participant.schema.js +0 -24
- package/dist/shared/helpers.schema.d.ts +0 -4
- package/dist/shared/helpers.schema.d.ts.map +0 -1
- package/dist/shared/helpers.schema.js +0 -16
- package/dist/shared/nft.schema.d.ts +0 -116
- package/dist/shared/nft.schema.d.ts.map +0 -1
- package/dist/shared/nft.schema.js +0 -193
package/README.md
CHANGED
|
@@ -25,6 +25,51 @@ Example `$id` pinned to a tag:
|
|
|
25
25
|
"$id": "https://raw.githubusercontent.com/carrot-foundation/schemas/refs/tags/v0.1.0/schemas/ipfs/collection/collection.schema.json"
|
|
26
26
|
```
|
|
27
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
|
+
|
|
28
73
|
## ✅ Usage
|
|
29
74
|
|
|
30
75
|
You may:
|