@speckle/objectsender 2.23.23 → 2.24.2
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/objectsender.cjs +2 -2
- package/dist/objectsender.cjs.map +1 -1
- package/dist/objectsender.js +168 -168
- package/dist/objectsender.js.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +2 -1
- package/src/transports/ServerTransport.ts +3 -3
package/dist/objectsender.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var Ct = Object.defineProperty;
|
|
2
|
+
var st = (t) => {
|
|
3
3
|
throw TypeError(t);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var S = (t, e, r) =>
|
|
7
|
-
var T = (t, e, r) => (X(t, e, "read from private field"), r ? r.call(t) : e.get(t)), j = (t, e, r) => e.has(t) ?
|
|
5
|
+
var wt = (t, e, r) => e in t ? Ct(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
6
|
+
var S = (t, e, r) => wt(t, typeof e != "symbol" ? e + "" : e, r), X = (t, e, r) => e.has(t) || st("Cannot " + r);
|
|
7
|
+
var T = (t, e, r) => (X(t, e, "read from private field"), r ? r.call(t) : e.get(t)), j = (t, e, r) => e.has(t) ? st("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), _ = (t, e, r, a) => (X(t, e, "write to private field"), a ? a.call(t, r) : e.set(t, r), r), y = (t, e, r) => (X(t, e, "access private method"), r);
|
|
8
8
|
import "reflect-metadata";
|
|
9
|
-
import { retry as
|
|
9
|
+
import { TIME_MS as Q, retry as St, timeoutAt as Tt } from "@speckle/shared";
|
|
10
10
|
function Y(t) {
|
|
11
11
|
function e(z, g) {
|
|
12
12
|
return z << g | z >>> 32 - g;
|
|
@@ -65,71 +65,71 @@ function Y(t) {
|
|
|
65
65
|
}
|
|
66
66
|
return (r(O) + r(k) + r(s) + r(l) + r(v)).toLowerCase().substring(0, 40);
|
|
67
67
|
}
|
|
68
|
-
var
|
|
69
|
-
function
|
|
70
|
-
var e =
|
|
68
|
+
var vt = typeof global == "object" && global && global.Object === Object && global, jt = typeof self == "object" && self && self.Object === Object && self, et = vt || jt || Function("return this")(), D = et.Symbol, ft = Object.prototype, Ot = ft.hasOwnProperty, kt = ft.toString, M = D ? D.toStringTag : void 0;
|
|
69
|
+
function zt(t) {
|
|
70
|
+
var e = Ot.call(t, M), r = t[M];
|
|
71
71
|
try {
|
|
72
|
-
t[
|
|
72
|
+
t[M] = void 0;
|
|
73
73
|
var a = !0;
|
|
74
74
|
} catch {
|
|
75
75
|
}
|
|
76
|
-
var i =
|
|
77
|
-
return a && (e ? t[
|
|
76
|
+
var i = kt.call(t);
|
|
77
|
+
return a && (e ? t[M] = r : delete t[M]), i;
|
|
78
78
|
}
|
|
79
|
-
var
|
|
80
|
-
function
|
|
81
|
-
return
|
|
82
|
-
}
|
|
83
|
-
var Pt = "[object Null]", It = "[object Undefined]", st = D ? D.toStringTag : void 0;
|
|
84
|
-
function ft(t) {
|
|
85
|
-
return t == null ? t === void 0 ? It : Pt : st && st in Object(t) ? kt(t) : $t(t);
|
|
79
|
+
var At = Object.prototype, $t = At.toString;
|
|
80
|
+
function Pt(t) {
|
|
81
|
+
return $t.call(t);
|
|
86
82
|
}
|
|
83
|
+
var It = "[object Null]", xt = "[object Undefined]", ot = D ? D.toStringTag : void 0;
|
|
87
84
|
function dt(t) {
|
|
85
|
+
return t == null ? t === void 0 ? xt : It : ot && ot in Object(t) ? zt(t) : Pt(t);
|
|
86
|
+
}
|
|
87
|
+
function pt(t) {
|
|
88
88
|
return t != null && typeof t == "object";
|
|
89
89
|
}
|
|
90
|
-
var
|
|
91
|
-
function
|
|
92
|
-
return typeof t == "symbol" ||
|
|
90
|
+
var Et = "[object Symbol]";
|
|
91
|
+
function rt(t) {
|
|
92
|
+
return typeof t == "symbol" || pt(t) && dt(t) == Et;
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function Dt(t, e) {
|
|
95
95
|
for (var r = -1, a = t == null ? 0 : t.length, i = Array(a); ++r < a; )
|
|
96
96
|
i[r] = e(t[r], r, t);
|
|
97
97
|
return i;
|
|
98
98
|
}
|
|
99
|
-
var
|
|
100
|
-
function
|
|
99
|
+
var nt = Array.isArray, Ft = 1 / 0, ct = D ? D.prototype : void 0, ht = ct ? ct.toString : void 0;
|
|
100
|
+
function yt(t) {
|
|
101
101
|
if (typeof t == "string")
|
|
102
102
|
return t;
|
|
103
|
+
if (nt(t))
|
|
104
|
+
return Dt(t, yt) + "";
|
|
103
105
|
if (rt(t))
|
|
104
|
-
return
|
|
105
|
-
if (et(t))
|
|
106
|
-
return ct ? ct.call(t) : "";
|
|
106
|
+
return ht ? ht.call(t) : "";
|
|
107
107
|
var e = t + "";
|
|
108
|
-
return e == "0" && 1 / t == -
|
|
108
|
+
return e == "0" && 1 / t == -Ft ? "-0" : e;
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function gt(t) {
|
|
111
111
|
var e = typeof t;
|
|
112
112
|
return t != null && (e == "object" || e == "function");
|
|
113
113
|
}
|
|
114
|
-
var
|
|
115
|
-
function
|
|
116
|
-
if (!
|
|
114
|
+
var Mt = "[object AsyncFunction]", Rt = "[object Function]", Lt = "[object GeneratorFunction]", Nt = "[object Proxy]";
|
|
115
|
+
function Ht(t) {
|
|
116
|
+
if (!gt(t))
|
|
117
117
|
return !1;
|
|
118
|
-
var e =
|
|
119
|
-
return e == Rt || e == Lt || e ==
|
|
118
|
+
var e = dt(t);
|
|
119
|
+
return e == Rt || e == Lt || e == Mt || e == Nt;
|
|
120
120
|
}
|
|
121
|
-
var Z =
|
|
121
|
+
var Z = et["__core-js_shared__"], ut = function() {
|
|
122
122
|
var t = /[^.]+$/.exec(Z && Z.keys && Z.keys.IE_PROTO || "");
|
|
123
123
|
return t ? "Symbol(src)_1." + t : "";
|
|
124
124
|
}();
|
|
125
|
-
function
|
|
126
|
-
return !!
|
|
125
|
+
function Ut(t) {
|
|
126
|
+
return !!ut && ut in t;
|
|
127
127
|
}
|
|
128
|
-
var
|
|
129
|
-
function
|
|
128
|
+
var Gt = Function.prototype, Kt = Gt.toString;
|
|
129
|
+
function Bt(t) {
|
|
130
130
|
if (t != null) {
|
|
131
131
|
try {
|
|
132
|
-
return
|
|
132
|
+
return Kt.call(t);
|
|
133
133
|
} catch {
|
|
134
134
|
}
|
|
135
135
|
try {
|
|
@@ -139,58 +139,58 @@ function Kt(t) {
|
|
|
139
139
|
}
|
|
140
140
|
return "";
|
|
141
141
|
}
|
|
142
|
-
var
|
|
143
|
-
"^" +
|
|
142
|
+
var qt = /[\\^$.*+?()[\]{}|]/g, Wt = /^\[object .+?Constructor\]$/, Jt = Function.prototype, Vt = Object.prototype, Xt = Jt.toString, Yt = Vt.hasOwnProperty, Zt = RegExp(
|
|
143
|
+
"^" + Xt.call(Yt).replace(qt, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
144
144
|
);
|
|
145
|
-
function
|
|
146
|
-
if (!
|
|
145
|
+
function Qt(t) {
|
|
146
|
+
if (!gt(t) || Ut(t))
|
|
147
147
|
return !1;
|
|
148
|
-
var e =
|
|
149
|
-
return e.test(
|
|
148
|
+
var e = Ht(t) ? Zt : Wt;
|
|
149
|
+
return e.test(Bt(t));
|
|
150
150
|
}
|
|
151
|
-
function
|
|
151
|
+
function te(t, e) {
|
|
152
152
|
return t == null ? void 0 : t[e];
|
|
153
153
|
}
|
|
154
|
-
function
|
|
155
|
-
var r =
|
|
156
|
-
return
|
|
154
|
+
function _t(t, e) {
|
|
155
|
+
var r = te(t, e);
|
|
156
|
+
return Qt(r) ? r : void 0;
|
|
157
157
|
}
|
|
158
|
-
function
|
|
158
|
+
function ee(t, e) {
|
|
159
159
|
return t === e || t !== t && e !== e;
|
|
160
160
|
}
|
|
161
|
-
var
|
|
162
|
-
function
|
|
163
|
-
if (
|
|
161
|
+
var re = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, ne = /^\w*$/;
|
|
162
|
+
function ae(t, e) {
|
|
163
|
+
if (nt(t))
|
|
164
164
|
return !1;
|
|
165
165
|
var r = typeof t;
|
|
166
|
-
return r == "number" || r == "symbol" || r == "boolean" || t == null ||
|
|
166
|
+
return r == "number" || r == "symbol" || r == "boolean" || t == null || rt(t) ? !0 : ne.test(t) || !re.test(t) || e != null && t in Object(e);
|
|
167
167
|
}
|
|
168
|
-
var N =
|
|
169
|
-
function
|
|
168
|
+
var N = _t(Object, "create");
|
|
169
|
+
function ie() {
|
|
170
170
|
this.__data__ = N ? N(null) : {}, this.size = 0;
|
|
171
171
|
}
|
|
172
|
-
function
|
|
172
|
+
function se(t) {
|
|
173
173
|
var e = this.has(t) && delete this.__data__[t];
|
|
174
174
|
return this.size -= e ? 1 : 0, e;
|
|
175
175
|
}
|
|
176
|
-
var
|
|
177
|
-
function
|
|
176
|
+
var oe = "__lodash_hash_undefined__", ce = Object.prototype, he = ce.hasOwnProperty;
|
|
177
|
+
function ue(t) {
|
|
178
178
|
var e = this.__data__;
|
|
179
179
|
if (N) {
|
|
180
180
|
var r = e[t];
|
|
181
|
-
return r ===
|
|
181
|
+
return r === oe ? void 0 : r;
|
|
182
182
|
}
|
|
183
|
-
return
|
|
183
|
+
return he.call(e, t) ? e[t] : void 0;
|
|
184
184
|
}
|
|
185
|
-
var
|
|
186
|
-
function
|
|
185
|
+
var le = Object.prototype, fe = le.hasOwnProperty;
|
|
186
|
+
function de(t) {
|
|
187
187
|
var e = this.__data__;
|
|
188
|
-
return N ? e[t] !== void 0 :
|
|
188
|
+
return N ? e[t] !== void 0 : fe.call(e, t);
|
|
189
189
|
}
|
|
190
|
-
var
|
|
191
|
-
function
|
|
190
|
+
var pe = "__lodash_hash_undefined__";
|
|
191
|
+
function ye(t, e) {
|
|
192
192
|
var r = this.__data__;
|
|
193
|
-
return this.size += this.has(t) ? 0 : 1, r[t] = N && e === void 0 ?
|
|
193
|
+
return this.size += this.has(t) ? 0 : 1, r[t] = N && e === void 0 ? pe : e, this;
|
|
194
194
|
}
|
|
195
195
|
function x(t) {
|
|
196
196
|
var e = -1, r = t == null ? 0 : t.length;
|
|
@@ -199,36 +199,36 @@ function x(t) {
|
|
|
199
199
|
this.set(a[0], a[1]);
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
|
-
x.prototype.clear =
|
|
203
|
-
x.prototype.delete =
|
|
204
|
-
x.prototype.get =
|
|
205
|
-
x.prototype.has =
|
|
206
|
-
x.prototype.set =
|
|
207
|
-
function
|
|
202
|
+
x.prototype.clear = ie;
|
|
203
|
+
x.prototype.delete = se;
|
|
204
|
+
x.prototype.get = ue;
|
|
205
|
+
x.prototype.has = de;
|
|
206
|
+
x.prototype.set = ye;
|
|
207
|
+
function ge() {
|
|
208
208
|
this.__data__ = [], this.size = 0;
|
|
209
209
|
}
|
|
210
210
|
function J(t, e) {
|
|
211
211
|
for (var r = t.length; r--; )
|
|
212
|
-
if (
|
|
212
|
+
if (ee(t[r][0], e))
|
|
213
213
|
return r;
|
|
214
214
|
return -1;
|
|
215
215
|
}
|
|
216
|
-
var
|
|
217
|
-
function
|
|
216
|
+
var _e = Array.prototype, be = _e.splice;
|
|
217
|
+
function me(t) {
|
|
218
218
|
var e = this.__data__, r = J(e, t);
|
|
219
219
|
if (r < 0)
|
|
220
220
|
return !1;
|
|
221
221
|
var a = e.length - 1;
|
|
222
|
-
return r == a ? e.pop() :
|
|
222
|
+
return r == a ? e.pop() : be.call(e, r, 1), --this.size, !0;
|
|
223
223
|
}
|
|
224
|
-
function
|
|
224
|
+
function Ce(t) {
|
|
225
225
|
var e = this.__data__, r = J(e, t);
|
|
226
226
|
return r < 0 ? void 0 : e[r][1];
|
|
227
227
|
}
|
|
228
|
-
function
|
|
228
|
+
function we(t) {
|
|
229
229
|
return J(this.__data__, t) > -1;
|
|
230
230
|
}
|
|
231
|
-
function
|
|
231
|
+
function Se(t, e) {
|
|
232
232
|
var r = this.__data__, a = J(r, t);
|
|
233
233
|
return a < 0 ? (++this.size, r.push([t, e])) : r[a][1] = e, this;
|
|
234
234
|
}
|
|
@@ -239,38 +239,38 @@ function F(t) {
|
|
|
239
239
|
this.set(a[0], a[1]);
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
|
-
F.prototype.clear =
|
|
243
|
-
F.prototype.delete =
|
|
244
|
-
F.prototype.get =
|
|
245
|
-
F.prototype.has =
|
|
246
|
-
F.prototype.set =
|
|
247
|
-
var
|
|
248
|
-
function
|
|
242
|
+
F.prototype.clear = ge;
|
|
243
|
+
F.prototype.delete = me;
|
|
244
|
+
F.prototype.get = Ce;
|
|
245
|
+
F.prototype.has = we;
|
|
246
|
+
F.prototype.set = Se;
|
|
247
|
+
var Te = _t(et, "Map");
|
|
248
|
+
function ve() {
|
|
249
249
|
this.size = 0, this.__data__ = {
|
|
250
250
|
hash: new x(),
|
|
251
|
-
map: new (
|
|
251
|
+
map: new (Te || F)(),
|
|
252
252
|
string: new x()
|
|
253
253
|
};
|
|
254
254
|
}
|
|
255
|
-
function
|
|
255
|
+
function je(t) {
|
|
256
256
|
var e = typeof t;
|
|
257
257
|
return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t !== "__proto__" : t === null;
|
|
258
258
|
}
|
|
259
259
|
function V(t, e) {
|
|
260
260
|
var r = t.__data__;
|
|
261
|
-
return
|
|
261
|
+
return je(e) ? r[typeof e == "string" ? "string" : "hash"] : r.map;
|
|
262
262
|
}
|
|
263
|
-
function
|
|
263
|
+
function Oe(t) {
|
|
264
264
|
var e = V(this, t).delete(t);
|
|
265
265
|
return this.size -= e ? 1 : 0, e;
|
|
266
266
|
}
|
|
267
|
-
function
|
|
267
|
+
function ke(t) {
|
|
268
268
|
return V(this, t).get(t);
|
|
269
269
|
}
|
|
270
|
-
function
|
|
270
|
+
function ze(t) {
|
|
271
271
|
return V(this, t).has(t);
|
|
272
272
|
}
|
|
273
|
-
function
|
|
273
|
+
function Ae(t, e) {
|
|
274
274
|
var r = V(this, t), a = r.size;
|
|
275
275
|
return r.set(t, e), this.size += r.size == a ? 0 : 1, this;
|
|
276
276
|
}
|
|
@@ -281,15 +281,15 @@ function E(t) {
|
|
|
281
281
|
this.set(a[0], a[1]);
|
|
282
282
|
}
|
|
283
283
|
}
|
|
284
|
-
E.prototype.clear =
|
|
285
|
-
E.prototype.delete =
|
|
286
|
-
E.prototype.get =
|
|
287
|
-
E.prototype.has =
|
|
288
|
-
E.prototype.set =
|
|
289
|
-
var
|
|
290
|
-
function
|
|
284
|
+
E.prototype.clear = ve;
|
|
285
|
+
E.prototype.delete = Oe;
|
|
286
|
+
E.prototype.get = ke;
|
|
287
|
+
E.prototype.has = ze;
|
|
288
|
+
E.prototype.set = Ae;
|
|
289
|
+
var $e = "Expected a function";
|
|
290
|
+
function at(t, e) {
|
|
291
291
|
if (typeof t != "function" || e != null && typeof e != "function")
|
|
292
|
-
throw new TypeError(
|
|
292
|
+
throw new TypeError($e);
|
|
293
293
|
var r = function() {
|
|
294
294
|
var a = arguments, i = e ? e.apply(this, a) : a[0], n = r.cache;
|
|
295
295
|
if (n.has(i))
|
|
@@ -297,64 +297,64 @@ function nt(t, e) {
|
|
|
297
297
|
var b = t.apply(this, a);
|
|
298
298
|
return r.cache = n.set(i, b) || n, b;
|
|
299
299
|
};
|
|
300
|
-
return r.cache = new (
|
|
300
|
+
return r.cache = new (at.Cache || E)(), r;
|
|
301
301
|
}
|
|
302
|
-
|
|
303
|
-
var
|
|
304
|
-
function
|
|
305
|
-
var e =
|
|
306
|
-
return r.size ===
|
|
302
|
+
at.Cache = E;
|
|
303
|
+
var Pe = 500;
|
|
304
|
+
function Ie(t) {
|
|
305
|
+
var e = at(t, function(a) {
|
|
306
|
+
return r.size === Pe && r.clear(), a;
|
|
307
307
|
}), r = e.cache;
|
|
308
308
|
return e;
|
|
309
309
|
}
|
|
310
|
-
var
|
|
310
|
+
var xe = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, Ee = /\\(\\)?/g, De = Ie(function(t) {
|
|
311
311
|
var e = [];
|
|
312
|
-
return t.charCodeAt(0) === 46 && e.push(""), t.replace(
|
|
313
|
-
e.push(i ? n.replace(
|
|
312
|
+
return t.charCodeAt(0) === 46 && e.push(""), t.replace(xe, function(r, a, i, n) {
|
|
313
|
+
e.push(i ? n.replace(Ee, "$1") : a || r);
|
|
314
314
|
}), e;
|
|
315
315
|
});
|
|
316
|
-
function
|
|
317
|
-
return t == null ? "" :
|
|
316
|
+
function Fe(t) {
|
|
317
|
+
return t == null ? "" : yt(t);
|
|
318
318
|
}
|
|
319
|
-
function
|
|
320
|
-
return
|
|
319
|
+
function Me(t, e) {
|
|
320
|
+
return nt(t) ? t : ae(t, e) ? [t] : De(Fe(t));
|
|
321
321
|
}
|
|
322
322
|
var Re = 1 / 0;
|
|
323
323
|
function Le(t) {
|
|
324
|
-
if (typeof t == "string" ||
|
|
324
|
+
if (typeof t == "string" || rt(t))
|
|
325
325
|
return t;
|
|
326
326
|
var e = t + "";
|
|
327
327
|
return e == "0" && 1 / t == -Re ? "-0" : e;
|
|
328
328
|
}
|
|
329
|
-
function
|
|
330
|
-
e =
|
|
329
|
+
function Ne(t, e) {
|
|
330
|
+
e = Me(e, t);
|
|
331
331
|
for (var r = 0, a = e.length; t != null && r < a; )
|
|
332
332
|
t = t[Le(e[r++])];
|
|
333
333
|
return r && r == a ? t : void 0;
|
|
334
334
|
}
|
|
335
|
-
function
|
|
336
|
-
var a = t == null ? void 0 :
|
|
335
|
+
function He(t, e, r) {
|
|
336
|
+
var a = t == null ? void 0 : Ne(t, e);
|
|
337
337
|
return a === void 0 ? r : a;
|
|
338
338
|
}
|
|
339
|
-
const
|
|
340
|
-
function
|
|
341
|
-
return Reflect.metadata(
|
|
342
|
-
}
|
|
343
|
-
function Ze(t) {
|
|
344
|
-
return Reflect.metadata(at, t);
|
|
339
|
+
const bt = Symbol("detach"), it = Symbol("chunkable");
|
|
340
|
+
function Ze() {
|
|
341
|
+
return Reflect.metadata(bt, !0);
|
|
345
342
|
}
|
|
346
|
-
function
|
|
347
|
-
return
|
|
343
|
+
function Qe(t) {
|
|
344
|
+
return Reflect.metadata(it, t);
|
|
348
345
|
}
|
|
349
346
|
function Ue(t, e) {
|
|
350
|
-
return !!Reflect.getMetadata(
|
|
347
|
+
return !!Reflect.getMetadata(bt, t, e);
|
|
351
348
|
}
|
|
352
349
|
function Ge(t, e) {
|
|
353
|
-
return Reflect.getMetadata(
|
|
350
|
+
return !!Reflect.getMetadata(it, t, e);
|
|
354
351
|
}
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
352
|
+
function Ke(t, e) {
|
|
353
|
+
return Reflect.getMetadata(it, t, e);
|
|
354
|
+
}
|
|
355
|
+
const Be = (t) => pt(t) && !!He(t, "speckle_type");
|
|
356
|
+
var h, R, L, W, tt, mt;
|
|
357
|
+
class qe {
|
|
358
358
|
constructor(e, r = 1e3, a = Y) {
|
|
359
359
|
j(this, h);
|
|
360
360
|
S(this, "chunkSize");
|
|
@@ -368,13 +368,13 @@ class Be {
|
|
|
368
368
|
this.chunkSize = r, this.detachLineage = [!0], this.lineage = [], this.familyTree = {}, this.closureTable = {}, this.transport = e, this.uniqueId = 0, this.hashingFunction = a || Y;
|
|
369
369
|
}
|
|
370
370
|
async write(e) {
|
|
371
|
-
return await y(this, h,
|
|
371
|
+
return await y(this, h, R).call(this, e, !0);
|
|
372
372
|
}
|
|
373
373
|
dispose() {
|
|
374
374
|
this.detachLineage = [], this.lineage = [], this.familyTree = {}, this.closureTable = {}, this.transport = null;
|
|
375
375
|
}
|
|
376
376
|
}
|
|
377
|
-
h = new WeakSet(),
|
|
377
|
+
h = new WeakSet(), R = async function(e, r) {
|
|
378
378
|
const a = `${this.uniqueId++}-obj`;
|
|
379
379
|
this.lineage.push(a);
|
|
380
380
|
const i = { speckle_type: e.speckle_type || "Base" };
|
|
@@ -385,26 +385,26 @@ h = new WeakSet(), L = async function(e, r) {
|
|
|
385
385
|
i[s] = l;
|
|
386
386
|
continue;
|
|
387
387
|
}
|
|
388
|
-
const v = s.startsWith("@") ||
|
|
388
|
+
const v = s.startsWith("@") || Ue(e, s), f = Array.isArray(l), o = f ? Ge(e, s) || s.match(/^@\((\d*)\)/) : !1;
|
|
389
389
|
if (f && o && l.length !== 0 && typeof l[0] != "object") {
|
|
390
390
|
let c = this.chunkSize;
|
|
391
|
-
typeof o == "boolean" ? c =
|
|
391
|
+
typeof o == "boolean" ? c = Ke(e, s) : c = o[1] !== "" ? parseInt(o[1]) : this.chunkSize;
|
|
392
392
|
const u = [];
|
|
393
|
-
let p = new
|
|
393
|
+
let p = new lt(), m = 0;
|
|
394
394
|
for (const C of l)
|
|
395
|
-
m === c && (u.push(await y(this, h,
|
|
396
|
-
p.data.length !== 0 && u.push(await y(this, h,
|
|
395
|
+
m === c && (u.push(await y(this, h, tt).call(this, p)), p = new lt(), m = 0), p.data.push(C), m++;
|
|
396
|
+
p.data.length !== 0 && u.push(await y(this, h, tt).call(this, p)), typeof o == "boolean" ? i[s] = u : i[s.replace(o[0], "")] = u;
|
|
397
397
|
continue;
|
|
398
398
|
}
|
|
399
399
|
if (l.speckle_type) {
|
|
400
|
-
const c = await y(this, h,
|
|
400
|
+
const c = await y(this, h, L).call(this, {
|
|
401
401
|
value: l,
|
|
402
402
|
isDetached: v
|
|
403
403
|
});
|
|
404
404
|
i[s] = v ? y(this, h, W).call(this, c.id) : c;
|
|
405
405
|
continue;
|
|
406
406
|
}
|
|
407
|
-
i[s] = await y(this, h,
|
|
407
|
+
i[s] = await y(this, h, L).call(this, {
|
|
408
408
|
value: l,
|
|
409
409
|
isDetached: v
|
|
410
410
|
});
|
|
@@ -416,9 +416,9 @@ h = new WeakSet(), L = async function(e, r) {
|
|
|
416
416
|
s[l] = v - this.detachLineage.length;
|
|
417
417
|
}), i.totalChildrenCount = Object.keys(s).length, i.totalChildrenCount && (i.__closure = s);
|
|
418
418
|
}
|
|
419
|
-
const { hash: d, serializedObject: O, size: k } = y(this, h,
|
|
419
|
+
const { hash: d, serializedObject: O, size: k } = y(this, h, mt).call(this, i);
|
|
420
420
|
return i.id = d, (n || r) && this.transport && await this.transport.write(O, k), r && this.transport && await this.transport.flush(), { hash: d, traversed: i };
|
|
421
|
-
},
|
|
421
|
+
}, L = async function({
|
|
422
422
|
value: e,
|
|
423
423
|
isDetached: r = !1
|
|
424
424
|
}) {
|
|
@@ -429,21 +429,21 @@ h = new WeakSet(), L = async function(e, r) {
|
|
|
429
429
|
if (typeof a[0] != "object") return a;
|
|
430
430
|
if (!r)
|
|
431
431
|
return Promise.all(
|
|
432
|
-
e.map(async (n) => await y(this, h,
|
|
432
|
+
e.map(async (n) => await y(this, h, L).call(this, { value: n }))
|
|
433
433
|
);
|
|
434
434
|
const i = [];
|
|
435
435
|
for (const n of e)
|
|
436
|
-
if (
|
|
436
|
+
if (Be(n)) {
|
|
437
437
|
this.detachLineage.push(r);
|
|
438
|
-
const { hash: b } = await y(this, h,
|
|
438
|
+
const { hash: b } = await y(this, h, R).call(this, n, !1);
|
|
439
439
|
i.push(y(this, h, W).call(this, b));
|
|
440
440
|
} else
|
|
441
|
-
i.push(await y(this, h,
|
|
441
|
+
i.push(await y(this, h, L).call(this, { value: n, isDetached: r }));
|
|
442
442
|
return i;
|
|
443
443
|
}
|
|
444
444
|
if (!e.speckle_type) return e;
|
|
445
445
|
if (e.speckle_type)
|
|
446
|
-
return this.detachLineage.push(r), (await y(this, h,
|
|
446
|
+
return this.detachLineage.push(r), (await y(this, h, R).call(this, e, !1)).traversed;
|
|
447
447
|
throw new Error(`Unsupported type '${typeof e}': ${e}.`);
|
|
448
448
|
}, W = function(e) {
|
|
449
449
|
return this.lineage.forEach((r) => {
|
|
@@ -452,11 +452,11 @@ h = new WeakSet(), L = async function(e, r) {
|
|
|
452
452
|
referencedId: e,
|
|
453
453
|
speckle_type: "reference"
|
|
454
454
|
};
|
|
455
|
-
},
|
|
455
|
+
}, tt = async function(e) {
|
|
456
456
|
this.detachLineage.push(!0);
|
|
457
|
-
const { hash: r } = await y(this, h,
|
|
457
|
+
const { hash: r } = await y(this, h, R).call(this, e, !1);
|
|
458
458
|
return y(this, h, W).call(this, r);
|
|
459
|
-
},
|
|
459
|
+
}, mt = function(e) {
|
|
460
460
|
const r = JSON.stringify(e), a = this.hashingFunction(r), i = r.substring(0, 1) + `"id":"${a}",` + r.substring(1);
|
|
461
461
|
return {
|
|
462
462
|
hash: Y(r),
|
|
@@ -465,7 +465,7 @@ h = new WeakSet(), L = async function(e, r) {
|
|
|
465
465
|
// approx, good enough as we're just limiting artificially batch sizes based on this
|
|
466
466
|
};
|
|
467
467
|
};
|
|
468
|
-
class
|
|
468
|
+
class lt {
|
|
469
469
|
constructor() {
|
|
470
470
|
S(this, "speckle_type");
|
|
471
471
|
S(this, "data");
|
|
@@ -473,7 +473,7 @@ class ut {
|
|
|
473
473
|
}
|
|
474
474
|
}
|
|
475
475
|
var $, H, I, U, G, K, B, q;
|
|
476
|
-
class
|
|
476
|
+
class We {
|
|
477
477
|
constructor(e, r, a, i) {
|
|
478
478
|
j(this, $);
|
|
479
479
|
j(this, H);
|
|
@@ -483,7 +483,7 @@ class qe {
|
|
|
483
483
|
j(this, K);
|
|
484
484
|
j(this, B);
|
|
485
485
|
j(this, q);
|
|
486
|
-
_(this, H, (i == null ? void 0 : i.maxSize) || 2e5), _(this, B, (i == null ? void 0 : i.flushRetryCount) || 3), _(this, q, (i == null ? void 0 : i.flushTimeout) || 2 *
|
|
486
|
+
_(this, H, (i == null ? void 0 : i.maxSize) || 2e5), _(this, B, (i == null ? void 0 : i.flushRetryCount) || 3), _(this, q, (i == null ? void 0 : i.flushTimeout) || 2 * Q.minute), _(this, I, 0), _(this, U, e), _(this, G, r), _(this, K, a), _(this, $, []);
|
|
487
487
|
}
|
|
488
488
|
async write(e, r) {
|
|
489
489
|
T(this, $).push(e), _(this, I, T(this, I) + r), !(T(this, I) < T(this, H)) && await this.flush();
|
|
@@ -492,17 +492,17 @@ class qe {
|
|
|
492
492
|
if (T(this, $).length === 0) return;
|
|
493
493
|
const e = new FormData(), r = "[" + T(this, $).join(",") + "]";
|
|
494
494
|
e.append("object-batch", new Blob([r], { type: "application/json" }));
|
|
495
|
-
const a = new URL(`/objects/${T(this, G)}`, T(this, U)), i = await
|
|
495
|
+
const a = new URL(`/objects/${T(this, G)}`, T(this, U)), i = await St(
|
|
496
496
|
async () => await Promise.race([
|
|
497
497
|
fetch(a, {
|
|
498
498
|
method: "POST",
|
|
499
499
|
headers: { Authorization: `Bearer ${T(this, K)}` },
|
|
500
500
|
body: e
|
|
501
501
|
}),
|
|
502
|
-
|
|
502
|
+
Tt(T(this, q), "Object sender flush timed out")
|
|
503
503
|
]),
|
|
504
504
|
T(this, B),
|
|
505
|
-
(n) => n *
|
|
505
|
+
(n) => n * Q.second
|
|
506
506
|
);
|
|
507
507
|
if (i.status !== 201)
|
|
508
508
|
throw new Error(
|
|
@@ -515,14 +515,14 @@ class qe {
|
|
|
515
515
|
}
|
|
516
516
|
}
|
|
517
517
|
$ = new WeakMap(), H = new WeakMap(), I = new WeakMap(), U = new WeakMap(), G = new WeakMap(), K = new WeakMap(), B = new WeakMap(), q = new WeakMap();
|
|
518
|
-
class
|
|
518
|
+
class tr {
|
|
519
519
|
constructor(e) {
|
|
520
520
|
S(this, "speckle_type");
|
|
521
521
|
if (this.speckle_type = this.constructor.name, e)
|
|
522
522
|
for (const r in e) this[r] = e[r];
|
|
523
523
|
}
|
|
524
524
|
}
|
|
525
|
-
const
|
|
525
|
+
const er = async (t, {
|
|
526
526
|
serverUrl: e = "https://app.speckle.systems",
|
|
527
527
|
projectId: r,
|
|
528
528
|
token: a,
|
|
@@ -531,7 +531,7 @@ const tr = async (t, {
|
|
|
531
531
|
}) => {
|
|
532
532
|
const b = performance.now();
|
|
533
533
|
i == null || i.log("Starting to send");
|
|
534
|
-
const d = new
|
|
534
|
+
const d = new We(e, r, a, n == null ? void 0 : n.transport), O = new qe(
|
|
535
535
|
d,
|
|
536
536
|
n == null ? void 0 : n.chunkSize,
|
|
537
537
|
n == null ? void 0 : n.hashingFunction
|
|
@@ -543,12 +543,12 @@ const tr = async (t, {
|
|
|
543
543
|
d.dispose(), O.dispose();
|
|
544
544
|
}
|
|
545
545
|
const s = performance.now();
|
|
546
|
-
return i.log(`Finished sending in ${(s - b) /
|
|
546
|
+
return i.log(`Finished sending in ${(s - b) / Q.second}s.`), k;
|
|
547
547
|
};
|
|
548
548
|
export {
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
549
|
+
tr as Base,
|
|
550
|
+
Qe as Chunkable,
|
|
551
|
+
Ze as Detach,
|
|
552
|
+
er as send
|
|
553
553
|
};
|
|
554
554
|
//# sourceMappingURL=objectsender.js.map
|