@sanity/client 4.0.0 → 4.0.1-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/sanityClient.browser.mjs +781 -932
- package/dist/sanityClient.browser.mjs.map +4 -4
- package/lib/assets/assetsClient.js +5 -4
- package/lib/data/dataMethods.js +10 -12
- package/lib/data/listen.js +3 -3
- package/lib/http/request.js +2 -2
- package/lib/sanityClient.js +6 -8
- package/package.json +7 -7
- package/sanityClient.d.ts +6 -6
- package/umd/sanityClient.js +5454 -188
- package/umd/sanityClient.min.js +14 -1
- package/lib/util/observable.js +0 -26
|
@@ -20,886 +20,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
20
20
|
mod
|
|
21
21
|
));
|
|
22
22
|
|
|
23
|
-
// node_modules/rxjs/internal/util/isFunction.js
|
|
24
|
-
var require_isFunction = __commonJS({
|
|
25
|
-
"node_modules/rxjs/internal/util/isFunction.js"(exports) {
|
|
26
|
-
"use strict";
|
|
27
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
function isFunction(x) {
|
|
29
|
-
return typeof x === "function";
|
|
30
|
-
}
|
|
31
|
-
exports.isFunction = isFunction;
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
// node_modules/rxjs/internal/config.js
|
|
36
|
-
var require_config = __commonJS({
|
|
37
|
-
"node_modules/rxjs/internal/config.js"(exports) {
|
|
38
|
-
"use strict";
|
|
39
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
var _enable_super_gross_mode_that_will_cause_bad_things = false;
|
|
41
|
-
exports.config = {
|
|
42
|
-
Promise: void 0,
|
|
43
|
-
set useDeprecatedSynchronousErrorHandling(value) {
|
|
44
|
-
if (value) {
|
|
45
|
-
var error = new Error();
|
|
46
|
-
console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n" + error.stack);
|
|
47
|
-
} else if (_enable_super_gross_mode_that_will_cause_bad_things) {
|
|
48
|
-
console.log("RxJS: Back to a better error behavior. Thank you. <3");
|
|
49
|
-
}
|
|
50
|
-
_enable_super_gross_mode_that_will_cause_bad_things = value;
|
|
51
|
-
},
|
|
52
|
-
get useDeprecatedSynchronousErrorHandling() {
|
|
53
|
-
return _enable_super_gross_mode_that_will_cause_bad_things;
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
// node_modules/rxjs/internal/util/hostReportError.js
|
|
60
|
-
var require_hostReportError = __commonJS({
|
|
61
|
-
"node_modules/rxjs/internal/util/hostReportError.js"(exports) {
|
|
62
|
-
"use strict";
|
|
63
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
64
|
-
function hostReportError(err) {
|
|
65
|
-
setTimeout(function() {
|
|
66
|
-
throw err;
|
|
67
|
-
}, 0);
|
|
68
|
-
}
|
|
69
|
-
exports.hostReportError = hostReportError;
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
// node_modules/rxjs/internal/Observer.js
|
|
74
|
-
var require_Observer = __commonJS({
|
|
75
|
-
"node_modules/rxjs/internal/Observer.js"(exports) {
|
|
76
|
-
"use strict";
|
|
77
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
78
|
-
var config_1 = require_config();
|
|
79
|
-
var hostReportError_1 = require_hostReportError();
|
|
80
|
-
exports.empty = {
|
|
81
|
-
closed: true,
|
|
82
|
-
next: function(value) {
|
|
83
|
-
},
|
|
84
|
-
error: function(err) {
|
|
85
|
-
if (config_1.config.useDeprecatedSynchronousErrorHandling) {
|
|
86
|
-
throw err;
|
|
87
|
-
} else {
|
|
88
|
-
hostReportError_1.hostReportError(err);
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
complete: function() {
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
// node_modules/rxjs/internal/util/isArray.js
|
|
98
|
-
var require_isArray = __commonJS({
|
|
99
|
-
"node_modules/rxjs/internal/util/isArray.js"(exports) {
|
|
100
|
-
"use strict";
|
|
101
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
102
|
-
exports.isArray = function() {
|
|
103
|
-
return Array.isArray || function(x) {
|
|
104
|
-
return x && typeof x.length === "number";
|
|
105
|
-
};
|
|
106
|
-
}();
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
// node_modules/rxjs/internal/util/isObject.js
|
|
111
|
-
var require_isObject = __commonJS({
|
|
112
|
-
"node_modules/rxjs/internal/util/isObject.js"(exports) {
|
|
113
|
-
"use strict";
|
|
114
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
115
|
-
function isObject(x) {
|
|
116
|
-
return x !== null && typeof x === "object";
|
|
117
|
-
}
|
|
118
|
-
exports.isObject = isObject;
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
// node_modules/rxjs/internal/util/UnsubscriptionError.js
|
|
123
|
-
var require_UnsubscriptionError = __commonJS({
|
|
124
|
-
"node_modules/rxjs/internal/util/UnsubscriptionError.js"(exports) {
|
|
125
|
-
"use strict";
|
|
126
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
127
|
-
var UnsubscriptionErrorImpl = function() {
|
|
128
|
-
function UnsubscriptionErrorImpl2(errors) {
|
|
129
|
-
Error.call(this);
|
|
130
|
-
this.message = errors ? errors.length + " errors occurred during unsubscription:\n" + errors.map(function(err, i) {
|
|
131
|
-
return i + 1 + ") " + err.toString();
|
|
132
|
-
}).join("\n ") : "";
|
|
133
|
-
this.name = "UnsubscriptionError";
|
|
134
|
-
this.errors = errors;
|
|
135
|
-
return this;
|
|
136
|
-
}
|
|
137
|
-
UnsubscriptionErrorImpl2.prototype = Object.create(Error.prototype);
|
|
138
|
-
return UnsubscriptionErrorImpl2;
|
|
139
|
-
}();
|
|
140
|
-
exports.UnsubscriptionError = UnsubscriptionErrorImpl;
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
// node_modules/rxjs/internal/Subscription.js
|
|
145
|
-
var require_Subscription = __commonJS({
|
|
146
|
-
"node_modules/rxjs/internal/Subscription.js"(exports) {
|
|
147
|
-
"use strict";
|
|
148
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
149
|
-
var isArray_1 = require_isArray();
|
|
150
|
-
var isObject_1 = require_isObject();
|
|
151
|
-
var isFunction_1 = require_isFunction();
|
|
152
|
-
var UnsubscriptionError_1 = require_UnsubscriptionError();
|
|
153
|
-
var Subscription = function() {
|
|
154
|
-
function Subscription2(unsubscribe) {
|
|
155
|
-
this.closed = false;
|
|
156
|
-
this._parentOrParents = null;
|
|
157
|
-
this._subscriptions = null;
|
|
158
|
-
if (unsubscribe) {
|
|
159
|
-
this._ctorUnsubscribe = true;
|
|
160
|
-
this._unsubscribe = unsubscribe;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
Subscription2.prototype.unsubscribe = function() {
|
|
164
|
-
var errors;
|
|
165
|
-
if (this.closed) {
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
var _a = this, _parentOrParents = _a._parentOrParents, _ctorUnsubscribe = _a._ctorUnsubscribe, _unsubscribe = _a._unsubscribe, _subscriptions = _a._subscriptions;
|
|
169
|
-
this.closed = true;
|
|
170
|
-
this._parentOrParents = null;
|
|
171
|
-
this._subscriptions = null;
|
|
172
|
-
if (_parentOrParents instanceof Subscription2) {
|
|
173
|
-
_parentOrParents.remove(this);
|
|
174
|
-
} else if (_parentOrParents !== null) {
|
|
175
|
-
for (var index = 0; index < _parentOrParents.length; ++index) {
|
|
176
|
-
var parent_1 = _parentOrParents[index];
|
|
177
|
-
parent_1.remove(this);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
if (isFunction_1.isFunction(_unsubscribe)) {
|
|
181
|
-
if (_ctorUnsubscribe) {
|
|
182
|
-
this._unsubscribe = void 0;
|
|
183
|
-
}
|
|
184
|
-
try {
|
|
185
|
-
_unsubscribe.call(this);
|
|
186
|
-
} catch (e) {
|
|
187
|
-
errors = e instanceof UnsubscriptionError_1.UnsubscriptionError ? flattenUnsubscriptionErrors(e.errors) : [e];
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
if (isArray_1.isArray(_subscriptions)) {
|
|
191
|
-
var index = -1;
|
|
192
|
-
var len = _subscriptions.length;
|
|
193
|
-
while (++index < len) {
|
|
194
|
-
var sub = _subscriptions[index];
|
|
195
|
-
if (isObject_1.isObject(sub)) {
|
|
196
|
-
try {
|
|
197
|
-
sub.unsubscribe();
|
|
198
|
-
} catch (e) {
|
|
199
|
-
errors = errors || [];
|
|
200
|
-
if (e instanceof UnsubscriptionError_1.UnsubscriptionError) {
|
|
201
|
-
errors = errors.concat(flattenUnsubscriptionErrors(e.errors));
|
|
202
|
-
} else {
|
|
203
|
-
errors.push(e);
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
if (errors) {
|
|
210
|
-
throw new UnsubscriptionError_1.UnsubscriptionError(errors);
|
|
211
|
-
}
|
|
212
|
-
};
|
|
213
|
-
Subscription2.prototype.add = function(teardown) {
|
|
214
|
-
var subscription = teardown;
|
|
215
|
-
if (!teardown) {
|
|
216
|
-
return Subscription2.EMPTY;
|
|
217
|
-
}
|
|
218
|
-
switch (typeof teardown) {
|
|
219
|
-
case "function":
|
|
220
|
-
subscription = new Subscription2(teardown);
|
|
221
|
-
case "object":
|
|
222
|
-
if (subscription === this || subscription.closed || typeof subscription.unsubscribe !== "function") {
|
|
223
|
-
return subscription;
|
|
224
|
-
} else if (this.closed) {
|
|
225
|
-
subscription.unsubscribe();
|
|
226
|
-
return subscription;
|
|
227
|
-
} else if (!(subscription instanceof Subscription2)) {
|
|
228
|
-
var tmp = subscription;
|
|
229
|
-
subscription = new Subscription2();
|
|
230
|
-
subscription._subscriptions = [tmp];
|
|
231
|
-
}
|
|
232
|
-
break;
|
|
233
|
-
default: {
|
|
234
|
-
throw new Error("unrecognized teardown " + teardown + " added to Subscription.");
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
var _parentOrParents = subscription._parentOrParents;
|
|
238
|
-
if (_parentOrParents === null) {
|
|
239
|
-
subscription._parentOrParents = this;
|
|
240
|
-
} else if (_parentOrParents instanceof Subscription2) {
|
|
241
|
-
if (_parentOrParents === this) {
|
|
242
|
-
return subscription;
|
|
243
|
-
}
|
|
244
|
-
subscription._parentOrParents = [_parentOrParents, this];
|
|
245
|
-
} else if (_parentOrParents.indexOf(this) === -1) {
|
|
246
|
-
_parentOrParents.push(this);
|
|
247
|
-
} else {
|
|
248
|
-
return subscription;
|
|
249
|
-
}
|
|
250
|
-
var subscriptions = this._subscriptions;
|
|
251
|
-
if (subscriptions === null) {
|
|
252
|
-
this._subscriptions = [subscription];
|
|
253
|
-
} else {
|
|
254
|
-
subscriptions.push(subscription);
|
|
255
|
-
}
|
|
256
|
-
return subscription;
|
|
257
|
-
};
|
|
258
|
-
Subscription2.prototype.remove = function(subscription) {
|
|
259
|
-
var subscriptions = this._subscriptions;
|
|
260
|
-
if (subscriptions) {
|
|
261
|
-
var subscriptionIndex = subscriptions.indexOf(subscription);
|
|
262
|
-
if (subscriptionIndex !== -1) {
|
|
263
|
-
subscriptions.splice(subscriptionIndex, 1);
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
};
|
|
267
|
-
Subscription2.EMPTY = function(empty) {
|
|
268
|
-
empty.closed = true;
|
|
269
|
-
return empty;
|
|
270
|
-
}(new Subscription2());
|
|
271
|
-
return Subscription2;
|
|
272
|
-
}();
|
|
273
|
-
exports.Subscription = Subscription;
|
|
274
|
-
function flattenUnsubscriptionErrors(errors) {
|
|
275
|
-
return errors.reduce(function(errs, err) {
|
|
276
|
-
return errs.concat(err instanceof UnsubscriptionError_1.UnsubscriptionError ? err.errors : err);
|
|
277
|
-
}, []);
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
});
|
|
281
|
-
|
|
282
|
-
// node_modules/rxjs/internal/symbol/rxSubscriber.js
|
|
283
|
-
var require_rxSubscriber = __commonJS({
|
|
284
|
-
"node_modules/rxjs/internal/symbol/rxSubscriber.js"(exports) {
|
|
285
|
-
"use strict";
|
|
286
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
287
|
-
exports.rxSubscriber = function() {
|
|
288
|
-
return typeof Symbol === "function" ? Symbol("rxSubscriber") : "@@rxSubscriber_" + Math.random();
|
|
289
|
-
}();
|
|
290
|
-
exports.$$rxSubscriber = exports.rxSubscriber;
|
|
291
|
-
}
|
|
292
|
-
});
|
|
293
|
-
|
|
294
|
-
// node_modules/rxjs/internal/Subscriber.js
|
|
295
|
-
var require_Subscriber = __commonJS({
|
|
296
|
-
"node_modules/rxjs/internal/Subscriber.js"(exports) {
|
|
297
|
-
"use strict";
|
|
298
|
-
var __extends = exports && exports.__extends || function() {
|
|
299
|
-
var extendStatics = function(d, b) {
|
|
300
|
-
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
|
|
301
|
-
d2.__proto__ = b2;
|
|
302
|
-
} || function(d2, b2) {
|
|
303
|
-
for (var p in b2)
|
|
304
|
-
if (b2.hasOwnProperty(p))
|
|
305
|
-
d2[p] = b2[p];
|
|
306
|
-
};
|
|
307
|
-
return extendStatics(d, b);
|
|
308
|
-
};
|
|
309
|
-
return function(d, b) {
|
|
310
|
-
extendStatics(d, b);
|
|
311
|
-
function __() {
|
|
312
|
-
this.constructor = d;
|
|
313
|
-
}
|
|
314
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
315
|
-
};
|
|
316
|
-
}();
|
|
317
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
318
|
-
var isFunction_1 = require_isFunction();
|
|
319
|
-
var Observer_1 = require_Observer();
|
|
320
|
-
var Subscription_1 = require_Subscription();
|
|
321
|
-
var rxSubscriber_1 = require_rxSubscriber();
|
|
322
|
-
var config_1 = require_config();
|
|
323
|
-
var hostReportError_1 = require_hostReportError();
|
|
324
|
-
var Subscriber = function(_super) {
|
|
325
|
-
__extends(Subscriber2, _super);
|
|
326
|
-
function Subscriber2(destinationOrNext, error, complete) {
|
|
327
|
-
var _this = _super.call(this) || this;
|
|
328
|
-
_this.syncErrorValue = null;
|
|
329
|
-
_this.syncErrorThrown = false;
|
|
330
|
-
_this.syncErrorThrowable = false;
|
|
331
|
-
_this.isStopped = false;
|
|
332
|
-
switch (arguments.length) {
|
|
333
|
-
case 0:
|
|
334
|
-
_this.destination = Observer_1.empty;
|
|
335
|
-
break;
|
|
336
|
-
case 1:
|
|
337
|
-
if (!destinationOrNext) {
|
|
338
|
-
_this.destination = Observer_1.empty;
|
|
339
|
-
break;
|
|
340
|
-
}
|
|
341
|
-
if (typeof destinationOrNext === "object") {
|
|
342
|
-
if (destinationOrNext instanceof Subscriber2) {
|
|
343
|
-
_this.syncErrorThrowable = destinationOrNext.syncErrorThrowable;
|
|
344
|
-
_this.destination = destinationOrNext;
|
|
345
|
-
destinationOrNext.add(_this);
|
|
346
|
-
} else {
|
|
347
|
-
_this.syncErrorThrowable = true;
|
|
348
|
-
_this.destination = new SafeSubscriber(_this, destinationOrNext);
|
|
349
|
-
}
|
|
350
|
-
break;
|
|
351
|
-
}
|
|
352
|
-
default:
|
|
353
|
-
_this.syncErrorThrowable = true;
|
|
354
|
-
_this.destination = new SafeSubscriber(_this, destinationOrNext, error, complete);
|
|
355
|
-
break;
|
|
356
|
-
}
|
|
357
|
-
return _this;
|
|
358
|
-
}
|
|
359
|
-
Subscriber2.prototype[rxSubscriber_1.rxSubscriber] = function() {
|
|
360
|
-
return this;
|
|
361
|
-
};
|
|
362
|
-
Subscriber2.create = function(next, error, complete) {
|
|
363
|
-
var subscriber = new Subscriber2(next, error, complete);
|
|
364
|
-
subscriber.syncErrorThrowable = false;
|
|
365
|
-
return subscriber;
|
|
366
|
-
};
|
|
367
|
-
Subscriber2.prototype.next = function(value) {
|
|
368
|
-
if (!this.isStopped) {
|
|
369
|
-
this._next(value);
|
|
370
|
-
}
|
|
371
|
-
};
|
|
372
|
-
Subscriber2.prototype.error = function(err) {
|
|
373
|
-
if (!this.isStopped) {
|
|
374
|
-
this.isStopped = true;
|
|
375
|
-
this._error(err);
|
|
376
|
-
}
|
|
377
|
-
};
|
|
378
|
-
Subscriber2.prototype.complete = function() {
|
|
379
|
-
if (!this.isStopped) {
|
|
380
|
-
this.isStopped = true;
|
|
381
|
-
this._complete();
|
|
382
|
-
}
|
|
383
|
-
};
|
|
384
|
-
Subscriber2.prototype.unsubscribe = function() {
|
|
385
|
-
if (this.closed) {
|
|
386
|
-
return;
|
|
387
|
-
}
|
|
388
|
-
this.isStopped = true;
|
|
389
|
-
_super.prototype.unsubscribe.call(this);
|
|
390
|
-
};
|
|
391
|
-
Subscriber2.prototype._next = function(value) {
|
|
392
|
-
this.destination.next(value);
|
|
393
|
-
};
|
|
394
|
-
Subscriber2.prototype._error = function(err) {
|
|
395
|
-
this.destination.error(err);
|
|
396
|
-
this.unsubscribe();
|
|
397
|
-
};
|
|
398
|
-
Subscriber2.prototype._complete = function() {
|
|
399
|
-
this.destination.complete();
|
|
400
|
-
this.unsubscribe();
|
|
401
|
-
};
|
|
402
|
-
Subscriber2.prototype._unsubscribeAndRecycle = function() {
|
|
403
|
-
var _parentOrParents = this._parentOrParents;
|
|
404
|
-
this._parentOrParents = null;
|
|
405
|
-
this.unsubscribe();
|
|
406
|
-
this.closed = false;
|
|
407
|
-
this.isStopped = false;
|
|
408
|
-
this._parentOrParents = _parentOrParents;
|
|
409
|
-
return this;
|
|
410
|
-
};
|
|
411
|
-
return Subscriber2;
|
|
412
|
-
}(Subscription_1.Subscription);
|
|
413
|
-
exports.Subscriber = Subscriber;
|
|
414
|
-
var SafeSubscriber = function(_super) {
|
|
415
|
-
__extends(SafeSubscriber2, _super);
|
|
416
|
-
function SafeSubscriber2(_parentSubscriber, observerOrNext, error, complete) {
|
|
417
|
-
var _this = _super.call(this) || this;
|
|
418
|
-
_this._parentSubscriber = _parentSubscriber;
|
|
419
|
-
var next;
|
|
420
|
-
var context = _this;
|
|
421
|
-
if (isFunction_1.isFunction(observerOrNext)) {
|
|
422
|
-
next = observerOrNext;
|
|
423
|
-
} else if (observerOrNext) {
|
|
424
|
-
next = observerOrNext.next;
|
|
425
|
-
error = observerOrNext.error;
|
|
426
|
-
complete = observerOrNext.complete;
|
|
427
|
-
if (observerOrNext !== Observer_1.empty) {
|
|
428
|
-
context = Object.create(observerOrNext);
|
|
429
|
-
if (isFunction_1.isFunction(context.unsubscribe)) {
|
|
430
|
-
_this.add(context.unsubscribe.bind(context));
|
|
431
|
-
}
|
|
432
|
-
context.unsubscribe = _this.unsubscribe.bind(_this);
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
_this._context = context;
|
|
436
|
-
_this._next = next;
|
|
437
|
-
_this._error = error;
|
|
438
|
-
_this._complete = complete;
|
|
439
|
-
return _this;
|
|
440
|
-
}
|
|
441
|
-
SafeSubscriber2.prototype.next = function(value) {
|
|
442
|
-
if (!this.isStopped && this._next) {
|
|
443
|
-
var _parentSubscriber = this._parentSubscriber;
|
|
444
|
-
if (!config_1.config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
|
|
445
|
-
this.__tryOrUnsub(this._next, value);
|
|
446
|
-
} else if (this.__tryOrSetError(_parentSubscriber, this._next, value)) {
|
|
447
|
-
this.unsubscribe();
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
};
|
|
451
|
-
SafeSubscriber2.prototype.error = function(err) {
|
|
452
|
-
if (!this.isStopped) {
|
|
453
|
-
var _parentSubscriber = this._parentSubscriber;
|
|
454
|
-
var useDeprecatedSynchronousErrorHandling = config_1.config.useDeprecatedSynchronousErrorHandling;
|
|
455
|
-
if (this._error) {
|
|
456
|
-
if (!useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
|
|
457
|
-
this.__tryOrUnsub(this._error, err);
|
|
458
|
-
this.unsubscribe();
|
|
459
|
-
} else {
|
|
460
|
-
this.__tryOrSetError(_parentSubscriber, this._error, err);
|
|
461
|
-
this.unsubscribe();
|
|
462
|
-
}
|
|
463
|
-
} else if (!_parentSubscriber.syncErrorThrowable) {
|
|
464
|
-
this.unsubscribe();
|
|
465
|
-
if (useDeprecatedSynchronousErrorHandling) {
|
|
466
|
-
throw err;
|
|
467
|
-
}
|
|
468
|
-
hostReportError_1.hostReportError(err);
|
|
469
|
-
} else {
|
|
470
|
-
if (useDeprecatedSynchronousErrorHandling) {
|
|
471
|
-
_parentSubscriber.syncErrorValue = err;
|
|
472
|
-
_parentSubscriber.syncErrorThrown = true;
|
|
473
|
-
} else {
|
|
474
|
-
hostReportError_1.hostReportError(err);
|
|
475
|
-
}
|
|
476
|
-
this.unsubscribe();
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
};
|
|
480
|
-
SafeSubscriber2.prototype.complete = function() {
|
|
481
|
-
var _this = this;
|
|
482
|
-
if (!this.isStopped) {
|
|
483
|
-
var _parentSubscriber = this._parentSubscriber;
|
|
484
|
-
if (this._complete) {
|
|
485
|
-
var wrappedComplete = function() {
|
|
486
|
-
return _this._complete.call(_this._context);
|
|
487
|
-
};
|
|
488
|
-
if (!config_1.config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
|
|
489
|
-
this.__tryOrUnsub(wrappedComplete);
|
|
490
|
-
this.unsubscribe();
|
|
491
|
-
} else {
|
|
492
|
-
this.__tryOrSetError(_parentSubscriber, wrappedComplete);
|
|
493
|
-
this.unsubscribe();
|
|
494
|
-
}
|
|
495
|
-
} else {
|
|
496
|
-
this.unsubscribe();
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
};
|
|
500
|
-
SafeSubscriber2.prototype.__tryOrUnsub = function(fn, value) {
|
|
501
|
-
try {
|
|
502
|
-
fn.call(this._context, value);
|
|
503
|
-
} catch (err) {
|
|
504
|
-
this.unsubscribe();
|
|
505
|
-
if (config_1.config.useDeprecatedSynchronousErrorHandling) {
|
|
506
|
-
throw err;
|
|
507
|
-
} else {
|
|
508
|
-
hostReportError_1.hostReportError(err);
|
|
509
|
-
}
|
|
510
|
-
}
|
|
511
|
-
};
|
|
512
|
-
SafeSubscriber2.prototype.__tryOrSetError = function(parent, fn, value) {
|
|
513
|
-
if (!config_1.config.useDeprecatedSynchronousErrorHandling) {
|
|
514
|
-
throw new Error("bad call");
|
|
515
|
-
}
|
|
516
|
-
try {
|
|
517
|
-
fn.call(this._context, value);
|
|
518
|
-
} catch (err) {
|
|
519
|
-
if (config_1.config.useDeprecatedSynchronousErrorHandling) {
|
|
520
|
-
parent.syncErrorValue = err;
|
|
521
|
-
parent.syncErrorThrown = true;
|
|
522
|
-
return true;
|
|
523
|
-
} else {
|
|
524
|
-
hostReportError_1.hostReportError(err);
|
|
525
|
-
return true;
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
|
-
return false;
|
|
529
|
-
};
|
|
530
|
-
SafeSubscriber2.prototype._unsubscribe = function() {
|
|
531
|
-
var _parentSubscriber = this._parentSubscriber;
|
|
532
|
-
this._context = null;
|
|
533
|
-
this._parentSubscriber = null;
|
|
534
|
-
_parentSubscriber.unsubscribe();
|
|
535
|
-
};
|
|
536
|
-
return SafeSubscriber2;
|
|
537
|
-
}(Subscriber);
|
|
538
|
-
exports.SafeSubscriber = SafeSubscriber;
|
|
539
|
-
}
|
|
540
|
-
});
|
|
541
|
-
|
|
542
|
-
// node_modules/rxjs/internal/util/canReportError.js
|
|
543
|
-
var require_canReportError = __commonJS({
|
|
544
|
-
"node_modules/rxjs/internal/util/canReportError.js"(exports) {
|
|
545
|
-
"use strict";
|
|
546
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
547
|
-
var Subscriber_1 = require_Subscriber();
|
|
548
|
-
function canReportError(observer) {
|
|
549
|
-
while (observer) {
|
|
550
|
-
var _a = observer, closed_1 = _a.closed, destination = _a.destination, isStopped = _a.isStopped;
|
|
551
|
-
if (closed_1 || isStopped) {
|
|
552
|
-
return false;
|
|
553
|
-
} else if (destination && destination instanceof Subscriber_1.Subscriber) {
|
|
554
|
-
observer = destination;
|
|
555
|
-
} else {
|
|
556
|
-
observer = null;
|
|
557
|
-
}
|
|
558
|
-
}
|
|
559
|
-
return true;
|
|
560
|
-
}
|
|
561
|
-
exports.canReportError = canReportError;
|
|
562
|
-
}
|
|
563
|
-
});
|
|
564
|
-
|
|
565
|
-
// node_modules/rxjs/internal/util/toSubscriber.js
|
|
566
|
-
var require_toSubscriber = __commonJS({
|
|
567
|
-
"node_modules/rxjs/internal/util/toSubscriber.js"(exports) {
|
|
568
|
-
"use strict";
|
|
569
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
570
|
-
var Subscriber_1 = require_Subscriber();
|
|
571
|
-
var rxSubscriber_1 = require_rxSubscriber();
|
|
572
|
-
var Observer_1 = require_Observer();
|
|
573
|
-
function toSubscriber(nextOrObserver, error, complete) {
|
|
574
|
-
if (nextOrObserver) {
|
|
575
|
-
if (nextOrObserver instanceof Subscriber_1.Subscriber) {
|
|
576
|
-
return nextOrObserver;
|
|
577
|
-
}
|
|
578
|
-
if (nextOrObserver[rxSubscriber_1.rxSubscriber]) {
|
|
579
|
-
return nextOrObserver[rxSubscriber_1.rxSubscriber]();
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
if (!nextOrObserver && !error && !complete) {
|
|
583
|
-
return new Subscriber_1.Subscriber(Observer_1.empty);
|
|
584
|
-
}
|
|
585
|
-
return new Subscriber_1.Subscriber(nextOrObserver, error, complete);
|
|
586
|
-
}
|
|
587
|
-
exports.toSubscriber = toSubscriber;
|
|
588
|
-
}
|
|
589
|
-
});
|
|
590
|
-
|
|
591
|
-
// node_modules/rxjs/internal/symbol/observable.js
|
|
592
|
-
var require_observable = __commonJS({
|
|
593
|
-
"node_modules/rxjs/internal/symbol/observable.js"(exports) {
|
|
594
|
-
"use strict";
|
|
595
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
596
|
-
exports.observable = function() {
|
|
597
|
-
return typeof Symbol === "function" && Symbol.observable || "@@observable";
|
|
598
|
-
}();
|
|
599
|
-
}
|
|
600
|
-
});
|
|
601
|
-
|
|
602
|
-
// node_modules/rxjs/internal/util/identity.js
|
|
603
|
-
var require_identity = __commonJS({
|
|
604
|
-
"node_modules/rxjs/internal/util/identity.js"(exports) {
|
|
605
|
-
"use strict";
|
|
606
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
607
|
-
function identity(x) {
|
|
608
|
-
return x;
|
|
609
|
-
}
|
|
610
|
-
exports.identity = identity;
|
|
611
|
-
}
|
|
612
|
-
});
|
|
613
|
-
|
|
614
|
-
// node_modules/rxjs/internal/util/pipe.js
|
|
615
|
-
var require_pipe = __commonJS({
|
|
616
|
-
"node_modules/rxjs/internal/util/pipe.js"(exports) {
|
|
617
|
-
"use strict";
|
|
618
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
619
|
-
var identity_1 = require_identity();
|
|
620
|
-
function pipe() {
|
|
621
|
-
var fns = [];
|
|
622
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
623
|
-
fns[_i] = arguments[_i];
|
|
624
|
-
}
|
|
625
|
-
return pipeFromArray(fns);
|
|
626
|
-
}
|
|
627
|
-
exports.pipe = pipe;
|
|
628
|
-
function pipeFromArray(fns) {
|
|
629
|
-
if (fns.length === 0) {
|
|
630
|
-
return identity_1.identity;
|
|
631
|
-
}
|
|
632
|
-
if (fns.length === 1) {
|
|
633
|
-
return fns[0];
|
|
634
|
-
}
|
|
635
|
-
return function piped(input) {
|
|
636
|
-
return fns.reduce(function(prev, fn) {
|
|
637
|
-
return fn(prev);
|
|
638
|
-
}, input);
|
|
639
|
-
};
|
|
640
|
-
}
|
|
641
|
-
exports.pipeFromArray = pipeFromArray;
|
|
642
|
-
}
|
|
643
|
-
});
|
|
644
|
-
|
|
645
|
-
// node_modules/rxjs/internal/Observable.js
|
|
646
|
-
var require_Observable = __commonJS({
|
|
647
|
-
"node_modules/rxjs/internal/Observable.js"(exports) {
|
|
648
|
-
"use strict";
|
|
649
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
650
|
-
var canReportError_1 = require_canReportError();
|
|
651
|
-
var toSubscriber_1 = require_toSubscriber();
|
|
652
|
-
var observable_1 = require_observable();
|
|
653
|
-
var pipe_1 = require_pipe();
|
|
654
|
-
var config_1 = require_config();
|
|
655
|
-
var Observable2 = function() {
|
|
656
|
-
function Observable3(subscribe) {
|
|
657
|
-
this._isScalar = false;
|
|
658
|
-
if (subscribe) {
|
|
659
|
-
this._subscribe = subscribe;
|
|
660
|
-
}
|
|
661
|
-
}
|
|
662
|
-
Observable3.prototype.lift = function(operator) {
|
|
663
|
-
var observable2 = new Observable3();
|
|
664
|
-
observable2.source = this;
|
|
665
|
-
observable2.operator = operator;
|
|
666
|
-
return observable2;
|
|
667
|
-
};
|
|
668
|
-
Observable3.prototype.subscribe = function(observerOrNext, error, complete) {
|
|
669
|
-
var operator = this.operator;
|
|
670
|
-
var sink = toSubscriber_1.toSubscriber(observerOrNext, error, complete);
|
|
671
|
-
if (operator) {
|
|
672
|
-
sink.add(operator.call(sink, this.source));
|
|
673
|
-
} else {
|
|
674
|
-
sink.add(this.source || config_1.config.useDeprecatedSynchronousErrorHandling && !sink.syncErrorThrowable ? this._subscribe(sink) : this._trySubscribe(sink));
|
|
675
|
-
}
|
|
676
|
-
if (config_1.config.useDeprecatedSynchronousErrorHandling) {
|
|
677
|
-
if (sink.syncErrorThrowable) {
|
|
678
|
-
sink.syncErrorThrowable = false;
|
|
679
|
-
if (sink.syncErrorThrown) {
|
|
680
|
-
throw sink.syncErrorValue;
|
|
681
|
-
}
|
|
682
|
-
}
|
|
683
|
-
}
|
|
684
|
-
return sink;
|
|
685
|
-
};
|
|
686
|
-
Observable3.prototype._trySubscribe = function(sink) {
|
|
687
|
-
try {
|
|
688
|
-
return this._subscribe(sink);
|
|
689
|
-
} catch (err) {
|
|
690
|
-
if (config_1.config.useDeprecatedSynchronousErrorHandling) {
|
|
691
|
-
sink.syncErrorThrown = true;
|
|
692
|
-
sink.syncErrorValue = err;
|
|
693
|
-
}
|
|
694
|
-
if (canReportError_1.canReportError(sink)) {
|
|
695
|
-
sink.error(err);
|
|
696
|
-
} else {
|
|
697
|
-
console.warn(err);
|
|
698
|
-
}
|
|
699
|
-
}
|
|
700
|
-
};
|
|
701
|
-
Observable3.prototype.forEach = function(next, promiseCtor) {
|
|
702
|
-
var _this = this;
|
|
703
|
-
promiseCtor = getPromiseCtor(promiseCtor);
|
|
704
|
-
return new promiseCtor(function(resolve, reject) {
|
|
705
|
-
var subscription;
|
|
706
|
-
subscription = _this.subscribe(function(value) {
|
|
707
|
-
try {
|
|
708
|
-
next(value);
|
|
709
|
-
} catch (err) {
|
|
710
|
-
reject(err);
|
|
711
|
-
if (subscription) {
|
|
712
|
-
subscription.unsubscribe();
|
|
713
|
-
}
|
|
714
|
-
}
|
|
715
|
-
}, reject, resolve);
|
|
716
|
-
});
|
|
717
|
-
};
|
|
718
|
-
Observable3.prototype._subscribe = function(subscriber) {
|
|
719
|
-
var source = this.source;
|
|
720
|
-
return source && source.subscribe(subscriber);
|
|
721
|
-
};
|
|
722
|
-
Observable3.prototype[observable_1.observable] = function() {
|
|
723
|
-
return this;
|
|
724
|
-
};
|
|
725
|
-
Observable3.prototype.pipe = function() {
|
|
726
|
-
var operations = [];
|
|
727
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
728
|
-
operations[_i] = arguments[_i];
|
|
729
|
-
}
|
|
730
|
-
if (operations.length === 0) {
|
|
731
|
-
return this;
|
|
732
|
-
}
|
|
733
|
-
return pipe_1.pipeFromArray(operations)(this);
|
|
734
|
-
};
|
|
735
|
-
Observable3.prototype.toPromise = function(promiseCtor) {
|
|
736
|
-
var _this = this;
|
|
737
|
-
promiseCtor = getPromiseCtor(promiseCtor);
|
|
738
|
-
return new promiseCtor(function(resolve, reject) {
|
|
739
|
-
var value;
|
|
740
|
-
_this.subscribe(function(x) {
|
|
741
|
-
return value = x;
|
|
742
|
-
}, function(err) {
|
|
743
|
-
return reject(err);
|
|
744
|
-
}, function() {
|
|
745
|
-
return resolve(value);
|
|
746
|
-
});
|
|
747
|
-
});
|
|
748
|
-
};
|
|
749
|
-
Observable3.create = function(subscribe) {
|
|
750
|
-
return new Observable3(subscribe);
|
|
751
|
-
};
|
|
752
|
-
return Observable3;
|
|
753
|
-
}();
|
|
754
|
-
exports.Observable = Observable2;
|
|
755
|
-
function getPromiseCtor(promiseCtor) {
|
|
756
|
-
if (!promiseCtor) {
|
|
757
|
-
promiseCtor = config_1.config.Promise || Promise;
|
|
758
|
-
}
|
|
759
|
-
if (!promiseCtor) {
|
|
760
|
-
throw new Error("no Promise impl found");
|
|
761
|
-
}
|
|
762
|
-
return promiseCtor;
|
|
763
|
-
}
|
|
764
|
-
}
|
|
765
|
-
});
|
|
766
|
-
|
|
767
|
-
// node_modules/rxjs/internal/operators/filter.js
|
|
768
|
-
var require_filter = __commonJS({
|
|
769
|
-
"node_modules/rxjs/internal/operators/filter.js"(exports) {
|
|
770
|
-
"use strict";
|
|
771
|
-
var __extends = exports && exports.__extends || function() {
|
|
772
|
-
var extendStatics = function(d, b) {
|
|
773
|
-
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
|
|
774
|
-
d2.__proto__ = b2;
|
|
775
|
-
} || function(d2, b2) {
|
|
776
|
-
for (var p in b2)
|
|
777
|
-
if (b2.hasOwnProperty(p))
|
|
778
|
-
d2[p] = b2[p];
|
|
779
|
-
};
|
|
780
|
-
return extendStatics(d, b);
|
|
781
|
-
};
|
|
782
|
-
return function(d, b) {
|
|
783
|
-
extendStatics(d, b);
|
|
784
|
-
function __() {
|
|
785
|
-
this.constructor = d;
|
|
786
|
-
}
|
|
787
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
788
|
-
};
|
|
789
|
-
}();
|
|
790
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
791
|
-
var Subscriber_1 = require_Subscriber();
|
|
792
|
-
function filter2(predicate, thisArg) {
|
|
793
|
-
return function filterOperatorFunction(source) {
|
|
794
|
-
return source.lift(new FilterOperator(predicate, thisArg));
|
|
795
|
-
};
|
|
796
|
-
}
|
|
797
|
-
exports.filter = filter2;
|
|
798
|
-
var FilterOperator = function() {
|
|
799
|
-
function FilterOperator2(predicate, thisArg) {
|
|
800
|
-
this.predicate = predicate;
|
|
801
|
-
this.thisArg = thisArg;
|
|
802
|
-
}
|
|
803
|
-
FilterOperator2.prototype.call = function(subscriber, source) {
|
|
804
|
-
return source.subscribe(new FilterSubscriber(subscriber, this.predicate, this.thisArg));
|
|
805
|
-
};
|
|
806
|
-
return FilterOperator2;
|
|
807
|
-
}();
|
|
808
|
-
var FilterSubscriber = function(_super) {
|
|
809
|
-
__extends(FilterSubscriber2, _super);
|
|
810
|
-
function FilterSubscriber2(destination, predicate, thisArg) {
|
|
811
|
-
var _this = _super.call(this, destination) || this;
|
|
812
|
-
_this.predicate = predicate;
|
|
813
|
-
_this.thisArg = thisArg;
|
|
814
|
-
_this.count = 0;
|
|
815
|
-
return _this;
|
|
816
|
-
}
|
|
817
|
-
FilterSubscriber2.prototype._next = function(value) {
|
|
818
|
-
var result;
|
|
819
|
-
try {
|
|
820
|
-
result = this.predicate.call(this.thisArg, value, this.count++);
|
|
821
|
-
} catch (err) {
|
|
822
|
-
this.destination.error(err);
|
|
823
|
-
return;
|
|
824
|
-
}
|
|
825
|
-
if (result) {
|
|
826
|
-
this.destination.next(value);
|
|
827
|
-
}
|
|
828
|
-
};
|
|
829
|
-
return FilterSubscriber2;
|
|
830
|
-
}(Subscriber_1.Subscriber);
|
|
831
|
-
}
|
|
832
|
-
});
|
|
833
|
-
|
|
834
|
-
// node_modules/rxjs/internal/operators/map.js
|
|
835
|
-
var require_map = __commonJS({
|
|
836
|
-
"node_modules/rxjs/internal/operators/map.js"(exports) {
|
|
837
|
-
"use strict";
|
|
838
|
-
var __extends = exports && exports.__extends || function() {
|
|
839
|
-
var extendStatics = function(d, b) {
|
|
840
|
-
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
|
|
841
|
-
d2.__proto__ = b2;
|
|
842
|
-
} || function(d2, b2) {
|
|
843
|
-
for (var p in b2)
|
|
844
|
-
if (b2.hasOwnProperty(p))
|
|
845
|
-
d2[p] = b2[p];
|
|
846
|
-
};
|
|
847
|
-
return extendStatics(d, b);
|
|
848
|
-
};
|
|
849
|
-
return function(d, b) {
|
|
850
|
-
extendStatics(d, b);
|
|
851
|
-
function __() {
|
|
852
|
-
this.constructor = d;
|
|
853
|
-
}
|
|
854
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
855
|
-
};
|
|
856
|
-
}();
|
|
857
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
858
|
-
var Subscriber_1 = require_Subscriber();
|
|
859
|
-
function map2(project, thisArg) {
|
|
860
|
-
return function mapOperation(source) {
|
|
861
|
-
if (typeof project !== "function") {
|
|
862
|
-
throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");
|
|
863
|
-
}
|
|
864
|
-
return source.lift(new MapOperator(project, thisArg));
|
|
865
|
-
};
|
|
866
|
-
}
|
|
867
|
-
exports.map = map2;
|
|
868
|
-
var MapOperator = function() {
|
|
869
|
-
function MapOperator2(project, thisArg) {
|
|
870
|
-
this.project = project;
|
|
871
|
-
this.thisArg = thisArg;
|
|
872
|
-
}
|
|
873
|
-
MapOperator2.prototype.call = function(subscriber, source) {
|
|
874
|
-
return source.subscribe(new MapSubscriber(subscriber, this.project, this.thisArg));
|
|
875
|
-
};
|
|
876
|
-
return MapOperator2;
|
|
877
|
-
}();
|
|
878
|
-
exports.MapOperator = MapOperator;
|
|
879
|
-
var MapSubscriber = function(_super) {
|
|
880
|
-
__extends(MapSubscriber2, _super);
|
|
881
|
-
function MapSubscriber2(destination, project, thisArg) {
|
|
882
|
-
var _this = _super.call(this, destination) || this;
|
|
883
|
-
_this.project = project;
|
|
884
|
-
_this.count = 0;
|
|
885
|
-
_this.thisArg = thisArg || _this;
|
|
886
|
-
return _this;
|
|
887
|
-
}
|
|
888
|
-
MapSubscriber2.prototype._next = function(value) {
|
|
889
|
-
var result;
|
|
890
|
-
try {
|
|
891
|
-
result = this.project.call(this.thisArg, value, this.count++);
|
|
892
|
-
} catch (err) {
|
|
893
|
-
this.destination.error(err);
|
|
894
|
-
return;
|
|
895
|
-
}
|
|
896
|
-
this.destination.next(result);
|
|
897
|
-
};
|
|
898
|
-
return MapSubscriber2;
|
|
899
|
-
}(Subscriber_1.Subscriber);
|
|
900
|
-
}
|
|
901
|
-
});
|
|
902
|
-
|
|
903
23
|
// node_modules/event-source-polyfill/src/eventsource.js
|
|
904
24
|
var require_eventsource = __commonJS({
|
|
905
25
|
"node_modules/event-source-polyfill/src/eventsource.js"(exports, module) {
|
|
@@ -1937,11 +1057,6 @@ var require_make_error = __commonJS({
|
|
|
1937
1057
|
}
|
|
1938
1058
|
});
|
|
1939
1059
|
|
|
1940
|
-
// src/util/observable.js
|
|
1941
|
-
var import_Observable = __toESM(require_Observable());
|
|
1942
|
-
var import_filter = __toESM(require_filter());
|
|
1943
|
-
var import_map = __toESM(require_map());
|
|
1944
|
-
|
|
1945
1060
|
// src/util/getSelection.js
|
|
1946
1061
|
function getSelection(sel) {
|
|
1947
1062
|
if (typeof sel === "string" || Array.isArray(sel)) {
|
|
@@ -2009,11 +1124,11 @@ var validateInsert = (at, selector, items) => {
|
|
|
2009
1124
|
throw new Error(`${signature} takes an "items"-argument which must be an array`);
|
|
2010
1125
|
}
|
|
2011
1126
|
};
|
|
2012
|
-
var hasDataset = (
|
|
2013
|
-
if (!
|
|
1127
|
+
var hasDataset = (config2) => {
|
|
1128
|
+
if (!config2.dataset) {
|
|
2014
1129
|
throw new Error("`dataset` must be provided to perform queries");
|
|
2015
1130
|
}
|
|
2016
|
-
return
|
|
1131
|
+
return config2.dataset || "";
|
|
2017
1132
|
};
|
|
2018
1133
|
var requestTag = (tag) => {
|
|
2019
1134
|
if (typeof tag !== "string" || !/^[a-z0-9._-]{1,75}$/i.test(tag)) {
|
|
@@ -2230,6 +1345,740 @@ var defaults_default = (obj, defaults) => Object.keys(defaults).concat(Object.ke
|
|
|
2230
1345
|
return target;
|
|
2231
1346
|
}, {});
|
|
2232
1347
|
|
|
1348
|
+
// node_modules/tslib/tslib.es6.js
|
|
1349
|
+
var extendStatics = function(d, b) {
|
|
1350
|
+
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
|
|
1351
|
+
d2.__proto__ = b2;
|
|
1352
|
+
} || function(d2, b2) {
|
|
1353
|
+
for (var p in b2)
|
|
1354
|
+
if (Object.prototype.hasOwnProperty.call(b2, p))
|
|
1355
|
+
d2[p] = b2[p];
|
|
1356
|
+
};
|
|
1357
|
+
return extendStatics(d, b);
|
|
1358
|
+
};
|
|
1359
|
+
function __extends(d, b) {
|
|
1360
|
+
if (typeof b !== "function" && b !== null)
|
|
1361
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
1362
|
+
extendStatics(d, b);
|
|
1363
|
+
function __() {
|
|
1364
|
+
this.constructor = d;
|
|
1365
|
+
}
|
|
1366
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
1367
|
+
}
|
|
1368
|
+
function __values(o) {
|
|
1369
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
1370
|
+
if (m)
|
|
1371
|
+
return m.call(o);
|
|
1372
|
+
if (o && typeof o.length === "number")
|
|
1373
|
+
return {
|
|
1374
|
+
next: function() {
|
|
1375
|
+
if (o && i >= o.length)
|
|
1376
|
+
o = void 0;
|
|
1377
|
+
return { value: o && o[i++], done: !o };
|
|
1378
|
+
}
|
|
1379
|
+
};
|
|
1380
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
1381
|
+
}
|
|
1382
|
+
function __read(o, n) {
|
|
1383
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
1384
|
+
if (!m)
|
|
1385
|
+
return o;
|
|
1386
|
+
var i = m.call(o), r, ar = [], e;
|
|
1387
|
+
try {
|
|
1388
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
1389
|
+
ar.push(r.value);
|
|
1390
|
+
} catch (error) {
|
|
1391
|
+
e = { error };
|
|
1392
|
+
} finally {
|
|
1393
|
+
try {
|
|
1394
|
+
if (r && !r.done && (m = i["return"]))
|
|
1395
|
+
m.call(i);
|
|
1396
|
+
} finally {
|
|
1397
|
+
if (e)
|
|
1398
|
+
throw e.error;
|
|
1399
|
+
}
|
|
1400
|
+
}
|
|
1401
|
+
return ar;
|
|
1402
|
+
}
|
|
1403
|
+
function __spreadArray(to, from, pack) {
|
|
1404
|
+
if (pack || arguments.length === 2)
|
|
1405
|
+
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
1406
|
+
if (ar || !(i in from)) {
|
|
1407
|
+
if (!ar)
|
|
1408
|
+
ar = Array.prototype.slice.call(from, 0, i);
|
|
1409
|
+
ar[i] = from[i];
|
|
1410
|
+
}
|
|
1411
|
+
}
|
|
1412
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
// node_modules/rxjs/dist/esm5/internal/util/isFunction.js
|
|
1416
|
+
function isFunction(value) {
|
|
1417
|
+
return typeof value === "function";
|
|
1418
|
+
}
|
|
1419
|
+
|
|
1420
|
+
// node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js
|
|
1421
|
+
function createErrorClass(createImpl) {
|
|
1422
|
+
var _super = function(instance) {
|
|
1423
|
+
Error.call(instance);
|
|
1424
|
+
instance.stack = new Error().stack;
|
|
1425
|
+
};
|
|
1426
|
+
var ctorFunc = createImpl(_super);
|
|
1427
|
+
ctorFunc.prototype = Object.create(Error.prototype);
|
|
1428
|
+
ctorFunc.prototype.constructor = ctorFunc;
|
|
1429
|
+
return ctorFunc;
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1432
|
+
// node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js
|
|
1433
|
+
var UnsubscriptionError = createErrorClass(function(_super) {
|
|
1434
|
+
return function UnsubscriptionErrorImpl(errors) {
|
|
1435
|
+
_super(this);
|
|
1436
|
+
this.message = errors ? errors.length + " errors occurred during unsubscription:\n" + errors.map(function(err, i) {
|
|
1437
|
+
return i + 1 + ") " + err.toString();
|
|
1438
|
+
}).join("\n ") : "";
|
|
1439
|
+
this.name = "UnsubscriptionError";
|
|
1440
|
+
this.errors = errors;
|
|
1441
|
+
};
|
|
1442
|
+
});
|
|
1443
|
+
|
|
1444
|
+
// node_modules/rxjs/dist/esm5/internal/util/arrRemove.js
|
|
1445
|
+
function arrRemove(arr, item) {
|
|
1446
|
+
if (arr) {
|
|
1447
|
+
var index = arr.indexOf(item);
|
|
1448
|
+
0 <= index && arr.splice(index, 1);
|
|
1449
|
+
}
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1452
|
+
// node_modules/rxjs/dist/esm5/internal/Subscription.js
|
|
1453
|
+
var Subscription = function() {
|
|
1454
|
+
function Subscription2(initialTeardown) {
|
|
1455
|
+
this.initialTeardown = initialTeardown;
|
|
1456
|
+
this.closed = false;
|
|
1457
|
+
this._parentage = null;
|
|
1458
|
+
this._finalizers = null;
|
|
1459
|
+
}
|
|
1460
|
+
Subscription2.prototype.unsubscribe = function() {
|
|
1461
|
+
var e_1, _a, e_2, _b;
|
|
1462
|
+
var errors;
|
|
1463
|
+
if (!this.closed) {
|
|
1464
|
+
this.closed = true;
|
|
1465
|
+
var _parentage = this._parentage;
|
|
1466
|
+
if (_parentage) {
|
|
1467
|
+
this._parentage = null;
|
|
1468
|
+
if (Array.isArray(_parentage)) {
|
|
1469
|
+
try {
|
|
1470
|
+
for (var _parentage_1 = __values(_parentage), _parentage_1_1 = _parentage_1.next(); !_parentage_1_1.done; _parentage_1_1 = _parentage_1.next()) {
|
|
1471
|
+
var parent_1 = _parentage_1_1.value;
|
|
1472
|
+
parent_1.remove(this);
|
|
1473
|
+
}
|
|
1474
|
+
} catch (e_1_1) {
|
|
1475
|
+
e_1 = { error: e_1_1 };
|
|
1476
|
+
} finally {
|
|
1477
|
+
try {
|
|
1478
|
+
if (_parentage_1_1 && !_parentage_1_1.done && (_a = _parentage_1.return))
|
|
1479
|
+
_a.call(_parentage_1);
|
|
1480
|
+
} finally {
|
|
1481
|
+
if (e_1)
|
|
1482
|
+
throw e_1.error;
|
|
1483
|
+
}
|
|
1484
|
+
}
|
|
1485
|
+
} else {
|
|
1486
|
+
_parentage.remove(this);
|
|
1487
|
+
}
|
|
1488
|
+
}
|
|
1489
|
+
var initialFinalizer = this.initialTeardown;
|
|
1490
|
+
if (isFunction(initialFinalizer)) {
|
|
1491
|
+
try {
|
|
1492
|
+
initialFinalizer();
|
|
1493
|
+
} catch (e) {
|
|
1494
|
+
errors = e instanceof UnsubscriptionError ? e.errors : [e];
|
|
1495
|
+
}
|
|
1496
|
+
}
|
|
1497
|
+
var _finalizers = this._finalizers;
|
|
1498
|
+
if (_finalizers) {
|
|
1499
|
+
this._finalizers = null;
|
|
1500
|
+
try {
|
|
1501
|
+
for (var _finalizers_1 = __values(_finalizers), _finalizers_1_1 = _finalizers_1.next(); !_finalizers_1_1.done; _finalizers_1_1 = _finalizers_1.next()) {
|
|
1502
|
+
var finalizer = _finalizers_1_1.value;
|
|
1503
|
+
try {
|
|
1504
|
+
execFinalizer(finalizer);
|
|
1505
|
+
} catch (err) {
|
|
1506
|
+
errors = errors !== null && errors !== void 0 ? errors : [];
|
|
1507
|
+
if (err instanceof UnsubscriptionError) {
|
|
1508
|
+
errors = __spreadArray(__spreadArray([], __read(errors)), __read(err.errors));
|
|
1509
|
+
} else {
|
|
1510
|
+
errors.push(err);
|
|
1511
|
+
}
|
|
1512
|
+
}
|
|
1513
|
+
}
|
|
1514
|
+
} catch (e_2_1) {
|
|
1515
|
+
e_2 = { error: e_2_1 };
|
|
1516
|
+
} finally {
|
|
1517
|
+
try {
|
|
1518
|
+
if (_finalizers_1_1 && !_finalizers_1_1.done && (_b = _finalizers_1.return))
|
|
1519
|
+
_b.call(_finalizers_1);
|
|
1520
|
+
} finally {
|
|
1521
|
+
if (e_2)
|
|
1522
|
+
throw e_2.error;
|
|
1523
|
+
}
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1526
|
+
if (errors) {
|
|
1527
|
+
throw new UnsubscriptionError(errors);
|
|
1528
|
+
}
|
|
1529
|
+
}
|
|
1530
|
+
};
|
|
1531
|
+
Subscription2.prototype.add = function(teardown) {
|
|
1532
|
+
var _a;
|
|
1533
|
+
if (teardown && teardown !== this) {
|
|
1534
|
+
if (this.closed) {
|
|
1535
|
+
execFinalizer(teardown);
|
|
1536
|
+
} else {
|
|
1537
|
+
if (teardown instanceof Subscription2) {
|
|
1538
|
+
if (teardown.closed || teardown._hasParent(this)) {
|
|
1539
|
+
return;
|
|
1540
|
+
}
|
|
1541
|
+
teardown._addParent(this);
|
|
1542
|
+
}
|
|
1543
|
+
(this._finalizers = (_a = this._finalizers) !== null && _a !== void 0 ? _a : []).push(teardown);
|
|
1544
|
+
}
|
|
1545
|
+
}
|
|
1546
|
+
};
|
|
1547
|
+
Subscription2.prototype._hasParent = function(parent) {
|
|
1548
|
+
var _parentage = this._parentage;
|
|
1549
|
+
return _parentage === parent || Array.isArray(_parentage) && _parentage.includes(parent);
|
|
1550
|
+
};
|
|
1551
|
+
Subscription2.prototype._addParent = function(parent) {
|
|
1552
|
+
var _parentage = this._parentage;
|
|
1553
|
+
this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;
|
|
1554
|
+
};
|
|
1555
|
+
Subscription2.prototype._removeParent = function(parent) {
|
|
1556
|
+
var _parentage = this._parentage;
|
|
1557
|
+
if (_parentage === parent) {
|
|
1558
|
+
this._parentage = null;
|
|
1559
|
+
} else if (Array.isArray(_parentage)) {
|
|
1560
|
+
arrRemove(_parentage, parent);
|
|
1561
|
+
}
|
|
1562
|
+
};
|
|
1563
|
+
Subscription2.prototype.remove = function(teardown) {
|
|
1564
|
+
var _finalizers = this._finalizers;
|
|
1565
|
+
_finalizers && arrRemove(_finalizers, teardown);
|
|
1566
|
+
if (teardown instanceof Subscription2) {
|
|
1567
|
+
teardown._removeParent(this);
|
|
1568
|
+
}
|
|
1569
|
+
};
|
|
1570
|
+
Subscription2.EMPTY = function() {
|
|
1571
|
+
var empty = new Subscription2();
|
|
1572
|
+
empty.closed = true;
|
|
1573
|
+
return empty;
|
|
1574
|
+
}();
|
|
1575
|
+
return Subscription2;
|
|
1576
|
+
}();
|
|
1577
|
+
var EMPTY_SUBSCRIPTION = Subscription.EMPTY;
|
|
1578
|
+
function isSubscription(value) {
|
|
1579
|
+
return value instanceof Subscription || value && "closed" in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe);
|
|
1580
|
+
}
|
|
1581
|
+
function execFinalizer(finalizer) {
|
|
1582
|
+
if (isFunction(finalizer)) {
|
|
1583
|
+
finalizer();
|
|
1584
|
+
} else {
|
|
1585
|
+
finalizer.unsubscribe();
|
|
1586
|
+
}
|
|
1587
|
+
}
|
|
1588
|
+
|
|
1589
|
+
// node_modules/rxjs/dist/esm5/internal/config.js
|
|
1590
|
+
var config = {
|
|
1591
|
+
onUnhandledError: null,
|
|
1592
|
+
onStoppedNotification: null,
|
|
1593
|
+
Promise: void 0,
|
|
1594
|
+
useDeprecatedSynchronousErrorHandling: false,
|
|
1595
|
+
useDeprecatedNextContext: false
|
|
1596
|
+
};
|
|
1597
|
+
|
|
1598
|
+
// node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js
|
|
1599
|
+
var timeoutProvider = {
|
|
1600
|
+
setTimeout: function(handler, timeout) {
|
|
1601
|
+
var args = [];
|
|
1602
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
1603
|
+
args[_i - 2] = arguments[_i];
|
|
1604
|
+
}
|
|
1605
|
+
var delegate = timeoutProvider.delegate;
|
|
1606
|
+
if (delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) {
|
|
1607
|
+
return delegate.setTimeout.apply(delegate, __spreadArray([handler, timeout], __read(args)));
|
|
1608
|
+
}
|
|
1609
|
+
return setTimeout.apply(void 0, __spreadArray([handler, timeout], __read(args)));
|
|
1610
|
+
},
|
|
1611
|
+
clearTimeout: function(handle) {
|
|
1612
|
+
var delegate = timeoutProvider.delegate;
|
|
1613
|
+
return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearTimeout) || clearTimeout)(handle);
|
|
1614
|
+
},
|
|
1615
|
+
delegate: void 0
|
|
1616
|
+
};
|
|
1617
|
+
|
|
1618
|
+
// node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js
|
|
1619
|
+
function reportUnhandledError(err) {
|
|
1620
|
+
timeoutProvider.setTimeout(function() {
|
|
1621
|
+
var onUnhandledError = config.onUnhandledError;
|
|
1622
|
+
if (onUnhandledError) {
|
|
1623
|
+
onUnhandledError(err);
|
|
1624
|
+
} else {
|
|
1625
|
+
throw err;
|
|
1626
|
+
}
|
|
1627
|
+
});
|
|
1628
|
+
}
|
|
1629
|
+
|
|
1630
|
+
// node_modules/rxjs/dist/esm5/internal/util/noop.js
|
|
1631
|
+
function noop() {
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1634
|
+
// node_modules/rxjs/dist/esm5/internal/NotificationFactories.js
|
|
1635
|
+
var COMPLETE_NOTIFICATION = function() {
|
|
1636
|
+
return createNotification("C", void 0, void 0);
|
|
1637
|
+
}();
|
|
1638
|
+
function errorNotification(error) {
|
|
1639
|
+
return createNotification("E", void 0, error);
|
|
1640
|
+
}
|
|
1641
|
+
function nextNotification(value) {
|
|
1642
|
+
return createNotification("N", value, void 0);
|
|
1643
|
+
}
|
|
1644
|
+
function createNotification(kind, value, error) {
|
|
1645
|
+
return {
|
|
1646
|
+
kind,
|
|
1647
|
+
value,
|
|
1648
|
+
error
|
|
1649
|
+
};
|
|
1650
|
+
}
|
|
1651
|
+
|
|
1652
|
+
// node_modules/rxjs/dist/esm5/internal/util/errorContext.js
|
|
1653
|
+
var context = null;
|
|
1654
|
+
function errorContext(cb) {
|
|
1655
|
+
if (config.useDeprecatedSynchronousErrorHandling) {
|
|
1656
|
+
var isRoot = !context;
|
|
1657
|
+
if (isRoot) {
|
|
1658
|
+
context = { errorThrown: false, error: null };
|
|
1659
|
+
}
|
|
1660
|
+
cb();
|
|
1661
|
+
if (isRoot) {
|
|
1662
|
+
var _a = context, errorThrown = _a.errorThrown, error = _a.error;
|
|
1663
|
+
context = null;
|
|
1664
|
+
if (errorThrown) {
|
|
1665
|
+
throw error;
|
|
1666
|
+
}
|
|
1667
|
+
}
|
|
1668
|
+
} else {
|
|
1669
|
+
cb();
|
|
1670
|
+
}
|
|
1671
|
+
}
|
|
1672
|
+
function captureError(err) {
|
|
1673
|
+
if (config.useDeprecatedSynchronousErrorHandling && context) {
|
|
1674
|
+
context.errorThrown = true;
|
|
1675
|
+
context.error = err;
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
|
|
1679
|
+
// node_modules/rxjs/dist/esm5/internal/Subscriber.js
|
|
1680
|
+
var Subscriber = function(_super) {
|
|
1681
|
+
__extends(Subscriber2, _super);
|
|
1682
|
+
function Subscriber2(destination) {
|
|
1683
|
+
var _this = _super.call(this) || this;
|
|
1684
|
+
_this.isStopped = false;
|
|
1685
|
+
if (destination) {
|
|
1686
|
+
_this.destination = destination;
|
|
1687
|
+
if (isSubscription(destination)) {
|
|
1688
|
+
destination.add(_this);
|
|
1689
|
+
}
|
|
1690
|
+
} else {
|
|
1691
|
+
_this.destination = EMPTY_OBSERVER;
|
|
1692
|
+
}
|
|
1693
|
+
return _this;
|
|
1694
|
+
}
|
|
1695
|
+
Subscriber2.create = function(next, error, complete) {
|
|
1696
|
+
return new SafeSubscriber(next, error, complete);
|
|
1697
|
+
};
|
|
1698
|
+
Subscriber2.prototype.next = function(value) {
|
|
1699
|
+
if (this.isStopped) {
|
|
1700
|
+
handleStoppedNotification(nextNotification(value), this);
|
|
1701
|
+
} else {
|
|
1702
|
+
this._next(value);
|
|
1703
|
+
}
|
|
1704
|
+
};
|
|
1705
|
+
Subscriber2.prototype.error = function(err) {
|
|
1706
|
+
if (this.isStopped) {
|
|
1707
|
+
handleStoppedNotification(errorNotification(err), this);
|
|
1708
|
+
} else {
|
|
1709
|
+
this.isStopped = true;
|
|
1710
|
+
this._error(err);
|
|
1711
|
+
}
|
|
1712
|
+
};
|
|
1713
|
+
Subscriber2.prototype.complete = function() {
|
|
1714
|
+
if (this.isStopped) {
|
|
1715
|
+
handleStoppedNotification(COMPLETE_NOTIFICATION, this);
|
|
1716
|
+
} else {
|
|
1717
|
+
this.isStopped = true;
|
|
1718
|
+
this._complete();
|
|
1719
|
+
}
|
|
1720
|
+
};
|
|
1721
|
+
Subscriber2.prototype.unsubscribe = function() {
|
|
1722
|
+
if (!this.closed) {
|
|
1723
|
+
this.isStopped = true;
|
|
1724
|
+
_super.prototype.unsubscribe.call(this);
|
|
1725
|
+
this.destination = null;
|
|
1726
|
+
}
|
|
1727
|
+
};
|
|
1728
|
+
Subscriber2.prototype._next = function(value) {
|
|
1729
|
+
this.destination.next(value);
|
|
1730
|
+
};
|
|
1731
|
+
Subscriber2.prototype._error = function(err) {
|
|
1732
|
+
try {
|
|
1733
|
+
this.destination.error(err);
|
|
1734
|
+
} finally {
|
|
1735
|
+
this.unsubscribe();
|
|
1736
|
+
}
|
|
1737
|
+
};
|
|
1738
|
+
Subscriber2.prototype._complete = function() {
|
|
1739
|
+
try {
|
|
1740
|
+
this.destination.complete();
|
|
1741
|
+
} finally {
|
|
1742
|
+
this.unsubscribe();
|
|
1743
|
+
}
|
|
1744
|
+
};
|
|
1745
|
+
return Subscriber2;
|
|
1746
|
+
}(Subscription);
|
|
1747
|
+
var _bind = Function.prototype.bind;
|
|
1748
|
+
function bind(fn, thisArg) {
|
|
1749
|
+
return _bind.call(fn, thisArg);
|
|
1750
|
+
}
|
|
1751
|
+
var ConsumerObserver = function() {
|
|
1752
|
+
function ConsumerObserver2(partialObserver) {
|
|
1753
|
+
this.partialObserver = partialObserver;
|
|
1754
|
+
}
|
|
1755
|
+
ConsumerObserver2.prototype.next = function(value) {
|
|
1756
|
+
var partialObserver = this.partialObserver;
|
|
1757
|
+
if (partialObserver.next) {
|
|
1758
|
+
try {
|
|
1759
|
+
partialObserver.next(value);
|
|
1760
|
+
} catch (error) {
|
|
1761
|
+
handleUnhandledError(error);
|
|
1762
|
+
}
|
|
1763
|
+
}
|
|
1764
|
+
};
|
|
1765
|
+
ConsumerObserver2.prototype.error = function(err) {
|
|
1766
|
+
var partialObserver = this.partialObserver;
|
|
1767
|
+
if (partialObserver.error) {
|
|
1768
|
+
try {
|
|
1769
|
+
partialObserver.error(err);
|
|
1770
|
+
} catch (error) {
|
|
1771
|
+
handleUnhandledError(error);
|
|
1772
|
+
}
|
|
1773
|
+
} else {
|
|
1774
|
+
handleUnhandledError(err);
|
|
1775
|
+
}
|
|
1776
|
+
};
|
|
1777
|
+
ConsumerObserver2.prototype.complete = function() {
|
|
1778
|
+
var partialObserver = this.partialObserver;
|
|
1779
|
+
if (partialObserver.complete) {
|
|
1780
|
+
try {
|
|
1781
|
+
partialObserver.complete();
|
|
1782
|
+
} catch (error) {
|
|
1783
|
+
handleUnhandledError(error);
|
|
1784
|
+
}
|
|
1785
|
+
}
|
|
1786
|
+
};
|
|
1787
|
+
return ConsumerObserver2;
|
|
1788
|
+
}();
|
|
1789
|
+
var SafeSubscriber = function(_super) {
|
|
1790
|
+
__extends(SafeSubscriber2, _super);
|
|
1791
|
+
function SafeSubscriber2(observerOrNext, error, complete) {
|
|
1792
|
+
var _this = _super.call(this) || this;
|
|
1793
|
+
var partialObserver;
|
|
1794
|
+
if (isFunction(observerOrNext) || !observerOrNext) {
|
|
1795
|
+
partialObserver = {
|
|
1796
|
+
next: observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : void 0,
|
|
1797
|
+
error: error !== null && error !== void 0 ? error : void 0,
|
|
1798
|
+
complete: complete !== null && complete !== void 0 ? complete : void 0
|
|
1799
|
+
};
|
|
1800
|
+
} else {
|
|
1801
|
+
var context_1;
|
|
1802
|
+
if (_this && config.useDeprecatedNextContext) {
|
|
1803
|
+
context_1 = Object.create(observerOrNext);
|
|
1804
|
+
context_1.unsubscribe = function() {
|
|
1805
|
+
return _this.unsubscribe();
|
|
1806
|
+
};
|
|
1807
|
+
partialObserver = {
|
|
1808
|
+
next: observerOrNext.next && bind(observerOrNext.next, context_1),
|
|
1809
|
+
error: observerOrNext.error && bind(observerOrNext.error, context_1),
|
|
1810
|
+
complete: observerOrNext.complete && bind(observerOrNext.complete, context_1)
|
|
1811
|
+
};
|
|
1812
|
+
} else {
|
|
1813
|
+
partialObserver = observerOrNext;
|
|
1814
|
+
}
|
|
1815
|
+
}
|
|
1816
|
+
_this.destination = new ConsumerObserver(partialObserver);
|
|
1817
|
+
return _this;
|
|
1818
|
+
}
|
|
1819
|
+
return SafeSubscriber2;
|
|
1820
|
+
}(Subscriber);
|
|
1821
|
+
function handleUnhandledError(error) {
|
|
1822
|
+
if (config.useDeprecatedSynchronousErrorHandling) {
|
|
1823
|
+
captureError(error);
|
|
1824
|
+
} else {
|
|
1825
|
+
reportUnhandledError(error);
|
|
1826
|
+
}
|
|
1827
|
+
}
|
|
1828
|
+
function defaultErrorHandler(err) {
|
|
1829
|
+
throw err;
|
|
1830
|
+
}
|
|
1831
|
+
function handleStoppedNotification(notification, subscriber) {
|
|
1832
|
+
var onStoppedNotification = config.onStoppedNotification;
|
|
1833
|
+
onStoppedNotification && timeoutProvider.setTimeout(function() {
|
|
1834
|
+
return onStoppedNotification(notification, subscriber);
|
|
1835
|
+
});
|
|
1836
|
+
}
|
|
1837
|
+
var EMPTY_OBSERVER = {
|
|
1838
|
+
closed: true,
|
|
1839
|
+
next: noop,
|
|
1840
|
+
error: defaultErrorHandler,
|
|
1841
|
+
complete: noop
|
|
1842
|
+
};
|
|
1843
|
+
|
|
1844
|
+
// node_modules/rxjs/dist/esm5/internal/symbol/observable.js
|
|
1845
|
+
var observable = function() {
|
|
1846
|
+
return typeof Symbol === "function" && Symbol.observable || "@@observable";
|
|
1847
|
+
}();
|
|
1848
|
+
|
|
1849
|
+
// node_modules/rxjs/dist/esm5/internal/util/identity.js
|
|
1850
|
+
function identity(x) {
|
|
1851
|
+
return x;
|
|
1852
|
+
}
|
|
1853
|
+
|
|
1854
|
+
// node_modules/rxjs/dist/esm5/internal/util/pipe.js
|
|
1855
|
+
function pipeFromArray(fns) {
|
|
1856
|
+
if (fns.length === 0) {
|
|
1857
|
+
return identity;
|
|
1858
|
+
}
|
|
1859
|
+
if (fns.length === 1) {
|
|
1860
|
+
return fns[0];
|
|
1861
|
+
}
|
|
1862
|
+
return function piped(input) {
|
|
1863
|
+
return fns.reduce(function(prev, fn) {
|
|
1864
|
+
return fn(prev);
|
|
1865
|
+
}, input);
|
|
1866
|
+
};
|
|
1867
|
+
}
|
|
1868
|
+
|
|
1869
|
+
// node_modules/rxjs/dist/esm5/internal/Observable.js
|
|
1870
|
+
var Observable = function() {
|
|
1871
|
+
function Observable2(subscribe) {
|
|
1872
|
+
if (subscribe) {
|
|
1873
|
+
this._subscribe = subscribe;
|
|
1874
|
+
}
|
|
1875
|
+
}
|
|
1876
|
+
Observable2.prototype.lift = function(operator) {
|
|
1877
|
+
var observable3 = new Observable2();
|
|
1878
|
+
observable3.source = this;
|
|
1879
|
+
observable3.operator = operator;
|
|
1880
|
+
return observable3;
|
|
1881
|
+
};
|
|
1882
|
+
Observable2.prototype.subscribe = function(observerOrNext, error, complete) {
|
|
1883
|
+
var _this = this;
|
|
1884
|
+
var subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);
|
|
1885
|
+
errorContext(function() {
|
|
1886
|
+
var _a = _this, operator = _a.operator, source = _a.source;
|
|
1887
|
+
subscriber.add(operator ? operator.call(subscriber, source) : source ? _this._subscribe(subscriber) : _this._trySubscribe(subscriber));
|
|
1888
|
+
});
|
|
1889
|
+
return subscriber;
|
|
1890
|
+
};
|
|
1891
|
+
Observable2.prototype._trySubscribe = function(sink) {
|
|
1892
|
+
try {
|
|
1893
|
+
return this._subscribe(sink);
|
|
1894
|
+
} catch (err) {
|
|
1895
|
+
sink.error(err);
|
|
1896
|
+
}
|
|
1897
|
+
};
|
|
1898
|
+
Observable2.prototype.forEach = function(next, promiseCtor) {
|
|
1899
|
+
var _this = this;
|
|
1900
|
+
promiseCtor = getPromiseCtor(promiseCtor);
|
|
1901
|
+
return new promiseCtor(function(resolve, reject) {
|
|
1902
|
+
var subscriber = new SafeSubscriber({
|
|
1903
|
+
next: function(value) {
|
|
1904
|
+
try {
|
|
1905
|
+
next(value);
|
|
1906
|
+
} catch (err) {
|
|
1907
|
+
reject(err);
|
|
1908
|
+
subscriber.unsubscribe();
|
|
1909
|
+
}
|
|
1910
|
+
},
|
|
1911
|
+
error: reject,
|
|
1912
|
+
complete: resolve
|
|
1913
|
+
});
|
|
1914
|
+
_this.subscribe(subscriber);
|
|
1915
|
+
});
|
|
1916
|
+
};
|
|
1917
|
+
Observable2.prototype._subscribe = function(subscriber) {
|
|
1918
|
+
var _a;
|
|
1919
|
+
return (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber);
|
|
1920
|
+
};
|
|
1921
|
+
Observable2.prototype[observable] = function() {
|
|
1922
|
+
return this;
|
|
1923
|
+
};
|
|
1924
|
+
Observable2.prototype.pipe = function() {
|
|
1925
|
+
var operations = [];
|
|
1926
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1927
|
+
operations[_i] = arguments[_i];
|
|
1928
|
+
}
|
|
1929
|
+
return pipeFromArray(operations)(this);
|
|
1930
|
+
};
|
|
1931
|
+
Observable2.prototype.toPromise = function(promiseCtor) {
|
|
1932
|
+
var _this = this;
|
|
1933
|
+
promiseCtor = getPromiseCtor(promiseCtor);
|
|
1934
|
+
return new promiseCtor(function(resolve, reject) {
|
|
1935
|
+
var value;
|
|
1936
|
+
_this.subscribe(function(x) {
|
|
1937
|
+
return value = x;
|
|
1938
|
+
}, function(err) {
|
|
1939
|
+
return reject(err);
|
|
1940
|
+
}, function() {
|
|
1941
|
+
return resolve(value);
|
|
1942
|
+
});
|
|
1943
|
+
});
|
|
1944
|
+
};
|
|
1945
|
+
Observable2.create = function(subscribe) {
|
|
1946
|
+
return new Observable2(subscribe);
|
|
1947
|
+
};
|
|
1948
|
+
return Observable2;
|
|
1949
|
+
}();
|
|
1950
|
+
function getPromiseCtor(promiseCtor) {
|
|
1951
|
+
var _a;
|
|
1952
|
+
return (_a = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config.Promise) !== null && _a !== void 0 ? _a : Promise;
|
|
1953
|
+
}
|
|
1954
|
+
function isObserver(value) {
|
|
1955
|
+
return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);
|
|
1956
|
+
}
|
|
1957
|
+
function isSubscriber(value) {
|
|
1958
|
+
return value && value instanceof Subscriber || isObserver(value) && isSubscription(value);
|
|
1959
|
+
}
|
|
1960
|
+
|
|
1961
|
+
// node_modules/rxjs/dist/esm5/internal/util/lift.js
|
|
1962
|
+
function hasLift(source) {
|
|
1963
|
+
return isFunction(source === null || source === void 0 ? void 0 : source.lift);
|
|
1964
|
+
}
|
|
1965
|
+
function operate(init) {
|
|
1966
|
+
return function(source) {
|
|
1967
|
+
if (hasLift(source)) {
|
|
1968
|
+
return source.lift(function(liftedSource) {
|
|
1969
|
+
try {
|
|
1970
|
+
return init(liftedSource, this);
|
|
1971
|
+
} catch (err) {
|
|
1972
|
+
this.error(err);
|
|
1973
|
+
}
|
|
1974
|
+
});
|
|
1975
|
+
}
|
|
1976
|
+
throw new TypeError("Unable to lift unknown Observable type");
|
|
1977
|
+
};
|
|
1978
|
+
}
|
|
1979
|
+
|
|
1980
|
+
// node_modules/rxjs/dist/esm5/internal/operators/OperatorSubscriber.js
|
|
1981
|
+
function createOperatorSubscriber(destination, onNext, onComplete, onError, onFinalize) {
|
|
1982
|
+
return new OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize);
|
|
1983
|
+
}
|
|
1984
|
+
var OperatorSubscriber = function(_super) {
|
|
1985
|
+
__extends(OperatorSubscriber2, _super);
|
|
1986
|
+
function OperatorSubscriber2(destination, onNext, onComplete, onError, onFinalize, shouldUnsubscribe) {
|
|
1987
|
+
var _this = _super.call(this, destination) || this;
|
|
1988
|
+
_this.onFinalize = onFinalize;
|
|
1989
|
+
_this.shouldUnsubscribe = shouldUnsubscribe;
|
|
1990
|
+
_this._next = onNext ? function(value) {
|
|
1991
|
+
try {
|
|
1992
|
+
onNext(value);
|
|
1993
|
+
} catch (err) {
|
|
1994
|
+
destination.error(err);
|
|
1995
|
+
}
|
|
1996
|
+
} : _super.prototype._next;
|
|
1997
|
+
_this._error = onError ? function(err) {
|
|
1998
|
+
try {
|
|
1999
|
+
onError(err);
|
|
2000
|
+
} catch (err2) {
|
|
2001
|
+
destination.error(err2);
|
|
2002
|
+
} finally {
|
|
2003
|
+
this.unsubscribe();
|
|
2004
|
+
}
|
|
2005
|
+
} : _super.prototype._error;
|
|
2006
|
+
_this._complete = onComplete ? function() {
|
|
2007
|
+
try {
|
|
2008
|
+
onComplete();
|
|
2009
|
+
} catch (err) {
|
|
2010
|
+
destination.error(err);
|
|
2011
|
+
} finally {
|
|
2012
|
+
this.unsubscribe();
|
|
2013
|
+
}
|
|
2014
|
+
} : _super.prototype._complete;
|
|
2015
|
+
return _this;
|
|
2016
|
+
}
|
|
2017
|
+
OperatorSubscriber2.prototype.unsubscribe = function() {
|
|
2018
|
+
var _a;
|
|
2019
|
+
if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
|
|
2020
|
+
var closed_1 = this.closed;
|
|
2021
|
+
_super.prototype.unsubscribe.call(this);
|
|
2022
|
+
!closed_1 && ((_a = this.onFinalize) === null || _a === void 0 ? void 0 : _a.call(this));
|
|
2023
|
+
}
|
|
2024
|
+
};
|
|
2025
|
+
return OperatorSubscriber2;
|
|
2026
|
+
}(Subscriber);
|
|
2027
|
+
|
|
2028
|
+
// node_modules/rxjs/dist/esm5/internal/util/EmptyError.js
|
|
2029
|
+
var EmptyError = createErrorClass(function(_super) {
|
|
2030
|
+
return function EmptyErrorImpl() {
|
|
2031
|
+
_super(this);
|
|
2032
|
+
this.name = "EmptyError";
|
|
2033
|
+
this.message = "no elements in sequence";
|
|
2034
|
+
};
|
|
2035
|
+
});
|
|
2036
|
+
|
|
2037
|
+
// node_modules/rxjs/dist/esm5/internal/lastValueFrom.js
|
|
2038
|
+
function lastValueFrom(source, config2) {
|
|
2039
|
+
var hasConfig = typeof config2 === "object";
|
|
2040
|
+
return new Promise(function(resolve, reject) {
|
|
2041
|
+
var _hasValue = false;
|
|
2042
|
+
var _value;
|
|
2043
|
+
source.subscribe({
|
|
2044
|
+
next: function(value) {
|
|
2045
|
+
_value = value;
|
|
2046
|
+
_hasValue = true;
|
|
2047
|
+
},
|
|
2048
|
+
error: reject,
|
|
2049
|
+
complete: function() {
|
|
2050
|
+
if (_hasValue) {
|
|
2051
|
+
resolve(_value);
|
|
2052
|
+
} else if (hasConfig) {
|
|
2053
|
+
resolve(config2.defaultValue);
|
|
2054
|
+
} else {
|
|
2055
|
+
reject(new EmptyError());
|
|
2056
|
+
}
|
|
2057
|
+
}
|
|
2058
|
+
});
|
|
2059
|
+
});
|
|
2060
|
+
}
|
|
2061
|
+
|
|
2062
|
+
// node_modules/rxjs/dist/esm5/internal/operators/map.js
|
|
2063
|
+
function map(project, thisArg) {
|
|
2064
|
+
return operate(function(source, subscriber) {
|
|
2065
|
+
var index = 0;
|
|
2066
|
+
source.subscribe(createOperatorSubscriber(subscriber, function(value) {
|
|
2067
|
+
subscriber.next(project.call(thisArg, value, index++));
|
|
2068
|
+
}));
|
|
2069
|
+
});
|
|
2070
|
+
}
|
|
2071
|
+
|
|
2072
|
+
// node_modules/rxjs/dist/esm5/internal/operators/filter.js
|
|
2073
|
+
function filter(predicate, thisArg) {
|
|
2074
|
+
return operate(function(source, subscriber) {
|
|
2075
|
+
var index = 0;
|
|
2076
|
+
source.subscribe(createOperatorSubscriber(subscriber, function(value) {
|
|
2077
|
+
return predicate.call(thisArg, value, index++) && subscriber.next(value);
|
|
2078
|
+
}));
|
|
2079
|
+
});
|
|
2080
|
+
}
|
|
2081
|
+
|
|
2233
2082
|
// src/data/listen.js
|
|
2234
2083
|
var MAX_URL_LENGTH = 16e3 - 1200;
|
|
2235
2084
|
var EventSource = import_eventsource.default;
|
|
@@ -2251,7 +2100,7 @@ function listen(query, params, opts = {}) {
|
|
|
2251
2100
|
const qs = encodeQueryString_default({ query, params, options: listenOpts, tag });
|
|
2252
2101
|
const uri = `${url}${this.getDataUrl("listen", qs)}`;
|
|
2253
2102
|
if (uri.length > MAX_URL_LENGTH) {
|
|
2254
|
-
return new
|
|
2103
|
+
return new Observable((observer) => observer.error(new Error("Query too large for listener")));
|
|
2255
2104
|
}
|
|
2256
2105
|
const listenFor = options.events ? options.events : ["mutation"];
|
|
2257
2106
|
const shouldEmitReconnect = listenFor.indexOf("reconnect") !== -1;
|
|
@@ -2264,7 +2113,7 @@ function listen(query, params, opts = {}) {
|
|
|
2264
2113
|
Authorization: `Bearer ${token}`
|
|
2265
2114
|
};
|
|
2266
2115
|
}
|
|
2267
|
-
return new
|
|
2116
|
+
return new Observable((observer) => {
|
|
2268
2117
|
let es = getEventSource();
|
|
2269
2118
|
let reconnectTimer;
|
|
2270
2119
|
let stopped = false;
|
|
@@ -2370,40 +2219,39 @@ var indexBy = (docs, attr) => docs.reduce((indexed, doc) => {
|
|
|
2370
2219
|
indexed[attr(doc)] = doc;
|
|
2371
2220
|
return indexed;
|
|
2372
2221
|
}, /* @__PURE__ */ Object.create(null));
|
|
2373
|
-
var toPromise = (observable2) => observable2.toPromise();
|
|
2374
2222
|
var getQuerySizeLimit = 11264;
|
|
2375
2223
|
var dataMethods_default = {
|
|
2376
2224
|
listen,
|
|
2377
2225
|
getDataUrl(operation, path) {
|
|
2378
|
-
const
|
|
2379
|
-
const catalog = hasDataset(
|
|
2226
|
+
const config2 = this.clientConfig;
|
|
2227
|
+
const catalog = hasDataset(config2);
|
|
2380
2228
|
const baseUri = `/${operation}/${catalog}`;
|
|
2381
2229
|
const uri = path ? `${baseUri}/${path}` : baseUri;
|
|
2382
2230
|
return `/data${uri}`.replace(/\/($|\?)/, "$1");
|
|
2383
2231
|
},
|
|
2384
2232
|
fetch(query, params, options = {}) {
|
|
2385
2233
|
const mapResponse = options.filterResponse === false ? (res) => res : (res) => res.result;
|
|
2386
|
-
const
|
|
2387
|
-
return this.isPromiseAPI() ?
|
|
2234
|
+
const observable3 = this._dataRequest("query", { query, params }, options).pipe(map(mapResponse));
|
|
2235
|
+
return this.isPromiseAPI() ? lastValueFrom(observable3) : observable3;
|
|
2388
2236
|
},
|
|
2389
2237
|
getDocument(id, opts = {}) {
|
|
2390
2238
|
const options = { uri: this.getDataUrl("doc", id), json: true, tag: opts.tag };
|
|
2391
|
-
const
|
|
2392
|
-
|
|
2393
|
-
|
|
2239
|
+
const observable3 = this._requestObservable(options).pipe(
|
|
2240
|
+
filter(isResponse),
|
|
2241
|
+
map((event) => event.body.documents && event.body.documents[0])
|
|
2394
2242
|
);
|
|
2395
|
-
return this.isPromiseAPI() ?
|
|
2243
|
+
return this.isPromiseAPI() ? lastValueFrom(observable3) : observable3;
|
|
2396
2244
|
},
|
|
2397
2245
|
getDocuments(ids, opts = {}) {
|
|
2398
2246
|
const options = { uri: this.getDataUrl("doc", ids.join(",")), json: true, tag: opts.tag };
|
|
2399
|
-
const
|
|
2400
|
-
|
|
2401
|
-
|
|
2247
|
+
const observable3 = this._requestObservable(options).pipe(
|
|
2248
|
+
filter(isResponse),
|
|
2249
|
+
map((event) => {
|
|
2402
2250
|
const indexed = indexBy(event.body.documents || [], (doc) => doc._id);
|
|
2403
2251
|
return ids.map((id) => indexed[id] || null);
|
|
2404
2252
|
})
|
|
2405
2253
|
);
|
|
2406
|
-
return this.isPromiseAPI() ?
|
|
2254
|
+
return this.isPromiseAPI() ? lastValueFrom(observable3) : observable3;
|
|
2407
2255
|
},
|
|
2408
2256
|
create(doc, options) {
|
|
2409
2257
|
return this._create(doc, "create", options);
|
|
@@ -2433,7 +2281,7 @@ var dataMethods_default = {
|
|
|
2433
2281
|
},
|
|
2434
2282
|
dataRequest(endpoint, body, options = {}) {
|
|
2435
2283
|
const request2 = this._dataRequest(endpoint, body, options);
|
|
2436
|
-
return this.isPromiseAPI() ?
|
|
2284
|
+
return this.isPromiseAPI() ? lastValueFrom(request2) : request2;
|
|
2437
2285
|
},
|
|
2438
2286
|
_dataRequest(endpoint, body, options = {}) {
|
|
2439
2287
|
const isMutation = endpoint === "mutate";
|
|
@@ -2457,9 +2305,9 @@ var dataMethods_default = {
|
|
|
2457
2305
|
canUseCdn: isQuery
|
|
2458
2306
|
};
|
|
2459
2307
|
return this._requestObservable(reqOptions).pipe(
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2308
|
+
filter(isResponse),
|
|
2309
|
+
map(getBody),
|
|
2310
|
+
map((res) => {
|
|
2463
2311
|
if (!isMutation) {
|
|
2464
2312
|
return res;
|
|
2465
2313
|
}
|
|
@@ -2573,7 +2421,7 @@ Object.assign(AssetsClient.prototype, {
|
|
|
2573
2421
|
query.sourceName = source.name;
|
|
2574
2422
|
query.sourceUrl = source.url;
|
|
2575
2423
|
}
|
|
2576
|
-
const
|
|
2424
|
+
const observable3 = this.client._requestObservable({
|
|
2577
2425
|
tag,
|
|
2578
2426
|
method: "POST",
|
|
2579
2427
|
timeout: options.timeout || 0,
|
|
@@ -2582,10 +2430,12 @@ Object.assign(AssetsClient.prototype, {
|
|
|
2582
2430
|
query,
|
|
2583
2431
|
body
|
|
2584
2432
|
});
|
|
2585
|
-
return this.client.isPromiseAPI() ?
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2433
|
+
return this.client.isPromiseAPI() ? lastValueFrom(
|
|
2434
|
+
observable3.pipe(
|
|
2435
|
+
filter((event) => event.type === "response"),
|
|
2436
|
+
map((event) => event.body.document)
|
|
2437
|
+
)
|
|
2438
|
+
) : observable3;
|
|
2589
2439
|
},
|
|
2590
2440
|
delete(type, id) {
|
|
2591
2441
|
console.warn("client.assets.delete() is deprecated, please use client.delete(<document-id>)");
|
|
@@ -2646,7 +2496,7 @@ var authClient_default = AuthClient;
|
|
|
2646
2496
|
|
|
2647
2497
|
// src/http/request.js
|
|
2648
2498
|
import getIt from "get-it";
|
|
2649
|
-
import { observable, jsonRequest, jsonResponse, progress } from "get-it/middleware";
|
|
2499
|
+
import { observable as observable2, jsonRequest, jsonResponse, progress } from "get-it/middleware";
|
|
2650
2500
|
|
|
2651
2501
|
// src/http/errors.js
|
|
2652
2502
|
var import_make_error = __toESM(require_make_error());
|
|
@@ -2720,7 +2570,7 @@ var middleware = envSpecific.concat([
|
|
|
2720
2570
|
jsonResponse(),
|
|
2721
2571
|
progress(),
|
|
2722
2572
|
httpError,
|
|
2723
|
-
|
|
2573
|
+
observable2({ implementation: Observable })
|
|
2724
2574
|
]);
|
|
2725
2575
|
var request = getIt(middleware);
|
|
2726
2576
|
function httpRequest(options, requester = request) {
|
|
@@ -2733,23 +2583,23 @@ var request_default = httpRequest;
|
|
|
2733
2583
|
|
|
2734
2584
|
// src/http/requestOptions.js
|
|
2735
2585
|
var projectHeader = "X-Sanity-Project-ID";
|
|
2736
|
-
var requestOptions_default = (
|
|
2586
|
+
var requestOptions_default = (config2, overrides = {}) => {
|
|
2737
2587
|
const headers = {};
|
|
2738
|
-
const token = overrides.token ||
|
|
2588
|
+
const token = overrides.token || config2.token;
|
|
2739
2589
|
if (token) {
|
|
2740
2590
|
headers.Authorization = `Bearer ${token}`;
|
|
2741
2591
|
}
|
|
2742
|
-
if (!overrides.useGlobalApi && !
|
|
2743
|
-
headers[projectHeader] =
|
|
2592
|
+
if (!overrides.useGlobalApi && !config2.useProjectHostname && config2.projectId) {
|
|
2593
|
+
headers[projectHeader] = config2.projectId;
|
|
2744
2594
|
}
|
|
2745
2595
|
const withCredentials = Boolean(
|
|
2746
|
-
typeof overrides.withCredentials === "undefined" ?
|
|
2596
|
+
typeof overrides.withCredentials === "undefined" ? config2.token || config2.withCredentials : overrides.withCredentials
|
|
2747
2597
|
);
|
|
2748
|
-
const timeout = typeof overrides.timeout === "undefined" ?
|
|
2598
|
+
const timeout = typeof overrides.timeout === "undefined" ? config2.timeout : overrides.timeout;
|
|
2749
2599
|
return Object.assign({}, overrides, {
|
|
2750
2600
|
headers: Object.assign({}, headers, overrides.headers || {}),
|
|
2751
2601
|
timeout: typeof timeout === "undefined" ? 5 * 60 * 1e3 : timeout,
|
|
2752
|
-
proxy: overrides.proxy ||
|
|
2602
|
+
proxy: overrides.proxy || config2.proxy,
|
|
2753
2603
|
json: true,
|
|
2754
2604
|
withCredentials
|
|
2755
2605
|
});
|
|
@@ -2814,8 +2664,8 @@ var validateApiVersion = function validateApiVersion2(apiVersion) {
|
|
|
2814
2664
|
throw new Error("Invalid API version string, expected `1` or date in format `YYYY-MM-DD`");
|
|
2815
2665
|
}
|
|
2816
2666
|
};
|
|
2817
|
-
var initConfig = (
|
|
2818
|
-
const specifiedConfig = Object.assign({}, prevConfig,
|
|
2667
|
+
var initConfig = (config2, prevConfig) => {
|
|
2668
|
+
const specifiedConfig = Object.assign({}, prevConfig, config2);
|
|
2819
2669
|
if (!specifiedConfig.apiVersion) {
|
|
2820
2670
|
printNoApiVersionSpecifiedWarning();
|
|
2821
2671
|
}
|
|
@@ -2863,12 +2713,11 @@ var initConfig = (config, prevConfig) => {
|
|
|
2863
2713
|
};
|
|
2864
2714
|
|
|
2865
2715
|
// src/sanityClient.js
|
|
2866
|
-
|
|
2867
|
-
function SanityClient(config = defaultConfig) {
|
|
2716
|
+
function SanityClient(config2 = defaultConfig) {
|
|
2868
2717
|
if (!(this instanceof SanityClient)) {
|
|
2869
|
-
return new SanityClient(
|
|
2718
|
+
return new SanityClient(config2);
|
|
2870
2719
|
}
|
|
2871
|
-
this.config(
|
|
2720
|
+
this.config(config2);
|
|
2872
2721
|
this.assets = new assetsClient_default(this);
|
|
2873
2722
|
this.datasets = new datasetsClient_default(this);
|
|
2874
2723
|
this.projects = new projectsClient_default(this);
|
|
@@ -2924,16 +2773,16 @@ Object.assign(SanityClient.prototype, {
|
|
|
2924
2773
|
url: this.getUrl(uri, useCdn)
|
|
2925
2774
|
})
|
|
2926
2775
|
);
|
|
2927
|
-
return new
|
|
2776
|
+
return new Observable(
|
|
2928
2777
|
(subscriber) => request_default(reqOptions, this.clientConfig.requester).subscribe(subscriber)
|
|
2929
2778
|
);
|
|
2930
2779
|
},
|
|
2931
2780
|
request(options) {
|
|
2932
|
-
const
|
|
2933
|
-
|
|
2934
|
-
|
|
2781
|
+
const observable3 = this._requestObservable(options).pipe(
|
|
2782
|
+
filter((event) => event.type === "response"),
|
|
2783
|
+
map((event) => event.body)
|
|
2935
2784
|
);
|
|
2936
|
-
return this.isPromiseAPI() ?
|
|
2785
|
+
return this.isPromiseAPI() ? lastValueFrom(observable3) : observable3;
|
|
2937
2786
|
}
|
|
2938
2787
|
});
|
|
2939
2788
|
SanityClient.Patch = patch_default;
|