@toolproof-npm/schema 0.1.33 → 0.1.35
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 +16 -16
- package/dist/_lib/types/Resource_Job.d.ts +55 -0
- package/dist/_lib/types/Resource_ResourceFormat.d.ts +40 -0
- package/dist/_lib/types/Resource_ResourceFormat.js +1 -0
- package/dist/_lib/types/Resource_ResourceType.d.ts +60 -0
- package/dist/_lib/types/Resource_ResourceType.js +1 -0
- package/dist/_lib/types/Resource_StatelessStrategy.d.ts +79 -0
- package/dist/_lib/types/Resource_StatelessStrategy.js +1 -0
- package/dist/_lib/types/types.d.ts +493 -355
- package/dist/genesis/generated/resources/Genesis.d.ts +2 -0
- package/dist/genesis/generated/resources/Genesis.js +2 -0
- package/dist/genesis/generated/resources/Genesis.json +2113 -0
- package/dist/{schemas → genesis/generated/schemas}/Genesis.json +269 -348
- package/dist/{schemas → genesis/generated/schemas}/Job.json +24 -26
- package/dist/genesis/generated/schemas/ResourceFormat.d.ts +2 -0
- package/dist/genesis/generated/schemas/ResourceFormat.js +2 -0
- package/dist/genesis/generated/schemas/ResourceFormat.json +74 -0
- package/dist/genesis/generated/schemas/ResourceType.d.ts +2 -0
- package/dist/genesis/generated/schemas/ResourceType.js +2 -0
- package/dist/genesis/generated/schemas/ResourceType.json +361 -0
- package/dist/genesis/generated/schemas/StatefulStrategy.d.ts +2 -0
- package/dist/genesis/generated/schemas/StatefulStrategy.js +2 -0
- package/dist/genesis/generated/schemas/StatefulStrategy.json +647 -0
- package/dist/genesis/generated/schemas/StatelessStrategy.d.ts +2 -0
- package/dist/genesis/generated/schemas/StatelessStrategy.js +2 -0
- package/dist/genesis/generated/schemas/StatelessStrategy.json +324 -0
- package/dist/genesis/resourceTypes/Genesis.d.ts +2 -0
- package/dist/genesis/resourceTypes/Genesis.js +2 -0
- package/dist/genesis/resourceTypes/Genesis.json +1523 -0
- package/dist/index.d.ts +8 -5
- package/dist/index.js +4 -3
- package/dist/scripts/_lib/config.d.ts +45 -0
- package/dist/scripts/_lib/config.js +109 -0
- package/dist/scripts/brandFactories.d.ts +5 -5
- package/dist/scripts/brandFactories.js +4 -5
- package/dist/scripts/extractSchemas.js +33 -8
- package/dist/scripts/extractSubschemaWithDefs.js +36 -7
- package/dist/scripts/generateResourceEnvelopes.js +77 -0
- package/dist/scripts/generateResourceTypeType.d.ts +1 -0
- package/dist/scripts/{generateResourceData.js → generateResourceTypeType.js} +21 -19
- package/dist/scripts/generateSchemaShims.d.ts +1 -0
- package/dist/scripts/generateSchemaShims.js +63 -0
- package/dist/scripts/generateTypes.js +116 -83
- package/dist/scripts/rewriteAnchors.d.ts +1 -0
- package/dist/scripts/rewriteAnchors.js +90 -0
- package/package.json +50 -52
- package/dist/_lib/types/ResourceData_Job.d.ts +0 -97
- /package/dist/_lib/types/{ResourceData_Job.js → Resource_Job.js} +0 -0
- /package/dist/{schemas → genesis/generated/schemas}/Genesis.d.ts +0 -0
- /package/dist/{schemas → genesis/generated/schemas}/Genesis.js +0 -0
- /package/dist/{schemas → genesis/generated/schemas}/Job.d.ts +0 -0
- /package/dist/{schemas → genesis/generated/schemas}/Job.js +0 -0
- /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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
49
|
+
implementation: 'implementation',
|
|
50
50
|
roles: {
|
|
51
51
|
inputMap: {
|
|
52
52
|
'data-input': {
|
|
@@ -65,55 +65,55 @@ const jobBeta = {
|
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
67
|
// This checks (no error expected); we're providing all required fields
|
|
68
|
-
const
|
|
69
|
-
|
|
68
|
+
const ResourceJobAlpha = {
|
|
69
|
+
identity: 'RESOURCE-1',
|
|
70
70
|
resourceTypeId: 'TYPE-ID',
|
|
71
71
|
creationContext: {
|
|
72
72
|
resourceRoleId: 'ROLE-ID',
|
|
73
73
|
executionId: 'EXECUTION-ID',
|
|
74
74
|
},
|
|
75
|
-
kind: '
|
|
75
|
+
kind: 'materialized',
|
|
76
76
|
timestamp: 'timestamp',
|
|
77
77
|
path: 'path',
|
|
78
78
|
extractedData: jobAlpha
|
|
79
79
|
};
|
|
80
80
|
// @ts-expect-error Missing path property
|
|
81
|
-
// This SHOULD fail (missing path) once
|
|
82
|
-
const
|
|
83
|
-
|
|
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',
|
|
87
87
|
executionId: 'EXECUTION-ID',
|
|
88
88
|
},
|
|
89
|
-
kind: '
|
|
89
|
+
kind: 'materialized',
|
|
90
90
|
timestamp: 'timestamp',
|
|
91
91
|
// path: 'path',
|
|
92
92
|
extractedData: jobAlpha
|
|
93
93
|
};
|
|
94
94
|
// @ts-expect-error Missing extractedData property
|
|
95
95
|
// This should fail; we're missing extractedData
|
|
96
|
-
const
|
|
97
|
-
|
|
96
|
+
const ResourceJobAlpha3 = {
|
|
97
|
+
identity: 'RESOURCE-2',
|
|
98
98
|
resourceTypeId: 'TYPE-ID',
|
|
99
99
|
creationContext: {
|
|
100
100
|
resourceRoleId: 'ROLE-ID',
|
|
101
101
|
executionId: 'EXECUTION-ID',
|
|
102
102
|
},
|
|
103
|
-
kind: '
|
|
103
|
+
kind: 'materialized',
|
|
104
104
|
timestamp: 'timestamp',
|
|
105
105
|
path: 'path',
|
|
106
106
|
// extractedData: jobAlpha
|
|
107
107
|
};
|
|
108
108
|
// This SHOULD fail (missing roles.outputMap) once Job's roles is strictly enforced.
|
|
109
|
-
const
|
|
110
|
-
|
|
109
|
+
const ResourceJobBeta = {
|
|
110
|
+
identity: 'RESOURCE-4',
|
|
111
111
|
resourceTypeId: 'TYPE-ID',
|
|
112
112
|
creationContext: {
|
|
113
113
|
resourceRoleId: 'ROLE-ID',
|
|
114
114
|
executionId: 'EXECUTION-ID',
|
|
115
115
|
},
|
|
116
|
-
kind: '
|
|
116
|
+
kind: 'materialized',
|
|
117
117
|
timestamp: 'timestamp',
|
|
118
118
|
path: 'path',
|
|
119
119
|
// @ts-expect-error Missing outputMap inside roles (Job requires outputMap)
|
|
@@ -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,60 @@
|
|
|
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
|
+
additionalProperties?: false;
|
|
32
|
+
unevaluatedProperties?: false;
|
|
33
|
+
$anchor: string;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export interface CreationContext {
|
|
37
|
+
creationContext: ResourceSocket;
|
|
38
|
+
}
|
|
39
|
+
export interface ResourceSocket {
|
|
40
|
+
executionId: string;
|
|
41
|
+
resourceRoleId: string;
|
|
42
|
+
}
|
|
43
|
+
export interface ResourceKind {
|
|
44
|
+
kind: "potential-input" | "potential-output" | "materialized";
|
|
45
|
+
}
|
|
46
|
+
export interface Timestamp {
|
|
47
|
+
timestamp: string;
|
|
48
|
+
}
|
|
49
|
+
export interface Path {
|
|
50
|
+
path: string;
|
|
51
|
+
}
|
|
52
|
+
export interface Name {
|
|
53
|
+
name: string;
|
|
54
|
+
}
|
|
55
|
+
export interface Description {
|
|
56
|
+
description: string;
|
|
57
|
+
}
|
|
58
|
+
export interface ExtractionSchema {
|
|
59
|
+
extractionSchema: ExtractionSchemaValue;
|
|
60
|
+
}
|
|
@@ -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 {}
|