@redocly/replay 0.28.0-next.4 → 0.28.0-next.6
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/dist/{replay-AiChatProvider-BIplPHOS.js → replay-AiChatProvider-Bj2P_hdU.js} +371 -369
- package/dist/replay-AiChatProvider-GeumgtIo.js +6 -0
- package/dist/{replay-AiChatSqliteDBStorage-Bay95FHW.js → replay-AiChatSqliteDBStorage-0M2Ejnzu.js} +1 -1
- package/dist/{replay-AiChatSqliteDBStorage-C-rkQ3jG.js → replay-AiChatSqliteDBStorage-BWJl1qdO.js} +1 -1
- package/dist/{replay-AiPanel-DU5aVA3q.js → replay-AiPanel-DfOpKMDQ.js} +709 -712
- package/dist/replay-AiPanel-ON_QfwBN.js +742 -0
- package/dist/replay-FileWatcher-04GlEkra.js +360 -0
- package/dist/replay-FileWatcher-B-T0jz_R.js +1 -0
- package/dist/{replay-SemanticSearchService-Dk4UTm2r.js → replay-SemanticSearchService-BQgdj2wy.js} +1 -1
- package/dist/{replay-SemanticSearchService-BWwCFW3F.js → replay-SemanticSearchService-CPIb_cUk.js} +7 -7
- package/dist/{replay-SqliteDBStorage-BFdjYsG7.js → replay-SqliteDBStorage-Bt2xXqei.js} +1 -1
- package/dist/{replay-SqliteDBStorage-DGQjzDy4.js → replay-SqliteDBStorage-vehgvWXZ.js} +1 -1
- package/dist/{replay-TauriFileSystemAdapter-CLzYSck7.js → replay-TauriFileSystemAdapter-D2yxrS6Q.js} +1 -1
- package/dist/{replay-TauriFileSystemAdapter-C8k9RvT1.js → replay-TauriFileSystemAdapter-YLdtT-Xp.js} +1 -1
- package/dist/{replay-TauriRootStorage-C1MIH5ji.js → replay-TauriRootStorage-BE6RmQfE.js} +162 -165
- package/dist/replay-TauriRootStorage-DcENVsBJ.js +1 -0
- package/dist/{replay-agent-loop-BoEw65rR.js → replay-agent-loop-CvopOugZ.js} +13 -13
- package/dist/{replay-agent-loop-Cm1iS9G2.js → replay-agent-loop-UwDSVh-4.js} +1 -1
- package/dist/{replay-ai-chat-mappers-IZNFNXug.js → replay-ai-chat-mappers-B7fm-v_w.js} +1 -1
- package/dist/{replay-ai-chat-mappers-Csm9vJrG.js → replay-ai-chat-mappers-yKBypIXh.js} +1 -1
- package/dist/{replay-create-model-BqvD-0wF.js → replay-create-model-CHahxEJy.js} +3 -3
- package/dist/{replay-create-model-Y9UJSztb.js → replay-create-model-CyBZMAWB.js} +4 -4
- package/dist/{replay-db-BImXgUGU.js → replay-db-CifZMdnr.js} +5 -5
- package/dist/{replay-db-C7FD3opa.js → replay-db-EWL-uAt-.js} +1 -1
- package/dist/{replay-external-resolver-CjM7Da6t.js → replay-external-resolver-D5fSfJEm.js} +1 -1
- package/dist/{replay-external-resolver-Bj3sLTnz.js → replay-external-resolver-G11iwLVZ.js} +2 -2
- package/dist/{replay-index-Dxk-kqkZ.js → replay-index-B2NUTBd8.js} +1 -1
- package/dist/{replay-index-CKRKzXMt.js → replay-index-B3MQaIS-.js} +1 -1
- package/dist/replay-index-Coy4kD_x.js +7009 -0
- package/dist/{replay-index-DJwfdo0s.js → replay-index-CqRiEj9e.js} +1 -1
- package/dist/{replay-index-DlTloE6S.js → replay-index-D0mbH_TN.js} +1 -1
- package/dist/{replay-index-Cp06WK82.js → replay-index-DDqKE6bs.js} +5 -5
- package/dist/{replay-index-xheWgsnj.js → replay-index-DrI9ZFwH.js} +2 -2
- package/dist/{replay-index-BH8cTSEK.js → replay-index-Dx8O3ZoA.js} +68783 -67874
- package/dist/{replay-lint-BIbkYU09.js → replay-lint-BiOcDIDr.js} +3 -3
- package/dist/{replay-lint--iBW-6Vj.js → replay-lint-CAo2fuiZ.js} +3 -3
- package/dist/{replay-lint-graphql-EXBI8I89.js → replay-lint-graphql-DAa8UNRg.js} +1 -1
- package/dist/{replay-lint-graphql-2b4GIER6.js → replay-lint-graphql-DzI2rUbR.js} +1 -1
- package/dist/replay-periodic-revalidation-D18ihfUc.js +1 -0
- package/dist/replay-periodic-revalidation-w7mrtjYg.js +22 -0
- package/dist/{replay-resolve-D9BUvjqv.js → replay-resolve-CojDRP37.js} +1 -1
- package/dist/{replay-resolve-B5yIfyuT.js → replay-resolve-DgAthAfi.js} +1 -1
- package/dist/{replay-respect-run-DNFoFnJU.js → replay-respect-run-3ukV7LMg.js} +1 -1
- package/dist/{replay-respect-run-Bx46aUHi.js → replay-respect-run-DNvB8rLX.js} +3 -3
- package/dist/replay-tauri-path-DM8PdMK8.js +22 -0
- package/dist/{replay-tauri-path-C8GiFO5s.js → replay-tauri-path-kr9DtxLs.js} +1 -1
- package/dist/{replay-useAiChatQueries-BTuu2xLG.js → replay-useAiChatQueries-BULoKr4E.js} +1564 -1395
- package/dist/replay-useAiChatQueries-BdjsFz1P.js +215 -0
- package/dist/{replay-validate-key-D4M7QvCw.js → replay-validate-key-CGmguj5X.js} +1 -1
- package/dist/{replay-validate-key-CjcIElmE.js → replay-validate-key-DzseOR5a.js} +2 -2
- package/dist/replay.cjs +1 -1
- package/dist/replay.d.ts +3 -3
- package/dist/replay.js +10 -10
- package/package.json +12 -5
- package/dist/replay-AiChatProvider-TF1u9E5L.js +0 -6
- package/dist/replay-AiPanel-DzGN1t86.js +0 -742
- package/dist/replay-FileWatcher-XMkIoDEA.js +0 -1
- package/dist/replay-FileWatcher-iYbHpwCv.js +0 -352
- package/dist/replay-TauriRootStorage-CiGY8MO6.js +0 -1
- package/dist/replay-index-BuYoH96w.js +0 -6982
- package/dist/replay-periodic-revalidation-BoyLQHtg.js +0 -1
- package/dist/replay-periodic-revalidation-Dsp-n7ui.js +0 -21
- package/dist/replay-tauri-path-BVoW6En0.js +0 -22
- package/dist/replay-useAiChatQueries-BDgjmzz-.js +0 -215
|
@@ -1,111 +1,111 @@
|
|
|
1
|
-
import { g as he, a as fe, S as D, l as de, b as W, r as J, R as pe, d as F, e as O, i as
|
|
1
|
+
import { g as he, a as fe, S as D, l as de, b as W, r as J, R as pe, d as F, e as O, i as ve, y as me, f as _e, P as we } from "./replay-index-Dx8O3ZoA.js";
|
|
2
2
|
import { p as H } from "./replay-promise-map-limit-Db_42GvV.js";
|
|
3
|
-
import { TauriFileSystemAdapter as X } from "./replay-TauriFileSystemAdapter-
|
|
3
|
+
import { TauriFileSystemAdapter as X } from "./replay-TauriFileSystemAdapter-YLdtT-Xp.js";
|
|
4
4
|
var Y = { exports: {} }, Z;
|
|
5
5
|
function ye() {
|
|
6
|
-
return Z || (Z = 1, (function(
|
|
6
|
+
return Z || (Z = 1, (function(n) {
|
|
7
7
|
var e = Object.prototype.hasOwnProperty, t = "~";
|
|
8
8
|
function r() {
|
|
9
9
|
}
|
|
10
10
|
Object.create && (r.prototype = /* @__PURE__ */ Object.create(null), new r().__proto__ || (t = !1));
|
|
11
|
-
function
|
|
12
|
-
this.fn = a, this.context = l, this.once =
|
|
11
|
+
function i(a, l, h) {
|
|
12
|
+
this.fn = a, this.context = l, this.once = h || !1;
|
|
13
13
|
}
|
|
14
|
-
function o(a, l,
|
|
15
|
-
if (typeof
|
|
14
|
+
function o(a, l, h, f, y) {
|
|
15
|
+
if (typeof h != "function")
|
|
16
16
|
throw new TypeError("The listener must be a function");
|
|
17
|
-
var w = new
|
|
17
|
+
var w = new i(h, f || a, y), p = t ? t + l : l;
|
|
18
18
|
return a._events[p] ? a._events[p].fn ? a._events[p] = [a._events[p], w] : a._events[p].push(w) : (a._events[p] = w, a._eventsCount++), a;
|
|
19
19
|
}
|
|
20
20
|
function d(a, l) {
|
|
21
21
|
--a._eventsCount === 0 ? a._events = new r() : delete a._events[l];
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function c() {
|
|
24
24
|
this._events = new r(), this._eventsCount = 0;
|
|
25
25
|
}
|
|
26
|
-
|
|
27
|
-
var l = [],
|
|
26
|
+
c.prototype.eventNames = function() {
|
|
27
|
+
var l = [], h, f;
|
|
28
28
|
if (this._eventsCount === 0) return l;
|
|
29
|
-
for (
|
|
30
|
-
e.call(
|
|
31
|
-
return Object.getOwnPropertySymbols ? l.concat(Object.getOwnPropertySymbols(
|
|
32
|
-
},
|
|
33
|
-
var
|
|
34
|
-
if (!
|
|
35
|
-
if (
|
|
36
|
-
for (var y = 0, w =
|
|
37
|
-
p[y] =
|
|
29
|
+
for (f in h = this._events)
|
|
30
|
+
e.call(h, f) && l.push(t ? f.slice(1) : f);
|
|
31
|
+
return Object.getOwnPropertySymbols ? l.concat(Object.getOwnPropertySymbols(h)) : l;
|
|
32
|
+
}, c.prototype.listeners = function(l) {
|
|
33
|
+
var h = t ? t + l : l, f = this._events[h];
|
|
34
|
+
if (!f) return [];
|
|
35
|
+
if (f.fn) return [f.fn];
|
|
36
|
+
for (var y = 0, w = f.length, p = new Array(w); y < w; y++)
|
|
37
|
+
p[y] = f[y].fn;
|
|
38
38
|
return p;
|
|
39
|
-
},
|
|
40
|
-
var
|
|
41
|
-
return
|
|
42
|
-
},
|
|
39
|
+
}, c.prototype.listenerCount = function(l) {
|
|
40
|
+
var h = t ? t + l : l, f = this._events[h];
|
|
41
|
+
return f ? f.fn ? 1 : f.length : 0;
|
|
42
|
+
}, c.prototype.emit = function(l, h, f, y, w, p) {
|
|
43
43
|
var b = t ? t + l : l;
|
|
44
44
|
if (!this._events[b]) return !1;
|
|
45
|
-
var
|
|
46
|
-
if (
|
|
47
|
-
switch (
|
|
45
|
+
var u = this._events[b], A = arguments.length, T, _;
|
|
46
|
+
if (u.fn) {
|
|
47
|
+
switch (u.once && this.removeListener(l, u.fn, void 0, !0), A) {
|
|
48
48
|
case 1:
|
|
49
|
-
return
|
|
49
|
+
return u.fn.call(u.context), !0;
|
|
50
50
|
case 2:
|
|
51
|
-
return
|
|
51
|
+
return u.fn.call(u.context, h), !0;
|
|
52
52
|
case 3:
|
|
53
|
-
return
|
|
53
|
+
return u.fn.call(u.context, h, f), !0;
|
|
54
54
|
case 4:
|
|
55
|
-
return
|
|
55
|
+
return u.fn.call(u.context, h, f, y), !0;
|
|
56
56
|
case 5:
|
|
57
|
-
return
|
|
57
|
+
return u.fn.call(u.context, h, f, y, w), !0;
|
|
58
58
|
case 6:
|
|
59
|
-
return
|
|
59
|
+
return u.fn.call(u.context, h, f, y, w, p), !0;
|
|
60
60
|
}
|
|
61
61
|
for (_ = 1, T = new Array(A - 1); _ < A; _++)
|
|
62
62
|
T[_ - 1] = arguments[_];
|
|
63
|
-
|
|
63
|
+
u.fn.apply(u.context, T);
|
|
64
64
|
} else {
|
|
65
|
-
var ce =
|
|
65
|
+
var ce = u.length, x;
|
|
66
66
|
for (_ = 0; _ < ce; _++)
|
|
67
|
-
switch (
|
|
67
|
+
switch (u[_].once && this.removeListener(l, u[_].fn, void 0, !0), A) {
|
|
68
68
|
case 1:
|
|
69
|
-
|
|
69
|
+
u[_].fn.call(u[_].context);
|
|
70
70
|
break;
|
|
71
71
|
case 2:
|
|
72
|
-
|
|
72
|
+
u[_].fn.call(u[_].context, h);
|
|
73
73
|
break;
|
|
74
74
|
case 3:
|
|
75
|
-
|
|
75
|
+
u[_].fn.call(u[_].context, h, f);
|
|
76
76
|
break;
|
|
77
77
|
case 4:
|
|
78
|
-
|
|
78
|
+
u[_].fn.call(u[_].context, h, f, y);
|
|
79
79
|
break;
|
|
80
80
|
default:
|
|
81
81
|
if (!T) for (x = 1, T = new Array(A - 1); x < A; x++)
|
|
82
82
|
T[x - 1] = arguments[x];
|
|
83
|
-
|
|
83
|
+
u[_].fn.apply(u[_].context, T);
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
return !0;
|
|
87
|
-
},
|
|
88
|
-
return o(this, l,
|
|
89
|
-
},
|
|
90
|
-
return o(this, l,
|
|
91
|
-
},
|
|
87
|
+
}, c.prototype.on = function(l, h, f) {
|
|
88
|
+
return o(this, l, h, f, !1);
|
|
89
|
+
}, c.prototype.once = function(l, h, f) {
|
|
90
|
+
return o(this, l, h, f, !0);
|
|
91
|
+
}, c.prototype.removeListener = function(l, h, f, y) {
|
|
92
92
|
var w = t ? t + l : l;
|
|
93
93
|
if (!this._events[w]) return this;
|
|
94
|
-
if (!
|
|
94
|
+
if (!h)
|
|
95
95
|
return d(this, w), this;
|
|
96
96
|
var p = this._events[w];
|
|
97
97
|
if (p.fn)
|
|
98
|
-
p.fn ===
|
|
98
|
+
p.fn === h && (!y || p.once) && (!f || p.context === f) && d(this, w);
|
|
99
99
|
else {
|
|
100
|
-
for (var b = 0,
|
|
101
|
-
(p[b].fn !==
|
|
102
|
-
|
|
100
|
+
for (var b = 0, u = [], A = p.length; b < A; b++)
|
|
101
|
+
(p[b].fn !== h || y && !p[b].once || f && p[b].context !== f) && u.push(p[b]);
|
|
102
|
+
u.length ? this._events[w] = u.length === 1 ? u[0] : u : d(this, w);
|
|
103
103
|
}
|
|
104
104
|
return this;
|
|
105
|
-
},
|
|
106
|
-
var
|
|
107
|
-
return l ? (
|
|
108
|
-
},
|
|
105
|
+
}, c.prototype.removeAllListeners = function(l) {
|
|
106
|
+
var h;
|
|
107
|
+
return l ? (h = t ? t + l : l, this._events[h] && d(this, h)) : (this._events = new r(), this._eventsCount = 0), this;
|
|
108
|
+
}, c.prototype.off = c.prototype.removeListener, c.prototype.addListener = c.prototype.on, c.prefixed = t, c.EventEmitter = c, n.exports = c;
|
|
109
109
|
})(Y)), Y.exports;
|
|
110
110
|
}
|
|
111
111
|
var ge = ye();
|
|
@@ -120,17 +120,17 @@ let be = class extends Error {
|
|
|
120
120
|
super(), this.name = "AbortError", this.message = e;
|
|
121
121
|
}
|
|
122
122
|
};
|
|
123
|
-
const ee = (
|
|
124
|
-
const e =
|
|
123
|
+
const ee = (n) => globalThis.DOMException === void 0 ? new be(n) : new DOMException(n), te = (n) => {
|
|
124
|
+
const e = n.reason === void 0 ? ee("This operation was aborted.") : n.reason;
|
|
125
125
|
return e instanceof Error ? e : ee(e);
|
|
126
126
|
};
|
|
127
|
-
function Ee(
|
|
128
|
-
let
|
|
129
|
-
const o = new Promise((d,
|
|
127
|
+
function Ee(n, e, t, r) {
|
|
128
|
+
let i;
|
|
129
|
+
const o = new Promise((d, c) => {
|
|
130
130
|
if (typeof e != "number" || Math.sign(e) !== 1)
|
|
131
131
|
throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${e}\``);
|
|
132
132
|
if (e === Number.POSITIVE_INFINITY) {
|
|
133
|
-
d(
|
|
133
|
+
d(n);
|
|
134
134
|
return;
|
|
135
135
|
}
|
|
136
136
|
if (r = {
|
|
@@ -138,40 +138,40 @@ function Ee(i, e, t, r) {
|
|
|
138
138
|
...r
|
|
139
139
|
}, r.signal) {
|
|
140
140
|
const { signal: a } = r;
|
|
141
|
-
a.aborted &&
|
|
142
|
-
|
|
141
|
+
a.aborted && c(te(a)), a.addEventListener("abort", () => {
|
|
142
|
+
c(te(a));
|
|
143
143
|
});
|
|
144
144
|
}
|
|
145
|
-
|
|
145
|
+
i = r.customTimers.setTimeout.call(void 0, () => {
|
|
146
146
|
const a = `Promise timed out after ${e} milliseconds`, l = t instanceof Error ? t : new ae(a);
|
|
147
|
-
typeof
|
|
147
|
+
typeof n.cancel == "function" && n.cancel(), c(l);
|
|
148
148
|
}, e), (async () => {
|
|
149
149
|
try {
|
|
150
|
-
d(await
|
|
150
|
+
d(await n);
|
|
151
151
|
} catch (a) {
|
|
152
|
-
|
|
152
|
+
c(a);
|
|
153
153
|
} finally {
|
|
154
|
-
r.customTimers.clearTimeout.call(void 0,
|
|
154
|
+
r.customTimers.clearTimeout.call(void 0, i);
|
|
155
155
|
}
|
|
156
156
|
})();
|
|
157
157
|
});
|
|
158
158
|
return o.clear = () => {
|
|
159
|
-
clearTimeout(
|
|
159
|
+
clearTimeout(i), i = void 0;
|
|
160
160
|
}, o;
|
|
161
161
|
}
|
|
162
|
-
function Se(
|
|
163
|
-
let r = 0,
|
|
164
|
-
for (;
|
|
165
|
-
const o = Math.trunc(
|
|
162
|
+
function Se(n, e, t) {
|
|
163
|
+
let r = 0, i = n.length;
|
|
164
|
+
for (; i > 0; ) {
|
|
165
|
+
const o = Math.trunc(i / 2);
|
|
166
166
|
let d = r + o;
|
|
167
|
-
t(
|
|
167
|
+
t(n[d], e) <= 0 ? (r = ++d, i -= o + 1) : i = o;
|
|
168
168
|
}
|
|
169
169
|
return r;
|
|
170
170
|
}
|
|
171
|
-
var Q = function(
|
|
171
|
+
var Q = function(n, e, t, r) {
|
|
172
172
|
if (t === "a" && !r) throw new TypeError("Private accessor was defined without a getter");
|
|
173
|
-
if (typeof e == "function" ?
|
|
174
|
-
return t === "m" ? r : t === "a" ? r.call(
|
|
173
|
+
if (typeof e == "function" ? n !== e || !r : !e.has(n)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
174
|
+
return t === "m" ? r : t === "a" ? r.call(n) : r ? r.value : e.get(n);
|
|
175
175
|
}, S;
|
|
176
176
|
class Ae {
|
|
177
177
|
constructor() {
|
|
@@ -190,8 +190,8 @@ class Ae {
|
|
|
190
190
|
Q(this, S, "f").push(r);
|
|
191
191
|
return;
|
|
192
192
|
}
|
|
193
|
-
const
|
|
194
|
-
Q(this, S, "f").splice(
|
|
193
|
+
const i = Se(Q(this, S, "f"), r, (o, d) => d.priority - o.priority);
|
|
194
|
+
Q(this, S, "f").splice(i, 0, r);
|
|
195
195
|
}
|
|
196
196
|
dequeue() {
|
|
197
197
|
const e = Q(this, S, "f").shift();
|
|
@@ -205,23 +205,23 @@ class Ae {
|
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
207
|
S = /* @__PURE__ */ new WeakMap();
|
|
208
|
-
var
|
|
208
|
+
var v = function(n, e, t, r, i) {
|
|
209
209
|
if (r === "m") throw new TypeError("Private method is not writable");
|
|
210
|
-
if (r === "a" && !
|
|
211
|
-
if (typeof e == "function" ?
|
|
212
|
-
return r === "a" ?
|
|
213
|
-
}, s = function(
|
|
210
|
+
if (r === "a" && !i) throw new TypeError("Private accessor was defined without a setter");
|
|
211
|
+
if (typeof e == "function" ? n !== e || !i : !e.has(n)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
212
|
+
return r === "a" ? i.call(n, t) : i ? i.value = t : e.set(n, t), t;
|
|
213
|
+
}, s = function(n, e, t, r) {
|
|
214
214
|
if (t === "a" && !r) throw new TypeError("Private accessor was defined without a getter");
|
|
215
|
-
if (typeof e == "function" ?
|
|
216
|
-
return t === "m" ? r : t === "a" ? r.call(
|
|
217
|
-
},
|
|
215
|
+
if (typeof e == "function" ? n !== e || !r : !e.has(n)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
216
|
+
return t === "m" ? r : t === "a" ? r.call(n) : r ? r.value : e.get(n);
|
|
217
|
+
}, m, z, M, I, B, N, j, E, L, g, q, P, k, C, $, re, se, oe, ne, ie, R, G, V, K, le, U;
|
|
218
218
|
class ue extends Error {
|
|
219
219
|
}
|
|
220
|
-
class
|
|
220
|
+
class Ce extends Pe {
|
|
221
221
|
// TODO: The `throwOnTimeout` option should affect the return types of `add()` and `addAll()`
|
|
222
222
|
constructor(e) {
|
|
223
|
-
var t, r,
|
|
224
|
-
if (super(),
|
|
223
|
+
var t, r, i, o;
|
|
224
|
+
if (super(), m.add(this), z.set(this, void 0), M.set(this, void 0), I.set(this, 0), B.set(this, void 0), N.set(this, void 0), j.set(this, 0), E.set(this, void 0), L.set(this, void 0), g.set(this, void 0), q.set(this, void 0), P.set(this, 0), k.set(this, void 0), C.set(this, void 0), $.set(this, void 0), Object.defineProperty(this, "timeout", {
|
|
225
225
|
enumerable: !0,
|
|
226
226
|
configurable: !0,
|
|
227
227
|
writable: !0,
|
|
@@ -237,8 +237,8 @@ class Ie extends Pe {
|
|
|
237
237
|
}, !(typeof e.intervalCap == "number" && e.intervalCap >= 1))
|
|
238
238
|
throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(r = (t = e.intervalCap) === null || t === void 0 ? void 0 : t.toString()) !== null && r !== void 0 ? r : ""}\` (${typeof e.intervalCap})`);
|
|
239
239
|
if (e.interval === void 0 || !(Number.isFinite(e.interval) && e.interval >= 0))
|
|
240
|
-
throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(o = (
|
|
241
|
-
|
|
240
|
+
throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(o = (i = e.interval) === null || i === void 0 ? void 0 : i.toString()) !== null && o !== void 0 ? o : ""}\` (${typeof e.interval})`);
|
|
241
|
+
v(this, z, e.carryoverConcurrencyCount, "f"), v(this, M, e.intervalCap === Number.POSITIVE_INFINITY || e.interval === 0, "f"), v(this, B, e.intervalCap, "f"), v(this, N, e.interval, "f"), v(this, g, new e.queueClass(), "f"), v(this, q, e.queueClass, "f"), this.concurrency = e.concurrency, this.timeout = e.timeout, v(this, $, e.throwOnTimeout === !0, "f"), v(this, C, e.autoStart === !1, "f");
|
|
242
242
|
}
|
|
243
243
|
get concurrency() {
|
|
244
244
|
return s(this, k, "f");
|
|
@@ -246,22 +246,22 @@ class Ie extends Pe {
|
|
|
246
246
|
set concurrency(e) {
|
|
247
247
|
if (!(typeof e == "number" && e >= 1))
|
|
248
248
|
throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);
|
|
249
|
-
|
|
249
|
+
v(this, k, e, "f"), s(this, m, "m", K).call(this);
|
|
250
250
|
}
|
|
251
251
|
async add(e, t = {}) {
|
|
252
252
|
return t = {
|
|
253
253
|
timeout: this.timeout,
|
|
254
254
|
throwOnTimeout: s(this, $, "f"),
|
|
255
255
|
...t
|
|
256
|
-
}, new Promise((r,
|
|
256
|
+
}, new Promise((r, i) => {
|
|
257
257
|
s(this, g, "f").enqueue(async () => {
|
|
258
|
-
var o, d,
|
|
259
|
-
|
|
258
|
+
var o, d, c;
|
|
259
|
+
v(this, P, (d = s(this, P, "f"), d++, d), "f"), v(this, I, (c = s(this, I, "f"), c++, c), "f");
|
|
260
260
|
try {
|
|
261
261
|
if (!((o = t.signal) === null || o === void 0) && o.aborted)
|
|
262
262
|
throw new ue("The task was aborted.");
|
|
263
263
|
let a = e({ signal: t.signal });
|
|
264
|
-
t.timeout && (a = Ee(Promise.resolve(a), t.timeout)), t.signal && (a = Promise.race([a, s(this,
|
|
264
|
+
t.timeout && (a = Ee(Promise.resolve(a), t.timeout)), t.signal && (a = Promise.race([a, s(this, m, "m", le).call(this, t.signal)]));
|
|
265
265
|
const l = await a;
|
|
266
266
|
r(l), this.emit("completed", l);
|
|
267
267
|
} catch (a) {
|
|
@@ -269,11 +269,11 @@ class Ie extends Pe {
|
|
|
269
269
|
r();
|
|
270
270
|
return;
|
|
271
271
|
}
|
|
272
|
-
|
|
272
|
+
i(a), this.emit("error", a);
|
|
273
273
|
} finally {
|
|
274
|
-
s(this,
|
|
274
|
+
s(this, m, "m", oe).call(this);
|
|
275
275
|
}
|
|
276
|
-
}, t), this.emit("add"), s(this,
|
|
276
|
+
}, t), this.emit("add"), s(this, m, "m", R).call(this);
|
|
277
277
|
});
|
|
278
278
|
}
|
|
279
279
|
async addAll(e, t) {
|
|
@@ -283,19 +283,19 @@ class Ie extends Pe {
|
|
|
283
283
|
Start (or resume) executing enqueued tasks within concurrency limit. No need to call this if queue is not paused (via `options.autoStart = false` or by `.pause()` method.)
|
|
284
284
|
*/
|
|
285
285
|
start() {
|
|
286
|
-
return s(this,
|
|
286
|
+
return s(this, C, "f") ? (v(this, C, !1, "f"), s(this, m, "m", K).call(this), this) : this;
|
|
287
287
|
}
|
|
288
288
|
/**
|
|
289
289
|
Put queue execution on hold.
|
|
290
290
|
*/
|
|
291
291
|
pause() {
|
|
292
|
-
|
|
292
|
+
v(this, C, !0, "f");
|
|
293
293
|
}
|
|
294
294
|
/**
|
|
295
295
|
Clear the queue.
|
|
296
296
|
*/
|
|
297
297
|
clear() {
|
|
298
|
-
|
|
298
|
+
v(this, g, new (s(this, q, "f"))(), "f");
|
|
299
299
|
}
|
|
300
300
|
/**
|
|
301
301
|
Can be called multiple times. Useful if you for example add additional items at a later time.
|
|
@@ -303,7 +303,7 @@ class Ie extends Pe {
|
|
|
303
303
|
@returns A promise that settles when the queue becomes empty.
|
|
304
304
|
*/
|
|
305
305
|
async onEmpty() {
|
|
306
|
-
s(this, g, "f").size !== 0 && await s(this,
|
|
306
|
+
s(this, g, "f").size !== 0 && await s(this, m, "m", U).call(this, "empty");
|
|
307
307
|
}
|
|
308
308
|
/**
|
|
309
309
|
@returns A promise that settles when the queue size is less than the given limit: `queue.size < limit`.
|
|
@@ -313,7 +313,7 @@ class Ie extends Pe {
|
|
|
313
313
|
Note that this only limits the number of items waiting to start. There could still be up to `concurrency` jobs already running that this call does not include in its calculation.
|
|
314
314
|
*/
|
|
315
315
|
async onSizeLessThan(e) {
|
|
316
|
-
s(this, g, "f").size < e || await s(this,
|
|
316
|
+
s(this, g, "f").size < e || await s(this, m, "m", U).call(this, "next", () => s(this, g, "f").size < e);
|
|
317
317
|
}
|
|
318
318
|
/**
|
|
319
319
|
The difference with `.onEmpty` is that `.onIdle` guarantees that all work from the queue has finished. `.onEmpty` merely signals that the queue is empty, but it could mean that some promises haven't completed yet.
|
|
@@ -321,7 +321,7 @@ class Ie extends Pe {
|
|
|
321
321
|
@returns A promise that settles when the queue becomes empty, and all promises have completed; `queue.size === 0 && queue.pending === 0`.
|
|
322
322
|
*/
|
|
323
323
|
async onIdle() {
|
|
324
|
-
s(this, P, "f") === 0 && s(this, g, "f").size === 0 || await s(this,
|
|
324
|
+
s(this, P, "f") === 0 && s(this, g, "f").size === 0 || await s(this, m, "m", U).call(this, "idle");
|
|
325
325
|
}
|
|
326
326
|
/**
|
|
327
327
|
Size of the queue, the number of queued items waiting to run.
|
|
@@ -347,49 +347,49 @@ class Ie extends Pe {
|
|
|
347
347
|
Whether the queue is currently paused.
|
|
348
348
|
*/
|
|
349
349
|
get isPaused() {
|
|
350
|
-
return s(this,
|
|
350
|
+
return s(this, C, "f");
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
|
-
z = /* @__PURE__ */ new WeakMap(), M = /* @__PURE__ */ new WeakMap(),
|
|
354
|
-
return s(this, M, "f") || s(this,
|
|
353
|
+
z = /* @__PURE__ */ new WeakMap(), M = /* @__PURE__ */ new WeakMap(), I = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakMap(), N = /* @__PURE__ */ new WeakMap(), j = /* @__PURE__ */ new WeakMap(), E = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), g = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(), P = /* @__PURE__ */ new WeakMap(), k = /* @__PURE__ */ new WeakMap(), C = /* @__PURE__ */ new WeakMap(), $ = /* @__PURE__ */ new WeakMap(), m = /* @__PURE__ */ new WeakSet(), re = function() {
|
|
354
|
+
return s(this, M, "f") || s(this, I, "f") < s(this, B, "f");
|
|
355
355
|
}, se = function() {
|
|
356
356
|
return s(this, P, "f") < s(this, k, "f");
|
|
357
357
|
}, oe = function() {
|
|
358
358
|
var e;
|
|
359
|
-
|
|
360
|
-
}, ie = function() {
|
|
361
|
-
s(this, v, "m", V).call(this), s(this, v, "m", G).call(this), m(this, L, void 0, "f");
|
|
359
|
+
v(this, P, (e = s(this, P, "f"), e--, e), "f"), s(this, m, "m", R).call(this), this.emit("next");
|
|
362
360
|
}, ne = function() {
|
|
361
|
+
s(this, m, "m", V).call(this), s(this, m, "m", G).call(this), v(this, L, void 0, "f");
|
|
362
|
+
}, ie = function() {
|
|
363
363
|
const e = Date.now();
|
|
364
364
|
if (s(this, E, "f") === void 0) {
|
|
365
365
|
const t = s(this, j, "f") - e;
|
|
366
366
|
if (t < 0)
|
|
367
|
-
|
|
367
|
+
v(this, I, s(this, z, "f") ? s(this, P, "f") : 0, "f");
|
|
368
368
|
else
|
|
369
|
-
return s(this, L, "f") === void 0 &&
|
|
370
|
-
s(this,
|
|
369
|
+
return s(this, L, "f") === void 0 && v(this, L, setTimeout(() => {
|
|
370
|
+
s(this, m, "m", ne).call(this);
|
|
371
371
|
}, t), "f"), !0;
|
|
372
372
|
}
|
|
373
373
|
return !1;
|
|
374
374
|
}, R = function() {
|
|
375
375
|
if (s(this, g, "f").size === 0)
|
|
376
|
-
return s(this, E, "f") && clearInterval(s(this, E, "f")),
|
|
377
|
-
if (!s(this,
|
|
378
|
-
const e = !s(this,
|
|
379
|
-
if (s(this,
|
|
376
|
+
return s(this, E, "f") && clearInterval(s(this, E, "f")), v(this, E, void 0, "f"), this.emit("empty"), s(this, P, "f") === 0 && this.emit("idle"), !1;
|
|
377
|
+
if (!s(this, C, "f")) {
|
|
378
|
+
const e = !s(this, m, "a", ie);
|
|
379
|
+
if (s(this, m, "a", re) && s(this, m, "a", se)) {
|
|
380
380
|
const t = s(this, g, "f").dequeue();
|
|
381
|
-
return t ? (this.emit("active"), t(), e && s(this,
|
|
381
|
+
return t ? (this.emit("active"), t(), e && s(this, m, "m", G).call(this), !0) : !1;
|
|
382
382
|
}
|
|
383
383
|
}
|
|
384
384
|
return !1;
|
|
385
385
|
}, G = function() {
|
|
386
|
-
s(this, M, "f") || s(this, E, "f") !== void 0 || (
|
|
387
|
-
s(this,
|
|
388
|
-
}, s(this, N, "f")), "f"),
|
|
386
|
+
s(this, M, "f") || s(this, E, "f") !== void 0 || (v(this, E, setInterval(() => {
|
|
387
|
+
s(this, m, "m", V).call(this);
|
|
388
|
+
}, s(this, N, "f")), "f"), v(this, j, Date.now() + s(this, N, "f"), "f"));
|
|
389
389
|
}, V = function() {
|
|
390
|
-
s(this,
|
|
390
|
+
s(this, I, "f") === 0 && s(this, P, "f") === 0 && s(this, E, "f") && (clearInterval(s(this, E, "f")), v(this, E, void 0, "f")), v(this, I, s(this, z, "f") ? s(this, P, "f") : 0, "f"), s(this, m, "m", K).call(this);
|
|
391
391
|
}, K = function() {
|
|
392
|
-
for (; s(this,
|
|
392
|
+
for (; s(this, m, "m", R).call(this); )
|
|
393
393
|
;
|
|
394
394
|
}, le = async function(e) {
|
|
395
395
|
return new Promise((t, r) => {
|
|
@@ -399,20 +399,20 @@ z = /* @__PURE__ */ new WeakMap(), M = /* @__PURE__ */ new WeakMap(), C = /* @__
|
|
|
399
399
|
});
|
|
400
400
|
}, U = async function(e, t) {
|
|
401
401
|
return new Promise((r) => {
|
|
402
|
-
const
|
|
403
|
-
t && !t() || (this.off(e,
|
|
402
|
+
const i = () => {
|
|
403
|
+
t && !t() || (this.off(e, i), r());
|
|
404
404
|
};
|
|
405
|
-
this.on(e,
|
|
405
|
+
this.on(e, i);
|
|
406
406
|
});
|
|
407
407
|
};
|
|
408
|
-
class
|
|
408
|
+
class Ie {
|
|
409
409
|
constructor(e) {
|
|
410
410
|
this.apisStorage = e;
|
|
411
411
|
}
|
|
412
412
|
apisStorage;
|
|
413
413
|
data = /* @__PURE__ */ new Map();
|
|
414
414
|
loading = /* @__PURE__ */ new Set();
|
|
415
|
-
pQueue = new
|
|
415
|
+
pQueue = new Ce({ concurrency: 20 });
|
|
416
416
|
async get(e) {
|
|
417
417
|
return this.data.has(e) ? this.data.get(e) ?? null : (await this.loadAndParse(e), this.data.get(e) ?? null);
|
|
418
418
|
}
|
|
@@ -425,16 +425,16 @@ class Ce {
|
|
|
425
425
|
return;
|
|
426
426
|
}
|
|
427
427
|
t && this.data.delete(e), this.loading.add(e), await this.pQueue.add(async () => {
|
|
428
|
-
const r = fe(e) ? D.WEB : D.FS,
|
|
428
|
+
const r = fe(e) ? D.WEB : D.FS, i = r === D.WEB ? e : await this.apisStorage.getAbsolutePath(e);
|
|
429
429
|
try {
|
|
430
|
-
const { definition: o, fileDependencies: d } = await de(
|
|
430
|
+
const { definition: o, fileDependencies: d } = await de(i);
|
|
431
431
|
if (!o) {
|
|
432
432
|
this.data.set(e, null), await W(e);
|
|
433
433
|
return;
|
|
434
434
|
}
|
|
435
|
-
const
|
|
435
|
+
const c = this.apisStorage.parse({ uri: e, type: r, content: o });
|
|
436
436
|
this.data.set(e, {
|
|
437
|
-
...
|
|
437
|
+
...c,
|
|
438
438
|
fileDependencies: d
|
|
439
439
|
}), await W(e);
|
|
440
440
|
} catch (o) {
|
|
@@ -463,16 +463,16 @@ class Ce {
|
|
|
463
463
|
class Oe extends pe {
|
|
464
464
|
apiLoader;
|
|
465
465
|
constructor(e, t, r) {
|
|
466
|
-
const
|
|
466
|
+
const i = new X(e.systemFilesDir), o = new X(e.userFilesDir);
|
|
467
467
|
super(
|
|
468
|
-
|
|
468
|
+
i,
|
|
469
469
|
o,
|
|
470
470
|
e,
|
|
471
471
|
!0,
|
|
472
472
|
!1,
|
|
473
473
|
t,
|
|
474
474
|
r
|
|
475
|
-
), this.apiLoader = new
|
|
475
|
+
), this.apiLoader = new Ie(this.apisStorage), this.setupWriteListeners(o);
|
|
476
476
|
}
|
|
477
477
|
setupWriteListeners(e) {
|
|
478
478
|
e.on("write-start", (t) => {
|
|
@@ -490,25 +490,22 @@ class Oe extends pe {
|
|
|
490
490
|
"com.redocly.storage.loadUserState",
|
|
491
491
|
[F("storageOperation", "loadUserState", "storage")],
|
|
492
492
|
e?.parentCtx
|
|
493
|
-
), [r,
|
|
493
|
+
), [r, i, o] = await Promise.all([
|
|
494
494
|
this.activeEnvironmentIdStorage.read(),
|
|
495
495
|
this.tabsStateStorage.read(),
|
|
496
496
|
this.environmentsStorage.read()
|
|
497
497
|
]);
|
|
498
498
|
t?.setAttribute("status", "completed"), t?.setAttribute("environmentCount", o.length), t?.setStatus(O.OK), t?.end();
|
|
499
|
-
const { apiFiles: d, collectionFiles:
|
|
499
|
+
const { apiFiles: d, collectionFiles: c } = await this.detectProjectFiles(e);
|
|
500
500
|
await this.loadAndParseApis(d, e);
|
|
501
|
-
const l = (await this.loadAndParseCollections(
|
|
502
|
-
|
|
503
|
-
const f = this.apiLoader.getAll();
|
|
504
|
-
return this.apisStorage.setItemIds(f.map((u) => u.id)), e?.setAttribute("status", "completed"), e?.setStatus(O.OK), e?.end(), {
|
|
501
|
+
const l = (await this.loadAndParseCollections(c, e)).filter((f) => f !== null), h = this.apiLoader.getAll();
|
|
502
|
+
return e?.setAttribute("status", "completed"), e?.setStatus(O.OK), e?.end(), {
|
|
505
503
|
project: this.project,
|
|
506
504
|
activeEnvironmentId: r,
|
|
507
|
-
tabsState:
|
|
505
|
+
tabsState: i,
|
|
508
506
|
environments: o,
|
|
509
|
-
apis:
|
|
510
|
-
collections: l
|
|
511
|
-
configFileError: this.getEnvironmentsConfigError()
|
|
507
|
+
apis: h,
|
|
508
|
+
collections: l
|
|
512
509
|
};
|
|
513
510
|
}
|
|
514
511
|
async detectProjectFiles(e) {
|
|
@@ -516,13 +513,13 @@ class Oe extends pe {
|
|
|
516
513
|
"com.redocly.storage.detectFiles",
|
|
517
514
|
[F("storageOperation", "detectFiles", "storage")],
|
|
518
515
|
e?.parentCtx
|
|
519
|
-
), { api_files: r, collection_files:
|
|
516
|
+
), { api_files: r, collection_files: i } = await ve(
|
|
520
517
|
"fs_scan",
|
|
521
518
|
{ dir: this.project.userFilesDir }
|
|
522
519
|
);
|
|
523
|
-
return t?.setAttribute("status", "completed"), t?.setAttribute("filesCount", r.length +
|
|
520
|
+
return t?.setAttribute("status", "completed"), t?.setAttribute("filesCount", r.length + i.length), t?.setAttribute("apiFilesCount", r.length), t?.setAttribute("collectionFilesCount", i.length), t?.setStatus(O.OK), t?.end(), {
|
|
524
521
|
apiFiles: r,
|
|
525
|
-
collectionFiles:
|
|
522
|
+
collectionFiles: i
|
|
526
523
|
};
|
|
527
524
|
}
|
|
528
525
|
readEnviroments() {
|
|
@@ -532,7 +529,7 @@ class Oe extends pe {
|
|
|
532
529
|
this.apiLoader.delete(e);
|
|
533
530
|
}
|
|
534
531
|
async loadAndParseApis(e, t, r = !1) {
|
|
535
|
-
const
|
|
532
|
+
const i = this.telemetry?.startSpan(
|
|
536
533
|
"com.redocly.storage.parseApis",
|
|
537
534
|
[
|
|
538
535
|
{
|
|
@@ -544,11 +541,11 @@ class Oe extends pe {
|
|
|
544
541
|
), o = await H(e, 20, async (d) => {
|
|
545
542
|
try {
|
|
546
543
|
return await this.apiLoader.load(d.relative_path, r), this.apiLoader.get(d.relative_path);
|
|
547
|
-
} catch (
|
|
548
|
-
return console.info(`Error parsing YAML/JSON file ${d.absolute_path}:`,
|
|
544
|
+
} catch (c) {
|
|
545
|
+
return console.info(`Error parsing YAML/JSON file ${d.absolute_path}:`, c), await J(d.relative_path, c), null;
|
|
549
546
|
}
|
|
550
547
|
});
|
|
551
|
-
return
|
|
548
|
+
return i?.setAttribute("status", "completed"), i?.setAttribute("parsedApisCount", this.apiLoader.size), i?.setStatus(O.OK), i?.end(), o;
|
|
552
549
|
}
|
|
553
550
|
async loadAndParseCollections(e, t) {
|
|
554
551
|
const r = this.telemetry?.startSpan(
|
|
@@ -560,46 +557,46 @@ class Oe extends pe {
|
|
|
560
557
|
}
|
|
561
558
|
],
|
|
562
559
|
t?.parentCtx
|
|
563
|
-
),
|
|
560
|
+
), i = await H(e, 20, async (o) => {
|
|
564
561
|
try {
|
|
565
562
|
const d = await this.userFilesStorage.get(o.relative_path);
|
|
566
563
|
if (!d)
|
|
567
564
|
return null;
|
|
568
|
-
const
|
|
569
|
-
if (typeof
|
|
565
|
+
const c = me.load(d);
|
|
566
|
+
if (typeof c != "object" || c === null || typeof c.arazzo != "string")
|
|
570
567
|
return await W(o.relative_path), null;
|
|
571
568
|
const a = [];
|
|
572
569
|
await Promise.all(
|
|
573
|
-
|
|
574
|
-
const y =
|
|
570
|
+
c.sourceDescriptions?.map(async (f) => {
|
|
571
|
+
const y = f.type, w = f.url, p = !y || y === "openapi", b = await _e({
|
|
575
572
|
projectPath: this.project.userFilesDir,
|
|
576
573
|
apiUrl: w,
|
|
577
574
|
collectionId: o.relative_path
|
|
578
575
|
});
|
|
579
576
|
if (p) {
|
|
580
|
-
const
|
|
581
|
-
|
|
577
|
+
const u = await this.apiLoader.get(b);
|
|
578
|
+
u && a.push(u);
|
|
582
579
|
}
|
|
583
580
|
})
|
|
584
581
|
);
|
|
585
582
|
const l = await we.join(
|
|
586
583
|
this.project.userFilesDir,
|
|
587
584
|
o.relative_path
|
|
588
|
-
),
|
|
585
|
+
), h = await this.collectionsStorage.parse(
|
|
589
586
|
{
|
|
590
587
|
uri: o.relative_path,
|
|
591
588
|
type: D.FS,
|
|
592
|
-
content:
|
|
589
|
+
content: c,
|
|
593
590
|
fileDependencies: /* @__PURE__ */ new Set([l])
|
|
594
591
|
},
|
|
595
592
|
a
|
|
596
593
|
);
|
|
597
|
-
return await W(o.relative_path),
|
|
594
|
+
return await W(o.relative_path), h;
|
|
598
595
|
} catch (d) {
|
|
599
596
|
return console.info(`Error parsing Arazzo file ${o.relative_path}:`, d), await J(o.relative_path, d), null;
|
|
600
597
|
}
|
|
601
598
|
});
|
|
602
|
-
return r?.setAttribute("status", "completed"), r?.setAttribute("parsedCollectionsCount",
|
|
599
|
+
return r?.setAttribute("status", "completed"), r?.setAttribute("parsedCollectionsCount", i.length), r?.setStatus(O.OK), r?.end(), i;
|
|
603
600
|
}
|
|
604
601
|
}
|
|
605
602
|
export {
|