@prismatic-io/spectral 10.11.2 → 10.11.3
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.
|
@@ -57,7 +57,8 @@ const convertIntegration = (definition) => {
|
|
|
57
57
|
}
|
|
58
58
|
const cniComponent = codeNativeIntegrationComponent(definition, referenceKey, configVars);
|
|
59
59
|
const cniYaml = codeNativeIntegrationYaml(definition, referenceKey, configVars, metadata);
|
|
60
|
-
|
|
60
|
+
const publishingMetadata = codeNativeIntegrationPublishingMetadata(definition);
|
|
61
|
+
return Object.assign(Object.assign({}, cniComponent), { codeNativeIntegrationYAML: cniYaml, publishingMetadata });
|
|
61
62
|
};
|
|
62
63
|
exports.convertIntegration = convertIntegration;
|
|
63
64
|
const convertConfigPages = (pages, userLevelConfigured) => {
|
|
@@ -304,6 +305,7 @@ const convertFlow = (flow, componentRegistry, referenceKey) => {
|
|
|
304
305
|
result.onExecution = undefined;
|
|
305
306
|
result.preprocessFlowConfig = undefined;
|
|
306
307
|
result.errorConfig = undefined;
|
|
308
|
+
result.testApiKeys = undefined;
|
|
307
309
|
let publicSupplementalComponent;
|
|
308
310
|
const triggerStep = {
|
|
309
311
|
name: "On Trigger",
|
|
@@ -562,7 +564,9 @@ const generateTriggerPerformFn = (componentRef, onTrigger, componentRegistry) =>
|
|
|
562
564
|
? (context, payload, params) => __awaiter(void 0, void 0, void 0, function* () {
|
|
563
565
|
var _a;
|
|
564
566
|
// @ts-expect-error: _components isn't part of the public API
|
|
565
|
-
const _components = (_a = context._components) !== null && _a !== void 0 ? _a : {
|
|
567
|
+
const _components = (_a = context._components) !== null && _a !== void 0 ? _a : {
|
|
568
|
+
invokeTrigger: () => { },
|
|
569
|
+
};
|
|
566
570
|
const invokeTrigger = _components.invokeTrigger;
|
|
567
571
|
const cniContext = (0, context_1.createCNIContext)(context, componentRegistry);
|
|
568
572
|
return yield invokeTrigger(invokeTriggerComponentInput(componentRef, onTrigger, "perform"), cniContext, payload, params);
|
|
@@ -582,7 +586,9 @@ const generateOnInstanceWrapperFn = (componentRef, onTrigger, eventName, compone
|
|
|
582
586
|
? (context, params) => __awaiter(void 0, void 0, void 0, function* () {
|
|
583
587
|
var _a;
|
|
584
588
|
// @ts-expect-error: _components isn't part of the public API
|
|
585
|
-
const _components = (_a = context._components) !== null && _a !== void 0 ? _a : {
|
|
589
|
+
const _components = (_a = context._components) !== null && _a !== void 0 ? _a : {
|
|
590
|
+
invokeTrigger: () => { },
|
|
591
|
+
};
|
|
586
592
|
const invokeTrigger = _components.invokeTrigger;
|
|
587
593
|
const cniContext = (0, context_1.createCNIContext)(context, componentRegistry);
|
|
588
594
|
// Using runWithContext allows for component action invocation via manifest.
|
|
@@ -716,3 +722,13 @@ const codeNativeIntegrationComponent = ({ name, iconPath, description, flows = [
|
|
|
716
722
|
dataSources: convertedDataSources,
|
|
717
723
|
};
|
|
718
724
|
};
|
|
725
|
+
const codeNativeIntegrationPublishingMetadata = (definition) => {
|
|
726
|
+
const customerRequiredSecurityEndpoints = definition.flows
|
|
727
|
+
.filter((flow) => flow.endpointSecurityType === "customer_required")
|
|
728
|
+
.map(({ name, testApiKeys }) => {
|
|
729
|
+
return { name, testApiKeys };
|
|
730
|
+
});
|
|
731
|
+
return {
|
|
732
|
+
flowsWithCustomerRequiredAPIKeys: customerRequiredSecurityEndpoints,
|
|
733
|
+
};
|
|
734
|
+
};
|
|
@@ -9,6 +9,12 @@ export { UserAttributes } from "../types";
|
|
|
9
9
|
export { IntegrationAttributes } from "../types";
|
|
10
10
|
export { FlowAttributes } from "../types";
|
|
11
11
|
export { FlowSchemas } from "../types";
|
|
12
|
+
export interface PublishingMetadata {
|
|
13
|
+
flowsWithCustomerRequiredAPIKeys: {
|
|
14
|
+
name: string;
|
|
15
|
+
testApiKeys?: string[];
|
|
16
|
+
}[];
|
|
17
|
+
}
|
|
12
18
|
export interface Component {
|
|
13
19
|
key: string;
|
|
14
20
|
public?: boolean;
|
|
@@ -22,6 +28,7 @@ export interface Component {
|
|
|
22
28
|
dataSources: Record<string, DataSource>;
|
|
23
29
|
connections: Connection[];
|
|
24
30
|
codeNativeIntegrationYAML?: string;
|
|
31
|
+
publishingMetadata?: PublishingMetadata;
|
|
25
32
|
}
|
|
26
33
|
export interface Action {
|
|
27
34
|
key: string;
|
|
@@ -115,6 +115,7 @@ export interface Flow<TTriggerPayload extends TriggerPayload = TriggerPayload> {
|
|
|
115
115
|
* when the endpoint security type is `EndpointSecurityType.Organization`.
|
|
116
116
|
*/
|
|
117
117
|
organizationApiKeys?: string[];
|
|
118
|
+
testApiKeys?: string[];
|
|
118
119
|
/** Schedule configuration that defines the frequency with which this flow will be automatically executed. */
|
|
119
120
|
schedule?: (ValueExpression<string> | ConfigVarExpression) & {
|
|
120
121
|
timezone?: string;
|
package/package.json
CHANGED