@pipelab/plugin-steam 1.0.0-beta.14 → 1.0.0-beta.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 CHANGED
@@ -1604,6 +1604,56 @@ function literal(literal_, message) {
1604
1604
  }
1605
1605
  };
1606
1606
  }
1607
+ function looseObject(entries, message) {
1608
+ return {
1609
+ kind: "schema",
1610
+ type: "loose_object",
1611
+ reference: looseObject,
1612
+ expects: "Object",
1613
+ async: false,
1614
+ entries,
1615
+ message,
1616
+ _run(dataset, config2) {
1617
+ const input = dataset.value;
1618
+ if (input && typeof input === "object") {
1619
+ dataset.typed = true;
1620
+ dataset.value = {};
1621
+ for (const key in this.entries) {
1622
+ const value2 = input[key];
1623
+ const valueDataset = this.entries[key]._run({
1624
+ typed: false,
1625
+ value: value2
1626
+ }, config2);
1627
+ if (valueDataset.issues) {
1628
+ const pathItem = {
1629
+ type: "object",
1630
+ origin: "value",
1631
+ input,
1632
+ key,
1633
+ value: value2
1634
+ };
1635
+ for (const issue of valueDataset.issues) {
1636
+ if (issue.path) issue.path.unshift(pathItem);
1637
+ else issue.path = [pathItem];
1638
+ dataset.issues?.push(issue);
1639
+ }
1640
+ if (!dataset.issues) dataset.issues = valueDataset.issues;
1641
+ if (config2.abortEarly) {
1642
+ dataset.typed = false;
1643
+ break;
1644
+ }
1645
+ }
1646
+ if (!valueDataset.typed) dataset.typed = false;
1647
+ if (valueDataset.value !== void 0 || key in input) dataset.value[key] = valueDataset.value;
1648
+ }
1649
+ if (!dataset.issues || !config2.abortEarly) {
1650
+ for (const key in input) if (_isValidObjectKey(input, key) && !(key in this.entries)) dataset.value[key] = input[key];
1651
+ }
1652
+ } else _addIssue(this, "type", dataset, config2);
1653
+ return dataset;
1654
+ }
1655
+ };
1656
+ }
1607
1657
  function number(message) {
1608
1658
  return {
1609
1659
  kind: "schema",
@@ -2141,6 +2191,18 @@ settingsMigratorInternal.createMigrations({
2141
2191
  })
2142
2192
  ]
2143
2193
  });
2194
+ const connectionsMigratorInternal = createMigrator();
2195
+ const defaultConnections = connectionsMigratorInternal.createDefault({
2196
+ version: "1.0.0",
2197
+ connections: []
2198
+ });
2199
+ connectionsMigratorInternal.createMigrations({
2200
+ defaultValue: defaultConnections,
2201
+ migrations: [createMigration({
2202
+ version: "1.0.0",
2203
+ up: finalVersion
2204
+ })]
2205
+ });
2144
2206
  const fileRepoMigratorInternal = createMigrator();
2145
2207
  const defaultFileRepo = fileRepoMigratorInternal.createDefault({
2146
2208
  version: "2.0.0",
@@ -2302,11 +2364,51 @@ const LEGACY_ID_MAP = {
2302
2364
  };
2303
2365
  const getStrictPluginId = (pluginId) => {
2304
2366
  if (!pluginId) return pluginId;
2305
- if (LEGACY_ID_MAP[pluginId]) return LEGACY_ID_MAP[pluginId];
2306
- if (pluginId.startsWith("@") || pluginId.includes("/") || pluginId.startsWith("pipelab-plugin-")) return pluginId;
2307
- const prefixed = `@pipelab/plugin-${pluginId}`;
2308
- return LEGACY_ID_MAP[prefixed] || prefixed;
2367
+ return LEGACY_ID_MAP[pluginId] || pluginId;
2309
2368
  };
2369
+ //#endregion
2370
+ //#region ../../packages/shared/src/save-location.ts
2371
+ const SaveLocationInternalValidator = object({
2372
+ id: string(),
2373
+ project: string(),
2374
+ lastModified: string(),
2375
+ type: literal("internal"),
2376
+ configName: string()
2377
+ });
2378
+ const SaveLocationValidator = union([
2379
+ object({
2380
+ id: string(),
2381
+ project: string(),
2382
+ path: string(),
2383
+ lastModified: string(),
2384
+ type: literal("external"),
2385
+ summary: object({
2386
+ plugins: array(string()),
2387
+ name: string(),
2388
+ description: string()
2389
+ })
2390
+ }),
2391
+ SaveLocationInternalValidator,
2392
+ object({
2393
+ id: string(),
2394
+ project: string(),
2395
+ type: literal("pipelab-cloud")
2396
+ })
2397
+ ]);
2398
+ object({
2399
+ version: literal("1.0.0"),
2400
+ data: optional(record(string(), SaveLocationValidator), {})
2401
+ });
2402
+ const FileRepoProjectValidatorV2$1 = object({
2403
+ id: string(),
2404
+ name: string(),
2405
+ description: string()
2406
+ });
2407
+ object({
2408
+ version: literal("2.0.0"),
2409
+ projects: array(FileRepoProjectValidatorV2$1),
2410
+ pipelines: optional(array(SaveLocationValidator), [])
2411
+ });
2310
2412
  object({
2311
2413
  cacheFolder: string(),
2312
2414
  theme: union([literal("light"), literal("dark")]),
@@ -2458,6 +2560,17 @@ object({
2458
2560
  })),
2459
2561
  isInternalMigrationBannerClosed: optional(boolean(), false)
2460
2562
  });
2563
+ const ConnectionValidator = looseObject({
2564
+ id: string(),
2565
+ pluginName: string(),
2566
+ name: string(),
2567
+ createdAt: string(),
2568
+ isDefault: boolean()
2569
+ });
2570
+ object({
2571
+ version: literal("1.0.0"),
2572
+ connections: array(ConnectionValidator)
2573
+ });
2461
2574
  //#endregion
2462
2575
  //#region ../../node_modules/tslog/dist/esm/prettyLogStyles.js
2463
2576
  const prettyLogStyles = {
@@ -2978,7 +3091,7 @@ const useLogger = () => {
2978
3091
  const OriginValidator = object({
2979
3092
  pluginId: string(),
2980
3093
  nodeId: string(),
2981
- version: pipe(optional(string()), description("Pinned version of the plugin for this block. Falls back to \"latest\" when absent."))
3094
+ version: optional(pipe(string(), description("Pinned version of the plugin for this block. Falls back to \"latest\" when absent.")))
2982
3095
  });
2983
3096
  const BlockActionValidatorV1 = object({
2984
3097
  type: literal("action"),
@@ -2991,7 +3104,7 @@ const EditorParamValidatorV3 = union([literal("simple"), literal("editor")]);
2991
3104
  const BlockActionValidatorV3 = object({
2992
3105
  type: literal("action"),
2993
3106
  uid: string(),
2994
- name: pipe(optional(string()), description("A custom name provided by the user")),
3107
+ name: optional(pipe(string(), description("A custom name provided by the user"))),
2995
3108
  disabled: optional(boolean()),
2996
3109
  params: record(string(), object({
2997
3110
  editor: EditorParamValidatorV3,
@@ -45291,35 +45404,6 @@ const createPathParam = (value, definition) => {
45291
45404
  };
45292
45405
  };
45293
45406
  //#endregion
45294
- //#region ../../packages/shared/src/save-location.ts
45295
- const SaveLocationInternalValidator = object({
45296
- id: string(),
45297
- project: string(),
45298
- lastModified: string(),
45299
- type: literal("internal"),
45300
- configName: string()
45301
- });
45302
- const SaveLocationValidator = union([
45303
- object({
45304
- id: string(),
45305
- project: string(),
45306
- path: string(),
45307
- lastModified: string(),
45308
- type: literal("external"),
45309
- summary: object({
45310
- plugins: array(string()),
45311
- name: string(),
45312
- description: string()
45313
- })
45314
- }),
45315
- SaveLocationInternalValidator,
45316
- object({
45317
- id: string(),
45318
- project: string(),
45319
- type: literal("pipelab-cloud")
45320
- })
45321
- ]);
45322
- //#endregion
45323
45407
  //#region ../../packages/shared/src/websocket.types.ts
45324
45408
  var WebSocketError = class extends Error {
45325
45409
  constructor(message, code, requestId) {
@@ -45336,20 +45420,6 @@ object({
45336
45420
  version: literal("1.0.0"),
45337
45421
  data: optional(record(string(), SaveLocationValidator), {})
45338
45422
  });
45339
- const FileRepoProjectValidatorV2$1 = object({
45340
- id: string(),
45341
- name: string(),
45342
- description: string()
45343
- });
45344
- object({
45345
- version: literal("2.0.0"),
45346
- projects: array(FileRepoProjectValidatorV2$1),
45347
- pipelines: optional(array(SaveLocationValidator), [])
45348
- });
45349
- object({
45350
- version: literal("1.0.0"),
45351
- data: optional(record(string(), SaveLocationValidator), {})
45352
- });
45353
45423
  const FileRepoProjectValidatorV2 = object({
45354
45424
  id: string(),
45355
45425
  name: string(),
@@ -45361,8 +45431,12 @@ object({
45361
45431
  pipelines: optional(array(SaveLocationValidator), [])
45362
45432
  });
45363
45433
  //#endregion
45434
+ //#region ../../packages/constants/src/index.ts
45435
+ const websocketPort = 33753;
45436
+ //#endregion
45364
45437
  //#region ../../packages/core-node/src/context.ts
45365
- 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();
45438
+ const metaUrl = require("url").pathToFileURL(__filename).href;
45439
+ const _dirname = typeof __dirname !== "undefined" ? __dirname : metaUrl ? (0, node_path.dirname)((0, node_url.fileURLToPath)(metaUrl)) : process.cwd();
45366
45440
  const isDev = process.env.NODE_ENV === "development";
45367
45441
  /**
45368
45442
  * Finds the monorepo root by looking for pnpm-workspace.yaml.
@@ -48934,9 +49008,6 @@ const useAPI = () => {
48934
49008
  };
48935
49009
  };
48936
49010
  //#endregion
48937
- //#region ../../packages/constants/src/index.ts
48938
- const websocketPort = 33753;
48939
- //#endregion
48940
49011
  //#region ../../packages/core-node/src/websocket-server.ts
48941
49012
  var WebSocketServer = class {
48942
49013
  wss = null;
@@ -59945,14 +60016,14 @@ var require_path_reservations = /* @__PURE__ */ require_chunk.__commonJSMin(((ex
59945
60016
  const assert$1 = require("assert");
59946
60017
  const normalize = require_normalize_unicode();
59947
60018
  const stripSlashes = require_strip_trailing_slashes();
59948
- const { join: join$17 } = require("path");
60019
+ const { join: join$18 } = require("path");
59949
60020
  const isWindows = (process.env.TESTING_TAR_FAKE_PLATFORM || process.platform) === "win32";
59950
60021
  module.exports = () => {
59951
60022
  const queues = /* @__PURE__ */ new Map();
59952
60023
  const reservations = /* @__PURE__ */ new Map();
59953
60024
  const getDirs = (path$65) => {
59954
60025
  return path$65.split("/").slice(0, -1).reduce((set, path$66) => {
59955
- if (set.length) path$66 = join$17(set[set.length - 1], path$66);
60026
+ if (set.length) path$66 = join$18(set[set.length - 1], path$66);
59956
60027
  set.push(path$66 || "/");
59957
60028
  return set;
59958
60029
  }, []);
@@ -60006,7 +60077,7 @@ var require_path_reservations = /* @__PURE__ */ require_chunk.__commonJSMin(((ex
60006
60077
  };
60007
60078
  const reserve = (paths, fn) => {
60008
60079
  paths = isWindows ? ["win32 parallelization disabled"] : paths.map((p) => {
60009
- return stripSlashes(join$17(normalize(p))).toLowerCase();
60080
+ return stripSlashes(join$18(normalize(p))).toLowerCase();
60010
60081
  });
60011
60082
  const dirs = new Set(paths.map((path$70) => getDirs(path$70)).reduce((a, b) => a.concat(b)));
60012
60083
  reservations.set(fn, {
@@ -95687,7 +95758,7 @@ var require_index_min$3 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports)
95687
95758
  //#region ../../node_modules/@npmcli/promise-spawn/node_modules/which/lib/index.js
95688
95759
  var require_lib$27 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
95689
95760
  const { isexe, sync: isexeSync } = require_index_min$3();
95690
- const { join: join$14, delimiter: delimiter$3, sep: sep$4, posix: posix$1 } = require("path");
95761
+ const { join: join$15, delimiter: delimiter$3, sep: sep$4, posix: posix$1 } = require("path");
95691
95762
  const isWindows = process.platform === "win32";
95692
95763
  /* istanbul ignore next */
95693
95764
  const rSlash = new RegExp(`[${posix$1.sep}${sep$4 === posix$1.sep ? "" : sep$4}]`.replace(/(\\)/g, "\\$1"));
@@ -95717,7 +95788,7 @@ var require_lib$27 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
95717
95788
  };
95718
95789
  const getPathPart = (raw, cmd) => {
95719
95790
  const pathPart = /^".*"$/.test(raw) ? raw.slice(1, -1) : raw;
95720
- return (!pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : "") + join$14(pathPart, cmd);
95791
+ return (!pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : "") + join$15(pathPart, cmd);
95721
95792
  };
95722
95793
  const which = async (cmd, opt = {}) => {
95723
95794
  const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
@@ -96466,7 +96537,7 @@ var require_index_min$2 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports)
96466
96537
  //#region ../../node_modules/@npmcli/git/node_modules/which/lib/index.js
96467
96538
  var require_lib$24 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
96468
96539
  const { isexe, sync: isexeSync } = require_index_min$2();
96469
- const { join: join$13, delimiter: delimiter$2, sep: sep$3, posix } = require("path");
96540
+ const { join: join$14, delimiter: delimiter$2, sep: sep$3, posix } = require("path");
96470
96541
  const isWindows = process.platform === "win32";
96471
96542
  /* istanbul ignore next */
96472
96543
  const rSlash = new RegExp(`[${posix.sep}${sep$3 === posix.sep ? "" : sep$3}]`.replace(/(\\)/g, "\\$1"));
@@ -96496,7 +96567,7 @@ var require_lib$24 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
96496
96567
  };
96497
96568
  const getPathPart = (raw, cmd) => {
96498
96569
  const pathPart = /^".*"$/.test(raw) ? raw.slice(1, -1) : raw;
96499
- return (!pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : "") + join$13(pathPart, cmd);
96570
+ return (!pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : "") + join$14(pathPart, cmd);
96500
96571
  };
96501
96572
  const which = async (cmd, opt = {}) => {
96502
96573
  const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
@@ -98394,7 +98465,7 @@ var require_lib$22 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
98394
98465
  //#endregion
98395
98466
  //#region ../../node_modules/npm-normalize-package-bin/lib/index.js
98396
98467
  var require_lib$21 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
98397
- const { join: join$12, basename: basename$4 } = require("path");
98468
+ const { join: join$13, basename: basename$4 } = require("path");
98398
98469
  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);
98399
98470
  const normalizeString = (pkg) => {
98400
98471
  if (!pkg.name) return removeBin(pkg);
@@ -98417,9 +98488,9 @@ var require_lib$21 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
98417
98488
  const clean = {};
98418
98489
  let hasBins = false;
98419
98490
  Object.keys(orig).forEach((binKey) => {
98420
- const base = join$12("/", basename$4(binKey.replace(/\\|:/g, "/"))).slice(1);
98491
+ const base = join$13("/", basename$4(binKey.replace(/\\|:/g, "/"))).slice(1);
98421
98492
  if (typeof orig[binKey] !== "string" || !base) return;
98422
- const binTarget = join$12("/", orig[binKey].replace(/\\/g, "/")).replace(/\\/g, "/").slice(1);
98493
+ const binTarget = join$13("/", orig[binKey].replace(/\\/g, "/")).replace(/\\/g, "/").slice(1);
98423
98494
  if (!binTarget) return;
98424
98495
  clean[base] = binTarget;
98425
98496
  hasBins = true;
@@ -100492,7 +100563,7 @@ var require_polyfill = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mo
100492
100563
  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();
100493
100564
  const { constants: { errno: { EEXIST, EISDIR, EINVAL, ENOTDIR } } } = require("os");
100494
100565
  const { chmod: chmod$3, copyFile, lstat: lstat$2, mkdir: mkdir$8, readdir: readdir$6, readlink, stat: stat$5, symlink, unlink, utimes } = require("fs/promises");
100495
- const { dirname: dirname$9, isAbsolute: isAbsolute$2, join: join$11, parse, resolve: resolve$10, sep: sep$2, toNamespacedPath } = require("path");
100566
+ const { dirname: dirname$9, isAbsolute: isAbsolute$2, join: join$12, parse, resolve: resolve$10, sep: sep$2, toNamespacedPath } = require("path");
100496
100567
  const { fileURLToPath: fileURLToPath$1 } = require("url");
100497
100568
  const defaultOptions = {
100498
100569
  dereference: false,
@@ -100701,8 +100772,8 @@ var require_polyfill = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mo
100701
100772
  const dir = await readdir$6(src);
100702
100773
  for (let i = 0; i < dir.length; i++) {
100703
100774
  const item = dir[i];
100704
- const srcItem = join$11(src, item);
100705
- const destItem = join$11(dest, item);
100775
+ const srcItem = join$12(src, item);
100776
+ const destItem = join$12(dest, item);
100706
100777
  const { destStat } = await checkPaths(srcItem, destItem, opts);
100707
100778
  await startCopy(destStat, srcItem, destItem, opts);
100708
100779
  }
@@ -100766,13 +100837,13 @@ var require_cp = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module)
100766
100837
  //#endregion
100767
100838
  //#region ../../node_modules/cacache/node_modules/@npmcli/fs/lib/with-temp-dir.js
100768
100839
  var require_with_temp_dir = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
100769
- const { join: join$10, sep: sep$1 } = require("path");
100840
+ const { join: join$11, sep: sep$1 } = require("path");
100770
100841
  const getOptions = require_get_options();
100771
100842
  const { mkdir: mkdir$7, mkdtemp, rm: rm$7 } = require("fs/promises");
100772
100843
  const withTempDir = async (root, fn, opts) => {
100773
100844
  const options = getOptions(opts, { copy: ["tmpPrefix"] });
100774
100845
  await mkdir$7(root, { recursive: true });
100775
- const target = await mkdtemp(join$10(`${root}${sep$1}`, options.tmpPrefix || ""));
100846
+ const target = await mkdtemp(join$11(`${root}${sep$1}`, options.tmpPrefix || ""));
100776
100847
  let err;
100777
100848
  let result;
100778
100849
  try {
@@ -100795,10 +100866,10 @@ var require_with_temp_dir = /* @__PURE__ */ require_chunk.__commonJSMin(((export
100795
100866
  //#region ../../node_modules/cacache/node_modules/@npmcli/fs/lib/readdir-scoped.js
100796
100867
  var require_readdir_scoped = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
100797
100868
  const { readdir: readdir$5 } = require("fs/promises");
100798
- const { join: join$9 } = require("path");
100869
+ const { join: join$10 } = require("path");
100799
100870
  const readdirScoped = async (dir) => {
100800
100871
  const results = [];
100801
- for (const item of await readdir$5(dir)) if (item.startsWith("@")) for (const scopedItem of await readdir$5(join$9(dir, item))) results.push(join$9(item, scopedItem));
100872
+ for (const item of await readdir$5(dir)) if (item.startsWith("@")) for (const scopedItem of await readdir$5(join$10(dir, item))) results.push(join$10(item, scopedItem));
100802
100873
  else results.push(item);
100803
100874
  return results;
100804
100875
  };
@@ -100807,7 +100878,7 @@ var require_readdir_scoped = /* @__PURE__ */ require_chunk.__commonJSMin(((expor
100807
100878
  //#endregion
100808
100879
  //#region ../../node_modules/cacache/node_modules/@npmcli/fs/lib/move-file.js
100809
100880
  var require_move_file = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
100810
- const { dirname: dirname$8, join: join$8, resolve: resolve$9, relative: relative$1, isAbsolute: isAbsolute$1 } = require("path");
100881
+ const { dirname: dirname$8, join: join$9, resolve: resolve$9, relative: relative$1, isAbsolute: isAbsolute$1 } = require("path");
100811
100882
  const fs$12 = require("fs/promises");
100812
100883
  const pathExists = async (path$57) => {
100813
100884
  try {
@@ -100832,7 +100903,7 @@ var require_move_file = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, m
100832
100903
  const sourceStat = await fs$12.lstat(source);
100833
100904
  if (sourceStat.isDirectory()) {
100834
100905
  const files = await fs$12.readdir(source);
100835
- await Promise.all(files.map((file) => moveFile(join$8(source, file), join$8(destination, file), options, false, symlinks)));
100906
+ await Promise.all(files.map((file) => moveFile(join$9(source, file), join$9(destination, file), options, false, symlinks)));
100836
100907
  } else if (sourceStat.isSymbolicLink()) symlinks.push({
100837
100908
  source,
100838
100909
  destination
@@ -110371,9 +110442,9 @@ var require_protected = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, m
110371
110442
  //#region ../../node_modules/pacote/lib/util/cache-dir.js
110372
110443
  var require_cache_dir = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
110373
110444
  const { resolve: resolve$7 } = require("node:path");
110374
- const { tmpdir: tmpdir$2, homedir } = require("node:os");
110445
+ const { tmpdir, homedir } = require("node:os");
110375
110446
  module.exports = (fakePlatform = false) => {
110376
- const temp = tmpdir$2();
110447
+ const temp = tmpdir();
110377
110448
  const uidOrPid = process.getuid ? process.getuid() : process.pid;
110378
110449
  const home = homedir() || resolve$7(temp, "npm-" + uidOrPid);
110379
110450
  const platform = fakePlatform || process.platform;
@@ -112195,7 +112266,7 @@ var require_lib$10 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
112195
112266
  var require_lib$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
112196
112267
  const { Walker: IgnoreWalker } = require_lib$10();
112197
112268
  const { lstatSync: lstat$1, readFileSync: readFile$4 } = require("fs");
112198
- const { basename: basename$2, dirname: dirname$6, extname: extname$1, join: join$7, relative, resolve: resolve$6, sep } = require("path");
112269
+ const { basename: basename$2, dirname: dirname$6, extname: extname$1, join: join$8, relative, resolve: resolve$6, sep } = require("path");
112199
112270
  const { log } = require_lib$29();
112200
112271
  const defaultRules = Symbol("npm-packlist.rules.default");
112201
112272
  const strictRules = Symbol("npm-packlist.rules.strict");
@@ -112228,7 +112299,7 @@ var require_lib$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
112228
112299
  const normalizePath = (path$49) => path$49.split("\\").join("/");
112229
112300
  const readOutOfTreeIgnoreFiles = (root, rel, result = []) => {
112230
112301
  for (const file of [".npmignore", ".gitignore"]) try {
112231
- const ignoreContent = readFile$4(join$7(root, file), { encoding: "utf8" });
112302
+ const ignoreContent = readFile$4(join$8(root, file), { encoding: "utf8" });
112232
112303
  result.push(ignoreContent);
112233
112304
  break;
112234
112305
  } catch (err) {
@@ -112237,8 +112308,8 @@ var require_lib$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
112237
112308
  }
112238
112309
  if (!rel) return result;
112239
112310
  const firstRel = rel.split(sep, 1)[0];
112240
- const newRoot = join$7(root, firstRel);
112241
- return readOutOfTreeIgnoreFiles(newRoot, relative(newRoot, join$7(root, rel)), result);
112311
+ const newRoot = join$8(root, firstRel);
112312
+ return readOutOfTreeIgnoreFiles(newRoot, relative(newRoot, join$8(root, rel)), result);
112242
112313
  };
112243
112314
  var PackWalker = class PackWalker extends IgnoreWalker {
112244
112315
  constructor(tree, opts) {
@@ -112305,7 +112376,7 @@ var require_lib$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
112305
112376
  let ignoreFiles = null;
112306
112377
  if (this.tree.workspaces) {
112307
112378
  const workspaceDirs = [...this.tree.workspaces.values()].map((dir) => dir.replace(/\\/g, "/"));
112308
- const entryPath = join$7(this.path, entry).replace(/\\/g, "/");
112379
+ const entryPath = join$8(this.path, entry).replace(/\\/g, "/");
112309
112380
  if (workspaceDirs.includes(entryPath)) ignoreFiles = [
112310
112381
  defaultRules,
112311
112382
  "package.json",
@@ -112365,7 +112436,7 @@ var require_lib$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
112365
112436
  if (file.endsWith("/*")) file += "*";
112366
112437
  const inverse = `!${file}`;
112367
112438
  try {
112368
- const stat = lstat$1(join$7(this.path, file.replace(/^!+/, "")).replace(/\\/g, "/"));
112439
+ const stat = lstat$1(join$8(this.path, file.replace(/^!+/, "")).replace(/\\/g, "/"));
112369
112440
  if (stat.isFile()) {
112370
112441
  strict.unshift(inverse);
112371
112442
  this.requiredFiles.push(file.startsWith("/") ? file.slice(1) : file);
@@ -112422,7 +112493,7 @@ var require_lib$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
112422
112493
  walker.start();
112423
112494
  });
112424
112495
  const relativeFrom = relative(this.root, walker.path);
112425
- for (const file of bundled) this.result.add(join$7(relativeFrom, file).replace(/\\/g, "/"));
112496
+ for (const file of bundled) this.result.add(join$8(relativeFrom, file).replace(/\\/g, "/"));
112426
112497
  }
112427
112498
  }
112428
112499
  };
@@ -123623,7 +123694,7 @@ var require_auth = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module
123623
123694
  //#endregion
123624
123695
  //#region ../../node_modules/make-fetch-happen/lib/options.js
123625
123696
  var require_options$1 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
123626
- const dns$2 = require("dns");
123697
+ const dns$3 = require("dns");
123627
123698
  const conditionalHeaders = [
123628
123699
  "if-modified-since",
123629
123700
  "if-none-match",
@@ -123648,7 +123719,7 @@ var require_options$1 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, m
123648
123719
  };
123649
123720
  options.dns = {
123650
123721
  ttl: 300 * 1e3,
123651
- lookup: dns$2.lookup,
123722
+ lookup: dns$3.lookup,
123652
123723
  ...options.dns
123653
123724
  };
123654
123725
  options.cache = options.cache || "default";
@@ -125065,9 +125136,9 @@ var require_key$3 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
125065
125136
  //#region ../../node_modules/@npmcli/agent/lib/dns.js
125066
125137
  var require_dns = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
125067
125138
  const { LRUCache } = require_index_min$5();
125068
- const dns$1 = require("dns");
125139
+ const dns$2 = require("dns");
125069
125140
  const cache = new LRUCache({ max: 50 });
125070
- const getOptions = ({ family = 0, hints = dns$1.ADDRCONFIG, all = false, verbatim = void 0, ttl = 300 * 1e3, lookup = dns$1.lookup }) => ({
125141
+ const getOptions = ({ family = 0, hints = dns$2.ADDRCONFIG, all = false, verbatim = void 0, ttl = 300 * 1e3, lookup = dns$2.lookup }) => ({
125071
125142
  hints,
125072
125143
  lookup: (hostname, ...args) => {
125073
125144
  const callback = args.pop();
@@ -130106,7 +130177,7 @@ var require_dist$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports) => {
130106
130177
  const socks_1 = require_build$1();
130107
130178
  const agent_base_1 = require_dist$12();
130108
130179
  const debug_1 = __importDefault(require_src$1());
130109
- const dns = __importStar(require("dns"));
130180
+ const dns$1 = __importStar(require("dns"));
130110
130181
  const net$1 = __importStar(require("net"));
130111
130182
  const tls$1 = __importStar(require("tls"));
130112
130183
  const url_1$1 = require("url");
@@ -130178,7 +130249,7 @@ var require_dist$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports) => {
130178
130249
  const { shouldLookup, proxy, timeout } = this;
130179
130250
  if (!opts.host) throw new Error("No `host` defined!");
130180
130251
  let { host } = opts;
130181
- const { port, lookup: lookupFn = dns.lookup } = opts;
130252
+ const { port, lookup: lookupFn = dns$1.lookup } = opts;
130182
130253
  if (shouldLookup) host = await new Promise((resolve, reject) => {
130183
130254
  lookupFn(host, {}, (err, res) => {
130184
130255
  if (err) reject(err);
@@ -150898,7 +150969,7 @@ require_semver();
150898
150969
  require_lib();
150899
150970
  //#endregion
150900
150971
  //#region ../../packages/core-node/src/handler-func.ts
150901
- const { join: join$5 } = node_path.default;
150972
+ const { join: join$6 } = node_path.default;
150902
150973
  //#endregion
150903
150974
  //#region ../../packages/core-node/src/handlers/plugins.ts
150904
150975
  const localPluginsMap = /* @__PURE__ */ new Map();
@@ -155192,119 +155263,120 @@ end tell`;
155192
155263
  };
155193
155264
  //#endregion
155194
155265
  //#region src/index.ts
155195
- var src_default = createNodeDefinition({ nodes: [{
155196
- node: createAction({
155197
- id: "steam-upload",
155198
- name: "Upload to Steam",
155199
- description: "Upload a folder to Steam",
155200
- icon: "",
155201
- displayString: "`Upload ${fmt.param(params['folder'], 'primary')} to steam`",
155202
- meta: {},
155203
- params: {
155204
- sdk: createPathParam("", {
155205
- required: true,
155206
- label: "Steam Sdk path",
155207
- control: {
155208
- type: "path",
155209
- options: { properties: ["openDirectory"] }
155210
- }
155211
- }),
155212
- username: createStringParam("", {
155213
- required: true,
155214
- label: "Steam username"
155215
- }),
155216
- appId: createStringParam("", {
155217
- required: true,
155218
- label: "App Id"
155219
- }),
155220
- depotId: createStringParam("", {
155221
- required: true,
155222
- label: "Depot Id"
155223
- }),
155224
- description: createStringParam("", {
155225
- required: true,
155226
- label: "Description"
155227
- }),
155228
- folder: createPathParam("", {
155229
- required: true,
155230
- label: "Folder to upload",
155231
- control: {
155232
- type: "path",
155233
- options: { properties: ["openDirectory"] }
155234
- }
155235
- })
155236
- },
155237
- outputs: {
155238
- "script-path": {
155239
- label: "Script path",
155240
- value: ""
155241
- },
155242
- "output-folder": {
155243
- label: "Output folder",
155244
- value: ""
155266
+ var src_default = createNodeDefinition({
155267
+ nodes: [{
155268
+ node: createAction({
155269
+ id: "steam-upload",
155270
+ name: "Upload to Steam",
155271
+ description: "Upload a folder to Steam",
155272
+ icon: "",
155273
+ displayString: "`Upload ${fmt.param(params['folder'], 'primary')} to steam`",
155274
+ meta: {},
155275
+ params: {
155276
+ sdk: createPathParam("", {
155277
+ required: true,
155278
+ label: "Steam Sdk path",
155279
+ control: {
155280
+ type: "path",
155281
+ options: { properties: ["openDirectory"] }
155282
+ }
155283
+ }),
155284
+ username: createStringParam("", {
155285
+ required: true,
155286
+ label: "Steam username"
155287
+ }),
155288
+ appId: createStringParam("", {
155289
+ required: true,
155290
+ label: "App Id"
155291
+ }),
155292
+ depotId: createStringParam("", {
155293
+ required: true,
155294
+ label: "Depot Id"
155295
+ }),
155296
+ description: createStringParam("", {
155297
+ required: true,
155298
+ label: "Description"
155299
+ }),
155300
+ folder: createPathParam("", {
155301
+ required: true,
155302
+ label: "Folder to upload",
155303
+ control: {
155304
+ type: "path",
155305
+ options: { properties: ["openDirectory"] }
155306
+ }
155307
+ })
155245
155308
  },
155246
- status: {
155247
- label: "Status",
155248
- value: ""
155309
+ outputs: {
155310
+ "script-path": {
155311
+ label: "Script path",
155312
+ value: ""
155313
+ },
155314
+ "output-folder": {
155315
+ label: "Output folder",
155316
+ value: ""
155317
+ },
155318
+ status: {
155319
+ label: "Status",
155320
+ value: ""
155321
+ }
155249
155322
  }
155250
- }
155251
- }),
155252
- runner: createActionRunner(async ({ log, inputs, cwd, abortSignal, setOutput }) => {
155253
- const folder = inputs.folder;
155254
- const appId = inputs.appId;
155255
- const sdk = inputs.sdk;
155256
- const depotId = inputs.depotId;
155257
- const username = inputs.username;
155258
- const description = inputs.description;
155259
- log(`uploading "${folder}" to steam`);
155260
- const errorMap = { 6: `No connection to content server. Your depot id (${depotId}) may be invalid` };
155261
- if (!await fileExists(sdk)) throw new Error(`You must enter a valid path to the Steam SDK`);
155262
- let builderFolder = "builder";
155263
- if ((0, node_os.platform)() === "linux") builderFolder += "_linux";
155264
- else if ((0, node_os.platform)() === "darwin") builderFolder += "_osx";
155265
- const cmd = "steamcmd";
155266
- const extensions = (0, node_os.platform)() === "win32" ? [
155267
- ".exe",
155268
- ".cmd",
155269
- ".bat"
155270
- ] : [".sh"];
155271
- let cmdFinal = "";
155272
- let steamcmdPath = "";
155273
- for (const ext of extensions) {
155274
- const p = (0, node_path.join)(sdk, "tools", "ContentBuilder", builderFolder, cmd + ext);
155275
- if (await fileExists(p)) {
155276
- steamcmdPath = p;
155277
- cmdFinal = cmd + ext;
155278
- break;
155323
+ }),
155324
+ runner: createActionRunner(async ({ log, inputs, cwd, abortSignal, setOutput }) => {
155325
+ const folder = inputs.folder;
155326
+ const appId = inputs.appId;
155327
+ const sdk = inputs.sdk;
155328
+ const depotId = inputs.depotId;
155329
+ const username = inputs.username;
155330
+ const description = inputs.description;
155331
+ log(`uploading "${folder}" to steam`);
155332
+ const errorMap = { 6: `No connection to content server. Your depot id (${depotId}) may be invalid` };
155333
+ if (!await fileExists(sdk)) throw new Error(`You must enter a valid path to the Steam SDK`);
155334
+ let builderFolder = "builder";
155335
+ if ((0, node_os.platform)() === "linux") builderFolder += "_linux";
155336
+ else if ((0, node_os.platform)() === "darwin") builderFolder += "_osx";
155337
+ const cmd = "steamcmd";
155338
+ const extensions = (0, node_os.platform)() === "win32" ? [
155339
+ ".exe",
155340
+ ".cmd",
155341
+ ".bat"
155342
+ ] : [".sh"];
155343
+ let cmdFinal = "";
155344
+ let steamcmdPath = "";
155345
+ for (const ext of extensions) {
155346
+ const p = (0, node_path.join)(sdk, "tools", "ContentBuilder", builderFolder, cmd + ext);
155347
+ if (await fileExists(p)) {
155348
+ steamcmdPath = p;
155349
+ cmdFinal = cmd + ext;
155350
+ break;
155351
+ }
155279
155352
  }
155280
- }
155281
- if (!steamcmdPath) {
155282
- if ((0, node_os.platform)() === "linux" || (0, node_os.platform)() === "darwin") cmdFinal = "steamcmd.sh";
155283
- else if ((0, node_os.platform)() === "win32") cmdFinal = "steamcmd.exe";
155284
- steamcmdPath = (0, node_path.join)(sdk, "tools", "ContentBuilder", builderFolder, cmdFinal);
155285
- }
155286
- console.log("steamcmdPath", steamcmdPath);
155287
- if ((0, node_os.platform)() === "linux" || (0, node_os.platform)() === "darwin") {
155288
- if ((0, node_os.platform)() === "linux") {
155289
- log("Adding \"execute\" permissions to linux binary");
155290
- await (0, node_fs_promises.chmod)((0, node_path.join)(sdk, "tools", "ContentBuilder", builderFolder, "linux32", cmd), 493);
155291
- await (0, node_fs_promises.chmod)((0, node_path.join)(sdk, "tools", "ContentBuilder", builderFolder, "linux32", "steamerrorreporter"), 493);
155292
- }
155293
- if ((0, node_os.platform)() === "darwin") {
155294
- const steamcmdBinaryPath = (0, node_path.join)(sdk, "tools", "ContentBuilder", builderFolder, cmd);
155295
- log("Adding \"execute\" permissions to darwin binary");
155296
- await (0, node_fs_promises.chmod)(steamcmdBinaryPath, 493);
155297
- }
155298
- log("Adding \"execute\" permissions to binary");
155299
- await (0, node_fs_promises.chmod)(steamcmdPath, 493);
155300
- }
155301
- const buildOutput = (0, node_path.join)(cwd, "steam", "output");
155302
- const scriptPath = (0, node_path.join)(cwd, "steam", "script.vdf");
155303
- setOutput("script-path", scriptPath);
155304
- setOutput("output-folder", buildOutput);
155305
- await (0, node_fs_promises.mkdir)(buildOutput, { recursive: true });
155306
- await (0, node_fs_promises.mkdir)((0, node_path.dirname)(scriptPath), { recursive: true });
155307
- const script = `"AppBuild"
155353
+ if (!steamcmdPath) {
155354
+ if ((0, node_os.platform)() === "linux" || (0, node_os.platform)() === "darwin") cmdFinal = "steamcmd.sh";
155355
+ else if ((0, node_os.platform)() === "win32") cmdFinal = "steamcmd.exe";
155356
+ steamcmdPath = (0, node_path.join)(sdk, "tools", "ContentBuilder", builderFolder, cmdFinal);
155357
+ }
155358
+ console.log("steamcmdPath", steamcmdPath);
155359
+ if ((0, node_os.platform)() === "linux" || (0, node_os.platform)() === "darwin") {
155360
+ if ((0, node_os.platform)() === "linux") {
155361
+ log("Adding \"execute\" permissions to linux binary");
155362
+ await (0, node_fs_promises.chmod)((0, node_path.join)(sdk, "tools", "ContentBuilder", builderFolder, "linux32", cmd), 493);
155363
+ await (0, node_fs_promises.chmod)((0, node_path.join)(sdk, "tools", "ContentBuilder", builderFolder, "linux32", "steamerrorreporter"), 493);
155364
+ }
155365
+ if ((0, node_os.platform)() === "darwin") {
155366
+ const steamcmdBinaryPath = (0, node_path.join)(sdk, "tools", "ContentBuilder", builderFolder, cmd);
155367
+ log("Adding \"execute\" permissions to darwin binary");
155368
+ await (0, node_fs_promises.chmod)(steamcmdBinaryPath, 493);
155369
+ }
155370
+ log("Adding \"execute\" permissions to binary");
155371
+ await (0, node_fs_promises.chmod)(steamcmdPath, 493);
155372
+ }
155373
+ const buildOutput = (0, node_path.join)(cwd, "steam", "output");
155374
+ const scriptPath = (0, node_path.join)(cwd, "steam", "script.vdf");
155375
+ setOutput("script-path", scriptPath);
155376
+ setOutput("output-folder", buildOutput);
155377
+ await (0, node_fs_promises.mkdir)(buildOutput, { recursive: true });
155378
+ await (0, node_fs_promises.mkdir)((0, node_path.dirname)(scriptPath), { recursive: true });
155379
+ const script = `"AppBuild"
155308
155380
  {
155309
155381
  "AppID" "${appId}" // your AppID
155310
155382
  "Desc" "${description}" // internal description for this build
@@ -155325,25 +155397,8 @@ var src_default = createNodeDefinition({ nodes: [{
155325
155397
  }
155326
155398
  }
155327
155399
  }`;
155328
- console.log("script", script);
155329
- const isAuthenticated = await checkSteamAuth({
155330
- context: {
155331
- log,
155332
- abortSignal
155333
- },
155334
- scriptPath,
155335
- steamcmdPath,
155336
- username
155337
- });
155338
- log("isAuthenticated", JSON.stringify(isAuthenticated));
155339
- if (isAuthenticated.success === false) {
155340
- log("Opening terminal with interactive login");
155341
- await openExternalTerminal(steamcmdPath, [
155342
- "+login",
155343
- username,
155344
- "+quit"
155345
- ], { cancelSignal: abortSignal });
155346
- if ((await checkSteamAuth({
155400
+ console.log("script", script);
155401
+ const isAuthenticated = await checkSteamAuth({
155347
155402
  context: {
155348
155403
  log,
155349
155404
  abortSignal
@@ -155351,42 +155406,77 @@ var src_default = createNodeDefinition({ nodes: [{
155351
155406
  scriptPath,
155352
155407
  steamcmdPath,
155353
155408
  username
155354
- })).success === false) throw new Error("Not authenticated");
155355
- }
155356
- log("Writing script");
155357
- await (0, node_fs_promises.writeFile)(scriptPath, script, {
155358
- encoding: "utf8",
155359
- signal: abortSignal
155360
- });
155361
- log("Executing steamcmd");
155362
- try {
155363
- await runWithLiveLogs(steamcmdPath, [
155364
- "+login",
155365
- username,
155366
- "+run_app_build",
155367
- scriptPath,
155368
- "+quit"
155369
- ], { shell: (0, node_os.platform)() === "win32" }, log, {
155370
- onStdout: (data) => {
155371
- log("[steamcmd]", data);
155372
- },
155373
- onStderr: (data) => {
155374
- log("[steamcmd]", data);
155375
- }
155376
- }, abortSignal);
155377
- } catch (e) {
155378
- if (e instanceof ExternalCommandError) {
155379
- const code = e.code;
155380
- const message = code in errorMap ? errorMap[code] : "SteamCmd error:" + e.code + " " + e.message;
155381
- throw new Error(message);
155382
- } else if (e instanceof Error) {
155383
- console.error(e);
155384
- throw new Error("Error:" + e.message);
155385
- } else throw new Error("unknwon error");
155386
- }
155387
- setOutput("status", "success");
155388
- log("Done uploading");
155389
- })
155390
- }] });
155409
+ });
155410
+ log("isAuthenticated", JSON.stringify(isAuthenticated));
155411
+ if (isAuthenticated.success === false) {
155412
+ log("Opening terminal with interactive login");
155413
+ await openExternalTerminal(steamcmdPath, [
155414
+ "+login",
155415
+ username,
155416
+ "+quit"
155417
+ ], { cancelSignal: abortSignal });
155418
+ if ((await checkSteamAuth({
155419
+ context: {
155420
+ log,
155421
+ abortSignal
155422
+ },
155423
+ scriptPath,
155424
+ steamcmdPath,
155425
+ username
155426
+ })).success === false) throw new Error("Not authenticated");
155427
+ }
155428
+ log("Writing script");
155429
+ await (0, node_fs_promises.writeFile)(scriptPath, script, {
155430
+ encoding: "utf8",
155431
+ signal: abortSignal
155432
+ });
155433
+ log("Executing steamcmd");
155434
+ try {
155435
+ await runWithLiveLogs(steamcmdPath, [
155436
+ "+login",
155437
+ username,
155438
+ "+run_app_build",
155439
+ scriptPath,
155440
+ "+quit"
155441
+ ], { shell: (0, node_os.platform)() === "win32" }, log, {
155442
+ onStdout: (data) => {
155443
+ log("[steamcmd]", data);
155444
+ },
155445
+ onStderr: (data) => {
155446
+ log("[steamcmd]", data);
155447
+ }
155448
+ }, abortSignal);
155449
+ } catch (e) {
155450
+ if (e instanceof ExternalCommandError) {
155451
+ const code = e.code;
155452
+ const message = code in errorMap ? errorMap[code] : "SteamCmd error:" + e.code + " " + e.message;
155453
+ throw new Error(message);
155454
+ } else if (e instanceof Error) {
155455
+ console.error(e);
155456
+ throw new Error("Error:" + e.message);
155457
+ } else throw new Error("unknwon error");
155458
+ }
155459
+ setOutput("status", "success");
155460
+ log("Done uploading");
155461
+ })
155462
+ }],
155463
+ integrations: [{
155464
+ name: "Steam SDK",
155465
+ fields: [{
155466
+ key: "sdk",
155467
+ label: "Steam SDK Path",
155468
+ type: "directory",
155469
+ placeholder: "e.g., /home/user/steam-sdk"
155470
+ }]
155471
+ }, {
155472
+ name: "Steam Credentials",
155473
+ fields: [{
155474
+ key: "username",
155475
+ label: "Steam Username",
155476
+ type: "text",
155477
+ placeholder: "e.g., steam_user"
155478
+ }]
155479
+ }]
155480
+ });
155391
155481
  //#endregion
155392
155482
  module.exports = src_default;