@pipelab/plugin-core 1.0.1-beta.3 → 1.0.1-beta.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.
package/dist/index.mjs CHANGED
@@ -5,11 +5,10 @@ import { formatWithOptions, types } from "util";
5
5
  import { execa } from "execa";
6
6
  import { dirname, join } from "node:path";
7
7
  import { access, mkdir, mkdtemp, realpath, writeFile } from "node:fs/promises";
8
- import { createReadStream, createWriteStream } from "node:fs";
8
+ import { createWriteStream } from "node:fs";
9
9
  import { pipeline } from "node:stream/promises";
10
10
  import pacote from "pacote";
11
11
  import { tmpdir } from "node:os";
12
- import zlib from "zlib";
13
12
  import tar from "tar";
14
13
  import yauzl from "yauzl";
15
14
  import archiver from "archiver";
@@ -49,7 +48,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
49
48
  }) : target, mod));
50
49
  var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
51
50
  //#endregion
52
- //#region ../migration/src/models/createMigration.ts
51
+ //#region ../../packages/migration/src/models/createMigration.ts
53
52
  function createMigration(migration) {
54
53
  return {
55
54
  version: migration.version,
@@ -1354,7 +1353,7 @@ var require_subset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1354
1353
  module.exports = subset;
1355
1354
  }));
1356
1355
  //#endregion
1357
- //#region ../migration/src/utils/object-keys.ts
1356
+ //#region ../../packages/migration/src/utils/object-keys.ts
1358
1357
  var import_semver = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
1359
1358
  const internalRe = require_re();
1360
1359
  const constants = require_constants$2();
@@ -2013,7 +2012,7 @@ var Migrator = class {
2013
2012
  }
2014
2013
  };
2015
2014
  //#endregion
2016
- //#region ../migration/src/models/createMigrator.ts
2015
+ //#region ../../packages/migration/src/models/createMigrator.ts
2017
2016
  const createMigrator = () => {
2018
2017
  return {
2019
2018
  createDefault(defaultState) {
@@ -2025,7 +2024,7 @@ const createMigrator = () => {
2025
2024
  };
2026
2025
  };
2027
2026
  //#endregion
2028
- //#region ../shared/src/config/migrators.ts
2027
+ //#region ../../packages/shared/src/config/migrators.ts
2029
2028
  const settingsMigratorInternal = createMigrator();
2030
2029
  const defaultAppSettings$1 = settingsMigratorInternal.createDefault({
2031
2030
  cacheFolder: "",
@@ -2265,10 +2264,10 @@ const configRegistry$1 = {
2265
2264
  pipeline: savedFileMigrator$1
2266
2265
  };
2267
2266
  //#endregion
2268
- //#region ../shared/src/apis.ts
2267
+ //#region ../../packages/shared/src/apis.ts
2269
2268
  const ShellChannels = ["dialog:showOpenDialog", "dialog:showSaveDialog"];
2270
2269
  //#endregion
2271
- //#region ../shared/src/config.schema.ts
2270
+ //#region ../../packages/shared/src/config.schema.ts
2272
2271
  const createVersionSchema = (schema) => schema;
2273
2272
  const AppSettingsValidatorV1 = object({
2274
2273
  cacheFolder: string(),
@@ -2880,7 +2879,7 @@ var Logger = class extends BaseLogger {
2880
2879
  }
2881
2880
  };
2882
2881
  //#endregion
2883
- //#region ../shared/src/logger.ts
2882
+ //#region ../../packages/shared/src/logger.ts
2884
2883
  const createDefaultLogger = () => new Logger({
2885
2884
  minLevel: 3,
2886
2885
  hideLogPositionForProduction: false
@@ -3881,7 +3880,7 @@ var we = class {
3881
3880
  }
3882
3881
  };
3883
3882
  //#endregion
3884
- //#region ../shared/src/fmt.ts
3883
+ //#region ../../packages/shared/src/fmt.ts
3885
3884
  const fmt = { param: (value, variant, ifEmpty = "") => {
3886
3885
  return `<span class="param ${variant ? variant : ""}">${value ? value : ifEmpty}</span>`;
3887
3886
  } };
@@ -3893,7 +3892,7 @@ var src_default$1 = {
3893
3892
  importModuleLoader: () => import("./emscripten-module-VHMWRAJ2-Czcf6BHN.mjs").then((mod) => mod.default)
3894
3893
  };
3895
3894
  //#endregion
3896
- //#region ../shared/src/quickjs.ts
3895
+ //#region ../../packages/shared/src/quickjs.ts
3897
3896
  var EvaluationError = class extends Error {
3898
3897
  constructor(name, description) {
3899
3898
  super(description);
@@ -3965,7 +3964,7 @@ const createQuickJsFromVariant = async (variant) => {
3965
3964
  };
3966
3965
  const createQuickJs = () => createQuickJsFromVariant(src_default$1);
3967
3966
  //#endregion
3968
- //#region ../shared/src/evaluator.ts
3967
+ //#region ../../packages/shared/src/evaluator.ts
3969
3968
  const makeResolvedParams = async (data, onItem = (item) => item, _vm) => {
3970
3969
  const { logger } = useLogger();
3971
3970
  const vm = _vm ?? await createQuickJs();
@@ -3991,7 +3990,7 @@ const makeResolvedParams = async (data, onItem = (item) => item, _vm) => {
3991
3990
  return result;
3992
3991
  };
3993
3992
  //#endregion
3994
- //#region ../shared/src/variables.ts
3993
+ //#region ../../packages/shared/src/variables.ts
3995
3994
  const variableToFormattedVariable = async (vm, variables) => {
3996
3995
  const result = {};
3997
3996
  for (const variable of variables) {
@@ -4002,7 +4001,7 @@ const variableToFormattedVariable = async (vm, variables) => {
4002
4001
  return result;
4003
4002
  };
4004
4003
  //#endregion
4005
- //#region ../shared/src/graph.ts
4004
+ //#region ../../packages/shared/src/graph.ts
4006
4005
  const getPluginDefinition = (pluginId, definitions) => {
4007
4006
  return definitions.find((nodeDef) => {
4008
4007
  return nodeDef.id === pluginId;
@@ -4063,7 +4062,7 @@ const processGraph = async (options) => {
4063
4062
  return options;
4064
4063
  };
4065
4064
  //#endregion
4066
- //#region ../shared/src/i18n/en_US.json
4065
+ //#region ../../packages/shared/src/i18n/en_US.json
4067
4066
  var en_US_default = {
4068
4067
  settings: {
4069
4068
  "darkTheme": "Dark theme",
@@ -4208,7 +4207,7 @@ var en_US_default = {
4208
4207
  }
4209
4208
  };
4210
4209
  //#endregion
4211
- //#region ../shared/src/i18n/fr_FR.json
4210
+ //#region ../../packages/shared/src/i18n/fr_FR.json
4212
4211
  var fr_FR_default = {
4213
4212
  settings: {
4214
4213
  "darkTheme": "Thème sombre",
@@ -4297,7 +4296,7 @@ var fr_FR_default = {
4297
4296
  scenarios: { "scenarios": "Scénarios" }
4298
4297
  };
4299
4298
  //#endregion
4300
- //#region ../shared/src/i18n/pt_BR.json
4299
+ //#region ../../packages/shared/src/i18n/pt_BR.json
4301
4300
  var pt_BR_default = {
4302
4301
  settings: {
4303
4302
  "darkTheme": "Tema escuro",
@@ -4383,7 +4382,7 @@ var pt_BR_default = {
4383
4382
  scenarios: { "scenarios": "Scenarios" }
4384
4383
  };
4385
4384
  //#endregion
4386
- //#region ../shared/src/i18n/zh_CN.json
4385
+ //#region ../../packages/shared/src/i18n/zh_CN.json
4387
4386
  var zh_CN_default = {
4388
4387
  settings: {
4389
4388
  "darkTheme": "Dark theme",
@@ -4469,7 +4468,7 @@ var zh_CN_default = {
4469
4468
  scenarios: { "scenarios": "Scenarios" }
4470
4469
  };
4471
4470
  //#endregion
4472
- //#region ../shared/src/i18n/es_ES.json
4471
+ //#region ../../packages/shared/src/i18n/es_ES.json
4473
4472
  var es_ES_default = {
4474
4473
  settings: {
4475
4474
  "darkTheme": "Dark theme",
@@ -4555,7 +4554,7 @@ var es_ES_default = {
4555
4554
  scenarios: { "scenarios": "Scenarios" }
4556
4555
  };
4557
4556
  //#endregion
4558
- //#region ../shared/src/i18n/de_DE.json
4557
+ //#region ../../packages/shared/src/i18n/de_DE.json
4559
4558
  var de_DE_default = {
4560
4559
  settings: {
4561
4560
  "darkTheme": "Dark theme",
@@ -4641,7 +4640,7 @@ var de_DE_default = {
4641
4640
  scenarios: { "scenarios": "Scenarios" }
4642
4641
  };
4643
4642
  //#endregion
4644
- //#region ../shared/src/model.ts
4643
+ //#region ../../packages/shared/src/model.ts
4645
4644
  const OriginValidator = object({
4646
4645
  pluginId: string(),
4647
4646
  nodeId: string()
@@ -46906,7 +46905,7 @@ var require_vue = /* @__PURE__ */ __commonJSMin(((exports, module) => {
46906
46905
  var vue_exports = /* @__PURE__ */ __exportAll({});
46907
46906
  __reExport(vue_exports, /* @__PURE__ */ __toESM(require_vue(), 1));
46908
46907
  //#endregion
46909
- //#region ../shared/src/plugins.ts
46908
+ //#region ../../packages/shared/src/plugins.ts
46910
46909
  const plugins = (0, vue_exports.shallowRef)([]);
46911
46910
  const usePlugins = () => {
46912
46911
  const load = () => {};
@@ -46920,7 +46919,7 @@ const usePlugins = () => {
46920
46919
  };
46921
46920
  };
46922
46921
  //#endregion
46923
- //#region ../shared/src/plugins/definitions.ts
46922
+ //#region ../../packages/shared/src/plugins/definitions.ts
46924
46923
  const createNodeDefinition = (def) => {
46925
46924
  return def;
46926
46925
  };
@@ -47037,7 +47036,7 @@ const createEvent = (event) => {
47037
47036
  };
47038
47037
  };
47039
47038
  //#endregion
47040
- //#region ../shared/src/save-location.ts
47039
+ //#region ../../packages/shared/src/save-location.ts
47041
47040
  const SaveLocationInternalValidator = object({
47042
47041
  id: string(),
47043
47042
  project: string(),
@@ -47069,7 +47068,7 @@ const SaveLocationValidator = union([
47069
47068
  SaveLocationPipelabCloudValidator
47070
47069
  ]);
47071
47070
  //#endregion
47072
- //#region ../shared/src/subscription-errors.ts
47071
+ //#region ../../packages/shared/src/subscription-errors.ts
47073
47072
  var SubscriptionRequiredError = class extends Error {
47074
47073
  code = "SUBSCRIPTION_REQUIRED";
47075
47074
  benefit;
@@ -64171,7 +64170,7 @@ function shouldShowDeprecationWarning() {
64171
64170
  }
64172
64171
  if (shouldShowDeprecationWarning()) console.warn("⚠️ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");
64173
64172
  //#endregion
64174
- //#region ../shared/src/supabase.ts
64173
+ //#region ../../packages/shared/src/supabase.ts
64175
64174
  const getSupabaseConfig = () => {
64176
64175
  return {
64177
64176
  url: process.env.SUPABASE_URL || "",
@@ -64191,10 +64190,10 @@ const supabase = (options) => {
64191
64190
  return createClient(url, anonKey, options);
64192
64191
  };
64193
64192
  //#endregion
64194
- //#region ../shared/src/utils.ts
64193
+ //#region ../../packages/shared/src/utils.ts
64195
64194
  const foo = "bar";
64196
64195
  //#endregion
64197
- //#region ../shared/src/validation.ts
64196
+ //#region ../../packages/shared/src/validation.ts
64198
64197
  const isRequired = (param) => {
64199
64198
  return param.required === true;
64200
64199
  };
@@ -64204,7 +64203,7 @@ const isRenderer = () => {
64204
64203
  return process.browser === true || process.title === "browser";
64205
64204
  };
64206
64205
  //#endregion
64207
- //#region ../shared/src/websocket.types.ts
64206
+ //#region ../../packages/shared/src/websocket.types.ts
64208
64207
  var WebSocketError = class extends Error {
64209
64208
  constructor(message, code, requestId) {
64210
64209
  super(message);
@@ -64265,7 +64264,7 @@ object({
64265
64264
  pipelines: optional(array(SaveLocationValidator), [])
64266
64265
  });
64267
64266
  //#endregion
64268
- //#region ../shared/src/index.ts
64267
+ //#region ../../packages/shared/src/index.ts
64269
64268
  const appSettingsMigrator = appSettingsMigrator$1;
64270
64269
  const defaultAppSettings = defaultAppSettings$1;
64271
64270
  const fileRepoMigrations = fileRepoMigrations$1;
@@ -64307,78 +64306,36 @@ const fileExists = async (path) => {
64307
64306
  return false;
64308
64307
  }
64309
64308
  };
64310
- const runWithLiveLogs = async (command, args, execaOptions, log, hooks) => {
64311
- return new Promise((resolve, reject) => {
64312
- console.log("command: ", command, args.join(" "));
64313
- const subprocess = execa(command, args, {
64314
- ...execaOptions,
64315
- stdout: "pipe",
64316
- stderr: "pipe",
64317
- stdin: "pipe"
64318
- });
64319
- subprocess.stdout.on("data", (data) => {
64320
- hooks?.onStdout?.(data.toString(), subprocess);
64321
- });
64322
- subprocess.stderr?.on("data", (data) => {
64323
- hooks?.onStderr?.(data.toString(), subprocess);
64324
- });
64325
- subprocess.on("error", (error) => {
64326
- console.log("error", error);
64327
- return reject(error);
64328
- });
64329
- subprocess.on("close", (code) => {
64330
- console.log("close", code);
64331
- hooks?.onExit?.(code);
64332
- if (code === 0) return resolve();
64333
- else return reject(/* @__PURE__ */ new Error(`Command exited with non-zero code: ${code}`));
64334
- });
64335
- subprocess.on("disconnect", () => {
64336
- console.log("disconnect");
64337
- hooks?.onExit?.(0);
64338
- return resolve();
64339
- });
64340
- subprocess.on("exit", (code) => {
64341
- console.log("exit", code);
64342
- hooks?.onExit?.(code);
64343
- if (code === 0) return resolve();
64344
- else return reject(/* @__PURE__ */ new Error(`Command exited with non-zero code: ${code}`));
64345
- });
64309
+ const runWithLiveLogs = async (command, args, execaOptions, log, hooks, abortSignal) => {
64310
+ console.log("command: ", command, args.join(" "));
64311
+ const subprocess = execa(command, args, {
64312
+ ...execaOptions,
64313
+ stdout: "pipe",
64314
+ stderr: "pipe",
64315
+ stdin: "pipe",
64316
+ env: {
64317
+ ...process.env,
64318
+ ...execaOptions.env,
64319
+ TERM: "xterm-256color",
64320
+ FORCE_STDERR_LOGGING: "1"
64321
+ },
64322
+ cancelSignal: abortSignal
64346
64323
  });
64347
- };
64348
- const runWithLiveLogsPTY = async (command, args, execaOptions, log, hooks, abortSignal) => {
64349
- return new Promise((resolve, reject) => {
64350
- console.log("command (execa-pty-fallback): ", command, args.join(" "));
64351
- const subprocess = execa(command, args, {
64352
- ...execaOptions,
64353
- stdout: "pipe",
64354
- stderr: "pipe",
64355
- stdin: "pipe",
64356
- env: {
64357
- ...process.env,
64358
- ...execaOptions.env,
64359
- TERM: "xterm-256color",
64360
- FORCE_STDERR_LOGGING: "1"
64361
- },
64362
- cancelSignal: abortSignal
64363
- });
64364
- hooks?.onCreated?.(subprocess);
64365
- subprocess.stdout?.on("data", (data) => {
64366
- hooks?.onStdout?.(data.toString(), subprocess);
64367
- });
64368
- subprocess.stderr?.on("data", (data) => {
64369
- hooks?.onStderr?.(data.toString(), subprocess);
64370
- });
64371
- subprocess.on("error", (error) => {
64372
- console.log("error", error);
64373
- return reject(error);
64374
- });
64375
- subprocess.on("exit", (code) => {
64376
- console.log("exit", code);
64377
- hooks?.onExit?.(code || 0);
64378
- if (code === 0) return resolve();
64379
- else return reject(new ExternalCommandError(`Command exited with non-zero code: ${code}`, code || 1));
64380
- });
64324
+ hooks?.onCreated?.(subprocess);
64325
+ subprocess.stdout?.on("data", (data) => {
64326
+ hooks?.onStdout?.(data.toString(), subprocess);
64327
+ });
64328
+ subprocess.stderr?.on("data", (data) => {
64329
+ hooks?.onStderr?.(data.toString(), subprocess);
64381
64330
  });
64331
+ try {
64332
+ const { exitCode } = await subprocess;
64333
+ hooks?.onExit?.(exitCode ?? 0);
64334
+ } catch (error) {
64335
+ const code = error.exitCode ?? 1;
64336
+ hooks?.onExit?.(code);
64337
+ throw new ExternalCommandError(error.message, code);
64338
+ }
64382
64339
  };
64383
64340
  /**
64384
64341
  * Downloads a file from a given URL to a specified local path with progress tracking.
@@ -64465,19 +64422,11 @@ const generateTempFolder = async (base) => {
64465
64422
  async function extractTarGz(archivePath, destinationDir) {
64466
64423
  console.log(`Extracting ${archivePath} to ${destinationDir}...`);
64467
64424
  await mkdir(destinationDir, { recursive: true });
64468
- return new Promise((resolve, reject) => {
64469
- const readStream = createReadStream(archivePath);
64470
- const gunzipStream = zlib.createGunzip();
64471
- const extractStream = tar.extract({ cwd: destinationDir });
64472
- readStream.on("error", reject);
64473
- gunzipStream.on("error", reject);
64474
- extractStream.on("error", reject);
64475
- extractStream.on("close", () => {
64476
- console.log("Extraction finished.");
64477
- resolve();
64478
- });
64479
- readStream.pipe(gunzipStream).pipe(extractStream);
64425
+ await tar.x({
64426
+ file: archivePath,
64427
+ cwd: destinationDir
64480
64428
  });
64429
+ console.log("Extraction finished.");
64481
64430
  }
64482
64431
  /**
64483
64432
  * Extracts a .zip archive.
@@ -64566,6 +64515,6 @@ const detectRuntime = async (appFolder) => {
64566
64515
  return detectedRuntime;
64567
64516
  };
64568
64517
  //#endregion
64569
- export { AppSettingsValidator, AppSettingsValidatorV1, AppSettingsValidatorV2, AppSettingsValidatorV3, AppSettingsValidatorV4, AppSettingsValidatorV5, AppSettingsValidatorV6, AppSettingsValidatorV7, BenefitNotFoundError, EditorParamValidatorV3, ExternalCommandError, OriginValidator, src_default as RELEASE_SYNC, SaveLocationExternalValidator, SaveLocationInternalValidator, SaveLocationPipelabCloudValidator, SaveLocationValidator, SavedFileDefaultValidator, SavedFileSimpleValidator, SavedFileValidator, SavedFileValidatorV1, SavedFileValidatorV2, SavedFileValidatorV3, SavedFileValidatorV4, ShellChannels, SubscriptionExpiredError, SubscriptionRequiredError, UnauthorizedError, VariableValidatorV1, WebSocketConnectionError, WebSocketError, WebSocketTimeoutError, appSettingsMigrator, configRegistry, createAction, createActionRunner, createArray, createBooleanParam, createColorPicker, createCondition, createConditionRunner, createDefinition, createEvent, createEventRunner, createExpression, createExpressionRunner, createLoop, createLoopRunner, createNetlifySiteParam, createNodeDefinition, createNumberParam, createPasswordParam, createPathParam, createPlugin, createQuickJs, createQuickJsFromVariant, createRawParam, createStringParam, createSubscriptionError, createVersionSchema, de_DE_default as de_DE, defaultAppSettings, defaultFileRepo, detectRuntime, downloadFile, en_US_default as en_US, ensure, ensureNPMPackage, es_ES_default as es_ES, extractTarGz, extractZip, fileExists, fileRepoMigrations, fmt, foo, fr_FR_default as fr_FR, generateTempFolder, getSubscriptionErrorMessage, isRenderer, isRequired, isSubscriptionError, isSupabaseAvailable, isWebSocketErrorMessage, isWebSocketRequestMessage, isWebSocketResponseMessage, makeResolvedParams, newVariant, processGraph, pt_BR_default as pt_BR, runWithLiveLogs, runWithLiveLogsPTY, savedFileMigrator, schema, sleep, supabase, useLogger, usePlugins, variableToFormattedVariable, zh_CN_default as zh_CN, zipFolder };
64518
+ export { AppSettingsValidator, AppSettingsValidatorV1, AppSettingsValidatorV2, AppSettingsValidatorV3, AppSettingsValidatorV4, AppSettingsValidatorV5, AppSettingsValidatorV6, AppSettingsValidatorV7, BenefitNotFoundError, EditorParamValidatorV3, ExternalCommandError, OriginValidator, src_default as RELEASE_SYNC, SaveLocationExternalValidator, SaveLocationInternalValidator, SaveLocationPipelabCloudValidator, SaveLocationValidator, SavedFileDefaultValidator, SavedFileSimpleValidator, SavedFileValidator, SavedFileValidatorV1, SavedFileValidatorV2, SavedFileValidatorV3, SavedFileValidatorV4, ShellChannels, SubscriptionExpiredError, SubscriptionRequiredError, UnauthorizedError, VariableValidatorV1, WebSocketConnectionError, WebSocketError, WebSocketTimeoutError, appSettingsMigrator, configRegistry, createAction, createActionRunner, createArray, createBooleanParam, createColorPicker, createCondition, createConditionRunner, createDefinition, createEvent, createEventRunner, createExpression, createExpressionRunner, createLoop, createLoopRunner, createNetlifySiteParam, createNodeDefinition, createNumberParam, createPasswordParam, createPathParam, createPlugin, createQuickJs, createQuickJsFromVariant, createRawParam, createStringParam, createSubscriptionError, createVersionSchema, de_DE_default as de_DE, defaultAppSettings, defaultFileRepo, detectRuntime, downloadFile, en_US_default as en_US, ensure, ensureNPMPackage, es_ES_default as es_ES, extractTarGz, extractZip, fileExists, fileRepoMigrations, fmt, foo, fr_FR_default as fr_FR, generateTempFolder, getSubscriptionErrorMessage, isRenderer, isRequired, isSubscriptionError, isSupabaseAvailable, isWebSocketErrorMessage, isWebSocketRequestMessage, isWebSocketResponseMessage, makeResolvedParams, newVariant, processGraph, pt_BR_default as pt_BR, runWithLiveLogs, savedFileMigrator, schema, sleep, supabase, useLogger, usePlugins, variableToFormattedVariable, zh_CN_default as zh_CN, zipFolder };
64570
64519
 
64571
64520
  //# sourceMappingURL=index.mjs.map