@ever-works/activepieces-plugin 1.0.14 → 1.0.16
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/index.cjs +287 -22
- package/dist/index.js +287 -22
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -491,7 +491,11 @@ var TASK_RESERVED_LABELS = Object.freeze([
|
|
|
491
491
|
"release:promotion",
|
|
492
492
|
"release:revert"
|
|
493
493
|
]);
|
|
494
|
-
var TASK_RESERVED_LABEL_PREFIXES = Object.freeze([
|
|
494
|
+
var TASK_RESERVED_LABEL_PREFIXES = Object.freeze([
|
|
495
|
+
"release:",
|
|
496
|
+
"provision-attempt-",
|
|
497
|
+
"fleet:"
|
|
498
|
+
]);
|
|
495
499
|
var PLATFORM_DEFAULT_MERGE_POLICY = Object.freeze({
|
|
496
500
|
allowAgentMerge: false,
|
|
497
501
|
requireGreenGate: true,
|
|
@@ -1261,7 +1265,18 @@ var FLEET_JOB_DEFAULT_QUEUED_MAX_AGE_SEC = Object.freeze({
|
|
|
1261
1265
|
// fails closed to), so an older reader's "unknown kind" answer is unchanged.
|
|
1262
1266
|
// A control the owner no longer wants is cancelled with its child's row.
|
|
1263
1267
|
"vm-create": 2 * 60 * 60,
|
|
1264
|
-
"vm-control": 2 * 60 * 60
|
|
1268
|
+
"vm-control": 2 * 60 * 60,
|
|
1269
|
+
// Usage scan (FL-20). The plan proposed 15 minutes (one scan interval); like
|
|
1270
|
+
// the kinds above it does NOT undercut the shortest existing default (the
|
|
1271
|
+
// fallback an unknown kind fails closed to). A scan nobody leased is simply
|
|
1272
|
+
// superseded: the dispatcher never enqueues a second while one is queued.
|
|
1273
|
+
"usage-scan": 2 * 60 * 60,
|
|
1274
|
+
// Actions runners on computers (FL-18). The plan proposed an hour for an
|
|
1275
|
+
// install and ten minutes for a control; like FL-16's kinds they do NOT
|
|
1276
|
+
// undercut the shortest existing default (the fallback an unknown kind fails
|
|
1277
|
+
// closed to), so an older reader's answer for an unknown kind is unchanged.
|
|
1278
|
+
"runner-install": 2 * 60 * 60,
|
|
1279
|
+
"runner-control": 2 * 60 * 60
|
|
1265
1280
|
});
|
|
1266
1281
|
var FLEET_JOB_MAX_QUEUED_MAX_AGE_SEC = 7 * 24 * 60 * 60;
|
|
1267
1282
|
var FLEET_AGENT_EXECUTION_MAX_INSTRUCTIONS_BYTES = 160 * 1024;
|
|
@@ -1603,7 +1618,7 @@ var FLEET_TOOL_CATALOGUE = Object.freeze([
|
|
|
1603
1618
|
route: GET("/api/fleet/nodes/{id}/desktop/screenshot"),
|
|
1604
1619
|
cli: "fleet desktop screenshot"
|
|
1605
1620
|
}),
|
|
1606
|
-
read("fleet_desktop_displays", "desktop", "FL-07", "FLEET_DESKTOP_ENABLED", "
|
|
1621
|
+
read("fleet_desktop_displays", "desktop", "FL-07", "FLEET_DESKTOP_ENABLED", "live", {
|
|
1607
1622
|
route: GET("/api/fleet/nodes/{id}/desktop/displays"),
|
|
1608
1623
|
cli: "fleet desktop displays"
|
|
1609
1624
|
}),
|
|
@@ -1877,6 +1892,9 @@ var FLEET_TOOL_CATALOGUE = Object.freeze([
|
|
|
1877
1892
|
route: GET("/api/fleet/checkouts/{id}/changes"),
|
|
1878
1893
|
cli: "fleet checkouts changes"
|
|
1879
1894
|
}),
|
|
1895
|
+
read("fleet_checkouts_pull_request_get", "checkouts", "FL-06", "FLEET_CHECKOUTS_ENABLED", "planned", {
|
|
1896
|
+
route: GET("/api/fleet/checkouts/{id}/pull-request")
|
|
1897
|
+
}),
|
|
1880
1898
|
act("fleet_checkouts_create", "checkouts", "FL-14", "FLEET_CHECKOUTS_ENABLED", "live", plain("machine.run"), {
|
|
1881
1899
|
route: POST("/api/fleet/checkouts"),
|
|
1882
1900
|
cli: "fleet checkouts create",
|
|
@@ -1957,9 +1975,9 @@ var FLEET_TOOL_CATALOGUE = Object.freeze([
|
|
|
1957
1975
|
waitable: true,
|
|
1958
1976
|
alwaysHeld: true
|
|
1959
1977
|
}),
|
|
1960
|
-
// ── cloud (FL-17) ── P1 shipped
|
|
1961
|
-
// change and a destroy are held for the
|
|
1962
|
-
// (`agent-fleet-cloud-tools.ts`)
|
|
1978
|
+
// ── cloud (FL-17) ── P1 shipped providers, create, power, destroy, usage; P2 the idle policy
|
|
1979
|
+
// (`PUT` answers the same as `PATCH`). A create, a power change and a destroy are held for the
|
|
1980
|
+
// owner's approval by the Agent tools (`agent-fleet-cloud-tools.ts`).
|
|
1963
1981
|
read("fleet_cloud_list", "view", "FL-17", "FLEET_CLOUD_ENABLED", "live", {
|
|
1964
1982
|
phase: "P3",
|
|
1965
1983
|
route: GET("/api/fleet/cloud"),
|
|
@@ -1998,18 +2016,20 @@ var FLEET_TOOL_CATALOGUE = Object.freeze([
|
|
|
1998
2016
|
waitable: true,
|
|
1999
2017
|
alwaysHeld: true
|
|
2000
2018
|
}),
|
|
2001
|
-
act("fleet_cloud_idle_policy", "machines", "FL-17", "FLEET_CLOUD_ENABLED", "
|
|
2019
|
+
act("fleet_cloud_idle_policy", "machines", "FL-17", "FLEET_CLOUD_ENABLED", "live", plain("machine.admin"), {
|
|
2002
2020
|
phase: "P3",
|
|
2003
2021
|
route: PATCH("/api/fleet/cloud/{id}/idle-policy"),
|
|
2004
2022
|
cli: "fleet cloud idle-policy"
|
|
2005
2023
|
}),
|
|
2006
|
-
// ── runners (FL-18) ──
|
|
2007
|
-
|
|
2024
|
+
// ── runners (FL-18) ── P1 shipped: list, install, start / stop / restart, remove. An install, a
|
|
2025
|
+
// stop, a restart and a remove asked by an Agent are held for the owner's approval
|
|
2026
|
+
// (`agent-fleet-runners-tools.ts`). P2: the Actions jobs read and Cancel workflow run (always held for an Agent).
|
|
2027
|
+
read("fleet_runners_list", "view", "FL-18", "FLEET_ACTIONS_RUNNERS_ENABLED", "live", {
|
|
2008
2028
|
phase: "P3",
|
|
2009
2029
|
route: GET("/api/fleet/nodes/{id}/runners"),
|
|
2010
2030
|
cli: "fleet runners list"
|
|
2011
2031
|
}),
|
|
2012
|
-
read("fleet_runners_jobs", "view", "FL-18", "FLEET_ACTIONS_RUNNERS_ENABLED", "
|
|
2032
|
+
read("fleet_runners_jobs", "view", "FL-18", "FLEET_ACTIONS_RUNNERS_ENABLED", "live", {
|
|
2013
2033
|
phase: "P3",
|
|
2014
2034
|
route: GET("/api/fleet/runners/jobs"),
|
|
2015
2035
|
cli: "fleet runners jobs"
|
|
@@ -2019,23 +2039,29 @@ var FLEET_TOOL_CATALOGUE = Object.freeze([
|
|
|
2019
2039
|
"machines",
|
|
2020
2040
|
"FL-18",
|
|
2021
2041
|
"FLEET_ACTIONS_RUNNERS_ENABLED",
|
|
2022
|
-
"
|
|
2042
|
+
"live",
|
|
2023
2043
|
confirm("machine.admin"),
|
|
2024
|
-
{
|
|
2044
|
+
{
|
|
2045
|
+
phase: "P3",
|
|
2046
|
+
route: POST("/api/fleet/nodes/{id}/runners"),
|
|
2047
|
+
cli: "fleet runners install",
|
|
2048
|
+
waitable: true,
|
|
2049
|
+
alwaysHeld: true
|
|
2050
|
+
}
|
|
2025
2051
|
),
|
|
2026
2052
|
act(
|
|
2027
2053
|
"fleet_runners_action",
|
|
2028
2054
|
"machines",
|
|
2029
2055
|
"FL-18",
|
|
2030
2056
|
"FLEET_ACTIONS_RUNNERS_ENABLED",
|
|
2031
|
-
"
|
|
2057
|
+
"live",
|
|
2032
2058
|
confirm("machine.admin"),
|
|
2033
2059
|
{
|
|
2034
2060
|
phase: "P3",
|
|
2035
2061
|
route: POST("/api/fleet/nodes/{id}/runners/{runnerId}/{action}"),
|
|
2036
2062
|
cli: "fleet runners action",
|
|
2037
2063
|
waitable: true,
|
|
2038
|
-
confirmationNote: "plain to start; confirm to stop and restart"
|
|
2064
|
+
confirmationNote: "plain to start; confirm to stop and restart (an Agent's stop or restart is held for the owner)"
|
|
2039
2065
|
}
|
|
2040
2066
|
),
|
|
2041
2067
|
act(
|
|
@@ -2043,21 +2069,34 @@ var FLEET_TOOL_CATALOGUE = Object.freeze([
|
|
|
2043
2069
|
"machines",
|
|
2044
2070
|
"FL-18",
|
|
2045
2071
|
"FLEET_ACTIONS_RUNNERS_ENABLED",
|
|
2046
|
-
"
|
|
2072
|
+
"live",
|
|
2047
2073
|
typed("write.destructive"),
|
|
2048
|
-
{
|
|
2074
|
+
{
|
|
2075
|
+
phase: "P3",
|
|
2076
|
+
route: POST("/api/fleet/nodes/{id}/runners/{runnerId}/remove"),
|
|
2077
|
+
cli: "fleet runners remove",
|
|
2078
|
+
waitable: true,
|
|
2079
|
+
alwaysHeld: true
|
|
2080
|
+
}
|
|
2049
2081
|
),
|
|
2050
2082
|
act(
|
|
2051
2083
|
"fleet_runners_cancel_run",
|
|
2052
2084
|
"machines",
|
|
2053
2085
|
"FL-18",
|
|
2054
2086
|
"FLEET_ACTIONS_RUNNERS_ENABLED",
|
|
2055
|
-
"
|
|
2087
|
+
"live",
|
|
2056
2088
|
confirm("machine.admin"),
|
|
2057
|
-
{
|
|
2089
|
+
{
|
|
2090
|
+
phase: "P3",
|
|
2091
|
+
route: POST("/api/fleet/runners/jobs/cancel"),
|
|
2092
|
+
cli: "fleet runners cancel-run",
|
|
2093
|
+
alwaysHeld: true
|
|
2094
|
+
}
|
|
2058
2095
|
),
|
|
2059
|
-
// ── usage (FL-20) ──
|
|
2060
|
-
|
|
2096
|
+
// ── usage (FL-20) ── P1 shipped: the Usage object (totals, by model, by computer, busiest
|
|
2097
|
+
// checkouts, sessions) every surface renders, read-only, with the payer sentence in `note`.
|
|
2098
|
+
read("fleet_usage_get", "view", "FL-20", "FLEET_USAGE_SCAN_ENABLED", "live", {
|
|
2099
|
+
phase: "P3",
|
|
2061
2100
|
route: GET("/api/fleet/usage"),
|
|
2062
2101
|
cli: "fleet usage"
|
|
2063
2102
|
}),
|
|
@@ -2228,10 +2267,74 @@ var FLEET_VIRTUAL_SYSTEMS = [
|
|
|
2228
2267
|
approxDownloadGiB: 0.7
|
|
2229
2268
|
}
|
|
2230
2269
|
];
|
|
2231
|
-
var FLEET_VIRTUAL_SYSTEM_IDS = FLEET_VIRTUAL_SYSTEMS.map(
|
|
2270
|
+
var FLEET_VIRTUAL_SYSTEM_IDS = FLEET_VIRTUAL_SYSTEMS.map(
|
|
2271
|
+
(system) => system.id
|
|
2272
|
+
);
|
|
2232
2273
|
var FLEET_VIRTUAL_ENROLL_TIMEOUT_MS = 20 * 60 * 1e3;
|
|
2233
2274
|
var FLEET_CLOUD_OPTIONS_CACHE_MS = 10 * 60 * 1e3;
|
|
2234
2275
|
var HOUR_MS2 = 60 * 60 * 1e3;
|
|
2276
|
+
var FLEET_CLOUD_USAGE_FRESH_MS = 5 * 60 * 1e3;
|
|
2277
|
+
var FLEET_USAGE_SCAN_INTERVAL_MS = 15 * 60 * 1e3;
|
|
2278
|
+
var FLEET_USAGE_REPORT_MAX_BYTES = 192 * 1024;
|
|
2279
|
+
var FLEET_USAGE_ZERO_TOKENS = Object.freeze({
|
|
2280
|
+
in: 0,
|
|
2281
|
+
out: 0,
|
|
2282
|
+
cacheRead: 0,
|
|
2283
|
+
cacheWrite: 0
|
|
2284
|
+
});
|
|
2285
|
+
var FLEET_ACTIONS_RUNNERS_CLOSED_REFRESH_MS = 5 * 6e4;
|
|
2286
|
+
var FLEET_ACTIONS_RUNNER_DOWNLOADS_CACHE_MS = 60 * 6e4;
|
|
2287
|
+
var FLEET_DESKTOP_CONTROL_REASON_FIXES = Object.freeze({
|
|
2288
|
+
"control-not-allowed": { command: "ever-works-node helper control allow" },
|
|
2289
|
+
"permission-accessibility": { settingsPath: "System Settings \u2192 Privacy & Security \u2192 Accessibility" },
|
|
2290
|
+
"input-unavailable": {}
|
|
2291
|
+
});
|
|
2292
|
+
var FLEET_DESKTOP_REASONS = [
|
|
2293
|
+
"kind-unsupported",
|
|
2294
|
+
"wayland-unsupported",
|
|
2295
|
+
"helper-missing",
|
|
2296
|
+
"helper-unadmitted",
|
|
2297
|
+
"helper-untrusted",
|
|
2298
|
+
"no-display-session",
|
|
2299
|
+
"permission-screen-recording",
|
|
2300
|
+
"permission-accessibility"
|
|
2301
|
+
];
|
|
2302
|
+
var FLEET_DESKTOP_WATCH_REASONS = FLEET_DESKTOP_REASONS.filter(
|
|
2303
|
+
(reason) => reason !== "permission-accessibility"
|
|
2304
|
+
);
|
|
2305
|
+
var FLEET_DESKTOP_MAX_REASONS = FLEET_DESKTOP_REASONS.length;
|
|
2306
|
+
var FLEET_DESKTOP_REASON_FIXES = Object.freeze({
|
|
2307
|
+
"kind-unsupported": Object.freeze({}),
|
|
2308
|
+
"wayland-unsupported": Object.freeze({}),
|
|
2309
|
+
"helper-missing": Object.freeze({ command: "ever-works-node helper install" }),
|
|
2310
|
+
"helper-unadmitted": Object.freeze({ command: "ever-works-node helper admit" }),
|
|
2311
|
+
"helper-untrusted": Object.freeze({ command: "ever-works-node helper status" }),
|
|
2312
|
+
"no-display-session": Object.freeze({}),
|
|
2313
|
+
"permission-screen-recording": Object.freeze({
|
|
2314
|
+
settingsPath: "System Settings \u2192 Privacy & Security \u2192 Screen Recording"
|
|
2315
|
+
}),
|
|
2316
|
+
"permission-accessibility": Object.freeze({ settingsPath: "System Settings \u2192 Privacy & Security \u2192 Accessibility" })
|
|
2317
|
+
});
|
|
2318
|
+
var FLEET_DESKTOP_BLOCKER_CODES = Object.freeze({
|
|
2319
|
+
"kill-switch": "kill_switch",
|
|
2320
|
+
"kind-unsupported": "unsupported_on_node",
|
|
2321
|
+
offline: "unreachable",
|
|
2322
|
+
"consent-missing": "consent_missing",
|
|
2323
|
+
"permission-denied": "permission_denied",
|
|
2324
|
+
"wayland-unsupported": "unsupported_on_node",
|
|
2325
|
+
"helper-missing": "unsupported_on_node",
|
|
2326
|
+
"helper-unadmitted": "unsupported_on_node",
|
|
2327
|
+
"helper-untrusted": "unsupported_on_node",
|
|
2328
|
+
"no-display-session": "unsupported_on_node",
|
|
2329
|
+
"permission-screen-recording": "unsupported_on_node",
|
|
2330
|
+
"link-unavailable": "unreachable"
|
|
2331
|
+
});
|
|
2332
|
+
var FLEET_DESKTOP_VIEW_CEILING_MS = 4 * 60 * 6e4;
|
|
2333
|
+
var FLEET_DESKTOP_MAX_PUBLISH_BYTES = 512 * 1024;
|
|
2334
|
+
var FLEET_DESKTOP_RECORDING_MAX_BYTES = 200 * 1024 * 1024;
|
|
2335
|
+
var FLEET_DESKTOP_RECORDING_MAX_MS = 4 * 60 * 6e4;
|
|
2336
|
+
var FLEET_DESKTOP_RECORDING_MAGIC = new Uint8Array([69, 87, 82, 49]);
|
|
2337
|
+
var FLEET_DESKTOP_RECORDING_MAX_CHUNK_BYTES = 64 * 1024 * 1024;
|
|
2235
2338
|
var EMAIL_INBOX_DEFAULT_DAILY_CAP = 100;
|
|
2236
2339
|
var EMAIL_INBOX_BURST_SENDS = 10;
|
|
2237
2340
|
var EMAIL_INBOX_BURST_RECIPIENTS = 20;
|
|
@@ -2950,7 +3053,14 @@ var PLUGIN_CAPABILITIES = {
|
|
|
2950
3053
|
// `capabilities/machine-provider.interface.ts`. Appended **last**, so every
|
|
2951
3054
|
// existing constant keeps its value and its position, and landed in the same
|
|
2952
3055
|
// change as the `machine-provider` category in `plugin-manifest.types.ts`.
|
|
2953
|
-
MACHINE_PROVIDER: "machine-provider"
|
|
3056
|
+
MACHINE_PROVIDER: "machine-provider",
|
|
3057
|
+
// Actions runners on computers (FL-18, CONTRACTS R-14) — GitHub's self-hosted
|
|
3058
|
+
// runner API through the Ever Works GitHub App (`github-actions-runners`),
|
|
3059
|
+
// consumed only through `ActionsRunnersFacadeService`; see
|
|
3060
|
+
// `capabilities/actions-runners.interface.ts`. Appended last, so every
|
|
3061
|
+
// existing constant keeps its value and its position; no category is added
|
|
3062
|
+
// (the plugin is an `integration`, which exists).
|
|
3063
|
+
ACTIONS_RUNNERS: "actions-runners"
|
|
2954
3064
|
};
|
|
2955
3065
|
var ALL_PLUGIN_CAPABILITIES = Object.values(PLUGIN_CAPABILITIES);
|
|
2956
3066
|
function initializePipelineState(stepDefinitions) {
|
|
@@ -3205,6 +3315,161 @@ function buildErrorPipelineResult(error, base) {
|
|
|
3205
3315
|
function buildCancelledPipelineResult(base) {
|
|
3206
3316
|
return buildErrorPipelineResult("Pipeline cancelled", base);
|
|
3207
3317
|
}
|
|
3318
|
+
function zod3ParsedType(data) {
|
|
3319
|
+
switch (typeof data) {
|
|
3320
|
+
case "undefined":
|
|
3321
|
+
return "undefined";
|
|
3322
|
+
case "string":
|
|
3323
|
+
return "string";
|
|
3324
|
+
case "number":
|
|
3325
|
+
return Number.isNaN(data) ? "nan" : "number";
|
|
3326
|
+
case "boolean":
|
|
3327
|
+
return "boolean";
|
|
3328
|
+
case "function":
|
|
3329
|
+
return "function";
|
|
3330
|
+
case "bigint":
|
|
3331
|
+
return "bigint";
|
|
3332
|
+
case "symbol":
|
|
3333
|
+
return "symbol";
|
|
3334
|
+
case "object": {
|
|
3335
|
+
if (Array.isArray(data)) return "array";
|
|
3336
|
+
if (data === null) return "null";
|
|
3337
|
+
const thenable = data;
|
|
3338
|
+
if (typeof thenable.then === "function" && typeof thenable.catch === "function") return "promise";
|
|
3339
|
+
if (data instanceof Map) return "map";
|
|
3340
|
+
if (data instanceof Set) return "set";
|
|
3341
|
+
if (data instanceof Date) return "date";
|
|
3342
|
+
return "object";
|
|
3343
|
+
}
|
|
3344
|
+
default:
|
|
3345
|
+
return "unknown";
|
|
3346
|
+
}
|
|
3347
|
+
}
|
|
3348
|
+
function joinValues(values, separator = " | ") {
|
|
3349
|
+
return values.map((value) => typeof value === "string" ? `'${value}'` : value).join(separator);
|
|
3350
|
+
}
|
|
3351
|
+
function bigIntSafe(_key, value) {
|
|
3352
|
+
return typeof value === "bigint" ? value.toString() : value;
|
|
3353
|
+
}
|
|
3354
|
+
function schemaType(issue) {
|
|
3355
|
+
return issue.inst?._zod?.def?.type;
|
|
3356
|
+
}
|
|
3357
|
+
var ZOD3_EXPECTED = {
|
|
3358
|
+
record: "object",
|
|
3359
|
+
tuple: "array"
|
|
3360
|
+
};
|
|
3361
|
+
var ZOD3_FORMAT = {
|
|
3362
|
+
guid: "uuid",
|
|
3363
|
+
ipv4: "ip",
|
|
3364
|
+
ipv6: "ip",
|
|
3365
|
+
cidrv4: "cidr",
|
|
3366
|
+
cidrv6: "cidr"
|
|
3367
|
+
};
|
|
3368
|
+
var ZOD4_ONLY_FORMATS = /* @__PURE__ */ new Set(["lowercase", "uppercase", "e164", "ksuid", "xid", "mac", "hex", "hash"]);
|
|
3369
|
+
function invalidType(issue) {
|
|
3370
|
+
if (issue.input === void 0) return "Required";
|
|
3371
|
+
if (issue.expected === "date" && issue.input instanceof Date) return "Invalid date";
|
|
3372
|
+
const received = zod3ParsedType(issue.input);
|
|
3373
|
+
if (issue.expected === "int") {
|
|
3374
|
+
return typeof issue.input === "number" ? "Expected integer, received float" : `Expected number, received ${received}`;
|
|
3375
|
+
}
|
|
3376
|
+
const expected = ZOD3_EXPECTED[issue.expected ?? ""] ?? issue.expected;
|
|
3377
|
+
return `Expected ${expected}, received ${received}`;
|
|
3378
|
+
}
|
|
3379
|
+
function invalidValue(issue) {
|
|
3380
|
+
const values = issue.values ?? [];
|
|
3381
|
+
if (schemaType(issue) === "literal") {
|
|
3382
|
+
return `Invalid literal value, expected ${JSON.stringify(values.length === 1 ? values[0] : values, bigIntSafe)}`;
|
|
3383
|
+
}
|
|
3384
|
+
if (issue.input === void 0) return "Required";
|
|
3385
|
+
const stringEnum = values.every((value) => typeof value === "string");
|
|
3386
|
+
const input = issue.input;
|
|
3387
|
+
if (stringEnum && typeof input !== "string" || typeof input !== "string" && typeof input !== "number") {
|
|
3388
|
+
return `Expected ${joinValues(values)}, received ${zod3ParsedType(input)}`;
|
|
3389
|
+
}
|
|
3390
|
+
return `Invalid enum value. Expected ${joinValues(values)}, received '${String(input)}'`;
|
|
3391
|
+
}
|
|
3392
|
+
function invalidFormat(issue) {
|
|
3393
|
+
const format = issue.format ?? "";
|
|
3394
|
+
switch (format) {
|
|
3395
|
+
case "regex":
|
|
3396
|
+
return "Invalid";
|
|
3397
|
+
case "starts_with":
|
|
3398
|
+
return `Invalid input: must start with "${issue.prefix}"`;
|
|
3399
|
+
case "ends_with":
|
|
3400
|
+
return `Invalid input: must end with "${issue.suffix}"`;
|
|
3401
|
+
case "includes":
|
|
3402
|
+
return `Invalid input: must include "${issue.includes}"`;
|
|
3403
|
+
default:
|
|
3404
|
+
if (!format || ZOD4_ONLY_FORMATS.has(format)) return void 0;
|
|
3405
|
+
return `Invalid ${ZOD3_FORMAT[format] ?? format}`;
|
|
3406
|
+
}
|
|
3407
|
+
}
|
|
3408
|
+
function tooSmall(issue) {
|
|
3409
|
+
const { exact, inclusive, minimum } = issue;
|
|
3410
|
+
switch (issue.origin) {
|
|
3411
|
+
case "array":
|
|
3412
|
+
return `Array must contain ${exact ? "exactly" : inclusive ? "at least" : "more than"} ${minimum} element(s)`;
|
|
3413
|
+
case "string":
|
|
3414
|
+
return `String must contain ${exact ? "exactly" : inclusive ? "at least" : "over"} ${minimum} character(s)`;
|
|
3415
|
+
case "number":
|
|
3416
|
+
case "int":
|
|
3417
|
+
case "bigint":
|
|
3418
|
+
return `Number must be ${exact ? "exactly equal to " : inclusive ? "greater than or equal to " : "greater than "}${minimum}`;
|
|
3419
|
+
case "date":
|
|
3420
|
+
return `Date must be ${exact ? "exactly equal to " : inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(minimum))}`;
|
|
3421
|
+
default:
|
|
3422
|
+
return "Invalid input";
|
|
3423
|
+
}
|
|
3424
|
+
}
|
|
3425
|
+
function tooBig(issue) {
|
|
3426
|
+
const { exact, inclusive, maximum } = issue;
|
|
3427
|
+
switch (issue.origin) {
|
|
3428
|
+
case "array":
|
|
3429
|
+
return `Array must contain ${exact ? "exactly" : inclusive ? "at most" : "less than"} ${maximum} element(s)`;
|
|
3430
|
+
case "string":
|
|
3431
|
+
return `String must contain ${exact ? "exactly" : inclusive ? "at most" : "under"} ${maximum} character(s)`;
|
|
3432
|
+
case "number":
|
|
3433
|
+
case "int":
|
|
3434
|
+
return `Number must be ${exact ? "exactly" : inclusive ? "less than or equal to" : "less than"} ${maximum}`;
|
|
3435
|
+
case "bigint":
|
|
3436
|
+
return `BigInt must be ${exact ? "exactly" : inclusive ? "less than or equal to" : "less than"} ${maximum}`;
|
|
3437
|
+
case "date":
|
|
3438
|
+
return `Date must be ${exact ? "exactly" : inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(maximum))}`;
|
|
3439
|
+
default:
|
|
3440
|
+
return "Invalid input";
|
|
3441
|
+
}
|
|
3442
|
+
}
|
|
3443
|
+
function zod3ErrorMessage(issue) {
|
|
3444
|
+
switch (issue.code) {
|
|
3445
|
+
case "invalid_type":
|
|
3446
|
+
return invalidType(issue);
|
|
3447
|
+
case "invalid_value":
|
|
3448
|
+
return invalidValue(issue);
|
|
3449
|
+
case "unrecognized_keys":
|
|
3450
|
+
return `Unrecognized key(s) in object: ${joinValues(issue.keys ?? [], ", ")}`;
|
|
3451
|
+
case "invalid_union":
|
|
3452
|
+
if (issue.discriminator !== void 0 && issue.options) {
|
|
3453
|
+
return `Invalid discriminator value. Expected ${joinValues(issue.options)}`;
|
|
3454
|
+
}
|
|
3455
|
+
return "Invalid input";
|
|
3456
|
+
case "invalid_format":
|
|
3457
|
+
return invalidFormat(issue);
|
|
3458
|
+
case "too_small":
|
|
3459
|
+
return tooSmall(issue);
|
|
3460
|
+
case "too_big":
|
|
3461
|
+
return tooBig(issue);
|
|
3462
|
+
case "not_multiple_of":
|
|
3463
|
+
return `Number must be a multiple of ${issue.divisor}`;
|
|
3464
|
+
case "custom":
|
|
3465
|
+
return "Invalid input";
|
|
3466
|
+
case "invalid_key":
|
|
3467
|
+
return issue.issues?.[0]?.message;
|
|
3468
|
+
default:
|
|
3469
|
+
return void 0;
|
|
3470
|
+
}
|
|
3471
|
+
}
|
|
3472
|
+
var ZOD3_ERROR_MESSAGES = Object.freeze({ error: zod3ErrorMessage });
|
|
3208
3473
|
|
|
3209
3474
|
// src/types.ts
|
|
3210
3475
|
var ACTIVEPIECES_STEP_IDS = [
|
package/dist/index.js
CHANGED
|
@@ -464,7 +464,11 @@ var TASK_RESERVED_LABELS = Object.freeze([
|
|
|
464
464
|
"release:promotion",
|
|
465
465
|
"release:revert"
|
|
466
466
|
]);
|
|
467
|
-
var TASK_RESERVED_LABEL_PREFIXES = Object.freeze([
|
|
467
|
+
var TASK_RESERVED_LABEL_PREFIXES = Object.freeze([
|
|
468
|
+
"release:",
|
|
469
|
+
"provision-attempt-",
|
|
470
|
+
"fleet:"
|
|
471
|
+
]);
|
|
468
472
|
var PLATFORM_DEFAULT_MERGE_POLICY = Object.freeze({
|
|
469
473
|
allowAgentMerge: false,
|
|
470
474
|
requireGreenGate: true,
|
|
@@ -1234,7 +1238,18 @@ var FLEET_JOB_DEFAULT_QUEUED_MAX_AGE_SEC = Object.freeze({
|
|
|
1234
1238
|
// fails closed to), so an older reader's "unknown kind" answer is unchanged.
|
|
1235
1239
|
// A control the owner no longer wants is cancelled with its child's row.
|
|
1236
1240
|
"vm-create": 2 * 60 * 60,
|
|
1237
|
-
"vm-control": 2 * 60 * 60
|
|
1241
|
+
"vm-control": 2 * 60 * 60,
|
|
1242
|
+
// Usage scan (FL-20). The plan proposed 15 minutes (one scan interval); like
|
|
1243
|
+
// the kinds above it does NOT undercut the shortest existing default (the
|
|
1244
|
+
// fallback an unknown kind fails closed to). A scan nobody leased is simply
|
|
1245
|
+
// superseded: the dispatcher never enqueues a second while one is queued.
|
|
1246
|
+
"usage-scan": 2 * 60 * 60,
|
|
1247
|
+
// Actions runners on computers (FL-18). The plan proposed an hour for an
|
|
1248
|
+
// install and ten minutes for a control; like FL-16's kinds they do NOT
|
|
1249
|
+
// undercut the shortest existing default (the fallback an unknown kind fails
|
|
1250
|
+
// closed to), so an older reader's answer for an unknown kind is unchanged.
|
|
1251
|
+
"runner-install": 2 * 60 * 60,
|
|
1252
|
+
"runner-control": 2 * 60 * 60
|
|
1238
1253
|
});
|
|
1239
1254
|
var FLEET_JOB_MAX_QUEUED_MAX_AGE_SEC = 7 * 24 * 60 * 60;
|
|
1240
1255
|
var FLEET_AGENT_EXECUTION_MAX_INSTRUCTIONS_BYTES = 160 * 1024;
|
|
@@ -1576,7 +1591,7 @@ var FLEET_TOOL_CATALOGUE = Object.freeze([
|
|
|
1576
1591
|
route: GET("/api/fleet/nodes/{id}/desktop/screenshot"),
|
|
1577
1592
|
cli: "fleet desktop screenshot"
|
|
1578
1593
|
}),
|
|
1579
|
-
read("fleet_desktop_displays", "desktop", "FL-07", "FLEET_DESKTOP_ENABLED", "
|
|
1594
|
+
read("fleet_desktop_displays", "desktop", "FL-07", "FLEET_DESKTOP_ENABLED", "live", {
|
|
1580
1595
|
route: GET("/api/fleet/nodes/{id}/desktop/displays"),
|
|
1581
1596
|
cli: "fleet desktop displays"
|
|
1582
1597
|
}),
|
|
@@ -1850,6 +1865,9 @@ var FLEET_TOOL_CATALOGUE = Object.freeze([
|
|
|
1850
1865
|
route: GET("/api/fleet/checkouts/{id}/changes"),
|
|
1851
1866
|
cli: "fleet checkouts changes"
|
|
1852
1867
|
}),
|
|
1868
|
+
read("fleet_checkouts_pull_request_get", "checkouts", "FL-06", "FLEET_CHECKOUTS_ENABLED", "planned", {
|
|
1869
|
+
route: GET("/api/fleet/checkouts/{id}/pull-request")
|
|
1870
|
+
}),
|
|
1853
1871
|
act("fleet_checkouts_create", "checkouts", "FL-14", "FLEET_CHECKOUTS_ENABLED", "live", plain("machine.run"), {
|
|
1854
1872
|
route: POST("/api/fleet/checkouts"),
|
|
1855
1873
|
cli: "fleet checkouts create",
|
|
@@ -1930,9 +1948,9 @@ var FLEET_TOOL_CATALOGUE = Object.freeze([
|
|
|
1930
1948
|
waitable: true,
|
|
1931
1949
|
alwaysHeld: true
|
|
1932
1950
|
}),
|
|
1933
|
-
// ── cloud (FL-17) ── P1 shipped
|
|
1934
|
-
// change and a destroy are held for the
|
|
1935
|
-
// (`agent-fleet-cloud-tools.ts`)
|
|
1951
|
+
// ── cloud (FL-17) ── P1 shipped providers, create, power, destroy, usage; P2 the idle policy
|
|
1952
|
+
// (`PUT` answers the same as `PATCH`). A create, a power change and a destroy are held for the
|
|
1953
|
+
// owner's approval by the Agent tools (`agent-fleet-cloud-tools.ts`).
|
|
1936
1954
|
read("fleet_cloud_list", "view", "FL-17", "FLEET_CLOUD_ENABLED", "live", {
|
|
1937
1955
|
phase: "P3",
|
|
1938
1956
|
route: GET("/api/fleet/cloud"),
|
|
@@ -1971,18 +1989,20 @@ var FLEET_TOOL_CATALOGUE = Object.freeze([
|
|
|
1971
1989
|
waitable: true,
|
|
1972
1990
|
alwaysHeld: true
|
|
1973
1991
|
}),
|
|
1974
|
-
act("fleet_cloud_idle_policy", "machines", "FL-17", "FLEET_CLOUD_ENABLED", "
|
|
1992
|
+
act("fleet_cloud_idle_policy", "machines", "FL-17", "FLEET_CLOUD_ENABLED", "live", plain("machine.admin"), {
|
|
1975
1993
|
phase: "P3",
|
|
1976
1994
|
route: PATCH("/api/fleet/cloud/{id}/idle-policy"),
|
|
1977
1995
|
cli: "fleet cloud idle-policy"
|
|
1978
1996
|
}),
|
|
1979
|
-
// ── runners (FL-18) ──
|
|
1980
|
-
|
|
1997
|
+
// ── runners (FL-18) ── P1 shipped: list, install, start / stop / restart, remove. An install, a
|
|
1998
|
+
// stop, a restart and a remove asked by an Agent are held for the owner's approval
|
|
1999
|
+
// (`agent-fleet-runners-tools.ts`). P2: the Actions jobs read and Cancel workflow run (always held for an Agent).
|
|
2000
|
+
read("fleet_runners_list", "view", "FL-18", "FLEET_ACTIONS_RUNNERS_ENABLED", "live", {
|
|
1981
2001
|
phase: "P3",
|
|
1982
2002
|
route: GET("/api/fleet/nodes/{id}/runners"),
|
|
1983
2003
|
cli: "fleet runners list"
|
|
1984
2004
|
}),
|
|
1985
|
-
read("fleet_runners_jobs", "view", "FL-18", "FLEET_ACTIONS_RUNNERS_ENABLED", "
|
|
2005
|
+
read("fleet_runners_jobs", "view", "FL-18", "FLEET_ACTIONS_RUNNERS_ENABLED", "live", {
|
|
1986
2006
|
phase: "P3",
|
|
1987
2007
|
route: GET("/api/fleet/runners/jobs"),
|
|
1988
2008
|
cli: "fleet runners jobs"
|
|
@@ -1992,23 +2012,29 @@ var FLEET_TOOL_CATALOGUE = Object.freeze([
|
|
|
1992
2012
|
"machines",
|
|
1993
2013
|
"FL-18",
|
|
1994
2014
|
"FLEET_ACTIONS_RUNNERS_ENABLED",
|
|
1995
|
-
"
|
|
2015
|
+
"live",
|
|
1996
2016
|
confirm("machine.admin"),
|
|
1997
|
-
{
|
|
2017
|
+
{
|
|
2018
|
+
phase: "P3",
|
|
2019
|
+
route: POST("/api/fleet/nodes/{id}/runners"),
|
|
2020
|
+
cli: "fleet runners install",
|
|
2021
|
+
waitable: true,
|
|
2022
|
+
alwaysHeld: true
|
|
2023
|
+
}
|
|
1998
2024
|
),
|
|
1999
2025
|
act(
|
|
2000
2026
|
"fleet_runners_action",
|
|
2001
2027
|
"machines",
|
|
2002
2028
|
"FL-18",
|
|
2003
2029
|
"FLEET_ACTIONS_RUNNERS_ENABLED",
|
|
2004
|
-
"
|
|
2030
|
+
"live",
|
|
2005
2031
|
confirm("machine.admin"),
|
|
2006
2032
|
{
|
|
2007
2033
|
phase: "P3",
|
|
2008
2034
|
route: POST("/api/fleet/nodes/{id}/runners/{runnerId}/{action}"),
|
|
2009
2035
|
cli: "fleet runners action",
|
|
2010
2036
|
waitable: true,
|
|
2011
|
-
confirmationNote: "plain to start; confirm to stop and restart"
|
|
2037
|
+
confirmationNote: "plain to start; confirm to stop and restart (an Agent's stop or restart is held for the owner)"
|
|
2012
2038
|
}
|
|
2013
2039
|
),
|
|
2014
2040
|
act(
|
|
@@ -2016,21 +2042,34 @@ var FLEET_TOOL_CATALOGUE = Object.freeze([
|
|
|
2016
2042
|
"machines",
|
|
2017
2043
|
"FL-18",
|
|
2018
2044
|
"FLEET_ACTIONS_RUNNERS_ENABLED",
|
|
2019
|
-
"
|
|
2045
|
+
"live",
|
|
2020
2046
|
typed("write.destructive"),
|
|
2021
|
-
{
|
|
2047
|
+
{
|
|
2048
|
+
phase: "P3",
|
|
2049
|
+
route: POST("/api/fleet/nodes/{id}/runners/{runnerId}/remove"),
|
|
2050
|
+
cli: "fleet runners remove",
|
|
2051
|
+
waitable: true,
|
|
2052
|
+
alwaysHeld: true
|
|
2053
|
+
}
|
|
2022
2054
|
),
|
|
2023
2055
|
act(
|
|
2024
2056
|
"fleet_runners_cancel_run",
|
|
2025
2057
|
"machines",
|
|
2026
2058
|
"FL-18",
|
|
2027
2059
|
"FLEET_ACTIONS_RUNNERS_ENABLED",
|
|
2028
|
-
"
|
|
2060
|
+
"live",
|
|
2029
2061
|
confirm("machine.admin"),
|
|
2030
|
-
{
|
|
2062
|
+
{
|
|
2063
|
+
phase: "P3",
|
|
2064
|
+
route: POST("/api/fleet/runners/jobs/cancel"),
|
|
2065
|
+
cli: "fleet runners cancel-run",
|
|
2066
|
+
alwaysHeld: true
|
|
2067
|
+
}
|
|
2031
2068
|
),
|
|
2032
|
-
// ── usage (FL-20) ──
|
|
2033
|
-
|
|
2069
|
+
// ── usage (FL-20) ── P1 shipped: the Usage object (totals, by model, by computer, busiest
|
|
2070
|
+
// checkouts, sessions) every surface renders, read-only, with the payer sentence in `note`.
|
|
2071
|
+
read("fleet_usage_get", "view", "FL-20", "FLEET_USAGE_SCAN_ENABLED", "live", {
|
|
2072
|
+
phase: "P3",
|
|
2034
2073
|
route: GET("/api/fleet/usage"),
|
|
2035
2074
|
cli: "fleet usage"
|
|
2036
2075
|
}),
|
|
@@ -2201,10 +2240,74 @@ var FLEET_VIRTUAL_SYSTEMS = [
|
|
|
2201
2240
|
approxDownloadGiB: 0.7
|
|
2202
2241
|
}
|
|
2203
2242
|
];
|
|
2204
|
-
var FLEET_VIRTUAL_SYSTEM_IDS = FLEET_VIRTUAL_SYSTEMS.map(
|
|
2243
|
+
var FLEET_VIRTUAL_SYSTEM_IDS = FLEET_VIRTUAL_SYSTEMS.map(
|
|
2244
|
+
(system) => system.id
|
|
2245
|
+
);
|
|
2205
2246
|
var FLEET_VIRTUAL_ENROLL_TIMEOUT_MS = 20 * 60 * 1e3;
|
|
2206
2247
|
var FLEET_CLOUD_OPTIONS_CACHE_MS = 10 * 60 * 1e3;
|
|
2207
2248
|
var HOUR_MS2 = 60 * 60 * 1e3;
|
|
2249
|
+
var FLEET_CLOUD_USAGE_FRESH_MS = 5 * 60 * 1e3;
|
|
2250
|
+
var FLEET_USAGE_SCAN_INTERVAL_MS = 15 * 60 * 1e3;
|
|
2251
|
+
var FLEET_USAGE_REPORT_MAX_BYTES = 192 * 1024;
|
|
2252
|
+
var FLEET_USAGE_ZERO_TOKENS = Object.freeze({
|
|
2253
|
+
in: 0,
|
|
2254
|
+
out: 0,
|
|
2255
|
+
cacheRead: 0,
|
|
2256
|
+
cacheWrite: 0
|
|
2257
|
+
});
|
|
2258
|
+
var FLEET_ACTIONS_RUNNERS_CLOSED_REFRESH_MS = 5 * 6e4;
|
|
2259
|
+
var FLEET_ACTIONS_RUNNER_DOWNLOADS_CACHE_MS = 60 * 6e4;
|
|
2260
|
+
var FLEET_DESKTOP_CONTROL_REASON_FIXES = Object.freeze({
|
|
2261
|
+
"control-not-allowed": { command: "ever-works-node helper control allow" },
|
|
2262
|
+
"permission-accessibility": { settingsPath: "System Settings \u2192 Privacy & Security \u2192 Accessibility" },
|
|
2263
|
+
"input-unavailable": {}
|
|
2264
|
+
});
|
|
2265
|
+
var FLEET_DESKTOP_REASONS = [
|
|
2266
|
+
"kind-unsupported",
|
|
2267
|
+
"wayland-unsupported",
|
|
2268
|
+
"helper-missing",
|
|
2269
|
+
"helper-unadmitted",
|
|
2270
|
+
"helper-untrusted",
|
|
2271
|
+
"no-display-session",
|
|
2272
|
+
"permission-screen-recording",
|
|
2273
|
+
"permission-accessibility"
|
|
2274
|
+
];
|
|
2275
|
+
var FLEET_DESKTOP_WATCH_REASONS = FLEET_DESKTOP_REASONS.filter(
|
|
2276
|
+
(reason) => reason !== "permission-accessibility"
|
|
2277
|
+
);
|
|
2278
|
+
var FLEET_DESKTOP_MAX_REASONS = FLEET_DESKTOP_REASONS.length;
|
|
2279
|
+
var FLEET_DESKTOP_REASON_FIXES = Object.freeze({
|
|
2280
|
+
"kind-unsupported": Object.freeze({}),
|
|
2281
|
+
"wayland-unsupported": Object.freeze({}),
|
|
2282
|
+
"helper-missing": Object.freeze({ command: "ever-works-node helper install" }),
|
|
2283
|
+
"helper-unadmitted": Object.freeze({ command: "ever-works-node helper admit" }),
|
|
2284
|
+
"helper-untrusted": Object.freeze({ command: "ever-works-node helper status" }),
|
|
2285
|
+
"no-display-session": Object.freeze({}),
|
|
2286
|
+
"permission-screen-recording": Object.freeze({
|
|
2287
|
+
settingsPath: "System Settings \u2192 Privacy & Security \u2192 Screen Recording"
|
|
2288
|
+
}),
|
|
2289
|
+
"permission-accessibility": Object.freeze({ settingsPath: "System Settings \u2192 Privacy & Security \u2192 Accessibility" })
|
|
2290
|
+
});
|
|
2291
|
+
var FLEET_DESKTOP_BLOCKER_CODES = Object.freeze({
|
|
2292
|
+
"kill-switch": "kill_switch",
|
|
2293
|
+
"kind-unsupported": "unsupported_on_node",
|
|
2294
|
+
offline: "unreachable",
|
|
2295
|
+
"consent-missing": "consent_missing",
|
|
2296
|
+
"permission-denied": "permission_denied",
|
|
2297
|
+
"wayland-unsupported": "unsupported_on_node",
|
|
2298
|
+
"helper-missing": "unsupported_on_node",
|
|
2299
|
+
"helper-unadmitted": "unsupported_on_node",
|
|
2300
|
+
"helper-untrusted": "unsupported_on_node",
|
|
2301
|
+
"no-display-session": "unsupported_on_node",
|
|
2302
|
+
"permission-screen-recording": "unsupported_on_node",
|
|
2303
|
+
"link-unavailable": "unreachable"
|
|
2304
|
+
});
|
|
2305
|
+
var FLEET_DESKTOP_VIEW_CEILING_MS = 4 * 60 * 6e4;
|
|
2306
|
+
var FLEET_DESKTOP_MAX_PUBLISH_BYTES = 512 * 1024;
|
|
2307
|
+
var FLEET_DESKTOP_RECORDING_MAX_BYTES = 200 * 1024 * 1024;
|
|
2308
|
+
var FLEET_DESKTOP_RECORDING_MAX_MS = 4 * 60 * 6e4;
|
|
2309
|
+
var FLEET_DESKTOP_RECORDING_MAGIC = new Uint8Array([69, 87, 82, 49]);
|
|
2310
|
+
var FLEET_DESKTOP_RECORDING_MAX_CHUNK_BYTES = 64 * 1024 * 1024;
|
|
2208
2311
|
var EMAIL_INBOX_DEFAULT_DAILY_CAP = 100;
|
|
2209
2312
|
var EMAIL_INBOX_BURST_SENDS = 10;
|
|
2210
2313
|
var EMAIL_INBOX_BURST_RECIPIENTS = 20;
|
|
@@ -2923,7 +3026,14 @@ var PLUGIN_CAPABILITIES = {
|
|
|
2923
3026
|
// `capabilities/machine-provider.interface.ts`. Appended **last**, so every
|
|
2924
3027
|
// existing constant keeps its value and its position, and landed in the same
|
|
2925
3028
|
// change as the `machine-provider` category in `plugin-manifest.types.ts`.
|
|
2926
|
-
MACHINE_PROVIDER: "machine-provider"
|
|
3029
|
+
MACHINE_PROVIDER: "machine-provider",
|
|
3030
|
+
// Actions runners on computers (FL-18, CONTRACTS R-14) — GitHub's self-hosted
|
|
3031
|
+
// runner API through the Ever Works GitHub App (`github-actions-runners`),
|
|
3032
|
+
// consumed only through `ActionsRunnersFacadeService`; see
|
|
3033
|
+
// `capabilities/actions-runners.interface.ts`. Appended last, so every
|
|
3034
|
+
// existing constant keeps its value and its position; no category is added
|
|
3035
|
+
// (the plugin is an `integration`, which exists).
|
|
3036
|
+
ACTIONS_RUNNERS: "actions-runners"
|
|
2927
3037
|
};
|
|
2928
3038
|
var ALL_PLUGIN_CAPABILITIES = Object.values(PLUGIN_CAPABILITIES);
|
|
2929
3039
|
function initializePipelineState(stepDefinitions) {
|
|
@@ -3178,6 +3288,161 @@ function buildErrorPipelineResult(error, base) {
|
|
|
3178
3288
|
function buildCancelledPipelineResult(base) {
|
|
3179
3289
|
return buildErrorPipelineResult("Pipeline cancelled", base);
|
|
3180
3290
|
}
|
|
3291
|
+
function zod3ParsedType(data) {
|
|
3292
|
+
switch (typeof data) {
|
|
3293
|
+
case "undefined":
|
|
3294
|
+
return "undefined";
|
|
3295
|
+
case "string":
|
|
3296
|
+
return "string";
|
|
3297
|
+
case "number":
|
|
3298
|
+
return Number.isNaN(data) ? "nan" : "number";
|
|
3299
|
+
case "boolean":
|
|
3300
|
+
return "boolean";
|
|
3301
|
+
case "function":
|
|
3302
|
+
return "function";
|
|
3303
|
+
case "bigint":
|
|
3304
|
+
return "bigint";
|
|
3305
|
+
case "symbol":
|
|
3306
|
+
return "symbol";
|
|
3307
|
+
case "object": {
|
|
3308
|
+
if (Array.isArray(data)) return "array";
|
|
3309
|
+
if (data === null) return "null";
|
|
3310
|
+
const thenable = data;
|
|
3311
|
+
if (typeof thenable.then === "function" && typeof thenable.catch === "function") return "promise";
|
|
3312
|
+
if (data instanceof Map) return "map";
|
|
3313
|
+
if (data instanceof Set) return "set";
|
|
3314
|
+
if (data instanceof Date) return "date";
|
|
3315
|
+
return "object";
|
|
3316
|
+
}
|
|
3317
|
+
default:
|
|
3318
|
+
return "unknown";
|
|
3319
|
+
}
|
|
3320
|
+
}
|
|
3321
|
+
function joinValues(values, separator = " | ") {
|
|
3322
|
+
return values.map((value) => typeof value === "string" ? `'${value}'` : value).join(separator);
|
|
3323
|
+
}
|
|
3324
|
+
function bigIntSafe(_key, value) {
|
|
3325
|
+
return typeof value === "bigint" ? value.toString() : value;
|
|
3326
|
+
}
|
|
3327
|
+
function schemaType(issue) {
|
|
3328
|
+
return issue.inst?._zod?.def?.type;
|
|
3329
|
+
}
|
|
3330
|
+
var ZOD3_EXPECTED = {
|
|
3331
|
+
record: "object",
|
|
3332
|
+
tuple: "array"
|
|
3333
|
+
};
|
|
3334
|
+
var ZOD3_FORMAT = {
|
|
3335
|
+
guid: "uuid",
|
|
3336
|
+
ipv4: "ip",
|
|
3337
|
+
ipv6: "ip",
|
|
3338
|
+
cidrv4: "cidr",
|
|
3339
|
+
cidrv6: "cidr"
|
|
3340
|
+
};
|
|
3341
|
+
var ZOD4_ONLY_FORMATS = /* @__PURE__ */ new Set(["lowercase", "uppercase", "e164", "ksuid", "xid", "mac", "hex", "hash"]);
|
|
3342
|
+
function invalidType(issue) {
|
|
3343
|
+
if (issue.input === void 0) return "Required";
|
|
3344
|
+
if (issue.expected === "date" && issue.input instanceof Date) return "Invalid date";
|
|
3345
|
+
const received = zod3ParsedType(issue.input);
|
|
3346
|
+
if (issue.expected === "int") {
|
|
3347
|
+
return typeof issue.input === "number" ? "Expected integer, received float" : `Expected number, received ${received}`;
|
|
3348
|
+
}
|
|
3349
|
+
const expected = ZOD3_EXPECTED[issue.expected ?? ""] ?? issue.expected;
|
|
3350
|
+
return `Expected ${expected}, received ${received}`;
|
|
3351
|
+
}
|
|
3352
|
+
function invalidValue(issue) {
|
|
3353
|
+
const values = issue.values ?? [];
|
|
3354
|
+
if (schemaType(issue) === "literal") {
|
|
3355
|
+
return `Invalid literal value, expected ${JSON.stringify(values.length === 1 ? values[0] : values, bigIntSafe)}`;
|
|
3356
|
+
}
|
|
3357
|
+
if (issue.input === void 0) return "Required";
|
|
3358
|
+
const stringEnum = values.every((value) => typeof value === "string");
|
|
3359
|
+
const input = issue.input;
|
|
3360
|
+
if (stringEnum && typeof input !== "string" || typeof input !== "string" && typeof input !== "number") {
|
|
3361
|
+
return `Expected ${joinValues(values)}, received ${zod3ParsedType(input)}`;
|
|
3362
|
+
}
|
|
3363
|
+
return `Invalid enum value. Expected ${joinValues(values)}, received '${String(input)}'`;
|
|
3364
|
+
}
|
|
3365
|
+
function invalidFormat(issue) {
|
|
3366
|
+
const format = issue.format ?? "";
|
|
3367
|
+
switch (format) {
|
|
3368
|
+
case "regex":
|
|
3369
|
+
return "Invalid";
|
|
3370
|
+
case "starts_with":
|
|
3371
|
+
return `Invalid input: must start with "${issue.prefix}"`;
|
|
3372
|
+
case "ends_with":
|
|
3373
|
+
return `Invalid input: must end with "${issue.suffix}"`;
|
|
3374
|
+
case "includes":
|
|
3375
|
+
return `Invalid input: must include "${issue.includes}"`;
|
|
3376
|
+
default:
|
|
3377
|
+
if (!format || ZOD4_ONLY_FORMATS.has(format)) return void 0;
|
|
3378
|
+
return `Invalid ${ZOD3_FORMAT[format] ?? format}`;
|
|
3379
|
+
}
|
|
3380
|
+
}
|
|
3381
|
+
function tooSmall(issue) {
|
|
3382
|
+
const { exact, inclusive, minimum } = issue;
|
|
3383
|
+
switch (issue.origin) {
|
|
3384
|
+
case "array":
|
|
3385
|
+
return `Array must contain ${exact ? "exactly" : inclusive ? "at least" : "more than"} ${minimum} element(s)`;
|
|
3386
|
+
case "string":
|
|
3387
|
+
return `String must contain ${exact ? "exactly" : inclusive ? "at least" : "over"} ${minimum} character(s)`;
|
|
3388
|
+
case "number":
|
|
3389
|
+
case "int":
|
|
3390
|
+
case "bigint":
|
|
3391
|
+
return `Number must be ${exact ? "exactly equal to " : inclusive ? "greater than or equal to " : "greater than "}${minimum}`;
|
|
3392
|
+
case "date":
|
|
3393
|
+
return `Date must be ${exact ? "exactly equal to " : inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(minimum))}`;
|
|
3394
|
+
default:
|
|
3395
|
+
return "Invalid input";
|
|
3396
|
+
}
|
|
3397
|
+
}
|
|
3398
|
+
function tooBig(issue) {
|
|
3399
|
+
const { exact, inclusive, maximum } = issue;
|
|
3400
|
+
switch (issue.origin) {
|
|
3401
|
+
case "array":
|
|
3402
|
+
return `Array must contain ${exact ? "exactly" : inclusive ? "at most" : "less than"} ${maximum} element(s)`;
|
|
3403
|
+
case "string":
|
|
3404
|
+
return `String must contain ${exact ? "exactly" : inclusive ? "at most" : "under"} ${maximum} character(s)`;
|
|
3405
|
+
case "number":
|
|
3406
|
+
case "int":
|
|
3407
|
+
return `Number must be ${exact ? "exactly" : inclusive ? "less than or equal to" : "less than"} ${maximum}`;
|
|
3408
|
+
case "bigint":
|
|
3409
|
+
return `BigInt must be ${exact ? "exactly" : inclusive ? "less than or equal to" : "less than"} ${maximum}`;
|
|
3410
|
+
case "date":
|
|
3411
|
+
return `Date must be ${exact ? "exactly" : inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(maximum))}`;
|
|
3412
|
+
default:
|
|
3413
|
+
return "Invalid input";
|
|
3414
|
+
}
|
|
3415
|
+
}
|
|
3416
|
+
function zod3ErrorMessage(issue) {
|
|
3417
|
+
switch (issue.code) {
|
|
3418
|
+
case "invalid_type":
|
|
3419
|
+
return invalidType(issue);
|
|
3420
|
+
case "invalid_value":
|
|
3421
|
+
return invalidValue(issue);
|
|
3422
|
+
case "unrecognized_keys":
|
|
3423
|
+
return `Unrecognized key(s) in object: ${joinValues(issue.keys ?? [], ", ")}`;
|
|
3424
|
+
case "invalid_union":
|
|
3425
|
+
if (issue.discriminator !== void 0 && issue.options) {
|
|
3426
|
+
return `Invalid discriminator value. Expected ${joinValues(issue.options)}`;
|
|
3427
|
+
}
|
|
3428
|
+
return "Invalid input";
|
|
3429
|
+
case "invalid_format":
|
|
3430
|
+
return invalidFormat(issue);
|
|
3431
|
+
case "too_small":
|
|
3432
|
+
return tooSmall(issue);
|
|
3433
|
+
case "too_big":
|
|
3434
|
+
return tooBig(issue);
|
|
3435
|
+
case "not_multiple_of":
|
|
3436
|
+
return `Number must be a multiple of ${issue.divisor}`;
|
|
3437
|
+
case "custom":
|
|
3438
|
+
return "Invalid input";
|
|
3439
|
+
case "invalid_key":
|
|
3440
|
+
return issue.issues?.[0]?.message;
|
|
3441
|
+
default:
|
|
3442
|
+
return void 0;
|
|
3443
|
+
}
|
|
3444
|
+
}
|
|
3445
|
+
var ZOD3_ERROR_MESSAGES = Object.freeze({ error: zod3ErrorMessage });
|
|
3181
3446
|
|
|
3182
3447
|
// src/types.ts
|
|
3183
3448
|
var ACTIVEPIECES_STEP_IDS = [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ever-works/activepieces-plugin",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.16",
|
|
4
4
|
"description": "Activepieces Automation Pipeline Plugin - Delegates Work generation steps to Activepieces flows",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Ever Co. LTD",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"test:coverage": "vitest run --coverage"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@ever-works/plugin": "^1.2.
|
|
36
|
+
"@ever-works/plugin": "^1.2.12"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@ever-works/plugin": "^1.2.
|
|
39
|
+
"@ever-works/plugin": "^1.2.12",
|
|
40
40
|
"@types/node": "^26.6.4",
|
|
41
41
|
"tsup": "^8.0.0",
|
|
42
42
|
"typescript": "^5.9.3",
|
|
@@ -76,8 +76,8 @@
|
|
|
76
76
|
"url": "https://github.com/ever-works/ever-works/issues"
|
|
77
77
|
},
|
|
78
78
|
"everworksRelease": {
|
|
79
|
-
"contentHash": "sha256:
|
|
80
|
-
"commit": "
|
|
81
|
-
"source": "https://github.com/ever-works/ever-works/tree/
|
|
79
|
+
"contentHash": "sha256:f5de9e2aca3e2ad0467b789a22ad06e6d8877f3491b5a5abcb7d8fa575227926",
|
|
80
|
+
"commit": "4b0b642a5bf671c9b0480d49307c2c4442730f28",
|
|
81
|
+
"source": "https://github.com/ever-works/ever-works/tree/4b0b642a5bf671c9b0480d49307c2c4442730f28/packages/plugins/activepieces"
|
|
82
82
|
}
|
|
83
83
|
}
|