@haibun/core 3.6.0 → 3.8.0
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/build/currentVersion.d.ts +1 -1
- package/build/currentVersion.js +1 -1
- package/build/lib/EventLogger.d.ts +6 -7
- package/build/lib/EventLogger.d.ts.map +1 -1
- package/build/lib/EventLogger.js +12 -33
- package/build/lib/EventLogger.js.map +1 -1
- package/build/lib/PhaseRunner.d.ts +16 -0
- package/build/lib/PhaseRunner.d.ts.map +1 -0
- package/build/lib/PhaseRunner.js +39 -0
- package/build/lib/PhaseRunner.js.map +1 -0
- package/build/lib/defs.d.ts +9 -11
- package/build/lib/defs.d.ts.map +1 -1
- package/build/lib/defs.js +8 -0
- package/build/lib/defs.js.map +1 -1
- package/build/lib/feature-variables.d.ts +10 -22
- package/build/lib/feature-variables.d.ts.map +1 -1
- package/build/lib/feature-variables.js +42 -58
- package/build/lib/feature-variables.js.map +1 -1
- package/build/lib/filter-schema.d.ts +49 -0
- package/build/lib/filter-schema.d.ts.map +1 -0
- package/build/lib/filter-schema.js +104 -0
- package/build/lib/filter-schema.js.map +1 -0
- package/build/lib/filter-types.d.ts +71 -0
- package/build/lib/filter-types.d.ts.map +1 -0
- package/build/lib/filter-types.js +121 -0
- package/build/lib/filter-types.js.map +1 -0
- package/build/lib/monitor-event-collector.d.ts +16 -0
- package/build/lib/monitor-event-collector.d.ts.map +1 -0
- package/build/lib/monitor-event-collector.js +26 -0
- package/build/lib/monitor-event-collector.js.map +1 -0
- package/build/lib/populateActionArgs.js +1 -1
- package/build/lib/populateActionArgs.js.map +1 -1
- package/build/lib/secrets.d.ts +17 -0
- package/build/lib/secrets.d.ts.map +1 -0
- package/build/lib/secrets.js +46 -0
- package/build/lib/secrets.js.map +1 -0
- package/build/lib/test/lib.js +3 -3
- package/build/lib/test/lib.js.map +1 -1
- package/build/lib/util/actualURI.d.ts +1 -1
- package/build/lib/util/actualURI.d.ts.map +1 -1
- package/build/lib/util/index.d.ts +1 -0
- package/build/lib/util/index.d.ts.map +1 -1
- package/build/lib/util/index.js +1 -0
- package/build/lib/util/index.js.map +1 -1
- package/build/lib/util/secret-utils.d.ts +7 -0
- package/build/lib/util/secret-utils.d.ts.map +1 -0
- package/build/lib/util/secret-utils.js +36 -0
- package/build/lib/util/secret-utils.js.map +1 -0
- package/build/phases/Executor.d.ts.map +1 -1
- package/build/phases/Executor.js +4 -6
- package/build/phases/Executor.js.map +1 -1
- package/build/phases/collector.d.ts +3 -2
- package/build/phases/collector.d.ts.map +1 -1
- package/build/phases/collector.js +19 -7
- package/build/phases/collector.js.map +1 -1
- package/build/run-policy/run-policy-schema.d.ts +44 -0
- package/build/run-policy/run-policy-schema.d.ts.map +1 -0
- package/build/run-policy/run-policy-schema.js +263 -0
- package/build/run-policy/run-policy-schema.js.map +1 -0
- package/build/run-policy/run-policy-types.d.ts +60 -0
- package/build/run-policy/run-policy-types.d.ts.map +1 -0
- package/build/run-policy/run-policy-types.js +106 -0
- package/build/run-policy/run-policy-types.js.map +1 -0
- package/build/runfilter/filter-schema.d.ts +76 -0
- package/build/runfilter/filter-schema.d.ts.map +1 -0
- package/build/runfilter/filter-schema.js +129 -0
- package/build/runfilter/filter-schema.js.map +1 -0
- package/build/runfilter/filter-types.d.ts +58 -0
- package/build/runfilter/filter-types.d.ts.map +1 -0
- package/build/runfilter/filter-types.js +102 -0
- package/build/runfilter/filter-types.js.map +1 -0
- package/build/runner.d.ts +0 -3
- package/build/runner.d.ts.map +1 -1
- package/build/runner.js +19 -52
- package/build/runner.js.map +1 -1
- package/build/schema/protocol.d.ts +2 -2
- package/build/steps/activities-stepper.d.ts +4 -4
- package/build/steps/activities-stepper.d.ts.map +1 -1
- package/build/steps/activities-stepper.js +0 -2
- package/build/steps/activities-stepper.js.map +1 -1
- package/build/steps/haibun.d.ts +4 -4
- package/build/steps/narrator.d.ts +4 -4
- package/build/steps/variables-stepper.d.ts +25 -25
- package/build/steps/variables-stepper.d.ts.map +1 -1
- package/build/steps/variables-stepper.js +45 -41
- package/build/steps/variables-stepper.js.map +1 -1
- package/haibun-core-specl.schema.json +42 -0
- package/package.json +6 -4
package/build/steps/haibun.d.ts
CHANGED
|
@@ -19,14 +19,14 @@ declare class Haibun extends AStepper implements IHasCycles {
|
|
|
19
19
|
gwta: string;
|
|
20
20
|
action: ({ statements }: {
|
|
21
21
|
statements: TFeatureStep[];
|
|
22
|
-
}, featureStep: TFeatureStep) => Promise<import("../schema/protocol.js").
|
|
22
|
+
}, featureStep: TFeatureStep) => Promise<import("../schema/protocol.js").TNotOKActionResult | import("../schema/protocol.js").TOKActionResult>;
|
|
23
23
|
};
|
|
24
24
|
backgrounds: {
|
|
25
25
|
gwta: string;
|
|
26
26
|
resolveFeatureLine: (line: string, _path: string, _stepper: AStepper, backgrounds: TFeatures) => false;
|
|
27
27
|
action: ({ names }: {
|
|
28
28
|
names: string;
|
|
29
|
-
}, featureStep: TFeatureStep) => Promise<import("../schema/protocol.js").
|
|
29
|
+
}, featureStep: TFeatureStep) => Promise<import("../schema/protocol.js").TNotOKActionResult | import("../schema/protocol.js").TOKActionResult>;
|
|
30
30
|
};
|
|
31
31
|
nothing: {
|
|
32
32
|
exact: string;
|
|
@@ -61,7 +61,7 @@ declare class Haibun extends AStepper implements IHasCycles {
|
|
|
61
61
|
gwta: string;
|
|
62
62
|
action: ({ result }: {
|
|
63
63
|
result: string;
|
|
64
|
-
}) => import("../schema/protocol.js").
|
|
64
|
+
}) => import("../schema/protocol.js").TNotOKActionResult | import("../schema/protocol.js").TOKActionResult;
|
|
65
65
|
};
|
|
66
66
|
showSteppers: {
|
|
67
67
|
exact: string;
|
|
@@ -109,7 +109,7 @@ declare class Haibun extends AStepper implements IHasCycles {
|
|
|
109
109
|
action: ({ statement }: {
|
|
110
110
|
stepperName: string;
|
|
111
111
|
statement: TFeatureStep[];
|
|
112
|
-
}, featureStep: TFeatureStep) => import("../schema/protocol.js").
|
|
112
|
+
}, featureStep: TFeatureStep) => import("../schema/protocol.js").TNotOKActionResult | import("../schema/protocol.js").TOKActionResult;
|
|
113
113
|
};
|
|
114
114
|
};
|
|
115
115
|
}
|
|
@@ -40,20 +40,20 @@ declare class Narrator extends AStepper implements IHasOptions, IHasCycles {
|
|
|
40
40
|
prose: {
|
|
41
41
|
precludes: string[];
|
|
42
42
|
match: RegExp;
|
|
43
|
-
action: (_args: TStepArgs, featureStep: TFeatureStep) => Promise<import("../schema/protocol.js").
|
|
43
|
+
action: (_args: TStepArgs, featureStep: TFeatureStep) => Promise<import("../schema/protocol.js").TNotOKActionResult | import("../schema/protocol.js").TOKActionResult>;
|
|
44
44
|
};
|
|
45
45
|
feature: {
|
|
46
46
|
precludes: string[];
|
|
47
47
|
gwta: string;
|
|
48
|
-
action: ({ feature }: TStepArgs, featureStep: TFeatureStep) => Promise<import("../schema/protocol.js").
|
|
48
|
+
action: ({ feature }: TStepArgs, featureStep: TFeatureStep) => Promise<import("../schema/protocol.js").TNotOKActionResult | import("../schema/protocol.js").TOKActionResult>;
|
|
49
49
|
};
|
|
50
50
|
scenario: {
|
|
51
51
|
precludes: string[];
|
|
52
52
|
gwta: string;
|
|
53
|
-
action: ({ scenario }: TStepArgs, featureStep: TFeatureStep) => Promise<import("../schema/protocol.js").
|
|
53
|
+
action: ({ scenario }: TStepArgs, featureStep: TFeatureStep) => Promise<import("../schema/protocol.js").TNotOKActionResult | import("../schema/protocol.js").TOKActionResult>;
|
|
54
54
|
};
|
|
55
55
|
};
|
|
56
|
-
maybeSay(featureStep: TFeatureStep): Promise<import("../schema/protocol.js").
|
|
56
|
+
maybeSay(featureStep: TFeatureStep): Promise<import("../schema/protocol.js").TNotOKActionResult | import("../schema/protocol.js").TOKActionResult>;
|
|
57
57
|
}
|
|
58
58
|
export default Narrator;
|
|
59
59
|
//# sourceMappingURL=narrator.d.ts.map
|
|
@@ -13,7 +13,7 @@ declare class VariablesStepper extends AStepper implements IHasCycles {
|
|
|
13
13
|
action: ({ domain, superdomains }: {
|
|
14
14
|
domain: string;
|
|
15
15
|
superdomains: TFeatureStep[];
|
|
16
|
-
}, featureStep: TFeatureStep) => import("../schema/protocol.js").
|
|
16
|
+
}, featureStep: TFeatureStep) => import("../schema/protocol.js").TNotOKActionResult | import("../schema/protocol.js").TOKActionResult;
|
|
17
17
|
};
|
|
18
18
|
defineOrderedSet: {
|
|
19
19
|
precludes: string[];
|
|
@@ -22,7 +22,7 @@ declare class VariablesStepper extends AStepper implements IHasCycles {
|
|
|
22
22
|
action: ({ domain, values }: {
|
|
23
23
|
domain: string;
|
|
24
24
|
values: TFeatureStep[];
|
|
25
|
-
}, featureStep: TFeatureStep) => import("../schema/protocol.js").
|
|
25
|
+
}, featureStep: TFeatureStep) => import("../schema/protocol.js").TNotOKActionResult | import("../schema/protocol.js").TOKActionResult;
|
|
26
26
|
};
|
|
27
27
|
defineValuesSet: {
|
|
28
28
|
gwta: string;
|
|
@@ -30,7 +30,7 @@ declare class VariablesStepper extends AStepper implements IHasCycles {
|
|
|
30
30
|
action: ({ domain, values }: {
|
|
31
31
|
domain: string;
|
|
32
32
|
values: TFeatureStep[];
|
|
33
|
-
}, featureStep: TFeatureStep) => import("../schema/protocol.js").
|
|
33
|
+
}, featureStep: TFeatureStep) => import("../schema/protocol.js").TNotOKActionResult | import("../schema/protocol.js").TOKActionResult;
|
|
34
34
|
};
|
|
35
35
|
statementSetValues: {
|
|
36
36
|
expose: false;
|
|
@@ -53,7 +53,7 @@ declare class VariablesStepper extends AStepper implements IHasCycles {
|
|
|
53
53
|
increment: {
|
|
54
54
|
gwta: string;
|
|
55
55
|
handlesUndefined: string[];
|
|
56
|
-
action: (_: TStepArgs, featureStep: TFeatureStep) => import("../schema/protocol.js").
|
|
56
|
+
action: (_: TStepArgs, featureStep: TFeatureStep) => import("../schema/protocol.js").TNotOKActionResult | import("../schema/protocol.js").TOKActionResult;
|
|
57
57
|
};
|
|
58
58
|
showEnv: {
|
|
59
59
|
gwta: string;
|
|
@@ -94,7 +94,7 @@ declare class VariablesStepper extends AStepper implements IHasCycles {
|
|
|
94
94
|
is: {
|
|
95
95
|
gwta: string;
|
|
96
96
|
handlesUndefined: string[];
|
|
97
|
-
action: (_: TStepArgs, featureStep: TFeatureStep) => import("../schema/protocol.js").
|
|
97
|
+
action: (_: TStepArgs, featureStep: TFeatureStep) => import("../schema/protocol.js").TNotOKActionResult | import("../schema/protocol.js").TOKActionResult;
|
|
98
98
|
};
|
|
99
99
|
isLessThan: {
|
|
100
100
|
gwta: string;
|
|
@@ -103,7 +103,7 @@ declare class VariablesStepper extends AStepper implements IHasCycles {
|
|
|
103
103
|
action: ({ what, value }: {
|
|
104
104
|
what: string;
|
|
105
105
|
value: string;
|
|
106
|
-
}, featureStep: TFeatureStep) => import("../schema/protocol.js").
|
|
106
|
+
}, featureStep: TFeatureStep) => import("../schema/protocol.js").TNotOKActionResult | import("../schema/protocol.js").TOKActionResult;
|
|
107
107
|
};
|
|
108
108
|
isMoreThan: {
|
|
109
109
|
gwta: string;
|
|
@@ -112,17 +112,17 @@ declare class VariablesStepper extends AStepper implements IHasCycles {
|
|
|
112
112
|
action: ({ what, value }: {
|
|
113
113
|
what: string;
|
|
114
114
|
value: string;
|
|
115
|
-
}, featureStep: TFeatureStep) => import("../schema/protocol.js").
|
|
115
|
+
}, featureStep: TFeatureStep) => import("../schema/protocol.js").TNotOKActionResult | import("../schema/protocol.js").TOKActionResult;
|
|
116
116
|
};
|
|
117
117
|
exists: {
|
|
118
118
|
gwta: string;
|
|
119
119
|
handlesUndefined: string[];
|
|
120
|
-
action: ({ what }: TStepArgs, featureStep: TFeatureStep) => import("../schema/protocol.js").
|
|
120
|
+
action: ({ what }: TStepArgs, featureStep: TFeatureStep) => import("../schema/protocol.js").TNotOKActionResult | import("../schema/protocol.js").TOKActionResult;
|
|
121
121
|
};
|
|
122
122
|
showVar: {
|
|
123
123
|
gwta: string;
|
|
124
124
|
handlesUndefined: string[];
|
|
125
|
-
action: (_: TStepArgs, featureStep: TFeatureStep) => import("../schema/protocol.js").
|
|
125
|
+
action: (_: TStepArgs, featureStep: TFeatureStep) => import("../schema/protocol.js").TNotOKActionResult | import("../schema/protocol.js").TOKActionResult;
|
|
126
126
|
};
|
|
127
127
|
showDomains: {
|
|
128
128
|
gwta: string;
|
|
@@ -131,19 +131,19 @@ declare class VariablesStepper extends AStepper implements IHasCycles {
|
|
|
131
131
|
showDomain: {
|
|
132
132
|
gwta: string;
|
|
133
133
|
handlesUndefined: string[];
|
|
134
|
-
action: (_: TStepArgs, featureStep: TFeatureStep) => import("../schema/protocol.js").
|
|
134
|
+
action: (_: TStepArgs, featureStep: TFeatureStep) => import("../schema/protocol.js").TNotOKActionResult | import("../schema/protocol.js").TOKActionResult;
|
|
135
135
|
};
|
|
136
136
|
isIn: {
|
|
137
137
|
match: RegExp;
|
|
138
138
|
fallback: true;
|
|
139
|
-
action: (_: unknown, featureStep: TFeatureStep) => import("../schema/protocol.js").
|
|
139
|
+
action: (_: unknown, featureStep: TFeatureStep) => import("../schema/protocol.js").TNotOKActionResult | import("../schema/protocol.js").TOKActionResult;
|
|
140
140
|
};
|
|
141
141
|
matches: {
|
|
142
142
|
gwta: string;
|
|
143
143
|
action: ({ value, pattern }: {
|
|
144
144
|
value: string;
|
|
145
145
|
pattern: string;
|
|
146
|
-
}, featureStep: TFeatureStep) => import("../schema/protocol.js").
|
|
146
|
+
}, featureStep: TFeatureStep) => import("../schema/protocol.js").TNotOKActionResult | import("../schema/protocol.js").TOKActionResult;
|
|
147
147
|
};
|
|
148
148
|
};
|
|
149
149
|
readonly typedSteps: {
|
|
@@ -153,7 +153,7 @@ declare class VariablesStepper extends AStepper implements IHasCycles {
|
|
|
153
153
|
action: ({ domain, superdomains }: {
|
|
154
154
|
domain: string;
|
|
155
155
|
superdomains: TFeatureStep[];
|
|
156
|
-
}, featureStep: TFeatureStep) => import("../schema/protocol.js").
|
|
156
|
+
}, featureStep: TFeatureStep) => import("../schema/protocol.js").TNotOKActionResult | import("../schema/protocol.js").TOKActionResult;
|
|
157
157
|
};
|
|
158
158
|
defineOrderedSet: {
|
|
159
159
|
precludes: string[];
|
|
@@ -162,7 +162,7 @@ declare class VariablesStepper extends AStepper implements IHasCycles {
|
|
|
162
162
|
action: ({ domain, values }: {
|
|
163
163
|
domain: string;
|
|
164
164
|
values: TFeatureStep[];
|
|
165
|
-
}, featureStep: TFeatureStep) => import("../schema/protocol.js").
|
|
165
|
+
}, featureStep: TFeatureStep) => import("../schema/protocol.js").TNotOKActionResult | import("../schema/protocol.js").TOKActionResult;
|
|
166
166
|
};
|
|
167
167
|
defineValuesSet: {
|
|
168
168
|
gwta: string;
|
|
@@ -170,7 +170,7 @@ declare class VariablesStepper extends AStepper implements IHasCycles {
|
|
|
170
170
|
action: ({ domain, values }: {
|
|
171
171
|
domain: string;
|
|
172
172
|
values: TFeatureStep[];
|
|
173
|
-
}, featureStep: TFeatureStep) => import("../schema/protocol.js").
|
|
173
|
+
}, featureStep: TFeatureStep) => import("../schema/protocol.js").TNotOKActionResult | import("../schema/protocol.js").TOKActionResult;
|
|
174
174
|
};
|
|
175
175
|
statementSetValues: {
|
|
176
176
|
expose: false;
|
|
@@ -193,7 +193,7 @@ declare class VariablesStepper extends AStepper implements IHasCycles {
|
|
|
193
193
|
increment: {
|
|
194
194
|
gwta: string;
|
|
195
195
|
handlesUndefined: string[];
|
|
196
|
-
action: (_: TStepArgs, featureStep: TFeatureStep) => import("../schema/protocol.js").
|
|
196
|
+
action: (_: TStepArgs, featureStep: TFeatureStep) => import("../schema/protocol.js").TNotOKActionResult | import("../schema/protocol.js").TOKActionResult;
|
|
197
197
|
};
|
|
198
198
|
showEnv: {
|
|
199
199
|
gwta: string;
|
|
@@ -234,7 +234,7 @@ declare class VariablesStepper extends AStepper implements IHasCycles {
|
|
|
234
234
|
is: {
|
|
235
235
|
gwta: string;
|
|
236
236
|
handlesUndefined: string[];
|
|
237
|
-
action: (_: TStepArgs, featureStep: TFeatureStep) => import("../schema/protocol.js").
|
|
237
|
+
action: (_: TStepArgs, featureStep: TFeatureStep) => import("../schema/protocol.js").TNotOKActionResult | import("../schema/protocol.js").TOKActionResult;
|
|
238
238
|
};
|
|
239
239
|
isLessThan: {
|
|
240
240
|
gwta: string;
|
|
@@ -243,7 +243,7 @@ declare class VariablesStepper extends AStepper implements IHasCycles {
|
|
|
243
243
|
action: ({ what, value }: {
|
|
244
244
|
what: string;
|
|
245
245
|
value: string;
|
|
246
|
-
}, featureStep: TFeatureStep) => import("../schema/protocol.js").
|
|
246
|
+
}, featureStep: TFeatureStep) => import("../schema/protocol.js").TNotOKActionResult | import("../schema/protocol.js").TOKActionResult;
|
|
247
247
|
};
|
|
248
248
|
isMoreThan: {
|
|
249
249
|
gwta: string;
|
|
@@ -252,17 +252,17 @@ declare class VariablesStepper extends AStepper implements IHasCycles {
|
|
|
252
252
|
action: ({ what, value }: {
|
|
253
253
|
what: string;
|
|
254
254
|
value: string;
|
|
255
|
-
}, featureStep: TFeatureStep) => import("../schema/protocol.js").
|
|
255
|
+
}, featureStep: TFeatureStep) => import("../schema/protocol.js").TNotOKActionResult | import("../schema/protocol.js").TOKActionResult;
|
|
256
256
|
};
|
|
257
257
|
exists: {
|
|
258
258
|
gwta: string;
|
|
259
259
|
handlesUndefined: string[];
|
|
260
|
-
action: ({ what }: TStepArgs, featureStep: TFeatureStep) => import("../schema/protocol.js").
|
|
260
|
+
action: ({ what }: TStepArgs, featureStep: TFeatureStep) => import("../schema/protocol.js").TNotOKActionResult | import("../schema/protocol.js").TOKActionResult;
|
|
261
261
|
};
|
|
262
262
|
showVar: {
|
|
263
263
|
gwta: string;
|
|
264
264
|
handlesUndefined: string[];
|
|
265
|
-
action: (_: TStepArgs, featureStep: TFeatureStep) => import("../schema/protocol.js").
|
|
265
|
+
action: (_: TStepArgs, featureStep: TFeatureStep) => import("../schema/protocol.js").TNotOKActionResult | import("../schema/protocol.js").TOKActionResult;
|
|
266
266
|
};
|
|
267
267
|
showDomains: {
|
|
268
268
|
gwta: string;
|
|
@@ -271,22 +271,22 @@ declare class VariablesStepper extends AStepper implements IHasCycles {
|
|
|
271
271
|
showDomain: {
|
|
272
272
|
gwta: string;
|
|
273
273
|
handlesUndefined: string[];
|
|
274
|
-
action: (_: TStepArgs, featureStep: TFeatureStep) => import("../schema/protocol.js").
|
|
274
|
+
action: (_: TStepArgs, featureStep: TFeatureStep) => import("../schema/protocol.js").TNotOKActionResult | import("../schema/protocol.js").TOKActionResult;
|
|
275
275
|
};
|
|
276
276
|
isIn: {
|
|
277
277
|
match: RegExp;
|
|
278
278
|
fallback: true;
|
|
279
|
-
action: (_: unknown, featureStep: TFeatureStep) => import("../schema/protocol.js").
|
|
279
|
+
action: (_: unknown, featureStep: TFeatureStep) => import("../schema/protocol.js").TNotOKActionResult | import("../schema/protocol.js").TOKActionResult;
|
|
280
280
|
};
|
|
281
281
|
matches: {
|
|
282
282
|
gwta: string;
|
|
283
283
|
action: ({ value, pattern }: {
|
|
284
284
|
value: string;
|
|
285
285
|
pattern: string;
|
|
286
|
-
}, featureStep: TFeatureStep) => import("../schema/protocol.js").
|
|
286
|
+
}, featureStep: TFeatureStep) => import("../schema/protocol.js").TNotOKActionResult | import("../schema/protocol.js").TOKActionResult;
|
|
287
287
|
};
|
|
288
288
|
};
|
|
289
|
-
compareValues(featureStep: TFeatureStep, rawTerm: string, value: string, operator: string): import("../schema/protocol.js").
|
|
289
|
+
compareValues(featureStep: TFeatureStep, rawTerm: string, value: string, operator: string): import("../schema/protocol.js").TNotOKActionResult | import("../schema/protocol.js").TOKActionResult;
|
|
290
290
|
/**
|
|
291
291
|
* Interpolates a template string by replacing {varName} placeholders with variable values.
|
|
292
292
|
* Returns the interpolated string or an error if a variable is not found.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variables-stepper.d.ts","sourceRoot":"","sources":["../../src/steps/variables-stepper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,cAAc,EAAwD,MAAM,gBAAgB,C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Q,EAAE,MAAM;IAsCzF;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAwB3B,OAAO,CAAC,8BAA8B;IAmDtC,OAAO,CAAC,iCAAiC;CAgBzC;AAED,eAAe,gBAAgB,CAAC;AAEhC,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,EAAE,SAAS,MAAM,EAAE,OAAO,MAAM;;;;CAE1E,CAAC;AAEH,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,YAAY,GAAG,qBAAqB,CAM1F"}
|
|
@@ -2,9 +2,9 @@ import { z } from 'zod';
|
|
|
2
2
|
import { OK, Origin } from '../schema/protocol.js';
|
|
3
3
|
import { AStepper } from '../lib/astepper.js';
|
|
4
4
|
import { actionOK, actionNotOK, getStepTerm } from '../lib/util/index.js';
|
|
5
|
-
import { FeatureVariables } from '../lib/feature-variables.js';
|
|
5
|
+
import { FeatureVariables, OBSCURED_VALUE } from '../lib/feature-variables.js';
|
|
6
|
+
import { sanitizeObjectSecrets, hideValueIfSecret } from '../lib/util/secret-utils.js';
|
|
6
7
|
import { DOMAIN_STATEMENT, DOMAIN_STRING, normalizeDomainKey, createEnumDomainDefinition, registerDomains } from '../lib/domain-types.js';
|
|
7
|
-
import { OBSCURED_VALUE } from '../lib/EventLogger.js';
|
|
8
8
|
const clearVars = (vars) => () => {
|
|
9
9
|
vars.getWorld().shared.clear();
|
|
10
10
|
return;
|
|
@@ -59,7 +59,7 @@ class VariablesStepper extends AStepper {
|
|
|
59
59
|
const result = this.interpolateTemplate(templateVal.term, featureStep);
|
|
60
60
|
if (result.error)
|
|
61
61
|
return actionNotOK(result.error);
|
|
62
|
-
return trySetVariable(this.getWorld().shared, { term: String(term), value: result.value, domain, origin: Origin.var }, provenanceFromFeatureStep(featureStep));
|
|
62
|
+
return trySetVariable(this.getWorld().shared, { term: String(term), value: result.value, domain, origin: Origin.var, secret: result.secret }, provenanceFromFeatureStep(featureStep));
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
65
|
compose: {
|
|
@@ -73,19 +73,19 @@ class VariablesStepper extends AStepper {
|
|
|
73
73
|
const result = this.interpolateTemplate(templateVal.term, featureStep);
|
|
74
74
|
if (result.error)
|
|
75
75
|
return actionNotOK(result.error);
|
|
76
|
-
return trySetVariable(this.getWorld().shared, { term: String(term), value: result.value, domain: DOMAIN_STRING, origin: Origin.var }, provenanceFromFeatureStep(featureStep));
|
|
77
|
-
}
|
|
76
|
+
return trySetVariable(this.getWorld().shared, { term: String(term), value: result.value, domain: DOMAIN_STRING, origin: Origin.var, secret: result.secret }, provenanceFromFeatureStep(featureStep));
|
|
77
|
+
},
|
|
78
78
|
},
|
|
79
79
|
increment: {
|
|
80
80
|
gwta: 'increment {what}',
|
|
81
81
|
handlesUndefined: ['what'],
|
|
82
82
|
action: (_, featureStep) => {
|
|
83
|
-
const { term: rawTerm
|
|
83
|
+
const { term: rawTerm } = featureStep.action.stepValuesMap.what;
|
|
84
84
|
const interpolated = this.interpolateTemplate(rawTerm, featureStep);
|
|
85
85
|
if (interpolated.error)
|
|
86
86
|
return actionNotOK(interpolated.error);
|
|
87
87
|
const term = interpolated?.value;
|
|
88
|
-
const resolved = this.getWorld().shared.resolveVariable({ term, origin: Origin.var
|
|
88
|
+
const resolved = this.getWorld().shared.resolveVariable({ term, origin: Origin.var }, featureStep);
|
|
89
89
|
const presentVal = resolved.value;
|
|
90
90
|
const effectiveDomain = resolved.domain;
|
|
91
91
|
if (presentVal === undefined) {
|
|
@@ -130,11 +130,9 @@ class VariablesStepper extends AStepper {
|
|
|
130
130
|
action: () => {
|
|
131
131
|
// Obscure secret environment variables (matching /password/i)
|
|
132
132
|
const envVars = this.world.options.envVariables || {};
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
console.info('env', displayEnv);
|
|
133
|
+
const shared = this.getWorld().shared;
|
|
134
|
+
const safeEnv = sanitizeObjectSecrets(envVars, (key) => shared.isSecret(key), Object.values(shared.getSecrets()));
|
|
135
|
+
this.getWorld().eventLogger.info(`env: ${JSON.stringify(safeEnv, null, 2)}`, { env: safeEnv });
|
|
138
136
|
return Promise.resolve(OK);
|
|
139
137
|
}
|
|
140
138
|
},
|
|
@@ -142,8 +140,9 @@ class VariablesStepper extends AStepper {
|
|
|
142
140
|
gwta: 'show vars',
|
|
143
141
|
action: () => {
|
|
144
142
|
const shared = this.getWorld().shared;
|
|
145
|
-
const displayVars = Object.fromEntries(Object.entries(shared.all()).map(([
|
|
146
|
-
|
|
143
|
+
const displayVars = Object.fromEntries(Object.entries(shared.all()).map(([key, variable]) => [key, variable.value]));
|
|
144
|
+
const safeVars = sanitizeObjectSecrets(displayVars, (key) => shared.isSecret(key), Object.values(shared.getSecrets()));
|
|
145
|
+
this.getWorld().eventLogger.info(`vars: ${JSON.stringify(safeVars, null, 2)}`, { vars: safeVars });
|
|
147
146
|
return actionOK();
|
|
148
147
|
},
|
|
149
148
|
},
|
|
@@ -153,7 +152,7 @@ class VariablesStepper extends AStepper {
|
|
|
153
152
|
precludes: ['Haibun.prose'],
|
|
154
153
|
action: (args, featureStep) => {
|
|
155
154
|
const { term: rawTerm, domain, origin } = featureStep.action.stepValuesMap.what;
|
|
156
|
-
const parsedValue = this.getWorld().shared.resolveVariable(featureStep.action.stepValuesMap.value, featureStep);
|
|
155
|
+
const parsedValue = this.getWorld().shared.resolveVariable(featureStep.action.stepValuesMap.value, featureStep, undefined, { secure: true });
|
|
157
156
|
if (parsedValue.value === undefined)
|
|
158
157
|
return actionNotOK(`Variable ${featureStep.action.stepValuesMap.value.term} not found`);
|
|
159
158
|
const resolved = { value: String(parsedValue.value) };
|
|
@@ -167,7 +166,7 @@ class VariablesStepper extends AStepper {
|
|
|
167
166
|
// Inherit domain from existing variable if not explicitly specified
|
|
168
167
|
const existing = this.getWorld().shared.resolveVariable({ term, origin: Origin.var }, featureStep);
|
|
169
168
|
const effectiveDomain = (domain === DOMAIN_STRING && existing?.domain) ? existing.domain : (domain || DOMAIN_STRING);
|
|
170
|
-
const result = trySetVariable(this.getWorld().shared, { term, value: resolved.value, domain: effectiveDomain, origin }, provenanceFromFeatureStep(featureStep));
|
|
169
|
+
const result = trySetVariable(this.getWorld().shared, { term, value: resolved.value, domain: effectiveDomain, origin, secret: interpolated.secret || parsedValue.secret }, provenanceFromFeatureStep(featureStep));
|
|
171
170
|
return result;
|
|
172
171
|
}
|
|
173
172
|
},
|
|
@@ -177,9 +176,8 @@ class VariablesStepper extends AStepper {
|
|
|
177
176
|
precludes: [`${VariablesStepper.name}.set`],
|
|
178
177
|
action: ({ value, domain }, featureStep) => {
|
|
179
178
|
const readonly = !!featureStep.in.match(/ as read-only /);
|
|
180
|
-
const secret = !!featureStep.in.match(/ as secret /);
|
|
181
179
|
const { term: rawTerm, origin } = featureStep.action.stepValuesMap.what;
|
|
182
|
-
const parsedValue = this.getWorld().shared.resolveVariable(featureStep.action.stepValuesMap.value, featureStep);
|
|
180
|
+
const parsedValue = this.getWorld().shared.resolveVariable(featureStep.action.stepValuesMap.value, featureStep, undefined, { secure: true });
|
|
183
181
|
if (parsedValue.value === undefined)
|
|
184
182
|
return actionNotOK(`Variable ${featureStep.action.stepValuesMap.value.term} not found`);
|
|
185
183
|
const resolved = { value: String(parsedValue.value) };
|
|
@@ -196,9 +194,6 @@ class VariablesStepper extends AStepper {
|
|
|
196
194
|
if (effectiveDomain.startsWith('read-only ')) {
|
|
197
195
|
effectiveDomain = effectiveDomain.replace('read-only ', '');
|
|
198
196
|
}
|
|
199
|
-
if (effectiveDomain.startsWith('secret ')) {
|
|
200
|
-
effectiveDomain = effectiveDomain.replace('secret ', '');
|
|
201
|
-
}
|
|
202
197
|
if (effectiveDomain.startsWith('"') && effectiveDomain.endsWith('"')) {
|
|
203
198
|
effectiveDomain = effectiveDomain.slice(1, -1);
|
|
204
199
|
}
|
|
@@ -207,7 +202,7 @@ class VariablesStepper extends AStepper {
|
|
|
207
202
|
if (typeof finalValue === 'string' && finalValue.startsWith('"') && finalValue.endsWith('"')) {
|
|
208
203
|
finalValue = finalValue.slice(1, -1);
|
|
209
204
|
}
|
|
210
|
-
return trySetVariable(this.getWorld().shared, { term, value: finalValue, domain: effectiveDomain, origin, readonly, secret }, provenanceFromFeatureStep(featureStep));
|
|
205
|
+
return trySetVariable(this.getWorld().shared, { term, value: finalValue, domain: effectiveDomain, origin, readonly, secret: interpolated.secret || parsedValue.secret }, provenanceFromFeatureStep(featureStep));
|
|
211
206
|
}
|
|
212
207
|
},
|
|
213
208
|
unset: {
|
|
@@ -247,18 +242,17 @@ class VariablesStepper extends AStepper {
|
|
|
247
242
|
if (interpolated.error)
|
|
248
243
|
return actionNotOK(interpolated.error);
|
|
249
244
|
const term = interpolated.value;
|
|
250
|
-
const resolved = this.getWorld().shared.resolveVariable({ term, origin: Origin.defined }, featureStep);
|
|
251
|
-
if (resolved.value === undefined) {
|
|
245
|
+
const resolved = this.getWorld().shared.resolveVariable({ term, origin: Origin.defined }, featureStep, undefined, { secure: true });
|
|
246
|
+
if (resolved.value === undefined || (resolved.origin !== Origin.var && resolved.origin !== Origin.env)) {
|
|
252
247
|
return actionNotOK(`${term} is not set`);
|
|
253
248
|
}
|
|
254
|
-
const
|
|
255
|
-
const parsedValue = this.getWorld().shared.resolveVariable(featureStep.action.stepValuesMap.value, featureStep);
|
|
249
|
+
const parsedValue = this.getWorld().shared.resolveVariable(featureStep.action.stepValuesMap.value, featureStep, undefined, { secure: true });
|
|
256
250
|
if (parsedValue.value === undefined)
|
|
257
251
|
return actionNotOK(`Variable ${featureStep.action.stepValuesMap.value.term} not found`);
|
|
258
252
|
const value = String(parsedValue.value);
|
|
259
253
|
const domainKey = normalizeDomainKey(resolved.domain);
|
|
260
254
|
const compareVal = this.getWorld().domains[domainKey].coerce({ term: '_cmp', value, domain: domainKey, origin: Origin.quoted }, featureStep, this.steppers);
|
|
261
|
-
return JSON.stringify(
|
|
255
|
+
return JSON.stringify(resolved.value) === JSON.stringify(compareVal) ? OK : actionNotOK(`${term} is ${JSON.stringify(resolved.value)}, not ${JSON.stringify(compareVal)}`);
|
|
262
256
|
}
|
|
263
257
|
},
|
|
264
258
|
isLessThan: {
|
|
@@ -284,8 +278,11 @@ class VariablesStepper extends AStepper {
|
|
|
284
278
|
handlesUndefined: ['what'],
|
|
285
279
|
action: ({ what }, featureStep) => {
|
|
286
280
|
const term = (getStepTerm(featureStep, 'what') ?? what);
|
|
287
|
-
const
|
|
288
|
-
|
|
281
|
+
const sharedVars = this.getWorld().shared.all();
|
|
282
|
+
if (sharedVars[term])
|
|
283
|
+
return OK;
|
|
284
|
+
const envVars = this.getWorld().options.envVariables || {};
|
|
285
|
+
return envVars[term] !== undefined ? OK : actionNotOK(`${what} not set`);
|
|
289
286
|
}
|
|
290
287
|
},
|
|
291
288
|
showVar: {
|
|
@@ -299,13 +296,15 @@ class VariablesStepper extends AStepper {
|
|
|
299
296
|
if (interpolated.error)
|
|
300
297
|
return actionNotOK(interpolated.error);
|
|
301
298
|
const term = interpolated.value || '';
|
|
302
|
-
const
|
|
303
|
-
const
|
|
299
|
+
const shared = this.getWorld().shared;
|
|
300
|
+
const stepValue = shared.resolveVariable({ term, origin: Origin.defined }, featureStep);
|
|
301
|
+
const isSecret = shared.isSecret(term);
|
|
302
|
+
const maskedValue = hideValueIfSecret(stepValue.value, Object.values(shared.getSecrets()));
|
|
304
303
|
if (stepValue.value === undefined) {
|
|
305
304
|
this.getWorld().eventLogger.info(`${term} is undefined`);
|
|
306
305
|
}
|
|
307
306
|
else {
|
|
308
|
-
const displayValue = isSecret ? { ...stepValue, value: OBSCURED_VALUE } : stepValue;
|
|
307
|
+
const displayValue = (isSecret || maskedValue === OBSCURED_VALUE) ? { ...stepValue, value: OBSCURED_VALUE } : stepValue;
|
|
309
308
|
const provenance = featureStep.action.stepValuesMap.what.provenance?.map((p, i) => ({ [i]: { in: p.in, seq: p.seq.join(','), when: p.when } }));
|
|
310
309
|
this.getWorld().eventLogger.info(`${term} is ${JSON.stringify({ ...displayValue, provenance }, null, 2)}`, { variable: term, value: displayValue });
|
|
311
310
|
}
|
|
@@ -385,8 +384,8 @@ class VariablesStepper extends AStepper {
|
|
|
385
384
|
valueTerm = valueTerm.slice(1, -1);
|
|
386
385
|
}
|
|
387
386
|
// Try to resolve as variable, fall back to literal
|
|
388
|
-
const
|
|
389
|
-
const actualValue =
|
|
387
|
+
const resolvedValue = this.getWorld().shared.get(valueTerm, true);
|
|
388
|
+
const actualValue = resolvedValue !== undefined ? String(resolvedValue) : valueTerm;
|
|
390
389
|
const domainName = matchResult[2].trim();
|
|
391
390
|
const domainKey = normalizeDomainKey(domainName);
|
|
392
391
|
const domainDef = this.getWorld().domains[domainKey];
|
|
@@ -422,8 +421,8 @@ class VariablesStepper extends AStepper {
|
|
|
422
421
|
return actionNotOK(interpolatedValue.error);
|
|
423
422
|
const term = interpolatedValue.value;
|
|
424
423
|
// Resolve value as a variable (e.g., "WebPlaywright/currentURI" -> actual URL)
|
|
425
|
-
const
|
|
426
|
-
const actualValue =
|
|
424
|
+
const resolvedValue = this.getWorld().shared.get(term, true);
|
|
425
|
+
const actualValue = resolvedValue !== undefined ? String(resolvedValue) : String(term);
|
|
427
426
|
// Interpolate variables in pattern (e.g., "{counter URI}*" -> "http://localhost:8123/*")
|
|
428
427
|
const interpolated = this.interpolateTemplate(pattern, featureStep);
|
|
429
428
|
if (interpolated.error)
|
|
@@ -447,7 +446,7 @@ class VariablesStepper extends AStepper {
|
|
|
447
446
|
if (interpolated.error)
|
|
448
447
|
return actionNotOK(interpolated.error);
|
|
449
448
|
const term = interpolated.value;
|
|
450
|
-
const stored = this.getWorld().shared.resolveVariable({ term, origin: Origin.var }, featureStep);
|
|
449
|
+
const stored = this.getWorld().shared.resolveVariable({ term, origin: Origin.var }, featureStep, this.steppers, { secure: true });
|
|
451
450
|
if (!stored) {
|
|
452
451
|
return actionNotOK(`${term} is not set`);
|
|
453
452
|
}
|
|
@@ -485,15 +484,20 @@ class VariablesStepper extends AStepper {
|
|
|
485
484
|
const placeholderRegex = /\{([^}]+)\}/g;
|
|
486
485
|
let result = template;
|
|
487
486
|
let match;
|
|
487
|
+
let secret = false;
|
|
488
488
|
while ((match = placeholderRegex.exec(template)) !== null) {
|
|
489
489
|
const varName = match[1];
|
|
490
|
-
|
|
490
|
+
// Check if it's secret BEFORE resolving it securely so we know
|
|
491
|
+
if (this.getWorld().shared.isSecret(varName)) {
|
|
492
|
+
secret = true;
|
|
493
|
+
}
|
|
494
|
+
const resolved = this.getWorld().shared.resolveVariable({ term: varName, origin: Origin.defined }, featureStep, undefined, { secure: true });
|
|
491
495
|
if (resolved.value === undefined) {
|
|
492
496
|
return { error: `Variable ${varName} not found` };
|
|
493
497
|
}
|
|
494
498
|
result = result.replace(match[0], String(resolved.value));
|
|
495
499
|
}
|
|
496
|
-
return { value: result };
|
|
500
|
+
return { value: result, secret };
|
|
497
501
|
}
|
|
498
502
|
registerSubdomainFromStatement(domain, superdomains, featureStep) {
|
|
499
503
|
try {
|
|
@@ -631,12 +635,12 @@ const compareDomainValues = (domain, left, right, domainName) => {
|
|
|
631
635
|
// ======== Helpers ========
|
|
632
636
|
// Returns OK if "set empty" and variable exists
|
|
633
637
|
function shouldSkipEmpty(featureStep, term, shared) {
|
|
634
|
-
return (featureStep.in.includes('set empty ') && shared.
|
|
638
|
+
return (featureStep.in.includes('set empty ') && shared.resolveVariable({ term, origin: Origin.var }, featureStep, undefined, { secure: true }).value !== undefined) ? OK : undefined;
|
|
635
639
|
}
|
|
636
640
|
// Wraps shared.set in try/catch
|
|
637
641
|
function trySetVariable(shared, opts, provenance) {
|
|
638
642
|
try {
|
|
639
|
-
shared.set({ term:
|
|
643
|
+
shared.set({ term: opts.term, value: opts.value, domain: opts.domain, origin: opts.origin, readonly: opts.readonly, secret: opts.secret }, provenance);
|
|
640
644
|
return OK;
|
|
641
645
|
}
|
|
642
646
|
catch (e) {
|