@fragment-dev/cli 2026.1.19 → 2026.1.22-1

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.
@@ -6075,11 +6075,10 @@ var validateEntryConditions = (entryConditions, staticParameters, entryType, acc
6075
6075
  })
6076
6076
  );
6077
6077
  const isTotalBalanceCondition = (condition) => {
6078
- return Boolean(
6079
- condition.precondition && "totalBalance" in condition.precondition
6080
- ) || Boolean(
6081
- condition.postcondition && "totalBalance" in condition.postcondition
6082
- );
6078
+ return Boolean(condition.precondition?.totalBalance) || Boolean(condition.postcondition?.totalBalance);
6079
+ };
6080
+ const isOwnBalanceCondition = (condition) => {
6081
+ return Boolean(condition.precondition?.ownBalance) || Boolean(condition.postcondition?.ownBalance);
6083
6082
  };
6084
6083
  conditions.forEach((condition, idx) => {
6085
6084
  const structuralPath = getStructuralPath(condition.account.path);
@@ -6121,7 +6120,7 @@ var validateEntryConditions = (entryConditions, staticParameters, entryType, acc
6121
6120
  });
6122
6121
  }
6123
6122
  });
6124
- if (matchedAccount?.currencyMode === "multi" && condition.currency === void 0) {
6123
+ if (matchedAccount?.currencyMode === "multi" && condition.currency === void 0 || condition.currency?.code.trim() === "") {
6125
6124
  errors.push({
6126
6125
  path: ["conditions", idx, "currency"],
6127
6126
  message: `You must specify a currency for a condition on a multi-currency Ledger Account. Error occurred at (${condition.account.path} | entry: ${entryType})`
@@ -6133,6 +6132,12 @@ var validateEntryConditions = (entryConditions, staticParameters, entryType, acc
6133
6132
  message: `The currency you specified on a condition (${condition.currency?.code === "CUSTOM" ? condition.currency.customCurrencyId : condition.currency.code}) differs from the currency of the Ledger Account it applies to. Error occurred at (${matchedAccount.currency?.code} | entry: ${entryType})`
6134
6133
  });
6135
6134
  }
6135
+ if (isOwnBalanceCondition(condition) && matchedAccount && matchedAccount.consistencyConfig.ownBalanceUpdates !== "strong") {
6136
+ errors.push({
6137
+ path: ["conditions", idx],
6138
+ message: `You cannot specify an ownBalance condition on a Ledger Account whose ownBalanceUpdates consistency mode is not 'strong'. Error occurred at (path: ${condition.account.path} | entry: ${entryType})`
6139
+ });
6140
+ }
6136
6141
  if (isTotalBalanceCondition(condition) && condition.precondition && condition.postcondition) {
6137
6142
  errors.push({
6138
6143
  path: ["conditions", idx, "precondition", "postcondition"],
@@ -6419,13 +6424,13 @@ var validateParameters = (parameters) => {
6419
6424
  Object.entries(parameters).forEach(([key, value], idx) => {
6420
6425
  if (key === "") {
6421
6426
  errors.push({
6422
- path: ["parameters", "key"],
6427
+ path: ["parameters", idx, "key"],
6423
6428
  message: `Key for static value at index ${idx} cannot be an empty string.`
6424
6429
  });
6425
6430
  }
6426
6431
  if (value === "") {
6427
6432
  errors.push({
6428
- path: ["parameters", "value"],
6433
+ path: ["parameters", idx, "value"],
6429
6434
  message: `Value for static value at index ${idx} cannot be an empty string.`
6430
6435
  });
6431
6436
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  inquirer_default
3
- } from "./chunk-W7POEWP5.js";
3
+ } from "./chunk-OE6G5KKN.js";
4
4
  import {
5
5
  AuthenticatedCommand
6
6
  } from "./chunk-K4VSNBUT.js";
@@ -15,22 +15,22 @@ import {
15
15
  } from "./chunk-2L7DM7UG.js";
16
16
  import {
17
17
  Update
18
- } from "./chunk-7SEJLCZX.js";
18
+ } from "./chunk-IG3ODKHF.js";
19
19
  import {
20
20
  VerifySchema
21
- } from "./chunk-KOQHOP64.js";
21
+ } from "./chunk-XIIPN2KQ.js";
22
22
  import {
23
23
  Workspace
24
24
  } from "./chunk-ZJ6YXWND.js";
25
25
  import {
26
26
  GetSchema
27
- } from "./chunk-CFMP4SZH.js";
27
+ } from "./chunk-GYNGQ47N.js";
28
28
  import {
29
29
  Init
30
30
  } from "./chunk-SOGMH4XZ.js";
31
31
  import {
32
32
  Login
33
- } from "./chunk-Y3LOFHYD.js";
33
+ } from "./chunk-VEPUYP44.js";
34
34
  import {
35
35
  MigrateLedgerEntry
36
36
  } from "./chunk-PH6CNCD5.js";
@@ -66,7 +66,7 @@ import {
66
66
  } from "./chunk-35TPIT7U.js";
67
67
  import {
68
68
  GenGraphQL
69
- } from "./chunk-MSMCOD4P.js";
69
+ } from "./chunk-HIFGFBQJ.js";
70
70
  import {
71
71
  init_cjs_shims
72
72
  } from "./chunk-7GH3YGSC.js";
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  Schema,
9
9
  parseWithError
10
- } from "./chunk-TWESYQMI.js";
10
+ } from "./chunk-3YAVQURU.js";
11
11
  import {
12
12
  formatValidationErrors,
13
13
  logValidationErrors
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  inquirer_default
3
- } from "./chunk-W7POEWP5.js";
3
+ } from "./chunk-OE6G5KKN.js";
4
4
  import {
5
5
  FragmentCommand,
6
6
  require_lib
@@ -26443,114 +26443,63 @@ var require_lib = __commonJS({
26443
26443
  }
26444
26444
  });
26445
26445
 
26446
- // ../../node_modules/os-tmpdir/index.js
26447
- var require_os_tmpdir = __commonJS({
26448
- "../../node_modules/os-tmpdir/index.js"(exports, module) {
26449
- "use strict";
26450
- init_cjs_shims();
26451
- var isWindows = process.platform === "win32";
26452
- var trailingSlashRe = isWindows ? /[^:]\\$/ : /.\/$/;
26453
- module.exports = function() {
26454
- var path;
26455
- if (isWindows) {
26456
- path = process.env.TEMP || process.env.TMP || (process.env.SystemRoot || process.env.windir) + "\\temp";
26457
- } else {
26458
- path = process.env.TMPDIR || process.env.TMP || process.env.TEMP || "/tmp";
26459
- }
26460
- if (trailingSlashRe.test(path)) {
26461
- path = path.slice(0, -1);
26462
- }
26463
- return path;
26464
- };
26465
- }
26466
- });
26467
-
26468
- // ../../node_modules/external-editor/node_modules/tmp/lib/tmp.js
26446
+ // ../../node_modules/tmp/lib/tmp.js
26469
26447
  var require_tmp = __commonJS({
26470
- "../../node_modules/external-editor/node_modules/tmp/lib/tmp.js"(exports, module) {
26448
+ "../../node_modules/tmp/lib/tmp.js"(exports, module) {
26471
26449
  init_cjs_shims();
26472
26450
  var fs = __require("fs");
26451
+ var os2 = __require("os");
26473
26452
  var path = __require("path");
26474
26453
  var crypto = __require("crypto");
26475
- var osTmpDir = require_os_tmpdir();
26476
- var _c = process.binding("constants");
26477
- var tmpDir = osTmpDir();
26454
+ var _c = { fs: fs.constants, os: os2.constants };
26478
26455
  var RANDOM_CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
26479
26456
  var TEMPLATE_PATTERN = /XXXXXX/;
26480
26457
  var DEFAULT_TRIES = 3;
26481
26458
  var CREATE_FLAGS = (_c.O_CREAT || _c.fs.O_CREAT) | (_c.O_EXCL || _c.fs.O_EXCL) | (_c.O_RDWR || _c.fs.O_RDWR);
26459
+ var IS_WIN32 = os2.platform() === "win32";
26482
26460
  var EBADF = _c.EBADF || _c.os.errno.EBADF;
26483
26461
  var ENOENT = _c.ENOENT || _c.os.errno.ENOENT;
26484
26462
  var DIR_MODE = 448;
26485
26463
  var FILE_MODE = 384;
26464
+ var EXIT = "exit";
26486
26465
  var _removeObjects = [];
26466
+ var FN_RMDIR_SYNC = fs.rmdirSync.bind(fs);
26487
26467
  var _gracefulCleanup = false;
26488
- var _uncaughtException = false;
26489
- function _randomChars(howMany) {
26490
- var value = [], rnd = null;
26491
- try {
26492
- rnd = crypto.randomBytes(howMany);
26493
- } catch (e) {
26494
- rnd = crypto.pseudoRandomBytes(howMany);
26495
- }
26496
- for (var i = 0; i < howMany; i++) {
26497
- value.push(RANDOM_CHARS[rnd[i] % RANDOM_CHARS.length]);
26498
- }
26499
- return value.join("");
26468
+ function rimraf(dirPath, callback) {
26469
+ return fs.rm(dirPath, { recursive: true }, callback);
26500
26470
  }
26501
- function _isUndefined(obj) {
26502
- return typeof obj === "undefined";
26503
- }
26504
- function _parseArguments(options, callback) {
26505
- if (typeof options == "function") {
26506
- return [callback || {}, options];
26507
- }
26508
- if (_isUndefined(options)) {
26509
- return [{}, callback];
26510
- }
26511
- return [options, callback];
26512
- }
26513
- function _generateTmpName(opts) {
26514
- if (opts.name) {
26515
- return path.join(opts.dir || tmpDir, opts.name);
26516
- }
26517
- if (opts.template) {
26518
- return opts.template.replace(TEMPLATE_PATTERN, _randomChars(6));
26519
- }
26520
- const name = [
26521
- opts.prefix || "tmp-",
26522
- process.pid,
26523
- _randomChars(12),
26524
- opts.postfix || ""
26525
- ].join("");
26526
- return path.join(opts.dir || tmpDir, name);
26471
+ function FN_RIMRAF_SYNC(dirPath) {
26472
+ return fs.rmSync(dirPath, { recursive: true });
26527
26473
  }
26528
26474
  function tmpName(options, callback) {
26529
- var args = _parseArguments(options, callback), opts = args[0], cb = args[1], tries = opts.name ? 1 : opts.tries || DEFAULT_TRIES;
26530
- if (isNaN(tries) || tries < 0)
26531
- return cb(new Error("Invalid tries"));
26532
- if (opts.template && !opts.template.match(TEMPLATE_PATTERN))
26533
- return cb(new Error("Invalid template provided"));
26534
- (function _getUniqueName() {
26535
- const name = _generateTmpName(opts);
26536
- fs.stat(name, function(err) {
26537
- if (!err) {
26538
- if (tries-- > 0)
26539
- return _getUniqueName();
26540
- return cb(new Error("Could not get a unique tmp filename, max tries reached " + name));
26541
- }
26542
- cb(null, name);
26543
- });
26544
- })();
26475
+ const args = _parseArguments(options, callback), opts = args[0], cb = args[1];
26476
+ _assertAndSanitizeOptions(opts, function(err, sanitizedOptions) {
26477
+ if (err)
26478
+ return cb(err);
26479
+ let tries = sanitizedOptions.tries;
26480
+ (function _getUniqueName() {
26481
+ try {
26482
+ const name = _generateTmpName(sanitizedOptions);
26483
+ fs.stat(name, function(err2) {
26484
+ if (!err2) {
26485
+ if (tries-- > 0)
26486
+ return _getUniqueName();
26487
+ return cb(new Error("Could not get a unique tmp filename, max tries reached " + name));
26488
+ }
26489
+ cb(null, name);
26490
+ });
26491
+ } catch (err2) {
26492
+ cb(err2);
26493
+ }
26494
+ })();
26495
+ });
26545
26496
  }
26546
26497
  function tmpNameSync(options) {
26547
- var args = _parseArguments(options), opts = args[0], tries = opts.name ? 1 : opts.tries || DEFAULT_TRIES;
26548
- if (isNaN(tries) || tries < 0)
26549
- throw new Error("Invalid tries");
26550
- if (opts.template && !opts.template.match(TEMPLATE_PATTERN))
26551
- throw new Error("Invalid template provided");
26498
+ const args = _parseArguments(options), opts = args[0];
26499
+ const sanitizedOptions = _assertAndSanitizeOptionsSync(opts);
26500
+ let tries = sanitizedOptions.tries;
26552
26501
  do {
26553
- const name = _generateTmpName(opts);
26502
+ const name = _generateTmpName(sanitizedOptions);
26554
26503
  try {
26555
26504
  fs.statSync(name);
26556
26505
  } catch (e) {
@@ -26560,8 +26509,7 @@ var require_tmp = __commonJS({
26560
26509
  throw new Error("Could not get a unique tmp filename, max tries reached");
26561
26510
  }
26562
26511
  function file(options, callback) {
26563
- var args = _parseArguments(options, callback), opts = args[0], cb = args[1];
26564
- opts.postfix = _isUndefined(opts.postfix) ? ".tmp" : opts.postfix;
26512
+ const args = _parseArguments(options, callback), opts = args[0], cb = args[1];
26565
26513
  tmpName(opts, function _tmpNameCreated(err, name) {
26566
26514
  if (err)
26567
26515
  return cb(err);
@@ -26569,33 +26517,21 @@ var require_tmp = __commonJS({
26569
26517
  if (err2)
26570
26518
  return cb(err2);
26571
26519
  if (opts.discardDescriptor) {
26572
- return fs.close(fd, function _discardCallback(err3) {
26573
- if (err3) {
26574
- try {
26575
- fs.unlinkSync(name);
26576
- } catch (e) {
26577
- if (!isENOENT(e)) {
26578
- err3 = e;
26579
- }
26580
- }
26581
- return cb(err3);
26582
- }
26583
- cb(null, name, void 0, _prepareTmpFileRemoveCallback(name, -1, opts));
26520
+ return fs.close(fd, function _discardCallback(possibleErr) {
26521
+ return cb(possibleErr, name, void 0, _prepareTmpFileRemoveCallback(name, -1, opts, false));
26584
26522
  });
26523
+ } else {
26524
+ const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor;
26525
+ cb(null, name, fd, _prepareTmpFileRemoveCallback(name, discardOrDetachDescriptor ? -1 : fd, opts, false));
26585
26526
  }
26586
- if (opts.detachDescriptor) {
26587
- return cb(null, name, fd, _prepareTmpFileRemoveCallback(name, -1, opts));
26588
- }
26589
- cb(null, name, fd, _prepareTmpFileRemoveCallback(name, fd, opts));
26590
26527
  });
26591
26528
  });
26592
26529
  }
26593
26530
  function fileSync(options) {
26594
- var args = _parseArguments(options), opts = args[0];
26595
- opts.postfix = opts.postfix || ".tmp";
26531
+ const args = _parseArguments(options), opts = args[0];
26596
26532
  const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor;
26597
26533
  const name = tmpNameSync(opts);
26598
- var fd = fs.openSync(name, CREATE_FLAGS, opts.mode || FILE_MODE);
26534
+ let fd = fs.openSync(name, CREATE_FLAGS, opts.mode || FILE_MODE);
26599
26535
  if (opts.discardDescriptor) {
26600
26536
  fs.closeSync(fd);
26601
26537
  fd = void 0;
@@ -26603,137 +26539,281 @@ var require_tmp = __commonJS({
26603
26539
  return {
26604
26540
  name,
26605
26541
  fd,
26606
- removeCallback: _prepareTmpFileRemoveCallback(name, discardOrDetachDescriptor ? -1 : fd, opts)
26542
+ removeCallback: _prepareTmpFileRemoveCallback(name, discardOrDetachDescriptor ? -1 : fd, opts, true)
26607
26543
  };
26608
26544
  }
26609
- function _rmdirRecursiveSync(root) {
26610
- const dirs = [root];
26611
- do {
26612
- var dir2 = dirs.pop(), deferred = false, files = fs.readdirSync(dir2);
26613
- for (var i = 0, length = files.length; i < length; i++) {
26614
- var file2 = path.join(dir2, files[i]), stat = fs.lstatSync(file2);
26615
- if (stat.isDirectory()) {
26616
- if (!deferred) {
26617
- deferred = true;
26618
- dirs.push(dir2);
26619
- }
26620
- dirs.push(file2);
26621
- } else {
26622
- fs.unlinkSync(file2);
26623
- }
26624
- }
26625
- if (!deferred) {
26626
- fs.rmdirSync(dir2);
26627
- }
26628
- } while (dirs.length !== 0);
26629
- }
26630
26545
  function dir(options, callback) {
26631
- var args = _parseArguments(options, callback), opts = args[0], cb = args[1];
26546
+ const args = _parseArguments(options, callback), opts = args[0], cb = args[1];
26632
26547
  tmpName(opts, function _tmpNameCreated(err, name) {
26633
26548
  if (err)
26634
26549
  return cb(err);
26635
26550
  fs.mkdir(name, opts.mode || DIR_MODE, function _dirCreated(err2) {
26636
26551
  if (err2)
26637
26552
  return cb(err2);
26638
- cb(null, name, _prepareTmpDirRemoveCallback(name, opts));
26553
+ cb(null, name, _prepareTmpDirRemoveCallback(name, opts, false));
26639
26554
  });
26640
26555
  });
26641
26556
  }
26642
26557
  function dirSync(options) {
26643
- var args = _parseArguments(options), opts = args[0];
26558
+ const args = _parseArguments(options), opts = args[0];
26644
26559
  const name = tmpNameSync(opts);
26645
26560
  fs.mkdirSync(name, opts.mode || DIR_MODE);
26646
26561
  return {
26647
26562
  name,
26648
- removeCallback: _prepareTmpDirRemoveCallback(name, opts)
26563
+ removeCallback: _prepareTmpDirRemoveCallback(name, opts, true)
26649
26564
  };
26650
26565
  }
26651
- function _prepareTmpFileRemoveCallback(name, fd, opts) {
26652
- const removeCallback = _prepareRemoveCallback(function _removeCallback(fdPath) {
26653
- try {
26654
- if (0 <= fdPath[0]) {
26655
- fs.closeSync(fdPath[0]);
26656
- }
26657
- } catch (e) {
26658
- if (!isEBADF(e) && !isENOENT(e)) {
26659
- throw e;
26660
- }
26566
+ function _removeFileAsync(fdPath, next) {
26567
+ const _handler = function(err) {
26568
+ if (err && !_isENOENT(err)) {
26569
+ return next(err);
26661
26570
  }
26571
+ next();
26572
+ };
26573
+ if (0 <= fdPath[0])
26574
+ fs.close(fdPath[0], function() {
26575
+ fs.unlink(fdPath[1], _handler);
26576
+ });
26577
+ else
26578
+ fs.unlink(fdPath[1], _handler);
26579
+ }
26580
+ function _removeFileSync(fdPath) {
26581
+ let rethrownException = null;
26582
+ try {
26583
+ if (0 <= fdPath[0])
26584
+ fs.closeSync(fdPath[0]);
26585
+ } catch (e) {
26586
+ if (!_isEBADF(e) && !_isENOENT(e))
26587
+ throw e;
26588
+ } finally {
26662
26589
  try {
26663
26590
  fs.unlinkSync(fdPath[1]);
26664
26591
  } catch (e) {
26665
- if (!isENOENT(e)) {
26666
- throw e;
26667
- }
26592
+ if (!_isENOENT(e))
26593
+ rethrownException = e;
26668
26594
  }
26669
- }, [fd, name]);
26670
- if (!opts.keep) {
26671
- _removeObjects.unshift(removeCallback);
26672
26595
  }
26673
- return removeCallback;
26674
- }
26675
- function _prepareTmpDirRemoveCallback(name, opts) {
26676
- const removeFunction = opts.unsafeCleanup ? _rmdirRecursiveSync : fs.rmdirSync.bind(fs);
26677
- const removeCallback = _prepareRemoveCallback(removeFunction, name);
26678
- if (!opts.keep) {
26679
- _removeObjects.unshift(removeCallback);
26596
+ if (rethrownException !== null) {
26597
+ throw rethrownException;
26680
26598
  }
26681
- return removeCallback;
26682
26599
  }
26683
- function _prepareRemoveCallback(removeFunction, arg) {
26684
- var called = false;
26600
+ function _prepareTmpFileRemoveCallback(name, fd, opts, sync) {
26601
+ const removeCallbackSync = _prepareRemoveCallback(_removeFileSync, [fd, name], sync);
26602
+ const removeCallback = _prepareRemoveCallback(_removeFileAsync, [fd, name], sync, removeCallbackSync);
26603
+ if (!opts.keep)
26604
+ _removeObjects.unshift(removeCallbackSync);
26605
+ return sync ? removeCallbackSync : removeCallback;
26606
+ }
26607
+ function _prepareTmpDirRemoveCallback(name, opts, sync) {
26608
+ const removeFunction = opts.unsafeCleanup ? rimraf : fs.rmdir.bind(fs);
26609
+ const removeFunctionSync = opts.unsafeCleanup ? FN_RIMRAF_SYNC : FN_RMDIR_SYNC;
26610
+ const removeCallbackSync = _prepareRemoveCallback(removeFunctionSync, name, sync);
26611
+ const removeCallback = _prepareRemoveCallback(removeFunction, name, sync, removeCallbackSync);
26612
+ if (!opts.keep)
26613
+ _removeObjects.unshift(removeCallbackSync);
26614
+ return sync ? removeCallbackSync : removeCallback;
26615
+ }
26616
+ function _prepareRemoveCallback(removeFunction, fileOrDirName, sync, cleanupCallbackSync) {
26617
+ let called = false;
26685
26618
  return function _cleanupCallback(next) {
26686
26619
  if (!called) {
26687
- const index = _removeObjects.indexOf(_cleanupCallback);
26688
- if (index >= 0) {
26620
+ const toRemove = cleanupCallbackSync || _cleanupCallback;
26621
+ const index = _removeObjects.indexOf(toRemove);
26622
+ if (index >= 0)
26689
26623
  _removeObjects.splice(index, 1);
26690
- }
26691
26624
  called = true;
26692
- removeFunction(arg);
26625
+ if (sync || removeFunction === FN_RMDIR_SYNC || removeFunction === FN_RIMRAF_SYNC) {
26626
+ return removeFunction(fileOrDirName);
26627
+ } else {
26628
+ return removeFunction(fileOrDirName, next || function() {
26629
+ });
26630
+ }
26693
26631
  }
26694
- if (next)
26695
- next(null);
26696
26632
  };
26697
26633
  }
26698
26634
  function _garbageCollector() {
26699
- if (_uncaughtException && !_gracefulCleanup) {
26635
+ if (!_gracefulCleanup)
26700
26636
  return;
26701
- }
26702
26637
  while (_removeObjects.length) {
26703
26638
  try {
26704
- _removeObjects[0].call(null);
26639
+ _removeObjects[0]();
26705
26640
  } catch (e) {
26706
26641
  }
26707
26642
  }
26708
26643
  }
26709
- function isEBADF(error) {
26710
- return isExpectedError(error, -EBADF, "EBADF");
26644
+ function _randomChars(howMany) {
26645
+ let value = [], rnd = null;
26646
+ try {
26647
+ rnd = crypto.randomBytes(howMany);
26648
+ } catch (e) {
26649
+ rnd = crypto.pseudoRandomBytes(howMany);
26650
+ }
26651
+ for (let i = 0; i < howMany; i++) {
26652
+ value.push(RANDOM_CHARS[rnd[i] % RANDOM_CHARS.length]);
26653
+ }
26654
+ return value.join("");
26655
+ }
26656
+ function _isUndefined(obj) {
26657
+ return typeof obj === "undefined";
26658
+ }
26659
+ function _parseArguments(options, callback) {
26660
+ if (typeof options === "function") {
26661
+ return [{}, options];
26662
+ }
26663
+ if (_isUndefined(options)) {
26664
+ return [{}, callback];
26665
+ }
26666
+ const actualOptions = {};
26667
+ for (const key of Object.getOwnPropertyNames(options)) {
26668
+ actualOptions[key] = options[key];
26669
+ }
26670
+ return [actualOptions, callback];
26671
+ }
26672
+ function _resolvePath(name, tmpDir, cb) {
26673
+ const pathToResolve = path.isAbsolute(name) ? name : path.join(tmpDir, name);
26674
+ fs.stat(pathToResolve, function(err) {
26675
+ if (err) {
26676
+ fs.realpath(path.dirname(pathToResolve), function(err2, parentDir) {
26677
+ if (err2)
26678
+ return cb(err2);
26679
+ cb(null, path.join(parentDir, path.basename(pathToResolve)));
26680
+ });
26681
+ } else {
26682
+ fs.realpath(pathToResolve, cb);
26683
+ }
26684
+ });
26685
+ }
26686
+ function _resolvePathSync(name, tmpDir) {
26687
+ const pathToResolve = path.isAbsolute(name) ? name : path.join(tmpDir, name);
26688
+ try {
26689
+ fs.statSync(pathToResolve);
26690
+ return fs.realpathSync(pathToResolve);
26691
+ } catch (_err) {
26692
+ const parentDir = fs.realpathSync(path.dirname(pathToResolve));
26693
+ return path.join(parentDir, path.basename(pathToResolve));
26694
+ }
26695
+ }
26696
+ function _generateTmpName(opts) {
26697
+ const tmpDir = opts.tmpdir;
26698
+ if (!_isUndefined(opts.name)) {
26699
+ return path.join(tmpDir, opts.dir, opts.name);
26700
+ }
26701
+ if (!_isUndefined(opts.template)) {
26702
+ return path.join(tmpDir, opts.dir, opts.template).replace(TEMPLATE_PATTERN, _randomChars(6));
26703
+ }
26704
+ const name = [
26705
+ opts.prefix ? opts.prefix : "tmp",
26706
+ "-",
26707
+ process.pid,
26708
+ "-",
26709
+ _randomChars(12),
26710
+ opts.postfix ? "-" + opts.postfix : ""
26711
+ ].join("");
26712
+ return path.join(tmpDir, opts.dir, name);
26713
+ }
26714
+ function _assertOptionsBase(options) {
26715
+ if (!_isUndefined(options.name)) {
26716
+ const name = options.name;
26717
+ if (path.isAbsolute(name))
26718
+ throw new Error(`name option must not contain an absolute path, found "${name}".`);
26719
+ const basename = path.basename(name);
26720
+ if (basename === ".." || basename === "." || basename !== name)
26721
+ throw new Error(`name option must not contain a path, found "${name}".`);
26722
+ }
26723
+ if (!_isUndefined(options.template) && !options.template.match(TEMPLATE_PATTERN)) {
26724
+ throw new Error(`Invalid template, found "${options.template}".`);
26725
+ }
26726
+ if (!_isUndefined(options.tries) && isNaN(options.tries) || options.tries < 0) {
26727
+ throw new Error(`Invalid tries, found "${options.tries}".`);
26728
+ }
26729
+ options.tries = _isUndefined(options.name) ? options.tries || DEFAULT_TRIES : 1;
26730
+ options.keep = !!options.keep;
26731
+ options.detachDescriptor = !!options.detachDescriptor;
26732
+ options.discardDescriptor = !!options.discardDescriptor;
26733
+ options.unsafeCleanup = !!options.unsafeCleanup;
26734
+ options.prefix = _isUndefined(options.prefix) ? "" : options.prefix;
26735
+ options.postfix = _isUndefined(options.postfix) ? "" : options.postfix;
26736
+ }
26737
+ function _getRelativePath(option, name, tmpDir, cb) {
26738
+ if (_isUndefined(name))
26739
+ return cb(null);
26740
+ _resolvePath(name, tmpDir, function(err, resolvedPath) {
26741
+ if (err)
26742
+ return cb(err);
26743
+ const relativePath = path.relative(tmpDir, resolvedPath);
26744
+ if (!resolvedPath.startsWith(tmpDir)) {
26745
+ return cb(new Error(`${option} option must be relative to "${tmpDir}", found "${relativePath}".`));
26746
+ }
26747
+ cb(null, relativePath);
26748
+ });
26711
26749
  }
26712
- function isENOENT(error) {
26713
- return isExpectedError(error, -ENOENT, "ENOENT");
26750
+ function _getRelativePathSync(option, name, tmpDir) {
26751
+ if (_isUndefined(name))
26752
+ return;
26753
+ const resolvedPath = _resolvePathSync(name, tmpDir);
26754
+ const relativePath = path.relative(tmpDir, resolvedPath);
26755
+ if (!resolvedPath.startsWith(tmpDir)) {
26756
+ throw new Error(`${option} option must be relative to "${tmpDir}", found "${relativePath}".`);
26757
+ }
26758
+ return relativePath;
26714
26759
  }
26715
- function isExpectedError(error, code, errno) {
26716
- return error.code == code || error.code == errno;
26760
+ function _assertAndSanitizeOptions(options, cb) {
26761
+ _getTmpDir(options, function(err, tmpDir) {
26762
+ if (err)
26763
+ return cb(err);
26764
+ options.tmpdir = tmpDir;
26765
+ try {
26766
+ _assertOptionsBase(options, tmpDir);
26767
+ } catch (err2) {
26768
+ return cb(err2);
26769
+ }
26770
+ _getRelativePath("dir", options.dir, tmpDir, function(err2, dir2) {
26771
+ if (err2)
26772
+ return cb(err2);
26773
+ options.dir = _isUndefined(dir2) ? "" : dir2;
26774
+ _getRelativePath("template", options.template, tmpDir, function(err3, template) {
26775
+ if (err3)
26776
+ return cb(err3);
26777
+ options.template = template;
26778
+ cb(null, options);
26779
+ });
26780
+ });
26781
+ });
26782
+ }
26783
+ function _assertAndSanitizeOptionsSync(options) {
26784
+ const tmpDir = options.tmpdir = _getTmpDirSync(options);
26785
+ _assertOptionsBase(options, tmpDir);
26786
+ const dir2 = _getRelativePathSync("dir", options.dir, tmpDir);
26787
+ options.dir = _isUndefined(dir2) ? "" : dir2;
26788
+ options.template = _getRelativePathSync("template", options.template, tmpDir);
26789
+ return options;
26790
+ }
26791
+ function _isEBADF(error) {
26792
+ return _isExpectedError(error, -EBADF, "EBADF");
26793
+ }
26794
+ function _isENOENT(error) {
26795
+ return _isExpectedError(error, -ENOENT, "ENOENT");
26796
+ }
26797
+ function _isExpectedError(error, errno, code) {
26798
+ return IS_WIN32 ? error.code === code : error.code === code && error.errno === errno;
26717
26799
  }
26718
26800
  function setGracefulCleanup() {
26719
26801
  _gracefulCleanup = true;
26720
26802
  }
26721
- var version = process.versions.node.split(".").map(function(value) {
26722
- return parseInt(value, 10);
26723
- });
26724
- if (version[0] === 0 && (version[1] < 9 || version[1] === 9 && version[2] < 5)) {
26725
- process.addListener("uncaughtException", function _uncaughtExceptionThrown(err) {
26726
- _uncaughtException = true;
26727
- _garbageCollector();
26728
- throw err;
26729
- });
26803
+ function _getTmpDir(options, cb) {
26804
+ return fs.realpath(options && options.tmpdir || os2.tmpdir(), cb);
26730
26805
  }
26731
- process.addListener("exit", function _exit(code) {
26732
- if (code)
26733
- _uncaughtException = true;
26734
- _garbageCollector();
26806
+ function _getTmpDirSync(options) {
26807
+ return fs.realpathSync(options && options.tmpdir || os2.tmpdir());
26808
+ }
26809
+ process.addListener(EXIT, _garbageCollector);
26810
+ Object.defineProperty(module.exports, "tmpdir", {
26811
+ enumerable: true,
26812
+ configurable: false,
26813
+ get: function() {
26814
+ return _getTmpDirSync();
26815
+ }
26735
26816
  });
26736
- module.exports.tmpdir = tmpDir;
26737
26817
  module.exports.dir = dir;
26738
26818
  module.exports.dirSync = dirSync;
26739
26819
  module.exports.file = file;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Schema,
3
3
  parseWithError
4
- } from "./chunk-TWESYQMI.js";
4
+ } from "./chunk-3YAVQURU.js";
5
5
  import {
6
6
  formatValidationErrors
7
7
  } from "./chunk-7TTNITTD.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  inquirer_default
3
- } from "./chunk-W7POEWP5.js";
3
+ } from "./chunk-OE6G5KKN.js";
4
4
  import {
5
5
  FragmentCommand,
6
6
  require_lib
@@ -2,7 +2,7 @@ import {
2
2
  extractSchemaMetadata,
3
3
  isJsonParseError,
4
4
  validateSchemaStructure
5
- } from "./chunk-UVJK3M2S.js";
5
+ } from "./chunk-V5Q477QX.js";
6
6
  import {
7
7
  DEFAULT_SCHEMA_PATH
8
8
  } from "./chunk-A4BSWX5D.js";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  GenGraphQL
3
- } from "../chunk-MSMCOD4P.js";
3
+ } from "../chunk-HIFGFBQJ.js";
4
4
  import "../chunk-UB2WBI7Z.js";
5
5
  import "../chunk-ODU6I44Y.js";
6
6
  import "../chunk-73ZTML2E.js";
7
- import "../chunk-TWESYQMI.js";
7
+ import "../chunk-3YAVQURU.js";
8
8
  import "../chunk-7TTNITTD.js";
9
9
  import "../chunk-RVULF4NW.js";
10
10
  import "../chunk-O2KL3FKY.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  GetSchema
3
- } from "../chunk-CFMP4SZH.js";
4
- import "../chunk-W7POEWP5.js";
3
+ } from "../chunk-GYNGQ47N.js";
4
+ import "../chunk-OE6G5KKN.js";
5
5
  import "../chunk-K4VSNBUT.js";
6
6
  import "../chunk-7N2Q46HP.js";
7
7
  import "../chunk-A5Y2SV3L.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Login
3
- } from "../chunk-Y3LOFHYD.js";
4
- import "../chunk-W7POEWP5.js";
3
+ } from "../chunk-VEPUYP44.js";
4
+ import "../chunk-OE6G5KKN.js";
5
5
  import "../chunk-A5Y2SV3L.js";
6
6
  import "../chunk-UDU5PBTV.js";
7
7
  import "../chunk-LJSFUVJW.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Update
3
- } from "../chunk-7SEJLCZX.js";
4
- import "../chunk-W7POEWP5.js";
3
+ } from "../chunk-IG3ODKHF.js";
4
+ import "../chunk-OE6G5KKN.js";
5
5
  import "../chunk-A5Y2SV3L.js";
6
6
  import "../chunk-UDU5PBTV.js";
7
7
  import "../chunk-LJSFUVJW.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  VerifySchema
3
- } from "../chunk-KOQHOP64.js";
4
- import "../chunk-UVJK3M2S.js";
3
+ } from "../chunk-XIIPN2KQ.js";
4
+ import "../chunk-V5Q477QX.js";
5
5
  import "../chunk-A4BSWX5D.js";
6
- import "../chunk-TWESYQMI.js";
6
+ import "../chunk-3YAVQURU.js";
7
7
  import "../chunk-7TTNITTD.js";
8
8
  import "../chunk-RVULF4NW.js";
9
9
  import "../chunk-O2KL3FKY.js";
package/dist/commands.js CHANGED
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  COMMANDS
3
- } from "./chunk-GA5QQVMA.js";
3
+ } from "./chunk-HG24VFOK.js";
4
4
  import "./chunk-Q5N327ZF.js";
5
5
  import "./chunk-UGDF44LB.js";
6
6
  import "./chunk-U27VOBWE.js";
7
7
  import "./chunk-OSRUOVMM.js";
8
8
  import "./chunk-2L7DM7UG.js";
9
- import "./chunk-7SEJLCZX.js";
10
- import "./chunk-KOQHOP64.js";
11
- import "./chunk-UVJK3M2S.js";
9
+ import "./chunk-IG3ODKHF.js";
10
+ import "./chunk-XIIPN2KQ.js";
11
+ import "./chunk-V5Q477QX.js";
12
12
  import "./chunk-A4BSWX5D.js";
13
13
  import "./chunk-ZJ6YXWND.js";
14
- import "./chunk-CFMP4SZH.js";
14
+ import "./chunk-GYNGQ47N.js";
15
15
  import "./chunk-SOGMH4XZ.js";
16
- import "./chunk-Y3LOFHYD.js";
17
- import "./chunk-W7POEWP5.js";
16
+ import "./chunk-VEPUYP44.js";
17
+ import "./chunk-OE6G5KKN.js";
18
18
  import "./chunk-PH6CNCD5.js";
19
19
  import "./chunk-OCALLQXO.js";
20
20
  import "./chunk-FYHQKV7S.js";
@@ -28,11 +28,11 @@ import "./chunk-ZDHQAGMI.js";
28
28
  import "./chunk-35TPIT7U.js";
29
29
  import "./chunk-K4VSNBUT.js";
30
30
  import "./chunk-7N2Q46HP.js";
31
- import "./chunk-MSMCOD4P.js";
31
+ import "./chunk-HIFGFBQJ.js";
32
32
  import "./chunk-UB2WBI7Z.js";
33
33
  import "./chunk-ODU6I44Y.js";
34
34
  import "./chunk-73ZTML2E.js";
35
- import "./chunk-TWESYQMI.js";
35
+ import "./chunk-3YAVQURU.js";
36
36
  import "./chunk-7TTNITTD.js";
37
37
  import "./chunk-RVULF4NW.js";
38
38
  import "./chunk-O2KL3FKY.js";
package/dist/index.js CHANGED
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  COMMANDS
3
- } from "./chunk-GA5QQVMA.js";
3
+ } from "./chunk-HG24VFOK.js";
4
4
  import "./chunk-Q5N327ZF.js";
5
5
  import "./chunk-UGDF44LB.js";
6
6
  import "./chunk-U27VOBWE.js";
7
7
  import "./chunk-OSRUOVMM.js";
8
8
  import "./chunk-2L7DM7UG.js";
9
- import "./chunk-7SEJLCZX.js";
10
- import "./chunk-KOQHOP64.js";
11
- import "./chunk-UVJK3M2S.js";
9
+ import "./chunk-IG3ODKHF.js";
10
+ import "./chunk-XIIPN2KQ.js";
11
+ import "./chunk-V5Q477QX.js";
12
12
  import "./chunk-A4BSWX5D.js";
13
13
  import "./chunk-ZJ6YXWND.js";
14
- import "./chunk-CFMP4SZH.js";
14
+ import "./chunk-GYNGQ47N.js";
15
15
  import "./chunk-SOGMH4XZ.js";
16
- import "./chunk-Y3LOFHYD.js";
17
- import "./chunk-W7POEWP5.js";
16
+ import "./chunk-VEPUYP44.js";
17
+ import "./chunk-OE6G5KKN.js";
18
18
  import "./chunk-PH6CNCD5.js";
19
19
  import "./chunk-OCALLQXO.js";
20
20
  import "./chunk-FYHQKV7S.js";
@@ -28,11 +28,11 @@ import "./chunk-ZDHQAGMI.js";
28
28
  import "./chunk-35TPIT7U.js";
29
29
  import "./chunk-K4VSNBUT.js";
30
30
  import "./chunk-7N2Q46HP.js";
31
- import "./chunk-MSMCOD4P.js";
31
+ import "./chunk-HIFGFBQJ.js";
32
32
  import "./chunk-UB2WBI7Z.js";
33
33
  import "./chunk-ODU6I44Y.js";
34
34
  import "./chunk-73ZTML2E.js";
35
- import "./chunk-TWESYQMI.js";
35
+ import "./chunk-3YAVQURU.js";
36
36
  import "./chunk-7TTNITTD.js";
37
37
  import "./chunk-RVULF4NW.js";
38
38
  import "./chunk-O2KL3FKY.js";
@@ -3,8 +3,8 @@ import {
3
3
  extractSchemaMetadata,
4
4
  isJsonParseError,
5
5
  validateSchemaStructure
6
- } from "../chunk-UVJK3M2S.js";
7
- import "../chunk-TWESYQMI.js";
6
+ } from "../chunk-V5Q477QX.js";
7
+ import "../chunk-3YAVQURU.js";
8
8
  import "../chunk-7TTNITTD.js";
9
9
  import "../chunk-RVULF4NW.js";
10
10
  import "../chunk-O2KL3FKY.js";
@@ -973,5 +973,5 @@
973
973
  "help": "Generate GraphQL queries from your Schema for your SDK."
974
974
  }
975
975
  },
976
- "version": "2026.1.19"
976
+ "version": "2026.1.22-1"
977
977
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fragment-dev/cli",
3
- "version": "2026.1.19",
3
+ "version": "2026.1.22-1",
4
4
  "description": "FRAGMENT CLI",
5
5
  "author": "hello@fragment.dev",
6
6
  "bin": {