@toolproof-npm/schema 0.1.34 → 0.1.36

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 (53) hide show
  1. package/dist/_lib/test.js +12 -12
  2. package/dist/_lib/types/Resource_Job.d.ts +55 -0
  3. package/dist/_lib/types/Resource_ResourceFormat.d.ts +40 -0
  4. package/dist/_lib/types/Resource_ResourceFormat.js +1 -0
  5. package/dist/_lib/types/Resource_ResourceType.d.ts +61 -0
  6. package/dist/_lib/types/Resource_ResourceType.js +1 -0
  7. package/dist/_lib/types/Resource_StatelessStrategy.d.ts +79 -0
  8. package/dist/_lib/types/Resource_StatelessStrategy.js +1 -0
  9. package/dist/_lib/types/types.d.ts +495 -355
  10. package/dist/genesis/generated/resources/Genesis.d.ts +2 -0
  11. package/dist/genesis/generated/resources/Genesis.js +2 -0
  12. package/dist/genesis/generated/resources/Genesis.json +2120 -0
  13. package/dist/{schemas → genesis/generated/schemas}/Genesis.json +273 -345
  14. package/dist/{schemas → genesis/generated/schemas}/Job.json +24 -26
  15. package/dist/genesis/generated/schemas/ResourceFormat.d.ts +2 -0
  16. package/dist/genesis/generated/schemas/ResourceFormat.js +2 -0
  17. package/dist/genesis/generated/schemas/ResourceFormat.json +74 -0
  18. package/dist/genesis/generated/schemas/ResourceType.d.ts +2 -0
  19. package/dist/genesis/generated/schemas/ResourceType.js +2 -0
  20. package/dist/genesis/generated/schemas/ResourceType.json +368 -0
  21. package/dist/genesis/generated/schemas/StatefulStrategy.d.ts +2 -0
  22. package/dist/genesis/generated/schemas/StatefulStrategy.js +2 -0
  23. package/dist/genesis/generated/schemas/StatefulStrategy.json +647 -0
  24. package/dist/genesis/generated/schemas/StatelessStrategy.d.ts +2 -0
  25. package/dist/genesis/generated/schemas/StatelessStrategy.js +2 -0
  26. package/dist/genesis/generated/schemas/StatelessStrategy.json +324 -0
  27. package/dist/genesis/resourceTypes/Genesis.d.ts +2 -0
  28. package/dist/genesis/resourceTypes/Genesis.js +2 -0
  29. package/dist/genesis/resourceTypes/Genesis.json +1530 -0
  30. package/dist/index.d.ts +8 -5
  31. package/dist/index.js +4 -3
  32. package/dist/scripts/_lib/config.d.ts +45 -0
  33. package/dist/scripts/_lib/config.js +109 -0
  34. package/dist/scripts/brandFactories.d.ts +5 -5
  35. package/dist/scripts/brandFactories.js +4 -5
  36. package/dist/scripts/extractSchemas.js +33 -8
  37. package/dist/scripts/extractSubschemaWithDefs.js +36 -7
  38. package/dist/scripts/generateResourceEnvelopes.js +77 -0
  39. package/dist/scripts/generateResourceTypeType.d.ts +1 -0
  40. package/dist/scripts/{generateResourceData.js → generateResourceTypeType.js} +21 -19
  41. package/dist/scripts/generateSchemaShims.d.ts +1 -0
  42. package/dist/scripts/generateSchemaShims.js +63 -0
  43. package/dist/scripts/generateTypes.js +125 -83
  44. package/dist/scripts/rewriteAnchors.d.ts +1 -0
  45. package/dist/scripts/rewriteAnchors.js +90 -0
  46. package/package.json +6 -3
  47. package/dist/_lib/types/ResourceData_Job.d.ts +0 -97
  48. /package/dist/_lib/types/{ResourceData_Job.js → Resource_Job.js} +0 -0
  49. /package/dist/{schemas → genesis/generated/schemas}/Genesis.d.ts +0 -0
  50. /package/dist/{schemas → genesis/generated/schemas}/Genesis.js +0 -0
  51. /package/dist/{schemas → genesis/generated/schemas}/Job.d.ts +0 -0
  52. /package/dist/{schemas → genesis/generated/schemas}/Job.js +0 -0
  53. /package/dist/scripts/{generateResourceData.d.ts → generateResourceEnvelopes.d.ts} +0 -0
package/dist/_lib/test.js CHANGED
@@ -2,7 +2,7 @@ const Job = {
2
2
  identity: 'identity',
3
3
  name: 'name',
4
4
  description: 'description',
5
- uri: 'uri',
5
+ implementation: 'implementation',
6
6
  roles: {
7
7
  inputMap: {
8
8
  'ROLE-1234': {
@@ -24,7 +24,7 @@ const jobAlpha = {
24
24
  identity: 'identity',
25
25
  name: 'name',
26
26
  description: 'description',
27
- uri: 'uri',
27
+ implementation: 'implementation',
28
28
  roles: {
29
29
  inputMap: {
30
30
  'data-input': {
@@ -46,7 +46,7 @@ const jobBeta = {
46
46
  identity: 'identity',
47
47
  name: 'name',
48
48
  description: 'description',
49
- uri: 'uri',
49
+ implementation: 'implementation',
50
50
  roles: {
51
51
  inputMap: {
52
52
  'data-input': {
@@ -65,8 +65,8 @@ const jobBeta = {
65
65
  }
66
66
  };
67
67
  // This checks (no error expected); we're providing all required fields
68
- const resourceDataJobAlpha = {
69
- id: 'RESOURCE-1',
68
+ const ResourceJobAlpha = {
69
+ identity: 'RESOURCE-1',
70
70
  resourceTypeId: 'TYPE-ID',
71
71
  creationContext: {
72
72
  resourceRoleId: 'ROLE-ID',
@@ -78,9 +78,9 @@ const resourceDataJobAlpha = {
78
78
  extractedData: jobAlpha
79
79
  };
80
80
  // @ts-expect-error Missing path property
81
- // This SHOULD fail (missing path) once ResourceData_Job enforces Path strictly.
82
- const resourceDataJobAlpha2 = {
83
- id: 'RESOURCE-3',
81
+ // This SHOULD fail (missing path) once Resource_Job enforces Path strictly.
82
+ const ResourceJobAlpha2 = {
83
+ identity: 'RESOURCE-3',
84
84
  resourceTypeId: 'TYPE-ID',
85
85
  creationContext: {
86
86
  resourceRoleId: 'ROLE-ID',
@@ -93,8 +93,8 @@ const resourceDataJobAlpha2 = {
93
93
  };
94
94
  // @ts-expect-error Missing extractedData property
95
95
  // This should fail; we're missing extractedData
96
- const resourceDataJobAlpha3 = {
97
- id: 'RESOURCE-2',
96
+ const ResourceJobAlpha3 = {
97
+ identity: 'RESOURCE-2',
98
98
  resourceTypeId: 'TYPE-ID',
99
99
  creationContext: {
100
100
  resourceRoleId: 'ROLE-ID',
@@ -106,8 +106,8 @@ const resourceDataJobAlpha3 = {
106
106
  // extractedData: jobAlpha
107
107
  };
108
108
  // This SHOULD fail (missing roles.outputMap) once Job's roles is strictly enforced.
109
- const resourceDataJobBeta = {
110
- id: 'RESOURCE-4',
109
+ const ResourceJobBeta = {
110
+ identity: 'RESOURCE-4',
111
111
  resourceTypeId: 'TYPE-ID',
112
112
  creationContext: {
113
113
  resourceRoleId: 'ROLE-ID',
@@ -0,0 +1,55 @@
1
+ // Auto-generated strict composite type. Do not edit.
2
+ export type Resource_Job = ResourceMetaBase & {
3
+ extractedData: Job;
4
+ };
5
+ export type ResourceMetaBase = ResourceBase &
6
+ ResourceKind & {
7
+ kind: "materialized";
8
+ } & Timestamp &
9
+ Path;
10
+ export type ResourceBase = {
11
+ identity: string;
12
+ resourceTypeId: string;
13
+ } & CreationContext;
14
+ export type Job = {
15
+ identity: string;
16
+ implementation: string;
17
+ } & Documented &
18
+ RolesOuter;
19
+ export type Documented = Name & Description;
20
+ export type ResourceRoleValue = {
21
+ resourceTypeId: string;
22
+ } & Documented;
23
+
24
+ export interface CreationContext {
25
+ creationContext: ResourceSocket;
26
+ }
27
+ export interface ResourceSocket {
28
+ executionId: string;
29
+ resourceRoleId: string;
30
+ }
31
+ export interface ResourceKind {
32
+ kind: "potential-input" | "potential-output" | "materialized";
33
+ }
34
+ export interface Timestamp {
35
+ timestamp: string;
36
+ }
37
+ export interface Path {
38
+ path: string;
39
+ }
40
+ export interface Name {
41
+ name: string;
42
+ }
43
+ export interface Description {
44
+ description: string;
45
+ }
46
+ export interface RolesOuter {
47
+ roles: RolesInner;
48
+ }
49
+ export interface RolesInner {
50
+ inputMap: RoleMap;
51
+ outputMap: RoleMap;
52
+ }
53
+ export interface RoleMap {
54
+ [k: string]: ResourceRoleValue;
55
+ }
@@ -0,0 +1,40 @@
1
+ // Auto-generated strict composite type. Do not edit.
2
+ export type Resource_ResourceFormat = ResourceMetaBase & {
3
+ extractedData: ResourceFormat;
4
+ };
5
+ export type ResourceMetaBase = ResourceBase &
6
+ ResourceKind & {
7
+ kind: "materialized";
8
+ } & Timestamp &
9
+ Path;
10
+ export type ResourceBase = {
11
+ identity: string;
12
+ resourceTypeId: string;
13
+ } & CreationContext;
14
+ export type ResourceFormat = {
15
+ identity: string;
16
+ } & Documented;
17
+ export type Documented = Name & Description;
18
+
19
+ export interface CreationContext {
20
+ creationContext: ResourceSocket;
21
+ }
22
+ export interface ResourceSocket {
23
+ executionId: string;
24
+ resourceRoleId: string;
25
+ }
26
+ export interface ResourceKind {
27
+ kind: "potential-input" | "potential-output" | "materialized";
28
+ }
29
+ export interface Timestamp {
30
+ timestamp: string;
31
+ }
32
+ export interface Path {
33
+ path: string;
34
+ }
35
+ export interface Name {
36
+ name: string;
37
+ }
38
+ export interface Description {
39
+ description: string;
40
+ }
@@ -0,0 +1 @@
1
+ export {}
@@ -0,0 +1,61 @@
1
+ // Auto-generated strict composite type. Do not edit.
2
+ export type Resource_ResourceType = ResourceMetaBase & {
3
+ extractedData: ResourceType;
4
+ };
5
+ export type ResourceMetaBase = ResourceBase &
6
+ ResourceKind & {
7
+ kind: "materialized";
8
+ } & Timestamp &
9
+ Path;
10
+ export type ResourceBase = {
11
+ identity: string;
12
+ resourceTypeId: string;
13
+ } & CreationContext;
14
+ export type ResourceType = {
15
+ identity: string;
16
+ resourceFormatId: string;
17
+ } & Documented &
18
+ ExtractionSchema & {
19
+ };
20
+ export type Documented = Name & Description;
21
+ export type ExtractionSchemaValue = {
22
+ } & {
23
+ $schema: "https://json-schema.org/draft/2020-12/schema";
24
+ $defs?: {
25
+ };
26
+ type: "object";
27
+ allOf?: {
28
+ }[];
29
+ properties?: {
30
+ };
31
+ required?: string[];
32
+ additionalProperties?: false;
33
+ unevaluatedProperties?: false;
34
+ $anchor: string;
35
+ };
36
+
37
+ export interface CreationContext {
38
+ creationContext: ResourceSocket;
39
+ }
40
+ export interface ResourceSocket {
41
+ executionId: string;
42
+ resourceRoleId: string;
43
+ }
44
+ export interface ResourceKind {
45
+ kind: "potential-input" | "potential-output" | "materialized";
46
+ }
47
+ export interface Timestamp {
48
+ timestamp: string;
49
+ }
50
+ export interface Path {
51
+ path: string;
52
+ }
53
+ export interface Name {
54
+ name: string;
55
+ }
56
+ export interface Description {
57
+ description: string;
58
+ }
59
+ export interface ExtractionSchema {
60
+ extractionSchema: ExtractionSchemaValue;
61
+ }
@@ -0,0 +1 @@
1
+ export {}
@@ -0,0 +1,79 @@
1
+ // Auto-generated strict composite type. Do not edit.
2
+ export type Resource_StatelessStrategy = ResourceMetaBase & {
3
+ extractedData: StatelessStrategy;
4
+ };
5
+ export type ResourceMetaBase = ResourceBase &
6
+ ResourceKind & {
7
+ kind: "materialized";
8
+ } & Timestamp &
9
+ Path;
10
+ export type ResourceBase = {
11
+ identity: string;
12
+ resourceTypeId: string;
13
+ } & CreationContext;
14
+ export type StatelessStrategy = {
15
+ identity: string;
16
+ steps: Step[];
17
+ };
18
+ export type Step = WorkStep | BranchStep | WhileStep | ForStep;
19
+ export type WorkStep = StepKind & {
20
+ execution: Execution;
21
+ identity: string;
22
+ kind: "work";
23
+ };
24
+ export type Execution = {
25
+ identity: string;
26
+ jobId: string;
27
+ } & RoleBindingsOuter;
28
+ export type BranchStep = StepKind & {
29
+ /**
30
+ * @minItems 1
31
+ */
32
+ cases: [ConditionalWrapper, ...ConditionalWrapper[]];
33
+ identity: string;
34
+ kind: "branch";
35
+ };
36
+ export type WhileStep = StepKind & {
37
+ case: ConditionalWrapper;
38
+ identity: string;
39
+ kind: "while";
40
+ };
41
+ export type ForStep = StepKind & {
42
+ case: ConditionalWrapper;
43
+ identity: string;
44
+ kind: "for";
45
+ };
46
+
47
+ export interface CreationContext {
48
+ creationContext: ResourceSocket;
49
+ }
50
+ export interface ResourceSocket {
51
+ executionId: string;
52
+ resourceRoleId: string;
53
+ }
54
+ export interface ResourceKind {
55
+ kind: "potential-input" | "potential-output" | "materialized";
56
+ }
57
+ export interface Timestamp {
58
+ timestamp: string;
59
+ }
60
+ export interface Path {
61
+ path: string;
62
+ }
63
+ export interface StepKind {
64
+ kind: "work" | "branch" | "while" | "for";
65
+ }
66
+ export interface RoleBindingsOuter {
67
+ roleBindings: RoleBindingsInner;
68
+ }
69
+ export interface RoleBindingsInner {
70
+ inputBindingMap: RoleBindingMap;
71
+ outputBindingMap: RoleBindingMap;
72
+ }
73
+ export interface RoleBindingMap {
74
+ [k: string]: string;
75
+ }
76
+ export interface ConditionalWrapper {
77
+ what: WorkStep;
78
+ when: WorkStep;
79
+ }
@@ -0,0 +1 @@
1
+ export {}