@prismatic-io/spectral 10.18.4 → 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.
@@ -541,7 +541,19 @@ const convertConfigVar = (key, configVar, referenceKey, componentRegistry) => {
541
541
  "collectionType",
542
542
  ]));
543
543
  if ((0, types_1.isScheduleConfigVar)(configVar)) {
544
- result.scheduleType = "custom";
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.4",
3
+ "version": "10.18.5",
4
4
  "description": "Utility library for building Prismatic connectors and code-native integrations",
5
5
  "keywords": [
6
6
  "prismatic"