@toolproof-npm/schema 0.1.28 → 0.1.30

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 CHANGED
@@ -1,59 +1,59 @@
1
- # @toolproof-npm/schema
2
-
3
- JSON schemas and TypeScript types for ToolProof...
4
-
5
- ## Installation
6
-
7
- ```bash
8
- pnpm add @toolproof-npm/schema
9
- # or
10
- npm install @toolproof-npm/schema
11
- # or
12
- yarn add @toolproof-npm/schema
13
- ```
14
-
15
- ## Usage
16
-
17
- ### Import Schemas and Types
18
-
19
- ```typescript
20
- import { /* schemas and types */ } from '@toolproof-npm/schema';
21
- ```
22
-
23
- ## Features
24
-
25
- - JSON Schema definitions with $defs subschemas
26
- - Generated TypeScript types from JSON schemas
27
- - Runtime schema validation support
28
- - Extractors for non-JSON resource types
29
- - Schema bundling utilities
30
-
31
- ## Development
32
-
33
- ### Generate Types
34
-
35
- ```bash
36
- pnpm run generateTypes
37
- ```
38
-
39
- ### Build
40
-
41
- ```bash
42
- pnpm run build
43
- ```
44
-
45
- ### Update (Clean build + generate types)
46
-
47
- ```bash
48
- pnpm run update
49
- ```
50
-
51
- ## Requirements
52
-
53
- - Node.js 16+
54
- - TypeScript 4.5+ (for TypeScript projects)
55
-
56
- ## License
57
-
58
- MIT
59
-
1
+ # @toolproof-npm/schema
2
+
3
+ JSON schemas and TypeScript types for ToolProof...
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pnpm add @toolproof-npm/schema
9
+ # or
10
+ npm install @toolproof-npm/schema
11
+ # or
12
+ yarn add @toolproof-npm/schema
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ ### Import Schemas and Types
18
+
19
+ ```typescript
20
+ import { /* schemas and types */ } from '@toolproof-npm/schema';
21
+ ```
22
+
23
+ ## Features
24
+
25
+ - JSON Schema definitions with $defs subschemas
26
+ - Generated TypeScript types from JSON schemas
27
+ - Runtime schema validation support
28
+ - Extractors for non-JSON resource types
29
+ - Schema bundling utilities
30
+
31
+ ## Development
32
+
33
+ ### Generate Types
34
+
35
+ ```bash
36
+ pnpm run generateTypes
37
+ ```
38
+
39
+ ### Build
40
+
41
+ ```bash
42
+ pnpm run build
43
+ ```
44
+
45
+ ### Update (Clean build + generate types)
46
+
47
+ ```bash
48
+ pnpm run update
49
+ ```
50
+
51
+ ## Requirements
52
+
53
+ - Node.js 16+
54
+ - TypeScript 4.5+ (for TypeScript projects)
55
+
56
+ ## License
57
+
58
+ MIT
59
+
package/dist/_lib/test.js CHANGED
@@ -6,14 +6,14 @@ const Job = {
6
6
  roles: {
7
7
  inputMap: {
8
8
  'ROLE-1234': {
9
- typeId: 'TYPE-1234',
9
+ resourceTypeId: 'RT-1234',
10
10
  name: 'name',
11
11
  description: 'description'
12
12
  }
13
13
  },
14
14
  outputMap: {
15
15
  'ROLE-5678': {
16
- typeId: 'TYPE-5678',
16
+ resourceTypeId: 'RT-5678',
17
17
  name: 'name',
18
18
  description: 'description'
19
19
  }
@@ -28,14 +28,14 @@ const jobAlpha = {
28
28
  roles: {
29
29
  inputMap: {
30
30
  'data-input': {
31
- typeId: 'typeId',
31
+ resourceTypeId: 'resourceTypeId',
32
32
  name: 'name',
33
33
  description: 'description'
34
34
  }
35
35
  },
36
36
  outputMap: {
37
37
  'data-output': {
38
- typeId: 'typeId',
38
+ resourceTypeId: 'resourceTypeId',
39
39
  name: 'name',
40
40
  description: 'description'
41
41
  }
@@ -50,14 +50,14 @@ const jobBeta = {
50
50
  roles: {
51
51
  inputMap: {
52
52
  'data-input': {
53
- typeId: 'typeId',
53
+ resourceTypeId: 'resourceTypeId',
54
54
  name: 'name',
55
55
  description: 'description'
56
56
  }
57
57
  },
58
58
  /* outputMap: {
59
59
  'data-output': {
60
- typeId: 'typeId',
60
+ resourceTypeId: 'resourceTypeId',
61
61
  name: 'name',
62
62
  description: 'description'
63
63
  }
@@ -67,9 +67,9 @@ const jobBeta = {
67
67
  // This checks (no error expected); we're providing all required fields
68
68
  const resourceDataJobAlpha = {
69
69
  id: 'RESOURCE-1',
70
- typeId: 'TYPE-ID',
70
+ resourceTypeId: 'RT-ID',
71
71
  creationContext: {
72
- roleId: 'ROLE-ID',
72
+ resourceRoleId: 'ROLE-ID',
73
73
  executionId: 'EXECUTION-ID',
74
74
  },
75
75
  kind: 'realized',
@@ -81,9 +81,9 @@ const resourceDataJobAlpha = {
81
81
  // This SHOULD fail (missing path) once ResourceData_Job enforces Path strictly.
82
82
  const resourceDataJobAlpha2 = {
83
83
  id: 'RESOURCE-3',
84
- typeId: 'TYPE-ID',
84
+ resourceTypeId: 'RT-ID',
85
85
  creationContext: {
86
- roleId: 'ROLE-ID',
86
+ resourceRoleId: 'ROLE-ID',
87
87
  executionId: 'EXECUTION-ID',
88
88
  },
89
89
  kind: 'realized',
@@ -95,9 +95,9 @@ const resourceDataJobAlpha2 = {
95
95
  // This should fail; we're missing extractedData
96
96
  const resourceDataJobAlpha3 = {
97
97
  id: 'RESOURCE-2',
98
- typeId: 'TYPE-ID',
98
+ resourceTypeId: 'RT-ID',
99
99
  creationContext: {
100
- roleId: 'ROLE-ID',
100
+ resourceRoleId: 'ROLE-ID',
101
101
  executionId: 'EXECUTION-ID',
102
102
  },
103
103
  kind: 'realized',
@@ -108,9 +108,9 @@ const resourceDataJobAlpha3 = {
108
108
  // This SHOULD fail (missing roles.outputMap) once Job's roles is strictly enforced.
109
109
  const resourceDataJobBeta = {
110
110
  id: 'RESOURCE-4',
111
- typeId: 'TYPE-ID',
111
+ resourceTypeId: 'RT-ID',
112
112
  creationContext: {
113
- roleId: 'ROLE-ID',
113
+ resourceRoleId: 'ROLE-ID',
114
114
  executionId: 'EXECUTION-ID',
115
115
  },
116
116
  kind: 'realized',
@@ -10,7 +10,7 @@ export type ResourceCanonicalMetaBase = ResourceBase &
10
10
  export type ResourceBase = Identifiable & {
11
11
  id: string;
12
12
  } & {
13
- typeId: string;
13
+ resourceTypeId: string;
14
14
  } & CreationContext;
15
15
  export type Job = Documented &
16
16
  RolesOuter &
@@ -24,14 +24,14 @@ export type Job = Documented &
24
24
  export type Documented = Name & Description;
25
25
  /**
26
26
  * This interface was referenced by `undefined`'s JSON-Schema
27
- * via the `definition` "RoleLiteral".
27
+ * via the `definition` "ResourceRoleValue".
28
28
  */
29
- export type RoleLiteral = {
29
+ export type ResourceRoleValue = {
30
30
  /**
31
31
  * This interface was referenced by `undefined`'s JSON-Schema
32
- * via the `definition` "TypeId".
32
+ * via the `definition` "ResourceTypeId".
33
33
  */
34
- typeId: string;
34
+ resourceTypeId: string;
35
35
  } & Documented;
36
36
 
37
37
  export interface Identifiable {
@@ -41,7 +41,7 @@ export interface CreationContext {
41
41
  }
42
42
  export interface ResourceSocket {
43
43
  executionId: string;
44
- roleId: string;
44
+ resourceRoleId: string;
45
45
  }
46
46
  export interface ResourceKind {
47
47
  kind: "potential-input" | "potential-output" | "realized";
@@ -86,7 +86,7 @@ export interface RolesInner {
86
86
  * via the `definition` "RoleMap".
87
87
  */
88
88
  export interface RoleMap {
89
- [k: string]: RoleLiteral;
89
+ [k: string]: ResourceRoleValue;
90
90
  }
91
91
  /**
92
92
  * This interface was referenced by `undefined`'s JSON-Schema
@@ -15,9 +15,6 @@ export type CombinedEntry =
15
15
  | ForStep
16
16
  | ForStepId
17
17
  | FormatBase
18
- | FormatData
19
- | FormatId
20
- | FormatMeta
21
18
  | Identifiable
22
19
  | IdentifiableDocumented
23
20
  | IdentityProp
@@ -33,18 +30,24 @@ export type CombinedEntry =
33
30
  | ResourceCanonicalMeta
34
31
  | ResourceCanonicalMetaBase
35
32
  | ResourceData
33
+ | ResourceFormatData
34
+ | ResourceFormatId
35
+ | ResourceFormatMeta
36
36
  | ResourceId
37
37
  | ResourceKind
38
38
  | ResourceMap
39
39
  | ResourceMeta
40
40
  | ResourcePotentialInput
41
41
  | ResourcePotentialOutput
42
+ | ResourceRoleId
43
+ | ResourceRoleValue
42
44
  | ResourceSocket
45
+ | ResourceTypeData
46
+ | ResourceTypeId
47
+ | ResourceTypeMeta
43
48
  | RoleBindingMap
44
49
  | RoleBindingsInner
45
50
  | RoleBindingsOuter1
46
- | RoleId
47
- | RoleLiteral
48
51
  | RoleMap
49
52
  | RolesInner
50
53
  | RolesOuter
@@ -53,9 +56,6 @@ export type CombinedEntry =
53
56
  | StepKind
54
57
  | Timestamp
55
58
  | TypeBase
56
- | TypeData
57
- | TypeId
58
- | TypeMeta
59
59
  | Uri
60
60
  | WhileStep
61
61
  | WhileStepId
@@ -73,9 +73,9 @@ export type CombinedEntry =
73
73
  | Job_Description
74
74
  | Job_RolesInner
75
75
  | Job_RoleMap
76
- | Job_RoleLiteral
77
- | Job_RoleId
78
- | Job_TypeId;
76
+ | Job_ResourceRoleValue
77
+ | Job_ResourceRoleId
78
+ | Job_ResourceTypeId;
79
79
  /**
80
80
  * This interface was referenced by `GenesisJson`'s JSON-Schema
81
81
  * via the `definition` "BranchStep".
@@ -129,9 +129,9 @@ export type WorkStepId = string;
129
129
  export type BranchStepId = string;
130
130
  /**
131
131
  * This interface was referenced by `GenesisJson`'s JSON-Schema
132
- * via the `definition` "RoleId".
132
+ * via the `definition` "ResourceRoleId".
133
133
  */
134
- export type RoleId = string;
134
+ export type ResourceRoleId = string;
135
135
  /**
136
136
  * This interface was referenced by `GenesisJson`'s JSON-Schema
137
137
  * via the `definition` "Documented".
@@ -232,7 +232,7 @@ export type ForStepId = string;
232
232
  * via the `definition` "FormatBase".
233
233
  */
234
234
  export type FormatBase = IdentifiableDocumented & {
235
- id: FormatId;
235
+ id: ResourceFormatId;
236
236
  };
237
237
  /**
238
238
  * This interface was referenced by `GenesisJson`'s JSON-Schema
@@ -241,19 +241,9 @@ export type FormatBase = IdentifiableDocumented & {
241
241
  export type IdentifiableDocumented = Identifiable & Documented;
242
242
  /**
243
243
  * This interface was referenced by `GenesisJson`'s JSON-Schema
244
- * via the `definition` "FormatId".
244
+ * via the `definition` "ResourceFormatId".
245
245
  */
246
- export type FormatId = string;
247
- /**
248
- * This interface was referenced by `GenesisJson`'s JSON-Schema
249
- * via the `definition` "FormatData".
250
- */
251
- export type FormatData = FormatBase;
252
- /**
253
- * This interface was referenced by `GenesisJson`'s JSON-Schema
254
- * via the `definition` "FormatMeta".
255
- */
256
- export type FormatMeta = FormatBase & Path;
246
+ export type ResourceFormatId = string;
257
247
  export type Job = Job_Documented &
258
248
  Job_RolesOuter &
259
249
  Job_Uri & {
@@ -266,21 +256,21 @@ export type Job = Job_Documented &
266
256
  export type Job_Documented = Job_Name & Job_Description;
267
257
  /**
268
258
  * This interface was referenced by `undefined`'s JSON-Schema
269
- * via the `definition` "RoleLiteral".
259
+ * via the `definition` "ResourceRoleValue".
270
260
  */
271
- export type Job_RoleLiteral = {
272
- typeId: Job_TypeId;
261
+ export type Job_ResourceRoleValue = {
262
+ resourceTypeId: Job_ResourceTypeId;
273
263
  } & Job_Documented;
274
264
  /**
275
265
  * This interface was referenced by `undefined`'s JSON-Schema
276
- * via the `definition` "TypeId".
266
+ * via the `definition` "ResourceTypeId".
277
267
  */
278
- export type Job_TypeId = string;
268
+ export type Job_ResourceTypeId = string;
279
269
  /**
280
270
  * This interface was referenced by `undefined`'s JSON-Schema
281
- * via the `definition` "RoleId".
271
+ * via the `definition` "ResourceRoleId".
282
272
  */
283
- export type Job_RoleId = string;
273
+ export type Job_ResourceRoleId = string;
284
274
  /**
285
275
  * This interface was referenced by `GenesisJson`'s JSON-Schema
286
276
  * via the `definition` "JsonValue".
@@ -301,13 +291,13 @@ export type JsonValue =
301
291
  export type ResourceBase = Identifiable & {
302
292
  id: ResourceId;
303
293
  } & {
304
- typeId: TypeId;
294
+ resourceTypeId: ResourceTypeId;
305
295
  } & CreationContext;
306
296
  /**
307
297
  * This interface was referenced by `GenesisJson`'s JSON-Schema
308
- * via the `definition` "TypeId".
298
+ * via the `definition` "ResourceTypeId".
309
299
  */
310
- export type TypeId = string;
300
+ export type ResourceTypeId = string;
311
301
  export type ResourceCanonicalMeta = ResourceBase &
312
302
  ResourceKind & {
313
303
  kind: "realized";
@@ -332,6 +322,16 @@ export type ResourceData = ResourceCanonicalMetaBase & {
332
322
  [k: string]: JsonValue;
333
323
  };
334
324
  };
325
+ /**
326
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
327
+ * via the `definition` "ResourceFormatData".
328
+ */
329
+ export type ResourceFormatData = FormatBase;
330
+ /**
331
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
332
+ * via the `definition` "ResourceFormatMeta".
333
+ */
334
+ export type ResourceFormatMeta = FormatBase & Path;
335
335
  /**
336
336
  * This interface was referenced by `GenesisJson`'s JSON-Schema
337
337
  * via the `definition` "ResourcePotentialInput".
@@ -355,11 +355,31 @@ export type ResourcePotentialOutput = ResourceBase &
355
355
  export type ResourceMeta = ResourceBase & CanonicalRef & Timestamp;
356
356
  /**
357
357
  * This interface was referenced by `GenesisJson`'s JSON-Schema
358
- * via the `definition` "RoleLiteral".
358
+ * via the `definition` "ResourceRoleValue".
359
359
  */
360
- export type RoleLiteral = {
361
- typeId: TypeId;
360
+ export type ResourceRoleValue = {
361
+ resourceTypeId: ResourceTypeId;
362
362
  } & Documented;
363
+ /**
364
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
365
+ * via the `definition` "ResourceTypeData".
366
+ */
367
+ export type ResourceTypeData = TypeBase & ExtractionSchema;
368
+ /**
369
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
370
+ * via the `definition` "TypeBase".
371
+ */
372
+ export type TypeBase = IdentifiableDocumented & {
373
+ id: ResourceTypeId;
374
+ resourceFormatId: ResourceFormatId;
375
+ };
376
+ /**
377
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
378
+ * via the `definition` "ResourceTypeMeta".
379
+ */
380
+ export type ResourceTypeMeta = TypeBase &
381
+ Path & {
382
+ };
363
383
  /**
364
384
  * This interface was referenced by `GenesisJson`'s JSON-Schema
365
385
  * via the `definition` "Step".
@@ -385,26 +405,6 @@ export type WhileStepId = string;
385
405
  * via the `definition` "StepId".
386
406
  */
387
407
  export type StepId = WorkStepId | BranchStepId | WhileStepId | ForStepId;
388
- /**
389
- * This interface was referenced by `GenesisJson`'s JSON-Schema
390
- * via the `definition` "TypeBase".
391
- */
392
- export type TypeBase = IdentifiableDocumented & {
393
- formatId: FormatId;
394
- id: TypeId;
395
- };
396
- /**
397
- * This interface was referenced by `GenesisJson`'s JSON-Schema
398
- * via the `definition` "TypeData".
399
- */
400
- export type TypeData = TypeBase & ExtractionSchema;
401
- /**
402
- * This interface was referenced by `GenesisJson`'s JSON-Schema
403
- * via the `definition` "TypeMeta".
404
- */
405
- export type TypeMeta = TypeBase &
406
- Path & {
407
- };
408
408
  /**
409
409
  * This interface was referenced by `GenesisJson`'s JSON-Schema
410
410
  * via the `definition` "Workflow".
@@ -499,7 +499,7 @@ export interface CreationContext {
499
499
  */
500
500
  export interface ResourceSocket {
501
501
  executionId: ExecutionId;
502
- roleId: RoleId;
502
+ resourceRoleId: ResourceRoleId;
503
503
  }
504
504
  /**
505
505
  * This interface was referenced by `GenesisJson`'s JSON-Schema
@@ -541,13 +541,6 @@ export interface MeritProp {
541
541
  merit?: MeritValue;
542
542
  };
543
543
  }
544
- /**
545
- * This interface was referenced by `GenesisJson`'s JSON-Schema
546
- * via the `definition` "Path".
547
- */
548
- export interface Path {
549
- path: string;
550
- }
551
544
  /**
552
545
  * This interface was referenced by `undefined`'s JSON-Schema
553
546
  * via the `definition` "Name".
@@ -582,7 +575,7 @@ export interface Job_RolesInner {
582
575
  * via the `definition` "RoleMap".
583
576
  */
584
577
  export interface Job_RoleMap {
585
- [k: string]: Job_RoleLiteral;
578
+ [k: string]: Job_ResourceRoleValue;
586
579
  }
587
580
  /**
588
581
  * This interface was referenced by `undefined`'s JSON-Schema
@@ -591,6 +584,13 @@ export interface Job_RoleMap {
591
584
  export interface Job_Uri {
592
585
  uri: string;
593
586
  }
587
+ /**
588
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
589
+ * via the `definition` "Path".
590
+ */
591
+ export interface Path {
592
+ path: string;
593
+ }
594
594
  /**
595
595
  * This interface was referenced by `GenesisJson`'s JSON-Schema
596
596
  * via the `definition` "PendingRef".
@@ -600,7 +600,7 @@ export interface PendingRef {
600
600
  }
601
601
  export interface ResourceSocket1 {
602
602
  executionId: ExecutionId;
603
- roleId: RoleId;
603
+ resourceRoleId: ResourceRoleId;
604
604
  }
605
605
  /**
606
606
  * This interface was referenced by `GenesisJson`'s JSON-Schema
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { default as GenesisSchema } from './schemas/Genesis.js';
2
2
  export { default as JobSchema } from './schemas/Job.js';
3
3
  export type { ResourceData_Job as ResourceData_JobJson } from './_lib/types/ResourceData_Job.js';
4
- export type { Identifiable as IdentifiableJson, Documented as DocumentedJson, IdentifiableDocumented as IdentifiableDocumentedJson, FormatId as FormatIdJson, FormatMeta as FormatMetaJson, FormatData as FormatDataJson, ExtractionSchema as ExtractionSchemaJson, ExtractionSchemaValue as ExtractionSchemaValueJson, IdentityProp as IdentityPropJson, MeritProp as MeritPropJson, TypeId as TypeIdJson, TypeMeta as TypeMetaJson, TypeData as TypeDataJson, RoleId as RoleIdJson, RoleLiteral as RoleLiteralJson, ExecutionId as ExecutionIdJson, Execution as ExecutionJson, ConditionalWrapper as ConditionalWrapperJson, RoleMap as RoleMapJson, RolesOuter as RolesOuterJson, RoleBindingMap as RoleBindingMapJson, RoleBindingsOuter as RoleBindingsOuterJson, ResourceId as ResourceIdJson, WorkStepId as WorkStepIdJson, BranchStepId as BranchStepIdJson, WhileStepId as WhileStepIdJson, ForStepId as ForStepIdJson, WorkStep as WorkStepJson, BranchStep as BranchStepJson, WhileStep as WhileStepJson, ForStep as ForStepJson, StepId as StepIdJson, Step as StepJson, ResourceSocket as ResourceSocketJson, ResourcePotentialInput as ResourcePotentialInputJson, ResourcePotentialOutput as ResourcePotentialOutputJson, ResourceMeta as ResourceMetaJson, ResourceData as ResourceDataJson, ResourceMap as ResourceMapJson, WorkflowId as WorkflowIdJson, Workflow as WorkflowJson, WorkflowSpecId as WorkflowSpecIdJson, WorkflowSpec as WorkflowSpecJson, Job as JobJson, JsonValue as JsonValueJson, } from './_lib/types/types.js';
5
- export { unsafeBrand, asTypeId, asRoleId, asExecutionId, asResourceId, asWorkStepId, asBranchStepId, asForStepId, asFormatId, asWhileStepId, asWorkflowId, asWorkflowSpecId, asTypeIds, asRoleIds, asExecutionIds, asResourceIds, asWorkStepIds, asBranchStepIds, asForStepIds, asFormatIds, asWhileStepIds, asWorkflowIds, asWorkflowSpecIds, } from './scripts/brandFactories.js';
4
+ export type { Identifiable as IdentifiableJson, Documented as DocumentedJson, IdentifiableDocumented as IdentifiableDocumentedJson, ResourceFormatId as ResourceFormatIdJson, ResourceFormatMeta as ResourceFormatMetaJson, ResourceFormatData as ResourceFormatDataJson, ExtractionSchema as ExtractionSchemaJson, ExtractionSchemaValue as ExtractionSchemaValueJson, IdentityProp as IdentityPropJson, MeritProp as MeritPropJson, ResourceTypeId as ResourceTypeIdJson, ResourceTypeMeta as ResourceTypeMetaJson, ResourceTypeData as ResourceTypeDataJson, ResourceRoleId as ResourceRoleIdJson, ResourceRoleValue as ResourceRoleValueJson, ExecutionId as ExecutionIdJson, Execution as ExecutionJson, ConditionalWrapper as ConditionalWrapperJson, RoleMap as RoleMapJson, RolesOuter as RolesOuterJson, RoleBindingMap as RoleBindingMapJson, RoleBindingsOuter as RoleBindingsOuterJson, ResourceId as ResourceIdJson, WorkStepId as WorkStepIdJson, BranchStepId as BranchStepIdJson, WhileStepId as WhileStepIdJson, ForStepId as ForStepIdJson, WorkStep as WorkStepJson, BranchStep as BranchStepJson, WhileStep as WhileStepJson, ForStep as ForStepJson, StepId as StepIdJson, Step as StepJson, ResourceSocket as ResourceSocketJson, ResourcePotentialInput as ResourcePotentialInputJson, ResourcePotentialOutput as ResourcePotentialOutputJson, ResourceMeta as ResourceMetaJson, ResourceData as ResourceDataJson, ResourceMap as ResourceMapJson, WorkflowId as WorkflowIdJson, Workflow as WorkflowJson, WorkflowSpecId as WorkflowSpecIdJson, WorkflowSpec as WorkflowSpecJson, Job as JobJson, JsonValue as JsonValueJson, } from './_lib/types/types.js';
5
+ export { unsafeBrand, asResourceTypeId, asRoleId, asExecutionId, asResourceId, asWorkStepId, asBranchStepId, asForStepId, asResourceFormatId, asWhileStepId, asWorkflowId, asWorkflowSpecId, asResourceTypeIds, asRoleIds, asExecutionIds, asResourceIds, asWorkStepIds, asBranchStepIds, asForStepIds, asResourceFormatIds, asWhileStepIds, asWorkflowIds, asWorkflowSpecIds, } from './scripts/brandFactories.js';
package/dist/index.js CHANGED
@@ -2,4 +2,4 @@
2
2
  export { default as GenesisSchema } from './schemas/Genesis.js';
3
3
  export { default as JobSchema } from './schemas/Job.js';
4
4
  // Re-export brand factories so consumers can construct branded IDs at runtime.
5
- export { unsafeBrand, asTypeId, asRoleId, asExecutionId, asResourceId, asWorkStepId, asBranchStepId, asForStepId, asFormatId, asWhileStepId, asWorkflowId, asWorkflowSpecId, asTypeIds, asRoleIds, asExecutionIds, asResourceIds, asWorkStepIds, asBranchStepIds, asForStepIds, asFormatIds, asWhileStepIds, asWorkflowIds, asWorkflowSpecIds, } from './scripts/brandFactories.js';
5
+ export { unsafeBrand, asResourceTypeId, asRoleId, asExecutionId, asResourceId, asWorkStepId, asBranchStepId, asForStepId, asResourceFormatId, asWhileStepId, asWorkflowId, asWorkflowSpecId, asResourceTypeIds, asRoleIds, asExecutionIds, asResourceIds, asWorkStepIds, asBranchStepIds, asForStepIds, asResourceFormatIds, asWhileStepIds, asWorkflowIds, asWorkflowSpecIds, } from './scripts/brandFactories.js';
@@ -297,7 +297,7 @@
297
297
  {
298
298
  "properties": {
299
299
  "id": {
300
- "$ref": "#/$defs/FormatId"
300
+ "$ref": "#/$defs/ResourceFormatId"
301
301
  }
302
302
  },
303
303
  "required": [
@@ -307,37 +307,6 @@
307
307
  ],
308
308
  "$anchor": "FormatBase"
309
309
  },
310
- "FormatData": {
311
- "$schema": "https://json-schema.org/draft/2020-12/schema",
312
- "type": "object",
313
- "allOf": [
314
- {
315
- "$ref": "#/$defs/FormatBase"
316
- }
317
- ],
318
- "unevaluatedProperties": false,
319
- "$anchor": "FormatData"
320
- },
321
- "FormatId": {
322
- "$schema": "https://json-schema.org/draft/2020-12/schema",
323
- "type": "string",
324
- "$anchor": "FormatId",
325
- "pattern": "^FORMAT-.+$"
326
- },
327
- "FormatMeta": {
328
- "$schema": "https://json-schema.org/draft/2020-12/schema",
329
- "type": "object",
330
- "allOf": [
331
- {
332
- "$ref": "#/$defs/FormatBase"
333
- },
334
- {
335
- "$ref": "#/$defs/Path"
336
- }
337
- ],
338
- "unevaluatedProperties": false,
339
- "$anchor": "FormatMeta"
340
- },
341
310
  "Identifiable": {
342
311
  "type": "object",
343
312
  "required": [
@@ -592,12 +561,12 @@
592
561
  },
593
562
  {
594
563
  "properties": {
595
- "typeId": {
596
- "$ref": "#/$defs/TypeId"
564
+ "resourceTypeId": {
565
+ "$ref": "#/$defs/ResourceTypeId"
597
566
  }
598
567
  },
599
568
  "required": [
600
- "typeId"
569
+ "resourceTypeId"
601
570
  ]
602
571
  },
603
572
  {
@@ -679,6 +648,37 @@
679
648
  "unevaluatedProperties": false,
680
649
  "$anchor": "ResourceData"
681
650
  },
651
+ "ResourceFormatData": {
652
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
653
+ "type": "object",
654
+ "allOf": [
655
+ {
656
+ "$ref": "#/$defs/FormatBase"
657
+ }
658
+ ],
659
+ "unevaluatedProperties": false,
660
+ "$anchor": "ResourceFormatData"
661
+ },
662
+ "ResourceFormatId": {
663
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
664
+ "type": "string",
665
+ "$anchor": "ResourceFormatId",
666
+ "pattern": "^RF-.+$"
667
+ },
668
+ "ResourceFormatMeta": {
669
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
670
+ "type": "object",
671
+ "allOf": [
672
+ {
673
+ "$ref": "#/$defs/FormatBase"
674
+ },
675
+ {
676
+ "$ref": "#/$defs/Path"
677
+ }
678
+ ],
679
+ "unevaluatedProperties": false,
680
+ "$anchor": "ResourceFormatMeta"
681
+ },
682
682
  "ResourceId": {
683
683
  "$schema": "https://json-schema.org/draft/2020-12/schema",
684
684
  "type": "string",
@@ -722,7 +722,7 @@
722
722
  ]
723
723
  },
724
724
  "propertyNames": {
725
- "$ref": "#/$defs/RoleId"
725
+ "$ref": "#/$defs/ResourceRoleId"
726
726
  }
727
727
  },
728
728
  "$anchor": "ResourceMap",
@@ -798,6 +798,32 @@
798
798
  "unevaluatedProperties": false,
799
799
  "$anchor": "ResourcePotentialOutput"
800
800
  },
801
+ "ResourceRoleId": {
802
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
803
+ "type": "string",
804
+ "$anchor": "ResourceRoleId",
805
+ "pattern": "^RR-.+$"
806
+ },
807
+ "ResourceRoleValue": {
808
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
809
+ "type": "object",
810
+ "allOf": [
811
+ {
812
+ "properties": {
813
+ "resourceTypeId": {
814
+ "$ref": "#/$defs/ResourceTypeId"
815
+ }
816
+ },
817
+ "required": [
818
+ "resourceTypeId"
819
+ ]
820
+ },
821
+ {
822
+ "$ref": "#/$defs/Documented"
823
+ }
824
+ ],
825
+ "$anchor": "ResourceRoleValue"
826
+ },
801
827
  "ResourceSocket": {
802
828
  "$schema": "https://json-schema.org/draft/2020-12/schema",
803
829
  "type": "object",
@@ -805,16 +831,67 @@
805
831
  "executionId": {
806
832
  "$ref": "#/$defs/ExecutionId"
807
833
  },
808
- "roleId": {
809
- "$ref": "#/$defs/RoleId"
834
+ "resourceRoleId": {
835
+ "$ref": "#/$defs/ResourceRoleId"
810
836
  }
811
837
  },
812
838
  "required": [
813
- "roleId",
839
+ "resourceRoleId",
814
840
  "executionId"
815
841
  ],
816
842
  "$anchor": "ResourceSocket"
817
843
  },
844
+ "ResourceTypeData": {
845
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
846
+ "type": "object",
847
+ "allOf": [
848
+ {
849
+ "$ref": "#/$defs/TypeBase"
850
+ },
851
+ {
852
+ "$ref": "#/$defs/ExtractionSchema"
853
+ }
854
+ ],
855
+ "$anchor": "ResourceTypeData"
856
+ },
857
+ "ResourceTypeId": {
858
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
859
+ "type": "string",
860
+ "$anchor": "ResourceTypeId",
861
+ "pattern": "^RT-.+$"
862
+ },
863
+ "ResourceTypeMeta": {
864
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
865
+ "type": "object",
866
+ "allOf": [
867
+ {
868
+ "$ref": "#/$defs/TypeBase"
869
+ },
870
+ {
871
+ "$ref": "#/$defs/Path"
872
+ },
873
+ {
874
+ "if": {
875
+ "properties": {
876
+ "resourceFormatId": {
877
+ "const": "RF-ApplicationJson"
878
+ }
879
+ },
880
+ "$comment": "If resourceFormatId is RF-ApplicationJson, then uri must not be present, but if resourceFormatId is not RF-ApplicationJson, then uri must be present. This is because resources of types with format RF-ApplicationJson are self-contained and do not need an extractor."
881
+ },
882
+ "then": {
883
+ "not": {
884
+ "$ref": "#/$defs/Uri"
885
+ }
886
+ },
887
+ "else": {
888
+ "$ref": "#/$defs/Uri"
889
+ }
890
+ }
891
+ ],
892
+ "unevaluatedProperties": false,
893
+ "$anchor": "ResourceTypeMeta"
894
+ },
818
895
  "RoleBindingMap": {
819
896
  "$schema": "https://json-schema.org/draft/2020-12/schema",
820
897
  "type": "object",
@@ -823,7 +900,7 @@
823
900
  },
824
901
  "$anchor": "RoleBindingMap",
825
902
  "propertyNames": {
826
- "$ref": "#/$defs/RoleId"
903
+ "$ref": "#/$defs/ResourceRoleId"
827
904
  }
828
905
  },
829
906
  "RoleBindingsInner": {
@@ -857,41 +934,15 @@
857
934
  ],
858
935
  "$anchor": "RoleBindingsOuter"
859
936
  },
860
- "RoleId": {
861
- "$schema": "https://json-schema.org/draft/2020-12/schema",
862
- "type": "string",
863
- "$anchor": "RoleId",
864
- "pattern": "^ROLE-.+$"
865
- },
866
- "RoleLiteral": {
867
- "$schema": "https://json-schema.org/draft/2020-12/schema",
868
- "type": "object",
869
- "allOf": [
870
- {
871
- "properties": {
872
- "typeId": {
873
- "$ref": "#/$defs/TypeId"
874
- }
875
- },
876
- "required": [
877
- "typeId"
878
- ]
879
- },
880
- {
881
- "$ref": "#/$defs/Documented"
882
- }
883
- ],
884
- "$anchor": "RoleLiteral"
885
- },
886
937
  "RoleMap": {
887
938
  "$schema": "https://json-schema.org/draft/2020-12/schema",
888
939
  "type": "object",
889
940
  "additionalProperties": {
890
- "$ref": "#/$defs/RoleLiteral"
941
+ "$ref": "#/$defs/ResourceRoleValue"
891
942
  },
892
943
  "$anchor": "RoleMap",
893
944
  "propertyNames": {
894
- "$ref": "#/$defs/RoleId"
945
+ "$ref": "#/$defs/ResourceRoleId"
895
946
  }
896
947
  },
897
948
  "RolesInner": {
@@ -1006,72 +1057,21 @@
1006
1057
  },
1007
1058
  {
1008
1059
  "properties": {
1009
- "formatId": {
1010
- "$ref": "#/$defs/FormatId"
1011
- },
1012
1060
  "id": {
1013
- "$ref": "#/$defs/TypeId"
1061
+ "$ref": "#/$defs/ResourceTypeId"
1062
+ },
1063
+ "resourceFormatId": {
1064
+ "$ref": "#/$defs/ResourceFormatId"
1014
1065
  }
1015
1066
  },
1016
1067
  "required": [
1017
1068
  "id",
1018
- "formatId"
1069
+ "resourceFormatId"
1019
1070
  ]
1020
1071
  }
1021
1072
  ],
1022
1073
  "$anchor": "TypeBase"
1023
1074
  },
1024
- "TypeData": {
1025
- "$schema": "https://json-schema.org/draft/2020-12/schema",
1026
- "type": "object",
1027
- "allOf": [
1028
- {
1029
- "$ref": "#/$defs/TypeBase"
1030
- },
1031
- {
1032
- "$ref": "#/$defs/ExtractionSchema"
1033
- }
1034
- ],
1035
- "$anchor": "TypeData"
1036
- },
1037
- "TypeId": {
1038
- "$schema": "https://json-schema.org/draft/2020-12/schema",
1039
- "type": "string",
1040
- "$anchor": "TypeId",
1041
- "pattern": "^TYPE-.+$"
1042
- },
1043
- "TypeMeta": {
1044
- "$schema": "https://json-schema.org/draft/2020-12/schema",
1045
- "type": "object",
1046
- "allOf": [
1047
- {
1048
- "$ref": "#/$defs/TypeBase"
1049
- },
1050
- {
1051
- "$ref": "#/$defs/Path"
1052
- },
1053
- {
1054
- "if": {
1055
- "properties": {
1056
- "formatId": {
1057
- "const": "FORMAT-ApplicationJson"
1058
- }
1059
- },
1060
- "$comment": "If formatId is FORMAT-ApplicationJson, then uri must not be present, but if formatId is not FORMAT-ApplicationJson, then uri must be present. This is because resources of types with format FORMAT-ApplicationJson are self-contained and do not need an extractor."
1061
- },
1062
- "then": {
1063
- "not": {
1064
- "$ref": "#/$defs/Uri"
1065
- }
1066
- },
1067
- "else": {
1068
- "$ref": "#/$defs/Uri"
1069
- }
1070
- }
1071
- ],
1072
- "unevaluatedProperties": false,
1073
- "$anchor": "TypeMeta"
1074
- },
1075
1075
  "Uri": {
1076
1076
  "$schema": "https://json-schema.org/draft/2020-12/schema",
1077
1077
  "type": "object",
@@ -1237,5 +1237,5 @@
1237
1237
  "pattern": "^WORKFLOWSPEC-.+$"
1238
1238
  }
1239
1239
  },
1240
- "$comment": "This schema defines all genesis schemas used throughout the Toolproof ecosystem. The genesis schemas themselves are defined in $defs.<ResourceType>.extractionSchema. The build process (via extractSchemas.js) extracts these schemas and writes them to a separate file (src/schemas/Genesis.json). The reason for this indirection is to have all these schema envelopes validate positively against the schema at $defs/TypeData, effectively making them ResourceTypes, which are first-class citizens in the Toolproof ecosystem."
1240
+ "$comment": "This schema defines all genesis schemas used throughout the Toolproof ecosystem. The genesis schemas themselves are defined in $defs.<ResourceType>.extractionSchema. The build process (via extractSchemas.js) extracts these schemas and writes them to a separate file (src/schemas/Genesis.json). The reason for this indirection is to have all these schema envelopes validate positively against the schema at $defs/ResourceTypeData, effectively making them ResourceTypes, which are first-class citizens in the Toolproof ecosystem."
1241
1241
  }
@@ -118,44 +118,44 @@
118
118
  "$schema": "https://json-schema.org/draft/2020-12/schema",
119
119
  "type": "object",
120
120
  "additionalProperties": {
121
- "$ref": "#/$defs/RoleLiteral"
121
+ "$ref": "#/$defs/ResourceRoleValue"
122
122
  },
123
123
  "$anchor": "RoleMap",
124
124
  "propertyNames": {
125
- "$ref": "#/$defs/RoleId"
125
+ "$ref": "#/$defs/ResourceRoleId"
126
126
  }
127
127
  },
128
- "RoleLiteral": {
128
+ "ResourceRoleValue": {
129
129
  "$schema": "https://json-schema.org/draft/2020-12/schema",
130
130
  "type": "object",
131
131
  "allOf": [
132
132
  {
133
133
  "properties": {
134
- "typeId": {
135
- "$ref": "#/$defs/TypeId"
134
+ "resourceTypeId": {
135
+ "$ref": "#/$defs/ResourceTypeId"
136
136
  }
137
137
  },
138
138
  "required": [
139
- "typeId"
139
+ "resourceTypeId"
140
140
  ]
141
141
  },
142
142
  {
143
143
  "$ref": "#/$defs/Documented"
144
144
  }
145
145
  ],
146
- "$anchor": "RoleLiteral"
146
+ "$anchor": "ResourceRoleValue"
147
147
  },
148
- "RoleId": {
148
+ "ResourceRoleId": {
149
149
  "$schema": "https://json-schema.org/draft/2020-12/schema",
150
150
  "type": "string",
151
- "$anchor": "RoleId",
152
- "pattern": "^ROLE-.+$"
151
+ "$anchor": "ResourceRoleId",
152
+ "pattern": "^RR-.+$"
153
153
  },
154
- "TypeId": {
154
+ "ResourceTypeId": {
155
155
  "$schema": "https://json-schema.org/draft/2020-12/schema",
156
156
  "type": "string",
157
- "$anchor": "TypeId",
158
- "pattern": "^TYPE-.+$"
157
+ "$anchor": "ResourceTypeId",
158
+ "pattern": "^RT-.+$"
159
159
  }
160
160
  }
161
161
  }
@@ -1,25 +1,25 @@
1
- import type { ExecutionId, ResourceId, WorkStepId, BranchStepId, ForStepId, FormatId, TypeId, RoleId, WhileStepId, WorkflowId, WorkflowSpecId } from "../_lib/types/types.js";
1
+ import type { ExecutionId, ResourceId, WorkStepId, BranchStepId, ForStepId, ResourceFormatId, ResourceTypeId, ResourceRoleId, WhileStepId, WorkflowId, WorkflowSpecId } from "../_lib/types/types.js";
2
2
  /** Generic unsafe brand helper when a bespoke factory is not available. */
3
3
  export declare function unsafeBrand<T extends string>(s: string): T;
4
- export declare const asTypeId: (s: string) => string;
4
+ export declare const asResourceTypeId: (s: string) => string;
5
5
  export declare const asRoleId: (s: string) => string;
6
6
  export declare const asExecutionId: (s: string) => string;
7
7
  export declare const asResourceId: (s: string) => string;
8
8
  export declare const asWorkStepId: (s: string) => string;
9
9
  export declare const asBranchStepId: (s: string) => string;
10
10
  export declare const asForStepId: (s: string) => string;
11
- export declare const asFormatId: (s: string) => string;
11
+ export declare const asResourceFormatId: (s: string) => string;
12
12
  export declare const asWhileStepId: (s: string) => string;
13
13
  export declare const asWorkflowId: (s: string) => string;
14
14
  export declare const asWorkflowSpecId: (s: string) => string;
15
- export declare const asTypeIds: (xs: string[]) => TypeId[];
16
- export declare const asRoleIds: (xs: string[]) => RoleId[];
15
+ export declare const asResourceTypeIds: (xs: string[]) => ResourceTypeId[];
16
+ export declare const asRoleIds: (xs: string[]) => ResourceRoleId[];
17
17
  export declare const asExecutionIds: (xs: string[]) => ExecutionId[];
18
18
  export declare const asResourceIds: (xs: string[]) => ResourceId[];
19
19
  export declare const asWorkStepIds: (xs: string[]) => WorkStepId[];
20
20
  export declare const asBranchStepIds: (xs: string[]) => BranchStepId[];
21
21
  export declare const asForStepIds: (xs: string[]) => ForStepId[];
22
- export declare const asFormatIds: (xs: string[]) => FormatId[];
22
+ export declare const asResourceFormatIds: (xs: string[]) => ResourceFormatId[];
23
23
  export declare const asWhileStepIds: (xs: string[]) => WhileStepId[];
24
24
  export declare const asWorkflowIds: (xs: string[]) => WorkflowId[];
25
25
  export declare const asWorkflowSpecIds: (xs: string[]) => WorkflowSpecId[];
@@ -19,12 +19,12 @@ export function unsafeBrand(s) {
19
19
  return s;
20
20
  }
21
21
  // Known patterns from schemas (when available)
22
- const RE_TYPE_ID = /^TYPE-.+$/;
22
+ const RE_RT_ID = /^RT-.+$/;
23
23
  const RE_SIGNATURE_ID = /^SIGNATURE-.+$/;
24
24
  const RE_JOB_ID = /^JOB-.+$/;
25
25
  const RE_ROLE_ID = /^ROLE-.+$/;
26
26
  // Factories for each Id-like type
27
- export const asTypeId = makeFactory("TypeId", RE_TYPE_ID);
27
+ export const asResourceTypeId = makeFactory("ResourceTypeId", RE_RT_ID);
28
28
  export const asRoleId = makeFactory("RoleId", RE_ROLE_ID);
29
29
  // IDs without strict regex patterns in the current schemas: keep unchecked casts.
30
30
  export const asExecutionId = makeFactory("ExecutionId");
@@ -32,19 +32,19 @@ export const asResourceId = makeFactory("ResourceId");
32
32
  export const asWorkStepId = makeFactory("WorkStepId");
33
33
  export const asBranchStepId = makeFactory("BranchStepId");
34
34
  export const asForStepId = makeFactory("ForStepId");
35
- export const asFormatId = makeFactory("FormatId");
35
+ export const asResourceFormatId = makeFactory("ResourceFormatId");
36
36
  export const asWhileStepId = makeFactory("WhileStepId");
37
37
  export const asWorkflowId = makeFactory("WorkflowId");
38
38
  export const asWorkflowSpecId = makeFactory("WorkflowSpecId");
39
39
  // Batch helpers
40
- export const asTypeIds = (xs) => xs.map(asTypeId);
40
+ export const asResourceTypeIds = (xs) => xs.map(asResourceTypeId);
41
41
  export const asRoleIds = (xs) => xs.map(asRoleId);
42
42
  export const asExecutionIds = (xs) => xs.map(asExecutionId);
43
43
  export const asResourceIds = (xs) => xs.map(asResourceId);
44
44
  export const asWorkStepIds = (xs) => xs.map(asWorkStepId);
45
45
  export const asBranchStepIds = (xs) => xs.map(asBranchStepId);
46
46
  export const asForStepIds = (xs) => xs.map(asForStepId);
47
- export const asFormatIds = (xs) => xs.map(asFormatId);
47
+ export const asResourceFormatIds = (xs) => xs.map(asResourceFormatId);
48
48
  export const asWhileStepIds = (xs) => xs.map(asWhileStepId);
49
49
  export const asWorkflowIds = (xs) => xs.map(asWorkflowId);
50
50
  export const asWorkflowSpecIds = (xs) => xs.map(asWorkflowSpecId);
package/package.json CHANGED
@@ -1,48 +1,53 @@
1
1
  {
2
- "name": "@toolproof-npm/schema",
3
- "version": "0.1.28",
4
- "description": "JSON schemas and TypeScript types for ToolProof",
5
- "keywords": ["toolproof", "schemas", "json-schema", "typescript"],
6
- "author": "ToolProof Team",
7
- "license": "MIT",
8
- "repository": {
9
- "type": "git",
10
- "url": "https://github.com/ToolProof/core.git",
11
- "directory": "packages/_schemas"
12
- },
13
- "homepage": "https://github.com/ToolProof/core#readme",
14
- "bugs": {
15
- "url": "https://github.com/ToolProof/core/issues"
16
- },
17
- "type": "module",
18
- "main": "dist/index.js",
19
- "types": "dist/index.d.ts",
20
- "exports": {
21
- ".": {
22
- "import": "./dist/index.js",
23
- "types": "./dist/index.d.ts"
24
- }
25
- },
26
- "scripts": {
27
- "build": "tsc -b",
28
- "build:scripts": "tsc -p tsconfig.scripts.json",
29
- "extractSchemas": "node ./dist/scripts/extractSchemas.js",
30
- "extractSubschema": "node ./dist/scripts/extractSubschemaWithDefs.js",
31
- "generateTypes": "node ./dist/scripts/generateTypes.js",
32
- "generateResourceData": "node ./dist/scripts/generateResourceData.js",
33
- "update": "rimraf /s /q dist && pnpm run build:scripts && pnpm run extractSchemas -- --in src/genesis/Genesis.json --out src/schemas/Genesis.json --id 'https://schemas.toolproof.com/v0/Genesis.json' && pnpm run extractSubschema -- --name Job && pnpm run generateTypes && pnpm run generateResourceData -- --name Job && pnpm run build"
34
- },
35
- "files": [
36
- "dist",
37
- "README.md"
38
- ],
39
- "devDependencies": {
40
- "@apidevtools/json-schema-ref-parser": "^14.2.1",
41
- "@types/node": "^20.8.1",
42
- "ajv-cli": "^5.0.0",
43
- "ajv-formats": "^3.0.1",
44
- "json-schema-to-typescript": "^15.0.4",
45
- "rimraf": "^5.0.0",
46
- "typescript": "^5.0.0"
2
+ "name": "@toolproof-npm/schema",
3
+ "version": "0.1.30",
4
+ "description": "JSON schemas and TypeScript types for ToolProof",
5
+ "keywords": [
6
+ "toolproof",
7
+ "schemas",
8
+ "json-schema",
9
+ "typescript"
10
+ ],
11
+ "author": "ToolProof Team",
12
+ "license": "MIT",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "https://github.com/ToolProof/core.git",
16
+ "directory": "packages/_schemas"
17
+ },
18
+ "homepage": "https://github.com/ToolProof/core#readme",
19
+ "bugs": {
20
+ "url": "https://github.com/ToolProof/core/issues"
21
+ },
22
+ "type": "module",
23
+ "main": "dist/index.js",
24
+ "types": "dist/index.d.ts",
25
+ "exports": {
26
+ ".": {
27
+ "import": "./dist/index.js",
28
+ "types": "./dist/index.d.ts"
47
29
  }
30
+ },
31
+ "files": [
32
+ "dist",
33
+ "README.md"
34
+ ],
35
+ "devDependencies": {
36
+ "@apidevtools/json-schema-ref-parser": "^14.2.1",
37
+ "@types/node": "^20.8.1",
38
+ "ajv-cli": "^5.0.0",
39
+ "ajv-formats": "^3.0.1",
40
+ "json-schema-to-typescript": "^15.0.4",
41
+ "rimraf": "^5.0.0",
42
+ "typescript": "^5.0.0"
43
+ },
44
+ "scripts": {
45
+ "build": "tsc -b",
46
+ "build:scripts": "tsc -p tsconfig.scripts.json",
47
+ "extractSchemas": "node ./dist/scripts/extractSchemas.js",
48
+ "extractSubschema": "node ./dist/scripts/extractSubschemaWithDefs.js",
49
+ "generateTypes": "node ./dist/scripts/generateTypes.js",
50
+ "generateResourceData": "node ./dist/scripts/generateResourceData.js",
51
+ "update": "rimraf /s /q dist && pnpm run build:scripts && pnpm run extractSchemas -- --in src/genesis/Genesis.json --out src/schemas/Genesis.json --id 'https://schemas.toolproof.com/v0/Genesis.json' && pnpm run extractSubschema -- --name Job && pnpm run generateTypes && pnpm run generateResourceData -- --name Job && pnpm run build"
52
+ }
48
53
  }