lingo.dev 0.85.6 → 0.85.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.
package/build/cli.cjs CHANGED
@@ -1032,6 +1032,8 @@ function createLoader(lDefinition) {
1032
1032
  const state = {
1033
1033
  defaultLocale: void 0,
1034
1034
  originalInput: void 0,
1035
+ pullInput: void 0,
1036
+ pullOutput: void 0,
1035
1037
  initCtx: void 0
1036
1038
  };
1037
1039
  return {
@@ -1059,7 +1061,10 @@ function createLoader(lDefinition) {
1059
1061
  if (locale === state.defaultLocale) {
1060
1062
  state.originalInput = input2 || null;
1061
1063
  }
1062
- return lDefinition.pull(locale, input2, state.initCtx);
1064
+ state.pullInput = input2;
1065
+ const result = await lDefinition.pull(locale, input2, state.initCtx);
1066
+ state.pullOutput = result;
1067
+ return result;
1063
1068
  },
1064
1069
  async push(locale, data) {
1065
1070
  if (!state.defaultLocale) {
@@ -1068,7 +1073,14 @@ function createLoader(lDefinition) {
1068
1073
  if (state.originalInput === void 0) {
1069
1074
  throw new Error("Cannot push data without pulling first");
1070
1075
  }
1071
- const pushResult = await lDefinition.push(locale, data, state.originalInput, state.defaultLocale);
1076
+ const pushResult = await lDefinition.push(
1077
+ locale,
1078
+ data,
1079
+ state.originalInput,
1080
+ state.defaultLocale,
1081
+ state.pullInput,
1082
+ state.pullOutput
1083
+ );
1072
1084
  return pushResult;
1073
1085
  }
1074
1086
  };
@@ -1996,14 +2008,27 @@ function createPoDataLoader(params) {
1996
2008
  }
1997
2009
  return result;
1998
2010
  },
1999
- async push(locale, data, originalInput) {
2000
- const sections = _optionalChain([originalInput, 'optionalAccess', _86 => _86.split, 'call', _87 => _87("\n\n"), 'access', _88 => _88.filter, 'call', _89 => _89(Boolean)]) || [];
2001
- const result = sections.map((section) => {
2011
+ async push(locale, data, originalInput, originalLocale, pullInput) {
2012
+ const currentSections = _optionalChain([pullInput, 'optionalAccess', _86 => _86.split, 'call', _87 => _87("\n\n"), 'access', _88 => _88.filter, 'call', _89 => _89(Boolean)]) || [];
2013
+ const originalSections = _optionalChain([originalInput, 'optionalAccess', _90 => _90.split, 'call', _91 => _91("\n\n"), 'access', _92 => _92.filter, 'call', _93 => _93(Boolean)]) || [];
2014
+ const result = originalSections.map((section) => {
2002
2015
  const sectionPo = _gettextparser2.default.po.parse(section);
2003
2016
  const contextKey = _lodash2.default.keys(sectionPo.translations)[0];
2004
2017
  const entries = sectionPo.translations[contextKey];
2005
2018
  const msgid = Object.keys(entries).find((key) => entries[key].msgid);
2006
- if (!msgid) return section;
2019
+ if (!msgid) {
2020
+ const currentSection = currentSections.find((cs) => {
2021
+ const csPo = _gettextparser2.default.po.parse(cs);
2022
+ const csContextKey = _lodash2.default.keys(csPo.translations)[0];
2023
+ const csEntries = csPo.translations[csContextKey];
2024
+ const csMsgid = Object.keys(csEntries).find((key) => csEntries[key].msgid);
2025
+ return csMsgid === msgid;
2026
+ });
2027
+ if (currentSection) {
2028
+ return currentSection;
2029
+ }
2030
+ return section;
2031
+ }
2007
2032
  if (data[msgid]) {
2008
2033
  const updatedPo = _lodash2.default.merge({}, sectionPo, {
2009
2034
  translations: {
@@ -2039,7 +2064,7 @@ function createPoContentLoader() {
2039
2064
  entry.msgid,
2040
2065
  {
2041
2066
  ...entry,
2042
- msgstr: [_optionalChain([data, 'access', _90 => _90[entry.msgid], 'optionalAccess', _91 => _91.singular]), _optionalChain([data, 'access', _92 => _92[entry.msgid], 'optionalAccess', _93 => _93.plural]) || null].filter(Boolean)
2067
+ msgstr: [_optionalChain([data, 'access', _94 => _94[entry.msgid], 'optionalAccess', _95 => _95.singular]), _optionalChain([data, 'access', _96 => _96[entry.msgid], 'optionalAccess', _97 => _97.plural]) || null].filter(Boolean)
2043
2068
  }
2044
2069
  ]).fromPairs().value();
2045
2070
  return result;
@@ -2285,7 +2310,7 @@ function createDatoClient(params) {
2285
2310
  only_valid: "true",
2286
2311
  ids: !records.length ? void 0 : records.join(",")
2287
2312
  }
2288
- }).catch((error) => Promise.reject(_optionalChain([error, 'optionalAccess', _94 => _94.response, 'optionalAccess', _95 => _95.body, 'optionalAccess', _96 => _96.data, 'optionalAccess', _97 => _97[0]]) || error));
2313
+ }).catch((error) => Promise.reject(_optionalChain([error, 'optionalAccess', _98 => _98.response, 'optionalAccess', _99 => _99.body, 'optionalAccess', _100 => _100.data, 'optionalAccess', _101 => _101[0]]) || error));
2289
2314
  },
2290
2315
  findRecordsForModel: async (modelId, records) => {
2291
2316
  try {
@@ -2295,9 +2320,9 @@ function createDatoClient(params) {
2295
2320
  filter: {
2296
2321
  type: modelId,
2297
2322
  only_valid: "true",
2298
- ids: !_optionalChain([records, 'optionalAccess', _98 => _98.length]) ? void 0 : records.join(",")
2323
+ ids: !_optionalChain([records, 'optionalAccess', _102 => _102.length]) ? void 0 : records.join(",")
2299
2324
  }
2300
- }).catch((error) => Promise.reject(_optionalChain([error, 'optionalAccess', _99 => _99.response, 'optionalAccess', _100 => _100.body, 'optionalAccess', _101 => _101.data, 'optionalAccess', _102 => _102[0]]) || error));
2325
+ }).catch((error) => Promise.reject(_optionalChain([error, 'optionalAccess', _103 => _103.response, 'optionalAccess', _104 => _104.body, 'optionalAccess', _105 => _105.data, 'optionalAccess', _106 => _106[0]]) || error));
2301
2326
  return result;
2302
2327
  } catch (_error) {
2303
2328
  throw new Error(
@@ -2311,9 +2336,9 @@ function createDatoClient(params) {
2311
2336
  },
2312
2337
  updateRecord: async (id, payload) => {
2313
2338
  try {
2314
- await dato.items.update(id, payload).catch((error) => Promise.reject(_optionalChain([error, 'optionalAccess', _103 => _103.response, 'optionalAccess', _104 => _104.body, 'optionalAccess', _105 => _105.data, 'optionalAccess', _106 => _106[0]]) || error));
2339
+ await dato.items.update(id, payload).catch((error) => Promise.reject(_optionalChain([error, 'optionalAccess', _107 => _107.response, 'optionalAccess', _108 => _108.body, 'optionalAccess', _109 => _109.data, 'optionalAccess', _110 => _110[0]]) || error));
2315
2340
  } catch (_error) {
2316
- if (_optionalChain([_error, 'optionalAccess', _107 => _107.attributes, 'optionalAccess', _108 => _108.details, 'optionalAccess', _109 => _109.message])) {
2341
+ if (_optionalChain([_error, 'optionalAccess', _111 => _111.attributes, 'optionalAccess', _112 => _112.details, 'optionalAccess', _113 => _113.message])) {
2317
2342
  throw new Error(
2318
2343
  [
2319
2344
  `${_error.attributes.details.message}`,
@@ -2334,9 +2359,9 @@ function createDatoClient(params) {
2334
2359
  },
2335
2360
  enableFieldLocalization: async (args) => {
2336
2361
  try {
2337
- await dato.fields.update(`${args.modelId}::${args.fieldId}`, { localized: true }).catch((error) => Promise.reject(_optionalChain([error, 'optionalAccess', _110 => _110.response, 'optionalAccess', _111 => _111.body, 'optionalAccess', _112 => _112.data, 'optionalAccess', _113 => _113[0]]) || error));
2362
+ await dato.fields.update(`${args.modelId}::${args.fieldId}`, { localized: true }).catch((error) => Promise.reject(_optionalChain([error, 'optionalAccess', _114 => _114.response, 'optionalAccess', _115 => _115.body, 'optionalAccess', _116 => _116.data, 'optionalAccess', _117 => _117[0]]) || error));
2338
2363
  } catch (_error) {
2339
- if (_optionalChain([_error, 'optionalAccess', _114 => _114.attributes, 'optionalAccess', _115 => _115.code]) === "NOT_FOUND") {
2364
+ if (_optionalChain([_error, 'optionalAccess', _118 => _118.attributes, 'optionalAccess', _119 => _119.code]) === "NOT_FOUND") {
2340
2365
  throw new Error(
2341
2366
  [
2342
2367
  `Field "${args.fieldId}" not found in model "${args.modelId}".`,
@@ -2344,7 +2369,7 @@ function createDatoClient(params) {
2344
2369
  ].join("\n\n")
2345
2370
  );
2346
2371
  }
2347
- if (_optionalChain([_error, 'optionalAccess', _116 => _116.attributes, 'optionalAccess', _117 => _117.details, 'optionalAccess', _118 => _118.message])) {
2372
+ if (_optionalChain([_error, 'optionalAccess', _120 => _120.attributes, 'optionalAccess', _121 => _121.details, 'optionalAccess', _122 => _122.message])) {
2348
2373
  throw new Error(
2349
2374
  [`${_error.attributes.details.message}`, `Error: ${JSON.stringify(_error, null, 2)}`].join("\n\n")
2350
2375
  );
@@ -2410,7 +2435,7 @@ function createDatoApiLoader(config, onConfigUpdate) {
2410
2435
  }
2411
2436
  }
2412
2437
  const records = await dato.findRecordsForModel(modelId);
2413
- const recordChoices = createRecordChoices(records, _optionalChain([config, 'access', _119 => _119.models, 'access', _120 => _120[modelId], 'optionalAccess', _121 => _121.records]) || [], project);
2438
+ const recordChoices = createRecordChoices(records, _optionalChain([config, 'access', _123 => _123.models, 'access', _124 => _124[modelId], 'optionalAccess', _125 => _125.records]) || [], project);
2414
2439
  const selectedRecords = await promptRecordSelection(modelName, recordChoices);
2415
2440
  result.models[modelId].records = records.filter((record) => selectedRecords.includes(record.id));
2416
2441
  updatedConfig.models[modelId].records = selectedRecords;
@@ -2422,14 +2447,14 @@ function createDatoApiLoader(config, onConfigUpdate) {
2422
2447
  },
2423
2448
  async pull(locale, input2, initCtx) {
2424
2449
  const result = {};
2425
- for (const modelId of _lodash2.default.keys(_optionalChain([initCtx, 'optionalAccess', _122 => _122.models]) || {})) {
2426
- let records = _optionalChain([initCtx, 'optionalAccess', _123 => _123.models, 'access', _124 => _124[modelId], 'access', _125 => _125.records]) || [];
2450
+ for (const modelId of _lodash2.default.keys(_optionalChain([initCtx, 'optionalAccess', _126 => _126.models]) || {})) {
2451
+ let records = _optionalChain([initCtx, 'optionalAccess', _127 => _127.models, 'access', _128 => _128[modelId], 'access', _129 => _129.records]) || [];
2427
2452
  const recordIds = records.map((record) => record.id);
2428
2453
  records = await dato.findRecords(recordIds);
2429
2454
  console.log(`Fetched ${records.length} records for model ${modelId}`);
2430
2455
  if (records.length > 0) {
2431
2456
  result[modelId] = {
2432
- fields: _optionalChain([initCtx, 'optionalAccess', _126 => _126.models, 'optionalAccess', _127 => _127[modelId], 'optionalAccess', _128 => _128.fields]) || [],
2457
+ fields: _optionalChain([initCtx, 'optionalAccess', _130 => _130.models, 'optionalAccess', _131 => _131[modelId], 'optionalAccess', _132 => _132.fields]) || [],
2433
2458
  records
2434
2459
  };
2435
2460
  }
@@ -2488,7 +2513,7 @@ function createRecordChoices(records, selectedIds = [], project) {
2488
2513
  return records.map((record) => ({
2489
2514
  name: `${record.id} - https://${project.internal_domain}/editor/item_types/${record.item_type.id}/items/${record.id}`,
2490
2515
  value: record.id,
2491
- checked: _optionalChain([selectedIds, 'optionalAccess', _129 => _129.includes, 'call', _130 => _130(record.id)])
2516
+ checked: _optionalChain([selectedIds, 'optionalAccess', _133 => _133.includes, 'call', _134 => _134(record.id)])
2492
2517
  }));
2493
2518
  }
2494
2519
  async function promptRecordSelection(modelName, choices) {
@@ -2755,7 +2780,7 @@ var _nodewebvtt = require('node-webvtt'); var _nodewebvtt2 = _interopRequireDefa
2755
2780
  function createVttLoader() {
2756
2781
  return createLoader({
2757
2782
  async pull(locale, input2) {
2758
- const vtt = _optionalChain([_nodewebvtt2.default, 'access', _131 => _131.parse, 'call', _132 => _132(input2), 'optionalAccess', _133 => _133.cues]);
2783
+ const vtt = _optionalChain([_nodewebvtt2.default, 'access', _135 => _135.parse, 'call', _136 => _136(input2), 'optionalAccess', _137 => _137.cues]);
2759
2784
  if (Object.keys(vtt).length === 0) {
2760
2785
  return {};
2761
2786
  } else {
@@ -2808,7 +2833,7 @@ function variableExtractLoader(params) {
2808
2833
  for (let i = 0; i < matches.length; i++) {
2809
2834
  const match = matches[i];
2810
2835
  const currentValue = result[key].value;
2811
- const newValue = _optionalChain([currentValue, 'optionalAccess', _134 => _134.replace, 'call', _135 => _135(match, `{variable:${i}}`)]);
2836
+ const newValue = _optionalChain([currentValue, 'optionalAccess', _138 => _138.replace, 'call', _139 => _139(match, `{variable:${i}}`)]);
2812
2837
  result[key].value = newValue;
2813
2838
  result[key].variables[i] = match;
2814
2839
  }
@@ -2822,7 +2847,7 @@ function variableExtractLoader(params) {
2822
2847
  for (let i = 0; i < valueObj.variables.length; i++) {
2823
2848
  const variable = valueObj.variables[i];
2824
2849
  const currentValue = result[key];
2825
- const newValue = _optionalChain([currentValue, 'optionalAccess', _136 => _136.replace, 'call', _137 => _137(`{variable:${i}}`, variable)]);
2850
+ const newValue = _optionalChain([currentValue, 'optionalAccess', _140 => _140.replace, 'call', _141 => _141(`{variable:${i}}`, variable)]);
2826
2851
  result[key] = newValue;
2827
2852
  }
2828
2853
  }
@@ -3003,7 +3028,7 @@ function createVueJsonLoader() {
3003
3028
  return createLoader({
3004
3029
  pull: async (locale, input2, ctx) => {
3005
3030
  const parsed = parseVueFile(input2);
3006
- return _nullishCoalesce(_optionalChain([parsed, 'optionalAccess', _138 => _138.i18n, 'optionalAccess', _139 => _139[locale]]), () => ( {}));
3031
+ return _nullishCoalesce(_optionalChain([parsed, 'optionalAccess', _142 => _142.i18n, 'optionalAccess', _143 => _143[locale]]), () => ( {}));
3007
3032
  },
3008
3033
  push: async (locale, data, originalInput) => {
3009
3034
  const parsed = parseVueFile(_nullishCoalesce(originalInput, () => ( "")));
@@ -3415,7 +3440,7 @@ function createBasicTranslator(model, systemPrompt) {
3415
3440
  ]
3416
3441
  });
3417
3442
  const result = JSON.parse(response.text);
3418
- return _optionalChain([result, 'optionalAccess', _140 => _140.data]) || {};
3443
+ return _optionalChain([result, 'optionalAccess', _144 => _144.data]) || {};
3419
3444
  };
3420
3445
  }
3421
3446
 
@@ -3433,7 +3458,7 @@ function createProcessor(provider, params) {
3433
3458
  }
3434
3459
  }
3435
3460
  function getPureModelProvider(provider) {
3436
- switch (_optionalChain([provider, 'optionalAccess', _141 => _141.id])) {
3461
+ switch (_optionalChain([provider, 'optionalAccess', _145 => _145.id])) {
3437
3462
  case "openai":
3438
3463
  if (!process.env.OPENAI_API_KEY) {
3439
3464
  throw new Error("OPENAI_API_KEY is not set.");
@@ -3450,7 +3475,7 @@ function getPureModelProvider(provider) {
3450
3475
  apiKey: process.env.ANTHROPIC_API_KEY
3451
3476
  })(provider.model);
3452
3477
  default:
3453
- throw new Error(`Unsupported provider: ${_optionalChain([provider, 'optionalAccess', _142 => _142.id])}`);
3478
+ throw new Error(`Unsupported provider: ${_optionalChain([provider, 'optionalAccess', _146 => _146.id])}`);
3454
3479
  }
3455
3480
  }
3456
3481
 
@@ -3652,14 +3677,14 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
3652
3677
  flags
3653
3678
  });
3654
3679
  let buckets = getBuckets(i18nConfig);
3655
- if (_optionalChain([flags, 'access', _143 => _143.bucket, 'optionalAccess', _144 => _144.length])) {
3680
+ if (_optionalChain([flags, 'access', _147 => _147.bucket, 'optionalAccess', _148 => _148.length])) {
3656
3681
  buckets = buckets.filter((bucket) => flags.bucket.includes(bucket.type));
3657
3682
  }
3658
3683
  ora.succeed("Buckets retrieved");
3659
- if (_optionalChain([flags, 'access', _145 => _145.file, 'optionalAccess', _146 => _146.length])) {
3684
+ if (_optionalChain([flags, 'access', _149 => _149.file, 'optionalAccess', _150 => _150.length])) {
3660
3685
  buckets = buckets.map((bucket) => {
3661
3686
  const paths = bucket.paths.filter(
3662
- (path18) => flags.file.find((file) => _optionalChain([path18, 'access', _147 => _147.pathPattern, 'optionalAccess', _148 => _148.includes, 'call', _149 => _149(file)]))
3687
+ (path18) => flags.file.find((file) => _optionalChain([path18, 'access', _151 => _151.pathPattern, 'optionalAccess', _152 => _152.includes, 'call', _153 => _153(file)]))
3663
3688
  );
3664
3689
  return { ...bucket, paths };
3665
3690
  }).filter((bucket) => bucket.paths.length > 0);
@@ -3676,7 +3701,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
3676
3701
  });
3677
3702
  }
3678
3703
  }
3679
- const targetLocales = _optionalChain([flags, 'access', _150 => _150.locale, 'optionalAccess', _151 => _151.length]) ? flags.locale : i18nConfig.locale.targets;
3704
+ const targetLocales = _optionalChain([flags, 'access', _154 => _154.locale, 'optionalAccess', _155 => _155.length]) ? flags.locale : i18nConfig.locale.targets;
3680
3705
  ora.start("Setting up localization cache...");
3681
3706
  const checkLockfileProcessor = createDeltaProcessor("");
3682
3707
  const lockfileExists = await checkLockfileProcessor.checkIfLockExists();
@@ -4064,12 +4089,12 @@ function validateParams(i18nConfig, flags) {
4064
4089
  message: "No buckets found in i18n.json. Please add at least one bucket containing i18n content.",
4065
4090
  docUrl: "bucketNotFound"
4066
4091
  });
4067
- } else if (_optionalChain([flags, 'access', _152 => _152.locale, 'optionalAccess', _153 => _153.some, 'call', _154 => _154((locale) => !i18nConfig.locale.targets.includes(locale))])) {
4092
+ } else if (_optionalChain([flags, 'access', _156 => _156.locale, 'optionalAccess', _157 => _157.some, 'call', _158 => _158((locale) => !i18nConfig.locale.targets.includes(locale))])) {
4068
4093
  throw new CLIError({
4069
4094
  message: `One or more specified locales do not exist in i18n.json locale.targets. Please add them to the list and try again.`,
4070
4095
  docUrl: "localeTargetNotFound"
4071
4096
  });
4072
- } else if (_optionalChain([flags, 'access', _155 => _155.bucket, 'optionalAccess', _156 => _156.some, 'call', _157 => _157((bucket) => !i18nConfig.buckets[bucket])])) {
4097
+ } else if (_optionalChain([flags, 'access', _159 => _159.bucket, 'optionalAccess', _160 => _160.some, 'call', _161 => _161((bucket) => !i18nConfig.buckets[bucket])])) {
4073
4098
  throw new CLIError({
4074
4099
  message: `One or more specified buckets do not exist in i18n.json. Please add them to the list and try again.`,
4075
4100
  docUrl: "bucketNotFound"
@@ -4502,7 +4527,7 @@ var InBranchFlow = class extends IntegrationFlow {
4502
4527
  _child_process.execSync.call(void 0, `git config --global safe.directory ${process.cwd()}`);
4503
4528
  _child_process.execSync.call(void 0, `git config user.name "${gitConfig.userName}"`);
4504
4529
  _child_process.execSync.call(void 0, `git config user.email "${gitConfig.userEmail}"`);
4505
- _optionalChain([this, 'access', _158 => _158.platformKit, 'optionalAccess', _159 => _159.gitConfig, 'call', _160 => _160()]);
4530
+ _optionalChain([this, 'access', _162 => _162.platformKit, 'optionalAccess', _163 => _163.gitConfig, 'call', _164 => _164()]);
4506
4531
  _child_process.execSync.call(void 0, `git fetch origin ${baseBranchName}`, { stdio: "inherit" });
4507
4532
  _child_process.execSync.call(void 0, `git checkout ${baseBranchName} --`, { stdio: "inherit" });
4508
4533
  if (!processOwnCommits) {
@@ -4527,7 +4552,7 @@ var InBranchFlow = class extends IntegrationFlow {
4527
4552
  // ../../action/src/flows/pull-request.ts
4528
4553
  var PullRequestFlow = class extends InBranchFlow {
4529
4554
  async preRun() {
4530
- const canContinue = await _optionalChain([super.preRun.bind(this), 'optionalCall', _161 => _161()]);
4555
+ const canContinue = await _optionalChain([super.preRun.bind(this), 'optionalCall', _165 => _165()]);
4531
4556
  if (!canContinue) {
4532
4557
  return false;
4533
4558
  }
@@ -4745,10 +4770,10 @@ var BitbucketPlatformKit = class extends PlatformKit {
4745
4770
  repo_slug: this.platformConfig.repositoryName,
4746
4771
  state: "OPEN"
4747
4772
  }).then(({ data: { values } }) => {
4748
- return _optionalChain([values, 'optionalAccess', _162 => _162.find, 'call', _163 => _163(
4749
- ({ source, destination }) => _optionalChain([source, 'optionalAccess', _164 => _164.branch, 'optionalAccess', _165 => _165.name]) === branch && _optionalChain([destination, 'optionalAccess', _166 => _166.branch, 'optionalAccess', _167 => _167.name]) === this.platformConfig.baseBranchName
4773
+ return _optionalChain([values, 'optionalAccess', _166 => _166.find, 'call', _167 => _167(
4774
+ ({ source, destination }) => _optionalChain([source, 'optionalAccess', _168 => _168.branch, 'optionalAccess', _169 => _169.name]) === branch && _optionalChain([destination, 'optionalAccess', _170 => _170.branch, 'optionalAccess', _171 => _171.name]) === this.platformConfig.baseBranchName
4750
4775
  )]);
4751
- }).then((pr) => _optionalChain([pr, 'optionalAccess', _168 => _168.id]));
4776
+ }).then((pr) => _optionalChain([pr, 'optionalAccess', _172 => _172.id]));
4752
4777
  }
4753
4778
  async closePullRequest({ pullRequestNumber }) {
4754
4779
  await this.bb.repositories.declinePullRequest({
@@ -4834,7 +4859,7 @@ var GitHubPlatformKit = class extends PlatformKit {
4834
4859
  repo: this.platformConfig.repositoryName,
4835
4860
  base: this.platformConfig.baseBranchName,
4836
4861
  state: "open"
4837
- }).then(({ data }) => data[0]).then((pr) => _optionalChain([pr, 'optionalAccess', _169 => _169.number]));
4862
+ }).then(({ data }) => data[0]).then((pr) => _optionalChain([pr, 'optionalAccess', _173 => _173.number]));
4838
4863
  }
4839
4864
  async closePullRequest({ pullRequestNumber }) {
4840
4865
  await this.octokit.rest.pulls.update({
@@ -4947,7 +4972,7 @@ var GitlabPlatformKit = class extends PlatformKit {
4947
4972
  sourceBranch: branch,
4948
4973
  state: "opened"
4949
4974
  });
4950
- return _optionalChain([mergeRequests, 'access', _170 => _170[0], 'optionalAccess', _171 => _171.iid]);
4975
+ return _optionalChain([mergeRequests, 'access', _174 => _174[0], 'optionalAccess', _175 => _175.iid]);
4951
4976
  }
4952
4977
  async closePullRequest({ pullRequestNumber }) {
4953
4978
  await this.gitlab.MergeRequests.edit(this.platformConfig.gitlabProjectId, pullRequestNumber, {
@@ -5000,7 +5025,7 @@ async function main() {
5000
5025
  const { isPullRequestMode } = platformKit.config;
5001
5026
  ora.info(`Pull request mode: ${isPullRequestMode ? "on" : "off"}`);
5002
5027
  const flow = isPullRequestMode ? new PullRequestFlow(ora, platformKit) : new InBranchFlow(ora, platformKit);
5003
- const canRun = await _optionalChain([flow, 'access', _172 => _172.preRun, 'optionalCall', _173 => _173()]);
5028
+ const canRun = await _optionalChain([flow, 'access', _176 => _176.preRun, 'optionalCall', _177 => _177()]);
5004
5029
  if (canRun === false) {
5005
5030
  return;
5006
5031
  }
@@ -5008,7 +5033,7 @@ async function main() {
5008
5033
  if (!hasChanges) {
5009
5034
  return;
5010
5035
  }
5011
- await _optionalChain([flow, 'access', _174 => _174.postRun, 'optionalCall', _175 => _175()]);
5036
+ await _optionalChain([flow, 'access', _178 => _178.postRun, 'optionalCall', _179 => _179()]);
5012
5037
  }
5013
5038
 
5014
5039
  // src/cli/cmd/ci.ts
@@ -5030,7 +5055,7 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
5030
5055
  }
5031
5056
  const env = {
5032
5057
  LINGODOTDEV_API_KEY: settings.auth.apiKey,
5033
- LINGODOTDEV_PULL_REQUEST: _optionalChain([options, 'access', _176 => _176.pullRequest, 'optionalAccess', _177 => _177.toString, 'call', _178 => _178()]) || "false",
5058
+ LINGODOTDEV_PULL_REQUEST: _optionalChain([options, 'access', _180 => _180.pullRequest, 'optionalAccess', _181 => _181.toString, 'call', _182 => _182()]) || "false",
5034
5059
  ...options.commitMessage && { LINGODOTDEV_COMMIT_MESSAGE: options.commitMessage },
5035
5060
  ...options.pullRequestTitle && { LINGODOTDEV_PULL_REQUEST_TITLE: options.pullRequestTitle },
5036
5061
  ...options.workingDirectory && { LINGODOTDEV_WORKING_DIRECTORY: options.workingDirectory },
@@ -5081,13 +5106,13 @@ var status_default = new (0, _interactivecommander.Command)().command("status").
5081
5106
  flags
5082
5107
  });
5083
5108
  let buckets = getBuckets(i18nConfig);
5084
- if (_optionalChain([flags, 'access', _179 => _179.bucket, 'optionalAccess', _180 => _180.length])) {
5109
+ if (_optionalChain([flags, 'access', _183 => _183.bucket, 'optionalAccess', _184 => _184.length])) {
5085
5110
  buckets = buckets.filter((bucket) => flags.bucket.includes(bucket.type));
5086
5111
  }
5087
5112
  ora.succeed("Buckets retrieved");
5088
- if (_optionalChain([flags, 'access', _181 => _181.file, 'optionalAccess', _182 => _182.length])) {
5113
+ if (_optionalChain([flags, 'access', _185 => _185.file, 'optionalAccess', _186 => _186.length])) {
5089
5114
  buckets = buckets.map((bucket) => {
5090
- const paths = bucket.paths.filter((path18) => flags.file.find((file) => _optionalChain([path18, 'access', _183 => _183.pathPattern, 'optionalAccess', _184 => _184.match, 'call', _185 => _185(file)])));
5115
+ const paths = bucket.paths.filter((path18) => flags.file.find((file) => _optionalChain([path18, 'access', _187 => _187.pathPattern, 'optionalAccess', _188 => _188.match, 'call', _189 => _189(file)])));
5091
5116
  return { ...bucket, paths };
5092
5117
  }).filter((bucket) => bucket.paths.length > 0);
5093
5118
  if (buckets.length === 0) {
@@ -5103,7 +5128,7 @@ var status_default = new (0, _interactivecommander.Command)().command("status").
5103
5128
  });
5104
5129
  }
5105
5130
  }
5106
- const targetLocales = _optionalChain([flags, 'access', _186 => _186.locale, 'optionalAccess', _187 => _187.length]) ? flags.locale : i18nConfig.locale.targets;
5131
+ const targetLocales = _optionalChain([flags, 'access', _190 => _190.locale, 'optionalAccess', _191 => _191.length]) ? flags.locale : i18nConfig.locale.targets;
5107
5132
  let totalSourceKeyCount = 0;
5108
5133
  let uniqueKeysToTranslate = 0;
5109
5134
  let totalExistingTranslations = 0;
@@ -5444,12 +5469,12 @@ function validateParams2(i18nConfig, flags) {
5444
5469
  message: "No buckets found in i18n.json. Please add at least one bucket containing i18n content.",
5445
5470
  docUrl: "bucketNotFound"
5446
5471
  });
5447
- } else if (_optionalChain([flags, 'access', _188 => _188.locale, 'optionalAccess', _189 => _189.some, 'call', _190 => _190((locale) => !i18nConfig.locale.targets.includes(locale))])) {
5472
+ } else if (_optionalChain([flags, 'access', _192 => _192.locale, 'optionalAccess', _193 => _193.some, 'call', _194 => _194((locale) => !i18nConfig.locale.targets.includes(locale))])) {
5448
5473
  throw new CLIError({
5449
5474
  message: `One or more specified locales do not exist in i18n.json locale.targets. Please add them to the list and try again.`,
5450
5475
  docUrl: "localeTargetNotFound"
5451
5476
  });
5452
- } else if (_optionalChain([flags, 'access', _191 => _191.bucket, 'optionalAccess', _192 => _192.some, 'call', _193 => _193((bucket) => !i18nConfig.buckets[bucket])])) {
5477
+ } else if (_optionalChain([flags, 'access', _195 => _195.bucket, 'optionalAccess', _196 => _196.some, 'call', _197 => _197((bucket) => !i18nConfig.buckets[bucket])])) {
5453
5478
  throw new CLIError({
5454
5479
  message: `One or more specified buckets do not exist in i18n.json. Please add them to the list and try again.`,
5455
5480
  docUrl: "bucketNotFound"
@@ -5460,7 +5485,7 @@ function validateParams2(i18nConfig, flags) {
5460
5485
  // package.json
5461
5486
  var package_default = {
5462
5487
  name: "lingo.dev",
5463
- version: "0.85.6",
5488
+ version: "0.85.7",
5464
5489
  description: "Lingo.dev CLI",
5465
5490
  private: false,
5466
5491
  publishConfig: {