@carrot-foundation/schemas 0.1.14 → 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mass-id/mass-id.data.schema.d.ts +20 -20
- package/dist/mass-id/mass-id.data.schema.d.ts.map +1 -1
- package/dist/mass-id/mass-id.data.schema.js +17 -15
- package/dist/mass-id/mass-id.schema.d.ts +10 -4
- package/dist/mass-id/mass-id.schema.d.ts.map +1 -1
- package/dist/mass-id/mass-id.schema.js +7 -6
- package/dist/shared/entities/location.schema.d.ts +3 -3
- package/dist/shared/entities/location.schema.d.ts.map +1 -1
- package/dist/shared/entities/location.schema.js +2 -2
- package/package.json +16 -19
- package/schemas/ipfs/mass-id/mass-id.schema.json +2 -5
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
declare const
|
|
2
|
+
declare const MassIDLocalClassificationSchema: z.ZodObject<{
|
|
3
3
|
code: z.ZodString;
|
|
4
4
|
description: z.ZodString;
|
|
5
5
|
system: z.ZodString;
|
|
6
6
|
}, z.core.$strict>;
|
|
7
|
-
export type
|
|
8
|
-
declare const
|
|
7
|
+
export type MassIDLocalClassification = z.infer<typeof MassIDLocalClassificationSchema>;
|
|
8
|
+
declare const MassIDMeasurementUnitSchema: z.ZodEnum<{
|
|
9
9
|
kg: "kg";
|
|
10
10
|
ton: "ton";
|
|
11
11
|
}>;
|
|
12
|
-
export type
|
|
12
|
+
export type MassIDMeasurementUnit = z.infer<typeof MassIDMeasurementUnitSchema>;
|
|
13
13
|
declare const ContaminationLevelSchema: z.ZodEnum<{
|
|
14
14
|
None: "None";
|
|
15
15
|
Low: "Low";
|
|
@@ -17,7 +17,7 @@ declare const ContaminationLevelSchema: z.ZodEnum<{
|
|
|
17
17
|
High: "High";
|
|
18
18
|
}>;
|
|
19
19
|
export type ContaminationLevel = z.infer<typeof ContaminationLevelSchema>;
|
|
20
|
-
declare const
|
|
20
|
+
declare const MassIDWasteClassificationSchema: z.ZodObject<{
|
|
21
21
|
primary_type: z.ZodString;
|
|
22
22
|
subtype: z.ZodString;
|
|
23
23
|
local_classification: z.ZodOptional<z.ZodObject<{
|
|
@@ -37,7 +37,7 @@ declare const WasteClassificationSchema: z.ZodObject<{
|
|
|
37
37
|
High: "High";
|
|
38
38
|
}>>;
|
|
39
39
|
}, z.core.$strict>;
|
|
40
|
-
export type
|
|
40
|
+
export type MassIDWasteClassification = z.infer<typeof MassIDWasteClassificationSchema>;
|
|
41
41
|
declare const EventAttributeFormatSchema: z.ZodEnum<{
|
|
42
42
|
KILOGRAM: "KILOGRAM";
|
|
43
43
|
DATE: "DATE";
|
|
@@ -66,10 +66,10 @@ declare const EventDocumentSchema: z.ZodObject<{
|
|
|
66
66
|
issuer: z.ZodOptional<z.ZodString>;
|
|
67
67
|
}, z.core.$strict>;
|
|
68
68
|
export type EventDocumentation = z.infer<typeof EventDocumentSchema>;
|
|
69
|
-
declare const
|
|
69
|
+
declare const MassIDChainOfCustodyEventSchema: z.ZodObject<{
|
|
70
70
|
event_id: z.ZodUUID;
|
|
71
71
|
event_name: z.ZodString;
|
|
72
|
-
description: z.ZodString
|
|
72
|
+
description: z.ZodOptional<z.ZodString>;
|
|
73
73
|
timestamp: z.ZodISODateTime;
|
|
74
74
|
participant_id: z.ZodUUID;
|
|
75
75
|
location_id: z.ZodUUID;
|
|
@@ -94,12 +94,12 @@ declare const ChainOfCustodyEventSchema: z.ZodObject<{
|
|
|
94
94
|
}, z.core.$strict>>>;
|
|
95
95
|
notes: z.ZodOptional<z.ZodString>;
|
|
96
96
|
}, z.core.$strict>;
|
|
97
|
-
export type
|
|
98
|
-
declare const
|
|
97
|
+
export type MassIDChainOfCustodyEvent = z.infer<typeof MassIDChainOfCustodyEventSchema>;
|
|
98
|
+
declare const MassIDChainOfCustodySchema: z.ZodObject<{
|
|
99
99
|
events: z.ZodArray<z.ZodObject<{
|
|
100
100
|
event_id: z.ZodUUID;
|
|
101
101
|
event_name: z.ZodString;
|
|
102
|
-
description: z.ZodString
|
|
102
|
+
description: z.ZodOptional<z.ZodString>;
|
|
103
103
|
timestamp: z.ZodISODateTime;
|
|
104
104
|
participant_id: z.ZodUUID;
|
|
105
105
|
location_id: z.ZodUUID;
|
|
@@ -127,16 +127,16 @@ declare const ChainOfCustodySchema: z.ZodObject<{
|
|
|
127
127
|
total_distance_km: z.ZodNumber;
|
|
128
128
|
total_duration_hours: z.ZodNumber;
|
|
129
129
|
}, z.core.$strict>;
|
|
130
|
-
export type
|
|
131
|
-
declare const
|
|
130
|
+
export type MassIDChainOfCustody = z.infer<typeof MassIDChainOfCustodySchema>;
|
|
131
|
+
declare const MassIDTransportRouteSchema: z.ZodObject<{
|
|
132
132
|
from_location_id: z.ZodUUID;
|
|
133
133
|
to_location_id: z.ZodUUID;
|
|
134
134
|
distance_km: z.ZodNumber;
|
|
135
135
|
transport_method: z.ZodString;
|
|
136
136
|
duration_hours: z.ZodNumber;
|
|
137
137
|
}, z.core.$strict>;
|
|
138
|
-
export type
|
|
139
|
-
declare const
|
|
138
|
+
export type MassIDTransportRoute = z.infer<typeof MassIDTransportRouteSchema>;
|
|
139
|
+
declare const MassIDGeographicDataSchema: z.ZodObject<{
|
|
140
140
|
origin_location_id: z.ZodUUID;
|
|
141
141
|
processing_location_ids: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
|
|
142
142
|
final_destination_id: z.ZodUUID;
|
|
@@ -148,7 +148,7 @@ declare const GeographicDataSchema: z.ZodObject<{
|
|
|
148
148
|
duration_hours: z.ZodNumber;
|
|
149
149
|
}, z.core.$strict>>;
|
|
150
150
|
}, z.core.$strict>;
|
|
151
|
-
export type
|
|
151
|
+
export type MassIDGeographicData = z.infer<typeof MassIDGeographicDataSchema>;
|
|
152
152
|
export declare const MassIDDataSchema: z.ZodObject<{
|
|
153
153
|
waste_classification: z.ZodObject<{
|
|
154
154
|
primary_type: z.ZodString;
|
|
@@ -174,7 +174,7 @@ export declare const MassIDDataSchema: z.ZodObject<{
|
|
|
174
174
|
id: z.ZodUUID;
|
|
175
175
|
municipality: z.ZodString;
|
|
176
176
|
administrative_division: z.ZodString;
|
|
177
|
-
administrative_division_code: z.ZodString
|
|
177
|
+
administrative_division_code: z.ZodOptional<z.ZodString>;
|
|
178
178
|
country: z.ZodString;
|
|
179
179
|
country_code: z.ZodString;
|
|
180
180
|
responsible_participant_id: z.ZodUUID;
|
|
@@ -189,7 +189,7 @@ export declare const MassIDDataSchema: z.ZodObject<{
|
|
|
189
189
|
country: "country";
|
|
190
190
|
}>;
|
|
191
191
|
}, z.core.$strict>;
|
|
192
|
-
facility_type: z.ZodEnum<{
|
|
192
|
+
facility_type: z.ZodOptional<z.ZodEnum<{
|
|
193
193
|
"Waste Generation": "Waste Generation";
|
|
194
194
|
"Collection Point": "Collection Point";
|
|
195
195
|
"Transfer Station": "Transfer Station";
|
|
@@ -199,7 +199,7 @@ export declare const MassIDDataSchema: z.ZodObject<{
|
|
|
199
199
|
"Processing Facility": "Processing Facility";
|
|
200
200
|
"Disposal Facility": "Disposal Facility";
|
|
201
201
|
"Administrative Office": "Administrative Office";
|
|
202
|
-
}
|
|
202
|
+
}>>;
|
|
203
203
|
}, z.core.$strict>>;
|
|
204
204
|
participants: z.ZodArray<z.ZodObject<{
|
|
205
205
|
id: z.ZodUUID;
|
|
@@ -210,7 +210,7 @@ export declare const MassIDDataSchema: z.ZodObject<{
|
|
|
210
210
|
events: z.ZodArray<z.ZodObject<{
|
|
211
211
|
event_id: z.ZodUUID;
|
|
212
212
|
event_name: z.ZodString;
|
|
213
|
-
description: z.ZodString
|
|
213
|
+
description: z.ZodOptional<z.ZodString>;
|
|
214
214
|
timestamp: z.ZodISODateTime;
|
|
215
215
|
participant_id: z.ZodUUID;
|
|
216
216
|
location_id: z.ZodUUID;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mass-id.data.schema.d.ts","sourceRoot":"","sources":["../../src/mass-id/mass-id.data.schema.ts"],"names":[],"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AM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,+BAA+B,CACvC,CAAC;AAEF,QAAA,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAoB5B,CAAC;AAEL,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,QAAA,MAAM,0BAA0B;;;;;;kBAqC5B,CAAC;AAEL,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,QAAA,MAAM,0BAA0B;;;;;;;;;;;kBAuB5B,CAAC;AAEL,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA8DzB,CAAC;AAEL,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { UuidSchema, WasteTypeSchema, WasteSubtypeSchema, NonEmptyStringSchema,
|
|
|
3
3
|
import { LocationSchema } from '../shared/entities/location.schema.js';
|
|
4
4
|
import { ParticipantSchema } from '../shared/entities/participant.schema.js';
|
|
5
5
|
import { uniqueBy } from '../shared/helpers.schema.js';
|
|
6
|
-
const
|
|
6
|
+
const MassIDLocalClassificationSchema = z
|
|
7
7
|
.strictObject({
|
|
8
8
|
code: NonEmptyStringSchema.max(20).meta({
|
|
9
9
|
title: 'Classification Code',
|
|
@@ -35,7 +35,7 @@ const LocalClassificationSchema = z
|
|
|
35
35
|
title: 'Local Classification',
|
|
36
36
|
description: 'Local or regional waste classification codes and descriptions',
|
|
37
37
|
});
|
|
38
|
-
const
|
|
38
|
+
const MassIDMeasurementUnitSchema = z.enum(['kg', 'ton']).meta({
|
|
39
39
|
title: 'Measurement Unit',
|
|
40
40
|
description: 'Unit of measurement for the waste quantity',
|
|
41
41
|
examples: ['kg', 'ton'],
|
|
@@ -47,7 +47,7 @@ const ContaminationLevelSchema = z
|
|
|
47
47
|
description: 'Level of contamination in the waste batch',
|
|
48
48
|
examples: ['Low', 'Medium', 'None'],
|
|
49
49
|
});
|
|
50
|
-
const
|
|
50
|
+
const MassIDWasteClassificationSchema = z
|
|
51
51
|
.strictObject({
|
|
52
52
|
primary_type: WasteTypeSchema.meta({
|
|
53
53
|
title: 'Primary Waste Type',
|
|
@@ -57,8 +57,8 @@ const WasteClassificationSchema = z
|
|
|
57
57
|
title: 'Waste Subtype',
|
|
58
58
|
description: 'Specific subcategory of waste material',
|
|
59
59
|
}),
|
|
60
|
-
local_classification:
|
|
61
|
-
measurement_unit:
|
|
60
|
+
local_classification: MassIDLocalClassificationSchema.optional(),
|
|
61
|
+
measurement_unit: MassIDMeasurementUnitSchema,
|
|
62
62
|
net_weight: NonNegativeFloatSchema.meta({
|
|
63
63
|
title: 'Net Weight',
|
|
64
64
|
description: 'Net weight of the waste batch in the specified measurement unit',
|
|
@@ -175,7 +175,7 @@ const EventDocumentSchema = z
|
|
|
175
175
|
title: 'Event Document',
|
|
176
176
|
description: 'Supporting event document',
|
|
177
177
|
});
|
|
178
|
-
const
|
|
178
|
+
const MassIDChainOfCustodyEventSchema = z
|
|
179
179
|
.strictObject({
|
|
180
180
|
event_id: UuidSchema.meta({
|
|
181
181
|
title: 'Event ID',
|
|
@@ -186,7 +186,9 @@ const ChainOfCustodyEventSchema = z
|
|
|
186
186
|
description: 'Name of custody or processing event',
|
|
187
187
|
examples: ['Sorting', 'Processing', 'Recycling', 'Weighing'],
|
|
188
188
|
}),
|
|
189
|
-
description: NonEmptyStringSchema.max(200)
|
|
189
|
+
description: NonEmptyStringSchema.max(200)
|
|
190
|
+
.optional()
|
|
191
|
+
.meta({
|
|
190
192
|
title: 'Event Description',
|
|
191
193
|
description: 'Detailed description of what happened during this event',
|
|
192
194
|
examples: [
|
|
@@ -231,9 +233,9 @@ const ChainOfCustodyEventSchema = z
|
|
|
231
233
|
title: 'Chain of Custody Event',
|
|
232
234
|
description: 'Chain of custody event',
|
|
233
235
|
});
|
|
234
|
-
const
|
|
236
|
+
const MassIDChainOfCustodySchema = z
|
|
235
237
|
.strictObject({
|
|
236
|
-
events: z.array(
|
|
238
|
+
events: z.array(MassIDChainOfCustodyEventSchema).min(1).meta({
|
|
237
239
|
title: 'Custody Events',
|
|
238
240
|
description: 'Chronological sequence of custody transfer and processing events',
|
|
239
241
|
}),
|
|
@@ -250,7 +252,7 @@ const ChainOfCustodySchema = z
|
|
|
250
252
|
title: 'Chain of Custody',
|
|
251
253
|
description: 'Complete chain of custody tracking from waste generation to final processing',
|
|
252
254
|
});
|
|
253
|
-
const
|
|
255
|
+
const MassIDTransportRouteSchema = z
|
|
254
256
|
.strictObject({
|
|
255
257
|
from_location_id: UuidSchema.meta({
|
|
256
258
|
title: 'From Location ID',
|
|
@@ -287,7 +289,7 @@ const TransportRouteSchema = z
|
|
|
287
289
|
title: 'Transport Route',
|
|
288
290
|
description: 'Transport route segment information',
|
|
289
291
|
});
|
|
290
|
-
const
|
|
292
|
+
const MassIDGeographicDataSchema = z
|
|
291
293
|
.strictObject({
|
|
292
294
|
origin_location_id: UuidSchema.meta({
|
|
293
295
|
title: 'Origin Location ID',
|
|
@@ -301,7 +303,7 @@ const GeographicDataSchema = z
|
|
|
301
303
|
title: 'Final Destination ID',
|
|
302
304
|
description: 'Reference to final destination in the locations array',
|
|
303
305
|
}),
|
|
304
|
-
transport_routes: z.array(
|
|
306
|
+
transport_routes: z.array(MassIDTransportRouteSchema).meta({
|
|
305
307
|
title: 'Transport Routes',
|
|
306
308
|
description: 'Detailed transport route information',
|
|
307
309
|
}),
|
|
@@ -312,7 +314,7 @@ const GeographicDataSchema = z
|
|
|
312
314
|
});
|
|
313
315
|
export const MassIDDataSchema = z
|
|
314
316
|
.strictObject({
|
|
315
|
-
waste_classification:
|
|
317
|
+
waste_classification: MassIDWasteClassificationSchema,
|
|
316
318
|
locations: uniqueBy(LocationSchema, (loc) => loc.id, 'Location IDs must be unique')
|
|
317
319
|
.min(1)
|
|
318
320
|
.meta({
|
|
@@ -325,8 +327,8 @@ export const MassIDDataSchema = z
|
|
|
325
327
|
title: 'Participants',
|
|
326
328
|
description: 'All participants referenced in this MassID, indexed by ID',
|
|
327
329
|
}),
|
|
328
|
-
chain_of_custody:
|
|
329
|
-
geographic_data:
|
|
330
|
+
chain_of_custody: MassIDChainOfCustodySchema,
|
|
331
|
+
geographic_data: MassIDGeographicDataSchema,
|
|
330
332
|
})
|
|
331
333
|
.refine((data) => {
|
|
332
334
|
const participantIdSet = new Set(data.participants.map((participant) => participant.id));
|
|
@@ -87,6 +87,12 @@ declare const MassIDAttributesSchema: z.ZodTuple<[z.ZodObject<{
|
|
|
87
87
|
display_type: z.ZodLiteral<"date">;
|
|
88
88
|
}, z.core.$strict>], null>;
|
|
89
89
|
export type MassIDAttributes = z.infer<typeof MassIDAttributesSchema>;
|
|
90
|
+
export declare const MassIDIpfsSchemaMeta: {
|
|
91
|
+
readonly title: "MassID NFT IPFS Record";
|
|
92
|
+
readonly description: "Complete MassID NFT IPFS record including fixed attributes and detailed waste tracking data";
|
|
93
|
+
readonly $id: "https://raw.githubusercontent.com/carrot-foundation/schemas/refs/heads/main/schemas/ipfs/mass-id/mass-id.schema.json";
|
|
94
|
+
readonly version: "1.0.1";
|
|
95
|
+
};
|
|
90
96
|
export declare const MassIDIpfsSchema: z.ZodObject<{
|
|
91
97
|
$schema: z.ZodURL;
|
|
92
98
|
created_at: z.ZodISODateTime;
|
|
@@ -208,7 +214,7 @@ export declare const MassIDIpfsSchema: z.ZodObject<{
|
|
|
208
214
|
id: z.ZodUUID;
|
|
209
215
|
municipality: z.ZodString;
|
|
210
216
|
administrative_division: z.ZodString;
|
|
211
|
-
administrative_division_code: z.ZodString
|
|
217
|
+
administrative_division_code: z.ZodOptional<z.ZodString>;
|
|
212
218
|
country: z.ZodString;
|
|
213
219
|
country_code: z.ZodString;
|
|
214
220
|
responsible_participant_id: z.ZodUUID;
|
|
@@ -223,7 +229,7 @@ export declare const MassIDIpfsSchema: z.ZodObject<{
|
|
|
223
229
|
country: "country";
|
|
224
230
|
}>;
|
|
225
231
|
}, z.core.$strict>;
|
|
226
|
-
facility_type: z.ZodEnum<{
|
|
232
|
+
facility_type: z.ZodOptional<z.ZodEnum<{
|
|
227
233
|
"Waste Generation": "Waste Generation";
|
|
228
234
|
"Collection Point": "Collection Point";
|
|
229
235
|
"Transfer Station": "Transfer Station";
|
|
@@ -233,7 +239,7 @@ export declare const MassIDIpfsSchema: z.ZodObject<{
|
|
|
233
239
|
"Processing Facility": "Processing Facility";
|
|
234
240
|
"Disposal Facility": "Disposal Facility";
|
|
235
241
|
"Administrative Office": "Administrative Office";
|
|
236
|
-
}
|
|
242
|
+
}>>;
|
|
237
243
|
}, z.core.$strict>>;
|
|
238
244
|
participants: z.ZodArray<z.ZodObject<{
|
|
239
245
|
id: z.ZodUUID;
|
|
@@ -244,7 +250,7 @@ export declare const MassIDIpfsSchema: z.ZodObject<{
|
|
|
244
250
|
events: z.ZodArray<z.ZodObject<{
|
|
245
251
|
event_id: z.ZodUUID;
|
|
246
252
|
event_name: z.ZodString;
|
|
247
|
-
description: z.ZodString
|
|
253
|
+
description: z.ZodOptional<z.ZodString>;
|
|
248
254
|
timestamp: z.ZodISODateTime;
|
|
249
255
|
participant_id: z.ZodUUID;
|
|
250
256
|
location_id: z.ZodUUID;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mass-id.schema.d.ts","sourceRoot":"","sources":["../../src/mass-id/mass-id.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,QAAA,MAAM,wBAAwB;;;kBAQ1B,CA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
|
|
|
139
139
|
title: 'MassID Attributes',
|
|
140
140
|
description: 'Fixed set of MassID NFT attributes in required order',
|
|
141
141
|
});
|
|
142
|
+
export const MassIDIpfsSchemaMeta = {
|
|
143
|
+
title: 'MassID NFT IPFS Record',
|
|
144
|
+
description: 'Complete MassID NFT IPFS record including fixed attributes and detailed waste tracking data',
|
|
145
|
+
$id: 'https://raw.githubusercontent.com/carrot-foundation/schemas/refs/heads/main/schemas/ipfs/mass-id/mass-id.schema.json',
|
|
146
|
+
version: '1.0.1',
|
|
147
|
+
};
|
|
142
148
|
export const MassIDIpfsSchema = NftIpfsSchema.safeExtend({
|
|
143
149
|
schema: NftIpfsSchema.shape.schema.safeExtend({
|
|
144
150
|
type: z.literal('MassID').meta({
|
|
@@ -154,9 +160,4 @@ export const MassIDIpfsSchema = NftIpfsSchema.safeExtend({
|
|
|
154
160
|
title: 'MassID Data',
|
|
155
161
|
description: 'MassID-specific data containing waste tracking and chain of custody information',
|
|
156
162
|
}),
|
|
157
|
-
}).meta(
|
|
158
|
-
title: 'MassID NFT IPFS Record',
|
|
159
|
-
description: 'Complete MassID NFT IPFS record including fixed attributes and detailed waste tracking data',
|
|
160
|
-
$id: 'https://raw.githubusercontent.com/carrot-foundation/schemas/refs/heads/main/schemas/ipfs/mass-id/mass-id.schema.json',
|
|
161
|
-
version: '1.0.0',
|
|
162
|
-
});
|
|
163
|
+
}).meta(MassIDIpfsSchemaMeta);
|
|
@@ -23,7 +23,7 @@ export declare const LocationSchema: z.ZodObject<{
|
|
|
23
23
|
id: z.ZodUUID;
|
|
24
24
|
municipality: z.ZodString;
|
|
25
25
|
administrative_division: z.ZodString;
|
|
26
|
-
administrative_division_code: z.ZodString
|
|
26
|
+
administrative_division_code: z.ZodOptional<z.ZodString>;
|
|
27
27
|
country: z.ZodString;
|
|
28
28
|
country_code: z.ZodString;
|
|
29
29
|
responsible_participant_id: z.ZodUUID;
|
|
@@ -38,7 +38,7 @@ export declare const LocationSchema: z.ZodObject<{
|
|
|
38
38
|
country: "country";
|
|
39
39
|
}>;
|
|
40
40
|
}, z.core.$strict>;
|
|
41
|
-
facility_type: z.ZodEnum<{
|
|
41
|
+
facility_type: z.ZodOptional<z.ZodEnum<{
|
|
42
42
|
"Waste Generation": "Waste Generation";
|
|
43
43
|
"Collection Point": "Collection Point";
|
|
44
44
|
"Transfer Station": "Transfer Station";
|
|
@@ -48,7 +48,7 @@ export declare const LocationSchema: z.ZodObject<{
|
|
|
48
48
|
"Processing Facility": "Processing Facility";
|
|
49
49
|
"Disposal Facility": "Disposal Facility";
|
|
50
50
|
"Administrative Office": "Administrative Office";
|
|
51
|
-
}
|
|
51
|
+
}>>;
|
|
52
52
|
}, z.core.$strict>;
|
|
53
53
|
export type Location = z.infer<typeof LocationSchema>;
|
|
54
54
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"location.schema.d.ts","sourceRoot":"","sources":["../../../src/shared/entities/location.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,QAAA,MAAM,oBAAoB;;;;;;EAMtB,CAAC;AAEL,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,iBAAiB;;;;;;;;;;kBAe1B,CAAC;AACL,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"location.schema.d.ts","sourceRoot":"","sources":["../../../src/shared/entities/location.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,QAAA,MAAM,oBAAoB;;;;;;EAMtB,CAAC;AAEL,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,iBAAiB;;;;;;;;;;kBAe1B,CAAC;AACL,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA2CvB,CAAC;AAEL,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
|
|
@@ -39,7 +39,7 @@ export const LocationSchema = z
|
|
|
39
39
|
description: 'State, province, or administrative region',
|
|
40
40
|
examples: ['California', 'Ontario', 'Bavaria', 'Queensland'],
|
|
41
41
|
}),
|
|
42
|
-
administrative_division_code: IsoAdministrativeDivisionCodeSchema.meta({
|
|
42
|
+
administrative_division_code: IsoAdministrativeDivisionCodeSchema.optional().meta({
|
|
43
43
|
title: 'Administrative Division Code',
|
|
44
44
|
description: 'ISO 3166-2 administrative division code',
|
|
45
45
|
}),
|
|
@@ -57,7 +57,7 @@ export const LocationSchema = z
|
|
|
57
57
|
description: 'ID of the participant responsible for this location',
|
|
58
58
|
}),
|
|
59
59
|
coordinates: CoordinatesSchema,
|
|
60
|
-
facility_type: FacilityTypeSchema.meta({
|
|
60
|
+
facility_type: FacilityTypeSchema.optional().meta({
|
|
61
61
|
title: 'Facility Type',
|
|
62
62
|
description: 'Type of facility at this location',
|
|
63
63
|
}),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carrot-foundation/schemas",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.15",
|
|
4
4
|
"description": "Carrot schema definitions and zod validation schemas",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"private": false,
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
"dist/**/*",
|
|
25
25
|
"schemas/**/*"
|
|
26
26
|
],
|
|
27
|
-
"packageManager": "pnpm@10.14.0",
|
|
28
27
|
"engines": {
|
|
29
28
|
"node": ">=22"
|
|
30
29
|
},
|
|
@@ -43,22 +42,6 @@
|
|
|
43
42
|
"type": "git",
|
|
44
43
|
"url": "https://github.com/carrot-foundation/schemas.git"
|
|
45
44
|
},
|
|
46
|
-
"scripts": {
|
|
47
|
-
"build": "tsc",
|
|
48
|
-
"check-refs": "node scripts/check-refs.js",
|
|
49
|
-
"clean": "rm -rf dist",
|
|
50
|
-
"generate-ipfs-schemas": "node scripts/generate-ipfs-schemas.js",
|
|
51
|
-
"lint": "eslint .",
|
|
52
|
-
"lint:fix": "eslint . --fix",
|
|
53
|
-
"pkgJsonLint": "npmPkgJsonLint .",
|
|
54
|
-
"prebuild": "pnpm clean",
|
|
55
|
-
"pregenerate-ipfs-schemas": "pnpm build",
|
|
56
|
-
"preinstall": "npx only-allow pnpm",
|
|
57
|
-
"prepare": "husky",
|
|
58
|
-
"prepublishOnly": "pnpm build",
|
|
59
|
-
"type-check": "tsc --noEmit",
|
|
60
|
-
"validate-schemas": "node scripts/validate-schemas.js"
|
|
61
|
-
},
|
|
62
45
|
"dependencies": {
|
|
63
46
|
"zod": "4.1.9"
|
|
64
47
|
},
|
|
@@ -85,5 +68,19 @@
|
|
|
85
68
|
},
|
|
86
69
|
"publishConfig": {
|
|
87
70
|
"access": "public"
|
|
71
|
+
},
|
|
72
|
+
"scripts": {
|
|
73
|
+
"build": "tsc",
|
|
74
|
+
"check-refs": "node scripts/check-refs.js",
|
|
75
|
+
"clean": "rm -rf dist",
|
|
76
|
+
"generate-ipfs-schemas": "node scripts/generate-ipfs-schemas.js",
|
|
77
|
+
"lint": "eslint .",
|
|
78
|
+
"lint:fix": "eslint . --fix",
|
|
79
|
+
"pkgJsonLint": "npmPkgJsonLint .",
|
|
80
|
+
"prebuild": "pnpm clean",
|
|
81
|
+
"pregenerate-ipfs-schemas": "pnpm build",
|
|
82
|
+
"preinstall": "npx only-allow pnpm",
|
|
83
|
+
"type-check": "tsc --noEmit",
|
|
84
|
+
"validate-schemas": "node scripts/validate-schemas.js"
|
|
88
85
|
}
|
|
89
|
-
}
|
|
86
|
+
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"title": "MassID NFT IPFS Record",
|
|
4
4
|
"description": "Complete MassID NFT IPFS record including fixed attributes and detailed waste tracking data",
|
|
5
5
|
"$id": "https://raw.githubusercontent.com/carrot-foundation/schemas/refs/heads/main/schemas/ipfs/mass-id/mass-id.schema.json",
|
|
6
|
-
"version": "1.0.
|
|
6
|
+
"version": "1.0.1",
|
|
7
7
|
"type": "object",
|
|
8
8
|
"properties": {
|
|
9
9
|
"$schema": {
|
|
@@ -438,12 +438,10 @@
|
|
|
438
438
|
"id",
|
|
439
439
|
"municipality",
|
|
440
440
|
"administrative_division",
|
|
441
|
-
"administrative_division_code",
|
|
442
441
|
"country",
|
|
443
442
|
"country_code",
|
|
444
443
|
"responsible_participant_id",
|
|
445
|
-
"coordinates"
|
|
446
|
-
"facility_type"
|
|
444
|
+
"coordinates"
|
|
447
445
|
],
|
|
448
446
|
"additionalProperties": false
|
|
449
447
|
}
|
|
@@ -763,7 +761,6 @@
|
|
|
763
761
|
"required": [
|
|
764
762
|
"event_id",
|
|
765
763
|
"event_name",
|
|
766
|
-
"description",
|
|
767
764
|
"timestamp",
|
|
768
765
|
"participant_id",
|
|
769
766
|
"location_id"
|