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