@pipelab/plugin-discord 1.0.0-beta.14 → 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 CHANGED
@@ -8,11 +8,11 @@ let node_os = require("node:os");
8
8
  let node_url = require("node:url");
9
9
  let node_fs = require("node:fs");
10
10
  node_fs = require_chunk.__toESM(node_fs);
11
+ let node_fs_promises = require("node:fs/promises");
12
+ node_fs_promises = require_chunk.__toESM(node_fs_promises);
11
13
  let node_http = require("node:http");
12
14
  node_http = require_chunk.__toESM(node_http);
13
15
  let node_crypto = require("node:crypto");
14
- let node_fs_promises = require("node:fs/promises");
15
- node_fs_promises = require_chunk.__toESM(node_fs_promises);
16
16
  let node_child_process = require("node:child_process");
17
17
  let node_string_decoder = require("node:string_decoder");
18
18
  let node_util = require("node:util");
@@ -1605,6 +1605,56 @@ function literal(literal_, message) {
1605
1605
  }
1606
1606
  };
1607
1607
  }
1608
+ function looseObject(entries, message) {
1609
+ return {
1610
+ kind: "schema",
1611
+ type: "loose_object",
1612
+ reference: looseObject,
1613
+ expects: "Object",
1614
+ async: false,
1615
+ entries,
1616
+ message,
1617
+ _run(dataset, config2) {
1618
+ const input = dataset.value;
1619
+ if (input && typeof input === "object") {
1620
+ dataset.typed = true;
1621
+ dataset.value = {};
1622
+ for (const key in this.entries) {
1623
+ const value2 = input[key];
1624
+ const valueDataset = this.entries[key]._run({
1625
+ typed: false,
1626
+ value: value2
1627
+ }, config2);
1628
+ if (valueDataset.issues) {
1629
+ const pathItem = {
1630
+ type: "object",
1631
+ origin: "value",
1632
+ input,
1633
+ key,
1634
+ value: value2
1635
+ };
1636
+ for (const issue of valueDataset.issues) {
1637
+ if (issue.path) issue.path.unshift(pathItem);
1638
+ else issue.path = [pathItem];
1639
+ dataset.issues?.push(issue);
1640
+ }
1641
+ if (!dataset.issues) dataset.issues = valueDataset.issues;
1642
+ if (config2.abortEarly) {
1643
+ dataset.typed = false;
1644
+ break;
1645
+ }
1646
+ }
1647
+ if (!valueDataset.typed) dataset.typed = false;
1648
+ if (valueDataset.value !== void 0 || key in input) dataset.value[key] = valueDataset.value;
1649
+ }
1650
+ if (!dataset.issues || !config2.abortEarly) {
1651
+ for (const key in input) if (_isValidObjectKey(input, key) && !(key in this.entries)) dataset.value[key] = input[key];
1652
+ }
1653
+ } else _addIssue(this, "type", dataset, config2);
1654
+ return dataset;
1655
+ }
1656
+ };
1657
+ }
1608
1658
  function number(message) {
1609
1659
  return {
1610
1660
  kind: "schema",
@@ -2142,6 +2192,18 @@ settingsMigratorInternal.createMigrations({
2142
2192
  })
2143
2193
  ]
2144
2194
  });
2195
+ const connectionsMigratorInternal = createMigrator();
2196
+ const defaultConnections = connectionsMigratorInternal.createDefault({
2197
+ version: "1.0.0",
2198
+ connections: []
2199
+ });
2200
+ connectionsMigratorInternal.createMigrations({
2201
+ defaultValue: defaultConnections,
2202
+ migrations: [createMigration({
2203
+ version: "1.0.0",
2204
+ up: finalVersion
2205
+ })]
2206
+ });
2145
2207
  const fileRepoMigratorInternal = createMigrator();
2146
2208
  const defaultFileRepo = fileRepoMigratorInternal.createDefault({
2147
2209
  version: "2.0.0",
@@ -2303,11 +2365,51 @@ const LEGACY_ID_MAP = {
2303
2365
  };
2304
2366
  const getStrictPluginId = (pluginId) => {
2305
2367
  if (!pluginId) return pluginId;
2306
- if (LEGACY_ID_MAP[pluginId]) return LEGACY_ID_MAP[pluginId];
2307
- if (pluginId.startsWith("@") || pluginId.includes("/") || pluginId.startsWith("pipelab-plugin-")) return pluginId;
2308
- const prefixed = `@pipelab/plugin-${pluginId}`;
2309
- return LEGACY_ID_MAP[prefixed] || prefixed;
2368
+ return LEGACY_ID_MAP[pluginId] || pluginId;
2310
2369
  };
2370
+ //#endregion
2371
+ //#region ../../packages/shared/src/save-location.ts
2372
+ const SaveLocationInternalValidator = object({
2373
+ id: string(),
2374
+ project: string(),
2375
+ lastModified: string(),
2376
+ type: literal("internal"),
2377
+ configName: string()
2378
+ });
2379
+ const SaveLocationValidator = union([
2380
+ object({
2381
+ id: string(),
2382
+ project: string(),
2383
+ path: string(),
2384
+ lastModified: string(),
2385
+ type: literal("external"),
2386
+ summary: object({
2387
+ plugins: array(string()),
2388
+ name: string(),
2389
+ description: string()
2390
+ })
2391
+ }),
2392
+ SaveLocationInternalValidator,
2393
+ object({
2394
+ id: string(),
2395
+ project: string(),
2396
+ type: literal("pipelab-cloud")
2397
+ })
2398
+ ]);
2399
+ object({
2400
+ version: literal("1.0.0"),
2401
+ data: optional(record(string(), SaveLocationValidator), {})
2402
+ });
2403
+ const FileRepoProjectValidatorV2$1 = object({
2404
+ id: string(),
2405
+ name: string(),
2406
+ description: string()
2407
+ });
2408
+ object({
2409
+ version: literal("2.0.0"),
2410
+ projects: array(FileRepoProjectValidatorV2$1),
2411
+ pipelines: optional(array(SaveLocationValidator), [])
2412
+ });
2311
2413
  object({
2312
2414
  cacheFolder: string(),
2313
2415
  theme: union([literal("light"), literal("dark")]),
@@ -2459,6 +2561,17 @@ object({
2459
2561
  })),
2460
2562
  isInternalMigrationBannerClosed: optional(boolean(), false)
2461
2563
  });
2564
+ const ConnectionValidator = looseObject({
2565
+ id: string(),
2566
+ pluginName: string(),
2567
+ name: string(),
2568
+ createdAt: string(),
2569
+ isDefault: boolean()
2570
+ });
2571
+ object({
2572
+ version: literal("1.0.0"),
2573
+ connections: array(ConnectionValidator)
2574
+ });
2462
2575
  //#endregion
2463
2576
  //#region ../../node_modules/tslog/dist/esm/prettyLogStyles.js
2464
2577
  const prettyLogStyles = {
@@ -2979,7 +3092,7 @@ const useLogger = () => {
2979
3092
  const OriginValidator = object({
2980
3093
  pluginId: string(),
2981
3094
  nodeId: string(),
2982
- version: pipe(optional(string()), description("Pinned version of the plugin for this block. Falls back to \"latest\" when absent."))
3095
+ version: optional(pipe(string(), description("Pinned version of the plugin for this block. Falls back to \"latest\" when absent.")))
2983
3096
  });
2984
3097
  const BlockActionValidatorV1 = object({
2985
3098
  type: literal("action"),
@@ -2992,7 +3105,7 @@ const EditorParamValidatorV3 = union([literal("simple"), literal("editor")]);
2992
3105
  const BlockActionValidatorV3 = object({
2993
3106
  type: literal("action"),
2994
3107
  uid: string(),
2995
- name: pipe(optional(string()), description("A custom name provided by the user")),
3108
+ name: optional(pipe(string(), description("A custom name provided by the user"))),
2996
3109
  disabled: optional(boolean()),
2997
3110
  params: record(string(), object({
2998
3111
  editor: EditorParamValidatorV3,
@@ -45292,35 +45405,6 @@ const createPathParam = (value, definition) => {
45292
45405
  };
45293
45406
  };
45294
45407
  //#endregion
45295
- //#region ../../packages/shared/src/save-location.ts
45296
- const SaveLocationInternalValidator = object({
45297
- id: string(),
45298
- project: string(),
45299
- lastModified: string(),
45300
- type: literal("internal"),
45301
- configName: string()
45302
- });
45303
- const SaveLocationValidator = union([
45304
- object({
45305
- id: string(),
45306
- project: string(),
45307
- path: string(),
45308
- lastModified: string(),
45309
- type: literal("external"),
45310
- summary: object({
45311
- plugins: array(string()),
45312
- name: string(),
45313
- description: string()
45314
- })
45315
- }),
45316
- SaveLocationInternalValidator,
45317
- object({
45318
- id: string(),
45319
- project: string(),
45320
- type: literal("pipelab-cloud")
45321
- })
45322
- ]);
45323
- //#endregion
45324
45408
  //#region ../../packages/shared/src/websocket.types.ts
45325
45409
  var WebSocketError = class extends Error {
45326
45410
  constructor(message, code, requestId) {
@@ -45337,20 +45421,6 @@ object({
45337
45421
  version: literal("1.0.0"),
45338
45422
  data: optional(record(string(), SaveLocationValidator), {})
45339
45423
  });
45340
- const FileRepoProjectValidatorV2$1 = object({
45341
- id: string(),
45342
- name: string(),
45343
- description: string()
45344
- });
45345
- object({
45346
- version: literal("2.0.0"),
45347
- projects: array(FileRepoProjectValidatorV2$1),
45348
- pipelines: optional(array(SaveLocationValidator), [])
45349
- });
45350
- object({
45351
- version: literal("1.0.0"),
45352
- data: optional(record(string(), SaveLocationValidator), {})
45353
- });
45354
45424
  const FileRepoProjectValidatorV2 = object({
45355
45425
  id: string(),
45356
45426
  name: string(),
@@ -45362,8 +45432,14 @@ object({
45362
45432
  pipelines: optional(array(SaveLocationValidator), [])
45363
45433
  });
45364
45434
  //#endregion
45435
+ //#region ../../packages/constants/src/index.ts
45436
+ const websocketPort = 33753;
45437
+ const DEFAULT_NODE_VERSION = "24.14.1";
45438
+ const DEFAULT_PNPM_VERSION = "10.12.0";
45439
+ //#endregion
45365
45440
  //#region ../../packages/core-node/src/context.ts
45366
- const _dirname = typeof __dirname !== "undefined" ? __dirname : require("url").pathToFileURL(__filename).href ? (0, node_path.dirname)((0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href)) : process.cwd();
45441
+ const metaUrl = require("url").pathToFileURL(__filename).href;
45442
+ const _dirname = typeof __dirname !== "undefined" ? __dirname : metaUrl ? (0, node_path.dirname)((0, node_url.fileURLToPath)(metaUrl)) : process.cwd();
45367
45443
  const isDev = process.env.NODE_ENV === "development";
45368
45444
  /**
45369
45445
  * Finds the monorepo root by looking for pnpm-workspace.yaml.
@@ -48935,9 +49011,6 @@ const useAPI = () => {
48935
49011
  };
48936
49012
  };
48937
49013
  //#endregion
48938
- //#region ../../packages/constants/src/index.ts
48939
- const websocketPort = 33753;
48940
- //#endregion
48941
49014
  //#region ../../packages/core-node/src/websocket-server.ts
48942
49015
  var WebSocketServer = class {
48943
49016
  wss = null;
@@ -59946,14 +60019,14 @@ var require_path_reservations = /* @__PURE__ */ require_chunk.__commonJSMin(((ex
59946
60019
  const assert$1 = require("assert");
59947
60020
  const normalize = require_normalize_unicode();
59948
60021
  const stripSlashes = require_strip_trailing_slashes();
59949
- const { join: join$19 } = require("path");
60022
+ const { join: join$20 } = require("path");
59950
60023
  const isWindows = (process.env.TESTING_TAR_FAKE_PLATFORM || process.platform) === "win32";
59951
60024
  module.exports = () => {
59952
60025
  const queues = /* @__PURE__ */ new Map();
59953
60026
  const reservations = /* @__PURE__ */ new Map();
59954
60027
  const getDirs = (path$62) => {
59955
60028
  return path$62.split("/").slice(0, -1).reduce((set, path$63) => {
59956
- if (set.length) path$63 = join$19(set[set.length - 1], path$63);
60029
+ if (set.length) path$63 = join$20(set[set.length - 1], path$63);
59957
60030
  set.push(path$63 || "/");
59958
60031
  return set;
59959
60032
  }, []);
@@ -60007,7 +60080,7 @@ var require_path_reservations = /* @__PURE__ */ require_chunk.__commonJSMin(((ex
60007
60080
  };
60008
60081
  const reserve = (paths, fn) => {
60009
60082
  paths = isWindows ? ["win32 parallelization disabled"] : paths.map((p) => {
60010
- return stripSlashes(join$19(normalize(p))).toLowerCase();
60083
+ return stripSlashes(join$20(normalize(p))).toLowerCase();
60011
60084
  });
60012
60085
  const dirs = new Set(paths.map((path$67) => getDirs(path$67)).reduce((a, b) => a.concat(b)));
60013
60086
  reservations.set(fn, {
@@ -89345,14 +89418,6 @@ var import_tar = /* @__PURE__ */ require_chunk.__toESM(require_tar$1(), 1);
89345
89418
  var import_yauzl = /* @__PURE__ */ require_chunk.__toESM(require_yauzl(), 1);
89346
89419
  require_archiver();
89347
89420
  /**
89348
- * Generates a unique temporary folder.
89349
- */
89350
- const generateTempFolder = async (base) => {
89351
- const targetBase = base || (0, node_os.tmpdir)();
89352
- await (0, node_fs_promises.mkdir)(targetBase, { recursive: true });
89353
- return await (0, node_fs_promises.mkdtemp)((0, node_path.join)(await (0, node_fs_promises.realpath)(targetBase), "pipelab-"));
89354
- };
89355
- /**
89356
89421
  * Extracts a .tar.gz archive.
89357
89422
  */
89358
89423
  async function extractTarGz(archivePath, destinationDir) {
@@ -95822,7 +95887,7 @@ var require_index_min$3 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports)
95822
95887
  //#region ../../node_modules/@npmcli/promise-spawn/node_modules/which/lib/index.js
95823
95888
  var require_lib$27 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
95824
95889
  const { isexe, sync: isexeSync } = require_index_min$3();
95825
- const { join: join$16, delimiter: delimiter$3, sep: sep$5, posix: posix$1 } = require("path");
95890
+ const { join: join$17, delimiter: delimiter$3, sep: sep$5, posix: posix$1 } = require("path");
95826
95891
  const isWindows = process.platform === "win32";
95827
95892
  /* istanbul ignore next */
95828
95893
  const rSlash = new RegExp(`[${posix$1.sep}${sep$5 === posix$1.sep ? "" : sep$5}]`.replace(/(\\)/g, "\\$1"));
@@ -95852,7 +95917,7 @@ var require_lib$27 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
95852
95917
  };
95853
95918
  const getPathPart = (raw, cmd) => {
95854
95919
  const pathPart = /^".*"$/.test(raw) ? raw.slice(1, -1) : raw;
95855
- return (!pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : "") + join$16(pathPart, cmd);
95920
+ return (!pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : "") + join$17(pathPart, cmd);
95856
95921
  };
95857
95922
  const which = async (cmd, opt = {}) => {
95858
95923
  const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
@@ -96601,7 +96666,7 @@ var require_index_min$2 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports)
96601
96666
  //#region ../../node_modules/@npmcli/git/node_modules/which/lib/index.js
96602
96667
  var require_lib$24 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
96603
96668
  const { isexe, sync: isexeSync } = require_index_min$2();
96604
- const { join: join$15, delimiter: delimiter$2, sep: sep$4, posix } = require("path");
96669
+ const { join: join$16, delimiter: delimiter$2, sep: sep$4, posix } = require("path");
96605
96670
  const isWindows = process.platform === "win32";
96606
96671
  /* istanbul ignore next */
96607
96672
  const rSlash = new RegExp(`[${posix.sep}${sep$4 === posix.sep ? "" : sep$4}]`.replace(/(\\)/g, "\\$1"));
@@ -96631,7 +96696,7 @@ var require_lib$24 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
96631
96696
  };
96632
96697
  const getPathPart = (raw, cmd) => {
96633
96698
  const pathPart = /^".*"$/.test(raw) ? raw.slice(1, -1) : raw;
96634
- return (!pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : "") + join$15(pathPart, cmd);
96699
+ return (!pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : "") + join$16(pathPart, cmd);
96635
96700
  };
96636
96701
  const which = async (cmd, opt = {}) => {
96637
96702
  const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
@@ -98529,7 +98594,7 @@ var require_lib$22 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
98529
98594
  //#endregion
98530
98595
  //#region ../../node_modules/npm-normalize-package-bin/lib/index.js
98531
98596
  var require_lib$21 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
98532
- const { join: join$14, basename: basename$6 } = require("path");
98597
+ const { join: join$15, basename: basename$6 } = require("path");
98533
98598
  const normalize = (pkg) => !pkg.bin ? removeBin(pkg) : typeof pkg.bin === "string" ? normalizeString(pkg) : Array.isArray(pkg.bin) ? normalizeArray(pkg) : typeof pkg.bin === "object" ? normalizeObject(pkg) : removeBin(pkg);
98534
98599
  const normalizeString = (pkg) => {
98535
98600
  if (!pkg.name) return removeBin(pkg);
@@ -98552,9 +98617,9 @@ var require_lib$21 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
98552
98617
  const clean = {};
98553
98618
  let hasBins = false;
98554
98619
  Object.keys(orig).forEach((binKey) => {
98555
- const base = join$14("/", basename$6(binKey.replace(/\\|:/g, "/"))).slice(1);
98620
+ const base = join$15("/", basename$6(binKey.replace(/\\|:/g, "/"))).slice(1);
98556
98621
  if (typeof orig[binKey] !== "string" || !base) return;
98557
- const binTarget = join$14("/", orig[binKey].replace(/\\/g, "/")).replace(/\\/g, "/").slice(1);
98622
+ const binTarget = join$15("/", orig[binKey].replace(/\\/g, "/")).replace(/\\/g, "/").slice(1);
98558
98623
  if (!binTarget) return;
98559
98624
  clean[base] = binTarget;
98560
98625
  hasBins = true;
@@ -100627,7 +100692,7 @@ var require_polyfill = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mo
100627
100692
  const { ERR_FS_CP_DIR_TO_NON_DIR, ERR_FS_CP_EEXIST, ERR_FS_CP_EINVAL, ERR_FS_CP_FIFO_PIPE, ERR_FS_CP_NON_DIR_TO_DIR, ERR_FS_CP_SOCKET, ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY, ERR_FS_CP_UNKNOWN, ERR_FS_EISDIR, ERR_INVALID_ARG_TYPE } = require_errors$3();
100628
100693
  const { constants: { errno: { EEXIST, EISDIR, EINVAL, ENOTDIR } } } = require("os");
100629
100694
  const { chmod: chmod$2, copyFile, lstat: lstat$2, mkdir: mkdir$7, readdir: readdir$6, readlink, stat: stat$5, symlink, unlink, utimes } = require("fs/promises");
100630
- const { dirname: dirname$8, isAbsolute: isAbsolute$2, join: join$13, parse, resolve: resolve$10, sep: sep$3, toNamespacedPath } = require("path");
100695
+ const { dirname: dirname$8, isAbsolute: isAbsolute$2, join: join$14, parse, resolve: resolve$10, sep: sep$3, toNamespacedPath } = require("path");
100631
100696
  const { fileURLToPath } = require("url");
100632
100697
  const defaultOptions = {
100633
100698
  dereference: false,
@@ -100836,8 +100901,8 @@ var require_polyfill = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mo
100836
100901
  const dir = await readdir$6(src);
100837
100902
  for (let i = 0; i < dir.length; i++) {
100838
100903
  const item = dir[i];
100839
- const srcItem = join$13(src, item);
100840
- const destItem = join$13(dest, item);
100904
+ const srcItem = join$14(src, item);
100905
+ const destItem = join$14(dest, item);
100841
100906
  const { destStat } = await checkPaths(srcItem, destItem, opts);
100842
100907
  await startCopy(destStat, srcItem, destItem, opts);
100843
100908
  }
@@ -100901,13 +100966,13 @@ var require_cp = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module)
100901
100966
  //#endregion
100902
100967
  //#region ../../node_modules/cacache/node_modules/@npmcli/fs/lib/with-temp-dir.js
100903
100968
  var require_with_temp_dir = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
100904
- const { join: join$12, sep: sep$2 } = require("path");
100969
+ const { join: join$13, sep: sep$2 } = require("path");
100905
100970
  const getOptions = require_get_options();
100906
100971
  const { mkdir: mkdir$6, mkdtemp, rm: rm$7 } = require("fs/promises");
100907
100972
  const withTempDir = async (root, fn, opts) => {
100908
100973
  const options = getOptions(opts, { copy: ["tmpPrefix"] });
100909
100974
  await mkdir$6(root, { recursive: true });
100910
- const target = await mkdtemp(join$12(`${root}${sep$2}`, options.tmpPrefix || ""));
100975
+ const target = await mkdtemp(join$13(`${root}${sep$2}`, options.tmpPrefix || ""));
100911
100976
  let err;
100912
100977
  let result;
100913
100978
  try {
@@ -100930,10 +100995,10 @@ var require_with_temp_dir = /* @__PURE__ */ require_chunk.__commonJSMin(((export
100930
100995
  //#region ../../node_modules/cacache/node_modules/@npmcli/fs/lib/readdir-scoped.js
100931
100996
  var require_readdir_scoped = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
100932
100997
  const { readdir: readdir$5 } = require("fs/promises");
100933
- const { join: join$11 } = require("path");
100998
+ const { join: join$12 } = require("path");
100934
100999
  const readdirScoped = async (dir) => {
100935
101000
  const results = [];
100936
- for (const item of await readdir$5(dir)) if (item.startsWith("@")) for (const scopedItem of await readdir$5(join$11(dir, item))) results.push(join$11(item, scopedItem));
101001
+ for (const item of await readdir$5(dir)) if (item.startsWith("@")) for (const scopedItem of await readdir$5(join$12(dir, item))) results.push(join$12(item, scopedItem));
100937
101002
  else results.push(item);
100938
101003
  return results;
100939
101004
  };
@@ -100942,7 +101007,7 @@ var require_readdir_scoped = /* @__PURE__ */ require_chunk.__commonJSMin(((expor
100942
101007
  //#endregion
100943
101008
  //#region ../../node_modules/cacache/node_modules/@npmcli/fs/lib/move-file.js
100944
101009
  var require_move_file = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
100945
- const { dirname: dirname$7, join: join$10, resolve: resolve$9, relative: relative$1, isAbsolute: isAbsolute$1 } = require("path");
101010
+ const { dirname: dirname$7, join: join$11, resolve: resolve$9, relative: relative$1, isAbsolute: isAbsolute$1 } = require("path");
100946
101011
  const fs$12 = require("fs/promises");
100947
101012
  const pathExists = async (path$54) => {
100948
101013
  try {
@@ -100967,7 +101032,7 @@ var require_move_file = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, m
100967
101032
  const sourceStat = await fs$12.lstat(source);
100968
101033
  if (sourceStat.isDirectory()) {
100969
101034
  const files = await fs$12.readdir(source);
100970
- await Promise.all(files.map((file) => moveFile(join$10(source, file), join$10(destination, file), options, false, symlinks)));
101035
+ await Promise.all(files.map((file) => moveFile(join$11(source, file), join$11(destination, file), options, false, symlinks)));
100971
101036
  } else if (sourceStat.isSymbolicLink()) symlinks.push({
100972
101037
  source,
100973
101038
  destination
@@ -110506,9 +110571,9 @@ var require_protected = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, m
110506
110571
  //#region ../../node_modules/pacote/lib/util/cache-dir.js
110507
110572
  var require_cache_dir = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
110508
110573
  const { resolve: resolve$7 } = require("node:path");
110509
- const { tmpdir: tmpdir$2, homedir } = require("node:os");
110574
+ const { tmpdir, homedir } = require("node:os");
110510
110575
  module.exports = (fakePlatform = false) => {
110511
- const temp = tmpdir$2();
110576
+ const temp = tmpdir();
110512
110577
  const uidOrPid = process.getuid ? process.getuid() : process.pid;
110513
110578
  const home = homedir() || resolve$7(temp, "npm-" + uidOrPid);
110514
110579
  const platform = fakePlatform || process.platform;
@@ -112330,7 +112395,7 @@ var require_lib$10 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
112330
112395
  var require_lib$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
112331
112396
  const { Walker: IgnoreWalker } = require_lib$10();
112332
112397
  const { lstatSync: lstat$1, readFileSync: readFile$4 } = require("fs");
112333
- const { basename: basename$4, dirname: dirname$5, extname: extname$1, join: join$9, relative, resolve: resolve$6, sep: sep$1 } = require("path");
112398
+ const { basename: basename$4, dirname: dirname$5, extname: extname$1, join: join$10, relative, resolve: resolve$6, sep: sep$1 } = require("path");
112334
112399
  const { log } = require_lib$29();
112335
112400
  const defaultRules = Symbol("npm-packlist.rules.default");
112336
112401
  const strictRules = Symbol("npm-packlist.rules.strict");
@@ -112363,7 +112428,7 @@ var require_lib$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
112363
112428
  const normalizePath = (path$46) => path$46.split("\\").join("/");
112364
112429
  const readOutOfTreeIgnoreFiles = (root, rel, result = []) => {
112365
112430
  for (const file of [".npmignore", ".gitignore"]) try {
112366
- const ignoreContent = readFile$4(join$9(root, file), { encoding: "utf8" });
112431
+ const ignoreContent = readFile$4(join$10(root, file), { encoding: "utf8" });
112367
112432
  result.push(ignoreContent);
112368
112433
  break;
112369
112434
  } catch (err) {
@@ -112372,8 +112437,8 @@ var require_lib$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
112372
112437
  }
112373
112438
  if (!rel) return result;
112374
112439
  const firstRel = rel.split(sep$1, 1)[0];
112375
- const newRoot = join$9(root, firstRel);
112376
- return readOutOfTreeIgnoreFiles(newRoot, relative(newRoot, join$9(root, rel)), result);
112440
+ const newRoot = join$10(root, firstRel);
112441
+ return readOutOfTreeIgnoreFiles(newRoot, relative(newRoot, join$10(root, rel)), result);
112377
112442
  };
112378
112443
  var PackWalker = class PackWalker extends IgnoreWalker {
112379
112444
  constructor(tree, opts) {
@@ -112440,7 +112505,7 @@ var require_lib$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
112440
112505
  let ignoreFiles = null;
112441
112506
  if (this.tree.workspaces) {
112442
112507
  const workspaceDirs = [...this.tree.workspaces.values()].map((dir) => dir.replace(/\\/g, "/"));
112443
- const entryPath = join$9(this.path, entry).replace(/\\/g, "/");
112508
+ const entryPath = join$10(this.path, entry).replace(/\\/g, "/");
112444
112509
  if (workspaceDirs.includes(entryPath)) ignoreFiles = [
112445
112510
  defaultRules,
112446
112511
  "package.json",
@@ -112500,7 +112565,7 @@ var require_lib$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
112500
112565
  if (file.endsWith("/*")) file += "*";
112501
112566
  const inverse = `!${file}`;
112502
112567
  try {
112503
- const stat = lstat$1(join$9(this.path, file.replace(/^!+/, "")).replace(/\\/g, "/"));
112568
+ const stat = lstat$1(join$10(this.path, file.replace(/^!+/, "")).replace(/\\/g, "/"));
112504
112569
  if (stat.isFile()) {
112505
112570
  strict.unshift(inverse);
112506
112571
  this.requiredFiles.push(file.startsWith("/") ? file.slice(1) : file);
@@ -112557,7 +112622,7 @@ var require_lib$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
112557
112622
  walker.start();
112558
112623
  });
112559
112624
  const relativeFrom = relative(this.root, walker.path);
112560
- for (const file of bundled) this.result.add(join$9(relativeFrom, file).replace(/\\/g, "/"));
112625
+ for (const file of bundled) this.result.add(join$10(relativeFrom, file).replace(/\\/g, "/"));
112561
112626
  }
112562
112627
  }
112563
112628
  };
@@ -151042,8 +151107,6 @@ const sendStartupProgress = (message) => {
151042
151107
  };
151043
151108
  //#endregion
151044
151109
  //#region ../../packages/core-node/src/utils/remote.ts
151045
- const DEFAULT_NODE_VERSION = "24.14.1";
151046
- const DEFAULT_PNPM_VERSION = "10.12.0";
151047
151110
  function isPackageComplete(packageDir) {
151048
151111
  return (0, node_fs.existsSync)((0, node_path.join)(packageDir, "package.json"));
151049
151112
  }
@@ -151235,7 +151298,7 @@ async function ensureNodeJS(context, version = DEFAULT_NODE_VERSION) {
151235
151298
  const extension = isWindows ? "zip" : "tar.gz";
151236
151299
  const fileName = `node-v${version}-${platform === "osx" ? "darwin" : platform}-${arch}.${extension}`;
151237
151300
  const downloadUrl = `https://nodejs.org/dist/v${version}/${fileName}`;
151238
- const tempDir = await generateTempFolder((0, node_os.tmpdir)());
151301
+ const tempDir = await context.createTempFolder("node-download-");
151239
151302
  const archivePath = (0, node_path.join)(tempDir, fileName);
151240
151303
  sendStartupProgress(`Downloading Node.js v${version}...`);
151241
151304
  console.log(`Downloading Node.js from ${downloadUrl}...`);
@@ -151445,7 +151508,7 @@ async function resolveEntryPoint(packageDir, packageName) {
151445
151508
  }
151446
151509
  //#endregion
151447
151510
  //#region ../../packages/core-node/src/handler-func.ts
151448
- const { join: join$7 } = node_path.default;
151511
+ const { join: join$8 } = node_path.default;
151449
151512
  //#endregion
151450
151513
  //#region ../../packages/core-node/src/handlers/plugins.ts
151451
151514
  const localPluginsMap = /* @__PURE__ */ new Map();
@@ -152744,12 +152807,23 @@ const packageV2Runner = createActionRunner(async ({ inputs, cwd, paths, log, set
152744
152807
  });
152745
152808
  //#endregion
152746
152809
  //#region src/index.ts
152747
- var src_default = createNodeDefinition({ nodes: [{
152748
- node: createPackageProps(IDPackage, "Package as Discord Activity", "Package your app as a Discord Activity", "", "`Package app from ${fmt.param(params['input-folder'], 'primary', 'Input folder not set')}`", false, false, void 0, false, false),
152749
- runner: packageV2Runner
152750
- }, {
152751
- node: createPreviewProps(IDPreview, "Preview Discord Acitivity app", "Package and preview your app as a Discord Activity", "", "`Preview app from ${fmt.param(params['input-folder'], 'primary', 'Input folder not set')}`"),
152752
- runner: previewRunner
152753
- }] });
152810
+ var src_default = createNodeDefinition({
152811
+ nodes: [{
152812
+ node: createPackageProps(IDPackage, "Package as Discord Activity", "Package your app as a Discord Activity", "", "`Package app from ${fmt.param(params['input-folder'], 'primary', 'Input folder not set')}`", false, false, void 0, false, false),
152813
+ runner: packageV2Runner
152814
+ }, {
152815
+ node: createPreviewProps(IDPreview, "Preview Discord Acitivity app", "Package and preview your app as a Discord Activity", "", "`Preview app from ${fmt.param(params['input-folder'], 'primary', 'Input folder not set')}`"),
152816
+ runner: previewRunner
152817
+ }],
152818
+ integrations: [{
152819
+ name: "Discord Connection",
152820
+ fields: [{
152821
+ key: "apiKey",
152822
+ label: "Webhook URL",
152823
+ type: "text",
152824
+ placeholder: "https://discord.com/api/webhooks/..."
152825
+ }]
152826
+ }]
152827
+ });
152754
152828
  //#endregion
152755
152829
  module.exports = src_default;