@toolproof-npm/schema 0.1.61 → 0.1.63

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.
@@ -49,12 +49,20 @@ export type ResourceTypeGenesis = {
49
49
  "RolesWrapper": ResourceType;
50
50
  "StatefulStrategy": ResourceType;
51
51
  "StatefulStrategyIdentity": ResourceType;
52
+ "StatefulStrategyWrapper": ResourceType;
52
53
  "StatelessStrategy": ResourceType;
53
54
  "StatelessStrategyIdentity": ResourceType;
55
+ "StatelessStrategyWrapper": ResourceType;
54
56
  "Step": ResourceType;
55
57
  "StepKind": ResourceType;
58
+ "StrategyRun": ResourceType;
59
+ "StrategyRunContext": ResourceType;
60
+ "StrategyRunIdentity": ResourceType;
61
+ "StrategyRunStatus": ResourceType;
56
62
  "StrategyState": ResourceType;
57
63
  "StrategyStateWrapper": ResourceType;
64
+ "StrategyThreadIdentity": ResourceType;
65
+ "StrategyThreadMap": ResourceType;
58
66
  "Timestamp": ResourceType;
59
67
  "WhileStep": ResourceType;
60
68
  "WhileStepIdentity": ResourceType;
@@ -0,0 +1,3 @@
1
+ // Auto-generated strict composite type. Do not edit.
2
+ import type { ResourceMetaBase, StatefulStrategy as ExtractedData } from './types.js';
3
+ export type Resource_StatefulStrategy = ResourceMetaBase & { extractedData: ExtractedData };
@@ -0,0 +1,3 @@
1
+ // Auto-generated strict composite type. Do not edit.
2
+ import type { ResourceMetaBase, StrategyRun as ExtractedData } from './types.js';
3
+ export type Resource_StrategyRun = ResourceMetaBase & { extractedData: ExtractedData };
@@ -299,8 +299,8 @@ export type ResourceType =
299
299
  export type StatefulStrategy =
300
300
  {
301
301
  identity: StatefulStrategyIdentity;
302
- statelessStrategy: StatelessStrategy;
303
- } & StrategyStateWrapper;
302
+ } & StatelessStrategyWrapper &
303
+ StrategyStateWrapper;
304
304
  /**
305
305
  * This interface was referenced by `GenesisJson`'s JSON-Schema
306
306
  * via the `definition` "StatefulStrategyIdentity".
@@ -335,6 +335,35 @@ export type WhileStep =
335
335
  */
336
336
  export type WhileStepIdentity =
337
337
  `WHILESTEP-${string}`;
338
+ /**
339
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
340
+ * via the `definition` "StrategyRun".
341
+ */
342
+ export type StrategyRun =
343
+ {
344
+ identity: StrategyRunIdentity;
345
+ statefulStrategyRef: StatefulStrategyIdentity;
346
+ strategyRunContext: StrategyRunContext;
347
+ } & StrategyThreadMap &
348
+ StrategyStateWrapper1;
349
+ /**
350
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
351
+ * via the `definition` "StrategyRunIdentity".
352
+ */
353
+ export type StrategyRunIdentity =
354
+ `STRATEGY_RUN-${string}`;
355
+ /**
356
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
357
+ * via the `definition` "StrategyRunStatus".
358
+ */
359
+ export type StrategyRunStatus =
360
+ "pending" | "running" | "completed" | "failed" | "cancelled";
361
+ /**
362
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
363
+ * via the `definition` "StrategyThreadIdentity".
364
+ */
365
+ export type StrategyThreadIdentity =
366
+ `STRATEGY_THREAD-${string}`;
338
367
 
339
368
  export interface GenesisJson {
340
369
  }
@@ -499,6 +528,13 @@ export interface Timestamp {
499
528
  export interface RoleBindingsWrapper1 {
500
529
  roleBindings: RoleBindings;
501
530
  }
531
+ /**
532
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
533
+ * via the `definition` "StatelessStrategyWrapper".
534
+ */
535
+ export interface StatelessStrategyWrapper {
536
+ statelessStrategy: StatelessStrategy;
537
+ }
502
538
  /**
503
539
  * This interface was referenced by `GenesisJson`'s JSON-Schema
504
540
  * via the `definition` "StatelessStrategy".
@@ -519,6 +555,35 @@ export interface StrategyStateWrapper {
519
555
  * via the `definition` "StrategyState".
520
556
  */
521
557
  export type StrategyState = Record<ExecutionIdentity, Record<ResourceRoleIdentity, ResourceMissing | ResourcePotentialInput | ResourcePotentialOutput | Resource>>;
558
+ /**
559
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
560
+ * via the `definition` "StatefulStrategyWrapper".
561
+ */
562
+ export interface StatefulStrategyWrapper {
563
+ statefulStrategy: StatefulStrategy;
564
+ }
565
+ /**
566
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
567
+ * via the `definition` "StrategyRunContext".
568
+ */
569
+ export interface StrategyRunContext {
570
+ completedAt?: Timestamp;
571
+ startedAt?: Timestamp;
572
+ status: StrategyRunStatus;
573
+ }
574
+ export interface StrategyThreadMap {
575
+ [k: string]: Step[];
576
+ }
577
+ export interface StrategyStateWrapper1 {
578
+ strategyState: StrategyState;
579
+ }
580
+ /**
581
+ * This interface was referenced by `GenesisJson`'s JSON-Schema
582
+ * via the `definition` "StrategyThreadMap".
583
+ */
584
+ export interface StrategyThreadMap1 {
585
+ [k: string]: Step[];
586
+ }
522
587
 
523
588
  export type Normalized =
524
589
  {
@@ -609,8 +674,8 @@ export interface ExtractionSchemaWrapper {
609
674
  export type Normalized =
610
675
  {
611
676
  identity: StatefulStrategyIdentity;
612
- statelessStrategy: StatelessStrategy;
613
- } & StrategyStateWrapper;
677
+ } & StatelessStrategyWrapper &
678
+ StrategyStateWrapper;
614
679
  export type StatefulStrategyIdentity =
615
680
  `STATEFUL_STRATEGY-${string}`;
616
681
  export type StatelessStrategyIdentity =
@@ -711,6 +776,9 @@ export type JsonData =
711
776
  [k: string]: JsonData;
712
777
  };
713
778
 
779
+ export interface StatelessStrategyWrapper {
780
+ statelessStrategy: StatelessStrategy;
781
+ }
714
782
  export interface StatelessStrategy {
715
783
  identity: StatelessStrategyIdentity;
716
784
  steps: Step[];
@@ -911,3 +979,160 @@ export interface RoleBindingsWrapper1 {
911
979
  roleBindings: RoleBindings;
912
980
  }
913
981
 
982
+ export type Normalized =
983
+ {
984
+ identity: StrategyRunIdentity;
985
+ statefulStrategyRef: StatefulStrategyIdentity;
986
+ strategyRunContext: StrategyRunContext;
987
+ } & StrategyThreadMap &
988
+ StrategyStateWrapper;
989
+ export type StrategyRunIdentity =
990
+ `STRATEGY_RUN-${string}`;
991
+ export type StatefulStrategyIdentity =
992
+ `STATEFUL_STRATEGY-${string}`;
993
+ export type StrategyRunStatus =
994
+ "pending" | "running" | "completed" | "failed" | "cancelled";
995
+ export type Step =
996
+ WorkStep | BranchStep | WhileStep | ForStep;
997
+ export type WorkStep =
998
+ {
999
+ execution: Execution;
1000
+ identity: WorkStepIdentity;
1001
+ kind: "work";
1002
+ } & StepKind;
1003
+ export type Execution =
1004
+ {
1005
+ identity: ExecutionIdentity;
1006
+ jobRef: JobIdentity;
1007
+ } & RoleBindingsWrapper;
1008
+ export type ExecutionIdentity =
1009
+ `EXECUTION-${string}`;
1010
+ export type JobIdentity =
1011
+ `JOB-${string}`;
1012
+ export type ResourceIdentity =
1013
+ `RESOURCE-${string}`;
1014
+ export type WorkStepIdentity =
1015
+ `WORKSTEP-${string}`;
1016
+ export type BranchStep =
1017
+ {
1018
+ /**
1019
+ * @minItems 1
1020
+ */
1021
+ cases: [Conditional, ...Conditional[]];
1022
+ identity: BranchStepIdentity;
1023
+ kind: "branch";
1024
+ } & StepKind;
1025
+ export type BranchStepIdentity =
1026
+ `BRANCHSTEP-${string}`;
1027
+ export type WhileStep =
1028
+ {
1029
+ case: Conditional;
1030
+ identity: WhileStepIdentity;
1031
+ kind: "while";
1032
+ } & StepKind;
1033
+ export type WhileStepIdentity =
1034
+ `WHILESTEP-${string}`;
1035
+ export type ForStep =
1036
+ {
1037
+ case: Conditional;
1038
+ identity: ForStepIdentity;
1039
+ kind: "for";
1040
+ } & StepKind;
1041
+ export type ForStepIdentity =
1042
+ `FORSTEP-${string}`;
1043
+ export type ResourceMissing =
1044
+ {
1045
+ } & ResourceBase &
1046
+ ResourceKind & {
1047
+ kind: "missing";
1048
+ };
1049
+ export type ResourceTypeIdentity =
1050
+ `TYPE-${string}`;
1051
+ export type ResourcePotentialInput =
1052
+ {
1053
+ } & ResourceBase &
1054
+ CreationContextWrapper &
1055
+ ResourceKind & {
1056
+ kind: "potential-input";
1057
+ };
1058
+ export type ResourceRoleIdentity =
1059
+ `ROLE-${string}`;
1060
+ export type ResourcePotentialOutput =
1061
+ {
1062
+ } & ResourceBase &
1063
+ CreationContextWrapper &
1064
+ ResourceKind & {
1065
+ kind: "potential-output";
1066
+ };
1067
+ export type Resource =
1068
+ {
1069
+ } & ResourceMetaBase & {
1070
+ extractedData: {
1071
+ [k: string]: JsonData;
1072
+ };
1073
+ };
1074
+ export type ResourceMetaBase =
1075
+ ResourceBase &
1076
+ CreationContextWrapper &
1077
+ ResourceKind & {
1078
+ kind: "materialized";
1079
+ } & Timestamp &
1080
+ Path;
1081
+ export type JsonData =
1082
+ | null
1083
+ | boolean
1084
+ | number
1085
+ | string
1086
+ | JsonData
1087
+ | {
1088
+ [k: string]: JsonData;
1089
+ };
1090
+
1091
+ export interface StrategyRunContext {
1092
+ completedAt?: Timestamp;
1093
+ startedAt?: Timestamp;
1094
+ status: StrategyRunStatus;
1095
+ }
1096
+ export interface Timestamp {
1097
+ timestamp: string;
1098
+ }
1099
+ export interface StrategyThreadMap {
1100
+ [k: string]: Step[];
1101
+ }
1102
+ export interface RoleBindingsWrapper {
1103
+ roleBindings: RoleBindings;
1104
+ }
1105
+ export interface RoleBindings {
1106
+ inputBindingMap: RoleBindingMap;
1107
+ outputBindingMap: RoleBindingMap;
1108
+ }
1109
+ export type RoleBindingMap = Record<ResourceRoleIdentity, ResourceIdentity>;
1110
+ export interface StepKind {
1111
+ kind: "work" | "branch" | "while" | "for";
1112
+ }
1113
+ export interface Conditional {
1114
+ what: WorkStep;
1115
+ when: WorkStep;
1116
+ }
1117
+ export interface StrategyStateWrapper {
1118
+ strategyState: StrategyState;
1119
+ }
1120
+ export type StrategyState = Record<ExecutionIdentity, Record<ResourceRoleIdentity, ResourceMissing | ResourcePotentialInput | ResourcePotentialOutput | Resource>>;
1121
+ export interface ResourceBase {
1122
+ identity: ResourceIdentity;
1123
+ resourceTypeRef: ResourceTypeIdentity;
1124
+ }
1125
+ export interface ResourceKind {
1126
+ kind: "missing" | "potential-input" | "potential-output" | "materialized";
1127
+ }
1128
+ export interface CreationContextWrapper {
1129
+ creationContext: CreationContext;
1130
+ }
1131
+ export interface CreationContext {
1132
+ executionRef: ExecutionIdentity;
1133
+ resourceRoleRef: ResourceRoleIdentity;
1134
+ }
1135
+ export interface Path {
1136
+ path: string;
1137
+ }
1138
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toolproof-npm/schema",
3
- "version": "0.1.61",
3
+ "version": "0.1.63",
4
4
  "description": "JSON schemas and TypeScript types for ToolProof",
5
5
  "keywords": [
6
6
  "toolproof",
@@ -53,6 +53,6 @@
53
53
  "generateResourceTypeType": "node ./dist/scripts/generateResourceTypeType.js",
54
54
  "generateResourceEnvelopes": "node ./dist/scripts/generateResourceEnvelopes.js",
55
55
  "generateSchemaShims": "node ./dist/scripts/generateSchemaShims.js",
56
- "update": "rimraf /s /q dist && pnpm run build:scripts && pnpm run rewriteAnchors && pnpm run generateResourceEnvelopes && pnpm run extractSchemas && pnpm run extractSubschema -- --name Job && pnpm run extractSubschema -- --name ResourceFormat && pnpm run extractSubschema -- --name ResourceType && pnpm run extractSubschema -- --name StatelessStrategy && pnpm run extractSubschema -- --name StatefulStrategy && pnpm run generateSchemaShims && pnpm run generateTypes && pnpm run generateResourceTypeType -- --name Job && pnpm run generateResourceTypeType -- --name ResourceFormat && pnpm run generateResourceTypeType -- --name ResourceType && pnpm run generateResourceTypeType -- --name StatelessStrategy && pnpm run generateResourceTypeGenesisType && pnpm run build"
56
+ "update": "rimraf /s /q dist && pnpm run build:scripts && pnpm run rewriteAnchors && pnpm run generateResourceEnvelopes && pnpm run extractSchemas && pnpm run extractSubschema -- --name Job && pnpm run extractSubschema -- --name ResourceFormat && pnpm run extractSubschema -- --name ResourceType && pnpm run extractSubschema -- --name StatelessStrategy && pnpm run extractSubschema -- --name StatefulStrategy && pnpm run extractSubschema -- --name StrategyRun && pnpm run generateSchemaShims && pnpm run generateTypes && pnpm run generateResourceTypeType -- --name Job && pnpm run generateResourceTypeType -- --name ResourceFormat && pnpm run generateResourceTypeType -- --name ResourceType && pnpm run generateResourceTypeType -- --name StatelessStrategy && pnpm run generateResourceTypeType -- --name StatefulStrategy && pnpm run generateResourceTypeType -- --name StrategyRun && pnpm run generateResourceTypeGenesisType && pnpm run build"
57
57
  }
58
58
  }