@pipelab/plugin-filesystem 1.0.0-beta.13 → 1.0.0-beta.15
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 +159 -84
- package/dist/index.mjs +130 -55
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -7,9 +7,9 @@ import path, { basename, dirname, join } from "node:path";
|
|
|
7
7
|
import { fileURLToPath } from "node:url";
|
|
8
8
|
import { constants, platform } from "node:os";
|
|
9
9
|
import { appendFileSync, createReadStream, createWriteStream, existsSync, readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
|
|
10
|
+
import { cp, mkdir, rm, stat } from "node:fs/promises";
|
|
10
11
|
import http from "node:http";
|
|
11
12
|
import { webcrypto } from "node:crypto";
|
|
12
|
-
import { cp, mkdir, rm, stat } from "node:fs/promises";
|
|
13
13
|
import { ChildProcess, exec, execFile, spawn, spawnSync } from "node:child_process";
|
|
14
14
|
import { StringDecoder } from "node:string_decoder";
|
|
15
15
|
import { aborted, callbackify, debuglog, inspect, promisify, stripVTControlCharacters } from "node:util";
|
|
@@ -1596,6 +1596,56 @@ function literal(literal_, message) {
|
|
|
1596
1596
|
}
|
|
1597
1597
|
};
|
|
1598
1598
|
}
|
|
1599
|
+
function looseObject(entries, message) {
|
|
1600
|
+
return {
|
|
1601
|
+
kind: "schema",
|
|
1602
|
+
type: "loose_object",
|
|
1603
|
+
reference: looseObject,
|
|
1604
|
+
expects: "Object",
|
|
1605
|
+
async: false,
|
|
1606
|
+
entries,
|
|
1607
|
+
message,
|
|
1608
|
+
_run(dataset, config2) {
|
|
1609
|
+
const input = dataset.value;
|
|
1610
|
+
if (input && typeof input === "object") {
|
|
1611
|
+
dataset.typed = true;
|
|
1612
|
+
dataset.value = {};
|
|
1613
|
+
for (const key in this.entries) {
|
|
1614
|
+
const value2 = input[key];
|
|
1615
|
+
const valueDataset = this.entries[key]._run({
|
|
1616
|
+
typed: false,
|
|
1617
|
+
value: value2
|
|
1618
|
+
}, config2);
|
|
1619
|
+
if (valueDataset.issues) {
|
|
1620
|
+
const pathItem = {
|
|
1621
|
+
type: "object",
|
|
1622
|
+
origin: "value",
|
|
1623
|
+
input,
|
|
1624
|
+
key,
|
|
1625
|
+
value: value2
|
|
1626
|
+
};
|
|
1627
|
+
for (const issue of valueDataset.issues) {
|
|
1628
|
+
if (issue.path) issue.path.unshift(pathItem);
|
|
1629
|
+
else issue.path = [pathItem];
|
|
1630
|
+
dataset.issues?.push(issue);
|
|
1631
|
+
}
|
|
1632
|
+
if (!dataset.issues) dataset.issues = valueDataset.issues;
|
|
1633
|
+
if (config2.abortEarly) {
|
|
1634
|
+
dataset.typed = false;
|
|
1635
|
+
break;
|
|
1636
|
+
}
|
|
1637
|
+
}
|
|
1638
|
+
if (!valueDataset.typed) dataset.typed = false;
|
|
1639
|
+
if (valueDataset.value !== void 0 || key in input) dataset.value[key] = valueDataset.value;
|
|
1640
|
+
}
|
|
1641
|
+
if (!dataset.issues || !config2.abortEarly) {
|
|
1642
|
+
for (const key in input) if (_isValidObjectKey(input, key) && !(key in this.entries)) dataset.value[key] = input[key];
|
|
1643
|
+
}
|
|
1644
|
+
} else _addIssue(this, "type", dataset, config2);
|
|
1645
|
+
return dataset;
|
|
1646
|
+
}
|
|
1647
|
+
};
|
|
1648
|
+
}
|
|
1599
1649
|
function number(message) {
|
|
1600
1650
|
return {
|
|
1601
1651
|
kind: "schema",
|
|
@@ -2133,6 +2183,18 @@ settingsMigratorInternal.createMigrations({
|
|
|
2133
2183
|
})
|
|
2134
2184
|
]
|
|
2135
2185
|
});
|
|
2186
|
+
const connectionsMigratorInternal = createMigrator();
|
|
2187
|
+
const defaultConnections = connectionsMigratorInternal.createDefault({
|
|
2188
|
+
version: "1.0.0",
|
|
2189
|
+
connections: []
|
|
2190
|
+
});
|
|
2191
|
+
connectionsMigratorInternal.createMigrations({
|
|
2192
|
+
defaultValue: defaultConnections,
|
|
2193
|
+
migrations: [createMigration({
|
|
2194
|
+
version: "1.0.0",
|
|
2195
|
+
up: finalVersion
|
|
2196
|
+
})]
|
|
2197
|
+
});
|
|
2136
2198
|
const fileRepoMigratorInternal = createMigrator();
|
|
2137
2199
|
const defaultFileRepo = fileRepoMigratorInternal.createDefault({
|
|
2138
2200
|
version: "2.0.0",
|
|
@@ -2294,11 +2356,51 @@ const LEGACY_ID_MAP = {
|
|
|
2294
2356
|
};
|
|
2295
2357
|
const getStrictPluginId = (pluginId) => {
|
|
2296
2358
|
if (!pluginId) return pluginId;
|
|
2297
|
-
|
|
2298
|
-
if (pluginId.startsWith("@") || pluginId.includes("/") || pluginId.startsWith("pipelab-plugin-")) return pluginId;
|
|
2299
|
-
const prefixed = `@pipelab/plugin-${pluginId}`;
|
|
2300
|
-
return LEGACY_ID_MAP[prefixed] || prefixed;
|
|
2359
|
+
return LEGACY_ID_MAP[pluginId] || pluginId;
|
|
2301
2360
|
};
|
|
2361
|
+
//#endregion
|
|
2362
|
+
//#region ../../packages/shared/src/save-location.ts
|
|
2363
|
+
const SaveLocationInternalValidator = object({
|
|
2364
|
+
id: string(),
|
|
2365
|
+
project: string(),
|
|
2366
|
+
lastModified: string(),
|
|
2367
|
+
type: literal("internal"),
|
|
2368
|
+
configName: string()
|
|
2369
|
+
});
|
|
2370
|
+
const SaveLocationValidator = union([
|
|
2371
|
+
object({
|
|
2372
|
+
id: string(),
|
|
2373
|
+
project: string(),
|
|
2374
|
+
path: string(),
|
|
2375
|
+
lastModified: string(),
|
|
2376
|
+
type: literal("external"),
|
|
2377
|
+
summary: object({
|
|
2378
|
+
plugins: array(string()),
|
|
2379
|
+
name: string(),
|
|
2380
|
+
description: string()
|
|
2381
|
+
})
|
|
2382
|
+
}),
|
|
2383
|
+
SaveLocationInternalValidator,
|
|
2384
|
+
object({
|
|
2385
|
+
id: string(),
|
|
2386
|
+
project: string(),
|
|
2387
|
+
type: literal("pipelab-cloud")
|
|
2388
|
+
})
|
|
2389
|
+
]);
|
|
2390
|
+
object({
|
|
2391
|
+
version: literal("1.0.0"),
|
|
2392
|
+
data: optional(record(string(), SaveLocationValidator), {})
|
|
2393
|
+
});
|
|
2394
|
+
const FileRepoProjectValidatorV2$1 = object({
|
|
2395
|
+
id: string(),
|
|
2396
|
+
name: string(),
|
|
2397
|
+
description: string()
|
|
2398
|
+
});
|
|
2399
|
+
object({
|
|
2400
|
+
version: literal("2.0.0"),
|
|
2401
|
+
projects: array(FileRepoProjectValidatorV2$1),
|
|
2402
|
+
pipelines: optional(array(SaveLocationValidator), [])
|
|
2403
|
+
});
|
|
2302
2404
|
object({
|
|
2303
2405
|
cacheFolder: string(),
|
|
2304
2406
|
theme: union([literal("light"), literal("dark")]),
|
|
@@ -2450,6 +2552,17 @@ object({
|
|
|
2450
2552
|
})),
|
|
2451
2553
|
isInternalMigrationBannerClosed: optional(boolean(), false)
|
|
2452
2554
|
});
|
|
2555
|
+
const ConnectionValidator = looseObject({
|
|
2556
|
+
id: string(),
|
|
2557
|
+
pluginName: string(),
|
|
2558
|
+
name: string(),
|
|
2559
|
+
createdAt: string(),
|
|
2560
|
+
isDefault: boolean()
|
|
2561
|
+
});
|
|
2562
|
+
object({
|
|
2563
|
+
version: literal("1.0.0"),
|
|
2564
|
+
connections: array(ConnectionValidator)
|
|
2565
|
+
});
|
|
2453
2566
|
//#endregion
|
|
2454
2567
|
//#region ../../node_modules/tslog/dist/esm/prettyLogStyles.js
|
|
2455
2568
|
const prettyLogStyles = {
|
|
@@ -2970,7 +3083,7 @@ const useLogger = () => {
|
|
|
2970
3083
|
const OriginValidator = object({
|
|
2971
3084
|
pluginId: string(),
|
|
2972
3085
|
nodeId: string(),
|
|
2973
|
-
version: pipe(
|
|
3086
|
+
version: optional(pipe(string(), description("Pinned version of the plugin for this block. Falls back to \"latest\" when absent.")))
|
|
2974
3087
|
});
|
|
2975
3088
|
const BlockActionValidatorV1 = object({
|
|
2976
3089
|
type: literal("action"),
|
|
@@ -2983,7 +3096,7 @@ const EditorParamValidatorV3 = union([literal("simple"), literal("editor")]);
|
|
|
2983
3096
|
const BlockActionValidatorV3 = object({
|
|
2984
3097
|
type: literal("action"),
|
|
2985
3098
|
uid: string(),
|
|
2986
|
-
name: pipe(
|
|
3099
|
+
name: optional(pipe(string(), description("A custom name provided by the user"))),
|
|
2987
3100
|
disabled: optional(boolean()),
|
|
2988
3101
|
params: record(string(), object({
|
|
2989
3102
|
editor: EditorParamValidatorV3,
|
|
@@ -45283,35 +45396,6 @@ const createPathParam = (value, definition) => {
|
|
|
45283
45396
|
};
|
|
45284
45397
|
};
|
|
45285
45398
|
//#endregion
|
|
45286
|
-
//#region ../../packages/shared/src/save-location.ts
|
|
45287
|
-
const SaveLocationInternalValidator = object({
|
|
45288
|
-
id: string(),
|
|
45289
|
-
project: string(),
|
|
45290
|
-
lastModified: string(),
|
|
45291
|
-
type: literal("internal"),
|
|
45292
|
-
configName: string()
|
|
45293
|
-
});
|
|
45294
|
-
const SaveLocationValidator = union([
|
|
45295
|
-
object({
|
|
45296
|
-
id: string(),
|
|
45297
|
-
project: string(),
|
|
45298
|
-
path: string(),
|
|
45299
|
-
lastModified: string(),
|
|
45300
|
-
type: literal("external"),
|
|
45301
|
-
summary: object({
|
|
45302
|
-
plugins: array(string()),
|
|
45303
|
-
name: string(),
|
|
45304
|
-
description: string()
|
|
45305
|
-
})
|
|
45306
|
-
}),
|
|
45307
|
-
SaveLocationInternalValidator,
|
|
45308
|
-
object({
|
|
45309
|
-
id: string(),
|
|
45310
|
-
project: string(),
|
|
45311
|
-
type: literal("pipelab-cloud")
|
|
45312
|
-
})
|
|
45313
|
-
]);
|
|
45314
|
-
//#endregion
|
|
45315
45399
|
//#region ../../packages/shared/src/websocket.types.ts
|
|
45316
45400
|
var WebSocketError = class extends Error {
|
|
45317
45401
|
constructor(message, code, requestId) {
|
|
@@ -45328,20 +45412,6 @@ object({
|
|
|
45328
45412
|
version: literal("1.0.0"),
|
|
45329
45413
|
data: optional(record(string(), SaveLocationValidator), {})
|
|
45330
45414
|
});
|
|
45331
|
-
const FileRepoProjectValidatorV2$1 = object({
|
|
45332
|
-
id: string(),
|
|
45333
|
-
name: string(),
|
|
45334
|
-
description: string()
|
|
45335
|
-
});
|
|
45336
|
-
object({
|
|
45337
|
-
version: literal("2.0.0"),
|
|
45338
|
-
projects: array(FileRepoProjectValidatorV2$1),
|
|
45339
|
-
pipelines: optional(array(SaveLocationValidator), [])
|
|
45340
|
-
});
|
|
45341
|
-
object({
|
|
45342
|
-
version: literal("1.0.0"),
|
|
45343
|
-
data: optional(record(string(), SaveLocationValidator), {})
|
|
45344
|
-
});
|
|
45345
45415
|
const FileRepoProjectValidatorV2 = object({
|
|
45346
45416
|
id: string(),
|
|
45347
45417
|
name: string(),
|
|
@@ -45361,9 +45431,13 @@ var init_esm_shims = __esmMin((() => {
|
|
|
45361
45431
|
__dirname = /* @__PURE__ */ getDirname();
|
|
45362
45432
|
}));
|
|
45363
45433
|
//#endregion
|
|
45364
|
-
//#region ../../packages/
|
|
45434
|
+
//#region ../../packages/constants/src/index.ts
|
|
45365
45435
|
init_esm_shims();
|
|
45366
|
-
const
|
|
45436
|
+
const websocketPort = 33753;
|
|
45437
|
+
//#endregion
|
|
45438
|
+
//#region ../../packages/core-node/src/context.ts
|
|
45439
|
+
const metaUrl = typeof import.meta !== "undefined" ? import.meta.url : void 0;
|
|
45440
|
+
const _dirname = typeof __dirname !== "undefined" ? __dirname : metaUrl ? dirname(fileURLToPath(metaUrl)) : process.cwd();
|
|
45367
45441
|
const isDev = process.env.NODE_ENV === "development";
|
|
45368
45442
|
/**
|
|
45369
45443
|
* Finds the monorepo root by looking for pnpm-workspace.yaml.
|
|
@@ -48935,9 +49009,6 @@ const useAPI = () => {
|
|
|
48935
49009
|
};
|
|
48936
49010
|
};
|
|
48937
49011
|
//#endregion
|
|
48938
|
-
//#region ../../packages/constants/src/index.ts
|
|
48939
|
-
const websocketPort = 33753;
|
|
48940
|
-
//#endregion
|
|
48941
49012
|
//#region ../../packages/core-node/src/websocket-server.ts
|
|
48942
49013
|
var WebSocketServer = class {
|
|
48943
49014
|
wss = null;
|
|
@@ -150924,6 +150995,9 @@ const createActionRunner = (runner) => runner;
|
|
|
150924
150995
|
const zip = createAction({
|
|
150925
150996
|
id: "zip-node",
|
|
150926
150997
|
name: "Zip",
|
|
150998
|
+
version: 1,
|
|
150999
|
+
deprecated: true,
|
|
151000
|
+
deprecatedMessage: "Use the new Zip V2 block instead.",
|
|
150927
151001
|
updateAvailable: true,
|
|
150928
151002
|
displayString: "`Zip ${fmt.param(params.folder, \"primary\", \"No folder specified\")} to ${fmt.param(params.output, \"secondary\", \"No output specified\")}`",
|
|
150929
151003
|
params: {
|
|
@@ -150995,6 +151069,7 @@ const zipRunner = createActionRunner(async ({ log, inputs, setOutput, abortSigna
|
|
|
150995
151069
|
const zipV2 = createAction({
|
|
150996
151070
|
id: "zip-v2-node",
|
|
150997
151071
|
name: "Zip",
|
|
151072
|
+
version: 2,
|
|
150998
151073
|
displayString: "`Zip ${fmt.param(params.folder, \"primary\", \"No folder specified\")}`",
|
|
150999
151074
|
params: { folder: createPathParam("", {
|
|
151000
151075
|
required: true,
|