@prismatic-io/spectral 10.4.1-alpha.0 → 10.4.1
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.
|
@@ -494,9 +494,11 @@ const generateTriggerPerformFn = (componentRef, onTrigger) => {
|
|
|
494
494
|
// @ts-expect-error: _components isn't part of the public API
|
|
495
495
|
const { _components } = context;
|
|
496
496
|
const invokeTrigger = _components.invokeTrigger;
|
|
497
|
-
return yield invokeTrigger(invokeTriggerComponentInput(componentRef, onTrigger, "perform"), context, payload, params);
|
|
497
|
+
return yield invokeTrigger(invokeTriggerComponentInput(componentRef, onTrigger, "perform"), Object.assign(Object.assign({}, context), { debug: (0, context_1.createDebugContext)(context) }), payload, params);
|
|
498
498
|
})
|
|
499
|
-
:
|
|
499
|
+
: (context, payload, params) => __awaiter(void 0, void 0, void 0, function* () {
|
|
500
|
+
return yield onTrigger(Object.assign(Object.assign({}, context), { debug: (0, context_1.createDebugContext)(context) }), payload, params);
|
|
501
|
+
});
|
|
500
502
|
return performFn;
|
|
501
503
|
};
|
|
502
504
|
/** Generates a wrapper function that calls an existing component's onInstanceDeploy
|
|
@@ -509,14 +511,19 @@ const generateOnInstanceWrapperFn = (componentRef, onTrigger, eventName, customF
|
|
|
509
511
|
// @ts-expect-error: _components isn't part of the public API
|
|
510
512
|
const { _components } = context;
|
|
511
513
|
const invokeTrigger = _components.invokeTrigger;
|
|
512
|
-
const invokeResponse = (yield invokeTrigger(invokeTriggerComponentInput(componentRef, onTrigger, eventName), context, null, params)) || {};
|
|
514
|
+
const invokeResponse = (yield invokeTrigger(invokeTriggerComponentInput(componentRef, onTrigger, eventName), Object.assign(Object.assign({}, context), { debug: (0, context_1.createDebugContext)(context) }), null, params)) || {};
|
|
513
515
|
let customResponse = {};
|
|
514
516
|
if (customFn) {
|
|
515
|
-
customResponse =
|
|
517
|
+
customResponse =
|
|
518
|
+
(yield customFn(Object.assign(Object.assign({}, context), { debug: (0, context_1.createDebugContext)(context) }), params)) || {};
|
|
516
519
|
}
|
|
517
520
|
return (0, merge_1.default)(invokeResponse, customResponse);
|
|
518
521
|
})
|
|
519
|
-
:
|
|
522
|
+
: (context, params) => __awaiter(void 0, void 0, void 0, function* () {
|
|
523
|
+
if (customFn) {
|
|
524
|
+
return yield customFn(Object.assign(Object.assign({}, context), { debug: (0, context_1.createDebugContext)(context) }), params);
|
|
525
|
+
}
|
|
526
|
+
});
|
|
520
527
|
return onInstanceFn;
|
|
521
528
|
};
|
|
522
529
|
const convertOnExecution = (onExecution, componentRegistry) => (context, params) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -546,7 +553,7 @@ const convertOnExecution = (onExecution, componentRegistry) => (context, params)
|
|
|
546
553
|
},
|
|
547
554
|
// older versions of manifests did not contain action.key so we fall back to the registry key
|
|
548
555
|
key: (_a = action.key) !== null && _a !== void 0 ? _a : registryActionKey,
|
|
549
|
-
}, context, transformedValues);
|
|
556
|
+
}, Object.assign(Object.assign({}, context), { debug: (0, context_1.createDebugContext)(context) }), transformedValues);
|
|
550
557
|
});
|
|
551
558
|
return Object.assign(Object.assign({}, actionsAccumulator), { [registryActionKey]: invokeAction });
|
|
552
559
|
}, {});
|
|
@@ -94,7 +94,7 @@ const createInvokePollAction = (context, action, { errorHandler }) => {
|
|
|
94
94
|
* Running clean twice can have unwanted behavior depending on how users have implemented
|
|
95
95
|
* their clean functions.
|
|
96
96
|
*/
|
|
97
|
-
return yield action.perform(context, params);
|
|
97
|
+
return yield action.perform(Object.assign(Object.assign({}, context), { debug: (0, context_1.createDebugContext)(context) }), params);
|
|
98
98
|
}
|
|
99
99
|
catch (error) {
|
|
100
100
|
throw errorHandler ? errorHandler(error) : error;
|
|
@@ -122,6 +122,7 @@ const createPollingPerform = (trigger, { inputCleaners, errorHandler }) => {
|
|
|
122
122
|
context.instanceState.__prismaticInternal = Object.assign(Object.assign({}, castState), { polling: newState });
|
|
123
123
|
},
|
|
124
124
|
},
|
|
125
|
+
debug: (0, context_1.createDebugContext)(context),
|
|
125
126
|
};
|
|
126
127
|
const triggerPerform = (0, exports.createPerform)(trigger.perform, {
|
|
127
128
|
inputCleaners,
|
package/dist/types/Inputs.d.ts
CHANGED
|
@@ -87,8 +87,6 @@ interface BaseInputField {
|
|
|
87
87
|
example?: string;
|
|
88
88
|
/** Indicate if this InputField is required. */
|
|
89
89
|
required?: boolean;
|
|
90
|
-
/** Key of the data source that can be used to set the value of this input. */
|
|
91
|
-
dataSource?: string;
|
|
92
90
|
}
|
|
93
91
|
type CollectionOptions<T> = SingleValue<T> | ValueListCollection<T> | KeyValueListCollection<T>;
|
|
94
92
|
interface SingleValue<T> {
|
package/package.json
CHANGED