@toolproof-core/schema 1.0.9 → 1.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/dist/generated/artifacts/constants.d.ts +121 -0
  2. package/dist/generated/artifacts/constants.js +121 -0
  3. package/dist/generated/artifacts/mappings.d.ts +23 -0
  4. package/dist/generated/artifacts/mappings.js +23 -0
  5. package/dist/generated/normalized/Genesis.json +117 -78
  6. package/dist/generated/resources/Genesis.json +489 -264
  7. package/dist/generated/schemas/Genesis.json +94 -61
  8. package/dist/generated/schemas/standalone/Job.json +9 -8
  9. package/dist/generated/schemas/standalone/RawStrategy.json +86 -110
  10. package/dist/generated/schemas/standalone/ResourceType.json +4 -4
  11. package/dist/generated/schemas/standalone/RunnableStrategy.json +115 -139
  12. package/dist/generated/schemas/standalone/StrategyRun.json +93 -117
  13. package/dist/generated/types/standalone/Resource_Genesis.d.ts +1 -1
  14. package/dist/generated/types/standalone/Resource_Job.d.ts +1 -1
  15. package/dist/generated/types/standalone/Resource_RawStrategy.d.ts +1 -1
  16. package/dist/generated/types/standalone/Resource_ResourceType.d.ts +1 -1
  17. package/dist/generated/types/standalone/Resource_RunnableStrategy.d.ts +1 -1
  18. package/dist/generated/types/types.d.ts +247 -239
  19. package/dist/index.d.ts +6 -3
  20. package/dist/index.js +5 -2
  21. package/dist/scripts/_lib/config.d.ts +3 -5
  22. package/dist/scripts/_lib/config.js +8 -14
  23. package/dist/scripts/generateConstantsAndMappings.d.ts +31 -0
  24. package/dist/scripts/generateConstantsAndMappings.js +243 -0
  25. package/dist/scripts/generateDependencies.js +1 -1
  26. package/dist/scripts/generateStandaloneType.js +2 -1
  27. package/dist/scripts/generateTerminals.js +2 -2
  28. package/dist/scripts/generateTypes.js +183 -5
  29. package/dist/scripts/wrapResourceTypesWithResourceShells.js +7 -3
  30. package/package.json +9 -10
  31. package/src/Genesis.json +1873 -1833
  32. package/src/generated/artifacts/constants.ts +122 -0
  33. package/src/generated/{dependencies → artifacts}/dependencyMap.json +282 -280
  34. package/src/generated/artifacts/mappings.ts +24 -0
  35. package/src/generated/{dependencies → artifacts}/terminals.json +13 -11
  36. package/src/generated/normalized/Genesis.json +1785 -1746
  37. package/src/generated/resources/Genesis.json +2833 -2608
  38. package/src/generated/schemas/Genesis.json +1348 -1315
  39. package/src/generated/schemas/standalone/Job.json +195 -194
  40. package/src/generated/schemas/standalone/RawStrategy.json +86 -110
  41. package/src/generated/schemas/standalone/ResourceType.json +106 -106
  42. package/src/generated/schemas/standalone/RunnableStrategy.json +645 -669
  43. package/src/generated/schemas/standalone/StrategyRun.json +913 -937
  44. package/src/generated/types/standalone/Resource_Genesis.d.ts +3 -3
  45. package/src/generated/types/standalone/Resource_Job.d.ts +3 -3
  46. package/src/generated/types/standalone/Resource_RawStrategy.d.ts +3 -3
  47. package/src/generated/types/standalone/Resource_ResourceType.d.ts +3 -3
  48. package/src/generated/types/standalone/Resource_RunnableStrategy.d.ts +3 -3
  49. package/src/generated/types/types.d.ts +717 -709
  50. package/src/index.ts +77 -70
  51. package/src/scripts/_lib/config.ts +207 -215
  52. package/src/scripts/extractSchemasFromResourceTypeShells.ts +261 -261
  53. package/src/scripts/generateConstantsAndMappings.ts +309 -0
  54. package/src/scripts/generateDependencies.ts +121 -121
  55. package/src/scripts/generateSchemaShims.ts +127 -127
  56. package/src/scripts/generateStandaloneSchema.ts +185 -185
  57. package/src/scripts/generateStandaloneType.ts +129 -127
  58. package/src/scripts/generateTerminals.ts +73 -73
  59. package/src/scripts/generateTypes.ts +733 -531
  60. package/src/scripts/normalizeAnchorsToPointers.ts +141 -141
  61. package/src/scripts/wrapResourceTypesWithResourceShells.ts +86 -82
  62. package/dist/generated/constants/constants.d.ts +0 -60
  63. package/dist/generated/constants/constants.js +0 -60
  64. package/dist/scripts/generateConstants.d.ts +0 -12
  65. package/dist/scripts/generateConstants.js +0 -179
  66. package/src/generated/constants/constants.ts +0 -61
  67. package/src/scripts/generateConstants.ts +0 -217
@@ -188,8 +188,8 @@
188
188
  },
189
189
  "allOf": [
190
190
  {
191
- "$comment": "The Engine runs jobs specified by steps in strategyThreadMap. The Engine also injects repeted steps when encountering loops.",
192
- "$ref": "#/$defs/StrategyThreadMapFacet"
191
+ "$comment": "The Engine runs jobs specified by steps in strategyThreadDict. The Engine also injects repeted steps when encountering loops.",
192
+ "$ref": "#/$defs/StrategyThreadDictFacet"
193
193
  },
194
194
  {
195
195
  "$comment": "The Engine updates strategyState with materialized Resources upon job completions and runtime-provided input events. It also inserts inputPotential and outputPotential Resources upon step injections.",
@@ -297,15 +297,15 @@
297
297
  },
298
298
  "unevaluatedProperties": false
299
299
  },
300
- "StrategyThreadMapFacet": {
300
+ "StrategyThreadDictFacet": {
301
301
  "$schema": "https://json-schema.org/draft/2020-12/schema",
302
302
  "type": "object",
303
303
  "required": [
304
- "strategyThreadMap"
304
+ "strategyThreadDict"
305
305
  ],
306
306
  "properties": {
307
- "strategyThreadMap": {
308
- "$ref": "#/$defs/StrategyThreadMap"
307
+ "strategyThreadDict": {
308
+ "$ref": "#/$defs/StrategyThreadDict"
309
309
  }
310
310
  }
311
311
  },
@@ -380,7 +380,7 @@
380
380
  "cancelled"
381
381
  ]
382
382
  },
383
- "StrategyThreadMap": {
383
+ "StrategyThreadDict": {
384
384
  "$schema": "https://json-schema.org/draft/2020-12/schema",
385
385
  "type": "object",
386
386
  "propertyNames": {
@@ -447,7 +447,14 @@
447
447
  "$ref": "#/$defs/ResourceRoleIdentity"
448
448
  },
449
449
  "additionalProperties": {
450
- "$ref": "#/$defs/Resource"
450
+ "oneOf": [
451
+ {
452
+ "$ref": "#/$defs/ResourcePotential"
453
+ },
454
+ {
455
+ "$ref": "#/$defs/Resource"
456
+ }
457
+ ]
451
458
  }
452
459
  },
453
460
  "JobStep": {
@@ -564,7 +571,7 @@
564
571
  "type": "string",
565
572
  "pattern": "^ROLE-.+$"
566
573
  },
567
- "Resource": {
574
+ "ResourcePotential": {
568
575
  "$schema": "https://json-schema.org/draft/2020-12/schema",
569
576
  "type": "object",
570
577
  "oneOf": [
@@ -576,9 +583,20 @@
576
583
  },
577
584
  {
578
585
  "$ref": "#/$defs/ResourceOutputPotential"
586
+ }
587
+ ],
588
+ "unevaluatedProperties": false
589
+ },
590
+ "Resource": {
591
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
592
+ "type": "object",
593
+ "allOf": [
594
+ {
595
+ "$ref": "#/$defs/ShellMaterializedBase"
579
596
  },
580
597
  {
581
- "$ref": "#/$defs/ResourceMaterialized"
598
+ "$comment": "This will be overlayed dynamically to match the data structure of the underlying ResourceType's nucleusSchema.",
599
+ "$ref": "#/$defs/NucleusFacet"
582
600
  }
583
601
  ],
584
602
  "unevaluatedProperties": false
@@ -647,19 +665,48 @@
647
665
  "$ref": "#/$defs/ShellOutputPotential",
648
666
  "unevaluatedProperties": false
649
667
  },
650
- "ResourceMaterialized": {
668
+ "ShellMaterializedBase": {
651
669
  "$schema": "https://json-schema.org/draft/2020-12/schema",
652
670
  "type": "object",
671
+ "required": [
672
+ "version",
673
+ "resourceShellKind"
674
+ ],
675
+ "properties": {
676
+ "version": {
677
+ "const": 1
678
+ },
679
+ "resourceShellKind": {
680
+ "const": "materialized"
681
+ }
682
+ },
653
683
  "allOf": [
654
684
  {
655
- "$ref": "#/$defs/ShellMaterializedBase"
685
+ "$ref": "#/$defs/ResourceShellBase"
656
686
  },
657
687
  {
658
- "$comment": "This will be overlayed dynamically to match the data structure of the underlying ResourceType's nucleusSchema.",
659
- "$ref": "#/$defs/NucleusFacet"
688
+ "$ref": "#/$defs/CreationContextFacet"
689
+ },
690
+ {
691
+ "$ref": "#/$defs/ResourceShellKindFacet"
692
+ },
693
+ {
694
+ "$ref": "#/$defs/TimestampFacet"
695
+ },
696
+ {
697
+ "$ref": "#/$defs/PathFacet"
660
698
  }
699
+ ]
700
+ },
701
+ "NucleusFacet": {
702
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
703
+ "type": "object",
704
+ "required": [
705
+ "nucleus"
661
706
  ],
662
- "unevaluatedProperties": false
707
+ "properties": {
708
+ "nucleus": true
709
+ }
663
710
  },
664
711
  "RoleBindings": {
665
712
  "$schema": "https://json-schema.org/draft/2020-12/schema",
@@ -680,8 +727,11 @@
680
727
  "ShellMissing": {
681
728
  "$schema": "https://json-schema.org/draft/2020-12/schema",
682
729
  "type": "object",
730
+ "required": [
731
+ "resourceShellKind"
732
+ ],
683
733
  "properties": {
684
- "resourceKind": {
734
+ "resourceShellKind": {
685
735
  "const": "missing"
686
736
  }
687
737
  },
@@ -690,7 +740,7 @@
690
740
  "$ref": "#/$defs/ResourceShellBase"
691
741
  },
692
742
  {
693
- "$ref": "#/$defs/ResourceKindFacet"
743
+ "$ref": "#/$defs/ResourceShellKindFacet"
694
744
  }
695
745
  ],
696
746
  "unevaluatedProperties": false
@@ -698,8 +748,11 @@
698
748
  "ShellInputPotential": {
699
749
  "$schema": "https://json-schema.org/draft/2020-12/schema",
700
750
  "type": "object",
751
+ "required": [
752
+ "resourceShellKind"
753
+ ],
701
754
  "properties": {
702
- "resourceKind": {
755
+ "resourceShellKind": {
703
756
  "const": "inputPotential"
704
757
  }
705
758
  },
@@ -711,44 +764,20 @@
711
764
  "$ref": "#/$defs/CreationContextFacet"
712
765
  },
713
766
  {
714
- "$ref": "#/$defs/ResourceKindFacet"
767
+ "$ref": "#/$defs/ResourceShellKindFacet"
715
768
  }
716
769
  ],
717
770
  "unevaluatedProperties": false
718
771
  },
719
772
  "ShellOutputPotential": {
720
- "$schema": "https://json-schema.org/draft/2020-12/schema",
721
- "type": "object",
722
- "properties": {
723
- "resourceKind": {
724
- "const": "outputPotential"
725
- }
726
- },
727
- "allOf": [
728
- {
729
- "$ref": "#/$defs/ResourceShellBase"
730
- },
731
- {
732
- "$ref": "#/$defs/CreationContextFacet"
733
- },
734
- {
735
- "$ref": "#/$defs/ResourceKindFacet"
736
- }
737
- ],
738
- "unevaluatedProperties": false
739
- },
740
- "ShellMaterializedBase": {
741
773
  "$schema": "https://json-schema.org/draft/2020-12/schema",
742
774
  "type": "object",
743
775
  "required": [
744
- "version"
776
+ "resourceShellKind"
745
777
  ],
746
778
  "properties": {
747
- "version": {
748
- "const": 1
749
- },
750
- "resourceKind": {
751
- "const": "materialized"
779
+ "resourceShellKind": {
780
+ "const": "outputPotential"
752
781
  }
753
782
  },
754
783
  "allOf": [
@@ -759,34 +788,10 @@
759
788
  "$ref": "#/$defs/CreationContextFacet"
760
789
  },
761
790
  {
762
- "$ref": "#/$defs/ResourceKindFacet"
763
- },
764
- {
765
- "$ref": "#/$defs/TimestampFacet"
766
- },
767
- {
768
- "$ref": "#/$defs/PathFacet"
791
+ "$ref": "#/$defs/ResourceShellKindFacet"
769
792
  }
770
- ]
771
- },
772
- "NucleusFacet": {
773
- "$schema": "https://json-schema.org/draft/2020-12/schema",
774
- "type": "object",
775
- "required": [
776
- "nucleus"
777
793
  ],
778
- "properties": {
779
- "nucleus": {
780
- "$ref": "#/$defs/Nucleus"
781
- }
782
- }
783
- },
784
- "RoleBindingArray": {
785
- "$schema": "https://json-schema.org/draft/2020-12/schema",
786
- "type": "array",
787
- "items": {
788
- "$ref": "#/$defs/ResourceRoleIdentity"
789
- }
794
+ "unevaluatedProperties": false
790
795
  },
791
796
  "ResourceShellBase": {
792
797
  "$schema": "https://json-schema.org/draft/2020-12/schema",
@@ -794,7 +799,7 @@
794
799
  "required": [
795
800
  "identity",
796
801
  "resourceTypeHandle",
797
- "resourceKind"
802
+ "resourceShellKind"
798
803
  ],
799
804
  "properties": {
800
805
  "identity": {
@@ -803,32 +808,32 @@
803
808
  "resourceTypeHandle": {
804
809
  "$ref": "#/$defs/ResourceTypeIdentity"
805
810
  },
806
- "resourceKind": {
807
- "$ref": "#/$defs/ResourceKind"
811
+ "resourceShellKind": {
812
+ "$ref": "#/$defs/ResourceShellKind"
808
813
  }
809
814
  }
810
815
  },
811
- "ResourceKindFacet": {
816
+ "CreationContextFacet": {
812
817
  "$schema": "https://json-schema.org/draft/2020-12/schema",
813
818
  "type": "object",
814
819
  "required": [
815
- "resourceKind"
820
+ "creationContext"
816
821
  ],
817
822
  "properties": {
818
- "resourceKind": {
819
- "$ref": "#/$defs/ResourceKind"
823
+ "creationContext": {
824
+ "$ref": "#/$defs/CreationContext"
820
825
  }
821
826
  }
822
827
  },
823
- "CreationContextFacet": {
828
+ "ResourceShellKindFacet": {
824
829
  "$schema": "https://json-schema.org/draft/2020-12/schema",
825
830
  "type": "object",
826
831
  "required": [
827
- "creationContext"
832
+ "resourceShellKind"
828
833
  ],
829
834
  "properties": {
830
- "creationContext": {
831
- "$ref": "#/$defs/CreationContext"
835
+ "resourceShellKind": {
836
+ "$ref": "#/$defs/ResourceShellKind"
832
837
  }
833
838
  }
834
839
  },
@@ -856,11 +861,11 @@
856
861
  }
857
862
  }
858
863
  },
859
- "Nucleus": {
864
+ "RoleBindingArray": {
860
865
  "$schema": "https://json-schema.org/draft/2020-12/schema",
861
- "type": "object",
862
- "additionalProperties": {
863
- "$ref": "#/$defs/JsonData"
866
+ "type": "array",
867
+ "items": {
868
+ "$ref": "#/$defs/ResourceRoleIdentity"
864
869
  }
865
870
  },
866
871
  "ResourceIdentity": {
@@ -873,7 +878,7 @@
873
878
  "type": "string",
874
879
  "pattern": "^TYPE-.+$"
875
880
  },
876
- "ResourceKind": {
881
+ "ResourceShellKind": {
877
882
  "$schema": "https://json-schema.org/draft/2020-12/schema",
878
883
  "type": "string",
879
884
  "enum": [
@@ -903,35 +908,6 @@
903
908
  "$schema": "https://json-schema.org/draft/2020-12/schema",
904
909
  "type": "string",
905
910
  "format": "uri-reference"
906
- },
907
- "JsonData": {
908
- "$schema": "https://json-schema.org/draft/2020-12/schema",
909
- "oneOf": [
910
- {
911
- "type": "null"
912
- },
913
- {
914
- "type": "boolean"
915
- },
916
- {
917
- "type": "number"
918
- },
919
- {
920
- "type": "string"
921
- },
922
- {
923
- "type": "array",
924
- "items": {
925
- "$ref": "#/$defs/JsonData"
926
- }
927
- },
928
- {
929
- "type": "object",
930
- "additionalProperties": {
931
- "$ref": "#/$defs/JsonData"
932
- }
933
- }
934
- ]
935
911
  }
936
912
  }
937
913
  }
@@ -1,3 +1,3 @@
1
1
  // Auto-generated strict composite type. Do not edit.
2
- import type { ShellMaterializedBase, Genesis as NucleusSchema } from "../types.js";
2
+ import type { ShellMaterializedBaseJson as ShellMaterializedBase, GenesisJson as NucleusSchema } from "../types.js";
3
3
  export type Resource_Genesis = ShellMaterializedBase & { nucleus: NucleusSchema };
@@ -1,3 +1,3 @@
1
1
  // Auto-generated strict composite type. Do not edit.
2
- import type { ShellMaterializedBase, Job as NucleusSchema } from "../types.js";
2
+ import type { ShellMaterializedBaseJson as ShellMaterializedBase, JobJson as NucleusSchema } from "../types.js";
3
3
  export type Resource_Job = ShellMaterializedBase & { nucleus: NucleusSchema };
@@ -1,3 +1,3 @@
1
1
  // Auto-generated strict composite type. Do not edit.
2
- import type { ShellMaterializedBase, RawStrategy as NucleusSchema } from "../types.js";
2
+ import type { ShellMaterializedBaseJson as ShellMaterializedBase, RawStrategyJson as NucleusSchema } from "../types.js";
3
3
  export type Resource_RawStrategy = ShellMaterializedBase & { nucleus: NucleusSchema };
@@ -1,3 +1,3 @@
1
1
  // Auto-generated strict composite type. Do not edit.
2
- import type { ShellMaterializedBase, ResourceType as NucleusSchema } from "../types.js";
2
+ import type { ShellMaterializedBaseJson as ShellMaterializedBase, ResourceTypeJson as NucleusSchema } from "../types.js";
3
3
  export type Resource_ResourceType = ShellMaterializedBase & { nucleus: NucleusSchema };
@@ -1,3 +1,3 @@
1
1
  // Auto-generated strict composite type. Do not edit.
2
- import type { ShellMaterializedBase, RunnableStrategy as NucleusSchema } from "../types.js";
2
+ import type { ShellMaterializedBaseJson as ShellMaterializedBase, RunnableStrategyJson as NucleusSchema } from "../types.js";
3
3
  export type Resource_RunnableStrategy = ShellMaterializedBase & { nucleus: NucleusSchema };