arri 0.0.5 → 0.0.7

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.
@@ -1,33 +1,33 @@
1
1
  'use strict';
2
2
 
3
- const index = require('../shared/arri.e2731572.cjs');
4
- const module$1 = require('module');
5
- const url = require('url');
6
- const path6 = require('path');
3
+ const require$$2 = require('module');
4
+ const require$$7 = require('url');
5
+ const require$$0 = require('path');
7
6
  const process4 = require('process');
8
- const os = require('os');
7
+ const require$$0$2 = require('os');
9
8
  const tty = require('tty');
10
9
  const fs$1 = require('fs');
11
10
  const assert4 = require('assert');
12
11
  const fs = require('fs/promises');
13
12
  const v8 = require('v8');
14
- const util = require('util');
15
- const child_process = require('child_process');
13
+ const require$$0$1 = require('util');
14
+ const index = require('./arri.8e602d87.cjs');
15
+ const require$$1 = require('child_process');
16
16
 
17
17
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
18
18
 
19
- const path6__default = /*#__PURE__*/_interopDefaultCompat(path6);
19
+ const require$$0__default = /*#__PURE__*/_interopDefaultCompat(require$$0);
20
20
  const process4__default = /*#__PURE__*/_interopDefaultCompat(process4);
21
- const os__default = /*#__PURE__*/_interopDefaultCompat(os);
21
+ const require$$0__default$1 = /*#__PURE__*/_interopDefaultCompat(require$$0$2);
22
22
  const tty__default = /*#__PURE__*/_interopDefaultCompat(tty);
23
23
  const fs__default$1 = /*#__PURE__*/_interopDefaultCompat(fs$1);
24
24
  const assert4__default = /*#__PURE__*/_interopDefaultCompat(assert4);
25
25
  const fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
26
26
  const v8__default = /*#__PURE__*/_interopDefaultCompat(v8);
27
27
 
28
- const require$2 = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (document.currentScript && document.currentScript.src || new URL('codegen/index.cjs', document.baseURI).href)));
29
- const __filename$2 = url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (document.currentScript && document.currentScript.src || new URL('codegen/index.cjs', document.baseURI).href)));
30
- const __dirname$1 = path6.dirname(__filename$2);
28
+ const require$2 = require$$2.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (document.currentScript && document.currentScript.src || new URL('shared/arri.835c5c3c.cjs', document.baseURI).href)));
29
+ const __filename$2 = require$$7.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (document.currentScript && document.currentScript.src || new URL('shared/arri.835c5c3c.cjs', document.baseURI).href)));
30
+ const __dirname$1 = require$$0.dirname(__filename$2);
31
31
 
32
32
  var __create$1 = Object.create;
33
33
  var __defProp$2 = Object.defineProperty;
@@ -7791,9 +7791,9 @@ const doc = {
7791
7791
  utils: utils
7792
7792
  };
7793
7793
 
7794
- const require$1 = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (document.currentScript && document.currentScript.src || new URL('codegen/index.cjs', document.baseURI).href)));
7795
- const __filename$1 = url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (document.currentScript && document.currentScript.src || new URL('codegen/index.cjs', document.baseURI).href)));
7796
- path6.dirname(__filename$1);
7794
+ const require$1 = require$$2.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (document.currentScript && document.currentScript.src || new URL('shared/arri.835c5c3c.cjs', document.baseURI).href)));
7795
+ const __filename$1 = require$$7.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (document.currentScript && document.currentScript.src || new URL('shared/arri.835c5c3c.cjs', document.baseURI).href)));
7796
+ require$$0.dirname(__filename$1);
7797
7797
 
7798
7798
  var __create = Object.create;
7799
7799
  var __defProp = Object.defineProperty;
@@ -21416,7 +21416,7 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
21416
21416
  return min;
21417
21417
  }
21418
21418
  if (process4__default.platform === "win32") {
21419
- const osRelease = os__default.release().split(".");
21419
+ const osRelease = require$$0__default$1.release().split(".");
21420
21420
  if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
21421
21421
  return Number(osRelease[2]) >= 14931 ? 3 : 2;
21422
21422
  }
@@ -26012,10 +26012,10 @@ var partition_default = partition2;
26012
26012
  var import_editorconfig = __toESM(require_src(), 1);
26013
26013
  var import_editorconfig_to_prettier = __toESM(require_editorconfig_to_prettier(), 1);
26014
26014
  var MARKERS = [".git", ".hg"];
26015
- var markerExists = (directory) => MARKERS.some((mark) => fs__default$1.existsSync(path6__default.join(directory, mark)));
26015
+ var markerExists = (directory) => MARKERS.some((mark) => fs__default$1.existsSync(require$$0__default.join(directory, mark)));
26016
26016
  function findProjectRoot(directory) {
26017
26017
  while (!markerExists(directory)) {
26018
- const parentDirectory = path6__default.resolve(directory, "..");
26018
+ const parentDirectory = require$$0__default.resolve(directory, "..");
26019
26019
  if (parentDirectory === directory) {
26020
26020
  break;
26021
26021
  }
@@ -26028,7 +26028,7 @@ var find_project_root_default = findProjectRoot;
26028
26028
  // src/config/resolve-editorconfig.js
26029
26029
  async function loadEditorConfig(filePath) {
26030
26030
  const editorConfig = await import_editorconfig.default.parse(filePath, {
26031
- root: find_project_root_default(path6__default.dirname(path6__default.resolve(filePath)))
26031
+ root: find_project_root_default(require$$0__default.dirname(require$$0__default.resolve(filePath)))
26032
26032
  });
26033
26033
  const config = (0, import_editorconfig_to_prettier.default)(editorConfig);
26034
26034
  if (config) {
@@ -26042,7 +26042,7 @@ var resolve_editorconfig_default = loadEditorConfig;
26042
26042
  var import_parse_async = __toESM(require_parse_async(), 1);
26043
26043
  var import_parse3 = __toESM(require_parse3(), 1);
26044
26044
  function requireFromFile(id, parent) {
26045
- const require2 = module$1.createRequire(parent);
26045
+ const require2 = require$$2.createRequire(parent);
26046
26046
  return require2(id);
26047
26047
  }
26048
26048
  var require_from_file_default = requireFromFile;
@@ -26254,7 +26254,7 @@ codes.ERR_INVALID_ARG_VALUE = createError(
26254
26254
  * @param {string} [reason='is invalid']
26255
26255
  */
26256
26256
  (name, value, reason = "is invalid") => {
26257
- let inspected = util.inspect(value);
26257
+ let inspected = require$$0$1.inspect(value);
26258
26258
  if (inspected.length > 128) {
26259
26259
  inspected = `${inspected.slice(0, 128)}...`;
26260
26260
  }
@@ -26379,7 +26379,7 @@ function getMessage(key, args, self) {
26379
26379
  if (args.length === 0)
26380
26380
  return message;
26381
26381
  args.unshift(message);
26382
- return Reflect.apply(util.format, null, args);
26382
+ return Reflect.apply(require$$0$1.format, null, args);
26383
26383
  }
26384
26384
  function determineSpecificType(value) {
26385
26385
  if (value === null || value === void 0) {
@@ -26392,9 +26392,9 @@ function determineSpecificType(value) {
26392
26392
  if (value.constructor && value.constructor.name) {
26393
26393
  return `an instance of ${value.constructor.name}`;
26394
26394
  }
26395
- return `${util.inspect(value, { depth: -1 })}`;
26395
+ return `${require$$0$1.inspect(value, { depth: -1 })}`;
26396
26396
  }
26397
- let inspected = util.inspect(value, { colors: false });
26397
+ let inspected = require$$0$1.inspect(value, { colors: false });
26398
26398
  if (inspected.length > 28) {
26399
26399
  inspected = `${inspected.slice(0, 25)}...`;
26400
26400
  }
@@ -26405,7 +26405,7 @@ var package_json_reader_default = reader;
26405
26405
  function read(jsonPath) {
26406
26406
  try {
26407
26407
  const string = fs__default$1.readFileSync(
26408
- path6__default.toNamespacedPath(path6__default.join(path6__default.dirname(jsonPath), "package.json")),
26408
+ require$$0__default.toNamespacedPath(require$$0__default.join(require$$0__default.dirname(jsonPath), "package.json")),
26409
26409
  "utf8"
26410
26410
  );
26411
26411
  return { string };
@@ -26453,7 +26453,7 @@ function getPackageConfig(path9, specifier, base) {
26453
26453
  );
26454
26454
  throw new ERR_INVALID_PACKAGE_CONFIG(
26455
26455
  path9,
26456
- (base ? `"${specifier}" from ` : "") + url.fileURLToPath(base || specifier),
26456
+ (base ? `"${specifier}" from ` : "") + require$$7.fileURLToPath(base || specifier),
26457
26457
  exception.message
26458
26458
  );
26459
26459
  }
@@ -26473,23 +26473,23 @@ function getPackageConfig(path9, specifier, base) {
26473
26473
  return packageConfig;
26474
26474
  }
26475
26475
  function getPackageScopeConfig(resolved) {
26476
- let packageJsonUrl = new url.URL("package.json", resolved);
26476
+ let packageJsonUrl = new require$$7.URL("package.json", resolved);
26477
26477
  while (true) {
26478
26478
  const packageJsonPath2 = packageJsonUrl.pathname;
26479
26479
  if (packageJsonPath2.endsWith("node_modules/package.json"))
26480
26480
  break;
26481
26481
  const packageConfig2 = getPackageConfig(
26482
- url.fileURLToPath(packageJsonUrl),
26482
+ require$$7.fileURLToPath(packageJsonUrl),
26483
26483
  resolved
26484
26484
  );
26485
26485
  if (packageConfig2.exists)
26486
26486
  return packageConfig2;
26487
26487
  const lastPackageJsonUrl = packageJsonUrl;
26488
- packageJsonUrl = new url.URL("../package.json", packageJsonUrl);
26488
+ packageJsonUrl = new require$$7.URL("../package.json", packageJsonUrl);
26489
26489
  if (packageJsonUrl.pathname === lastPackageJsonUrl.pathname)
26490
26490
  break;
26491
26491
  }
26492
- const packageJsonPath = url.fileURLToPath(packageJsonUrl);
26492
+ const packageJsonPath = require$$7.fileURLToPath(packageJsonUrl);
26493
26493
  const packageConfig = {
26494
26494
  pjsonPath: packageJsonPath,
26495
26495
  exists: false,
@@ -26558,10 +26558,10 @@ function extname(url) {
26558
26558
  }
26559
26559
  return "";
26560
26560
  }
26561
- function getFileProtocolModuleFormat(url$1, _context, ignoreErrors) {
26562
- const ext = extname(url$1);
26561
+ function getFileProtocolModuleFormat(url, _context, ignoreErrors) {
26562
+ const ext = extname(url);
26563
26563
  if (ext === ".js") {
26564
- return getPackageType(url$1) === "module" ? "module" : "commonjs";
26564
+ return getPackageType(url) === "module" ? "module" : "commonjs";
26565
26565
  }
26566
26566
  const format3 = extensionFormatMap[ext];
26567
26567
  if (format3)
@@ -26569,7 +26569,7 @@ function getFileProtocolModuleFormat(url$1, _context, ignoreErrors) {
26569
26569
  if (ignoreErrors) {
26570
26570
  return void 0;
26571
26571
  }
26572
- const filepath = url.fileURLToPath(url$1);
26572
+ const filepath = require$$7.fileURLToPath(url);
26573
26573
  throw new ERR_UNKNOWN_FILE_EXTENSION(ext, filepath);
26574
26574
  }
26575
26575
  function getHttpProtocolModuleFormat() {
@@ -26628,21 +26628,21 @@ var encodedSepRegEx = /%2f|%5c/i;
26628
26628
  var emittedPackageWarnings = /* @__PURE__ */ new Set();
26629
26629
  var doubleSlashRegEx = /[/\\]{2}/;
26630
26630
  function emitInvalidSegmentDeprecation(target, request, match, packageJsonUrl, internal, base, isTarget) {
26631
- const pjsonPath = url.fileURLToPath(packageJsonUrl);
26631
+ const pjsonPath = require$$7.fileURLToPath(packageJsonUrl);
26632
26632
  const double = doubleSlashRegEx.exec(isTarget ? target : request) !== null;
26633
26633
  process4__default.emitWarning(
26634
- `Use of deprecated ${double ? "double slash" : "leading or trailing slash matching"} resolving "${target}" for module request "${request}" ${request === match ? "" : `matched to "${match}" `}in the "${internal ? "imports" : "exports"}" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${url.fileURLToPath(base)}` : ""}.`,
26634
+ `Use of deprecated ${double ? "double slash" : "leading or trailing slash matching"} resolving "${target}" for module request "${request}" ${request === match ? "" : `matched to "${match}" `}in the "${internal ? "imports" : "exports"}" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${require$$7.fileURLToPath(base)}` : ""}.`,
26635
26635
  "DeprecationWarning",
26636
26636
  "DEP0166"
26637
26637
  );
26638
26638
  }
26639
- function emitLegacyIndexDeprecation(url$1, packageJsonUrl, base, main) {
26640
- const format3 = defaultGetFormatWithoutErrors(url$1, { parentURL: base.href });
26639
+ function emitLegacyIndexDeprecation(url, packageJsonUrl, base, main) {
26640
+ const format3 = defaultGetFormatWithoutErrors(url, { parentURL: base.href });
26641
26641
  if (format3 !== "module")
26642
26642
  return;
26643
- const path9 = url.fileURLToPath(url$1.href);
26644
- const pkgPath = url.fileURLToPath(new url.URL(".", packageJsonUrl));
26645
- const basePath = url.fileURLToPath(base);
26643
+ const path9 = require$$7.fileURLToPath(url.href);
26644
+ const pkgPath = require$$7.fileURLToPath(new require$$7.URL(".", packageJsonUrl));
26645
+ const basePath = require$$7.fileURLToPath(base);
26646
26646
  if (main)
26647
26647
  process4__default.emitWarning(
26648
26648
  `Package ${pkgPath} has a "main" field set to ${JSON.stringify(main)}, excluding the full filename and extension to the resolved file at "${path9.slice(
@@ -26677,7 +26677,7 @@ function fileExists(url) {
26677
26677
  function legacyMainResolve(packageJsonUrl, packageConfig, base) {
26678
26678
  let guess;
26679
26679
  if (packageConfig.main !== void 0) {
26680
- guess = new url.URL(packageConfig.main, packageJsonUrl);
26680
+ guess = new require$$7.URL(packageConfig.main, packageJsonUrl);
26681
26681
  if (fileExists(guess))
26682
26682
  return guess;
26683
26683
  const tries2 = [
@@ -26690,7 +26690,7 @@ function legacyMainResolve(packageJsonUrl, packageConfig, base) {
26690
26690
  ];
26691
26691
  let i2 = -1;
26692
26692
  while (++i2 < tries2.length) {
26693
- guess = new url.URL(tries2[i2], packageJsonUrl);
26693
+ guess = new require$$7.URL(tries2[i2], packageJsonUrl);
26694
26694
  if (fileExists(guess))
26695
26695
  break;
26696
26696
  guess = void 0;
@@ -26708,7 +26708,7 @@ function legacyMainResolve(packageJsonUrl, packageConfig, base) {
26708
26708
  const tries = ["./index.js", "./index.json", "./index.node"];
26709
26709
  let i = -1;
26710
26710
  while (++i < tries.length) {
26711
- guess = new url.URL(tries[i], packageJsonUrl);
26711
+ guess = new require$$7.URL(tries[i], packageJsonUrl);
26712
26712
  if (fileExists(guess))
26713
26713
  break;
26714
26714
  guess = void 0;
@@ -26718,8 +26718,8 @@ function legacyMainResolve(packageJsonUrl, packageConfig, base) {
26718
26718
  return guess;
26719
26719
  }
26720
26720
  throw new ERR_MODULE_NOT_FOUND(
26721
- url.fileURLToPath(new url.URL(".", packageJsonUrl)),
26722
- url.fileURLToPath(base)
26721
+ require$$7.fileURLToPath(new require$$7.URL(".", packageJsonUrl)),
26722
+ require$$7.fileURLToPath(base)
26723
26723
  );
26724
26724
  }
26725
26725
  function finalizeResolution(resolved, base, preserveSymlinks) {
@@ -26727,28 +26727,28 @@ function finalizeResolution(resolved, base, preserveSymlinks) {
26727
26727
  throw new ERR_INVALID_MODULE_SPECIFIER(
26728
26728
  resolved.pathname,
26729
26729
  'must not include encoded "/" or "\\" characters',
26730
- url.fileURLToPath(base)
26730
+ require$$7.fileURLToPath(base)
26731
26731
  );
26732
- const filePath = url.fileURLToPath(resolved);
26732
+ const filePath = require$$7.fileURLToPath(resolved);
26733
26733
  const stats = tryStatSync(
26734
26734
  filePath.endsWith("/") ? filePath.slice(-1) : filePath
26735
26735
  );
26736
26736
  if (stats.isDirectory()) {
26737
- const error = new ERR_UNSUPPORTED_DIR_IMPORT(filePath, url.fileURLToPath(base));
26737
+ const error = new ERR_UNSUPPORTED_DIR_IMPORT(filePath, require$$7.fileURLToPath(base));
26738
26738
  error.url = String(resolved);
26739
26739
  throw error;
26740
26740
  }
26741
26741
  if (!stats.isFile()) {
26742
26742
  throw new ERR_MODULE_NOT_FOUND(
26743
26743
  filePath || resolved.pathname,
26744
- base && url.fileURLToPath(base),
26744
+ base && require$$7.fileURLToPath(base),
26745
26745
  "module"
26746
26746
  );
26747
26747
  }
26748
26748
  if (!preserveSymlinks) {
26749
26749
  const real = fs$1.realpathSync(filePath);
26750
26750
  const { search, hash } = resolved;
26751
- resolved = url.pathToFileURL(real + (filePath.endsWith(path6__default.sep) ? "/" : ""));
26751
+ resolved = require$$7.pathToFileURL(real + (filePath.endsWith(require$$0__default.sep) ? "/" : ""));
26752
26752
  resolved.search = search;
26753
26753
  resolved.hash = hash;
26754
26754
  }
@@ -26757,33 +26757,33 @@ function finalizeResolution(resolved, base, preserveSymlinks) {
26757
26757
  function importNotDefined(specifier, packageJsonUrl, base) {
26758
26758
  return new ERR_PACKAGE_IMPORT_NOT_DEFINED(
26759
26759
  specifier,
26760
- packageJsonUrl && url.fileURLToPath(new url.URL(".", packageJsonUrl)),
26761
- url.fileURLToPath(base)
26760
+ packageJsonUrl && require$$7.fileURLToPath(new require$$7.URL(".", packageJsonUrl)),
26761
+ require$$7.fileURLToPath(base)
26762
26762
  );
26763
26763
  }
26764
26764
  function exportsNotFound(subpath, packageJsonUrl, base) {
26765
26765
  return new ERR_PACKAGE_PATH_NOT_EXPORTED(
26766
- url.fileURLToPath(new url.URL(".", packageJsonUrl)),
26766
+ require$$7.fileURLToPath(new require$$7.URL(".", packageJsonUrl)),
26767
26767
  subpath,
26768
- base && url.fileURLToPath(base)
26768
+ base && require$$7.fileURLToPath(base)
26769
26769
  );
26770
26770
  }
26771
26771
  function throwInvalidSubpath(request, match, packageJsonUrl, internal, base) {
26772
- const reason = `request is not a valid match in pattern "${match}" for the "${internal ? "imports" : "exports"}" resolution of ${url.fileURLToPath(packageJsonUrl)}`;
26772
+ const reason = `request is not a valid match in pattern "${match}" for the "${internal ? "imports" : "exports"}" resolution of ${require$$7.fileURLToPath(packageJsonUrl)}`;
26773
26773
  throw new ERR_INVALID_MODULE_SPECIFIER(
26774
26774
  request,
26775
26775
  reason,
26776
- base && url.fileURLToPath(base)
26776
+ base && require$$7.fileURLToPath(base)
26777
26777
  );
26778
26778
  }
26779
26779
  function invalidPackageTarget(subpath, target, packageJsonUrl, internal, base) {
26780
26780
  target = typeof target === "object" && target !== null ? JSON.stringify(target, null, "") : `${target}`;
26781
26781
  return new ERR_INVALID_PACKAGE_TARGET(
26782
- url.fileURLToPath(new url.URL(".", packageJsonUrl)),
26782
+ require$$7.fileURLToPath(new require$$7.URL(".", packageJsonUrl)),
26783
26783
  subpath,
26784
26784
  target,
26785
26785
  internal,
26786
- base && url.fileURLToPath(base)
26786
+ base && require$$7.fileURLToPath(base)
26787
26787
  );
26788
26788
  }
26789
26789
  function resolvePackageTargetString(target, subpath, match, packageJsonUrl, base, pattern, internal, isPathMap, conditions) {
@@ -26793,7 +26793,7 @@ function resolvePackageTargetString(target, subpath, match, packageJsonUrl, base
26793
26793
  if (internal && !target.startsWith("../") && !target.startsWith("/")) {
26794
26794
  let isURL2 = false;
26795
26795
  try {
26796
- new url.URL(target);
26796
+ new require$$7.URL(target);
26797
26797
  isURL2 = true;
26798
26798
  } catch {
26799
26799
  }
@@ -26831,9 +26831,9 @@ function resolvePackageTargetString(target, subpath, match, packageJsonUrl, base
26831
26831
  throw invalidPackageTarget(match, target, packageJsonUrl, internal, base);
26832
26832
  }
26833
26833
  }
26834
- const resolved = new url.URL(target, packageJsonUrl);
26834
+ const resolved = new require$$7.URL(target, packageJsonUrl);
26835
26835
  const resolvedPath = resolved.pathname;
26836
- const packagePath = new url.URL(".", packageJsonUrl).pathname;
26836
+ const packagePath = new require$$7.URL(".", packageJsonUrl).pathname;
26837
26837
  if (!resolvedPath.startsWith(packagePath))
26838
26838
  throw invalidPackageTarget(match, target, packageJsonUrl, internal, base);
26839
26839
  if (subpath === "")
@@ -26862,7 +26862,7 @@ function resolvePackageTargetString(target, subpath, match, packageJsonUrl, base
26862
26862
  }
26863
26863
  }
26864
26864
  if (pattern) {
26865
- return new url.URL(
26865
+ return new require$$7.URL(
26866
26866
  RegExpPrototypeSymbolReplace.call(
26867
26867
  patternRegEx,
26868
26868
  resolved.href,
@@ -26870,7 +26870,7 @@ function resolvePackageTargetString(target, subpath, match, packageJsonUrl, base
26870
26870
  )
26871
26871
  );
26872
26872
  }
26873
- return new url.URL(subpath, resolved);
26873
+ return new require$$7.URL(subpath, resolved);
26874
26874
  }
26875
26875
  function isArrayIndex(key) {
26876
26876
  const keyNumber = Number(key);
@@ -26943,7 +26943,7 @@ function resolvePackageTarget(packageJsonUrl, target, subpath, packageSubpath, b
26943
26943
  const key = keys[i];
26944
26944
  if (isArrayIndex(key)) {
26945
26945
  throw new ERR_INVALID_PACKAGE_CONFIG2(
26946
- url.fileURLToPath(packageJsonUrl),
26946
+ require$$7.fileURLToPath(packageJsonUrl),
26947
26947
  base,
26948
26948
  '"exports" cannot contain numeric property keys.'
26949
26949
  );
@@ -27002,7 +27002,7 @@ function isConditionalExportsMainSugar(exports, packageJsonUrl, base) {
27002
27002
  isConditionalSugar = curIsConditionalSugar;
27003
27003
  } else if (isConditionalSugar !== curIsConditionalSugar) {
27004
27004
  throw new ERR_INVALID_PACKAGE_CONFIG2(
27005
- url.fileURLToPath(packageJsonUrl),
27005
+ require$$7.fileURLToPath(packageJsonUrl),
27006
27006
  base,
27007
27007
  `"exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.`
27008
27008
  );
@@ -27011,12 +27011,12 @@ function isConditionalExportsMainSugar(exports, packageJsonUrl, base) {
27011
27011
  return isConditionalSugar;
27012
27012
  }
27013
27013
  function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) {
27014
- const pjsonPath = url.fileURLToPath(pjsonUrl);
27014
+ const pjsonPath = require$$7.fileURLToPath(pjsonUrl);
27015
27015
  if (emittedPackageWarnings.has(pjsonPath + "|" + match))
27016
27016
  return;
27017
27017
  emittedPackageWarnings.add(pjsonPath + "|" + match);
27018
27018
  process4__default.emitWarning(
27019
- `Use of deprecated trailing slash pattern mapping "${match}" in the "exports" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${url.fileURLToPath(base)}` : ""}. Mapping specifiers ending in "/" is no longer supported.`,
27019
+ `Use of deprecated trailing slash pattern mapping "${match}" in the "exports" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${require$$7.fileURLToPath(base)}` : ""}. Mapping specifiers ending in "/" is no longer supported.`,
27020
27020
  "DeprecationWarning",
27021
27021
  "DEP0155"
27022
27022
  );
@@ -27114,12 +27114,12 @@ function patternKeyCompare(a, b) {
27114
27114
  function packageImportsResolve(name, base, conditions) {
27115
27115
  if (name === "#" || name.startsWith("#/") || name.endsWith("/")) {
27116
27116
  const reason = "is not a valid internal imports specifier name";
27117
- throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, url.fileURLToPath(base));
27117
+ throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, require$$7.fileURLToPath(base));
27118
27118
  }
27119
27119
  let packageJsonUrl;
27120
27120
  const packageConfig = getPackageScopeConfig(base);
27121
27121
  if (packageConfig.exists) {
27122
- packageJsonUrl = url.pathToFileURL(packageConfig.pjsonPath);
27122
+ packageJsonUrl = require$$7.pathToFileURL(packageConfig.pjsonPath);
27123
27123
  const imports = packageConfig.imports;
27124
27124
  if (imports) {
27125
27125
  if (own2.call(imports, name) && !name.includes("*")) {
@@ -27198,15 +27198,15 @@ function parsePackageName(specifier, base) {
27198
27198
  throw new ERR_INVALID_MODULE_SPECIFIER(
27199
27199
  specifier,
27200
27200
  "is not a valid package name",
27201
- url.fileURLToPath(base)
27201
+ require$$7.fileURLToPath(base)
27202
27202
  );
27203
27203
  }
27204
27204
  const packageSubpath = "." + (separatorIndex === -1 ? "" : specifier.slice(separatorIndex));
27205
27205
  return { packageName, packageSubpath, isScoped };
27206
27206
  }
27207
27207
  function packageResolve(specifier, base, conditions) {
27208
- if (module$1.builtinModules.includes(specifier)) {
27209
- return new url.URL("node:" + specifier);
27208
+ if (require$$2.builtinModules.includes(specifier)) {
27209
+ return new require$$7.URL("node:" + specifier);
27210
27210
  }
27211
27211
  const { packageName, packageSubpath, isScoped } = parsePackageName(
27212
27212
  specifier,
@@ -27214,7 +27214,7 @@ function packageResolve(specifier, base, conditions) {
27214
27214
  );
27215
27215
  const packageConfig = getPackageScopeConfig(base);
27216
27216
  if (packageConfig.exists) {
27217
- const packageJsonUrl2 = url.pathToFileURL(packageConfig.pjsonPath);
27217
+ const packageJsonUrl2 = require$$7.pathToFileURL(packageConfig.pjsonPath);
27218
27218
  if (packageConfig.name === packageName && packageConfig.exports !== void 0 && packageConfig.exports !== null) {
27219
27219
  return packageExportsResolve(
27220
27220
  packageJsonUrl2,
@@ -27225,21 +27225,21 @@ function packageResolve(specifier, base, conditions) {
27225
27225
  );
27226
27226
  }
27227
27227
  }
27228
- let packageJsonUrl = new url.URL(
27228
+ let packageJsonUrl = new require$$7.URL(
27229
27229
  "./node_modules/" + packageName + "/package.json",
27230
27230
  base
27231
27231
  );
27232
- let packageJsonPath = url.fileURLToPath(packageJsonUrl);
27232
+ let packageJsonPath = require$$7.fileURLToPath(packageJsonUrl);
27233
27233
  let lastPath;
27234
27234
  do {
27235
27235
  const stat = tryStatSync(packageJsonPath.slice(0, -13));
27236
27236
  if (!stat.isDirectory()) {
27237
27237
  lastPath = packageJsonPath;
27238
- packageJsonUrl = new url.URL(
27238
+ packageJsonUrl = new require$$7.URL(
27239
27239
  (isScoped ? "../../../../node_modules/" : "../../../node_modules/") + packageName + "/package.json",
27240
27240
  packageJsonUrl
27241
27241
  );
27242
- packageJsonPath = url.fileURLToPath(packageJsonUrl);
27242
+ packageJsonPath = require$$7.fileURLToPath(packageJsonUrl);
27243
27243
  continue;
27244
27244
  }
27245
27245
  const packageConfig2 = getPackageConfig(packageJsonPath, specifier, base);
@@ -27255,9 +27255,9 @@ function packageResolve(specifier, base, conditions) {
27255
27255
  if (packageSubpath === ".") {
27256
27256
  return legacyMainResolve(packageJsonUrl, packageConfig2, base);
27257
27257
  }
27258
- return new url.URL(packageSubpath, packageJsonUrl);
27258
+ return new require$$7.URL(packageSubpath, packageJsonUrl);
27259
27259
  } while (packageJsonPath.length !== lastPath.length);
27260
- throw new ERR_MODULE_NOT_FOUND(packageName, url.fileURLToPath(base));
27260
+ throw new ERR_MODULE_NOT_FOUND(packageName, require$$7.fileURLToPath(base));
27261
27261
  }
27262
27262
  function isRelativeSpecifier(specifier) {
27263
27263
  if (specifier[0] === ".") {
@@ -27281,12 +27281,12 @@ function moduleResolve(specifier, base, conditions, preserveSymlinks) {
27281
27281
  const isRemote = protocol === "http:" || protocol === "https:";
27282
27282
  let resolved;
27283
27283
  if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) {
27284
- resolved = new url.URL(specifier, base);
27284
+ resolved = new require$$7.URL(specifier, base);
27285
27285
  } else if (!isRemote && specifier[0] === "#") {
27286
27286
  resolved = packageImportsResolve(specifier, base, conditions);
27287
27287
  } else {
27288
27288
  try {
27289
- resolved = new url.URL(specifier);
27289
+ resolved = new require$$7.URL(specifier);
27290
27290
  } catch {
27291
27291
  if (!isRemote) {
27292
27292
  resolved = packageResolve(specifier, base, conditions);
@@ -27314,7 +27314,7 @@ function checkIfDisallowedImport(specifier, parsed, parsedParentURL) {
27314
27314
  }
27315
27315
  return { url: (parsed == null ? void 0 : parsed.href) || "" };
27316
27316
  }
27317
- if (module$1.builtinModules.includes(specifier)) {
27317
+ if (require$$2.builtinModules.includes(specifier)) {
27318
27318
  throw new ERR_NETWORK_IMPORT_DISALLOWED(
27319
27319
  specifier,
27320
27320
  parsedParentURL,
@@ -27370,13 +27370,13 @@ function defaultResolve(specifier, context = {}) {
27370
27370
  let parsedParentURL;
27371
27371
  if (parentURL) {
27372
27372
  try {
27373
- parsedParentURL = new url.URL(parentURL);
27373
+ parsedParentURL = new require$$7.URL(parentURL);
27374
27374
  } catch {
27375
27375
  }
27376
27376
  }
27377
27377
  let parsed;
27378
27378
  try {
27379
- parsed = shouldBeTreatedAsRelativeOrAbsolutePath(specifier) ? new url.URL(specifier, parsedParentURL) : new url.URL(specifier);
27379
+ parsed = shouldBeTreatedAsRelativeOrAbsolutePath(specifier) ? new require$$7.URL(specifier, parsedParentURL) : new require$$7.URL(specifier);
27380
27380
  const protocol = parsed.protocol;
27381
27381
  if (protocol === "data:" || experimentalNetworkImports && (protocol === "https:" || protocol === "http:")) {
27382
27382
  return { url: parsed.href, format: null };
@@ -27394,13 +27394,13 @@ function defaultResolve(specifier, context = {}) {
27394
27394
  return { url: specifier };
27395
27395
  throwIfUnsupportedURLScheme(parsed, experimentalNetworkImports);
27396
27396
  const conditions = getConditionsSet(context.conditions);
27397
- const url$1 = moduleResolve(specifier, new url.URL(parentURL), conditions, false);
27398
- throwIfUnsupportedURLProtocol(url$1);
27397
+ const url = moduleResolve(specifier, new require$$7.URL(parentURL), conditions, false);
27398
+ throwIfUnsupportedURLProtocol(url);
27399
27399
  return {
27400
27400
  // Do NOT cast `url` to a string: that will work even when there are real
27401
27401
  // problems, silencing them
27402
- url: url$1.href,
27403
- format: defaultGetFormatWithoutErrors(url$1, { parentURL })
27402
+ url: url.href,
27403
+ format: defaultGetFormatWithoutErrors(url, { parentURL })
27404
27404
  };
27405
27405
  }
27406
27406
 
@@ -27427,8 +27427,8 @@ function resolve(specifier, parent) {
27427
27427
 
27428
27428
  // src/utils/import-from-file.js
27429
27429
  function importFromFile(specifier, parent) {
27430
- const url$1 = resolve(specifier, url.pathToFileURL(parent).href);
27431
- return import(url$1);
27430
+ const url = resolve(specifier, require$$7.pathToFileURL(parent).href);
27431
+ return import(url);
27432
27432
  }
27433
27433
  var import_from_file_default = importFromFile;
27434
27434
 
@@ -27547,7 +27547,7 @@ async function resolveConfig(filePath, options8) {
27547
27547
  };
27548
27548
  if (Array.isArray(merged.plugins)) {
27549
27549
  merged.plugins = merged.plugins.map(
27550
- (value) => typeof value === "string" && value.startsWith(".") ? path6__default.resolve(path6__default.dirname(result.filepath), value) : value
27550
+ (value) => typeof value === "string" && value.startsWith(".") ? require$$0__default.resolve(require$$0__default.dirname(result.filepath), value) : value
27551
27551
  );
27552
27552
  }
27553
27553
  return merged;
@@ -27561,7 +27561,7 @@ function mergeOverrides(configResult, filePath) {
27561
27561
  const { config, filepath: configPath } = configResult || {};
27562
27562
  const { overrides, ...options8 } = config || {};
27563
27563
  if (filePath && overrides) {
27564
- const relativeFilePath = path6__default.relative(path6__default.dirname(configPath), filePath);
27564
+ const relativeFilePath = require$$0__default.relative(require$$0__default.dirname(configPath), filePath);
27565
27565
  for (const override of overrides) {
27566
27566
  if (pathMatchesGlobs(
27567
27567
  relativeFilePath,
@@ -27607,7 +27607,7 @@ var read_file_default = readFile;
27607
27607
 
27608
27608
  // src/utils/ignore.js
27609
27609
  var createIgnore = import_ignore.default.default;
27610
- var slash = path6__default.sep === "\\" ? (filepath) => string_replace_all_default(
27610
+ var slash = require$$0__default.sep === "\\" ? (filepath) => string_replace_all_default(
27611
27611
  /* isOptionalObject*/
27612
27612
  false,
27613
27613
  filepath,
@@ -27629,8 +27629,8 @@ async function createSingleIsIgnoredFunction(ignoreFilePath, withNodeModules) {
27629
27629
  allowRelativePaths: true
27630
27630
  }).add(content);
27631
27631
  return (filepath) => {
27632
- filepath = path6__default.resolve(filepath);
27633
- const relativePath = ignoreFilePath ? path6__default.relative(path6__default.dirname(ignoreFilePath), filepath) : path6__default.relative(process.cwd(), filepath);
27632
+ filepath = require$$0__default.resolve(filepath);
27633
+ const relativePath = ignoreFilePath ? require$$0__default.relative(require$$0__default.dirname(ignoreFilePath), filepath) : require$$0__default.relative(process.cwd(), filepath);
27634
27634
  return ignore.ignores(slash(relativePath));
27635
27635
  };
27636
27636
  }
@@ -27680,7 +27680,7 @@ async function getParser(filePath, options8) {
27680
27680
  }
27681
27681
  var get_file_info_default = getFileInfo;
27682
27682
  function importFromDirectory(specifier, directory) {
27683
- return import_from_file_default(specifier, path6__default.join(directory, "noop.js"));
27683
+ return import_from_file_default(specifier, require$$0__default.join(directory, "noop.js"));
27684
27684
  }
27685
27685
  var import_from_directory_default = importFromDirectory;
27686
27686
 
@@ -27695,7 +27695,7 @@ var loadPluginFromDirectory = mem(
27695
27695
  );
27696
27696
  var importPlugin = mem(async (name) => {
27697
27697
  try {
27698
- return await import(url.pathToFileURL(path6__default.resolve(name)).href);
27698
+ return await import(require$$7.pathToFileURL(require$$0__default.resolve(name)).href);
27699
27699
  } catch {
27700
27700
  return import_from_directory_default(name, process.cwd());
27701
27701
  }
@@ -29046,211 +29046,6 @@ function defineClientGeneratorPlugin(plugin) {
29046
29046
  return plugin;
29047
29047
  }
29048
29048
 
29049
- let createdModels = [];
29050
- const typescriptClientGenerator = defineClientGeneratorPlugin(
29051
- (options) => ({
29052
- generator: async (def) => {
29053
- if (!options.name) {
29054
- throw new Error("Name is requires");
29055
- }
29056
- if (!options.outputFile) {
29057
- throw new Error("No output file specified");
29058
- }
29059
- const result = await createTypescriptClient(def, options.name);
29060
- fs$1.writeFileSync(options.outputFile, result);
29061
- },
29062
- options
29063
- })
29064
- );
29065
- async function createTypescriptClient(def, prefix = "Client") {
29066
- createdModels = [];
29067
- const services = index.unflattenObject(def.procedures);
29068
- const serviceParts = [];
29069
- const modelParts = [];
29070
- Object.keys(services).forEach((key) => {
29071
- const serviceName = index.pascalCase(`${prefix}_${key}_service`);
29072
- serviceParts.push({
29073
- name: serviceName,
29074
- key,
29075
- content: tsServiceFromServiceDefinition(serviceName, services[key])
29076
- });
29077
- });
29078
- Object.keys(def.models).forEach((key) => {
29079
- const modelName = index.pascalCase(`${key}`);
29080
- if (!createdModels.includes(modelName)) {
29081
- modelParts.push(tsModelFromDefinition(modelName, def.models[key]));
29082
- createdModels.push(modelName);
29083
- }
29084
- });
29085
- return format2(
29086
- `/* eslint-disable */
29087
- import { arriRequest, ArriRequestError } from 'arri-client';
29088
-
29089
- export class ${prefix} {
29090
- ${serviceParts.map((service) => `${service.key}: ${service.name}`).join("\n")}
29091
- constructor(opts: { baseUrl?: string; headers?: Record<string, string> }) {
29092
- ${serviceParts.map(
29093
- (service) => `this.${service.key} = new ${service.name}(opts);`
29094
- ).join("\n")}
29095
- }
29096
- }
29097
-
29098
- ${serviceParts.map((service) => service.content).join("\n")}
29099
- ${modelParts.join("\n")}`,
29100
- {
29101
- parser: "typescript"
29102
- }
29103
- );
29104
- }
29105
- function tsServiceFromServiceDefinition(name, def) {
29106
- const rpcParts = [];
29107
- const subServiceParts = [];
29108
- Object.keys(def).forEach((key) => {
29109
- const val = def[key];
29110
- if (index.isProcedureDefinition(val)) {
29111
- rpcParts.push(tsRpcFromProcedureDefinition(key, val));
29112
- return;
29113
- }
29114
- const subServiceName = index.pascalCase(
29115
- `${name.split("Service").join("")}_${key}_service`
29116
- );
29117
- subServiceParts.push({
29118
- name: subServiceName,
29119
- key,
29120
- content: tsServiceFromServiceDefinition(subServiceName, val)
29121
- });
29122
- });
29123
- return `export class ${name} {
29124
- baseUrl: string;
29125
- headers: Record<string, string>;
29126
- ${subServiceParts.map((service) => `${service.key}: ${service.name};`).join("\n")}
29127
- constructor(opts: { baseUrl?: string; headers?: Record<string, string> }) {
29128
- this.baseUrl = opts.baseUrl ?? "";
29129
- this.headers = opts.headers ?? {};
29130
- ${subServiceParts.map(
29131
- (service) => `this.${service.key} = new ${service.name}(opts);`
29132
- ).join("\n")}
29133
- }
29134
- ${rpcParts.join("\n")}
29135
- }
29136
- ${subServiceParts.map((service) => service.content).join("\n")}`;
29137
- }
29138
- function tsRpcFromProcedureDefinition(name, def) {
29139
- let paramStr = "";
29140
- let responseName = "";
29141
- if (def.params) {
29142
- paramStr = `params: ${def.params}`;
29143
- }
29144
- if (def.response) {
29145
- responseName = def.response;
29146
- }
29147
- return `async ${name}(${paramStr}) {
29148
- return arriRequest<${responseName || "undefined"}>({
29149
- url: \`\${this.baseUrl}${def.path}\`,
29150
- method: '${def.method}',
29151
- ${paramStr.length ? `params,` : ""}
29152
- headers: this.headers,
29153
- });
29154
- }`;
29155
- }
29156
- function tsModelFromDefinition(name, def) {
29157
- const fieldParts = [];
29158
- const subModelParts = [];
29159
- Object.keys(def.properties ?? {}).forEach((key) => {
29160
- const isOptional = !def.required?.includes(key);
29161
- const prop = def.properties?.[key];
29162
- const keyPart = isOptional ? `${key}?` : key;
29163
- if (index.isJsonSchemaScalarType(prop)) {
29164
- fieldParts.push(
29165
- tsInterfaceScalarField(key, prop, isOptional) ?? ""
29166
- );
29167
- return;
29168
- }
29169
- if (index.isJsonSchemaNullType(prop)) {
29170
- switch (prop.type) {
29171
- case "null":
29172
- fieldParts.push(`${keyPart}: null;`);
29173
- break;
29174
- case "undefined":
29175
- fieldParts.push(`${keyPart}: undefined`);
29176
- break;
29177
- }
29178
- return;
29179
- }
29180
- if (index.isJsonSchemaObject(prop)) {
29181
- const subModelName = prop.$id ?? index.pascalCase(`${name}_${key}`);
29182
- if (!createdModels.includes(subModelName)) {
29183
- const content = tsModelFromDefinition(
29184
- subModelName,
29185
- prop
29186
- );
29187
- subModelParts.push(content);
29188
- }
29189
- fieldParts.push(`${keyPart}: ${subModelName};`);
29190
- return;
29191
- }
29192
- if (index.isJsonSchemaEnum(prop)) {
29193
- const vals = prop.anyOf.map(
29194
- (opt) => opt.type === "string" ? `'${opt.const}'` : `${opt.const}`
29195
- );
29196
- fieldParts.push(`${keyPart}: ${vals.join(" | ")};`);
29197
- return;
29198
- }
29199
- if (index.isJsonSchemaArray(prop)) {
29200
- if (index.isJsonSchemaScalarType(prop.items)) {
29201
- const part = tsInterfaceScalarField(
29202
- key,
29203
- prop.items,
29204
- isOptional
29205
- ).replace(";", "[];");
29206
- fieldParts.push(part);
29207
- return;
29208
- }
29209
- if (index.isJsonSchemaNullType(prop.items)) {
29210
- if (prop.items.type === "null") {
29211
- fieldParts.push(`${keyPart}: null[]`);
29212
- return;
29213
- }
29214
- fieldParts.push(`${keyPart}: undefined[]`);
29215
- return;
29216
- }
29217
- if (index.isJsonSchemaObject(prop.items)) {
29218
- const subModelName = prop.items.$id ?? index.pascalCase(`${name}_${key}_item`);
29219
- if (!createdModels.includes(subModelName)) {
29220
- subModelParts.push(
29221
- tsModelFromDefinition(subModelName, prop.items)
29222
- );
29223
- }
29224
- fieldParts.push(`${keyPart}: ${subModelName}[];`);
29225
- }
29226
- }
29227
- });
29228
- return `export interface ${name} {
29229
- ${fieldParts.join("\n")}
29230
- }
29231
- ${subModelParts.join("\n")}`;
29232
- }
29233
- function tsInterfaceScalarField(key, prop, isOptional = false) {
29234
- const keyPart = isOptional ? `${key}?` : key;
29235
- switch (prop.type) {
29236
- case "string":
29237
- return `${keyPart}: string;`;
29238
- case "bigint":
29239
- return `${keyPart}: bigint;`;
29240
- case "Date":
29241
- return `${keyPart}: Date;`;
29242
- case "boolean":
29243
- return `${keyPart}: boolean;`;
29244
- case "integer":
29245
- return `/**
29246
- * must be an integer
29247
- */
29248
- ${keyPart}: number;`;
29249
- case "number":
29250
- return `${keyPart}: number;`;
29251
- }
29252
- }
29253
-
29254
29049
  const dartClientGenerator = defineClientGeneratorPlugin(
29255
29050
  (options) => {
29256
29051
  return {
@@ -29267,7 +29062,7 @@ const dartClientGenerator = defineClientGeneratorPlugin(
29267
29062
  }
29268
29063
  const result = createDartClient(def, options.clientName);
29269
29064
  fs$1.writeFileSync(options.outputFile, result);
29270
- child_process.execSync(`dart format ${options.outputFile}`);
29065
+ require$$1.execSync(`dart format ${options.outputFile}`);
29271
29066
  },
29272
29067
  options
29273
29068
  };
@@ -29277,20 +29072,27 @@ const generatedModels = [];
29277
29072
  function createDartClient(appDef, prefix = "Client") {
29278
29073
  const { models, procedures } = appDef;
29279
29074
  const serviceParts = [];
29280
- const services = index.unflattenObject(procedures);
29075
+ const procedureParts = [];
29076
+ const services = index.unflattenProcedures(procedures);
29281
29077
  Object.keys(services).forEach((k) => {
29282
- const service = services[k];
29283
- const serviceName = index.pascalCase(`$_${prefix}_${k}_service`);
29284
- serviceParts.push({
29285
- name: serviceName,
29286
- key: k,
29287
- content: dartServiceFromServiceDefinition(
29288
- // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
29289
- serviceName,
29290
- service,
29291
- prefix
29292
- )
29293
- });
29078
+ const item = services[k];
29079
+ if (index.isServiceDefinition(item)) {
29080
+ const serviceName = index.pascalCase(`${prefix}_${k}_service`);
29081
+ serviceParts.push({
29082
+ name: serviceName,
29083
+ key: k,
29084
+ content: dartServiceFromServiceDefinition(
29085
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
29086
+ serviceName,
29087
+ item,
29088
+ prefix
29089
+ )
29090
+ });
29091
+ return;
29092
+ }
29093
+ procedureParts.push(
29094
+ dartProcedureFromServiceDefinition(prefix, k, item)
29095
+ );
29294
29096
  });
29295
29097
  const endpoints = {};
29296
29098
  Object.keys(procedures).forEach((key) => {
@@ -29318,22 +29120,18 @@ import "package:http/http.dart" as http;
29318
29120
  import "package:arri_client/arri_client.dart";
29319
29121
 
29320
29122
  class ${prefix} {
29321
- final String baseUrl;
29322
- final Map<String, String> headers;
29123
+ final String _baseUrl;
29124
+ final Map<String, String> _headers;
29323
29125
  const ${prefix}({
29324
- this.baseUrl = "",
29325
- this.headers = const {},
29326
- });
29327
- ${prefix} withHeaders(Map<String, String> headers) {
29328
- return ${prefix}(
29329
- baseUrl: baseUrl,
29330
- headers: headers,
29331
- );
29332
- }
29126
+ String baseUrl = "",
29127
+ Map<String, String> headers = const {},
29128
+ }): _headers = headers,
29129
+ _baseUrl = baseUrl;
29130
+ ${procedureParts.join("\n")}
29333
29131
  ${serviceParts.map(
29334
29132
  (service) => `${service.name} get ${service.key} {
29335
29133
  return ${service.name}(
29336
- baseUrl: baseUrl, headers: headers,
29134
+ baseUrl: _baseUrl, headers: _headers,
29337
29135
  );
29338
29136
  }`
29339
29137
  ).join("\n ")}
@@ -29345,9 +29143,9 @@ class ${prefix} {
29345
29143
  Encoding? encoding,
29346
29144
  }) async {
29347
29145
  return arriRequest(
29348
- "$baseUrl\${endpoint.path}",
29146
+ "$_baseUrl\${endpoint.path}",
29349
29147
  method: endpoint.method,
29350
- headers: headers ?? this.headers,
29148
+ headers: headers ?? this._headers,
29351
29149
  body: body,
29352
29150
  query: query,
29353
29151
  encoding: encoding,
@@ -29374,7 +29172,7 @@ enum ${prefix}Endpoints implements Comparable<${prefix}Endpoints>, ArriEndpoint
29374
29172
  final HttpMethod method;
29375
29173
 
29376
29174
  @override
29377
- compareTo(BackendEndpoints other) => name.compareTo(other.name);
29175
+ compareTo(${prefix}Endpoints other) => name.compareTo(other.name);
29378
29176
  }`;
29379
29177
  }
29380
29178
  function dartServiceFromServiceDefinition(name, def, prefix = "") {
@@ -29384,62 +29182,18 @@ function dartServiceFromServiceDefinition(name, def, prefix = "") {
29384
29182
  Object.keys(def).forEach((key) => {
29385
29183
  const item = def[key];
29386
29184
  if (index.isProcedureDefinition(item)) {
29387
- let returnType = `Future<String>`;
29388
- let returnTypeName = "String";
29389
- if (item.response) {
29390
- returnType = `Future<${prefix}${item.response}>`;
29391
- returnTypeName = `${prefix}${item.response}`;
29392
- } else {
29393
- returnType = "Future<void>";
29394
- }
29395
- let paramsInput = "";
29396
- if (item.params) {
29397
- paramsInput = `${prefix}${item.params} params`;
29398
- }
29399
- let responseParser = "(body) => body;";
29400
- switch (returnType) {
29401
- case "Future<String>":
29402
- break;
29403
- case "Future<int>":
29404
- responseParser = `(body) => Int.parse(body)`;
29405
- break;
29406
- case "Future<double>":
29407
- responseParser = `(body) => Double.parse(body)`;
29408
- break;
29409
- case "Future<void>":
29410
- responseParser = `(body) {}`;
29411
- break;
29412
- case "Future<bool>":
29413
- responseParser = `(body) {
29414
- switch(body) {
29415
- case "true":
29416
- case "1":
29417
- return true;
29418
- case "false":
29419
- case "0":
29420
- default:
29421
- return false;
29422
- }
29423
- }`;
29424
- break;
29425
- default:
29426
- responseParser = `(body) => ${returnTypeName}.fromJson(json.decode(body))`;
29427
- break;
29428
- }
29429
- rpcParts.push(`${returnType} ${key}(${paramsInput}) {
29430
- return parsedArriRequest(
29431
- "$baseUrl${item.path}",
29432
- method: HttpMethod.${item.method},
29433
- headers: headers,
29434
- params: ${paramsInput.length ? `params.toJson()` : "null"},
29435
- parser: ${responseParser},
29436
- );
29437
- }`);
29185
+ rpcParts.push(
29186
+ dartProcedureFromServiceDefinition(prefix, key, item)
29187
+ );
29438
29188
  return;
29439
29189
  }
29440
- const subServiceName = index.pascalCase(`${name}_${key}_Service`);
29190
+ const nameParts = name.split("Service");
29191
+ nameParts.pop();
29192
+ const subServiceName = index.pascalCase(
29193
+ `${nameParts.join("")}_${key}_Service`
29194
+ );
29441
29195
  const subService = dartServiceFromServiceDefinition(
29442
- index.pascalCase(`${name}_${key}_Service`),
29196
+ subServiceName,
29443
29197
  item,
29444
29198
  prefix
29445
29199
  );
@@ -29450,17 +29204,18 @@ function dartServiceFromServiceDefinition(name, def, prefix = "") {
29450
29204
  });
29451
29205
  });
29452
29206
  return `class ${serviceName} {
29453
- final String baseUrl;
29454
- final Map<String, String> headers;
29207
+ final String _baseUrl;
29208
+ final Map<String, String> _headers;
29455
29209
  const ${serviceName}({
29456
- this.baseUrl = "",
29457
- this.headers = const {},
29458
- });
29210
+ String baseUrl = "",
29211
+ Map<String, String> headers = const {},
29212
+ }): _baseUrl = baseUrl,
29213
+ _headers = headers;
29459
29214
  ${subServiceParts.map(
29460
29215
  (sub) => `${sub.name} get ${sub.key} {
29461
29216
  return ${sub.name}(
29462
- baseUrl: baseUrl,
29463
- headers: headers,
29217
+ baseUrl: _baseUrl,
29218
+ headers: _headers,
29464
29219
  );
29465
29220
  }`
29466
29221
  ).join("\n")}
@@ -29469,6 +29224,59 @@ function dartServiceFromServiceDefinition(name, def, prefix = "") {
29469
29224
  ${subServiceParts.map((sub) => sub.content).join("\n")}
29470
29225
  `;
29471
29226
  }
29227
+ function dartProcedureFromServiceDefinition(clientName, key, def) {
29228
+ let returnType = `Future<String>`;
29229
+ let returnTypeName = "String";
29230
+ if (def.response) {
29231
+ returnType = `Future<${clientName}${def.response}>`;
29232
+ returnTypeName = `${clientName}${def.response}`;
29233
+ } else {
29234
+ returnType = "Future<void>";
29235
+ }
29236
+ let paramsInput = "";
29237
+ if (def.params) {
29238
+ paramsInput = `${clientName}${def.params} params`;
29239
+ }
29240
+ let responseParser = "(body) => body;";
29241
+ switch (returnType) {
29242
+ case "Future<String>":
29243
+ break;
29244
+ case "Future<int>":
29245
+ responseParser = `(body) => Int.parse(body)`;
29246
+ break;
29247
+ case "Future<double>":
29248
+ responseParser = `(body) => Double.parse(body)`;
29249
+ break;
29250
+ case "Future<void>":
29251
+ responseParser = `(body) {}`;
29252
+ break;
29253
+ case "Future<bool>":
29254
+ responseParser = `(body) {
29255
+ switch(body) {
29256
+ case "true":
29257
+ case "1":
29258
+ return true;
29259
+ case "false":
29260
+ case "0":
29261
+ default:
29262
+ return false;
29263
+ }
29264
+ }`;
29265
+ break;
29266
+ default:
29267
+ responseParser = `(body) => ${returnTypeName}.fromJson(json.decode(body))`;
29268
+ break;
29269
+ }
29270
+ return `${returnType} ${key}(${paramsInput}) {
29271
+ return parsedArriRequest(
29272
+ "$_baseUrl${def.path}",
29273
+ method: HttpMethod.${def.method},
29274
+ headers: _headers,
29275
+ params: ${paramsInput.length ? `params.toJson()` : "null"},
29276
+ parser: ${responseParser},
29277
+ );
29278
+ }`;
29279
+ }
29472
29280
  function dartModelFromJsonSchema(name, schema) {
29473
29281
  const fields = [];
29474
29282
  const subModelParts = [];
@@ -29550,7 +29358,7 @@ function dartPropertyTypeFromSchema(objectName, propertyName, schema) {
29550
29358
  for (const opt of prop.anyOf) {
29551
29359
  if (opt.type === "string") {
29552
29360
  options.push({
29553
- name: opt.const.toString(),
29361
+ name: index.camelCase(opt.const.toString()),
29554
29362
  type: "String",
29555
29363
  value: opt.const
29556
29364
  });
@@ -29850,17 +29658,14 @@ function isDartTypeWithNullables(input) {
29850
29658
  exports.classListTransformer = classListTransformer;
29851
29659
  exports.classTransformer = classTransformer;
29852
29660
  exports.createDartClient = createDartClient;
29853
- exports.createTypescriptClient = createTypescriptClient;
29854
29661
  exports.dartClientGenerator = dartClientGenerator;
29855
29662
  exports.dartModelFromJsonSchema = dartModelFromJsonSchema;
29856
29663
  exports.dartParsedJsonField = dartParsedJsonField;
29664
+ exports.dartProcedureFromServiceDefinition = dartProcedureFromServiceDefinition;
29857
29665
  exports.dartPropertyTypeFromSchema = dartPropertyTypeFromSchema;
29858
29666
  exports.dartServiceFromServiceDefinition = dartServiceFromServiceDefinition;
29859
29667
  exports.defineClientGeneratorPlugin = defineClientGeneratorPlugin;
29668
+ exports.format2 = format2;
29860
29669
  exports.isDartType = isDartType;
29861
29670
  exports.isDartTypeWithNullables = isDartTypeWithNullables;
29862
29671
  exports.transformers = transformers;
29863
- exports.tsModelFromDefinition = tsModelFromDefinition;
29864
- exports.tsRpcFromProcedureDefinition = tsRpcFromProcedureDefinition;
29865
- exports.tsServiceFromServiceDefinition = tsServiceFromServiceDefinition;
29866
- exports.typescriptClientGenerator = typescriptClientGenerator;