@prismatic-io/spectral 10.6.5 → 10.6.7
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/generators/componentManifest/templates/connections/connection.ts.ejs +1 -1
- package/dist/generators/componentManifest/templates/dataSources/dataSource.ts.ejs +1 -1
- package/dist/serverTypes/convertIntegration.js +12 -1
- package/dist/types/IntegrationDefinition.d.ts +4 -2
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%- include('../partials/generatedHeader.ejs') -%>
|
|
2
|
-
import { connectionConfigVar } from "@prismatic-io/spectral/integration";
|
|
2
|
+
import { connectionConfigVar } from "@prismatic-io/spectral/dist/integration";
|
|
3
3
|
<%- include('../partials/imports.ejs', { imports, helpers }) %>
|
|
4
4
|
|
|
5
5
|
export interface <%= connection.typeInterface %>Values {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%- include('../partials/generatedHeader.ejs') -%>
|
|
2
|
-
import { dataSourceConfigVar } from "@prismatic-io/spectral/integration";
|
|
2
|
+
import { dataSourceConfigVar } from "@prismatic-io/spectral/dist/integration";
|
|
3
3
|
<%- include('../partials/imports.ejs', { imports, helpers }) %>
|
|
4
4
|
|
|
5
5
|
export interface <%= dataSource.typeInterface %>Values {
|
|
@@ -346,6 +346,7 @@ const convertFlow = (flow, componentRegistry, referenceKey) => {
|
|
|
346
346
|
},
|
|
347
347
|
};
|
|
348
348
|
}
|
|
349
|
+
let hasSchedule = false;
|
|
349
350
|
if ("schedule" in flow && typeof flow.schedule === "object") {
|
|
350
351
|
const { schedule } = flow;
|
|
351
352
|
triggerStep.schedule = {
|
|
@@ -357,10 +358,20 @@ const convertFlow = (flow, componentRegistry, referenceKey) => {
|
|
|
357
358
|
},
|
|
358
359
|
};
|
|
359
360
|
result.schedule = undefined;
|
|
361
|
+
hasSchedule = true;
|
|
360
362
|
}
|
|
361
363
|
if ("queueConfig" in flow && typeof flow.queueConfig === "object") {
|
|
362
364
|
const { queueConfig } = flow;
|
|
363
|
-
|
|
365
|
+
if (hasSchedule && queueConfig.usesFifoQueue) {
|
|
366
|
+
throw new Error(`${flow.name} has a schedule & usesFifoQueue set to true. FIFO queues cannot be used with scheduled flows.`);
|
|
367
|
+
}
|
|
368
|
+
else if (!hasSchedule && queueConfig.singletonExecutions) {
|
|
369
|
+
throw new Error(`${flow.name} is configured for singletonExecutions but has no schedule. Unscheduled flows cannot be configured for singleton executions.`);
|
|
370
|
+
}
|
|
371
|
+
else if (queueConfig.usesFifoQueue && queueConfig.singletonExecutions) {
|
|
372
|
+
throw new Error(`${flow.name} is configured for both FIFO queues and singleton executions, but these options are mutually exclusive. Please choose one.`);
|
|
373
|
+
}
|
|
374
|
+
result.queueConfig = Object.assign(Object.assign({ usesFifoQueue: false }, queueConfig), (queueConfig.dedupeIdField
|
|
364
375
|
? {
|
|
365
376
|
dedupeIdField: {
|
|
366
377
|
type: "reference",
|
|
@@ -160,10 +160,12 @@ export type RetryConfig = {
|
|
|
160
160
|
};
|
|
161
161
|
/** Defines attributes of a retry configuration used by a flow of an integration. */
|
|
162
162
|
export type QueueConfig = {
|
|
163
|
-
/** Determines whether the flow should be executed using FIFO ordering. */
|
|
164
|
-
usesFifoQueue
|
|
163
|
+
/** Determines whether the flow should be executed using FIFO ordering. Not valid for synchonous or scheduled flows. */
|
|
164
|
+
usesFifoQueue?: boolean;
|
|
165
165
|
/** Reference to the field in the flow's trigger return payload; used to determine whether to queue the execution. */
|
|
166
166
|
dedupeIdField?: string;
|
|
167
|
+
/** Determines whether the flow should be setup for singleton executions. Only valid for scheduled/polling trigger-based flows. */
|
|
168
|
+
singletonExecutions?: boolean;
|
|
167
169
|
};
|
|
168
170
|
/** Defines attributes of a step error configuration used to determine how to handle errors during flow step execution. */
|
|
169
171
|
export type StepErrorConfig = {
|