@dereekb/dbx-cli 13.12.9 → 13.13.0

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/index.cjs.js CHANGED
@@ -17,13 +17,13 @@ var tsMorph = require('ts-morph');
17
17
  var node_url = require('node:url');
18
18
 
19
19
  var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
20
- function _array_like_to_array$11(arr, len) {
20
+ function _array_like_to_array$12(arr, len) {
21
21
  if (len == null || len > arr.length) len = arr.length;
22
22
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
23
23
  return arr2;
24
24
  }
25
- function _array_without_holes$Y(arr) {
26
- if (Array.isArray(arr)) return _array_like_to_array$11(arr);
25
+ function _array_without_holes$Z(arr) {
26
+ if (Array.isArray(arr)) return _array_like_to_array$12(arr);
27
27
  }
28
28
  function _assert_this_initialized(self) {
29
29
  if (self === void 0) {
@@ -86,7 +86,7 @@ function _construct(Parent, args, Class) {
86
86
  }
87
87
  return _construct.apply(null, arguments);
88
88
  }
89
- function _define_property$K(obj, key, value) {
89
+ function _define_property$L(obj, key, value) {
90
90
  if (key in obj) {
91
91
  Object.defineProperty(obj, key, {
92
92
  value: value,
@@ -129,13 +129,13 @@ function _instanceof$o(left, right) {
129
129
  function _is_native_function(fn) {
130
130
  return Function.toString.call(fn).indexOf("[native code]") !== -1;
131
131
  }
132
- function _iterable_to_array$Y(iter) {
132
+ function _iterable_to_array$Z(iter) {
133
133
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
134
134
  }
135
- function _non_iterable_spread$Y() {
135
+ function _non_iterable_spread$Z() {
136
136
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
137
137
  }
138
- function _object_spread$K(target) {
138
+ function _object_spread$L(target) {
139
139
  for(var i = 1; i < arguments.length; i++){
140
140
  var source = arguments[i] != null ? arguments[i] : {};
141
141
  var ownKeys = Object.keys(source);
@@ -145,12 +145,12 @@ function _object_spread$K(target) {
145
145
  }));
146
146
  }
147
147
  ownKeys.forEach(function(key) {
148
- _define_property$K(target, key, source[key]);
148
+ _define_property$L(target, key, source[key]);
149
149
  });
150
150
  }
151
151
  return target;
152
152
  }
153
- function ownKeys$s(object, enumerableOnly) {
153
+ function ownKeys$t(object, enumerableOnly) {
154
154
  var keys = Object.keys(object);
155
155
  if (Object.getOwnPropertySymbols) {
156
156
  var symbols = Object.getOwnPropertySymbols(object);
@@ -158,12 +158,12 @@ function ownKeys$s(object, enumerableOnly) {
158
158
  }
159
159
  return keys;
160
160
  }
161
- function _object_spread_props$s(target, source) {
161
+ function _object_spread_props$t(target, source) {
162
162
  source = source != null ? source : {};
163
163
  if (Object.getOwnPropertyDescriptors) {
164
164
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
165
165
  } else {
166
- ownKeys$s(Object(source)).forEach(function(key) {
166
+ ownKeys$t(Object(source)).forEach(function(key) {
167
167
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
168
168
  });
169
169
  }
@@ -182,20 +182,20 @@ function _set_prototype_of(o, p) {
182
182
  };
183
183
  return _set_prototype_of(o, p);
184
184
  }
185
- function _to_consumable_array$Y(arr) {
186
- return _array_without_holes$Y(arr) || _iterable_to_array$Y(arr) || _unsupported_iterable_to_array$11(arr) || _non_iterable_spread$Y();
185
+ function _to_consumable_array$Z(arr) {
186
+ return _array_without_holes$Z(arr) || _iterable_to_array$Z(arr) || _unsupported_iterable_to_array$12(arr) || _non_iterable_spread$Z();
187
187
  }
188
188
  function _type_of$2(obj) {
189
189
  "@swc/helpers - typeof";
190
190
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
191
191
  }
192
- function _unsupported_iterable_to_array$11(o, minLen) {
192
+ function _unsupported_iterable_to_array$12(o, minLen) {
193
193
  if (!o) return;
194
- if (typeof o === "string") return _array_like_to_array$11(o, minLen);
194
+ if (typeof o === "string") return _array_like_to_array$12(o, minLen);
195
195
  var n = Object.prototype.toString.call(o).slice(8, -1);
196
196
  if (n === "Object" && o.constructor) n = o.constructor.name;
197
197
  if (n === "Map" || n === "Set") return Array.from(n);
198
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$11(o, minLen);
198
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$12(o, minLen);
199
199
  }
200
200
  function _wrap_native_super(Class) {
201
201
  var _cache = typeof Map === "function" ? new Map() : undefined;
@@ -352,7 +352,7 @@ function _ts_generator$1f(thisArg, body) {
352
352
  /id_token[=:]\s*\S+/gi
353
353
  ];
354
354
  var _outputOptions = {};
355
- var _secretPatterns = _to_consumable_array$Y(DEFAULT_CLI_SECRET_PATTERNS);
355
+ var _secretPatterns = _to_consumable_array$Z(DEFAULT_CLI_SECRET_PATTERNS);
356
356
  var _errorMapper;
357
357
  var _verbose = false;
358
358
  var _timeoutMs;
@@ -432,7 +432,7 @@ var _timeoutMs;
432
432
  timeoutHandle = setTimeout(function() {
433
433
  return localController.abort();
434
434
  }, timeoutMs);
435
- finalInit = _object_spread_props$s(_object_spread$K({}, init), {
435
+ finalInit = _object_spread_props$t(_object_spread$L({}, init), {
436
436
  signal: localController.signal
437
437
  });
438
438
  }
@@ -580,7 +580,7 @@ function dumpResponse(data, meta) {
580
580
  if (!filePath) {
581
581
  return;
582
582
  }
583
- var content = _object_spread$K({
583
+ var content = _object_spread$L({
584
584
  ok: true,
585
585
  data: data
586
586
  }, meta ? {
@@ -657,7 +657,7 @@ function stringifyEnvelope(value) {
657
657
  */ function outputResult(data, meta) {
658
658
  dumpResponse(data, meta);
659
659
  var outputData = _outputOptions.pick ? pickFields(data, _outputOptions.pick) : data;
660
- var output = _object_spread$K({
660
+ var output = _object_spread$L({
661
661
  ok: true,
662
662
  data: outputData
663
663
  }, meta ? {
@@ -686,7 +686,7 @@ function stringifyEnvelope(value) {
686
686
  var _this;
687
687
  _this = _call_super(this, CliError, [
688
688
  input.message
689
- ]), _define_property$K(_this, "code", void 0), _define_property$K(_this, "suggestion", void 0);
689
+ ]), _define_property$L(_this, "code", void 0), _define_property$L(_this, "suggestion", void 0);
690
690
  _this.name = 'CliError';
691
691
  _this.code = input.code;
692
692
  _this.suggestion = input.suggestion;
@@ -714,7 +714,7 @@ function stringifyEnvelope(value) {
714
714
  if (mapped) {
715
715
  result = mapped;
716
716
  } else if (_instanceof$o(error, CliError)) {
717
- result = _object_spread$K({
717
+ result = _object_spread$L({
718
718
  ok: false,
719
719
  error: sanitizeString(error.message),
720
720
  code: error.code
@@ -737,13 +737,13 @@ function stringifyEnvelope(value) {
737
737
  return result;
738
738
  }
739
739
 
740
- function _array_like_to_array$10(arr, len) {
740
+ function _array_like_to_array$11(arr, len) {
741
741
  if (len == null || len > arr.length) len = arr.length;
742
742
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
743
743
  return arr2;
744
744
  }
745
- function _array_without_holes$X(arr) {
746
- if (Array.isArray(arr)) return _array_like_to_array$10(arr);
745
+ function _array_without_holes$Y(arr) {
746
+ if (Array.isArray(arr)) return _array_like_to_array$11(arr);
747
747
  }
748
748
  function asyncGeneratorStep$1e(gen, resolve, reject, _next, _throw, key, arg) {
749
749
  try {
@@ -774,7 +774,7 @@ function _async_to_generator$1e(fn) {
774
774
  });
775
775
  };
776
776
  }
777
- function _define_property$J(obj, key, value) {
777
+ function _define_property$K(obj, key, value) {
778
778
  if (key in obj) {
779
779
  Object.defineProperty(obj, key, {
780
780
  value: value,
@@ -787,13 +787,13 @@ function _define_property$J(obj, key, value) {
787
787
  }
788
788
  return obj;
789
789
  }
790
- function _iterable_to_array$X(iter) {
790
+ function _iterable_to_array$Y(iter) {
791
791
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
792
792
  }
793
- function _non_iterable_spread$X() {
793
+ function _non_iterable_spread$Y() {
794
794
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
795
795
  }
796
- function _object_spread$J(target) {
796
+ function _object_spread$K(target) {
797
797
  for(var i = 1; i < arguments.length; i++){
798
798
  var source = arguments[i] != null ? arguments[i] : {};
799
799
  var ownKeys = Object.keys(source);
@@ -803,12 +803,12 @@ function _object_spread$J(target) {
803
803
  }));
804
804
  }
805
805
  ownKeys.forEach(function(key) {
806
- _define_property$J(target, key, source[key]);
806
+ _define_property$K(target, key, source[key]);
807
807
  });
808
808
  }
809
809
  return target;
810
810
  }
811
- function ownKeys$r(object, enumerableOnly) {
811
+ function ownKeys$s(object, enumerableOnly) {
812
812
  var keys = Object.keys(object);
813
813
  if (Object.getOwnPropertySymbols) {
814
814
  var symbols = Object.getOwnPropertySymbols(object);
@@ -816,31 +816,31 @@ function ownKeys$r(object, enumerableOnly) {
816
816
  }
817
817
  return keys;
818
818
  }
819
- function _object_spread_props$r(target, source) {
819
+ function _object_spread_props$s(target, source) {
820
820
  source = source != null ? source : {};
821
821
  if (Object.getOwnPropertyDescriptors) {
822
822
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
823
823
  } else {
824
- ownKeys$r(Object(source)).forEach(function(key) {
824
+ ownKeys$s(Object(source)).forEach(function(key) {
825
825
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
826
826
  });
827
827
  }
828
828
  return target;
829
829
  }
830
- function _to_consumable_array$X(arr) {
831
- return _array_without_holes$X(arr) || _iterable_to_array$X(arr) || _unsupported_iterable_to_array$10(arr) || _non_iterable_spread$X();
830
+ function _to_consumable_array$Y(arr) {
831
+ return _array_without_holes$Y(arr) || _iterable_to_array$Y(arr) || _unsupported_iterable_to_array$11(arr) || _non_iterable_spread$Y();
832
832
  }
833
833
  function _type_of$1(obj) {
834
834
  "@swc/helpers - typeof";
835
835
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
836
836
  }
837
- function _unsupported_iterable_to_array$10(o, minLen) {
837
+ function _unsupported_iterable_to_array$11(o, minLen) {
838
838
  if (!o) return;
839
- if (typeof o === "string") return _array_like_to_array$10(o, minLen);
839
+ if (typeof o === "string") return _array_like_to_array$11(o, minLen);
840
840
  var n = Object.prototype.toString.call(o).slice(8, -1);
841
841
  if (n === "Object" && o.constructor) n = o.constructor.name;
842
842
  if (n === "Map" || n === "Set") return Array.from(n);
843
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$10(o, minLen);
843
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$11(o, minLen);
844
844
  }
845
845
  function _ts_generator$1e(thisArg, body) {
846
846
  var f, y, t, _ = {
@@ -1088,14 +1088,14 @@ var MAX_MODEL_ACCESS_MULTI_READ_KEYS = 50;
1088
1088
  chunk = _step.value;
1089
1089
  return [
1090
1090
  4,
1091
- getMultipleModelsOverHttp(_object_spread_props$r(_object_spread$J({}, input), {
1091
+ getMultipleModelsOverHttp(_object_spread_props$s(_object_spread$K({}, input), {
1092
1092
  keys: chunk
1093
1093
  }))
1094
1094
  ];
1095
1095
  case 3:
1096
1096
  batch = _state.sent();
1097
- (_mergedResults = mergedResults).push.apply(_mergedResults, _to_consumable_array$X(batch.results));
1098
- (_mergedErrors = mergedErrors).push.apply(_mergedErrors, _to_consumable_array$X(batch.errors));
1097
+ (_mergedResults = mergedResults).push.apply(_mergedResults, _to_consumable_array$Y(batch.results));
1098
+ (_mergedErrors = mergedErrors).push.apply(_mergedErrors, _to_consumable_array$Y(batch.errors));
1099
1099
  _state.label = 4;
1100
1100
  case 4:
1101
1101
  _iteratorNormalCompletion = true;
@@ -1148,9 +1148,9 @@ function requestJson(input) {
1148
1148
  switch(_state.label){
1149
1149
  case 0:
1150
1150
  hasJsonBody = input.jsonBody !== undefined;
1151
- init = _object_spread$J({
1151
+ init = _object_spread$K({
1152
1152
  method: input.method,
1153
- headers: _object_spread$J({
1153
+ headers: _object_spread$K({
1154
1154
  Accept: 'application/json',
1155
1155
  Authorization: "Bearer ".concat(input.accessToken)
1156
1156
  }, hasJsonBody ? {
@@ -1725,7 +1725,7 @@ function _ts_generator$1c(thisArg, body) {
1725
1725
  };
1726
1726
  }
1727
1727
 
1728
- function _array_like_to_array$$(arr, len) {
1728
+ function _array_like_to_array$10(arr, len) {
1729
1729
  if (len == null || len > arr.length) len = arr.length;
1730
1730
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
1731
1731
  return arr2;
@@ -1733,10 +1733,10 @@ function _array_like_to_array$$(arr, len) {
1733
1733
  function _array_with_holes$g(arr) {
1734
1734
  if (Array.isArray(arr)) return arr;
1735
1735
  }
1736
- function _array_without_holes$W(arr) {
1737
- if (Array.isArray(arr)) return _array_like_to_array$$(arr);
1736
+ function _array_without_holes$X(arr) {
1737
+ if (Array.isArray(arr)) return _array_like_to_array$10(arr);
1738
1738
  }
1739
- function _iterable_to_array$W(iter) {
1739
+ function _iterable_to_array$X(iter) {
1740
1740
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
1741
1741
  }
1742
1742
  function _iterable_to_array_limit$g(arr, i) {
@@ -1766,22 +1766,22 @@ function _iterable_to_array_limit$g(arr, i) {
1766
1766
  function _non_iterable_rest$g() {
1767
1767
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1768
1768
  }
1769
- function _non_iterable_spread$W() {
1769
+ function _non_iterable_spread$X() {
1770
1770
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1771
1771
  }
1772
1772
  function _sliced_to_array$g(arr, i) {
1773
- return _array_with_holes$g(arr) || _iterable_to_array_limit$g(arr, i) || _unsupported_iterable_to_array$$(arr, i) || _non_iterable_rest$g();
1773
+ return _array_with_holes$g(arr) || _iterable_to_array_limit$g(arr, i) || _unsupported_iterable_to_array$10(arr, i) || _non_iterable_rest$g();
1774
1774
  }
1775
- function _to_consumable_array$W(arr) {
1776
- return _array_without_holes$W(arr) || _iterable_to_array$W(arr) || _unsupported_iterable_to_array$$(arr) || _non_iterable_spread$W();
1775
+ function _to_consumable_array$X(arr) {
1776
+ return _array_without_holes$X(arr) || _iterable_to_array$X(arr) || _unsupported_iterable_to_array$10(arr) || _non_iterable_spread$X();
1777
1777
  }
1778
- function _unsupported_iterable_to_array$$(o, minLen) {
1778
+ function _unsupported_iterable_to_array$10(o, minLen) {
1779
1779
  if (!o) return;
1780
- if (typeof o === "string") return _array_like_to_array$$(o, minLen);
1780
+ if (typeof o === "string") return _array_like_to_array$10(o, minLen);
1781
1781
  var n = Object.prototype.toString.call(o).slice(8, -1);
1782
1782
  if (n === "Object" && o.constructor) n = o.constructor.name;
1783
1783
  if (n === "Map" || n === "Set") return Array.from(n);
1784
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$$(o, minLen);
1784
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$10(o, minLen);
1785
1785
  }
1786
1786
  /**
1787
1787
  * Default name of the parent command that groups all registered action specs.
@@ -1836,7 +1836,7 @@ function _unsupported_iterable_to_array$$(o, minLen) {
1836
1836
  }
1837
1837
  }
1838
1838
  }
1839
- var sortedModels = _to_consumable_array$W(byModel.entries()).sort(function(param, param1) {
1839
+ var sortedModels = _to_consumable_array$X(byModel.entries()).sort(function(param, param1) {
1840
1840
  var _param = _sliced_to_array$g(param, 1), a = _param[0], _param1 = _sliced_to_array$g(param1, 1), b = _param1[0];
1841
1841
  return a.localeCompare(b);
1842
1842
  });
@@ -1926,7 +1926,7 @@ function _unsupported_iterable_to_array$$(o, minLen) {
1926
1926
  return result;
1927
1927
  }
1928
1928
 
1929
- function _array_like_to_array$_(arr, len) {
1929
+ function _array_like_to_array$$(arr, len) {
1930
1930
  if (len == null || len > arr.length) len = arr.length;
1931
1931
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
1932
1932
  return arr2;
@@ -1934,8 +1934,8 @@ function _array_like_to_array$_(arr, len) {
1934
1934
  function _array_with_holes$f(arr) {
1935
1935
  if (Array.isArray(arr)) return arr;
1936
1936
  }
1937
- function _array_without_holes$V(arr) {
1938
- if (Array.isArray(arr)) return _array_like_to_array$_(arr);
1937
+ function _array_without_holes$W(arr) {
1938
+ if (Array.isArray(arr)) return _array_like_to_array$$(arr);
1939
1939
  }
1940
1940
  function asyncGeneratorStep$1b(gen, resolve, reject, _next, _throw, key, arg) {
1941
1941
  try {
@@ -1966,7 +1966,7 @@ function _async_to_generator$1b(fn) {
1966
1966
  });
1967
1967
  };
1968
1968
  }
1969
- function _define_property$I(obj, key, value) {
1969
+ function _define_property$J(obj, key, value) {
1970
1970
  if (key in obj) {
1971
1971
  Object.defineProperty(obj, key, {
1972
1972
  value: value,
@@ -1979,7 +1979,7 @@ function _define_property$I(obj, key, value) {
1979
1979
  }
1980
1980
  return obj;
1981
1981
  }
1982
- function _iterable_to_array$V(iter) {
1982
+ function _iterable_to_array$W(iter) {
1983
1983
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
1984
1984
  }
1985
1985
  function _iterable_to_array_limit$f(arr, i) {
@@ -2009,10 +2009,10 @@ function _iterable_to_array_limit$f(arr, i) {
2009
2009
  function _non_iterable_rest$f() {
2010
2010
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2011
2011
  }
2012
- function _non_iterable_spread$V() {
2012
+ function _non_iterable_spread$W() {
2013
2013
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2014
2014
  }
2015
- function _object_spread$I(target) {
2015
+ function _object_spread$J(target) {
2016
2016
  for(var i = 1; i < arguments.length; i++){
2017
2017
  var source = arguments[i] != null ? arguments[i] : {};
2018
2018
  var ownKeys = Object.keys(source);
@@ -2022,12 +2022,12 @@ function _object_spread$I(target) {
2022
2022
  }));
2023
2023
  }
2024
2024
  ownKeys.forEach(function(key) {
2025
- _define_property$I(target, key, source[key]);
2025
+ _define_property$J(target, key, source[key]);
2026
2026
  });
2027
2027
  }
2028
2028
  return target;
2029
2029
  }
2030
- function ownKeys$q(object, enumerableOnly) {
2030
+ function ownKeys$r(object, enumerableOnly) {
2031
2031
  var keys = Object.keys(object);
2032
2032
  if (Object.getOwnPropertySymbols) {
2033
2033
  var symbols = Object.getOwnPropertySymbols(object);
@@ -2035,30 +2035,30 @@ function ownKeys$q(object, enumerableOnly) {
2035
2035
  }
2036
2036
  return keys;
2037
2037
  }
2038
- function _object_spread_props$q(target, source) {
2038
+ function _object_spread_props$r(target, source) {
2039
2039
  source = source != null ? source : {};
2040
2040
  if (Object.getOwnPropertyDescriptors) {
2041
2041
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
2042
2042
  } else {
2043
- ownKeys$q(Object(source)).forEach(function(key) {
2043
+ ownKeys$r(Object(source)).forEach(function(key) {
2044
2044
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
2045
2045
  });
2046
2046
  }
2047
2047
  return target;
2048
2048
  }
2049
2049
  function _sliced_to_array$f(arr, i) {
2050
- return _array_with_holes$f(arr) || _iterable_to_array_limit$f(arr, i) || _unsupported_iterable_to_array$_(arr, i) || _non_iterable_rest$f();
2050
+ return _array_with_holes$f(arr) || _iterable_to_array_limit$f(arr, i) || _unsupported_iterable_to_array$$(arr, i) || _non_iterable_rest$f();
2051
2051
  }
2052
- function _to_consumable_array$V(arr) {
2053
- return _array_without_holes$V(arr) || _iterable_to_array$V(arr) || _unsupported_iterable_to_array$_(arr) || _non_iterable_spread$V();
2052
+ function _to_consumable_array$W(arr) {
2053
+ return _array_without_holes$W(arr) || _iterable_to_array$W(arr) || _unsupported_iterable_to_array$$(arr) || _non_iterable_spread$W();
2054
2054
  }
2055
- function _unsupported_iterable_to_array$_(o, minLen) {
2055
+ function _unsupported_iterable_to_array$$(o, minLen) {
2056
2056
  if (!o) return;
2057
- if (typeof o === "string") return _array_like_to_array$_(o, minLen);
2057
+ if (typeof o === "string") return _array_like_to_array$$(o, minLen);
2058
2058
  var n = Object.prototype.toString.call(o).slice(8, -1);
2059
2059
  if (n === "Object" && o.constructor) n = o.constructor.name;
2060
2060
  if (n === "Map" || n === "Set") return Array.from(n);
2061
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$_(o, minLen);
2061
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$$(o, minLen);
2062
2062
  }
2063
2063
  function _ts_generator$1b(thisArg, body) {
2064
2064
  var f, y, t, _ = {
@@ -2174,7 +2174,7 @@ var _defaultResponseAdapter = {
2174
2174
  }
2175
2175
  };
2176
2176
  function _defaultBuildRequestData(params, state, limit) {
2177
- var base = _object_spread$I({}, params);
2177
+ var base = _object_spread$J({}, params);
2178
2178
  if (state.cursorDocumentKey != null) {
2179
2179
  base.cursorDocumentKey = state.cursorDocumentKey;
2180
2180
  }
@@ -2198,7 +2198,7 @@ function _runItemTasks(input) {
2198
2198
  itemIndex: itemIndex
2199
2199
  };
2200
2200
  });
2201
- taskConfig = _object_spread_props$q(_object_spread$I({
2201
+ taskConfig = _object_spread_props$r(_object_spread$J({
2202
2202
  sequential: true,
2203
2203
  throwError: true
2204
2204
  }, itemPerformTasksConfig), {
@@ -2429,10 +2429,10 @@ function _evaluateLoopExit(input) {
2429
2429
  case 3:
2430
2430
  pageOutcome = _state.sent();
2431
2431
  if (collectItemsForPage) {
2432
- (_allItems = allItems).push.apply(_allItems, _to_consumable_array$V(pageOutcome.items));
2432
+ (_allItems = allItems).push.apply(_allItems, _to_consumable_array$W(pageOutcome.items));
2433
2433
  }
2434
2434
  if (collectItemResultsForPage && pageOutcome.itemResults) {
2435
- (_allItemResults = allItemResults).push.apply(_allItemResults, _to_consumable_array$V(pageOutcome.itemResults));
2435
+ (_allItemResults = allItemResults).push.apply(_allItemResults, _to_consumable_array$W(pageOutcome.itemResults));
2436
2436
  }
2437
2437
  if (collectPageResultsForPage && pageOutcome.pageResult !== undefined) {
2438
2438
  allPageResults.push(pageOutcome.pageResult);
@@ -2455,7 +2455,7 @@ function _evaluateLoopExit(input) {
2455
2455
  1
2456
2456
  ];
2457
2457
  case 4:
2458
- result = _object_spread$I({
2458
+ result = _object_spread$J({
2459
2459
  totalPages: pageIndex,
2460
2460
  totalItems: totalItems,
2461
2461
  hitLimit: hitLimit,
@@ -2505,7 +2505,7 @@ function _async_to_generator$1a(fn) {
2505
2505
  });
2506
2506
  };
2507
2507
  }
2508
- function _define_property$H(obj, key, value) {
2508
+ function _define_property$I(obj, key, value) {
2509
2509
  if (key in obj) {
2510
2510
  Object.defineProperty(obj, key, {
2511
2511
  value: value,
@@ -2518,7 +2518,7 @@ function _define_property$H(obj, key, value) {
2518
2518
  }
2519
2519
  return obj;
2520
2520
  }
2521
- function _object_spread$H(target) {
2521
+ function _object_spread$I(target) {
2522
2522
  for(var i = 1; i < arguments.length; i++){
2523
2523
  var source = arguments[i] != null ? arguments[i] : {};
2524
2524
  var ownKeys = Object.keys(source);
@@ -2528,12 +2528,12 @@ function _object_spread$H(target) {
2528
2528
  }));
2529
2529
  }
2530
2530
  ownKeys.forEach(function(key) {
2531
- _define_property$H(target, key, source[key]);
2531
+ _define_property$I(target, key, source[key]);
2532
2532
  });
2533
2533
  }
2534
2534
  return target;
2535
2535
  }
2536
- function ownKeys$p(object, enumerableOnly) {
2536
+ function ownKeys$q(object, enumerableOnly) {
2537
2537
  var keys = Object.keys(object);
2538
2538
  if (Object.getOwnPropertySymbols) {
2539
2539
  var symbols = Object.getOwnPropertySymbols(object);
@@ -2541,12 +2541,12 @@ function ownKeys$p(object, enumerableOnly) {
2541
2541
  }
2542
2542
  return keys;
2543
2543
  }
2544
- function _object_spread_props$p(target, source) {
2544
+ function _object_spread_props$q(target, source) {
2545
2545
  source = source != null ? source : {};
2546
2546
  if (Object.getOwnPropertyDescriptors) {
2547
2547
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
2548
2548
  } else {
2549
- ownKeys$p(Object(source)).forEach(function(key) {
2549
+ ownKeys$q(Object(source)).forEach(function(key) {
2550
2550
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
2551
2551
  });
2552
2552
  }
@@ -2675,7 +2675,7 @@ function _ts_generator$1a(thisArg, body) {
2675
2675
  case 0:
2676
2676
  context = requireCliContext();
2677
2677
  data = spec.buildParams(argv);
2678
- params = _object_spread_props$p(_object_spread$H({
2678
+ params = _object_spread_props$q(_object_spread$I({
2679
2679
  modelType: spec.model,
2680
2680
  call: spec.verb
2681
2681
  }, spec.specifier == null ? {} : {
@@ -3152,7 +3152,7 @@ function _async_to_generator$18(fn) {
3152
3152
  });
3153
3153
  };
3154
3154
  }
3155
- function _define_property$G(obj, key, value) {
3155
+ function _define_property$H(obj, key, value) {
3156
3156
  if (key in obj) {
3157
3157
  Object.defineProperty(obj, key, {
3158
3158
  value: value,
@@ -3173,7 +3173,7 @@ function _instanceof$n(left, right) {
3173
3173
  return left instanceof right;
3174
3174
  }
3175
3175
  }
3176
- function _object_spread$G(target) {
3176
+ function _object_spread$H(target) {
3177
3177
  for(var i = 1; i < arguments.length; i++){
3178
3178
  var source = arguments[i] != null ? arguments[i] : {};
3179
3179
  var ownKeys = Object.keys(source);
@@ -3183,12 +3183,12 @@ function _object_spread$G(target) {
3183
3183
  }));
3184
3184
  }
3185
3185
  ownKeys.forEach(function(key) {
3186
- _define_property$G(target, key, source[key]);
3186
+ _define_property$H(target, key, source[key]);
3187
3187
  });
3188
3188
  }
3189
3189
  return target;
3190
3190
  }
3191
- function ownKeys$o(object, enumerableOnly) {
3191
+ function ownKeys$p(object, enumerableOnly) {
3192
3192
  var keys = Object.keys(object);
3193
3193
  if (Object.getOwnPropertySymbols) {
3194
3194
  var symbols = Object.getOwnPropertySymbols(object);
@@ -3196,12 +3196,12 @@ function ownKeys$o(object, enumerableOnly) {
3196
3196
  }
3197
3197
  return keys;
3198
3198
  }
3199
- function _object_spread_props$o(target, source) {
3199
+ function _object_spread_props$p(target, source) {
3200
3200
  source = source != null ? source : {};
3201
3201
  if (Object.getOwnPropertyDescriptors) {
3202
3202
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
3203
3203
  } else {
3204
- ownKeys$o(Object(source)).forEach(function(key) {
3204
+ ownKeys$p(Object(source)).forEach(function(key) {
3205
3205
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
3206
3206
  });
3207
3207
  }
@@ -3360,7 +3360,7 @@ function _ts_generator$18(thisArg, body) {
3360
3360
  });
3361
3361
  }
3362
3362
  }
3363
- params = _object_spread_props$o(_object_spread$G({
3363
+ params = _object_spread_props$p(_object_spread$H({
3364
3364
  modelType: argv.model,
3365
3365
  call: argv.verb
3366
3366
  }, argv.specifier == null ? {} : {
@@ -3384,7 +3384,7 @@ function _ts_generator$18(thisArg, body) {
3384
3384
  })
3385
3385
  };
3386
3386
 
3387
- function _array_like_to_array$Z(arr, len) {
3387
+ function _array_like_to_array$_(arr, len) {
3388
3388
  if (len == null || len > arr.length) len = arr.length;
3389
3389
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
3390
3390
  return arr2;
@@ -3428,19 +3428,19 @@ function _non_iterable_rest$e() {
3428
3428
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
3429
3429
  }
3430
3430
  function _sliced_to_array$e(arr, i) {
3431
- return _array_with_holes$e(arr) || _iterable_to_array_limit$e(arr, i) || _unsupported_iterable_to_array$Z(arr, i) || _non_iterable_rest$e();
3431
+ return _array_with_holes$e(arr) || _iterable_to_array_limit$e(arr, i) || _unsupported_iterable_to_array$_(arr, i) || _non_iterable_rest$e();
3432
3432
  }
3433
3433
  function _type_of(obj) {
3434
3434
  "@swc/helpers - typeof";
3435
3435
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
3436
3436
  }
3437
- function _unsupported_iterable_to_array$Z(o, minLen) {
3437
+ function _unsupported_iterable_to_array$_(o, minLen) {
3438
3438
  if (!o) return;
3439
- if (typeof o === "string") return _array_like_to_array$Z(o, minLen);
3439
+ if (typeof o === "string") return _array_like_to_array$_(o, minLen);
3440
3440
  var n = Object.prototype.toString.call(o).slice(8, -1);
3441
3441
  if (n === "Object" && o.constructor) n = o.constructor.name;
3442
3442
  if (n === "Map" || n === "Set") return Array.from(n);
3443
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$Z(o, minLen);
3443
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$_(o, minLen);
3444
3444
  }
3445
3445
  /**
3446
3446
  * Resolves the manifest entry for `modelType`. Lookup tries
@@ -3593,30 +3593,30 @@ function isPlainObject(value) {
3593
3593
  return result;
3594
3594
  }
3595
3595
 
3596
- function _array_like_to_array$Y(arr, len) {
3596
+ function _array_like_to_array$Z(arr, len) {
3597
3597
  if (len == null || len > arr.length) len = arr.length;
3598
3598
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
3599
3599
  return arr2;
3600
3600
  }
3601
- function _array_without_holes$U(arr) {
3602
- if (Array.isArray(arr)) return _array_like_to_array$Y(arr);
3601
+ function _array_without_holes$V(arr) {
3602
+ if (Array.isArray(arr)) return _array_like_to_array$Z(arr);
3603
3603
  }
3604
- function _iterable_to_array$U(iter) {
3604
+ function _iterable_to_array$V(iter) {
3605
3605
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
3606
3606
  }
3607
- function _non_iterable_spread$U() {
3607
+ function _non_iterable_spread$V() {
3608
3608
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
3609
3609
  }
3610
- function _to_consumable_array$U(arr) {
3611
- return _array_without_holes$U(arr) || _iterable_to_array$U(arr) || _unsupported_iterable_to_array$Y(arr) || _non_iterable_spread$U();
3610
+ function _to_consumable_array$V(arr) {
3611
+ return _array_without_holes$V(arr) || _iterable_to_array$V(arr) || _unsupported_iterable_to_array$Z(arr) || _non_iterable_spread$V();
3612
3612
  }
3613
- function _unsupported_iterable_to_array$Y(o, minLen) {
3613
+ function _unsupported_iterable_to_array$Z(o, minLen) {
3614
3614
  if (!o) return;
3615
- if (typeof o === "string") return _array_like_to_array$Y(o, minLen);
3615
+ if (typeof o === "string") return _array_like_to_array$Z(o, minLen);
3616
3616
  var n = Object.prototype.toString.call(o).slice(8, -1);
3617
3617
  if (n === "Object" && o.constructor) n = o.constructor.name;
3618
3618
  if (n === "Map" || n === "Set") return Array.from(n);
3619
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$Y(o, minLen);
3619
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$Z(o, minLen);
3620
3620
  }
3621
3621
  /**
3622
3622
  * Default command name for the model-decode command. Top-level so it stays
@@ -3743,13 +3743,13 @@ function toSegment(prefix, id, entry) {
3743
3743
  *
3744
3744
  * @__NO_SIDE_EFFECTS__
3745
3745
  */ function renderDecodedKey(decoded) {
3746
- var lines = _to_consumable_array$U(renderLeafLines(decoded.leaf));
3746
+ var lines = _to_consumable_array$V(renderLeafLines(decoded.leaf));
3747
3747
  if (decoded.ancestors.length > 0) {
3748
3748
  var _lines;
3749
3749
  (_lines = lines).push.apply(_lines, [
3750
3750
  '',
3751
3751
  'Parent chain:'
3752
- ].concat(_to_consumable_array$U(decoded.ancestors.map(renderAncestorLine))));
3752
+ ].concat(_to_consumable_array$V(decoded.ancestors.map(renderAncestorLine))));
3753
3753
  }
3754
3754
  if (decoded.unresolvedPrefixes.length > 0) {
3755
3755
  var suffix = decoded.unresolvedPrefixes.length === 1 ? '' : 'es';
@@ -3785,7 +3785,7 @@ function renderAncestorLine(ancestor) {
3785
3785
  return ancestor.modelName ? "- ".concat(ancestor.modelName, " — prefix ").concat(ancestor.prefix, ", id ").concat(ancestor.id) : "- <unknown> — prefix ".concat(ancestor.prefix, ", id ").concat(ancestor.id);
3786
3786
  }
3787
3787
 
3788
- function _array_like_to_array$X(arr, len) {
3788
+ function _array_like_to_array$Y(arr, len) {
3789
3789
  if (len == null || len > arr.length) len = arr.length;
3790
3790
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
3791
3791
  return arr2;
@@ -3793,10 +3793,10 @@ function _array_like_to_array$X(arr, len) {
3793
3793
  function _array_with_holes$d(arr) {
3794
3794
  if (Array.isArray(arr)) return arr;
3795
3795
  }
3796
- function _array_without_holes$T(arr) {
3797
- if (Array.isArray(arr)) return _array_like_to_array$X(arr);
3796
+ function _array_without_holes$U(arr) {
3797
+ if (Array.isArray(arr)) return _array_like_to_array$Y(arr);
3798
3798
  }
3799
- function _iterable_to_array$T(iter) {
3799
+ function _iterable_to_array$U(iter) {
3800
3800
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
3801
3801
  }
3802
3802
  function _iterable_to_array_limit$d(arr, i) {
@@ -3826,22 +3826,22 @@ function _iterable_to_array_limit$d(arr, i) {
3826
3826
  function _non_iterable_rest$d() {
3827
3827
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
3828
3828
  }
3829
- function _non_iterable_spread$T() {
3829
+ function _non_iterable_spread$U() {
3830
3830
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
3831
3831
  }
3832
3832
  function _sliced_to_array$d(arr, i) {
3833
- return _array_with_holes$d(arr) || _iterable_to_array_limit$d(arr, i) || _unsupported_iterable_to_array$X(arr, i) || _non_iterable_rest$d();
3833
+ return _array_with_holes$d(arr) || _iterable_to_array_limit$d(arr, i) || _unsupported_iterable_to_array$Y(arr, i) || _non_iterable_rest$d();
3834
3834
  }
3835
- function _to_consumable_array$T(arr) {
3836
- return _array_without_holes$T(arr) || _iterable_to_array$T(arr) || _unsupported_iterable_to_array$X(arr) || _non_iterable_spread$T();
3835
+ function _to_consumable_array$U(arr) {
3836
+ return _array_without_holes$U(arr) || _iterable_to_array$U(arr) || _unsupported_iterable_to_array$Y(arr) || _non_iterable_spread$U();
3837
3837
  }
3838
- function _unsupported_iterable_to_array$X(o, minLen) {
3838
+ function _unsupported_iterable_to_array$Y(o, minLen) {
3839
3839
  if (!o) return;
3840
- if (typeof o === "string") return _array_like_to_array$X(o, minLen);
3840
+ if (typeof o === "string") return _array_like_to_array$Y(o, minLen);
3841
3841
  var n = Object.prototype.toString.call(o).slice(8, -1);
3842
3842
  if (n === "Object" && o.constructor) n = o.constructor.name;
3843
3843
  if (n === "Map" || n === "Set") return Array.from(n);
3844
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$X(o, minLen);
3844
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$Y(o, minLen);
3845
3845
  }
3846
3846
  /**
3847
3847
  * Parses the positionals for the top-level `get <modelOrKey> [key]` command into a
@@ -3947,7 +3947,7 @@ function _unsupported_iterable_to_array$X(o, minLen) {
3947
3947
  if (firstArg.includes('/')) {
3948
3948
  var keys = [
3949
3949
  firstArg
3950
- ].concat(_to_consumable_array$T(rest));
3950
+ ].concat(_to_consumable_array$U(rest));
3951
3951
  result = inferModelTypeFromKeys(keys, input.manifest);
3952
3952
  } else {
3953
3953
  if (rest.length === 0) {
@@ -4005,7 +4005,7 @@ function inferModelTypeFromKeys(keys, manifest) {
4005
4005
  }
4006
4006
  if (decodedTypes.size > 1) {
4007
4007
  throw new CliError({
4008
- message: "get-many: all keys must belong to the same modelType. Got: ".concat(_to_consumable_array$T(decodedTypes).join(', '), ". Split into separate calls."),
4008
+ message: "get-many: all keys must belong to the same modelType. Got: ".concat(_to_consumable_array$U(decodedTypes).join(', '), ". Split into separate calls."),
4009
4009
  code: 'INVALID_ARGUMENT'
4010
4010
  });
4011
4011
  }
@@ -4428,7 +4428,7 @@ function _async_to_generator$15(fn) {
4428
4428
  });
4429
4429
  };
4430
4430
  }
4431
- function _define_property$F(obj, key, value) {
4431
+ function _define_property$G(obj, key, value) {
4432
4432
  if (key in obj) {
4433
4433
  Object.defineProperty(obj, key, {
4434
4434
  value: value,
@@ -4441,7 +4441,7 @@ function _define_property$F(obj, key, value) {
4441
4441
  }
4442
4442
  return obj;
4443
4443
  }
4444
- function _object_spread$F(target) {
4444
+ function _object_spread$G(target) {
4445
4445
  for(var i = 1; i < arguments.length; i++){
4446
4446
  var source = arguments[i] != null ? arguments[i] : {};
4447
4447
  var ownKeys = Object.keys(source);
@@ -4451,7 +4451,7 @@ function _object_spread$F(target) {
4451
4451
  }));
4452
4452
  }
4453
4453
  ownKeys.forEach(function(key) {
4454
- _define_property$F(target, key, source[key]);
4454
+ _define_property$G(target, key, source[key]);
4455
4455
  });
4456
4456
  }
4457
4457
  return target;
@@ -4627,7 +4627,7 @@ function _ts_generator$15(thisArg, body) {
4627
4627
  existing = (_ref = _state.sent()) !== null && _ref !== void 0 ? _ref : {};
4628
4628
  merged = {
4629
4629
  activeEnv: (_input_updates_activeEnv = input.updates.activeEnv) !== null && _input_updates_activeEnv !== void 0 ? _input_updates_activeEnv : existing.activeEnv,
4630
- envs: input.updates.envs ? _object_spread$F({}, existing.envs, input.updates.envs) : existing.envs,
4630
+ envs: input.updates.envs ? _object_spread$G({}, existing.envs, input.updates.envs) : existing.envs,
4631
4631
  output: input.updates.output === undefined ? existing.output : mergeOutputConfig(existing.output, input.updates.output)
4632
4632
  };
4633
4633
  return [
@@ -4669,12 +4669,12 @@ function mergeOutputCommandsConfig(existing, updates) {
4669
4669
  var result;
4670
4670
  if ('commands' in updates) {
4671
4671
  if (updates.commands) {
4672
- var merged = _object_spread$F({}, existing);
4672
+ var merged = _object_spread$G({}, existing);
4673
4673
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
4674
4674
  try {
4675
4675
  for(var _iterator = Object.keys(updates.commands)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
4676
4676
  var key = _step.value;
4677
- merged[key] = _object_spread$F({}, existing === null || existing === void 0 ? void 0 : existing[key], updates.commands[key]);
4677
+ merged[key] = _object_spread$G({}, existing === null || existing === void 0 ? void 0 : existing[key], updates.commands[key]);
4678
4678
  }
4679
4679
  } catch (err) {
4680
4680
  _didIteratorError = true;
@@ -4739,6 +4739,78 @@ function mergeOutputCommandsConfig(existing, updates) {
4739
4739
  return result;
4740
4740
  }
4741
4741
 
4742
+ function _array_like_to_array$X(arr, len) {
4743
+ if (len == null || len > arr.length) len = arr.length;
4744
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
4745
+ return arr2;
4746
+ }
4747
+ function _array_without_holes$T(arr) {
4748
+ if (Array.isArray(arr)) return _array_like_to_array$X(arr);
4749
+ }
4750
+ function _define_property$F(obj, key, value) {
4751
+ if (key in obj) {
4752
+ Object.defineProperty(obj, key, {
4753
+ value: value,
4754
+ enumerable: true,
4755
+ configurable: true,
4756
+ writable: true
4757
+ });
4758
+ } else {
4759
+ obj[key] = value;
4760
+ }
4761
+ return obj;
4762
+ }
4763
+ function _iterable_to_array$T(iter) {
4764
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
4765
+ }
4766
+ function _non_iterable_spread$T() {
4767
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
4768
+ }
4769
+ function _object_spread$F(target) {
4770
+ for(var i = 1; i < arguments.length; i++){
4771
+ var source = arguments[i] != null ? arguments[i] : {};
4772
+ var ownKeys = Object.keys(source);
4773
+ if (typeof Object.getOwnPropertySymbols === "function") {
4774
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
4775
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
4776
+ }));
4777
+ }
4778
+ ownKeys.forEach(function(key) {
4779
+ _define_property$F(target, key, source[key]);
4780
+ });
4781
+ }
4782
+ return target;
4783
+ }
4784
+ function ownKeys$o(object, enumerableOnly) {
4785
+ var keys = Object.keys(object);
4786
+ if (Object.getOwnPropertySymbols) {
4787
+ var symbols = Object.getOwnPropertySymbols(object);
4788
+ keys.push.apply(keys, symbols);
4789
+ }
4790
+ return keys;
4791
+ }
4792
+ function _object_spread_props$o(target, source) {
4793
+ source = source != null ? source : {};
4794
+ if (Object.getOwnPropertyDescriptors) {
4795
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
4796
+ } else {
4797
+ ownKeys$o(Object(source)).forEach(function(key) {
4798
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
4799
+ });
4800
+ }
4801
+ return target;
4802
+ }
4803
+ function _to_consumable_array$T(arr) {
4804
+ return _array_without_holes$T(arr) || _iterable_to_array$T(arr) || _unsupported_iterable_to_array$X(arr) || _non_iterable_spread$T();
4805
+ }
4806
+ function _unsupported_iterable_to_array$X(o, minLen) {
4807
+ if (!o) return;
4808
+ if (typeof o === "string") return _array_like_to_array$X(o, minLen);
4809
+ var n = Object.prototype.toString.call(o).slice(8, -1);
4810
+ if (n === "Object" && o.constructor) n = o.constructor.name;
4811
+ if (n === "Map" || n === "Set") return Array.from(n);
4812
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$X(o, minLen);
4813
+ }
4742
4814
  /**
4743
4815
  * The default OAuth/OIDC scopes requested by the CLI when none are configured.
4744
4816
  */ var DEFAULT_CLI_OIDC_SCOPES = 'openid profile email';
@@ -4758,6 +4830,17 @@ function mergeOutputCommandsConfig(existing, updates) {
4758
4830
  *
4759
4831
  * Opens up to nothing in the browser so the user can copy/paste the resulting token url back into the CLI.
4760
4832
  */ var DEFAULT_CLI_REDIRECT_URI = 'http://127.0.0.1:0/callback';
4833
+ /**
4834
+ * The generic OIDC scopes a `--service-token` login adds to the requested set.
4835
+ *
4836
+ * `token.service` triggers the admin-only, long-lived, non-rotating behavior server-side;
4837
+ * `offline_access` is required so a refresh token is issued (the durable credential the server env
4838
+ * consumes). The app's own resource scope (e.g. `demo`) is intentionally NOT included here — it
4839
+ * already lives in the configured `env.scopes`, keeping this generic CLI app-agnostic.
4840
+ */ var SERVICE_TOKEN_REQUIRED_OIDC_SCOPES = [
4841
+ 'token.service',
4842
+ 'offline_access'
4843
+ ];
4761
4844
  /**
4762
4845
  * Returns the input scope string with the `model.create`, `model.update`, and `model.delete`
4763
4846
  * scopes removed, preserving every other scope (including `model.read` and `model.query`).
@@ -4773,6 +4856,41 @@ function mergeOutputCommandsConfig(existing, updates) {
4773
4856
  return s.length > 0 && !writeScopes.has(s);
4774
4857
  }).join(' ');
4775
4858
  }
4859
+ /**
4860
+ * Returns the input scope string with the {@link SERVICE_TOKEN_REQUIRED_OIDC_SCOPES} unioned in
4861
+ * (de-duplicated), preserving every other already-requested scope.
4862
+ *
4863
+ * Drives the `auth login --service-token` flag. Combinable with `filterReadOnlyModelScopes` — apply
4864
+ * the read-only filter first, then this, so a service token can still be read-only.
4865
+ *
4866
+ * @param scopes - Space-separated scope list, or `undefined` to augment the default scopes.
4867
+ * @returns The augmented space-separated scope list.
4868
+ */ function withServiceTokenScopes(scopes) {
4869
+ var result = new Set((scopes !== null && scopes !== void 0 ? scopes : DEFAULT_CLI_OIDC_SCOPES).split(/\s+/).filter(function(s) {
4870
+ return s.length > 0;
4871
+ }));
4872
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
4873
+ try {
4874
+ for(var _iterator = SERVICE_TOKEN_REQUIRED_OIDC_SCOPES[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
4875
+ var scope = _step.value;
4876
+ result.add(scope);
4877
+ }
4878
+ } catch (err) {
4879
+ _didIteratorError = true;
4880
+ _iteratorError = err;
4881
+ } finally{
4882
+ try {
4883
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
4884
+ _iterator.return();
4885
+ }
4886
+ } finally{
4887
+ if (_didIteratorError) {
4888
+ throw _iteratorError;
4889
+ }
4890
+ }
4891
+ }
4892
+ return _to_consumable_array$T(result).join(' ');
4893
+ }
4776
4894
  /**
4777
4895
  * Returns the {@link CliEnvDefault} whose `names` includes the given env name, or `undefined`.
4778
4896
  *
@@ -4869,6 +4987,42 @@ function nonEmpty(value) {
4869
4987
  */ function isCliEnvConfigComplete(env) {
4870
4988
  return Boolean((env === null || env === void 0 ? void 0 : env.apiBaseUrl) && (env === null || env === void 0 ? void 0 : env.oidcIssuer) && (env === null || env === void 0 ? void 0 : env.clientId) && (env === null || env === void 0 ? void 0 : env.clientSecret) && (env === null || env === void 0 ? void 0 : env.redirectUri));
4871
4989
  }
4990
+ /**
4991
+ * Reads an OAuth token entry from environment variables, for non-interactive server consumption.
4992
+ *
4993
+ * Reads `<PREFIX>_REFRESH_TOKEN` (required) plus the optional `<PREFIX>_ACCESS_TOKEN` and
4994
+ * `<PREFIX>_TOKEN_SCOPE`, where `PREFIX = cliName.replaceAll('-', '_').toUpperCase()` (the existing
4995
+ * env-var prefix convention). The intended credential is a long-lived, non-rotating service token
4996
+ * (see `auth login --service-token`).
4997
+ *
4998
+ * Returns `undefined` when no refresh token is present. When only a refresh token is supplied, the
4999
+ * returned entry has `accessToken: ''` and `expiresAt: 0` so the first use is forced to mint an
5000
+ * access token via a refresh. The entry is flagged `fromEnv: true` so the middleware does not write
5001
+ * it back to the on-disk cache.
5002
+ *
5003
+ * @param input - The lookup inputs.
5004
+ * @param input.cliName - The CLI name used to derive the env-var prefix (e.g. `demo-cli` → `DEMO_CLI`).
5005
+ * @returns The env-sourced {@link CliTokenEntry}, or `undefined` when no refresh token is set.
5006
+ */ function readEnvTokenEntry(input) {
5007
+ var prefix = input.cliName.replaceAll('-', '_').toUpperCase();
5008
+ var refreshToken = nonEmpty(process.env["".concat(prefix, "_REFRESH_TOKEN")]);
5009
+ var result;
5010
+ if (refreshToken) {
5011
+ var accessToken = nonEmpty(process.env["".concat(prefix, "_ACCESS_TOKEN")]);
5012
+ var scope = nonEmpty(process.env["".concat(prefix, "_TOKEN_SCOPE")]);
5013
+ result = _object_spread_props$o(_object_spread$F({
5014
+ accessToken: accessToken !== null && accessToken !== void 0 ? accessToken : '',
5015
+ refreshToken: refreshToken,
5016
+ // No reliable expiry is supplied via env, so force a refresh on first use (expiresAt 0 = expired).
5017
+ expiresAt: 0
5018
+ }, scope ? {
5019
+ scope: scope
5020
+ } : {}), {
5021
+ fromEnv: true
5022
+ });
5023
+ }
5024
+ return result;
5025
+ }
4872
5026
 
4873
5027
  function asyncGeneratorStep$14(gen, resolve, reject, _next, _throw, key, arg) {
4874
5028
  try {
@@ -5640,6 +5794,52 @@ function _ts_generator$13(thisArg, body) {
5640
5794
  });
5641
5795
  })();
5642
5796
  }
5797
+ /**
5798
+ * Fetches the dbx-components `GET /oidc/session` route and returns the parsed session lifetime metadata.
5799
+ *
5800
+ * Mirrors {@link fetchUserInfo}, but reads the access token's baked-in session-lifetime claims
5801
+ * (`dbx_session_expires_at` / `dbx_rotation_disabled`) which userinfo does not echo.
5802
+ *
5803
+ * @param input - The session request.
5804
+ * @param input.sessionEndpoint - The `GET /oidc/session` endpoint URL.
5805
+ * @param input.accessToken - The Bearer access token sent in the `Authorization` header.
5806
+ * @returns The parsed {@link OidcSessionInfo}. Throws a {@link CliError} (`SESSION_INFO_FAILED`) on a non-OK response.
5807
+ */ function fetchSessionInfo(input) {
5808
+ return _async_to_generator$13(function() {
5809
+ var res;
5810
+ return _ts_generator$13(this, function(_state) {
5811
+ switch(_state.label){
5812
+ case 0:
5813
+ return [
5814
+ 4,
5815
+ tracedFetch(undefined, input.sessionEndpoint, {
5816
+ headers: {
5817
+ Authorization: "Bearer ".concat(input.accessToken),
5818
+ Accept: 'application/json'
5819
+ }
5820
+ })
5821
+ ];
5822
+ case 1:
5823
+ res = _state.sent();
5824
+ if (!res.ok) {
5825
+ throw new CliError({
5826
+ message: "Session info request failed: ".concat(res.status, " ").concat(res.statusText),
5827
+ code: 'SESSION_INFO_FAILED'
5828
+ });
5829
+ }
5830
+ return [
5831
+ 4,
5832
+ res.json()
5833
+ ];
5834
+ case 2:
5835
+ return [
5836
+ 2,
5837
+ _state.sent()
5838
+ ];
5839
+ }
5840
+ });
5841
+ })();
5842
+ }
5643
5843
  function postTokenEndpoint(input) {
5644
5844
  return _async_to_generator$13(function() {
5645
5845
  var res, body, _ref, _body_error_description, message;
@@ -6445,6 +6645,83 @@ function resolveAuthSetupPrompt(input) {
6445
6645
  });
6446
6646
  })();
6447
6647
  }
6648
+ /**
6649
+ * Builds the `GET /oidc/session` endpoint URL from the env's OIDC issuer (`<oidcIssuer>/session`).
6650
+ *
6651
+ * @param oidcIssuer - The env's OIDC issuer URL.
6652
+ * @returns The session endpoint URL.
6653
+ */ function buildSessionEndpoint(oidcIssuer) {
6654
+ return "".concat(oidcIssuer.replace(/\/+$/, ''), "/session");
6655
+ }
6656
+ /**
6657
+ * Best-effort fetch of the session lifetime metadata for an access token. Returns `undefined` when
6658
+ * the route is unavailable or errors, so callers can treat the session info as supplemental.
6659
+ *
6660
+ * @param input - The lookup inputs.
6661
+ * @param input.oidcIssuer - The env's OIDC issuer URL (used to derive the session endpoint).
6662
+ * @param input.accessToken - The Bearer access token.
6663
+ * @returns The {@link OidcSessionInfo}, or `undefined` on any failure.
6664
+ */ function loadSessionInfoSafely(input) {
6665
+ return _async_to_generator$11(function() {
6666
+ var result;
6667
+ return _ts_generator$11(this, function(_state) {
6668
+ switch(_state.label){
6669
+ case 0:
6670
+ _state.trys.push([
6671
+ 0,
6672
+ 2,
6673
+ ,
6674
+ 3
6675
+ ]);
6676
+ return [
6677
+ 4,
6678
+ fetchSessionInfo({
6679
+ sessionEndpoint: buildSessionEndpoint(input.oidcIssuer),
6680
+ accessToken: input.accessToken
6681
+ })
6682
+ ];
6683
+ case 1:
6684
+ result = _state.sent();
6685
+ return [
6686
+ 3,
6687
+ 3
6688
+ ];
6689
+ case 2:
6690
+ _state.sent();
6691
+ // Supplemental — older servers without the /oidc/session route, or transient errors, are non-fatal.
6692
+ result = undefined;
6693
+ return [
6694
+ 3,
6695
+ 3
6696
+ ];
6697
+ case 3:
6698
+ return [
6699
+ 2,
6700
+ result
6701
+ ];
6702
+ }
6703
+ });
6704
+ })();
6705
+ }
6706
+ /**
6707
+ * Renders a human-readable session-lifetime summary, e.g. `valid until 2027-06-01T00:00:00.000Z (~365 days), rotation: disabled`.
6708
+ *
6709
+ * @param input - The session lifetime fields.
6710
+ * @param input.sessionExpiresAt - Grant expiry as unix epoch seconds.
6711
+ * @param input.rotationDisabled - Whether refresh-token rotation is disabled.
6712
+ * @param input.nowMs - Current time in unix epoch milliseconds. Defaults to `Date.now()`.
6713
+ * @returns The summary line, or `undefined` when no `sessionExpiresAt` is available.
6714
+ */ function describeSessionLifetime(input) {
6715
+ var result;
6716
+ if (input.sessionExpiresAt != null) {
6717
+ var _input_nowMs;
6718
+ var expiresMs = input.sessionExpiresAt * util.MS_IN_SECOND;
6719
+ var days = Math.max(0, Math.round((expiresMs - ((_input_nowMs = input.nowMs) !== null && _input_nowMs !== void 0 ? _input_nowMs : Date.now())) / util.MS_IN_SECOND / 86400));
6720
+ var rotation = input.rotationDisabled ? 'disabled' : 'enabled';
6721
+ result = "valid until ".concat(new Date(expiresMs).toISOString(), " (~").concat(days, " days), rotation: ").concat(rotation);
6722
+ }
6723
+ return result;
6724
+ }
6448
6725
  /**
6449
6726
  * Factory for the built-in `auth` command tree.
6450
6727
  *
@@ -6644,6 +6921,11 @@ function resolveAuthSetupPrompt(input) {
6644
6921
  type: 'boolean',
6645
6922
  default: false,
6646
6923
  describe: 'Drop model.create/model.update/model.delete from the requested scopes (keeps model.read and model.query)'
6924
+ }).option('service-token', {
6925
+ type: 'boolean',
6926
+ default: false,
6927
+ alias: 'long-lived',
6928
+ describe: 'Request a long-lived, non-rotating admin service token (adds token.service + offline_access). Combine with --login-for.'
6647
6929
  }).option('login-for', {
6648
6930
  type: 'string',
6649
6931
  describe: 'Requested login duration with a unit (e.g. 30d, 12h, 3600s). Mixed units are allowed (e.g. "1h30m", "2d 12h"). Subject to server/client caps. Applied to Session, Grant, and RefreshToken.'
@@ -6651,7 +6933,7 @@ function resolveAuthSetupPrompt(input) {
6651
6933
  },
6652
6934
  handler: wrapCommandHandler(function(argv) {
6653
6935
  return _async_to_generator$11(function() {
6654
- var _argv_code, _tokenResponse_expires_in, _ref, envName, env, meta, _ref1, codeVerifier, codeChallenge, state, requestedScopes, requestedSessionTtlSeconds, ms, url, pasted, _tmp, code, tokenResponse, expiresAt, entry;
6936
+ var _argv_code, _tokenResponse_expires_in, _ref, _ref1, envName, env, meta, _ref2, codeVerifier, codeChallenge, state, requestedScopes, requestedSessionTtlSeconds, ms, url, pasted, _tmp, code, tokenResponse, expiresAt, sessionInfo, sessionExpiresAt, rotationDisabled, entry, sessionSummary;
6655
6937
  return _ts_generator$11(this, function(_state) {
6656
6938
  switch(_state.label){
6657
6939
  case 0:
@@ -6667,7 +6949,7 @@ function resolveAuthSetupPrompt(input) {
6667
6949
  })
6668
6950
  ];
6669
6951
  case 1:
6670
- _ref = _state.sent(), envName = _ref.envName, env = _ref.env;
6952
+ _ref1 = _state.sent(), envName = _ref1.envName, env = _ref1.env;
6671
6953
  return [
6672
6954
  4,
6673
6955
  discoverOidcMetadata({
@@ -6682,9 +6964,15 @@ function resolveAuthSetupPrompt(input) {
6682
6964
  generatePkceMaterial()
6683
6965
  ];
6684
6966
  case 3:
6685
- _ref1 = _state.sent(), codeVerifier = _ref1.codeVerifier, codeChallenge = _ref1.codeChallenge;
6967
+ _ref2 = _state.sent(), codeVerifier = _ref2.codeVerifier, codeChallenge = _ref2.codeChallenge;
6686
6968
  state = generateOAuthState();
6687
6969
  requestedScopes = argv.readOnlyScopes ? filterReadOnlyModelScopes(env.scopes) : env.scopes;
6970
+ if (argv.serviceToken) {
6971
+ // Adds token.service + offline_access (de-duped); applied after the read-only filter so a
6972
+ // service token can still be read-only. The provider hard-rejects a non-admin and clamps
6973
+ // the duration to the service-token tier (up to 1 year).
6974
+ requestedScopes = withServiceTokenScopes(requestedScopes);
6975
+ }
6688
6976
  if (argv.loginFor) {
6689
6977
  ms = date.durationDataToMilliseconds(date.parseDurationString(argv.loginFor));
6690
6978
  if (ms <= 0) {
@@ -6749,20 +7037,43 @@ function resolveAuthSetupPrompt(input) {
6749
7037
  case 7:
6750
7038
  tokenResponse = _state.sent();
6751
7039
  expiresAt = Date.now() + ((_tokenResponse_expires_in = tokenResponse.expires_in) !== null && _tokenResponse_expires_in !== void 0 ? _tokenResponse_expires_in : 0) * 1000;
6752
- entry = {
7040
+ return [
7041
+ 4,
7042
+ loadSessionInfoSafely({
7043
+ oidcIssuer: env.oidcIssuer,
7044
+ accessToken: tokenResponse.access_token
7045
+ })
7046
+ ];
7047
+ case 8:
7048
+ sessionInfo = _state.sent();
7049
+ sessionExpiresAt = (_ref = sessionInfo === null || sessionInfo === void 0 ? void 0 : sessionInfo.expiresAt) !== null && _ref !== void 0 ? _ref : undefined;
7050
+ rotationDisabled = sessionInfo === null || sessionInfo === void 0 ? void 0 : sessionInfo.rotationDisabled;
7051
+ entry = _object_spread$D({
6753
7052
  accessToken: tokenResponse.access_token,
6754
7053
  refreshToken: tokenResponse.refresh_token,
6755
7054
  idToken: tokenResponse.id_token,
6756
7055
  tokenType: tokenResponse.token_type,
6757
7056
  scope: tokenResponse.scope,
6758
7057
  expiresAt: expiresAt
6759
- };
7058
+ }, sessionExpiresAt != null ? {
7059
+ sessionExpiresAt: sessionExpiresAt
7060
+ } : {}, rotationDisabled != null ? {
7061
+ rotationDisabled: rotationDisabled
7062
+ } : {});
6760
7063
  return [
6761
7064
  4,
6762
7065
  tokens.set(envName, entry)
6763
7066
  ];
6764
- case 8:
7067
+ case 9:
6765
7068
  _state.sent();
7069
+ sessionSummary = describeSessionLifetime({
7070
+ sessionExpiresAt: sessionExpiresAt,
7071
+ rotationDisabled: rotationDisabled
7072
+ });
7073
+ if (sessionSummary) {
7074
+ // Emit through stderr so JSON stdout stays parseable.
7075
+ process.stderr.write("Session: ".concat(sessionSummary, "\n"));
7076
+ }
6766
7077
  outputResult({
6767
7078
  loggedIn: true,
6768
7079
  env: envName,
@@ -6770,7 +7081,9 @@ function resolveAuthSetupPrompt(input) {
6770
7081
  refreshToken: entry.refreshToken ? maskSecret(entry.refreshToken) : undefined,
6771
7082
  tokenType: entry.tokenType,
6772
7083
  scope: entry.scope,
6773
- expiresAt: expiresAt
7084
+ expiresAt: expiresAt,
7085
+ sessionExpiresAt: sessionExpiresAt,
7086
+ rotationDisabled: rotationDisabled
6774
7087
  });
6775
7088
  return [
6776
7089
  2
@@ -6892,7 +7205,7 @@ function resolveAuthSetupPrompt(input) {
6892
7205
  },
6893
7206
  handler: wrapCommandHandler(function(argv) {
6894
7207
  return _async_to_generator$11(function() {
6895
- var _ref, envName, env, entry, expired, meta, userinfoEndpoint, claims;
7208
+ var _ref, envName, env, entry, _ref1, _ref2, expired, sessionInfo, sessionExpiresAt, rotationDisabled, session, meta, userinfoEndpoint, claims;
6896
7209
  return _ts_generator$11(this, function(_state) {
6897
7210
  switch(_state.label){
6898
7211
  case 0:
@@ -6916,9 +7229,24 @@ function resolveAuthSetupPrompt(input) {
6916
7229
  entry = _state.sent();
6917
7230
  if (!entry) return [
6918
7231
  3,
6919
- 7
7232
+ 8
6920
7233
  ];
6921
7234
  expired = isTokenExpired(entry);
7235
+ return [
7236
+ 4,
7237
+ loadSessionInfoSafely({
7238
+ oidcIssuer: env.oidcIssuer,
7239
+ accessToken: entry.accessToken
7240
+ })
7241
+ ];
7242
+ case 3:
7243
+ sessionInfo = _state.sent();
7244
+ sessionExpiresAt = (_ref1 = sessionInfo === null || sessionInfo === void 0 ? void 0 : sessionInfo.expiresAt) !== null && _ref1 !== void 0 ? _ref1 : entry.sessionExpiresAt;
7245
+ rotationDisabled = (_ref2 = sessionInfo === null || sessionInfo === void 0 ? void 0 : sessionInfo.rotationDisabled) !== null && _ref2 !== void 0 ? _ref2 : entry.rotationDisabled;
7246
+ session = describeSessionLifetime({
7247
+ sessionExpiresAt: sessionExpiresAt !== null && sessionExpiresAt !== void 0 ? sessionExpiresAt : undefined,
7248
+ rotationDisabled: rotationDisabled
7249
+ });
6922
7250
  return [
6923
7251
  4,
6924
7252
  discoverOidcMetadata({
@@ -6926,12 +7254,12 @@ function resolveAuthSetupPrompt(input) {
6926
7254
  fallbackBaseUrl: env.apiBaseUrl
6927
7255
  })
6928
7256
  ];
6929
- case 3:
7257
+ case 4:
6930
7258
  meta = _state.sent();
6931
7259
  userinfoEndpoint = meta.userinfo_endpoint;
6932
7260
  if (!userinfoEndpoint) return [
6933
7261
  3,
6934
- 5
7262
+ 6
6935
7263
  ];
6936
7264
  return [
6937
7265
  4,
@@ -6940,7 +7268,7 @@ function resolveAuthSetupPrompt(input) {
6940
7268
  accessToken: entry.accessToken
6941
7269
  })
6942
7270
  ];
6943
- case 4:
7271
+ case 5:
6944
7272
  claims = _state.sent();
6945
7273
  outputResult({
6946
7274
  env: envName,
@@ -6948,35 +7276,41 @@ function resolveAuthSetupPrompt(input) {
6948
7276
  expiresAt: entry.expiresAt,
6949
7277
  expired: expired,
6950
7278
  scope: entry.scope,
7279
+ sessionExpiresAt: sessionExpiresAt,
7280
+ rotationDisabled: rotationDisabled,
7281
+ session: session,
6951
7282
  sub: claims.sub,
6952
7283
  claims: claims
6953
7284
  });
6954
7285
  return [
6955
7286
  3,
6956
- 6
7287
+ 7
6957
7288
  ];
6958
- case 5:
7289
+ case 6:
6959
7290
  outputResult({
6960
7291
  env: envName,
6961
7292
  authenticated: !expired,
6962
7293
  expiresAt: entry.expiresAt,
6963
7294
  expired: expired,
6964
- scope: entry.scope
7295
+ scope: entry.scope,
7296
+ sessionExpiresAt: sessionExpiresAt,
7297
+ rotationDisabled: rotationDisabled,
7298
+ session: session
6965
7299
  });
6966
- _state.label = 6;
6967
- case 6:
7300
+ _state.label = 7;
7301
+ case 7:
6968
7302
  return [
6969
7303
  3,
6970
- 8
7304
+ 9
6971
7305
  ];
6972
- case 7:
7306
+ case 8:
6973
7307
  outputResult({
6974
7308
  env: envName,
6975
7309
  authenticated: false,
6976
7310
  suggestion: "Run: ".concat(cliName, " auth login --env ").concat(envName)
6977
7311
  });
6978
- _state.label = 8;
6979
- case 8:
7312
+ _state.label = 9;
7313
+ case 9:
6980
7314
  return [
6981
7315
  2
6982
7316
  ];
@@ -7025,7 +7359,13 @@ function resolveAuthSetupPrompt(input) {
7025
7359
  tokenType: entry.tokenType,
7026
7360
  scope: entry.scope,
7027
7361
  expiresAt: entry.expiresAt,
7028
- expired: isTokenExpired(entry)
7362
+ expired: isTokenExpired(entry),
7363
+ sessionExpiresAt: entry.sessionExpiresAt,
7364
+ rotationDisabled: entry.rotationDisabled,
7365
+ session: describeSessionLifetime({
7366
+ sessionExpiresAt: entry.sessionExpiresAt,
7367
+ rotationDisabled: entry.rotationDisabled
7368
+ })
7029
7369
  } : null
7030
7370
  });
7031
7371
  return [
@@ -8939,7 +9279,7 @@ function _ts_generator$_(thisArg, body) {
8939
9279
  });
8940
9280
  return function(argv) {
8941
9281
  return _async_to_generator$_(function() {
8942
- var _argv__, command, _ref, _ref1, envName, env, entry, _refreshed_refresh_token, _refreshed_token_type, _refreshed_scope, _refreshed_expires_in, meta, refreshed, e;
9282
+ var _argv__, command, _ref, _ref1, envName, env, entry, _readEnvTokenEntry, _refreshed_refresh_token, _refreshed_token_type, _refreshed_scope, _refreshed_expires_in, meta, suppliedRefreshToken, refreshed, e;
8943
9283
  return _ts_generator$_(this, function(_state) {
8944
9284
  switch(_state.label){
8945
9285
  case 0:
@@ -8957,9 +9297,9 @@ function _ts_generator$_(thisArg, body) {
8957
9297
  case 1:
8958
9298
  _state.trys.push([
8959
9299
  1,
8960
- 8,
9300
+ 9,
8961
9301
  ,
8962
- 9
9302
+ 10
8963
9303
  ]);
8964
9304
  return [
8965
9305
  4,
@@ -8979,15 +9319,20 @@ function _ts_generator$_(thisArg, body) {
8979
9319
  ];
8980
9320
  case 3:
8981
9321
  entry = (_ref = _state.sent()) !== null && _ref !== void 0 ? _ref : undefined;
8982
- if (!(entry === null || entry === void 0 ? void 0 : entry.accessToken)) {
9322
+ if (!entry) {
9323
+ entry = (_readEnvTokenEntry = readEnvTokenEntry({
9324
+ cliName: input.cliName
9325
+ })) !== null && _readEnvTokenEntry !== void 0 ? _readEnvTokenEntry : undefined;
9326
+ }
9327
+ if (!(entry === null || entry === void 0 ? void 0 : entry.accessToken) && !(entry === null || entry === void 0 ? void 0 : entry.refreshToken)) {
8983
9328
  throw new CliError({
8984
9329
  message: 'No tokens for env "'.concat(envName, '". Run `').concat(input.cliName, " auth login --env ").concat(envName, "`."),
8985
9330
  code: 'NOT_LOGGED_IN'
8986
9331
  });
8987
9332
  }
8988
- if (!isTokenExpired(entry)) return [
9333
+ if (!(!entry.accessToken || isTokenExpired(entry))) return [
8989
9334
  3,
8990
- 7
9335
+ 8
8991
9336
  ];
8992
9337
  if (!entry.refreshToken) {
8993
9338
  throw new CliError({
@@ -9005,13 +9350,14 @@ function _ts_generator$_(thisArg, body) {
9005
9350
  ];
9006
9351
  case 4:
9007
9352
  meta = _state.sent();
9353
+ suppliedRefreshToken = entry.refreshToken;
9008
9354
  return [
9009
9355
  4,
9010
9356
  refreshAccessToken({
9011
9357
  tokenEndpoint: meta.token_endpoint,
9012
9358
  clientId: env.clientId,
9013
9359
  clientSecret: env.clientSecret,
9014
- refreshToken: entry.refreshToken
9360
+ refreshToken: suppliedRefreshToken
9015
9361
  })
9016
9362
  ];
9017
9363
  case 5:
@@ -9023,14 +9369,29 @@ function _ts_generator$_(thisArg, body) {
9023
9369
  scope: (_refreshed_scope = refreshed.scope) !== null && _refreshed_scope !== void 0 ? _refreshed_scope : entry.scope,
9024
9370
  expiresAt: Date.now() + ((_refreshed_expires_in = refreshed.expires_in) !== null && _refreshed_expires_in !== void 0 ? _refreshed_expires_in : 0) * 1000
9025
9371
  });
9372
+ if (!entry.fromEnv) return [
9373
+ 3,
9374
+ 6
9375
+ ];
9376
+ // Service tokens do not rotate, so a one-shot env-sourced invocation is durable without
9377
+ // persisting. If a *rotating* refresh token was supplied, the rotation is lost on exit —
9378
+ // warn that env credentials should be non-rotating service tokens.
9379
+ if (refreshed.refresh_token != null && refreshed.refresh_token !== suppliedRefreshToken) {
9380
+ process.stderr.write('Warning: the refresh token supplied via environment rotated on use; the rotated token cannot be persisted for a one-shot invocation. Use a non-rotating service token (auth login --service-token).\n');
9381
+ }
9382
+ return [
9383
+ 3,
9384
+ 8
9385
+ ];
9386
+ case 6:
9026
9387
  return [
9027
9388
  4,
9028
9389
  tokens.set(envName, entry)
9029
9390
  ];
9030
- case 6:
9031
- _state.sent();
9032
- _state.label = 7;
9033
9391
  case 7:
9392
+ _state.sent();
9393
+ _state.label = 8;
9394
+ case 8:
9034
9395
  setCliContext(createCliContext({
9035
9396
  cliName: input.cliName,
9036
9397
  envName: envName,
@@ -9040,17 +9401,17 @@ function _ts_generator$_(thisArg, body) {
9040
9401
  }));
9041
9402
  return [
9042
9403
  3,
9043
- 9
9404
+ 10
9044
9405
  ];
9045
- case 8:
9406
+ case 9:
9046
9407
  e = _state.sent();
9047
9408
  outputError(e);
9048
9409
  process.exit(CLI_EXIT_CODE_AUTH);
9049
9410
  return [
9050
9411
  3,
9051
- 9
9412
+ 10
9052
9413
  ];
9053
- case 9:
9414
+ case 10:
9054
9415
  return [
9055
9416
  2
9056
9417
  ];
@@ -56555,6 +56916,7 @@ exports.PipesScanConfig = PipesScanConfig;
56555
56916
  exports.PipesScanSection = PipesScanSection;
56556
56917
  exports.RESERVED_MODEL_FOLDERS = RESERVED_MODEL_FOLDERS;
56557
56918
  exports.SCAN_CONFIG_FILENAME = SCAN_CONFIG_FILENAME$1;
56919
+ exports.SERVICE_TOKEN_REQUIRED_OIDC_SCOPES = SERVICE_TOKEN_REQUIRED_OIDC_SCOPES;
56558
56920
  exports.STANDARD_GLOBAL_OPTION_NAMES = STANDARD_GLOBAL_OPTION_NAMES;
56559
56921
  exports.SemanticTypeEntry = SemanticTypeEntry;
56560
56922
  exports.SemanticTypeManifest = SemanticTypeManifest;
@@ -56675,6 +57037,7 @@ exports.extractModels = extractModels;
56675
57037
  exports.extractPipeEntries = extractPipeEntries;
56676
57038
  exports.extractUiEntries = extractUiEntries;
56677
57039
  exports.extractUtilEntries = extractUtilEntries;
57040
+ exports.fetchSessionInfo = fetchSessionInfo;
56678
57041
  exports.fetchUserInfo = fetchUserInfo;
56679
57042
  exports.filterReadOnlyModelScopes = filterReadOnlyModelScopes;
56680
57043
  exports.findAndLoadConfig = findAndLoadConfig;
@@ -56777,6 +57140,7 @@ exports.pickFields = pickFields;
56777
57140
  exports.promptLine = promptLine;
56778
57141
  exports.readAllStdin = readAllStdin;
56779
57142
  exports.readDirectiveDecorator = readDirectiveDecorator;
57143
+ exports.readEnvTokenEntry = readEnvTokenEntry;
56780
57144
  exports.readPropertyDescription = readPropertyDescription;
56781
57145
  exports.readSelector = readSelector;
56782
57146
  exports.readStdinTokens = readStdinTokens;
@@ -56838,5 +57202,6 @@ exports.withCallModelArgs = withCallModelArgs;
56838
57202
  exports.withEnv = withEnv;
56839
57203
  exports.withMultiplePages = withMultiplePages;
56840
57204
  exports.withOutput = withOutput;
57205
+ exports.withServiceTokenScopes = withServiceTokenScopes;
56841
57206
  exports.wrapCommandHandler = wrapCommandHandler;
56842
57207
  exports.wrapSyncCommandHandler = wrapSyncCommandHandler;