@prismatic-io/spectral 10.18.3 → 10.18.5
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.
|
@@ -13,13 +13,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.invokeTriggerComponentInput = exports.convertConfigVar = exports.convertInputValue = exports.convertFlow = exports.convertQueueConfig = exports.convertConfigPages = exports.convertIntegration = exports.CONCURRENCY_LIMIT_MIN = exports.CONCURRENCY_LIMIT_MAX = void 0;
|
|
16
|
+
const node_crypto_1 = require("node:crypto");
|
|
16
17
|
const fs_1 = require("fs");
|
|
17
18
|
const assign_1 = __importDefault(require("lodash/assign"));
|
|
18
19
|
const camelCase_1 = __importDefault(require("lodash/camelCase"));
|
|
19
20
|
const merge_1 = __importDefault(require("lodash/merge"));
|
|
20
21
|
const pick_1 = __importDefault(require("lodash/pick"));
|
|
21
22
|
const path_1 = __importDefault(require("path"));
|
|
22
|
-
const uuid_1 = require("uuid");
|
|
23
23
|
const yaml_1 = __importDefault(require("yaml"));
|
|
24
24
|
const types_1 = require("../types");
|
|
25
25
|
const asyncContext_1 = require("./asyncContext");
|
|
@@ -34,7 +34,7 @@ const convertIntegration = (definition) => {
|
|
|
34
34
|
// Generate a unique reference key that will be used to reference the
|
|
35
35
|
// actions, triggers, data sources, and connections that are created
|
|
36
36
|
// inline as part of the integration definition.
|
|
37
|
-
const referenceKey = (0,
|
|
37
|
+
const referenceKey = (0, node_crypto_1.randomUUID)();
|
|
38
38
|
const scopedConfigVars = (_a = definition.scopedConfigVars) !== null && _a !== void 0 ? _a : {};
|
|
39
39
|
const configVars = Object.values({
|
|
40
40
|
configPages: (_b = definition.configPages) !== null && _b !== void 0 ? _b : {},
|
|
@@ -541,7 +541,19 @@ const convertConfigVar = (key, configVar, referenceKey, componentRegistry) => {
|
|
|
541
541
|
"collectionType",
|
|
542
542
|
]));
|
|
543
543
|
if ((0, types_1.isScheduleConfigVar)(configVar)) {
|
|
544
|
-
|
|
544
|
+
// Mirror the low-code options: callers may supply `scheduleType`
|
|
545
|
+
// explicitly ("none" / "minute" / "hour" / "day" / "week" / "custom").
|
|
546
|
+
// Otherwise infer from defaultValue: a non-empty string is treated as a
|
|
547
|
+
// custom CRON expression; missing/empty means "never".
|
|
548
|
+
if (configVar.scheduleType) {
|
|
549
|
+
result.scheduleType = configVar.scheduleType;
|
|
550
|
+
}
|
|
551
|
+
else if (typeof defaultValue === "string" && defaultValue.length > 0) {
|
|
552
|
+
result.scheduleType = "custom";
|
|
553
|
+
}
|
|
554
|
+
else {
|
|
555
|
+
result.scheduleType = "none";
|
|
556
|
+
}
|
|
545
557
|
}
|
|
546
558
|
if ((0, types_1.isJsonFormConfigVar)(configVar) || (0, types_1.isJsonFormDataSourceConfigVar)(configVar)) {
|
|
547
559
|
result.meta = Object.assign(Object.assign({}, result.meta), { validationMode: (_c = configVar === null || configVar === void 0 ? void 0 : configVar.validationMode) !== null && _c !== void 0 ? _c : "ValidateAndShow" });
|
|
@@ -120,9 +120,22 @@ type CodeConfigVar = CreateStandardConfigVar<"code"> & {
|
|
|
120
120
|
};
|
|
121
121
|
type BooleanConfigVar = CreateStandardConfigVar<"boolean">;
|
|
122
122
|
type NumberConfigVar = CreateStandardConfigVar<"number">;
|
|
123
|
+
/**
|
|
124
|
+
* Schedule type for a schedule-typed config variable. Mirrors the options
|
|
125
|
+
* available in low-code:
|
|
126
|
+
* - `"none"` (Never) - no schedule is set; the default when no `defaultValue` is provided.
|
|
127
|
+
* - `"minute"` / `"hour"` / `"day"` / `"week"` - run on the corresponding interval.
|
|
128
|
+
* - `"custom"` - run on a custom CRON expression supplied via `defaultValue`.
|
|
129
|
+
*/
|
|
130
|
+
export type ScheduleType = "none" | "custom" | "minute" | "hour" | "day" | "week";
|
|
123
131
|
type ScheduleConfigVar = CreateStandardConfigVar<"schedule"> & {
|
|
124
132
|
/** Timezone for the schedule. */
|
|
125
133
|
timeZone?: string;
|
|
134
|
+
/**
|
|
135
|
+
* Optional schedule type. If omitted, this is inferred from `defaultValue`
|
|
136
|
+
* (`"none"` when there is no/empty `defaultValue`, otherwise `"custom"`).
|
|
137
|
+
*/
|
|
138
|
+
scheduleType?: ScheduleType;
|
|
126
139
|
};
|
|
127
140
|
type ObjectSelectionConfigVar = CreateStandardConfigVar<"objectSelection">;
|
|
128
141
|
type ObjectFieldMapConfigVar = CreateStandardConfigVar<"objectFieldMap">;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prismatic-io/spectral",
|
|
3
|
-
"version": "10.18.
|
|
3
|
+
"version": "10.18.5",
|
|
4
4
|
"description": "Utility library for building Prismatic connectors and code-native integrations",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"prismatic"
|
|
@@ -53,7 +53,6 @@
|
|
|
53
53
|
"object-sizeof": "^2.6.4",
|
|
54
54
|
"prettier": "^3.8.3",
|
|
55
55
|
"safe-stable-stringify": "^2.5.0",
|
|
56
|
-
"uuid": "^14.0.0",
|
|
57
56
|
"valid-url": "1.0.9",
|
|
58
57
|
"yaml": "^2.8.3"
|
|
59
58
|
},
|