@immich/cli 2.2.72 → 2.2.73

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/.nvmrc CHANGED
@@ -1 +1 @@
1
- 22.16.0
1
+ 22.17.1
package/bin/immich ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import '../dist/index.js';
package/dist/index.js CHANGED
@@ -1,7 +1,4 @@
1
1
  #! /usr/bin/env node
2
- var __defProp = Object.defineProperty;
3
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
2
  import require$$0 from "node:events";
6
3
  import require$$1 from "node:child_process";
7
4
  import path$1, { resolve, join, relative, sep, basename } from "node:path";
@@ -1789,13 +1786,12 @@ Expecting one of '${allowedValues.join("', '")}'`);
1789
1786
  * @private
1790
1787
  */
1791
1788
  _prepareUserArgs(argv, parseOptions) {
1792
- var _a;
1793
1789
  if (argv !== void 0 && !Array.isArray(argv)) {
1794
1790
  throw new Error("first parameter to parse must be array or undefined");
1795
1791
  }
1796
1792
  parseOptions = parseOptions || {};
1797
1793
  if (argv === void 0 && parseOptions.from === void 0) {
1798
- if ((_a = process2.versions) == null ? void 0 : _a.electron) {
1794
+ if (process2.versions?.electron) {
1799
1795
  parseOptions.from = "electron";
1800
1796
  }
1801
1797
  const execArgv = process2.execArgv ?? [];
@@ -2034,7 +2030,6 @@ Expecting one of '${allowedValues.join("', '")}'`);
2034
2030
  * @private
2035
2031
  */
2036
2032
  _dispatchHelpCommand(subcommandName) {
2037
- var _a, _b;
2038
2033
  if (!subcommandName) {
2039
2034
  this.help();
2040
2035
  }
@@ -2045,7 +2040,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
2045
2040
  return this._dispatchSubcommand(
2046
2041
  subcommandName,
2047
2042
  [],
2048
- [((_a = this._getHelpOption()) == null ? void 0 : _a.long) ?? ((_b = this._getHelpOption()) == null ? void 0 : _b.short) ?? "--help"]
2043
+ [this._getHelpOption()?.long ?? this._getHelpOption()?.short ?? "--help"]
2049
2044
  );
2050
2045
  }
2051
2046
  /**
@@ -2707,7 +2702,6 @@ Expecting one of '${allowedValues.join("', '")}'`);
2707
2702
  * @return {(string|Command)}
2708
2703
  */
2709
2704
  alias(alias) {
2710
- var _a;
2711
2705
  if (alias === void 0) return this._aliases[0];
2712
2706
  let command2 = this;
2713
2707
  if (this.commands.length !== 0 && this.commands[this.commands.length - 1]._executableHandler) {
@@ -2715,7 +2709,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
2715
2709
  }
2716
2710
  if (alias === command2._name)
2717
2711
  throw new Error("Command alias can't be the same as its name");
2718
- const matchingCommand = (_a = this.parent) == null ? void 0 : _a._findCommand(alias);
2712
+ const matchingCommand = this.parent?._findCommand(alias);
2719
2713
  if (matchingCommand) {
2720
2714
  const existingCmd = [matchingCommand.name()].concat(matchingCommand.aliases()).join("|");
2721
2715
  throw new Error(
@@ -2839,7 +2833,6 @@ Expecting one of '${allowedValues.join("', '")}'`);
2839
2833
  * @param {{ error: boolean } | Function} [contextOptions] - pass {error:true} to write to stderr instead of stdout
2840
2834
  */
2841
2835
  outputHelp(contextOptions) {
2842
- var _a;
2843
2836
  let deprecatedCallback;
2844
2837
  if (typeof contextOptions === "function") {
2845
2838
  deprecatedCallback = contextOptions;
@@ -2856,7 +2849,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
2856
2849
  }
2857
2850
  }
2858
2851
  context.write(helpInformation);
2859
- if ((_a = this._getHelpOption()) == null ? void 0 : _a.long) {
2852
+ if (this._getHelpOption()?.long) {
2860
2853
  this.emit(this._getHelpOption().long);
2861
2854
  }
2862
2855
  this.emit("afterHelp", context);
@@ -3193,12 +3186,11 @@ async function y(o2) {
3193
3186
  throw new l(e.status, e.data, e.headers);
3194
3187
  }
3195
3188
  class l extends Error {
3189
+ status;
3190
+ data;
3191
+ headers;
3196
3192
  constructor(e, i, f2) {
3197
- super(`Error: ${e}`);
3198
- __publicField(this, "status");
3199
- __publicField(this, "data");
3200
- __publicField(this, "headers");
3201
- this.status = e, this.data = i, this.headers = f2;
3193
+ super(`Error: ${e}`), this.status = e, this.data = i, this.headers = f2;
3202
3194
  }
3203
3195
  }
3204
3196
  const defaults = {
@@ -3522,35 +3514,70 @@ var Error2;
3522
3514
  })(Error2 || (Error2 = {}));
3523
3515
  var SyncEntityType;
3524
3516
  (function(SyncEntityType2) {
3517
+ SyncEntityType2["AuthUserV1"] = "AuthUserV1";
3525
3518
  SyncEntityType2["UserV1"] = "UserV1";
3526
3519
  SyncEntityType2["UserDeleteV1"] = "UserDeleteV1";
3527
- SyncEntityType2["PartnerV1"] = "PartnerV1";
3528
- SyncEntityType2["PartnerDeleteV1"] = "PartnerDeleteV1";
3529
3520
  SyncEntityType2["AssetV1"] = "AssetV1";
3530
3521
  SyncEntityType2["AssetDeleteV1"] = "AssetDeleteV1";
3531
3522
  SyncEntityType2["AssetExifV1"] = "AssetExifV1";
3523
+ SyncEntityType2["PartnerV1"] = "PartnerV1";
3524
+ SyncEntityType2["PartnerDeleteV1"] = "PartnerDeleteV1";
3532
3525
  SyncEntityType2["PartnerAssetV1"] = "PartnerAssetV1";
3533
3526
  SyncEntityType2["PartnerAssetBackfillV1"] = "PartnerAssetBackfillV1";
3534
3527
  SyncEntityType2["PartnerAssetDeleteV1"] = "PartnerAssetDeleteV1";
3535
3528
  SyncEntityType2["PartnerAssetExifV1"] = "PartnerAssetExifV1";
3536
3529
  SyncEntityType2["PartnerAssetExifBackfillV1"] = "PartnerAssetExifBackfillV1";
3530
+ SyncEntityType2["PartnerStackBackfillV1"] = "PartnerStackBackfillV1";
3531
+ SyncEntityType2["PartnerStackDeleteV1"] = "PartnerStackDeleteV1";
3532
+ SyncEntityType2["PartnerStackV1"] = "PartnerStackV1";
3537
3533
  SyncEntityType2["AlbumV1"] = "AlbumV1";
3538
3534
  SyncEntityType2["AlbumDeleteV1"] = "AlbumDeleteV1";
3539
3535
  SyncEntityType2["AlbumUserV1"] = "AlbumUserV1";
3540
3536
  SyncEntityType2["AlbumUserBackfillV1"] = "AlbumUserBackfillV1";
3541
3537
  SyncEntityType2["AlbumUserDeleteV1"] = "AlbumUserDeleteV1";
3538
+ SyncEntityType2["AlbumAssetV1"] = "AlbumAssetV1";
3539
+ SyncEntityType2["AlbumAssetBackfillV1"] = "AlbumAssetBackfillV1";
3540
+ SyncEntityType2["AlbumAssetExifV1"] = "AlbumAssetExifV1";
3541
+ SyncEntityType2["AlbumAssetExifBackfillV1"] = "AlbumAssetExifBackfillV1";
3542
+ SyncEntityType2["AlbumToAssetV1"] = "AlbumToAssetV1";
3543
+ SyncEntityType2["AlbumToAssetDeleteV1"] = "AlbumToAssetDeleteV1";
3544
+ SyncEntityType2["AlbumToAssetBackfillV1"] = "AlbumToAssetBackfillV1";
3545
+ SyncEntityType2["MemoryV1"] = "MemoryV1";
3546
+ SyncEntityType2["MemoryDeleteV1"] = "MemoryDeleteV1";
3547
+ SyncEntityType2["MemoryToAssetV1"] = "MemoryToAssetV1";
3548
+ SyncEntityType2["MemoryToAssetDeleteV1"] = "MemoryToAssetDeleteV1";
3549
+ SyncEntityType2["StackV1"] = "StackV1";
3550
+ SyncEntityType2["StackDeleteV1"] = "StackDeleteV1";
3551
+ SyncEntityType2["PersonV1"] = "PersonV1";
3552
+ SyncEntityType2["PersonDeleteV1"] = "PersonDeleteV1";
3553
+ SyncEntityType2["AssetFaceV1"] = "AssetFaceV1";
3554
+ SyncEntityType2["AssetFaceDeleteV1"] = "AssetFaceDeleteV1";
3555
+ SyncEntityType2["UserMetadataV1"] = "UserMetadataV1";
3556
+ SyncEntityType2["UserMetadataDeleteV1"] = "UserMetadataDeleteV1";
3542
3557
  SyncEntityType2["SyncAckV1"] = "SyncAckV1";
3558
+ SyncEntityType2["SyncResetV1"] = "SyncResetV1";
3543
3559
  })(SyncEntityType || (SyncEntityType = {}));
3544
3560
  var SyncRequestType;
3545
3561
  (function(SyncRequestType2) {
3546
- SyncRequestType2["UsersV1"] = "UsersV1";
3547
- SyncRequestType2["PartnersV1"] = "PartnersV1";
3562
+ SyncRequestType2["AlbumsV1"] = "AlbumsV1";
3563
+ SyncRequestType2["AlbumUsersV1"] = "AlbumUsersV1";
3564
+ SyncRequestType2["AlbumToAssetsV1"] = "AlbumToAssetsV1";
3565
+ SyncRequestType2["AlbumAssetsV1"] = "AlbumAssetsV1";
3566
+ SyncRequestType2["AlbumAssetExifsV1"] = "AlbumAssetExifsV1";
3548
3567
  SyncRequestType2["AssetsV1"] = "AssetsV1";
3549
3568
  SyncRequestType2["AssetExifsV1"] = "AssetExifsV1";
3569
+ SyncRequestType2["AuthUsersV1"] = "AuthUsersV1";
3570
+ SyncRequestType2["MemoriesV1"] = "MemoriesV1";
3571
+ SyncRequestType2["MemoryToAssetsV1"] = "MemoryToAssetsV1";
3572
+ SyncRequestType2["PartnersV1"] = "PartnersV1";
3550
3573
  SyncRequestType2["PartnerAssetsV1"] = "PartnerAssetsV1";
3551
3574
  SyncRequestType2["PartnerAssetExifsV1"] = "PartnerAssetExifsV1";
3552
- SyncRequestType2["AlbumsV1"] = "AlbumsV1";
3553
- SyncRequestType2["AlbumUsersV1"] = "AlbumUsersV1";
3575
+ SyncRequestType2["PartnerStacksV1"] = "PartnerStacksV1";
3576
+ SyncRequestType2["StacksV1"] = "StacksV1";
3577
+ SyncRequestType2["UsersV1"] = "UsersV1";
3578
+ SyncRequestType2["PeopleV1"] = "PeopleV1";
3579
+ SyncRequestType2["AssetFacesV1"] = "AssetFacesV1";
3580
+ SyncRequestType2["UserMetadataV1"] = "UserMetadataV1";
3554
3581
  })(SyncRequestType || (SyncRequestType = {}));
3555
3582
  var TranscodeHWAccel;
3556
3583
  (function(TranscodeHWAccel2) {
@@ -9504,16 +9531,16 @@ const defaultQueueOptions = {
9504
9531
  verbose: false
9505
9532
  };
9506
9533
  class Queue {
9534
+ queue;
9535
+ store = /* @__PURE__ */ new Map();
9536
+ options;
9537
+ worker;
9507
9538
  /**
9508
9539
  * Create a new queue.
9509
9540
  * @param worker - The worker function that processes the task.
9510
9541
  * @param options - The queue options.
9511
9542
  */
9512
9543
  constructor(worker, options2) {
9513
- __publicField(this, "queue");
9514
- __publicField(this, "store", /* @__PURE__ */ new Map());
9515
- __publicField(this, "options");
9516
- __publicField(this, "worker");
9517
9544
  this.options = { ...defaultQueueOptions, ...options2 };
9518
9545
  this.worker = worker;
9519
9546
  this.store = /* @__PURE__ */ new Map();
@@ -12242,19 +12269,18 @@ function requireVisit() {
12242
12269
  return visitor;
12243
12270
  }
12244
12271
  function callVisitor(key, node, visitor, path2) {
12245
- var _a, _b, _c, _d, _e;
12246
12272
  if (typeof visitor === "function")
12247
12273
  return visitor(key, node, path2);
12248
12274
  if (identity2.isMap(node))
12249
- return (_a = visitor.Map) == null ? void 0 : _a.call(visitor, key, node, path2);
12275
+ return visitor.Map?.(key, node, path2);
12250
12276
  if (identity2.isSeq(node))
12251
- return (_b = visitor.Seq) == null ? void 0 : _b.call(visitor, key, node, path2);
12277
+ return visitor.Seq?.(key, node, path2);
12252
12278
  if (identity2.isPair(node))
12253
- return (_c = visitor.Pair) == null ? void 0 : _c.call(visitor, key, node, path2);
12279
+ return visitor.Pair?.(key, node, path2);
12254
12280
  if (identity2.isScalar(node))
12255
- return (_d = visitor.Scalar) == null ? void 0 : _d.call(visitor, key, node, path2);
12281
+ return visitor.Scalar?.(key, node, path2);
12256
12282
  if (identity2.isAlias(node))
12257
- return (_e = visitor.Alias) == null ? void 0 : _e.call(visitor, key, node, path2);
12283
+ return visitor.Alias?.(key, node, path2);
12258
12284
  return void 0;
12259
12285
  }
12260
12286
  function replaceNode(key, path2, node) {
@@ -12593,7 +12619,7 @@ function requireToJS() {
12593
12619
  ctx.onCreate(res);
12594
12620
  return res;
12595
12621
  }
12596
- if (typeof value === "bigint" && !(ctx == null ? void 0 : ctx.keep))
12622
+ if (typeof value === "bigint" && !ctx?.keep)
12597
12623
  return Number(value);
12598
12624
  return value;
12599
12625
  }
@@ -12665,7 +12691,7 @@ function requireAlias() {
12665
12691
  */
12666
12692
  resolve(doc, ctx) {
12667
12693
  let nodes;
12668
- if (ctx == null ? void 0 : ctx.aliasResolveCache) {
12694
+ if (ctx?.aliasResolveCache) {
12669
12695
  nodes = ctx.aliasResolveCache;
12670
12696
  } else {
12671
12697
  nodes = [];
@@ -12770,7 +12796,7 @@ function requireScalar() {
12770
12796
  this.value = value;
12771
12797
  }
12772
12798
  toJSON(arg, ctx) {
12773
- return (ctx == null ? void 0 : ctx.keep) ? this.value : toJS2.toJS(this.value, arg, ctx);
12799
+ return ctx?.keep ? this.value : toJS2.toJS(this.value, arg, ctx);
12774
12800
  }
12775
12801
  toString() {
12776
12802
  return String(this.value);
@@ -12801,19 +12827,15 @@ function requireCreateNode() {
12801
12827
  throw new Error(`Tag ${tagName} not found`);
12802
12828
  return tagObj;
12803
12829
  }
12804
- return tags2.find((t2) => {
12805
- var _a;
12806
- return ((_a = t2.identify) == null ? void 0 : _a.call(t2, value)) && !t2.format;
12807
- });
12830
+ return tags2.find((t2) => t2.identify?.(value) && !t2.format);
12808
12831
  }
12809
12832
  function createNode$1(value, tagName, ctx) {
12810
- var _a, _b, _c;
12811
12833
  if (identity2.isDocument(value))
12812
12834
  value = value.contents;
12813
12835
  if (identity2.isNode(value))
12814
12836
  return value;
12815
12837
  if (identity2.isPair(value)) {
12816
- const map2 = (_b = (_a = ctx.schema[identity2.MAP]).createNode) == null ? void 0 : _b.call(_a, ctx.schema, null, ctx);
12838
+ const map2 = ctx.schema[identity2.MAP].createNode?.(ctx.schema, null, ctx);
12817
12839
  map2.items.push(value);
12818
12840
  return map2;
12819
12841
  }
@@ -12832,7 +12854,7 @@ function requireCreateNode() {
12832
12854
  sourceObjects.set(value, ref);
12833
12855
  }
12834
12856
  }
12835
- if (tagName == null ? void 0 : tagName.startsWith("!!"))
12857
+ if (tagName?.startsWith("!!"))
12836
12858
  tagName = defaultTagPrefix + tagName.slice(2);
12837
12859
  let tagObj = findTagObject(value, tagName, schema2.tags);
12838
12860
  if (!tagObj) {
@@ -12851,7 +12873,7 @@ function requireCreateNode() {
12851
12873
  onTagObj(tagObj);
12852
12874
  delete ctx.onTagObj;
12853
12875
  }
12854
- const node = (tagObj == null ? void 0 : tagObj.createNode) ? tagObj.createNode(ctx.schema, value, ctx) : typeof ((_c = tagObj == null ? void 0 : tagObj.nodeClass) == null ? void 0 : _c.from) === "function" ? tagObj.nodeClass.from(ctx.schema, value, ctx) : new Scalar2.Scalar(value);
12876
+ const node = tagObj?.createNode ? tagObj.createNode(ctx.schema, value, ctx) : typeof tagObj?.nodeClass?.from === "function" ? tagObj.nodeClass.from(ctx.schema, value, ctx) : new Scalar2.Scalar(value);
12855
12877
  if (tagName)
12856
12878
  node.tag = tagName;
12857
12879
  else if (!tagObj.default)
@@ -13401,12 +13423,9 @@ ${indent}${start}${value}${end}`;
13401
13423
  const str = value.replace(/\n+/g, `$&
13402
13424
  ${indent}`);
13403
13425
  if (actualString) {
13404
- const test = (tag) => {
13405
- var _a;
13406
- return tag.default && tag.tag !== "tag:yaml.org,2002:str" && ((_a = tag.test) == null ? void 0 : _a.test(str));
13407
- };
13426
+ const test = (tag) => tag.default && tag.tag !== "tag:yaml.org,2002:str" && tag.test?.test(str);
13408
13427
  const { compat, tags: tags2 } = ctx.doc.schema;
13409
- if (tags2.some(test) || (compat == null ? void 0 : compat.some(test)))
13428
+ if (tags2.some(test) || compat?.some(test))
13410
13429
  return quotedString(value, ctx);
13411
13430
  }
13412
13431
  return implicitKey ? str : foldFlowLines2.foldFlowLines(str, indent, foldFlowLines2.FOLD_FLOW, getFoldOptions(ctx, false));
@@ -13497,7 +13516,6 @@ function requireStringify() {
13497
13516
  };
13498
13517
  }
13499
13518
  function getTagObject(tags2, item) {
13500
- var _a;
13501
13519
  if (item.tag) {
13502
13520
  const match = tags2.filter((t2) => t2.tag === item.tag);
13503
13521
  if (match.length > 0)
@@ -13507,10 +13525,7 @@ function requireStringify() {
13507
13525
  let obj;
13508
13526
  if (identity2.isScalar(item)) {
13509
13527
  obj = item.value;
13510
- let match = tags2.filter((t2) => {
13511
- var _a2;
13512
- return (_a2 = t2.identify) == null ? void 0 : _a2.call(t2, obj);
13513
- });
13528
+ let match = tags2.filter((t2) => t2.identify?.(obj));
13514
13529
  if (match.length > 1) {
13515
13530
  const testMatch = match.filter((t2) => t2.test);
13516
13531
  if (testMatch.length > 0)
@@ -13522,7 +13537,7 @@ function requireStringify() {
13522
13537
  tagObj = tags2.find((t2) => t2.nodeClass && obj instanceof t2.nodeClass);
13523
13538
  }
13524
13539
  if (!tagObj) {
13525
- const name = ((_a = obj == null ? void 0 : obj.constructor) == null ? void 0 : _a.name) ?? (obj === null ? "null" : typeof obj);
13540
+ const name = obj?.constructor?.name ?? (obj === null ? "null" : typeof obj);
13526
13541
  throw new Error(`Tag not resolved for ${name} value`);
13527
13542
  }
13528
13543
  return tagObj;
@@ -13542,13 +13557,12 @@ function requireStringify() {
13542
13557
  return props.join(" ");
13543
13558
  }
13544
13559
  function stringify$12(item, ctx, onComment, onChompKeep) {
13545
- var _a;
13546
13560
  if (identity2.isPair(item))
13547
13561
  return item.toString(ctx, onComment, onChompKeep);
13548
13562
  if (identity2.isAlias(item)) {
13549
13563
  if (ctx.doc.directives)
13550
13564
  return item.toString(ctx);
13551
- if ((_a = ctx.resolvedAliases) == null ? void 0 : _a.has(item)) {
13565
+ if (ctx.resolvedAliases?.has(item)) {
13552
13566
  throw new TypeError(`Cannot stringify circular structure without alias nodes`);
13553
13567
  } else {
13554
13568
  if (ctx.resolvedAliases)
@@ -13747,7 +13761,7 @@ function requireMerge() {
13747
13761
  }),
13748
13762
  stringify: () => MERGE_KEY
13749
13763
  };
13750
- const isMergeKey = (ctx, key) => (merge$1.identify(key) || identity2.isScalar(key) && (!key.type || key.type === Scalar2.Scalar.PLAIN) && merge$1.identify(key.value)) && (ctx == null ? void 0 : ctx.doc.schema.tags.some((tag) => tag.tag === merge$1.tag && tag.default));
13764
+ const isMergeKey = (ctx, key) => (merge$1.identify(key) || identity2.isScalar(key) && (!key.type || key.type === Scalar2.Scalar.PLAIN) && merge$1.identify(key.value)) && ctx?.doc.schema.tags.some((tag) => tag.tag === merge$1.tag && tag.default);
13751
13765
  function addMergeToJSMap(ctx, map2, value) {
13752
13766
  value = ctx && identity2.isAlias(value) ? value.resolve(ctx.doc) : value;
13753
13767
  if (identity2.isSeq(value))
@@ -13827,7 +13841,7 @@ function requireAddPairToJSMap() {
13827
13841
  return "";
13828
13842
  if (typeof jsKey !== "object")
13829
13843
  return String(jsKey);
13830
- if (identity2.isNode(key) && (ctx == null ? void 0 : ctx.doc)) {
13844
+ if (identity2.isNode(key) && ctx?.doc) {
13831
13845
  const strCtx = stringify2.createStringifyContext(ctx.doc, {});
13832
13846
  strCtx.anchors = /* @__PURE__ */ new Set();
13833
13847
  for (const node of ctx.anchors.keys())
@@ -13877,11 +13891,11 @@ function requirePair() {
13877
13891
  return new Pair2(key, value);
13878
13892
  }
13879
13893
  toJSON(_, ctx) {
13880
- const pair = (ctx == null ? void 0 : ctx.mapAsMap) ? /* @__PURE__ */ new Map() : {};
13894
+ const pair = ctx?.mapAsMap ? /* @__PURE__ */ new Map() : {};
13881
13895
  return addPairToJSMap2.addPairToJSMap(ctx, pair, this);
13882
13896
  }
13883
13897
  toString(ctx, onComment, onChompKeep) {
13884
- return (ctx == null ? void 0 : ctx.doc) ? stringifyPair2.stringifyPair(this, ctx, onComment, onChompKeep) : JSON.stringify(this);
13898
+ return ctx?.doc ? stringifyPair2.stringifyPair(this, ctx, onComment, onChompKeep) : JSON.stringify(this);
13885
13899
  }
13886
13900
  };
13887
13901
  Pair.Pair = Pair$1;
@@ -13988,7 +14002,7 @@ ${indent}${line}` : "\n";
13988
14002
  comment = iv.comment;
13989
14003
  if (iv.commentBefore)
13990
14004
  reqNewline = true;
13991
- } else if (item.value == null && (ik == null ? void 0 : ik.comment)) {
14005
+ } else if (item.value == null && ik?.comment) {
13992
14006
  comment = ik.comment;
13993
14007
  }
13994
14008
  }
@@ -14099,16 +14113,15 @@ function requireYAMLMap() {
14099
14113
  * collection will throw. Otherwise, overwrites the previous value.
14100
14114
  */
14101
14115
  add(pair, overwrite) {
14102
- var _a;
14103
14116
  let _pair;
14104
14117
  if (identity2.isPair(pair))
14105
14118
  _pair = pair;
14106
14119
  else if (!pair || typeof pair !== "object" || !("key" in pair)) {
14107
- _pair = new Pair2.Pair(pair, pair == null ? void 0 : pair.value);
14120
+ _pair = new Pair2.Pair(pair, pair?.value);
14108
14121
  } else
14109
14122
  _pair = new Pair2.Pair(pair.key, pair.value);
14110
14123
  const prev = findPair(this.items, _pair.key);
14111
- const sortEntries = (_a = this.schema) == null ? void 0 : _a.sortMapEntries;
14124
+ const sortEntries = this.schema?.sortMapEntries;
14112
14125
  if (prev) {
14113
14126
  if (!overwrite)
14114
14127
  throw new Error(`Key ${_pair.key} already set`);
@@ -14135,7 +14148,7 @@ function requireYAMLMap() {
14135
14148
  }
14136
14149
  get(key, keepScalar) {
14137
14150
  const it = findPair(this.items, key);
14138
- const node = it == null ? void 0 : it.value;
14151
+ const node = it?.value;
14139
14152
  return (!keepScalar && identity2.isScalar(node) ? node.value : node) ?? void 0;
14140
14153
  }
14141
14154
  has(key) {
@@ -14150,8 +14163,8 @@ function requireYAMLMap() {
14150
14163
  * @returns Instance of Type, Map, or Object
14151
14164
  */
14152
14165
  toJSON(_, ctx, Type) {
14153
- const map2 = Type ? new Type() : (ctx == null ? void 0 : ctx.mapAsMap) ? /* @__PURE__ */ new Map() : {};
14154
- if (ctx == null ? void 0 : ctx.onCreate)
14166
+ const map2 = Type ? new Type() : ctx?.mapAsMap ? /* @__PURE__ */ new Map() : {};
14167
+ if (ctx?.onCreate)
14155
14168
  ctx.onCreate(map2);
14156
14169
  for (const item of this.items)
14157
14170
  addPairToJSMap2.addPairToJSMap(ctx, map2, item);
@@ -14274,7 +14287,7 @@ function requireYAMLSeq() {
14274
14287
  }
14275
14288
  toJSON(_, ctx) {
14276
14289
  const seq2 = [];
14277
- if (ctx == null ? void 0 : ctx.onCreate)
14290
+ if (ctx?.onCreate)
14278
14291
  ctx.onCreate(seq2);
14279
14292
  let i = 0;
14280
14293
  for (const item of this.items)
@@ -14785,7 +14798,7 @@ function requireOmap() {
14785
14798
  if (!ctx)
14786
14799
  return super.toJSON(_);
14787
14800
  const map2 = /* @__PURE__ */ new Map();
14788
- if (ctx == null ? void 0 : ctx.onCreate)
14801
+ if (ctx?.onCreate)
14789
14802
  ctx.onCreate(map2);
14790
14803
  for (const pair of this.items) {
14791
14804
  let key, value;
@@ -15166,7 +15179,7 @@ function requireTimestamp() {
15166
15179
  }
15167
15180
  return new Date(date);
15168
15181
  },
15169
- stringify: ({ value }) => (value == null ? void 0 : value.toISOString().replace(/(T00:00:00)?\.000Z$/, "")) ?? ""
15182
+ stringify: ({ value }) => value?.toISOString().replace(/(T00:00:00)?\.000Z$/, "") ?? ""
15170
15183
  };
15171
15184
  timestamp.floatTime = floatTime;
15172
15185
  timestamp.intTime = intTime;
@@ -15349,7 +15362,6 @@ function requireStringifyDocument() {
15349
15362
  var stringify2 = requireStringify();
15350
15363
  var stringifyComment2 = requireStringifyComment();
15351
15364
  function stringifyDocument$1(doc, options2) {
15352
- var _a;
15353
15365
  const lines = [];
15354
15366
  let hasDirectives = options2.directives === true;
15355
15367
  if (options2.directives !== false && doc.directives) {
@@ -15394,7 +15406,7 @@ function requireStringifyDocument() {
15394
15406
  } else {
15395
15407
  lines.push(stringify2.stringify(doc.contents, ctx));
15396
15408
  }
15397
- if ((_a = doc.directives) == null ? void 0 : _a.docEnd) {
15409
+ if (doc.directives?.docEnd) {
15398
15410
  if (doc.comment) {
15399
15411
  const cs = commentString(doc.comment);
15400
15412
  if (cs.includes("\n")) {
@@ -15462,7 +15474,7 @@ function requireDocument() {
15462
15474
  }, options2);
15463
15475
  this.options = opt;
15464
15476
  let { version: version2 } = opt;
15465
- if (options2 == null ? void 0 : options2._directives) {
15477
+ if (options2?._directives) {
15466
15478
  this.directives = options2._directives.atDocument();
15467
15479
  if (this.directives.yaml.explicit)
15468
15480
  version2 = this.directives.yaml.version;
@@ -15832,7 +15844,7 @@ function requireResolveProps() {
15832
15844
  }
15833
15845
  switch (token.type) {
15834
15846
  case "space":
15835
- if (!flow && (indicator !== "doc-start" || (next == null ? void 0 : next.type) !== "flow-collection") && token.source.includes(" ")) {
15847
+ if (!flow && (indicator !== "doc-start" || next?.type !== "flow-collection") && token.source.includes(" ")) {
15836
15848
  tab = token;
15837
15849
  }
15838
15850
  hasSpace = true;
@@ -15914,7 +15926,7 @@ function requireResolveProps() {
15914
15926
  if (reqSpace && next && next.type !== "space" && next.type !== "newline" && next.type !== "comma" && (next.type !== "scalar" || next.source !== "")) {
15915
15927
  onError(next.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space");
15916
15928
  }
15917
- if (tab && (atNewline && tab.indent <= parentIndent || (next == null ? void 0 : next.type) === "block-map" || (next == null ? void 0 : next.type) === "block-seq"))
15929
+ if (tab && (atNewline && tab.indent <= parentIndent || next?.type === "block-map" || next?.type === "block-seq"))
15918
15930
  onError(tab, "TAB_AS_INDENT", "Tabs are not allowed as indentation");
15919
15931
  return {
15920
15932
  comma,
@@ -15981,7 +15993,7 @@ function requireUtilFlowIndentCheck() {
15981
15993
  hasRequiredUtilFlowIndentCheck = 1;
15982
15994
  var utilContainsNewline2 = requireUtilContainsNewline();
15983
15995
  function flowIndentCheck(indent, fc, onError) {
15984
- if ((fc == null ? void 0 : fc.type) === "flow-collection") {
15996
+ if (fc?.type === "flow-collection") {
15985
15997
  const end = fc.end[0];
15986
15998
  if (end.indent === indent && (end.source === "]" || end.source === "}") && utilContainsNewline2.containsNewline(fc)) {
15987
15999
  const msg = "Flow end indicator should be more indented than parent";
@@ -16020,8 +16032,7 @@ function requireResolveBlockMap() {
16020
16032
  var utilMapIncludes2 = requireUtilMapIncludes();
16021
16033
  const startColMsg = "All mapping items must start at the same column";
16022
16034
  function resolveBlockMap$1({ composeNode: composeNode2, composeEmptyNode }, ctx, bm, onError, tag) {
16023
- var _a;
16024
- const NodeClass = (tag == null ? void 0 : tag.nodeClass) ?? YAMLMap2.YAMLMap;
16035
+ const NodeClass = tag?.nodeClass ?? YAMLMap2.YAMLMap;
16025
16036
  const map2 = new NodeClass(ctx.schema);
16026
16037
  if (ctx.atRoot)
16027
16038
  ctx.atRoot = false;
@@ -16031,7 +16042,7 @@ function requireResolveBlockMap() {
16031
16042
  const { start, key, sep: sep2, value } = collItem;
16032
16043
  const keyProps = resolveProps2.resolveProps(start, {
16033
16044
  indicator: "explicit-key-ind",
16034
- next: key ?? (sep2 == null ? void 0 : sep2[0]),
16045
+ next: key ?? sep2?.[0],
16035
16046
  offset,
16036
16047
  onError,
16037
16048
  parentIndent: bm.indent,
@@ -16058,7 +16069,7 @@ function requireResolveBlockMap() {
16058
16069
  if (keyProps.newlineAfterProp || utilContainsNewline2.containsNewline(key)) {
16059
16070
  onError(key ?? start[start.length - 1], "MULTILINE_IMPLICIT_KEY", "Implicit keys need to be on a single line");
16060
16071
  }
16061
- } else if (((_a = keyProps.found) == null ? void 0 : _a.indent) !== bm.indent) {
16072
+ } else if (keyProps.found?.indent !== bm.indent) {
16062
16073
  onError(offset, "BAD_INDENT", startColMsg);
16063
16074
  }
16064
16075
  ctx.atKey = true;
@@ -16080,7 +16091,7 @@ function requireResolveBlockMap() {
16080
16091
  offset = valueProps.end;
16081
16092
  if (valueProps.found) {
16082
16093
  if (implicitKey) {
16083
- if ((value == null ? void 0 : value.type) === "block-map" && !valueProps.hasNewline)
16094
+ if (value?.type === "block-map" && !valueProps.hasNewline)
16084
16095
  onError(offset, "BLOCK_AS_IMPLICIT_KEY", "Nested mappings are not allowed in compact mappings");
16085
16096
  if (ctx.options.strict && keyProps.start < valueProps.found.offset - 1024)
16086
16097
  onError(keyNode.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key");
@@ -16125,7 +16136,7 @@ function requireResolveBlockSeq() {
16125
16136
  var resolveProps2 = requireResolveProps();
16126
16137
  var utilFlowIndentCheck2 = requireUtilFlowIndentCheck();
16127
16138
  function resolveBlockSeq$1({ composeNode: composeNode2, composeEmptyNode }, ctx, bs, onError, tag) {
16128
- const NodeClass = (tag == null ? void 0 : tag.nodeClass) ?? YAMLSeq2.YAMLSeq;
16139
+ const NodeClass = tag?.nodeClass ?? YAMLSeq2.YAMLSeq;
16129
16140
  const seq2 = new NodeClass(ctx.schema);
16130
16141
  if (ctx.atRoot)
16131
16142
  ctx.atRoot = false;
@@ -16228,7 +16239,7 @@ function requireResolveFlowCollection() {
16228
16239
  function resolveFlowCollection$1({ composeNode: composeNode2, composeEmptyNode }, ctx, fc, onError, tag) {
16229
16240
  const isMap = fc.start.source === "{";
16230
16241
  const fcName = isMap ? "flow map" : "flow sequence";
16231
- const NodeClass = (tag == null ? void 0 : tag.nodeClass) ?? (isMap ? YAMLMap2.YAMLMap : YAMLSeq2.YAMLSeq);
16242
+ const NodeClass = tag?.nodeClass ?? (isMap ? YAMLMap2.YAMLMap : YAMLSeq2.YAMLSeq);
16232
16243
  const coll = new NodeClass(ctx.schema);
16233
16244
  coll.flow = true;
16234
16245
  const atRoot = ctx.atRoot;
@@ -16243,7 +16254,7 @@ function requireResolveFlowCollection() {
16243
16254
  const props = resolveProps2.resolveProps(start, {
16244
16255
  flow: fcName,
16245
16256
  indicator: "explicit-key-ind",
16246
- next: key ?? (sep2 == null ? void 0 : sep2[0]),
16257
+ next: key ?? sep2?.[0],
16247
16258
  offset,
16248
16259
  onError,
16249
16260
  parentIndent: fc.indent,
@@ -16427,7 +16438,6 @@ function requireComposeCollection() {
16427
16438
  return coll;
16428
16439
  }
16429
16440
  function composeCollection$1(CN, ctx, token, props, onError) {
16430
- var _a;
16431
16441
  const tagToken = props.tag;
16432
16442
  const tagName = !tagToken ? null : ctx.directives.tagName(tagToken.source, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg));
16433
16443
  if (token.type === "block-seq") {
@@ -16458,11 +16468,11 @@ function requireComposeCollection() {
16458
16468
  }
16459
16469
  }
16460
16470
  const coll = resolveCollection(CN, ctx, token, onError, tagName, tag);
16461
- const res = ((_a = tag.resolve) == null ? void 0 : _a.call(tag, coll, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg), ctx.options)) ?? coll;
16471
+ const res = tag.resolve?.(coll, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg), ctx.options) ?? coll;
16462
16472
  const node = identity2.isNode(res) ? res : new Scalar2.Scalar(res);
16463
16473
  node.range = coll.range;
16464
16474
  node.tag = tagName;
16465
- if (tag == null ? void 0 : tag.format)
16475
+ if (tag?.format)
16466
16476
  node.format = tag.format;
16467
16477
  return node;
16468
16478
  }
@@ -16644,7 +16654,7 @@ function requireResolveBlockScalar() {
16644
16654
  const split = source.split(/\n( *)/);
16645
16655
  const first = split[0];
16646
16656
  const m2 = first.match(/^( *)/);
16647
- const line0 = (m2 == null ? void 0 : m2[1]) ? [m2[1], first.slice(m2[1].length)] : ["", first];
16657
+ const line0 = m2?.[1] ? [m2[1], first.slice(m2[1].length)] : ["", first];
16648
16658
  const lines = [line0];
16649
16659
  for (let i = 1; i < split.length; i += 2)
16650
16660
  lines.push([split[i], split[i + 1]]);
@@ -16761,7 +16771,7 @@ function requireResolveFlowScalar() {
16761
16771
  const last = /[ \t]*(.*)/sy;
16762
16772
  last.lastIndex = pos;
16763
16773
  match = last.exec(source);
16764
- return res + sep2 + ((match == null ? void 0 : match[1]) ?? "");
16774
+ return res + sep2 + (match?.[1] ?? "");
16765
16775
  }
16766
16776
  function doubleQuotedValue(source, onError) {
16767
16777
  let res = "";
@@ -16914,7 +16924,6 @@ function requireComposeScalar() {
16914
16924
  return scalar;
16915
16925
  }
16916
16926
  function findScalarTagByName(schema2, value, tagName, tagToken, onError) {
16917
- var _a;
16918
16927
  if (tagName === "!")
16919
16928
  return schema2[identity2.SCALAR];
16920
16929
  const matchWithTest = [];
@@ -16927,7 +16936,7 @@ function requireComposeScalar() {
16927
16936
  }
16928
16937
  }
16929
16938
  for (const tag of matchWithTest)
16930
- if ((_a = tag.test) == null ? void 0 : _a.test(value))
16939
+ if (tag.test?.test(value))
16931
16940
  return tag;
16932
16941
  const kt = schema2.knownTags[tagName];
16933
16942
  if (kt && !kt.collection) {
@@ -16938,15 +16947,9 @@ function requireComposeScalar() {
16938
16947
  return schema2[identity2.SCALAR];
16939
16948
  }
16940
16949
  function findScalarTagByTest({ atKey, directives: directives2, schema: schema2 }, value, token, onError) {
16941
- const tag = schema2.tags.find((tag2) => {
16942
- var _a;
16943
- return (tag2.default === true || atKey && tag2.default === "key") && ((_a = tag2.test) == null ? void 0 : _a.test(value));
16944
- }) || schema2[identity2.SCALAR];
16950
+ const tag = schema2.tags.find((tag2) => (tag2.default === true || atKey && tag2.default === "key") && tag2.test?.test(value)) || schema2[identity2.SCALAR];
16945
16951
  if (schema2.compat) {
16946
- const compat = schema2.compat.find((tag2) => {
16947
- var _a;
16948
- return tag2.default && ((_a = tag2.test) == null ? void 0 : _a.test(value));
16949
- }) ?? schema2[identity2.SCALAR];
16952
+ const compat = schema2.compat.find((tag2) => tag2.default && tag2.test?.test(value)) ?? schema2[identity2.SCALAR];
16950
16953
  if (tag.tag !== compat.tag) {
16951
16954
  const ts = directives2.tagString(tag.tag);
16952
16955
  const cs = directives2.tagString(compat.tag);
@@ -16977,7 +16980,7 @@ function requireUtilEmptyScalarPosition() {
16977
16980
  continue;
16978
16981
  }
16979
16982
  st = before[++i];
16980
- while ((st == null ? void 0 : st.type) === "space") {
16983
+ while (st?.type === "space") {
16981
16984
  offset += st.source.length;
16982
16985
  st = before[++i];
16983
16986
  }
@@ -17109,7 +17112,7 @@ function requireComposeDoc() {
17109
17112
  };
17110
17113
  const props = resolveProps2.resolveProps(start, {
17111
17114
  indicator: "doc-start",
17112
- next: value ?? (end == null ? void 0 : end[0]),
17115
+ next: value ?? end?.[0],
17113
17116
  offset,
17114
17117
  onError,
17115
17118
  parentIndent: 0,
@@ -17151,7 +17154,6 @@ function requireComposer() {
17151
17154
  return [offset, offset + (typeof source === "string" ? source.length : 1)];
17152
17155
  }
17153
17156
  function parsePrelude(prelude) {
17154
- var _a;
17155
17157
  let comment = "";
17156
17158
  let atComment = false;
17157
17159
  let afterEmptyLine = false;
@@ -17164,7 +17166,7 @@ function requireComposer() {
17164
17166
  afterEmptyLine = false;
17165
17167
  break;
17166
17168
  case "%":
17167
- if (((_a = prelude[i + 1]) == null ? void 0 : _a[0]) !== "#")
17169
+ if (prelude[i + 1]?.[0] !== "#")
17168
17170
  i += 1;
17169
17171
  atComment = false;
17170
17172
  break;
@@ -17603,7 +17605,7 @@ function requireCstVisit() {
17603
17605
  visit2.itemAtPath = (cst2, path2) => {
17604
17606
  let item = cst2;
17605
17607
  for (const [field, index] of path2) {
17606
- const tok = item == null ? void 0 : item[field];
17608
+ const tok = item?.[field];
17607
17609
  if (tok && "items" in tok) {
17608
17610
  item = tok.items[index];
17609
17611
  } else
@@ -17614,7 +17616,7 @@ function requireCstVisit() {
17614
17616
  visit2.parentCollection = (cst2, path2) => {
17615
17617
  const parent = visit2.itemAtPath(cst2, path2.slice(0, -1));
17616
17618
  const field = path2[path2.length - 1][0];
17617
- const coll = parent == null ? void 0 : parent[field];
17619
+ const coll = parent?.[field];
17618
17620
  if (coll && "items" in coll)
17619
17621
  return coll;
17620
17622
  throw new Error("Parent collection not found");
@@ -18385,7 +18387,7 @@ function requireParser() {
18385
18387
  return -1;
18386
18388
  }
18387
18389
  function isFlowToken(token) {
18388
- switch (token == null ? void 0 : token.type) {
18390
+ switch (token?.type) {
18389
18391
  case "alias":
18390
18392
  case "scalar":
18391
18393
  case "single-quoted-scalar":
@@ -18412,7 +18414,6 @@ function requireParser() {
18412
18414
  }
18413
18415
  }
18414
18416
  function getFirstKeyStartProps(prev) {
18415
- var _a;
18416
18417
  if (prev.length === 0)
18417
18418
  return [];
18418
18419
  let i = prev.length;
@@ -18426,7 +18427,7 @@ function requireParser() {
18426
18427
  break loop;
18427
18428
  }
18428
18429
  }
18429
- while (((_a = prev[++i]) == null ? void 0 : _a.type) === "space") {
18430
+ while (prev[++i]?.type === "space") {
18430
18431
  }
18431
18432
  return prev.splice(i, prev.length);
18432
18433
  }
@@ -18770,7 +18771,6 @@ function requireParser() {
18770
18771
  }
18771
18772
  }
18772
18773
  *blockMap(map2) {
18773
- var _a;
18774
18774
  const it = map2.items[map2.items.length - 1];
18775
18775
  switch (this.type) {
18776
18776
  case "newline":
@@ -18778,8 +18778,8 @@ function requireParser() {
18778
18778
  if (it.value) {
18779
18779
  const end = "end" in it.value ? it.value.end : void 0;
18780
18780
  const last = Array.isArray(end) ? end[end.length - 1] : void 0;
18781
- if ((last == null ? void 0 : last.type) === "comment")
18782
- end == null ? void 0 : end.push(this.sourceToken);
18781
+ if (last?.type === "comment")
18782
+ end?.push(this.sourceToken);
18783
18783
  else
18784
18784
  map2.items.push({ start: [this.sourceToken] });
18785
18785
  } else if (it.sep) {
@@ -18797,7 +18797,7 @@ function requireParser() {
18797
18797
  } else {
18798
18798
  if (this.atIndentedComment(it.start, map2.indent)) {
18799
18799
  const prev = map2.items[map2.items.length - 2];
18800
- const end = (_a = prev == null ? void 0 : prev.value) == null ? void 0 : _a.end;
18800
+ const end = prev?.value?.end;
18801
18801
  if (Array.isArray(end)) {
18802
18802
  Array.prototype.push.apply(end, it.start);
18803
18803
  end.push(this.sourceToken);
@@ -18965,15 +18965,14 @@ function requireParser() {
18965
18965
  yield* this.step();
18966
18966
  }
18967
18967
  *blockSequence(seq2) {
18968
- var _a;
18969
18968
  const it = seq2.items[seq2.items.length - 1];
18970
18969
  switch (this.type) {
18971
18970
  case "newline":
18972
18971
  if (it.value) {
18973
18972
  const end = "end" in it.value ? it.value.end : void 0;
18974
18973
  const last = Array.isArray(end) ? end[end.length - 1] : void 0;
18975
- if ((last == null ? void 0 : last.type) === "comment")
18976
- end == null ? void 0 : end.push(this.sourceToken);
18974
+ if (last?.type === "comment")
18975
+ end?.push(this.sourceToken);
18977
18976
  else
18978
18977
  seq2.items.push({ start: [this.sourceToken] });
18979
18978
  } else
@@ -18986,7 +18985,7 @@ function requireParser() {
18986
18985
  else {
18987
18986
  if (this.atIndentedComment(it.start, seq2.indent)) {
18988
18987
  const prev = seq2.items[seq2.items.length - 2];
18989
- const end = (_a = prev == null ? void 0 : prev.value) == null ? void 0 : _a.end;
18988
+ const end = prev?.value?.end;
18990
18989
  if (Array.isArray(end)) {
18991
18990
  Array.prototype.push.apply(end, it.start);
18992
18991
  end.push(this.sourceToken);
@@ -19246,7 +19245,7 @@ function requirePublicApi() {
19246
19245
  }
19247
19246
  function parseAllDocuments(source, options2 = {}) {
19248
19247
  const { lineCounter: lineCounter3, prettyErrors } = parseOptions(options2);
19249
- const parser$1 = new parser2.Parser(lineCounter3 == null ? void 0 : lineCounter3.addNewLine);
19248
+ const parser$1 = new parser2.Parser(lineCounter3?.addNewLine);
19250
19249
  const composer$1 = new composer2.Composer(options2);
19251
19250
  const docs = Array.from(composer$1.compose(parser$1.parse(source)));
19252
19251
  if (prettyErrors && lineCounter3)
@@ -19260,7 +19259,7 @@ function requirePublicApi() {
19260
19259
  }
19261
19260
  function parseDocument(source, options2 = {}) {
19262
19261
  const { lineCounter: lineCounter3, prettyErrors } = parseOptions(options2);
19263
- const parser$1 = new parser2.Parser(lineCounter3 == null ? void 0 : lineCounter3.addNewLine);
19262
+ const parser$1 = new parser2.Parser(lineCounter3?.addNewLine);
19264
19263
  const composer$1 = new composer2.Composer(options2);
19265
19264
  let doc = null;
19266
19265
  for (const _doc of composer$1.compose(parser$1.parse(source), true, source.length)) {
@@ -19500,16 +19499,16 @@ const sha1 = (filepath) => {
19500
19499
  });
19501
19500
  };
19502
19501
  class Batcher {
19502
+ items = [];
19503
+ batchSize;
19504
+ debounceTimeMs;
19505
+ onBatch;
19506
+ debounceTimer;
19503
19507
  constructor({
19504
19508
  batchSize,
19505
19509
  debounceTimeMs,
19506
19510
  onBatch
19507
19511
  }) {
19508
- __publicField(this, "items", []);
19509
- __publicField(this, "batchSize");
19510
- __publicField(this, "debounceTimeMs");
19511
- __publicField(this, "onBatch");
19512
- __publicField(this, "debounceTimer");
19513
19512
  this.batchSize = batchSize;
19514
19513
  this.debounceTimeMs = debounceTimeMs;
19515
19514
  this.onBatch = onBatch;
@@ -19591,11 +19590,10 @@ const startWatch = async (paths, options2, {
19591
19590
  }
19592
19591
  });
19593
19592
  const onFile = async (path2, stats) => {
19594
- var _a;
19595
- if (stats == null ? void 0 : stats.isDirectory()) {
19593
+ if (stats?.isDirectory()) {
19596
19594
  return;
19597
19595
  }
19598
- const ext = "." + ((_a = path2.split(".").pop()) == null ? void 0 : _a.toLowerCase());
19596
+ const ext = "." + path2.split(".").pop()?.toLowerCase();
19599
19597
  if (!ext || !extensions.has(ext)) {
19600
19598
  return;
19601
19599
  }
@@ -19661,8 +19659,8 @@ const checkForDuplicates = async (files, { concurrency, skipHash, progress }) =>
19661
19659
  } else {
19662
19660
  console.log(`Received ${files.length} files, hashing...`);
19663
19661
  }
19664
- const hashProgressBar = multiBar2 == null ? void 0 : multiBar2.create(files.length, 0, { message: "Hashing files " });
19665
- const checkProgressBar = multiBar2 == null ? void 0 : multiBar2.create(files.length, 0, { message: "Checking for duplicates" });
19662
+ const hashProgressBar = multiBar2?.create(files.length, 0, { message: "Hashing files " });
19663
+ const checkProgressBar = multiBar2?.create(files.length, 0, { message: "Checking for duplicates" });
19666
19664
  const newFiles = [];
19667
19665
  const duplicates = [];
19668
19666
  const checkBulkUploadQueue = new Queue(
@@ -19676,7 +19674,7 @@ const checkForDuplicates = async (files, { concurrency, skipHash, progress }) =>
19676
19674
  duplicates.push({ id: assetId, filepath });
19677
19675
  }
19678
19676
  }
19679
- checkProgressBar == null ? void 0 : checkProgressBar.increment(assets.length);
19677
+ checkProgressBar?.increment(assets.length);
19680
19678
  },
19681
19679
  { concurrency, retry: 3 }
19682
19680
  );
@@ -19692,7 +19690,7 @@ const checkForDuplicates = async (files, { concurrency, skipHash, progress }) =>
19692
19690
  checkBulkUploadRequests = [];
19693
19691
  void checkBulkUploadQueue.push(batch);
19694
19692
  }
19695
- hashProgressBar == null ? void 0 : hashProgressBar.increment();
19693
+ hashProgressBar?.increment();
19696
19694
  return results;
19697
19695
  },
19698
19696
  { concurrency, retry: 3 }
@@ -19705,7 +19703,7 @@ const checkForDuplicates = async (files, { concurrency, skipHash, progress }) =>
19705
19703
  void checkBulkUploadQueue.push(checkBulkUploadRequests);
19706
19704
  }
19707
19705
  await checkBulkUploadQueue.drained();
19708
- multiBar2 == null ? void 0 : multiBar2.stop();
19706
+ multiBar2?.stop();
19709
19707
  console.log(`Found ${newFiles.length} new files and ${duplicates.length} duplicate${s(duplicates.length)}`);
19710
19708
  const failedTasks = queue2.tasks.filter((task) => task.status === "failed");
19711
19709
  if (failedTasks.length > 0) {
@@ -19743,8 +19741,8 @@ const uploadFiles = async (files, { dryRun, concurrency, progress }) => {
19743
19741
  } else {
19744
19742
  console.log(`Uploading ${files.length} asset${s(files.length)} (${byteSize(totalSize)})`);
19745
19743
  }
19746
- uploadProgress == null ? void 0 : uploadProgress.start(totalSize, 0);
19747
- uploadProgress == null ? void 0 : uploadProgress.update({ value_formatted: 0, total_formatted: byteSize(totalSize) });
19744
+ uploadProgress?.start(totalSize, 0);
19745
+ uploadProgress?.update({ value_formatted: 0, total_formatted: byteSize(totalSize) });
19748
19746
  let duplicateCount = 0;
19749
19747
  let duplicateSize = 0;
19750
19748
  let successCount = 0;
@@ -19765,7 +19763,7 @@ const uploadFiles = async (files, { dryRun, concurrency, progress }) => {
19765
19763
  successCount++;
19766
19764
  successSize += stats.size ?? 0;
19767
19765
  }
19768
- uploadProgress == null ? void 0 : uploadProgress.update(successSize, { value_formatted: byteSize(successSize + duplicateSize) });
19766
+ uploadProgress?.update(successSize, { value_formatted: byteSize(successSize + duplicateSize) });
19769
19767
  return response;
19770
19768
  },
19771
19769
  { concurrency, retry: 3 }
@@ -19774,7 +19772,7 @@ const uploadFiles = async (files, { dryRun, concurrency, progress }) => {
19774
19772
  void queue2.push(item);
19775
19773
  }
19776
19774
  await queue2.drained();
19777
- uploadProgress == null ? void 0 : uploadProgress.stop();
19775
+ uploadProgress?.stop();
19778
19776
  console.log(`Successfully uploaded ${successCount} new asset${s(successCount)} (${byteSize(successSize)})`);
19779
19777
  if (duplicateCount > 0) {
19780
19778
  console.log(`Skipped ${duplicateCount} duplicate asset${s(duplicateCount)} (${byteSize(duplicateSize)})`);
@@ -19850,7 +19848,6 @@ const deleteFiles = async (files, options2) => {
19850
19848
  }
19851
19849
  };
19852
19850
  const updateAlbums = async (assets, options2) => {
19853
- var _a;
19854
19851
  if (!options2.album && !options2.albumName) {
19855
19852
  return;
19856
19853
  }
@@ -19900,7 +19897,7 @@ const updateAlbums = async (assets, options2) => {
19900
19897
  if (!albumToAssets.has(albumId)) {
19901
19898
  albumToAssets.set(albumId, []);
19902
19899
  }
19903
- (_a = albumToAssets.get(albumId)) == null ? void 0 : _a.push(asset.id);
19900
+ albumToAssets.get(albumId)?.push(asset.id);
19904
19901
  }
19905
19902
  }
19906
19903
  const albumUpdateProgress = new cliProgressExports.SingleBar(
@@ -19971,7 +19968,7 @@ const serverInfo = async (options2) => {
19971
19968
  console.log(` Videos: ${stats.videos}`);
19972
19969
  console.log(` Total: ${stats.total}`);
19973
19970
  };
19974
- const version = "2.2.72";
19971
+ const version = "2.2.73";
19975
19972
  const defaultConfigDirectory = path$1.join(os.homedir(), ".config/immich/");
19976
19973
  const program = new Command().name("immich").version(version).description("Command line interface for Immich").addOption(
19977
19974
  new Option("-d, --config-directory <directory>", "Configuration directory where auth.yml will be stored").env("IMMICH_CONFIG_DIR").default(defaultConfigDirectory)
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@immich/cli",
3
- "version": "2.2.72",
3
+ "version": "2.2.73",
4
4
  "description": "Command Line Interface (CLI) for Immich",
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",
7
7
  "bin": {
8
- "immich": "dist/index.js"
8
+ "immich": "./bin/immich"
9
9
  },
10
10
  "license": "GNU Affero General Public License version 3",
11
11
  "keywords": [
@@ -21,7 +21,7 @@
21
21
  "@types/lodash-es": "^4.17.12",
22
22
  "@types/micromatch": "^4.0.9",
23
23
  "@types/mock-fs": "^4.13.1",
24
- "@types/node": "^22.15.31",
24
+ "@types/node": "^22.16.4",
25
25
  "@vitest/coverage-v8": "^3.0.0",
26
26
  "byte-size": "^9.0.0",
27
27
  "cli-progress": "^3.12.0",
@@ -36,7 +36,7 @@
36
36
  "prettier-plugin-organize-imports": "^4.0.0",
37
37
  "typescript": "^5.3.3",
38
38
  "typescript-eslint": "^8.28.0",
39
- "vite": "^6.0.0",
39
+ "vite": "^7.0.0",
40
40
  "vite-tsconfig-paths": "^5.0.0",
41
41
  "vitest": "^3.0.0",
42
42
  "vitest-fetch-mock": "^0.4.0",
@@ -69,6 +69,6 @@
69
69
  "micromatch": "^4.0.8"
70
70
  },
71
71
  "volta": {
72
- "node": "22.16.0"
72
+ "node": "22.17.1"
73
73
  }
74
74
  }