@mindline/sync 1.0.107 → 1.0.109

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.
@@ -3,5 +3,6 @@
3
3
  "",
4
4
  "\\src"
5
5
  ],
6
+ "SelectedNode": "\\src\\index.d.ts",
6
7
  "PreviewInSolutionExplorer": false
7
8
  }
package/.vs/slnx.sqlite CHANGED
Binary file
Binary file
@@ -6,6 +6,10 @@
6
6
  "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\ArvindSuthar\\source\\repos\\front\\sync\\src\\index.d.ts||{0F2454B1-A556-402D-A7D0-1FDE7F99DEE0}",
7
7
  "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:src\\index.d.ts||{0F2454B1-A556-402D-A7D0-1FDE7F99DEE0}"
8
8
  },
9
+ {
10
+ "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\ArvindSuthar\\source\\repos\\front\\sync\\vite.config.ts||{0F2454B1-A556-402D-A7D0-1FDE7F99DEE0}",
11
+ "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:vite.config.ts||{0F2454B1-A556-402D-A7D0-1FDE7F99DEE0}"
12
+ },
9
13
  {
10
14
  "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\ArvindSuthar\\source\\repos\\front\\sync\\src\\index.ts||{0F2454B1-A556-402D-A7D0-1FDE7F99DEE0}",
11
15
  "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:src\\index.ts||{0F2454B1-A556-402D-A7D0-1FDE7F99DEE0}"
@@ -78,20 +82,33 @@
78
82
  "RelativeDocumentMoniker": "src\\index.d.ts",
79
83
  "ToolTip": "C:\\Users\\ArvindSuthar\\source\\repos\\front\\sync\\src\\index.d.ts",
80
84
  "RelativeToolTip": "src\\index.d.ts",
81
- "ViewState": "AgIAAI0AAAAAAAAAAAAAALYAAAAIAAAAAAAAAA==",
85
+ "ViewState": "AgIAADIBAAAAAAAAAAAAAFEBAAAAAAAAAAAAAA==",
82
86
  "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003213|",
83
- "WhenOpened": "2025-12-16T15:22:39.404Z",
87
+ "WhenOpened": "2026-01-21T15:21:58.603Z",
84
88
  "EditorCaption": ""
85
89
  },
86
90
  {
87
91
  "$type": "Document",
88
92
  "DocumentIndex": 1,
93
+ "Title": "vite.config.ts",
94
+ "DocumentMoniker": "C:\\Users\\ArvindSuthar\\source\\repos\\front\\sync\\vite.config.ts",
95
+ "RelativeDocumentMoniker": "vite.config.ts",
96
+ "ToolTip": "C:\\Users\\ArvindSuthar\\source\\repos\\front\\sync\\vite.config.ts",
97
+ "RelativeToolTip": "vite.config.ts",
98
+ "ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
99
+ "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003213|",
100
+ "WhenOpened": "2026-01-21T15:20:13.535Z",
101
+ "EditorCaption": ""
102
+ },
103
+ {
104
+ "$type": "Document",
105
+ "DocumentIndex": 2,
89
106
  "Title": "index.ts",
90
107
  "DocumentMoniker": "C:\\Users\\ArvindSuthar\\source\\repos\\front\\sync\\src\\index.ts",
91
108
  "RelativeDocumentMoniker": "src\\index.ts",
92
109
  "ToolTip": "C:\\Users\\ArvindSuthar\\source\\repos\\front\\sync\\src\\index.ts",
93
110
  "RelativeToolTip": "src\\index.ts",
94
- "ViewState": "AgIAAFMEAAAAAAAAAADgv6kEAAAeAAAAAAAAAA==",
111
+ "ViewState": "AgIAAKwGAAAAAAAAAAAQwNYGAAAlAAAAAAAAAA==",
95
112
  "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003213|",
96
113
  "WhenOpened": "2025-12-09T14:51:18.593Z",
97
114
  "EditorCaption": ""
@@ -5,6 +5,14 @@
5
5
  {
6
6
  "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\ArvindSuthar\\source\\repos\\front\\sync\\src\\index.ts||{0F2454B1-A556-402D-A7D0-1FDE7F99DEE0}",
7
7
  "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:src\\index.ts||{0F2454B1-A556-402D-A7D0-1FDE7F99DEE0}"
8
+ },
9
+ {
10
+ "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\ArvindSuthar\\source\\repos\\front\\sync\\src\\index.d.ts||{0F2454B1-A556-402D-A7D0-1FDE7F99DEE0}",
11
+ "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:src\\index.d.ts||{0F2454B1-A556-402D-A7D0-1FDE7F99DEE0}"
12
+ },
13
+ {
14
+ "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\ArvindSuthar\\source\\repos\\front\\sync\\vite.config.ts||{0F2454B1-A556-402D-A7D0-1FDE7F99DEE0}",
15
+ "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:vite.config.ts||{0F2454B1-A556-402D-A7D0-1FDE7F99DEE0}"
8
16
  }
9
17
  ],
10
18
  "DocumentGroupContainers": [
@@ -60,12 +68,37 @@
60
68
  },
61
69
  {
62
70
  "DockedWidth": 160,
63
- "SelectedChildIndex": 1,
71
+ "SelectedChildIndex": 3,
64
72
  "Children": [
65
73
  {
66
74
  "$type": "Bookmark",
67
75
  "Name": "ST:0:0:{004be353-6879-467c-9d1e-9ac23cdf6d49}"
68
76
  },
77
+ {
78
+ "$type": "Document",
79
+ "DocumentIndex": 1,
80
+ "Title": "index.d.ts",
81
+ "DocumentMoniker": "C:\\Users\\ArvindSuthar\\source\\repos\\front\\sync\\src\\index.d.ts",
82
+ "RelativeDocumentMoniker": "src\\index.d.ts",
83
+ "ToolTip": "C:\\Users\\ArvindSuthar\\source\\repos\\front\\sync\\src\\index.d.ts",
84
+ "RelativeToolTip": "src\\index.d.ts",
85
+ "ViewState": "AgIAAE0BAAAAAAAAAAAAAFEBAAAAAAAAAAAAAA==",
86
+ "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003213|",
87
+ "WhenOpened": "2026-01-21T15:21:58.603Z",
88
+ "EditorCaption": ""
89
+ },
90
+ {
91
+ "$type": "Document",
92
+ "DocumentIndex": 2,
93
+ "Title": "vite.config.ts",
94
+ "DocumentMoniker": "C:\\Users\\ArvindSuthar\\source\\repos\\front\\sync\\vite.config.ts",
95
+ "RelativeDocumentMoniker": "vite.config.ts",
96
+ "ToolTip": "C:\\Users\\ArvindSuthar\\source\\repos\\front\\sync\\vite.config.ts",
97
+ "RelativeToolTip": "vite.config.ts",
98
+ "ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
99
+ "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003213|",
100
+ "WhenOpened": "2026-01-21T15:20:13.535Z"
101
+ },
69
102
  {
70
103
  "$type": "Document",
71
104
  "DocumentIndex": 0,
@@ -74,7 +107,7 @@
74
107
  "RelativeDocumentMoniker": "src\\index.ts",
75
108
  "ToolTip": "C:\\Users\\ArvindSuthar\\source\\repos\\front\\sync\\src\\index.ts",
76
109
  "RelativeToolTip": "src\\index.ts",
77
- "ViewState": "AgIAAB4EAAAAAAAAAADgvzkEAAAWAAAAAAAAAA==",
110
+ "ViewState": "AgIAAF8EAAAAAAAAAAAQwIAEAAAAAAAAAAAAAA==",
78
111
  "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003213|",
79
112
  "WhenOpened": "2025-12-09T14:51:18.593Z",
80
113
  "EditorCaption": ""
@@ -2,12 +2,12 @@ import { IPublicClientApplication } from '@azure/msal-browser';
2
2
  export declare function sum(a: number, b: number): number;
3
3
  export declare function helloNpm(): string;
4
4
  export declare function getSyncVersion(): string;
5
- export declare class APIResult {
5
+ export declare class APIResult<T = any> {
6
6
  result: boolean;
7
7
  status: number;
8
8
  error: string;
9
9
  version: string;
10
- array: Array<Object> | null;
10
+ array: Array<T> | null;
11
11
  constructor();
12
12
  }
13
13
  export declare class azureConfig {
@@ -247,6 +247,7 @@ export declare class BatchArray {
247
247
  pb_timer: NodeJS.Timeout | null;
248
248
  milestoneArray: MilestoneArray;
249
249
  constructor(config: SyncConfig | null, syncPortalGlobalState: InitInfo | null, bClearLocalStorage: boolean);
250
+ clearStoredBatchIds(): void;
250
251
  init(config: SyncConfig | null | undefined, syncPortalGlobalState: InitInfo | null, bClearLocalStorage: boolean): void;
251
252
  initializeProgressBar(setSyncProgress: (progress: number) => void, setConfigSyncResult: (result: string) => void, setIdleText: (idleText: string) => void, setMilestones: (milestones: Milestone[]) => void): void;
252
253
  uninitializeProgressBar(setSyncProgress: (progress: number) => void, setConfigSyncResult: (result: string) => void, setIdleText: (idleText: string) => void, setMilestones: (milestones: Milestone[]) => void): void;
package/dist/sync.es.js CHANGED
@@ -1,11 +1,11 @@
1
- var ve = Object.defineProperty;
1
+ var Pe = Object.defineProperty;
2
2
  var Ie = (n) => {
3
3
  throw TypeError(n);
4
4
  };
5
- var Pe = (n, s, r) => s in n ? ve(n, s, { enumerable: !0, configurable: !0, writable: !0, value: r }) : n[s] = r;
6
- var c = (n, s, r) => Pe(n, typeof s != "symbol" ? s + "" : s, r), Re = (n, s, r) => s.has(n) || Ie("Cannot " + r);
5
+ var ve = (n, s, r) => s in n ? Pe(n, s, { enumerable: !0, configurable: !0, writable: !0, value: r }) : n[s] = r;
6
+ var c = (n, s, r) => ve(n, typeof s != "symbol" ? s + "" : s, r), Re = (n, s, r) => s.has(n) || Ie("Cannot " + r);
7
7
  var J = (n, s, r) => s.has(n) ? Ie("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(n) : s.set(n, r);
8
- var O = (n, s, r) => (Re(n, s, "access private method"), r);
8
+ var N = (n, s, r) => (Re(n, s, "access private method"), r);
9
9
  import * as V from "@microsoft/signalr";
10
10
  import { deserializeArray as U } from "class-transformer";
11
11
  const Ge = [
@@ -147,7 +147,7 @@ function xt() {
147
147
  return "hello NPM";
148
148
  }
149
149
  function _() {
150
- return "1.0.107";
150
+ return "1.0.109";
151
151
  }
152
152
  class m {
153
153
  constructor() {
@@ -400,7 +400,7 @@ class ne {
400
400
  this.id = "", this.name = "", this.ownerid = "", this.associatedUsers = new Array(), this.associatedTenants = new Array(), this.associatedConfigs = new Array(), this.sel = !1;
401
401
  }
402
402
  }
403
- function N() {
403
+ function G() {
404
404
  let n;
405
405
  try {
406
406
  n = window.localStorage;
@@ -433,7 +433,7 @@ class Wt {
433
433
  }
434
434
  // get initial data from localStorage or file
435
435
  init(s) {
436
- if (console.log(`Calling InitInfo::init(bClearLocalStorage: ${s ? "true" : "false"})`), N()) {
436
+ if (console.log(`Calling InitInfo::init(bClearLocalStorage: ${s ? "true" : "false"})`), G()) {
437
437
  let o = localStorage.getItem("InitInfo");
438
438
  if (o != null && typeof o == "string" && o !== "") {
439
439
  let i = JSON.parse(o);
@@ -441,7 +441,7 @@ class Wt {
441
441
  if (s)
442
442
  localStorage.removeItem("InitInfo");
443
443
  else {
444
- O(this, Z, Ae).call(this, i);
444
+ N(this, Z, Ae).call(this, i);
445
445
  return;
446
446
  }
447
447
  }
@@ -554,42 +554,42 @@ const je = [
554
554
  ]
555
555
  }
556
556
  ];
557
- var G, oe, ie, le;
557
+ var x, oe, ie, le;
558
558
  class Ft {
559
559
  constructor(s) {
560
- J(this, G);
560
+ J(this, x);
561
561
  c(this, "tasks");
562
562
  this.tasks = [new se()], this.init(s);
563
563
  }
564
564
  // get initial data from localStorage or file
565
565
  init(s) {
566
- if (console.log(`Calling TaskArray::init(bClearLocalStorage: ${s ? "true" : "false"})`), this.tasks.length = 0, s && N() && localStorage.removeItem("Tasks"), N()) {
566
+ if (console.log(`Calling TaskArray::init(bClearLocalStorage: ${s ? "true" : "false"})`), this.tasks.length = 0, s && G() && localStorage.removeItem("Tasks"), G()) {
567
567
  let r = localStorage.getItem("Tasks");
568
568
  if (r != null && typeof r == "string" && r !== "") {
569
569
  let e = JSON.parse(r);
570
- if (this.tasks = O(this, G, ie).call(this, e.tasks), this.tasks.length !== 0) return;
570
+ if (this.tasks = N(this, x, ie).call(this, e.tasks), this.tasks.length !== 0) return;
571
571
  }
572
572
  }
573
- this.tasks = O(this, G, ie).call(this, je);
573
+ this.tasks = N(this, x, ie).call(this, je);
574
574
  }
575
575
  // set start time for a task
576
576
  setTaskStart(s, r) {
577
- let t = O(this, G, oe).call(this, s);
577
+ let t = N(this, x, oe).call(this, s);
578
578
  if (t != null && t != null)
579
- t.setStart(r), t.status = "in progress", O(this, G, le).call(this);
579
+ t.setStart(r), t.status = "in progress", N(this, x, le).call(this);
580
580
  else
581
581
  debugger;
582
582
  }
583
583
  // set end time for a task
584
584
  setTaskEnd(s, r, t) {
585
- let e = O(this, G, oe).call(this, s);
585
+ let e = N(this, x, oe).call(this, s);
586
586
  if (e != null && e != null)
587
- e.setEnd(r), e.status = t, O(this, G, le).call(this);
587
+ e.setEnd(r), e.status = t, N(this, x, le).call(this);
588
588
  else
589
589
  debugger;
590
590
  }
591
591
  }
592
- G = new WeakSet(), //
592
+ x = new WeakSet(), //
593
593
  // private
594
594
  //
595
595
  oe = function(s) {
@@ -610,7 +610,7 @@ oe = function(s) {
610
610
  });
611
611
  }, le = function() {
612
612
  let s = JSON.stringify(this);
613
- N() && localStorage.setItem("Tasks", s);
613
+ G() && localStorage.setItem("Tasks", s);
614
614
  };
615
615
  class se {
616
616
  constructor() {
@@ -673,7 +673,7 @@ class He {
673
673
  this.init(s);
674
674
  }
675
675
  init(s) {
676
- if (N()) {
676
+ if (G()) {
677
677
  let r = localStorage.getItem("syncmilestones");
678
678
  if (r != null && typeof r == "string" && r !== "") {
679
679
  let e = JSON.parse(r);
@@ -681,16 +681,16 @@ class He {
681
681
  if (s)
682
682
  localStorage.removeItem("syncmilestones");
683
683
  else {
684
- O(this, q, ce).call(this, e);
684
+ N(this, q, ce).call(this, e);
685
685
  return;
686
686
  }
687
687
  }
688
688
  }
689
- O(this, q, ce).call(this, Ne);
689
+ N(this, q, ce).call(this, Ne);
690
690
  }
691
691
  save() {
692
692
  let s = JSON.stringify(this.milestones);
693
- N() && localStorage.setItem("syncmilestones", s);
693
+ G() && localStorage.setItem("syncmilestones", s);
694
694
  }
695
695
  // milestone tracking during a sync
696
696
  start(s) {
@@ -761,13 +761,16 @@ class Bt {
761
761
  c(this, "pb_total");
762
762
  c(this, "pb_timer");
763
763
  c(this, "milestoneArray");
764
- this.tenantNodes = new Array(), this.init(s, r, t), this.pb_startTS = 0, this.pb_progress = 0, this.pb_increment = 0, this.pb_timer = null, this.pb_idle = 0, this.pb_idleMax = 0, this.pb_total = 0, this.milestoneArray = new He(!1);
764
+ this.tenantNodes = new Array(), this.init(s, r, t), this.pb_startTS = 0, this.pb_progress = 0, this.pb_increment = 0.25, this.pb_timer = null, this.pb_idle = 0, this.pb_idleMax = 0, this.pb_total = 0, this.milestoneArray = new He(!1);
765
+ }
766
+ clearStoredBatchIds() {
767
+ G() && localStorage.setItem("BatchIdArray", "[]");
765
768
  }
766
769
  // populate tenantNodes based on config tenants
767
770
  init(s, r, t) {
768
771
  console.log(
769
772
  `Calling BatchArray::init(config: "${s ? s.name : "null"}", bClearLocalStorage: ${t ? "true" : "false"})`
770
- ), t && N() && (localStorage.removeItem(s.name), this.milestoneArray.init(t)), s != null && s.tenants != null && r != null && (this.tenantNodes.length = 0, s.tenants.map((e) => {
773
+ ), t && G() && (localStorage.removeItem(s.name), this.milestoneArray.init(t)), s != null && s.tenants != null && r != null && (this.tenantNodes.length = 0, s.tenants.map((e) => {
771
774
  if (e.configurationTenantType === "source" || e.configurationTenantType === "sourcetarget") {
772
775
  let a = r.ts.find(
773
776
  (o) => o.tid === e.tid
@@ -813,7 +816,7 @@ class Bt {
813
816
  }
814
817
  initializeProgressBar(s, r, t, e) {
815
818
  this.pb_startTS = Date.now(), this.pb_progress = 0, this.pb_increment = 0.25, this.pb_idle = 0, this.pb_idleMax = 0, this.pb_total = 0, this.pb_timer = setInterval(() => {
816
- console.log("this.tenantNodes", this.tenantNodes), this.tenantNodes.map((o) => o.targets.map((d) => d.status === "complete" || o.nothingtosync).reduce((d, i) => d && i)).reduce((o, d) => o && d) ? (clearInterval(this.pb_timer), this.pb_timer = null, this.pb_progress = 100, s(this.pb_progress), t(`Complete. [max idle: ${this.pb_idleMax}]`)) : (this.pb_total = this.pb_total + 1, this.pb_idle = this.pb_idle + 1, this.pb_idleMax = Math.max(this.pb_idle, this.pb_idleMax), t(`${this.pb_total} seconds elapsed. Last update ${this.pb_idle} seconds ago. [max idle: ${this.pb_idleMax}/60]`), this.pb_idle >= 60 && this.milestoneArray.milestones[0].Write == null && r(`sync continuing, but no update for ${this.pb_idle} seconds`), this.pb_progress < 100 && (this.pb_progress = Math.min(100, this.pb_progress + this.pb_increment), s(this.pb_progress)));
819
+ console.log("this.tenantNodes", this.tenantNodes), this.tenantNodes.map((o) => o.targets.map((d) => d.status === "complete" || o.nothingtosync).reduce((d, i) => d && i)).reduce((o, d) => o && d) ? (clearInterval(this.pb_timer), this.pb_timer = null, this.pb_progress = 100, s(this.pb_progress), t(`Complete. [max idle: ${this.pb_idleMax}]`), this.clearStoredBatchIds()) : (this.pb_total = this.pb_total + 1, this.pb_idle = this.pb_idle + 1, this.pb_idleMax = Math.max(this.pb_idle, this.pb_idleMax), t(`${this.pb_total} seconds elapsed. Last update ${this.pb_idle} seconds ago. [max idle: ${this.pb_idleMax}/60]`), this.pb_idle >= 60 && this.milestoneArray.milestones[0].Write == null && r(`sync continuing, but no update for ${this.pb_idle} seconds`), this.pb_progress < 100 && (this.pb_progress = Math.min(100, this.pb_progress + this.pb_increment), s(this.pb_progress)));
817
820
  }, 1e3), this.milestoneArray.start(e);
818
821
  }
819
822
  uninitializeProgressBar(s, r, t, e) {
@@ -821,7 +824,7 @@ class Bt {
821
824
  }
822
825
  initializeSignalR(s, r, t, e, a, o, d, i, l, u, f, I, D, R) {
823
826
  this.milestoneArray.post(f), I("started sync, waiting for updates..."), this.init(s, r, !1);
824
- let W = (x) => (E) => {
827
+ let W = (C) => (E) => {
825
828
  console.log(E);
826
829
  let A = JSON.parse(E);
827
830
  this.pb_idle = 0;
@@ -838,28 +841,28 @@ class Bt {
838
841
  return;
839
842
  }
840
843
  h.batchId = $.BatchId;
841
- let ue = A.Stats, P = Object.keys(ue), C = Object.values(ue), X = !1, fe = !1;
842
- for (let g = 0; g < P.length; g++) {
843
- let v = P[g].endsWith("TotalCount"), L = P[g].endsWith("CurrentCount"), z = P[g].endsWith("ExtCount"), K = P[g].endsWith("DeferredCount"), ee = P[g].endsWith("RescheduledCount");
844
- if (z && (h.excluded = Math.max(Number(C[g]), h.excluded), h.targets.map((T) => {
844
+ let ue = A.Stats, v = Object.keys(ue), O = Object.values(ue), X = !1, fe = !1;
845
+ for (let g = 0; g < v.length; g++) {
846
+ let P = v[g].endsWith("TotalCount"), L = v[g].endsWith("CurrentCount"), z = v[g].endsWith("ExtCount"), K = v[g].endsWith("DeferredCount"), ee = v[g].endsWith("RescheduledCount");
847
+ if (z && (h.excluded = Math.max(Number(O[g]), h.excluded), h.targets.map((T) => {
845
848
  T.excluded = h.excluded, T.update(T.total, T.read, T.excluded, T.written, T.deferred);
846
- })), v && (X = Number(C[g]) == 0, h.total = Math.max(Number(C[g]), h.total), h.targets.map((T) => {
849
+ })), P && (X = Number(O[g]) == 0, h.total = Math.max(Number(O[g]), h.total), h.targets.map((T) => {
847
850
  T.total = h.total, T.update(T.total, T.read, T.excluded, T.written, T.deferred);
848
- })), P[g].startsWith("Reader")) {
851
+ })), v[g].startsWith("Reader")) {
849
852
  let T = /Reader\/TID:(.+)\/TotalCount/;
850
- if (L && (T = /Reader\/TID:(.+)\/CurrentCount/), z && (T = /Reader\/TID:(.+)\/ExtCount/), K && (T = /Reader\/TID:(.+)\/DeferredCount/), ee && (T = /Reader\/TID:(.+)\/RescheduledCount/), P[g].match(T) == null) {
851
- console.log(`tid not found in ${P[g]}.`);
853
+ if (L && (T = /Reader\/TID:(.+)\/CurrentCount/), z && (T = /Reader\/TID:(.+)\/ExtCount/), K && (T = /Reader\/TID:(.+)\/DeferredCount/), ee && (T = /Reader\/TID:(.+)\/RescheduledCount/), v[g].match(T) == null) {
854
+ console.log(`tid not found in ${v[g]}.`);
852
855
  debugger;
853
856
  return;
854
857
  }
855
- v ? (X = Number(C[g]) == 0, h.total = Math.max(Number(C[g]), h.total), console.log(`----- ${h.name} TID: ${h.tid} batchId: ${h.batchId}`), console.log(`----- ${h.name} Total To Read: ${h.total}`)) : (fe = Number(C[g]) == 0, L ? (h.read = Math.max(Number(C[g]), h.read), console.log(`----- ${h.name} Currently Read: ${h.read}`)) : K && (h.deferred = Math.max(Number(C[g]), h.deferred), console.log(`----- ${h.name} Deferred: ${h.deferred}`)));
858
+ P ? (X = Number(O[g]) == 0, h.total = Math.max(Number(O[g]), h.total), console.log(`----- ${h.name} TID: ${h.tid} batchId: ${h.batchId}`), console.log(`----- ${h.name} Total To Read: ${h.total}`)) : (fe = Number(O[g]) == 0, L ? (h.read = Math.max(Number(O[g]), h.read), console.log(`----- ${h.name} Currently Read: ${h.read}`)) : K && (h.deferred = Math.max(Number(O[g]), h.deferred), console.log(`----- ${h.name} Deferred: ${h.deferred}`)));
856
859
  }
857
- if (h.nothingtosync = X && fe, P[g].startsWith("Writer")) {
860
+ if (h.nothingtosync = X && fe, v[g].startsWith("Writer")) {
858
861
  let T = /Reader\/TID:(.+)\/TotalCount/;
859
862
  L && (T = /Writer\/TID:(.+)\/CurrentCount/), z && (T = /Writer\/TID:(.+)\/ExtCount/), K && (T = /Writer\/TID:(.+)\/DeferredCount/), ee && (T = /Writer\/TID:(.+)\/RescheduledCount/);
860
- let te = P[g].match(T);
863
+ let te = v[g].match(T);
861
864
  if (te == null) {
862
- console.log(`tid not found in ${P[g]}.`);
865
+ console.log(`tid not found in ${v[g]}.`);
863
866
  debugger;
864
867
  return;
865
868
  }
@@ -869,12 +872,12 @@ class Bt {
869
872
  debugger;
870
873
  return;
871
874
  }
872
- if (S.total = Math.max(Number(h.total), S.total), S.total = Math.max(Number(h.total), S.total), S.batchId = $.BatchId, v)
873
- S.total = Math.max(Number(v), S.total), console.log(`----- ${S.name} TID: ${S.tid} batchId: ${S.batchId}`), console.log(`----- ${S.name} Total To Write: ${S.total}`);
875
+ if (S.total = Math.max(Number(h.total), S.total), S.total = Math.max(Number(h.total), S.total), S.batchId = $.BatchId, P)
876
+ S.total = Math.max(Number(P), S.total), console.log(`----- ${S.name} TID: ${S.tid} batchId: ${S.batchId}`), console.log(`----- ${S.name} Total To Write: ${S.total}`);
874
877
  else if (L)
875
- S.written = Math.max(Number(C[g]), S.written), console.log(`----- ${S.name} Total Written: ${S.written}`);
878
+ S.written = Math.max(Number(O[g]), S.written), console.log(`----- ${S.name} Total Written: ${S.written}`);
876
879
  else if (K || ee)
877
- S.deferred = Math.max(Number(C[g]), S.deferred), console.log(`----- ${S.name} Total Deferred: ${S.deferred}`);
880
+ S.deferred = Math.max(Number(O[g]), S.deferred), console.log(`----- ${S.name} Total Deferred: ${S.deferred}`);
878
881
  else {
879
882
  console.log("unknown writer type");
880
883
  debugger;
@@ -886,26 +889,26 @@ class Bt {
886
889
  h.update(h.total, h.read, h.excluded, h.written, h.deferred);
887
890
  let pe = !0, he = !0, ge = !1, me = !0, Y = 0, ye = 0, we = 0, Te = 0, Se = 0, be = 0;
888
891
  if (this.tenantNodes.map((g) => {
889
- g.targets.map((v) => {
890
- he && (he = v.status == "complete" || v.status == "failed"), ge || (ge = v.total > 0 || v.status != "not started"), Te += Math.max(v.total, g.total), Se += v.written, be += v.excluded;
892
+ g.targets.map((P) => {
893
+ he && (he = P.status == "complete" || P.status == "failed"), ge || (ge = P.total > 0 || P.status != "not started"), Te += Math.max(P.total, g.total), Se += P.written, be += P.excluded;
891
894
  }), me && (me = g.nothingtosync), pe && (pe = g.status == "complete" || g.status == "failed"), Y += g.total, ye += g.read, we += g.excluded;
892
895
  }), a(Y), d(ye), o(we), i(Math.max(Te, Y)), u(Se), l(be), me)
893
- this.milestoneArray.write(f), x.stop(), I("nothing to sync"), console.log('Setting config sync result: "nothing to sync"');
896
+ this.milestoneArray.write(f), C.stop(), I("nothing to sync"), this.clearStoredBatchIds(), console.log('Setting config sync result: "nothing to sync"');
894
897
  else {
895
898
  if (pe) {
896
899
  this.milestoneArray.read(f), I("reading complete"), console.log('Setting config sync result: "reading complete"'), e(s.workspaceId);
897
900
  let z = (Date.now() - this.pb_startTS) / 1e3 / 8.5;
898
901
  this.pb_increment = z, console.log(`Setting increment: ${this.pb_increment}% per second`);
899
902
  }
900
- he ? (this.milestoneArray.write(f), x.stop(), I("sync complete"), console.log('Setting config sync result: "complete"')) : ge ? (I("writing in progress"), console.log('Setting config sync result: "writing in progress"')) : this.milestoneArray.milestones[0].Read == null && (I("reading in progress"), console.log('Setting config sync result: "reading in progress"'));
903
+ he ? (this.milestoneArray.write(f), C.stop(), I("sync complete"), this.clearStoredBatchIds(), console.log('Setting config sync result: "complete"')) : ge ? (I("writing in progress"), console.log('Setting config sync result: "writing in progress"')) : this.milestoneArray.milestones[0].Read == null && (I("reading in progress"), console.log('Setting config sync result: "reading in progress"'));
901
904
  }
902
905
  };
903
- t.map((x) => {
906
+ t.map((C) => {
904
907
  const E = w.signalREndpoint();
905
908
  let A = new URL(E);
906
- A.searchParams.append("statsId", x.BatchId), console.log(`Creating SignalR Hub for TID: ${x.SourceId} ${A.href}`);
909
+ A.searchParams.append("statsId", C.BatchId), console.log(`Creating SignalR Hub for TID: ${C.SourceId} ${A.href}`);
907
910
  const $ = new V.HubConnectionBuilder().withUrl(A.href).withAutomaticReconnect().configureLogging(V.LogLevel.Information).build();
908
- R && JSON.parse(R).TargetID === x.BatchId && W($)(R), $.on("newMessage", W($)), $.onreconnecting((h) => {
911
+ R && JSON.parse(R).TargetID === C.BatchId && W($)(R), $.on("newMessage", W($)), $.onreconnecting((h) => {
909
912
  console.assert($.state === V.HubConnectionState.Reconnecting), console.log(`Connection lost due to error "${h}". Reconnecting.`);
910
913
  }), $.onreconnected((h) => {
911
914
  console.assert($.state === V.HubConnectionState.Connected), console.log(`Connection reestablished. Connected with connectionId "${h}".`);
@@ -921,7 +924,7 @@ class Bt {
921
924
  debugger;
922
925
  return e.result = !1, e.error = "startSync: invalid parameters", e.status = 500, e;
923
926
  }
924
- return e = await vt(s, r, t), e;
927
+ return e = await Pt(s, r, t), e;
925
928
  }
926
929
  }
927
930
  class $e {
@@ -951,7 +954,7 @@ class ke {
951
954
  }
952
955
  // get resource data from localStorage or file
953
956
  init(s) {
954
- if (console.log(`Calling ResourceArray::init(bClearLocalStorage: ${s ? "true" : "false"})`), N()) {
957
+ if (console.log(`Calling ResourceArray::init(bClearLocalStorage: ${s ? "true" : "false"})`), G()) {
955
958
  let t = localStorage.getItem("ResourceArray");
956
959
  if (t != null && typeof t == "string" && t !== "")
957
960
  if (s)
@@ -976,7 +979,7 @@ class ke {
976
979
  }
977
980
  // save resource data to localstorage
978
981
  save() {
979
- if (N()) {
982
+ if (G()) {
980
983
  let s = JSON.stringify(this);
981
984
  localStorage.setItem("ResourceArray", s);
982
985
  }
@@ -999,7 +1002,7 @@ class Ut {
999
1002
  }
1000
1003
  // get initial data from localStorage or file
1001
1004
  init(s) {
1002
- if (console.log(`Calling ResourceArray::init(bClearLocalStorage: ${s ? "true" : "false"})`), N()) {
1005
+ if (console.log(`Calling ResourceArray::init(bClearLocalStorage: ${s ? "true" : "false"})`), G()) {
1003
1006
  let t = localStorage.getItem("RBACActors");
1004
1007
  if (t != null && typeof t == "string" && t !== "")
1005
1008
  if (s)
@@ -1387,7 +1390,9 @@ async function Yt(n, s, r, t, e, a, o, d) {
1387
1390
  let i = new m();
1388
1391
  if (r.id === "1") {
1389
1392
  if (i = await Tt(n, s, r, a.id, d), i.result) {
1390
- t && t(r.id);
1393
+ r.tenants.forEach((f) => {
1394
+ (f.configId === "1" || f.configId === "") && (f.configId = r.id);
1395
+ }), t && t(r.id);
1391
1396
  const l = {};
1392
1397
  Object.defineProperty(l, r.id, { value: !0, writable: !0, enumerable: !0 }), e(l);
1393
1398
  let u = a.associatedConfigs.findIndex((f) => f == "1");
@@ -1415,7 +1420,7 @@ async function rs(n, s, r, t, e, a) {
1415
1420
  if (d != null) {
1416
1421
  d.associatedConfigs.length = 0;
1417
1422
  let i = await mt(n, s, a, d.id, e);
1418
- return i.result && (t.tagWithWorkspaces(), localStorage.setItem("BatchIdArray", "{}")), i;
1423
+ return i.result && t.tagWithWorkspaces(), i;
1419
1424
  } else
1420
1425
  return o.result = !1, o.error = "Workspace not found.", o.status = 404, o;
1421
1426
  } catch (d) {
@@ -1531,11 +1536,11 @@ async function rt(n, s, r, t) {
1531
1536
  A != null && A.sel && (u = A.id);
1532
1537
  }
1533
1538
  o.associatedUsers.length = 0, o.associatedTenants.length = 0, o.associatedConfigs.length = 0, o.id = a.id, o.name = a.name, o.ownerid = a.workspaceOwnerUserId;
1534
- let f = it(n, s, o.id, t), I = At(n, s, o.id, t), D = bt(n, s, o.id, t), [R, W, x] = await Promise.all([f, I, D]);
1539
+ let f = it(n, s, o.id, t), I = At(n, s, o.id, t), D = bt(n, s, o.id, t), [R, W, C] = await Promise.all([f, I, D]);
1535
1540
  if (!R.result) return R;
1536
1541
  if (!W.result) return W;
1537
- if (!x.result) return x;
1538
- tt(o, r, W.array, l), et(o, r, R.array, i), st(o, r, x.array, u), r.tagWithWorkspaces();
1542
+ if (!C.result) return C;
1543
+ tt(o, r, W.array, l), et(o, r, R.array, i), st(o, r, C.array, u), r.tagWithWorkspaces();
1539
1544
  }
1540
1545
  return e;
1541
1546
  }
@@ -1989,7 +1994,9 @@ async function Tt(n, s, r, t, e) {
1989
1994
  "sourceGroupName": ${I},
1990
1995
  "targetGroupId": ${D},
1991
1996
  "targetGroupName": ${R},
1992
- "configurationTenantType": "${u.configurationTenantType}"
1997
+ "configurationTenantType": "${u.configurationTenantType}",
1998
+ "isReadPermissionConsented": ${u.isReadPermissionConsented},
1999
+ "isWritePermissionConsented": ${u.isWritePermissionConsented}
1993
2000
  }`;
1994
2001
  }), i += "]}";
1995
2002
  let l = { method: "POST", headers: d, body: i };
@@ -1999,8 +2006,8 @@ async function Tt(n, s, r, t, e) {
1999
2006
  let u = await fetch(o, l);
2000
2007
  if (u.status === 200 && u.statusText === "OK") {
2001
2008
  let f = await u.json();
2002
- return r.id = f, console.log(
2003
- `Successful ConfigID: ${f} from POST to /config: ${i}`
2009
+ return r.id = typeof f == "object" && f !== null && f.id ? f.id : f, console.log(
2010
+ `Successful ConfigID: ${r.id} from POST to /config: ${i}`
2004
2011
  ), a;
2005
2012
  } else
2006
2013
  return a.error = await y(u), console.log(`Failed PUT to /config: ${i}`), console.log(a.error), a.status = 500, a.result = !1, a;
@@ -2030,7 +2037,9 @@ async function St(n, s, r, t) {
2030
2037
  "targetGroupId": ${R},
2031
2038
  "targetGroupName": ${W},
2032
2039
  "configurationTenantType": "${u.configurationTenantType}",
2033
- "deltaToken": "${u.deltaToken}"
2040
+ "deltaToken": "${u.deltaToken}",
2041
+ "isReadPermissionConsented": ${u.isReadPermissionConsented},
2042
+ "isWritePermissionConsented": ${u.isWritePermissionConsented}
2034
2043
  }`;
2035
2044
  }), i += "]}";
2036
2045
  let l = { method: "PUT", headers: d, body: i };
@@ -2225,7 +2234,7 @@ async function Dt(n, s, r) {
2225
2234
  }
2226
2235
  return t;
2227
2236
  }
2228
- async function vt(n, s, r) {
2237
+ async function Pt(n, s, r) {
2229
2238
  let t = new m();
2230
2239
  if (n == null || s == null)
2231
2240
  return t.result = !1, t.error = "readerPost: invalid parameters", t.status = 500, t;
@@ -2329,7 +2338,7 @@ export {
2329
2338
  Ve as oauth2PermissionGrantsGet,
2330
2339
  Ze as oauth2PermissionGrantsSet,
2331
2340
  y as processErrors,
2332
- vt as readerPost,
2341
+ Pt as readerPost,
2333
2342
  gs as readerStats,
2334
2343
  Lt as requestAdminConsent,
2335
2344
  Qe as servicePrincipalGet,