@toolproof-npm/schema 0.1.31 → 0.1.33

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/_lib/test.js CHANGED
@@ -5,15 +5,15 @@ const Job = {
5
5
  uri: 'uri',
6
6
  roles: {
7
7
  inputMap: {
8
- 'RR-1234': {
9
- resourceTypeId: 'RT-1234',
8
+ 'ROLE-1234': {
9
+ resourceTypeId: 'TYPE-1234',
10
10
  name: 'name',
11
11
  description: 'description'
12
12
  }
13
13
  },
14
14
  outputMap: {
15
- 'RR-5678': {
16
- resourceTypeId: 'RT-5678',
15
+ 'ROLE-5678': {
16
+ resourceTypeId: 'TYPE-5678',
17
17
  name: 'name',
18
18
  description: 'description'
19
19
  }
@@ -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
- resourceTypeId: 'RT-ID',
70
+ resourceTypeId: 'TYPE-ID',
71
71
  creationContext: {
72
- resourceRoleId: 'RR-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
- resourceTypeId: 'RT-ID',
84
+ resourceTypeId: 'TYPE-ID',
85
85
  creationContext: {
86
- resourceRoleId: 'RR-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
- resourceTypeId: 'RT-ID',
98
+ resourceTypeId: 'TYPE-ID',
99
99
  creationContext: {
100
- resourceRoleId: 'RR-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
- resourceTypeId: 'RT-ID',
111
+ resourceTypeId: 'TYPE-ID',
112
112
  creationContext: {
113
- resourceRoleId: 'RR-ID',
113
+ resourceRoleId: 'ROLE-ID',
114
114
  executionId: 'EXECUTION-ID',
115
115
  },
116
116
  kind: 'realized',
@@ -1,8 +1,8 @@
1
1
  // Auto-generated strict composite type. Do not edit.
2
- export type ResourceData_Job = ResourceCanonicalMetaBase & {
2
+ export type ResourceData_Job = ResourceMetaBase & {
3
3
  extractedData: Job;
4
4
  };
5
- export type ResourceCanonicalMetaBase = ResourceBase &
5
+ export type ResourceMetaBase = ResourceBase &
6
6
  ResourceKind & {
7
7
  kind: "realized";
8
8
  } & Path &
@@ -27,8 +27,6 @@ export type CombinedEntry =
27
27
  | Path
28
28
  | PendingRef
29
29
  | ResourceBase
30
- | ResourceCanonicalMeta
31
- | ResourceCanonicalMetaBase
32
30
  | ResourceData
33
31
  | ResourceFormatData
34
32
  | ResourceFormatId
@@ -37,11 +35,14 @@ export type CombinedEntry =
37
35
  | ResourceKind
38
36
  | ResourceMap
39
37
  | ResourceMeta
38
+ | ResourceMetaBase
40
39
  | ResourcePotentialInput
41
40
  | ResourcePotentialOutput
41
+ | ResourceRawMeta
42
42
  | ResourceRoleId
43
43
  | ResourceRoleValue
44
44
  | ResourceSocket
45
+ | ResourceTypeBase
45
46
  | ResourceTypeData
46
47
  | ResourceTypeId
47
48
  | ResourceTypeMeta
@@ -55,7 +56,6 @@ export type CombinedEntry =
55
56
  | StepId
56
57
  | StepKind
57
58
  | Timestamp
58
- | TypeBase
59
59
  | Uri
60
60
  | WhileStep
61
61
  | WhileStepId
@@ -298,30 +298,25 @@ export type ResourceBase = Identifiable & {
298
298
  * via the `definition` "ResourceTypeId".
299
299
  */
300
300
  export type ResourceTypeId = string;
301
- export type ResourceCanonicalMeta = ResourceBase &
302
- ResourceKind & {
303
- kind: "realized";
304
- } & Path &
305
- Timestamp;
306
- /**
307
- * This interface was referenced by `GenesisJson`'s JSON-Schema
308
- * via the `definition` "ResourceCanonicalMetaBase".
309
- */
310
- export type ResourceCanonicalMetaBase = ResourceBase &
311
- ResourceKind & {
312
- kind: "realized";
313
- } & Path &
314
- Timestamp;
315
301
  /**
316
302
  * This interface was referenced by `GenesisJson`'s JSON-Schema
317
303
  * via the `definition` "ResourceData".
318
304
  */
319
- export type ResourceData = ResourceCanonicalMetaBase & {
305
+ export type ResourceData = ResourceMetaBase & {
320
306
  extractedData: {
321
307
  identity: string | number | boolean;
322
308
  [k: string]: JsonValue;
323
309
  };
324
310
  };
311
+ /**
312
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
313
+ * via the `definition` "ResourceMetaBase".
314
+ */
315
+ export type ResourceMetaBase = ResourceBase &
316
+ ResourceKind & {
317
+ kind: "realized";
318
+ } & Path &
319
+ Timestamp;
325
320
  /**
326
321
  * This interface was referenced by `GenesisJson`'s JSON-Schema
327
322
  * via the `definition` "ResourceFormatData".
@@ -348,11 +343,16 @@ export type ResourcePotentialOutput = ResourceBase &
348
343
  ResourceKind & {
349
344
  kind: "potential-output";
350
345
  };
346
+ export type ResourceMeta = ResourceBase &
347
+ ResourceKind & {
348
+ kind: "realized";
349
+ } & Path &
350
+ Timestamp;
351
351
  /**
352
352
  * This interface was referenced by `GenesisJson`'s JSON-Schema
353
- * via the `definition` "ResourceMeta".
353
+ * via the `definition` "ResourceRawMeta".
354
354
  */
355
- export type ResourceMeta = ResourceBase & CanonicalRef & Timestamp;
355
+ export type ResourceRawMeta = ResourceBase & CanonicalRef & Timestamp;
356
356
  /**
357
357
  * This interface was referenced by `GenesisJson`'s JSON-Schema
358
358
  * via the `definition` "ResourceRoleValue".
@@ -362,22 +362,22 @@ export type ResourceRoleValue = {
362
362
  } & Documented;
363
363
  /**
364
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".
365
+ * via the `definition` "ResourceTypeBase".
371
366
  */
372
- export type TypeBase = IdentifiableDocumented & {
367
+ export type ResourceTypeBase = IdentifiableDocumented & {
373
368
  id: ResourceTypeId;
374
369
  resourceFormatId: ResourceFormatId;
375
370
  };
371
+ /**
372
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
373
+ * via the `definition` "ResourceTypeData".
374
+ */
375
+ export type ResourceTypeData = ResourceTypeBase & ExtractionSchema;
376
376
  /**
377
377
  * This interface was referenced by `GenesisJson`'s JSON-Schema
378
378
  * via the `definition` "ResourceTypeMeta".
379
379
  */
380
- export type ResourceTypeMeta = TypeBase &
380
+ export type ResourceTypeMeta = ResourceTypeBase &
381
381
  Path & {
382
382
  };
383
383
  /**
@@ -434,9 +434,9 @@ export type WorkflowSpec = Identifiable & {
434
434
  export type WorkflowSpecId = string;
435
435
  /**
436
436
  * This interface was referenced by `GenesisJson`'s JSON-Schema
437
- * via the `definition` "ResourceCanonicalMeta".
437
+ * via the `definition` "ResourceMeta".
438
438
  */
439
- export type ResourceCanonicalMetaBase1 = ResourceBase &
439
+ export type ResourceMetaBase1 = ResourceBase &
440
440
  ResourceKind & {
441
441
  kind: "realized";
442
442
  } & Path &
@@ -632,7 +632,7 @@ export interface RoleBindingsOuter1 {
632
632
  * This interface was referenced by `GenesisJson`'s JSON-Schema
633
633
  * via the `definition` "RoleMap".
634
634
  */
635
- export type RoleMap = Record<ResourceRoleId, RoleLiteral>;
635
+ export type RoleMap = Record<ResourceRoleId, ResourceRoleValue>;
636
636
  /**
637
637
  * This interface was referenced by `GenesisJson`'s JSON-Schema
638
638
  * via the `definition` "RolesInner".
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, 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';
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, ResourceRawMeta as ResourceRawMetaJson, 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
5
  export { unsafeBrand, asResourceTypeId, asResourceRoleId, asExecutionId, asResourceId, asWorkStepId, asBranchStepId, asForStepId, asResourceFormatId, asWhileStepId, asWorkflowId, asWorkflowSpecId, asResourceTypeIds, asResourceRoleIds, asExecutionIds, asResourceIds, asWorkStepIds, asBranchStepIds, asForStepIds, asResourceFormatIds, asWhileStepIds, asWorkflowIds, asWorkflowSpecIds, } from './scripts/brandFactories.js';
@@ -533,7 +533,7 @@
533
533
  "type": "object",
534
534
  "properties": {
535
535
  "pendingRef": {
536
- "$comment": "This points to a resource created at a previous step in the same workflow. This resource is not yet realized at the time of defining the workflow, but will be realized when the step using this resource is executed.The Engine resolves this pointer at runtime.",
536
+ "$comment": "This points to a resource created at a previous step in the same workflow. This resource is not yet realized at the time of defining the workflow, but will be realized when the step using this resource is executed.The Engine resolves this ref at runtime.",
537
537
  "$ref": "#/$defs/ResourceSocket"
538
538
  }
539
539
  },
@@ -575,48 +575,12 @@
575
575
  ],
576
576
  "$anchor": "ResourceBase"
577
577
  },
578
- "ResourceCanonicalMeta": {
579
- "$schema": "https://json-schema.org/draft/2020-12/schema",
580
- "type": "object",
581
- "unevaluatedProperties": false,
582
- "$anchor": "ResourceCanonicalMeta",
583
- "$ref": "#/$defs/ResourceCanonicalMetaBase"
584
- },
585
- "ResourceCanonicalMetaBase": {
586
- "$schema": "https://json-schema.org/draft/2020-12/schema",
587
- "type": "object",
588
- "allOf": [
589
- {
590
- "$ref": "#/$defs/ResourceBase"
591
- },
592
- {
593
- "$ref": "#/$defs/ResourceKind"
594
- },
595
- {
596
- "properties": {
597
- "kind": {
598
- "const": "realized"
599
- }
600
- },
601
- "required": [
602
- "kind"
603
- ]
604
- },
605
- {
606
- "$ref": "#/$defs/Path"
607
- },
608
- {
609
- "$ref": "#/$defs/Timestamp"
610
- }
611
- ],
612
- "$anchor": "ResourceCanonicalMetaBase"
613
- },
614
578
  "ResourceData": {
615
579
  "$schema": "https://json-schema.org/draft/2020-12/schema",
616
580
  "type": "object",
617
581
  "allOf": [
618
582
  {
619
- "$ref": "#/$defs/ResourceCanonicalMetaBase"
583
+ "$ref": "#/$defs/ResourceMetaBase"
620
584
  },
621
585
  {
622
586
  "properties": {
@@ -663,7 +627,7 @@
663
627
  "$schema": "https://json-schema.org/draft/2020-12/schema",
664
628
  "type": "string",
665
629
  "$anchor": "ResourceFormatId",
666
- "pattern": "^RF-.+$"
630
+ "pattern": "^FORMAT-.+$"
667
631
  },
668
632
  "ResourceFormatMeta": {
669
633
  "$schema": "https://json-schema.org/draft/2020-12/schema",
@@ -731,6 +695,13 @@
731
695
  }
732
696
  },
733
697
  "ResourceMeta": {
698
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
699
+ "type": "object",
700
+ "unevaluatedProperties": false,
701
+ "$anchor": "ResourceMeta",
702
+ "$ref": "#/$defs/ResourceMetaBase"
703
+ },
704
+ "ResourceMetaBase": {
734
705
  "$schema": "https://json-schema.org/draft/2020-12/schema",
735
706
  "type": "object",
736
707
  "allOf": [
@@ -738,14 +709,26 @@
738
709
  "$ref": "#/$defs/ResourceBase"
739
710
  },
740
711
  {
741
- "$ref": "#/$defs/CanonicalRef"
712
+ "$ref": "#/$defs/ResourceKind"
713
+ },
714
+ {
715
+ "properties": {
716
+ "kind": {
717
+ "const": "realized"
718
+ }
719
+ },
720
+ "required": [
721
+ "kind"
722
+ ]
723
+ },
724
+ {
725
+ "$ref": "#/$defs/Path"
742
726
  },
743
727
  {
744
728
  "$ref": "#/$defs/Timestamp"
745
729
  }
746
730
  ],
747
- "unevaluatedProperties": false,
748
- "$anchor": "ResourceMeta"
731
+ "$anchor": "ResourceMetaBase"
749
732
  },
750
733
  "ResourcePotentialInput": {
751
734
  "$schema": "https://json-schema.org/draft/2020-12/schema",
@@ -798,11 +781,28 @@
798
781
  "unevaluatedProperties": false,
799
782
  "$anchor": "ResourcePotentialOutput"
800
783
  },
784
+ "ResourceRawMeta": {
785
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
786
+ "type": "object",
787
+ "allOf": [
788
+ {
789
+ "$ref": "#/$defs/ResourceBase"
790
+ },
791
+ {
792
+ "$ref": "#/$defs/CanonicalRef"
793
+ },
794
+ {
795
+ "$ref": "#/$defs/Timestamp"
796
+ }
797
+ ],
798
+ "unevaluatedProperties": false,
799
+ "$anchor": "ResourceRawMeta"
800
+ },
801
801
  "ResourceRoleId": {
802
802
  "$schema": "https://json-schema.org/draft/2020-12/schema",
803
803
  "type": "string",
804
804
  "$anchor": "ResourceRoleId",
805
- "pattern": "^RR-.+$"
805
+ "pattern": "^ROLE-.+$"
806
806
  },
807
807
  "ResourceRoleValue": {
808
808
  "$schema": "https://json-schema.org/draft/2020-12/schema",
@@ -841,12 +841,36 @@
841
841
  ],
842
842
  "$anchor": "ResourceSocket"
843
843
  },
844
+ "ResourceTypeBase": {
845
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
846
+ "type": "object",
847
+ "allOf": [
848
+ {
849
+ "$ref": "#/$defs/IdentifiableDocumented"
850
+ },
851
+ {
852
+ "properties": {
853
+ "id": {
854
+ "$ref": "#/$defs/ResourceTypeId"
855
+ },
856
+ "resourceFormatId": {
857
+ "$ref": "#/$defs/ResourceFormatId"
858
+ }
859
+ },
860
+ "required": [
861
+ "id",
862
+ "resourceFormatId"
863
+ ]
864
+ }
865
+ ],
866
+ "$anchor": "ResourceTypeBase"
867
+ },
844
868
  "ResourceTypeData": {
845
869
  "$schema": "https://json-schema.org/draft/2020-12/schema",
846
870
  "type": "object",
847
871
  "allOf": [
848
872
  {
849
- "$ref": "#/$defs/TypeBase"
873
+ "$ref": "#/$defs/ResourceTypeBase"
850
874
  },
851
875
  {
852
876
  "$ref": "#/$defs/ExtractionSchema"
@@ -858,14 +882,14 @@
858
882
  "$schema": "https://json-schema.org/draft/2020-12/schema",
859
883
  "type": "string",
860
884
  "$anchor": "ResourceTypeId",
861
- "pattern": "^RT-.+$"
885
+ "pattern": "^TYPE-.+$"
862
886
  },
863
887
  "ResourceTypeMeta": {
864
888
  "$schema": "https://json-schema.org/draft/2020-12/schema",
865
889
  "type": "object",
866
890
  "allOf": [
867
891
  {
868
- "$ref": "#/$defs/TypeBase"
892
+ "$ref": "#/$defs/ResourceTypeBase"
869
893
  },
870
894
  {
871
895
  "$ref": "#/$defs/Path"
@@ -874,10 +898,10 @@
874
898
  "if": {
875
899
  "properties": {
876
900
  "resourceFormatId": {
877
- "const": "RF-ApplicationJson"
901
+ "const": "FORMAT-ApplicationJson"
878
902
  }
879
903
  },
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."
904
+ "$comment": "If resourceFormatId is FORMAT-ApplicationJson, then uri must not be present, but if resourceFormatId 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."
881
905
  },
882
906
  "then": {
883
907
  "not": {
@@ -1048,30 +1072,6 @@
1048
1072
  ],
1049
1073
  "$anchor": "Timestamp"
1050
1074
  },
1051
- "TypeBase": {
1052
- "$schema": "https://json-schema.org/draft/2020-12/schema",
1053
- "type": "object",
1054
- "allOf": [
1055
- {
1056
- "$ref": "#/$defs/IdentifiableDocumented"
1057
- },
1058
- {
1059
- "properties": {
1060
- "id": {
1061
- "$ref": "#/$defs/ResourceTypeId"
1062
- },
1063
- "resourceFormatId": {
1064
- "$ref": "#/$defs/ResourceFormatId"
1065
- }
1066
- },
1067
- "required": [
1068
- "id",
1069
- "resourceFormatId"
1070
- ]
1071
- }
1072
- ],
1073
- "$anchor": "TypeBase"
1074
- },
1075
1075
  "Uri": {
1076
1076
  "$schema": "https://json-schema.org/draft/2020-12/schema",
1077
1077
  "type": "object",
@@ -149,13 +149,13 @@
149
149
  "$schema": "https://json-schema.org/draft/2020-12/schema",
150
150
  "type": "string",
151
151
  "$anchor": "ResourceRoleId",
152
- "pattern": "^RR-.+$"
152
+ "pattern": "^ROLE-.+$"
153
153
  },
154
154
  "ResourceTypeId": {
155
155
  "$schema": "https://json-schema.org/draft/2020-12/schema",
156
156
  "type": "string",
157
157
  "$anchor": "ResourceTypeId",
158
- "pattern": "^RT-.+$"
158
+ "pattern": "^TYPE-.+$"
159
159
  }
160
160
  }
161
161
  }
@@ -19,13 +19,13 @@ export function unsafeBrand(s) {
19
19
  return s;
20
20
  }
21
21
  // Known patterns from schemas (when available)
22
- const RE_RT_ID = /^RT-.+$/;
22
+ const RE_TYPE_ID = /^TYPE-.+$/;
23
23
  const RE_SIGNATURE_ID = /^SIGNATURE-.+$/;
24
24
  const RE_JOB_ID = /^JOB-.+$/;
25
- const RE_RR_ID = /^RR-.+$/;
25
+ const RE_ROLE_ID = /^ROLE-.+$/;
26
26
  // Factories for each Id-like type
27
- export const asResourceTypeId = makeFactory("ResourceTypeId", RE_RT_ID);
28
- export const asResourceRoleId = makeFactory("ResourceRoleId", RE_RR_ID);
27
+ export const asResourceTypeId = makeFactory("ResourceTypeId", RE_TYPE_ID);
28
+ export const asResourceRoleId = makeFactory("ResourceRoleId", RE_ROLE_ID);
29
29
  // IDs without strict regex patterns in the current schemas: keep unchecked casts.
30
30
  export const asExecutionId = makeFactory("ExecutionId");
31
31
  export const asResourceId = makeFactory("ResourceId");
@@ -52,7 +52,7 @@ async function main() {
52
52
  title: `ResourceData_${name}`,
53
53
  type: 'object',
54
54
  allOf: [
55
- { $ref: './Genesis.json#/$defs/ResourceCanonicalMetaBase' },
55
+ { $ref: './Genesis.json#/$defs/ResourceMetaBase' },
56
56
  {
57
57
  type: 'object',
58
58
  required: ['extractedData'],
@@ -185,7 +185,7 @@ async function main() {
185
185
  }
186
186
  });
187
187
  // Remove permissive index signatures that make interfaces open-ended.
188
- // Keep meaningful map-like signatures (e.g., `[k: string]: RoleLiteral`) intact.
188
+ // Keep meaningful map-like signatures (e.g., `[k: string]: ResourceRoleValue`) intact.
189
189
  // Robust single-pass: delete the entire line (with optional trailing newline) where the signature appears.
190
190
  // This avoids introducing extra blank lines while handling CRLF/LF and varying indentation.
191
191
  ts = ts.replace(/^\s*\[k:\s*string\]:\s*unknown;\s*(?:\r?\n)?/gm, '');
@@ -331,7 +331,7 @@ async function main() {
331
331
  });
332
332
  // Post-process map-like interfaces to enforce key constraints via template literal Id types.
333
333
  // Replace index-signature interfaces with Record<IdType, ValueType> so object literal keys are checked.
334
- ts = ts.replace(/export interface RoleMap\s*{[^}]*}/g, 'export type RoleMap = Record<ResourceRoleId, RoleLiteral>;');
334
+ ts = ts.replace(/export interface RoleMap\s*{[^}]*}/g, 'export type RoleMap = Record<ResourceRoleId, ResourceRoleValue>;');
335
335
  ts = ts.replace(/export interface RoleBindingMap\s*{[^}]*}/g, 'export type RoleBindingMap = Record<ResourceRoleId, ResourceId>;');
336
336
  ts = ts.replace(/export interface ResourceMap\s*\{[^}]*\{[^}]*\}[^}]*\}/gs, 'export type ResourceMap = Record<ExecutionId, Record<ResourceRoleId, ResourcePotentialInput | ResourcePotentialOutput | ResourceData>>;');
337
337
  parts.push(ts);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toolproof-npm/schema",
3
- "version": "0.1.31",
3
+ "version": "0.1.33",
4
4
  "description": "JSON schemas and TypeScript types for ToolProof",
5
5
  "keywords": [
6
6
  "toolproof",