@onivoro/server-process 1.20.0 → 1.21.0
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/index.d.ts → index.d.ts} +8 -8
- package/index.js +20 -0
- package/index.js.map +1 -0
- package/{dist/lib → lib}/docker.d.ts +9 -9
- package/lib/docker.js +15 -0
- package/lib/docker.js.map +1 -0
- package/{dist/lib → lib}/exec-promise.d.ts +4 -4
- package/lib/exec-promise.js +18 -0
- package/lib/exec-promise.js.map +1 -0
- package/{dist/lib → lib}/exec-rx-as-json.d.ts +2 -2
- package/lib/exec-rx-as-json.js +9 -0
- package/lib/exec-rx-as-json.js.map +1 -0
- package/{dist/lib → lib}/exec-rx-as-lines.d.ts +2 -2
- package/lib/exec-rx-as-lines.js +10 -0
- package/lib/exec-rx-as-lines.js.map +1 -0
- package/{dist/lib → lib}/exec-rx.d.ts +5 -5
- package/lib/exec-rx.js +20 -0
- package/lib/exec-rx.js.map +1 -0
- package/{dist/lib → lib}/exit.d.ts +1 -1
- package/lib/exit.js +5 -0
- package/lib/exit.js.map +1 -0
- package/{dist/lib → lib}/listen.d.ts +5 -5
- package/lib/listen.js +12 -0
- package/lib/listen.js.map +1 -0
- package/{dist/lib → lib}/psql.d.ts +6 -6
- package/lib/psql.js +21 -0
- package/lib/psql.js.map +1 -0
- package/lib/spawn-promise.d.ts +1 -0
- package/lib/spawn-promise.js +30 -0
- package/lib/spawn-promise.js.map +1 -0
- package/package.json +4 -17
- package/README.md +0 -3
- package/dist/index.es.js +0 -1352
- package/dist/index.es.js.map +0 -1
- package/dist/index.js +0 -1363
- package/dist/index.js.map +0 -1
- package/dist/lib/exec-rx.spec.d.ts +0 -1
package/dist/index.es.js
DELETED
|
@@ -1,1352 +0,0 @@
|
|
|
1
|
-
import { exec } from 'child_process';
|
|
2
|
-
|
|
3
|
-
/*! *****************************************************************************
|
|
4
|
-
Copyright (c) Microsoft Corporation.
|
|
5
|
-
|
|
6
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
7
|
-
purpose with or without fee is hereby granted.
|
|
8
|
-
|
|
9
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
10
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
11
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
12
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
13
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
14
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
16
|
-
***************************************************************************** */
|
|
17
|
-
/* global Reflect, Promise */
|
|
18
|
-
|
|
19
|
-
var extendStatics = function(d, b) {
|
|
20
|
-
extendStatics = Object.setPrototypeOf ||
|
|
21
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
22
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
23
|
-
return extendStatics(d, b);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
function __extends(d, b) {
|
|
27
|
-
extendStatics(d, b);
|
|
28
|
-
function __() { this.constructor = d; }
|
|
29
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/** PURE_IMPORTS_START PURE_IMPORTS_END */
|
|
33
|
-
function isFunction(x) {
|
|
34
|
-
return typeof x === 'function';
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/** PURE_IMPORTS_START PURE_IMPORTS_END */
|
|
38
|
-
var _enable_super_gross_mode_that_will_cause_bad_things = false;
|
|
39
|
-
var config = {
|
|
40
|
-
Promise: undefined,
|
|
41
|
-
set useDeprecatedSynchronousErrorHandling(value) {
|
|
42
|
-
if (value) {
|
|
43
|
-
var error = /*@__PURE__*/ new Error();
|
|
44
|
-
/*@__PURE__*/ console.warn('DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n' + error.stack);
|
|
45
|
-
}
|
|
46
|
-
_enable_super_gross_mode_that_will_cause_bad_things = value;
|
|
47
|
-
},
|
|
48
|
-
get useDeprecatedSynchronousErrorHandling() {
|
|
49
|
-
return _enable_super_gross_mode_that_will_cause_bad_things;
|
|
50
|
-
},
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
/** PURE_IMPORTS_START PURE_IMPORTS_END */
|
|
54
|
-
function hostReportError(err) {
|
|
55
|
-
setTimeout(function () { throw err; }, 0);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/** PURE_IMPORTS_START _config,_util_hostReportError PURE_IMPORTS_END */
|
|
59
|
-
var empty = {
|
|
60
|
-
closed: true,
|
|
61
|
-
next: function (value) { },
|
|
62
|
-
error: function (err) {
|
|
63
|
-
if (config.useDeprecatedSynchronousErrorHandling) {
|
|
64
|
-
throw err;
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
hostReportError(err);
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
complete: function () { }
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
/** PURE_IMPORTS_START PURE_IMPORTS_END */
|
|
74
|
-
var isArray = /*@__PURE__*/ (function () { return Array.isArray || (function (x) { return x && typeof x.length === 'number'; }); })();
|
|
75
|
-
|
|
76
|
-
/** PURE_IMPORTS_START PURE_IMPORTS_END */
|
|
77
|
-
function isObject(x) {
|
|
78
|
-
return x !== null && typeof x === 'object';
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/** PURE_IMPORTS_START PURE_IMPORTS_END */
|
|
82
|
-
var UnsubscriptionErrorImpl = /*@__PURE__*/ (function () {
|
|
83
|
-
function UnsubscriptionErrorImpl(errors) {
|
|
84
|
-
Error.call(this);
|
|
85
|
-
this.message = errors ?
|
|
86
|
-
errors.length + " errors occurred during unsubscription:\n" + errors.map(function (err, i) { return i + 1 + ") " + err.toString(); }).join('\n ') : '';
|
|
87
|
-
this.name = 'UnsubscriptionError';
|
|
88
|
-
this.errors = errors;
|
|
89
|
-
return this;
|
|
90
|
-
}
|
|
91
|
-
UnsubscriptionErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype);
|
|
92
|
-
return UnsubscriptionErrorImpl;
|
|
93
|
-
})();
|
|
94
|
-
var UnsubscriptionError = UnsubscriptionErrorImpl;
|
|
95
|
-
|
|
96
|
-
/** PURE_IMPORTS_START _util_isArray,_util_isObject,_util_isFunction,_util_UnsubscriptionError PURE_IMPORTS_END */
|
|
97
|
-
var Subscription = /*@__PURE__*/ (function () {
|
|
98
|
-
function Subscription(unsubscribe) {
|
|
99
|
-
this.closed = false;
|
|
100
|
-
this._parentOrParents = null;
|
|
101
|
-
this._subscriptions = null;
|
|
102
|
-
if (unsubscribe) {
|
|
103
|
-
this._ctorUnsubscribe = true;
|
|
104
|
-
this._unsubscribe = unsubscribe;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
Subscription.prototype.unsubscribe = function () {
|
|
108
|
-
var errors;
|
|
109
|
-
if (this.closed) {
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
var _a = this, _parentOrParents = _a._parentOrParents, _ctorUnsubscribe = _a._ctorUnsubscribe, _unsubscribe = _a._unsubscribe, _subscriptions = _a._subscriptions;
|
|
113
|
-
this.closed = true;
|
|
114
|
-
this._parentOrParents = null;
|
|
115
|
-
this._subscriptions = null;
|
|
116
|
-
if (_parentOrParents instanceof Subscription) {
|
|
117
|
-
_parentOrParents.remove(this);
|
|
118
|
-
}
|
|
119
|
-
else if (_parentOrParents !== null) {
|
|
120
|
-
for (var index = 0; index < _parentOrParents.length; ++index) {
|
|
121
|
-
var parent_1 = _parentOrParents[index];
|
|
122
|
-
parent_1.remove(this);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
if (isFunction(_unsubscribe)) {
|
|
126
|
-
if (_ctorUnsubscribe) {
|
|
127
|
-
this._unsubscribe = undefined;
|
|
128
|
-
}
|
|
129
|
-
try {
|
|
130
|
-
_unsubscribe.call(this);
|
|
131
|
-
}
|
|
132
|
-
catch (e) {
|
|
133
|
-
errors = e instanceof UnsubscriptionError ? flattenUnsubscriptionErrors(e.errors) : [e];
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
if (isArray(_subscriptions)) {
|
|
137
|
-
var index = -1;
|
|
138
|
-
var len = _subscriptions.length;
|
|
139
|
-
while (++index < len) {
|
|
140
|
-
var sub = _subscriptions[index];
|
|
141
|
-
if (isObject(sub)) {
|
|
142
|
-
try {
|
|
143
|
-
sub.unsubscribe();
|
|
144
|
-
}
|
|
145
|
-
catch (e) {
|
|
146
|
-
errors = errors || [];
|
|
147
|
-
if (e instanceof UnsubscriptionError) {
|
|
148
|
-
errors = errors.concat(flattenUnsubscriptionErrors(e.errors));
|
|
149
|
-
}
|
|
150
|
-
else {
|
|
151
|
-
errors.push(e);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
if (errors) {
|
|
158
|
-
throw new UnsubscriptionError(errors);
|
|
159
|
-
}
|
|
160
|
-
};
|
|
161
|
-
Subscription.prototype.add = function (teardown) {
|
|
162
|
-
var subscription = teardown;
|
|
163
|
-
if (!teardown) {
|
|
164
|
-
return Subscription.EMPTY;
|
|
165
|
-
}
|
|
166
|
-
switch (typeof teardown) {
|
|
167
|
-
case 'function':
|
|
168
|
-
subscription = new Subscription(teardown);
|
|
169
|
-
case 'object':
|
|
170
|
-
if (subscription === this || subscription.closed || typeof subscription.unsubscribe !== 'function') {
|
|
171
|
-
return subscription;
|
|
172
|
-
}
|
|
173
|
-
else if (this.closed) {
|
|
174
|
-
subscription.unsubscribe();
|
|
175
|
-
return subscription;
|
|
176
|
-
}
|
|
177
|
-
else if (!(subscription instanceof Subscription)) {
|
|
178
|
-
var tmp = subscription;
|
|
179
|
-
subscription = new Subscription();
|
|
180
|
-
subscription._subscriptions = [tmp];
|
|
181
|
-
}
|
|
182
|
-
break;
|
|
183
|
-
default: {
|
|
184
|
-
throw new Error('unrecognized teardown ' + teardown + ' added to Subscription.');
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
var _parentOrParents = subscription._parentOrParents;
|
|
188
|
-
if (_parentOrParents === null) {
|
|
189
|
-
subscription._parentOrParents = this;
|
|
190
|
-
}
|
|
191
|
-
else if (_parentOrParents instanceof Subscription) {
|
|
192
|
-
if (_parentOrParents === this) {
|
|
193
|
-
return subscription;
|
|
194
|
-
}
|
|
195
|
-
subscription._parentOrParents = [_parentOrParents, this];
|
|
196
|
-
}
|
|
197
|
-
else if (_parentOrParents.indexOf(this) === -1) {
|
|
198
|
-
_parentOrParents.push(this);
|
|
199
|
-
}
|
|
200
|
-
else {
|
|
201
|
-
return subscription;
|
|
202
|
-
}
|
|
203
|
-
var subscriptions = this._subscriptions;
|
|
204
|
-
if (subscriptions === null) {
|
|
205
|
-
this._subscriptions = [subscription];
|
|
206
|
-
}
|
|
207
|
-
else {
|
|
208
|
-
subscriptions.push(subscription);
|
|
209
|
-
}
|
|
210
|
-
return subscription;
|
|
211
|
-
};
|
|
212
|
-
Subscription.prototype.remove = function (subscription) {
|
|
213
|
-
var subscriptions = this._subscriptions;
|
|
214
|
-
if (subscriptions) {
|
|
215
|
-
var subscriptionIndex = subscriptions.indexOf(subscription);
|
|
216
|
-
if (subscriptionIndex !== -1) {
|
|
217
|
-
subscriptions.splice(subscriptionIndex, 1);
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
};
|
|
221
|
-
Subscription.EMPTY = (function (empty) {
|
|
222
|
-
empty.closed = true;
|
|
223
|
-
return empty;
|
|
224
|
-
}(new Subscription()));
|
|
225
|
-
return Subscription;
|
|
226
|
-
}());
|
|
227
|
-
function flattenUnsubscriptionErrors(errors) {
|
|
228
|
-
return errors.reduce(function (errs, err) { return errs.concat((err instanceof UnsubscriptionError) ? err.errors : err); }, []);
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
/** PURE_IMPORTS_START PURE_IMPORTS_END */
|
|
232
|
-
var rxSubscriber = /*@__PURE__*/ (function () {
|
|
233
|
-
return typeof Symbol === 'function'
|
|
234
|
-
? /*@__PURE__*/ Symbol('rxSubscriber')
|
|
235
|
-
: '@@rxSubscriber_' + /*@__PURE__*/ Math.random();
|
|
236
|
-
})();
|
|
237
|
-
|
|
238
|
-
/** PURE_IMPORTS_START tslib,_util_isFunction,_Observer,_Subscription,_internal_symbol_rxSubscriber,_config,_util_hostReportError PURE_IMPORTS_END */
|
|
239
|
-
var Subscriber = /*@__PURE__*/ (function (_super) {
|
|
240
|
-
__extends(Subscriber, _super);
|
|
241
|
-
function Subscriber(destinationOrNext, error, complete) {
|
|
242
|
-
var _this = _super.call(this) || this;
|
|
243
|
-
_this.syncErrorValue = null;
|
|
244
|
-
_this.syncErrorThrown = false;
|
|
245
|
-
_this.syncErrorThrowable = false;
|
|
246
|
-
_this.isStopped = false;
|
|
247
|
-
switch (arguments.length) {
|
|
248
|
-
case 0:
|
|
249
|
-
_this.destination = empty;
|
|
250
|
-
break;
|
|
251
|
-
case 1:
|
|
252
|
-
if (!destinationOrNext) {
|
|
253
|
-
_this.destination = empty;
|
|
254
|
-
break;
|
|
255
|
-
}
|
|
256
|
-
if (typeof destinationOrNext === 'object') {
|
|
257
|
-
if (destinationOrNext instanceof Subscriber) {
|
|
258
|
-
_this.syncErrorThrowable = destinationOrNext.syncErrorThrowable;
|
|
259
|
-
_this.destination = destinationOrNext;
|
|
260
|
-
destinationOrNext.add(_this);
|
|
261
|
-
}
|
|
262
|
-
else {
|
|
263
|
-
_this.syncErrorThrowable = true;
|
|
264
|
-
_this.destination = new SafeSubscriber(_this, destinationOrNext);
|
|
265
|
-
}
|
|
266
|
-
break;
|
|
267
|
-
}
|
|
268
|
-
default:
|
|
269
|
-
_this.syncErrorThrowable = true;
|
|
270
|
-
_this.destination = new SafeSubscriber(_this, destinationOrNext, error, complete);
|
|
271
|
-
break;
|
|
272
|
-
}
|
|
273
|
-
return _this;
|
|
274
|
-
}
|
|
275
|
-
Subscriber.prototype[rxSubscriber] = function () { return this; };
|
|
276
|
-
Subscriber.create = function (next, error, complete) {
|
|
277
|
-
var subscriber = new Subscriber(next, error, complete);
|
|
278
|
-
subscriber.syncErrorThrowable = false;
|
|
279
|
-
return subscriber;
|
|
280
|
-
};
|
|
281
|
-
Subscriber.prototype.next = function (value) {
|
|
282
|
-
if (!this.isStopped) {
|
|
283
|
-
this._next(value);
|
|
284
|
-
}
|
|
285
|
-
};
|
|
286
|
-
Subscriber.prototype.error = function (err) {
|
|
287
|
-
if (!this.isStopped) {
|
|
288
|
-
this.isStopped = true;
|
|
289
|
-
this._error(err);
|
|
290
|
-
}
|
|
291
|
-
};
|
|
292
|
-
Subscriber.prototype.complete = function () {
|
|
293
|
-
if (!this.isStopped) {
|
|
294
|
-
this.isStopped = true;
|
|
295
|
-
this._complete();
|
|
296
|
-
}
|
|
297
|
-
};
|
|
298
|
-
Subscriber.prototype.unsubscribe = function () {
|
|
299
|
-
if (this.closed) {
|
|
300
|
-
return;
|
|
301
|
-
}
|
|
302
|
-
this.isStopped = true;
|
|
303
|
-
_super.prototype.unsubscribe.call(this);
|
|
304
|
-
};
|
|
305
|
-
Subscriber.prototype._next = function (value) {
|
|
306
|
-
this.destination.next(value);
|
|
307
|
-
};
|
|
308
|
-
Subscriber.prototype._error = function (err) {
|
|
309
|
-
this.destination.error(err);
|
|
310
|
-
this.unsubscribe();
|
|
311
|
-
};
|
|
312
|
-
Subscriber.prototype._complete = function () {
|
|
313
|
-
this.destination.complete();
|
|
314
|
-
this.unsubscribe();
|
|
315
|
-
};
|
|
316
|
-
Subscriber.prototype._unsubscribeAndRecycle = function () {
|
|
317
|
-
var _parentOrParents = this._parentOrParents;
|
|
318
|
-
this._parentOrParents = null;
|
|
319
|
-
this.unsubscribe();
|
|
320
|
-
this.closed = false;
|
|
321
|
-
this.isStopped = false;
|
|
322
|
-
this._parentOrParents = _parentOrParents;
|
|
323
|
-
return this;
|
|
324
|
-
};
|
|
325
|
-
return Subscriber;
|
|
326
|
-
}(Subscription));
|
|
327
|
-
var SafeSubscriber = /*@__PURE__*/ (function (_super) {
|
|
328
|
-
__extends(SafeSubscriber, _super);
|
|
329
|
-
function SafeSubscriber(_parentSubscriber, observerOrNext, error, complete) {
|
|
330
|
-
var _this = _super.call(this) || this;
|
|
331
|
-
_this._parentSubscriber = _parentSubscriber;
|
|
332
|
-
var next;
|
|
333
|
-
var context = _this;
|
|
334
|
-
if (isFunction(observerOrNext)) {
|
|
335
|
-
next = observerOrNext;
|
|
336
|
-
}
|
|
337
|
-
else if (observerOrNext) {
|
|
338
|
-
next = observerOrNext.next;
|
|
339
|
-
error = observerOrNext.error;
|
|
340
|
-
complete = observerOrNext.complete;
|
|
341
|
-
if (observerOrNext !== empty) {
|
|
342
|
-
context = Object.create(observerOrNext);
|
|
343
|
-
if (isFunction(context.unsubscribe)) {
|
|
344
|
-
_this.add(context.unsubscribe.bind(context));
|
|
345
|
-
}
|
|
346
|
-
context.unsubscribe = _this.unsubscribe.bind(_this);
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
_this._context = context;
|
|
350
|
-
_this._next = next;
|
|
351
|
-
_this._error = error;
|
|
352
|
-
_this._complete = complete;
|
|
353
|
-
return _this;
|
|
354
|
-
}
|
|
355
|
-
SafeSubscriber.prototype.next = function (value) {
|
|
356
|
-
if (!this.isStopped && this._next) {
|
|
357
|
-
var _parentSubscriber = this._parentSubscriber;
|
|
358
|
-
if (!config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
|
|
359
|
-
this.__tryOrUnsub(this._next, value);
|
|
360
|
-
}
|
|
361
|
-
else if (this.__tryOrSetError(_parentSubscriber, this._next, value)) {
|
|
362
|
-
this.unsubscribe();
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
};
|
|
366
|
-
SafeSubscriber.prototype.error = function (err) {
|
|
367
|
-
if (!this.isStopped) {
|
|
368
|
-
var _parentSubscriber = this._parentSubscriber;
|
|
369
|
-
var useDeprecatedSynchronousErrorHandling = config.useDeprecatedSynchronousErrorHandling;
|
|
370
|
-
if (this._error) {
|
|
371
|
-
if (!useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
|
|
372
|
-
this.__tryOrUnsub(this._error, err);
|
|
373
|
-
this.unsubscribe();
|
|
374
|
-
}
|
|
375
|
-
else {
|
|
376
|
-
this.__tryOrSetError(_parentSubscriber, this._error, err);
|
|
377
|
-
this.unsubscribe();
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
else if (!_parentSubscriber.syncErrorThrowable) {
|
|
381
|
-
this.unsubscribe();
|
|
382
|
-
if (useDeprecatedSynchronousErrorHandling) {
|
|
383
|
-
throw err;
|
|
384
|
-
}
|
|
385
|
-
hostReportError(err);
|
|
386
|
-
}
|
|
387
|
-
else {
|
|
388
|
-
if (useDeprecatedSynchronousErrorHandling) {
|
|
389
|
-
_parentSubscriber.syncErrorValue = err;
|
|
390
|
-
_parentSubscriber.syncErrorThrown = true;
|
|
391
|
-
}
|
|
392
|
-
else {
|
|
393
|
-
hostReportError(err);
|
|
394
|
-
}
|
|
395
|
-
this.unsubscribe();
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
};
|
|
399
|
-
SafeSubscriber.prototype.complete = function () {
|
|
400
|
-
var _this = this;
|
|
401
|
-
if (!this.isStopped) {
|
|
402
|
-
var _parentSubscriber = this._parentSubscriber;
|
|
403
|
-
if (this._complete) {
|
|
404
|
-
var wrappedComplete = function () { return _this._complete.call(_this._context); };
|
|
405
|
-
if (!config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
|
|
406
|
-
this.__tryOrUnsub(wrappedComplete);
|
|
407
|
-
this.unsubscribe();
|
|
408
|
-
}
|
|
409
|
-
else {
|
|
410
|
-
this.__tryOrSetError(_parentSubscriber, wrappedComplete);
|
|
411
|
-
this.unsubscribe();
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
else {
|
|
415
|
-
this.unsubscribe();
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
};
|
|
419
|
-
SafeSubscriber.prototype.__tryOrUnsub = function (fn, value) {
|
|
420
|
-
try {
|
|
421
|
-
fn.call(this._context, value);
|
|
422
|
-
}
|
|
423
|
-
catch (err) {
|
|
424
|
-
this.unsubscribe();
|
|
425
|
-
if (config.useDeprecatedSynchronousErrorHandling) {
|
|
426
|
-
throw err;
|
|
427
|
-
}
|
|
428
|
-
else {
|
|
429
|
-
hostReportError(err);
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
};
|
|
433
|
-
SafeSubscriber.prototype.__tryOrSetError = function (parent, fn, value) {
|
|
434
|
-
if (!config.useDeprecatedSynchronousErrorHandling) {
|
|
435
|
-
throw new Error('bad call');
|
|
436
|
-
}
|
|
437
|
-
try {
|
|
438
|
-
fn.call(this._context, value);
|
|
439
|
-
}
|
|
440
|
-
catch (err) {
|
|
441
|
-
if (config.useDeprecatedSynchronousErrorHandling) {
|
|
442
|
-
parent.syncErrorValue = err;
|
|
443
|
-
parent.syncErrorThrown = true;
|
|
444
|
-
return true;
|
|
445
|
-
}
|
|
446
|
-
else {
|
|
447
|
-
hostReportError(err);
|
|
448
|
-
return true;
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
return false;
|
|
452
|
-
};
|
|
453
|
-
SafeSubscriber.prototype._unsubscribe = function () {
|
|
454
|
-
var _parentSubscriber = this._parentSubscriber;
|
|
455
|
-
this._context = null;
|
|
456
|
-
this._parentSubscriber = null;
|
|
457
|
-
_parentSubscriber.unsubscribe();
|
|
458
|
-
};
|
|
459
|
-
return SafeSubscriber;
|
|
460
|
-
}(Subscriber));
|
|
461
|
-
|
|
462
|
-
/** PURE_IMPORTS_START _Subscriber PURE_IMPORTS_END */
|
|
463
|
-
function canReportError(observer) {
|
|
464
|
-
while (observer) {
|
|
465
|
-
var _a = observer, closed_1 = _a.closed, destination = _a.destination, isStopped = _a.isStopped;
|
|
466
|
-
if (closed_1 || isStopped) {
|
|
467
|
-
return false;
|
|
468
|
-
}
|
|
469
|
-
else if (destination && destination instanceof Subscriber) {
|
|
470
|
-
observer = destination;
|
|
471
|
-
}
|
|
472
|
-
else {
|
|
473
|
-
observer = null;
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
return true;
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
/** PURE_IMPORTS_START _Subscriber,_symbol_rxSubscriber,_Observer PURE_IMPORTS_END */
|
|
480
|
-
function toSubscriber(nextOrObserver, error, complete) {
|
|
481
|
-
if (nextOrObserver) {
|
|
482
|
-
if (nextOrObserver instanceof Subscriber) {
|
|
483
|
-
return nextOrObserver;
|
|
484
|
-
}
|
|
485
|
-
if (nextOrObserver[rxSubscriber]) {
|
|
486
|
-
return nextOrObserver[rxSubscriber]();
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
if (!nextOrObserver && !error && !complete) {
|
|
490
|
-
return new Subscriber(empty);
|
|
491
|
-
}
|
|
492
|
-
return new Subscriber(nextOrObserver, error, complete);
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
/** PURE_IMPORTS_START PURE_IMPORTS_END */
|
|
496
|
-
var observable = /*@__PURE__*/ (function () { return typeof Symbol === 'function' && Symbol.observable || '@@observable'; })();
|
|
497
|
-
|
|
498
|
-
/** PURE_IMPORTS_START PURE_IMPORTS_END */
|
|
499
|
-
function identity(x) {
|
|
500
|
-
return x;
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
/** PURE_IMPORTS_START _identity PURE_IMPORTS_END */
|
|
504
|
-
function pipeFromArray(fns) {
|
|
505
|
-
if (fns.length === 0) {
|
|
506
|
-
return identity;
|
|
507
|
-
}
|
|
508
|
-
if (fns.length === 1) {
|
|
509
|
-
return fns[0];
|
|
510
|
-
}
|
|
511
|
-
return function piped(input) {
|
|
512
|
-
return fns.reduce(function (prev, fn) { return fn(prev); }, input);
|
|
513
|
-
};
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
/** PURE_IMPORTS_START _util_canReportError,_util_toSubscriber,_symbol_observable,_util_pipe,_config PURE_IMPORTS_END */
|
|
517
|
-
var Observable = /*@__PURE__*/ (function () {
|
|
518
|
-
function Observable(subscribe) {
|
|
519
|
-
this._isScalar = false;
|
|
520
|
-
if (subscribe) {
|
|
521
|
-
this._subscribe = subscribe;
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
Observable.prototype.lift = function (operator) {
|
|
525
|
-
var observable = new Observable();
|
|
526
|
-
observable.source = this;
|
|
527
|
-
observable.operator = operator;
|
|
528
|
-
return observable;
|
|
529
|
-
};
|
|
530
|
-
Observable.prototype.subscribe = function (observerOrNext, error, complete) {
|
|
531
|
-
var operator = this.operator;
|
|
532
|
-
var sink = toSubscriber(observerOrNext, error, complete);
|
|
533
|
-
if (operator) {
|
|
534
|
-
sink.add(operator.call(sink, this.source));
|
|
535
|
-
}
|
|
536
|
-
else {
|
|
537
|
-
sink.add(this.source || (config.useDeprecatedSynchronousErrorHandling && !sink.syncErrorThrowable) ?
|
|
538
|
-
this._subscribe(sink) :
|
|
539
|
-
this._trySubscribe(sink));
|
|
540
|
-
}
|
|
541
|
-
if (config.useDeprecatedSynchronousErrorHandling) {
|
|
542
|
-
if (sink.syncErrorThrowable) {
|
|
543
|
-
sink.syncErrorThrowable = false;
|
|
544
|
-
if (sink.syncErrorThrown) {
|
|
545
|
-
throw sink.syncErrorValue;
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
return sink;
|
|
550
|
-
};
|
|
551
|
-
Observable.prototype._trySubscribe = function (sink) {
|
|
552
|
-
try {
|
|
553
|
-
return this._subscribe(sink);
|
|
554
|
-
}
|
|
555
|
-
catch (err) {
|
|
556
|
-
if (config.useDeprecatedSynchronousErrorHandling) {
|
|
557
|
-
sink.syncErrorThrown = true;
|
|
558
|
-
sink.syncErrorValue = err;
|
|
559
|
-
}
|
|
560
|
-
if (canReportError(sink)) {
|
|
561
|
-
sink.error(err);
|
|
562
|
-
}
|
|
563
|
-
else {
|
|
564
|
-
console.warn(err);
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
};
|
|
568
|
-
Observable.prototype.forEach = function (next, promiseCtor) {
|
|
569
|
-
var _this = this;
|
|
570
|
-
promiseCtor = getPromiseCtor(promiseCtor);
|
|
571
|
-
return new promiseCtor(function (resolve, reject) {
|
|
572
|
-
var subscription;
|
|
573
|
-
subscription = _this.subscribe(function (value) {
|
|
574
|
-
try {
|
|
575
|
-
next(value);
|
|
576
|
-
}
|
|
577
|
-
catch (err) {
|
|
578
|
-
reject(err);
|
|
579
|
-
if (subscription) {
|
|
580
|
-
subscription.unsubscribe();
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
|
-
}, reject, resolve);
|
|
584
|
-
});
|
|
585
|
-
};
|
|
586
|
-
Observable.prototype._subscribe = function (subscriber) {
|
|
587
|
-
var source = this.source;
|
|
588
|
-
return source && source.subscribe(subscriber);
|
|
589
|
-
};
|
|
590
|
-
Observable.prototype[observable] = function () {
|
|
591
|
-
return this;
|
|
592
|
-
};
|
|
593
|
-
Observable.prototype.pipe = function () {
|
|
594
|
-
var operations = [];
|
|
595
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
596
|
-
operations[_i] = arguments[_i];
|
|
597
|
-
}
|
|
598
|
-
if (operations.length === 0) {
|
|
599
|
-
return this;
|
|
600
|
-
}
|
|
601
|
-
return pipeFromArray(operations)(this);
|
|
602
|
-
};
|
|
603
|
-
Observable.prototype.toPromise = function (promiseCtor) {
|
|
604
|
-
var _this = this;
|
|
605
|
-
promiseCtor = getPromiseCtor(promiseCtor);
|
|
606
|
-
return new promiseCtor(function (resolve, reject) {
|
|
607
|
-
var value;
|
|
608
|
-
_this.subscribe(function (x) { return value = x; }, function (err) { return reject(err); }, function () { return resolve(value); });
|
|
609
|
-
});
|
|
610
|
-
};
|
|
611
|
-
Observable.create = function (subscribe) {
|
|
612
|
-
return new Observable(subscribe);
|
|
613
|
-
};
|
|
614
|
-
return Observable;
|
|
615
|
-
}());
|
|
616
|
-
function getPromiseCtor(promiseCtor) {
|
|
617
|
-
if (!promiseCtor) {
|
|
618
|
-
promiseCtor = config.Promise || Promise;
|
|
619
|
-
}
|
|
620
|
-
if (!promiseCtor) {
|
|
621
|
-
throw new Error('no Promise impl found');
|
|
622
|
-
}
|
|
623
|
-
return promiseCtor;
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
/** PURE_IMPORTS_START PURE_IMPORTS_END */
|
|
627
|
-
var ObjectUnsubscribedErrorImpl = /*@__PURE__*/ (function () {
|
|
628
|
-
function ObjectUnsubscribedErrorImpl() {
|
|
629
|
-
Error.call(this);
|
|
630
|
-
this.message = 'object unsubscribed';
|
|
631
|
-
this.name = 'ObjectUnsubscribedError';
|
|
632
|
-
return this;
|
|
633
|
-
}
|
|
634
|
-
ObjectUnsubscribedErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype);
|
|
635
|
-
return ObjectUnsubscribedErrorImpl;
|
|
636
|
-
})();
|
|
637
|
-
var ObjectUnsubscribedError = ObjectUnsubscribedErrorImpl;
|
|
638
|
-
|
|
639
|
-
/** PURE_IMPORTS_START tslib,_Subscription PURE_IMPORTS_END */
|
|
640
|
-
var SubjectSubscription = /*@__PURE__*/ (function (_super) {
|
|
641
|
-
__extends(SubjectSubscription, _super);
|
|
642
|
-
function SubjectSubscription(subject, subscriber) {
|
|
643
|
-
var _this = _super.call(this) || this;
|
|
644
|
-
_this.subject = subject;
|
|
645
|
-
_this.subscriber = subscriber;
|
|
646
|
-
_this.closed = false;
|
|
647
|
-
return _this;
|
|
648
|
-
}
|
|
649
|
-
SubjectSubscription.prototype.unsubscribe = function () {
|
|
650
|
-
if (this.closed) {
|
|
651
|
-
return;
|
|
652
|
-
}
|
|
653
|
-
this.closed = true;
|
|
654
|
-
var subject = this.subject;
|
|
655
|
-
var observers = subject.observers;
|
|
656
|
-
this.subject = null;
|
|
657
|
-
if (!observers || observers.length === 0 || subject.isStopped || subject.closed) {
|
|
658
|
-
return;
|
|
659
|
-
}
|
|
660
|
-
var subscriberIndex = observers.indexOf(this.subscriber);
|
|
661
|
-
if (subscriberIndex !== -1) {
|
|
662
|
-
observers.splice(subscriberIndex, 1);
|
|
663
|
-
}
|
|
664
|
-
};
|
|
665
|
-
return SubjectSubscription;
|
|
666
|
-
}(Subscription));
|
|
667
|
-
|
|
668
|
-
/** PURE_IMPORTS_START tslib,_Observable,_Subscriber,_Subscription,_util_ObjectUnsubscribedError,_SubjectSubscription,_internal_symbol_rxSubscriber PURE_IMPORTS_END */
|
|
669
|
-
var SubjectSubscriber = /*@__PURE__*/ (function (_super) {
|
|
670
|
-
__extends(SubjectSubscriber, _super);
|
|
671
|
-
function SubjectSubscriber(destination) {
|
|
672
|
-
var _this = _super.call(this, destination) || this;
|
|
673
|
-
_this.destination = destination;
|
|
674
|
-
return _this;
|
|
675
|
-
}
|
|
676
|
-
return SubjectSubscriber;
|
|
677
|
-
}(Subscriber));
|
|
678
|
-
var Subject = /*@__PURE__*/ (function (_super) {
|
|
679
|
-
__extends(Subject, _super);
|
|
680
|
-
function Subject() {
|
|
681
|
-
var _this = _super.call(this) || this;
|
|
682
|
-
_this.observers = [];
|
|
683
|
-
_this.closed = false;
|
|
684
|
-
_this.isStopped = false;
|
|
685
|
-
_this.hasError = false;
|
|
686
|
-
_this.thrownError = null;
|
|
687
|
-
return _this;
|
|
688
|
-
}
|
|
689
|
-
Subject.prototype[rxSubscriber] = function () {
|
|
690
|
-
return new SubjectSubscriber(this);
|
|
691
|
-
};
|
|
692
|
-
Subject.prototype.lift = function (operator) {
|
|
693
|
-
var subject = new AnonymousSubject(this, this);
|
|
694
|
-
subject.operator = operator;
|
|
695
|
-
return subject;
|
|
696
|
-
};
|
|
697
|
-
Subject.prototype.next = function (value) {
|
|
698
|
-
if (this.closed) {
|
|
699
|
-
throw new ObjectUnsubscribedError();
|
|
700
|
-
}
|
|
701
|
-
if (!this.isStopped) {
|
|
702
|
-
var observers = this.observers;
|
|
703
|
-
var len = observers.length;
|
|
704
|
-
var copy = observers.slice();
|
|
705
|
-
for (var i = 0; i < len; i++) {
|
|
706
|
-
copy[i].next(value);
|
|
707
|
-
}
|
|
708
|
-
}
|
|
709
|
-
};
|
|
710
|
-
Subject.prototype.error = function (err) {
|
|
711
|
-
if (this.closed) {
|
|
712
|
-
throw new ObjectUnsubscribedError();
|
|
713
|
-
}
|
|
714
|
-
this.hasError = true;
|
|
715
|
-
this.thrownError = err;
|
|
716
|
-
this.isStopped = true;
|
|
717
|
-
var observers = this.observers;
|
|
718
|
-
var len = observers.length;
|
|
719
|
-
var copy = observers.slice();
|
|
720
|
-
for (var i = 0; i < len; i++) {
|
|
721
|
-
copy[i].error(err);
|
|
722
|
-
}
|
|
723
|
-
this.observers.length = 0;
|
|
724
|
-
};
|
|
725
|
-
Subject.prototype.complete = function () {
|
|
726
|
-
if (this.closed) {
|
|
727
|
-
throw new ObjectUnsubscribedError();
|
|
728
|
-
}
|
|
729
|
-
this.isStopped = true;
|
|
730
|
-
var observers = this.observers;
|
|
731
|
-
var len = observers.length;
|
|
732
|
-
var copy = observers.slice();
|
|
733
|
-
for (var i = 0; i < len; i++) {
|
|
734
|
-
copy[i].complete();
|
|
735
|
-
}
|
|
736
|
-
this.observers.length = 0;
|
|
737
|
-
};
|
|
738
|
-
Subject.prototype.unsubscribe = function () {
|
|
739
|
-
this.isStopped = true;
|
|
740
|
-
this.closed = true;
|
|
741
|
-
this.observers = null;
|
|
742
|
-
};
|
|
743
|
-
Subject.prototype._trySubscribe = function (subscriber) {
|
|
744
|
-
if (this.closed) {
|
|
745
|
-
throw new ObjectUnsubscribedError();
|
|
746
|
-
}
|
|
747
|
-
else {
|
|
748
|
-
return _super.prototype._trySubscribe.call(this, subscriber);
|
|
749
|
-
}
|
|
750
|
-
};
|
|
751
|
-
Subject.prototype._subscribe = function (subscriber) {
|
|
752
|
-
if (this.closed) {
|
|
753
|
-
throw new ObjectUnsubscribedError();
|
|
754
|
-
}
|
|
755
|
-
else if (this.hasError) {
|
|
756
|
-
subscriber.error(this.thrownError);
|
|
757
|
-
return Subscription.EMPTY;
|
|
758
|
-
}
|
|
759
|
-
else if (this.isStopped) {
|
|
760
|
-
subscriber.complete();
|
|
761
|
-
return Subscription.EMPTY;
|
|
762
|
-
}
|
|
763
|
-
else {
|
|
764
|
-
this.observers.push(subscriber);
|
|
765
|
-
return new SubjectSubscription(this, subscriber);
|
|
766
|
-
}
|
|
767
|
-
};
|
|
768
|
-
Subject.prototype.asObservable = function () {
|
|
769
|
-
var observable = new Observable();
|
|
770
|
-
observable.source = this;
|
|
771
|
-
return observable;
|
|
772
|
-
};
|
|
773
|
-
Subject.create = function (destination, source) {
|
|
774
|
-
return new AnonymousSubject(destination, source);
|
|
775
|
-
};
|
|
776
|
-
return Subject;
|
|
777
|
-
}(Observable));
|
|
778
|
-
var AnonymousSubject = /*@__PURE__*/ (function (_super) {
|
|
779
|
-
__extends(AnonymousSubject, _super);
|
|
780
|
-
function AnonymousSubject(destination, source) {
|
|
781
|
-
var _this = _super.call(this) || this;
|
|
782
|
-
_this.destination = destination;
|
|
783
|
-
_this.source = source;
|
|
784
|
-
return _this;
|
|
785
|
-
}
|
|
786
|
-
AnonymousSubject.prototype.next = function (value) {
|
|
787
|
-
var destination = this.destination;
|
|
788
|
-
if (destination && destination.next) {
|
|
789
|
-
destination.next(value);
|
|
790
|
-
}
|
|
791
|
-
};
|
|
792
|
-
AnonymousSubject.prototype.error = function (err) {
|
|
793
|
-
var destination = this.destination;
|
|
794
|
-
if (destination && destination.error) {
|
|
795
|
-
this.destination.error(err);
|
|
796
|
-
}
|
|
797
|
-
};
|
|
798
|
-
AnonymousSubject.prototype.complete = function () {
|
|
799
|
-
var destination = this.destination;
|
|
800
|
-
if (destination && destination.complete) {
|
|
801
|
-
this.destination.complete();
|
|
802
|
-
}
|
|
803
|
-
};
|
|
804
|
-
AnonymousSubject.prototype._subscribe = function (subscriber) {
|
|
805
|
-
var source = this.source;
|
|
806
|
-
if (source) {
|
|
807
|
-
return this.source.subscribe(subscriber);
|
|
808
|
-
}
|
|
809
|
-
else {
|
|
810
|
-
return Subscription.EMPTY;
|
|
811
|
-
}
|
|
812
|
-
};
|
|
813
|
-
return AnonymousSubject;
|
|
814
|
-
}(Subject));
|
|
815
|
-
|
|
816
|
-
/** PURE_IMPORTS_START PURE_IMPORTS_END */
|
|
817
|
-
var subscribeToArray = function (array) {
|
|
818
|
-
return function (subscriber) {
|
|
819
|
-
for (var i = 0, len = array.length; i < len && !subscriber.closed; i++) {
|
|
820
|
-
subscriber.next(array[i]);
|
|
821
|
-
}
|
|
822
|
-
subscriber.complete();
|
|
823
|
-
};
|
|
824
|
-
};
|
|
825
|
-
|
|
826
|
-
/** PURE_IMPORTS_START _Observable,_Subscription PURE_IMPORTS_END */
|
|
827
|
-
function scheduleArray(input, scheduler) {
|
|
828
|
-
return new Observable(function (subscriber) {
|
|
829
|
-
var sub = new Subscription();
|
|
830
|
-
var i = 0;
|
|
831
|
-
sub.add(scheduler.schedule(function () {
|
|
832
|
-
if (i === input.length) {
|
|
833
|
-
subscriber.complete();
|
|
834
|
-
return;
|
|
835
|
-
}
|
|
836
|
-
subscriber.next(input[i++]);
|
|
837
|
-
if (!subscriber.closed) {
|
|
838
|
-
sub.add(this.schedule());
|
|
839
|
-
}
|
|
840
|
-
}));
|
|
841
|
-
return sub;
|
|
842
|
-
});
|
|
843
|
-
}
|
|
844
|
-
|
|
845
|
-
/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
|
|
846
|
-
function map(project, thisArg) {
|
|
847
|
-
return function mapOperation(source) {
|
|
848
|
-
if (typeof project !== 'function') {
|
|
849
|
-
throw new TypeError('argument is not a function. Are you looking for `mapTo()`?');
|
|
850
|
-
}
|
|
851
|
-
return source.lift(new MapOperator(project, thisArg));
|
|
852
|
-
};
|
|
853
|
-
}
|
|
854
|
-
var MapOperator = /*@__PURE__*/ (function () {
|
|
855
|
-
function MapOperator(project, thisArg) {
|
|
856
|
-
this.project = project;
|
|
857
|
-
this.thisArg = thisArg;
|
|
858
|
-
}
|
|
859
|
-
MapOperator.prototype.call = function (subscriber, source) {
|
|
860
|
-
return source.subscribe(new MapSubscriber(subscriber, this.project, this.thisArg));
|
|
861
|
-
};
|
|
862
|
-
return MapOperator;
|
|
863
|
-
}());
|
|
864
|
-
var MapSubscriber = /*@__PURE__*/ (function (_super) {
|
|
865
|
-
__extends(MapSubscriber, _super);
|
|
866
|
-
function MapSubscriber(destination, project, thisArg) {
|
|
867
|
-
var _this = _super.call(this, destination) || this;
|
|
868
|
-
_this.project = project;
|
|
869
|
-
_this.count = 0;
|
|
870
|
-
_this.thisArg = thisArg || _this;
|
|
871
|
-
return _this;
|
|
872
|
-
}
|
|
873
|
-
MapSubscriber.prototype._next = function (value) {
|
|
874
|
-
var result;
|
|
875
|
-
try {
|
|
876
|
-
result = this.project.call(this.thisArg, value, this.count++);
|
|
877
|
-
}
|
|
878
|
-
catch (err) {
|
|
879
|
-
this.destination.error(err);
|
|
880
|
-
return;
|
|
881
|
-
}
|
|
882
|
-
this.destination.next(result);
|
|
883
|
-
};
|
|
884
|
-
return MapSubscriber;
|
|
885
|
-
}(Subscriber));
|
|
886
|
-
|
|
887
|
-
/** PURE_IMPORTS_START _hostReportError PURE_IMPORTS_END */
|
|
888
|
-
var subscribeToPromise = function (promise) {
|
|
889
|
-
return function (subscriber) {
|
|
890
|
-
promise.then(function (value) {
|
|
891
|
-
if (!subscriber.closed) {
|
|
892
|
-
subscriber.next(value);
|
|
893
|
-
subscriber.complete();
|
|
894
|
-
}
|
|
895
|
-
}, function (err) { return subscriber.error(err); })
|
|
896
|
-
.then(null, hostReportError);
|
|
897
|
-
return subscriber;
|
|
898
|
-
};
|
|
899
|
-
};
|
|
900
|
-
|
|
901
|
-
/** PURE_IMPORTS_START PURE_IMPORTS_END */
|
|
902
|
-
function getSymbolIterator() {
|
|
903
|
-
if (typeof Symbol !== 'function' || !Symbol.iterator) {
|
|
904
|
-
return '@@iterator';
|
|
905
|
-
}
|
|
906
|
-
return Symbol.iterator;
|
|
907
|
-
}
|
|
908
|
-
var iterator = /*@__PURE__*/ getSymbolIterator();
|
|
909
|
-
|
|
910
|
-
/** PURE_IMPORTS_START _symbol_iterator PURE_IMPORTS_END */
|
|
911
|
-
var subscribeToIterable = function (iterable) {
|
|
912
|
-
return function (subscriber) {
|
|
913
|
-
var iterator$1 = iterable[iterator]();
|
|
914
|
-
do {
|
|
915
|
-
var item = void 0;
|
|
916
|
-
try {
|
|
917
|
-
item = iterator$1.next();
|
|
918
|
-
}
|
|
919
|
-
catch (err) {
|
|
920
|
-
subscriber.error(err);
|
|
921
|
-
return subscriber;
|
|
922
|
-
}
|
|
923
|
-
if (item.done) {
|
|
924
|
-
subscriber.complete();
|
|
925
|
-
break;
|
|
926
|
-
}
|
|
927
|
-
subscriber.next(item.value);
|
|
928
|
-
if (subscriber.closed) {
|
|
929
|
-
break;
|
|
930
|
-
}
|
|
931
|
-
} while (true);
|
|
932
|
-
if (typeof iterator$1.return === 'function') {
|
|
933
|
-
subscriber.add(function () {
|
|
934
|
-
if (iterator$1.return) {
|
|
935
|
-
iterator$1.return();
|
|
936
|
-
}
|
|
937
|
-
});
|
|
938
|
-
}
|
|
939
|
-
return subscriber;
|
|
940
|
-
};
|
|
941
|
-
};
|
|
942
|
-
|
|
943
|
-
/** PURE_IMPORTS_START _symbol_observable PURE_IMPORTS_END */
|
|
944
|
-
var subscribeToObservable = function (obj) {
|
|
945
|
-
return function (subscriber) {
|
|
946
|
-
var obs = obj[observable]();
|
|
947
|
-
if (typeof obs.subscribe !== 'function') {
|
|
948
|
-
throw new TypeError('Provided object does not correctly implement Symbol.observable');
|
|
949
|
-
}
|
|
950
|
-
else {
|
|
951
|
-
return obs.subscribe(subscriber);
|
|
952
|
-
}
|
|
953
|
-
};
|
|
954
|
-
};
|
|
955
|
-
|
|
956
|
-
/** PURE_IMPORTS_START PURE_IMPORTS_END */
|
|
957
|
-
var isArrayLike = (function (x) { return x && typeof x.length === 'number' && typeof x !== 'function'; });
|
|
958
|
-
|
|
959
|
-
/** PURE_IMPORTS_START PURE_IMPORTS_END */
|
|
960
|
-
function isPromise(value) {
|
|
961
|
-
return !!value && typeof value.subscribe !== 'function' && typeof value.then === 'function';
|
|
962
|
-
}
|
|
963
|
-
|
|
964
|
-
/** PURE_IMPORTS_START _subscribeToArray,_subscribeToPromise,_subscribeToIterable,_subscribeToObservable,_isArrayLike,_isPromise,_isObject,_symbol_iterator,_symbol_observable PURE_IMPORTS_END */
|
|
965
|
-
var subscribeTo = function (result) {
|
|
966
|
-
if (!!result && typeof result[observable] === 'function') {
|
|
967
|
-
return subscribeToObservable(result);
|
|
968
|
-
}
|
|
969
|
-
else if (isArrayLike(result)) {
|
|
970
|
-
return subscribeToArray(result);
|
|
971
|
-
}
|
|
972
|
-
else if (isPromise(result)) {
|
|
973
|
-
return subscribeToPromise(result);
|
|
974
|
-
}
|
|
975
|
-
else if (!!result && typeof result[iterator] === 'function') {
|
|
976
|
-
return subscribeToIterable(result);
|
|
977
|
-
}
|
|
978
|
-
else {
|
|
979
|
-
var value = isObject(result) ? 'an invalid object' : "'" + result + "'";
|
|
980
|
-
var msg = "You provided " + value + " where a stream was expected."
|
|
981
|
-
+ ' You can provide an Observable, Promise, Array, or Iterable.';
|
|
982
|
-
throw new TypeError(msg);
|
|
983
|
-
}
|
|
984
|
-
};
|
|
985
|
-
|
|
986
|
-
/** PURE_IMPORTS_START _Observable,_Subscription,_symbol_observable PURE_IMPORTS_END */
|
|
987
|
-
function scheduleObservable(input, scheduler) {
|
|
988
|
-
return new Observable(function (subscriber) {
|
|
989
|
-
var sub = new Subscription();
|
|
990
|
-
sub.add(scheduler.schedule(function () {
|
|
991
|
-
var observable$1 = input[observable]();
|
|
992
|
-
sub.add(observable$1.subscribe({
|
|
993
|
-
next: function (value) { sub.add(scheduler.schedule(function () { return subscriber.next(value); })); },
|
|
994
|
-
error: function (err) { sub.add(scheduler.schedule(function () { return subscriber.error(err); })); },
|
|
995
|
-
complete: function () { sub.add(scheduler.schedule(function () { return subscriber.complete(); })); },
|
|
996
|
-
}));
|
|
997
|
-
}));
|
|
998
|
-
return sub;
|
|
999
|
-
});
|
|
1000
|
-
}
|
|
1001
|
-
|
|
1002
|
-
/** PURE_IMPORTS_START _Observable,_Subscription PURE_IMPORTS_END */
|
|
1003
|
-
function schedulePromise(input, scheduler) {
|
|
1004
|
-
return new Observable(function (subscriber) {
|
|
1005
|
-
var sub = new Subscription();
|
|
1006
|
-
sub.add(scheduler.schedule(function () {
|
|
1007
|
-
return input.then(function (value) {
|
|
1008
|
-
sub.add(scheduler.schedule(function () {
|
|
1009
|
-
subscriber.next(value);
|
|
1010
|
-
sub.add(scheduler.schedule(function () { return subscriber.complete(); }));
|
|
1011
|
-
}));
|
|
1012
|
-
}, function (err) {
|
|
1013
|
-
sub.add(scheduler.schedule(function () { return subscriber.error(err); }));
|
|
1014
|
-
});
|
|
1015
|
-
}));
|
|
1016
|
-
return sub;
|
|
1017
|
-
});
|
|
1018
|
-
}
|
|
1019
|
-
|
|
1020
|
-
/** PURE_IMPORTS_START _Observable,_Subscription,_symbol_iterator PURE_IMPORTS_END */
|
|
1021
|
-
function scheduleIterable(input, scheduler) {
|
|
1022
|
-
if (!input) {
|
|
1023
|
-
throw new Error('Iterable cannot be null');
|
|
1024
|
-
}
|
|
1025
|
-
return new Observable(function (subscriber) {
|
|
1026
|
-
var sub = new Subscription();
|
|
1027
|
-
var iterator$1;
|
|
1028
|
-
sub.add(function () {
|
|
1029
|
-
if (iterator$1 && typeof iterator$1.return === 'function') {
|
|
1030
|
-
iterator$1.return();
|
|
1031
|
-
}
|
|
1032
|
-
});
|
|
1033
|
-
sub.add(scheduler.schedule(function () {
|
|
1034
|
-
iterator$1 = input[iterator]();
|
|
1035
|
-
sub.add(scheduler.schedule(function () {
|
|
1036
|
-
if (subscriber.closed) {
|
|
1037
|
-
return;
|
|
1038
|
-
}
|
|
1039
|
-
var value;
|
|
1040
|
-
var done;
|
|
1041
|
-
try {
|
|
1042
|
-
var result = iterator$1.next();
|
|
1043
|
-
value = result.value;
|
|
1044
|
-
done = result.done;
|
|
1045
|
-
}
|
|
1046
|
-
catch (err) {
|
|
1047
|
-
subscriber.error(err);
|
|
1048
|
-
return;
|
|
1049
|
-
}
|
|
1050
|
-
if (done) {
|
|
1051
|
-
subscriber.complete();
|
|
1052
|
-
}
|
|
1053
|
-
else {
|
|
1054
|
-
subscriber.next(value);
|
|
1055
|
-
this.schedule();
|
|
1056
|
-
}
|
|
1057
|
-
}));
|
|
1058
|
-
}));
|
|
1059
|
-
return sub;
|
|
1060
|
-
});
|
|
1061
|
-
}
|
|
1062
|
-
|
|
1063
|
-
/** PURE_IMPORTS_START _symbol_observable PURE_IMPORTS_END */
|
|
1064
|
-
function isInteropObservable(input) {
|
|
1065
|
-
return input && typeof input[observable] === 'function';
|
|
1066
|
-
}
|
|
1067
|
-
|
|
1068
|
-
/** PURE_IMPORTS_START _symbol_iterator PURE_IMPORTS_END */
|
|
1069
|
-
function isIterable(input) {
|
|
1070
|
-
return input && typeof input[iterator] === 'function';
|
|
1071
|
-
}
|
|
1072
|
-
|
|
1073
|
-
/** PURE_IMPORTS_START _scheduleObservable,_schedulePromise,_scheduleArray,_scheduleIterable,_util_isInteropObservable,_util_isPromise,_util_isArrayLike,_util_isIterable PURE_IMPORTS_END */
|
|
1074
|
-
function scheduled(input, scheduler) {
|
|
1075
|
-
if (input != null) {
|
|
1076
|
-
if (isInteropObservable(input)) {
|
|
1077
|
-
return scheduleObservable(input, scheduler);
|
|
1078
|
-
}
|
|
1079
|
-
else if (isPromise(input)) {
|
|
1080
|
-
return schedulePromise(input, scheduler);
|
|
1081
|
-
}
|
|
1082
|
-
else if (isArrayLike(input)) {
|
|
1083
|
-
return scheduleArray(input, scheduler);
|
|
1084
|
-
}
|
|
1085
|
-
else if (isIterable(input) || typeof input === 'string') {
|
|
1086
|
-
return scheduleIterable(input, scheduler);
|
|
1087
|
-
}
|
|
1088
|
-
}
|
|
1089
|
-
throw new TypeError((input !== null && typeof input || input) + ' is not observable');
|
|
1090
|
-
}
|
|
1091
|
-
|
|
1092
|
-
/** PURE_IMPORTS_START _Observable,_util_subscribeTo,_scheduled_scheduled PURE_IMPORTS_END */
|
|
1093
|
-
function from(input, scheduler) {
|
|
1094
|
-
if (!scheduler) {
|
|
1095
|
-
if (input instanceof Observable) {
|
|
1096
|
-
return input;
|
|
1097
|
-
}
|
|
1098
|
-
return new Observable(subscribeTo(input));
|
|
1099
|
-
}
|
|
1100
|
-
else {
|
|
1101
|
-
return scheduled(input, scheduler);
|
|
1102
|
-
}
|
|
1103
|
-
}
|
|
1104
|
-
|
|
1105
|
-
/** PURE_IMPORTS_START tslib,_Subscriber,_Observable,_util_subscribeTo PURE_IMPORTS_END */
|
|
1106
|
-
var SimpleInnerSubscriber = /*@__PURE__*/ (function (_super) {
|
|
1107
|
-
__extends(SimpleInnerSubscriber, _super);
|
|
1108
|
-
function SimpleInnerSubscriber(parent) {
|
|
1109
|
-
var _this = _super.call(this) || this;
|
|
1110
|
-
_this.parent = parent;
|
|
1111
|
-
return _this;
|
|
1112
|
-
}
|
|
1113
|
-
SimpleInnerSubscriber.prototype._next = function (value) {
|
|
1114
|
-
this.parent.notifyNext(value);
|
|
1115
|
-
};
|
|
1116
|
-
SimpleInnerSubscriber.prototype._error = function (error) {
|
|
1117
|
-
this.parent.notifyError(error);
|
|
1118
|
-
this.unsubscribe();
|
|
1119
|
-
};
|
|
1120
|
-
SimpleInnerSubscriber.prototype._complete = function () {
|
|
1121
|
-
this.parent.notifyComplete();
|
|
1122
|
-
this.unsubscribe();
|
|
1123
|
-
};
|
|
1124
|
-
return SimpleInnerSubscriber;
|
|
1125
|
-
}(Subscriber));
|
|
1126
|
-
var SimpleOuterSubscriber = /*@__PURE__*/ (function (_super) {
|
|
1127
|
-
__extends(SimpleOuterSubscriber, _super);
|
|
1128
|
-
function SimpleOuterSubscriber() {
|
|
1129
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1130
|
-
}
|
|
1131
|
-
SimpleOuterSubscriber.prototype.notifyNext = function (innerValue) {
|
|
1132
|
-
this.destination.next(innerValue);
|
|
1133
|
-
};
|
|
1134
|
-
SimpleOuterSubscriber.prototype.notifyError = function (err) {
|
|
1135
|
-
this.destination.error(err);
|
|
1136
|
-
};
|
|
1137
|
-
SimpleOuterSubscriber.prototype.notifyComplete = function () {
|
|
1138
|
-
this.destination.complete();
|
|
1139
|
-
};
|
|
1140
|
-
return SimpleOuterSubscriber;
|
|
1141
|
-
}(Subscriber));
|
|
1142
|
-
function innerSubscribe(result, innerSubscriber) {
|
|
1143
|
-
if (innerSubscriber.closed) {
|
|
1144
|
-
return undefined;
|
|
1145
|
-
}
|
|
1146
|
-
if (result instanceof Observable) {
|
|
1147
|
-
return result.subscribe(innerSubscriber);
|
|
1148
|
-
}
|
|
1149
|
-
return subscribeTo(result)(innerSubscriber);
|
|
1150
|
-
}
|
|
1151
|
-
|
|
1152
|
-
/** PURE_IMPORTS_START tslib,_map,_observable_from,_innerSubscribe PURE_IMPORTS_END */
|
|
1153
|
-
function mergeMap(project, resultSelector, concurrent) {
|
|
1154
|
-
if (concurrent === void 0) {
|
|
1155
|
-
concurrent = Number.POSITIVE_INFINITY;
|
|
1156
|
-
}
|
|
1157
|
-
if (typeof resultSelector === 'function') {
|
|
1158
|
-
return function (source) { return source.pipe(mergeMap(function (a, i) { return from(project(a, i)).pipe(map(function (b, ii) { return resultSelector(a, b, i, ii); })); }, concurrent)); };
|
|
1159
|
-
}
|
|
1160
|
-
else if (typeof resultSelector === 'number') {
|
|
1161
|
-
concurrent = resultSelector;
|
|
1162
|
-
}
|
|
1163
|
-
return function (source) { return source.lift(new MergeMapOperator(project, concurrent)); };
|
|
1164
|
-
}
|
|
1165
|
-
var MergeMapOperator = /*@__PURE__*/ (function () {
|
|
1166
|
-
function MergeMapOperator(project, concurrent) {
|
|
1167
|
-
if (concurrent === void 0) {
|
|
1168
|
-
concurrent = Number.POSITIVE_INFINITY;
|
|
1169
|
-
}
|
|
1170
|
-
this.project = project;
|
|
1171
|
-
this.concurrent = concurrent;
|
|
1172
|
-
}
|
|
1173
|
-
MergeMapOperator.prototype.call = function (observer, source) {
|
|
1174
|
-
return source.subscribe(new MergeMapSubscriber(observer, this.project, this.concurrent));
|
|
1175
|
-
};
|
|
1176
|
-
return MergeMapOperator;
|
|
1177
|
-
}());
|
|
1178
|
-
var MergeMapSubscriber = /*@__PURE__*/ (function (_super) {
|
|
1179
|
-
__extends(MergeMapSubscriber, _super);
|
|
1180
|
-
function MergeMapSubscriber(destination, project, concurrent) {
|
|
1181
|
-
if (concurrent === void 0) {
|
|
1182
|
-
concurrent = Number.POSITIVE_INFINITY;
|
|
1183
|
-
}
|
|
1184
|
-
var _this = _super.call(this, destination) || this;
|
|
1185
|
-
_this.project = project;
|
|
1186
|
-
_this.concurrent = concurrent;
|
|
1187
|
-
_this.hasCompleted = false;
|
|
1188
|
-
_this.buffer = [];
|
|
1189
|
-
_this.active = 0;
|
|
1190
|
-
_this.index = 0;
|
|
1191
|
-
return _this;
|
|
1192
|
-
}
|
|
1193
|
-
MergeMapSubscriber.prototype._next = function (value) {
|
|
1194
|
-
if (this.active < this.concurrent) {
|
|
1195
|
-
this._tryNext(value);
|
|
1196
|
-
}
|
|
1197
|
-
else {
|
|
1198
|
-
this.buffer.push(value);
|
|
1199
|
-
}
|
|
1200
|
-
};
|
|
1201
|
-
MergeMapSubscriber.prototype._tryNext = function (value) {
|
|
1202
|
-
var result;
|
|
1203
|
-
var index = this.index++;
|
|
1204
|
-
try {
|
|
1205
|
-
result = this.project(value, index);
|
|
1206
|
-
}
|
|
1207
|
-
catch (err) {
|
|
1208
|
-
this.destination.error(err);
|
|
1209
|
-
return;
|
|
1210
|
-
}
|
|
1211
|
-
this.active++;
|
|
1212
|
-
this._innerSub(result);
|
|
1213
|
-
};
|
|
1214
|
-
MergeMapSubscriber.prototype._innerSub = function (ish) {
|
|
1215
|
-
var innerSubscriber = new SimpleInnerSubscriber(this);
|
|
1216
|
-
var destination = this.destination;
|
|
1217
|
-
destination.add(innerSubscriber);
|
|
1218
|
-
var innerSubscription = innerSubscribe(ish, innerSubscriber);
|
|
1219
|
-
if (innerSubscription !== innerSubscriber) {
|
|
1220
|
-
destination.add(innerSubscription);
|
|
1221
|
-
}
|
|
1222
|
-
};
|
|
1223
|
-
MergeMapSubscriber.prototype._complete = function () {
|
|
1224
|
-
this.hasCompleted = true;
|
|
1225
|
-
if (this.active === 0 && this.buffer.length === 0) {
|
|
1226
|
-
this.destination.complete();
|
|
1227
|
-
}
|
|
1228
|
-
this.unsubscribe();
|
|
1229
|
-
};
|
|
1230
|
-
MergeMapSubscriber.prototype.notifyNext = function (innerValue) {
|
|
1231
|
-
this.destination.next(innerValue);
|
|
1232
|
-
};
|
|
1233
|
-
MergeMapSubscriber.prototype.notifyComplete = function () {
|
|
1234
|
-
var buffer = this.buffer;
|
|
1235
|
-
this.active--;
|
|
1236
|
-
if (buffer.length > 0) {
|
|
1237
|
-
this._next(buffer.shift());
|
|
1238
|
-
}
|
|
1239
|
-
else if (this.active === 0 && this.hasCompleted) {
|
|
1240
|
-
this.destination.complete();
|
|
1241
|
-
}
|
|
1242
|
-
};
|
|
1243
|
-
return MergeMapSubscriber;
|
|
1244
|
-
}(SimpleOuterSubscriber));
|
|
1245
|
-
|
|
1246
|
-
function execRx(cmd, options, emitStdErr) {
|
|
1247
|
-
if (emitStdErr === void 0) { emitStdErr = true; }
|
|
1248
|
-
return new Observable(function (observer) {
|
|
1249
|
-
exec(cmd, options, function (err, stdout, stderr) {
|
|
1250
|
-
if (err) {
|
|
1251
|
-
observer.error(err);
|
|
1252
|
-
}
|
|
1253
|
-
else {
|
|
1254
|
-
observer.next("" + stdout + (emitStdErr && " " + stderr));
|
|
1255
|
-
observer.complete();
|
|
1256
|
-
}
|
|
1257
|
-
});
|
|
1258
|
-
});
|
|
1259
|
-
}
|
|
1260
|
-
|
|
1261
|
-
var Docker = /** @class */ (function () {
|
|
1262
|
-
function Docker(containerName, binaryName) {
|
|
1263
|
-
this.containerName = containerName;
|
|
1264
|
-
this.binaryName = binaryName;
|
|
1265
|
-
}
|
|
1266
|
-
Docker.prototype.execRx = function (cmd, options, emitStdErr) {
|
|
1267
|
-
if (emitStdErr === void 0) { emitStdErr = true; }
|
|
1268
|
-
return execRx("docker exec " + this.containerName + " " + this.binaryName + " " + cmd, options, emitStdErr);
|
|
1269
|
-
};
|
|
1270
|
-
return Docker;
|
|
1271
|
-
}());
|
|
1272
|
-
|
|
1273
|
-
function execPromise(cmd, options) {
|
|
1274
|
-
return new Promise(function (resolve, reject) {
|
|
1275
|
-
exec(cmd, options, function (err, stdout) {
|
|
1276
|
-
if (err) {
|
|
1277
|
-
reject(err);
|
|
1278
|
-
}
|
|
1279
|
-
else {
|
|
1280
|
-
resolve(stdout.toString());
|
|
1281
|
-
}
|
|
1282
|
-
});
|
|
1283
|
-
});
|
|
1284
|
-
}
|
|
1285
|
-
|
|
1286
|
-
/** PURE_IMPORTS_START _mergeMap PURE_IMPORTS_END */
|
|
1287
|
-
function concatMap(project, resultSelector) {
|
|
1288
|
-
return mergeMap(project, resultSelector, 1);
|
|
1289
|
-
}
|
|
1290
|
-
|
|
1291
|
-
var execRxAsJson = function (cmd, options, emitStdErr) {
|
|
1292
|
-
if (emitStdErr === void 0) { emitStdErr = true; }
|
|
1293
|
-
return execRx(cmd, options, emitStdErr).pipe(map(function (s) { return JSON.parse(s); }));
|
|
1294
|
-
};
|
|
1295
|
-
|
|
1296
|
-
var execRxAsLines = function (cmd, options, emitStdErr) {
|
|
1297
|
-
if (emitStdErr === void 0) { emitStdErr = true; }
|
|
1298
|
-
return execRx(cmd, options, emitStdErr).pipe(concatMap(function (s) { return from(s.split('\n')); }));
|
|
1299
|
-
};
|
|
1300
|
-
|
|
1301
|
-
var exit = function (code) { return process.exit.bind(process, code); };
|
|
1302
|
-
|
|
1303
|
-
var stdin = new Subject();
|
|
1304
|
-
var stdout = new Subject();
|
|
1305
|
-
var listen = function () {
|
|
1306
|
-
process.stdin.on('data', function (d) { return stdin.next(d); });
|
|
1307
|
-
process.stdin.on('close', function () { return stdin.complete(); });
|
|
1308
|
-
return { stdout: stdout, stdin: stdin };
|
|
1309
|
-
};
|
|
1310
|
-
|
|
1311
|
-
/*! *****************************************************************************
|
|
1312
|
-
Copyright (c) Microsoft Corporation.
|
|
1313
|
-
|
|
1314
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
1315
|
-
purpose with or without fee is hereby granted.
|
|
1316
|
-
|
|
1317
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
1318
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
1319
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
1320
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
1321
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
1322
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
1323
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
1324
|
-
***************************************************************************** */
|
|
1325
|
-
|
|
1326
|
-
/** @deprecated */
|
|
1327
|
-
function __spreadArrays() {
|
|
1328
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
1329
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
1330
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
1331
|
-
r[k] = a[j];
|
|
1332
|
-
return r;
|
|
1333
|
-
}
|
|
1334
|
-
|
|
1335
|
-
var binaryName = 'psql';
|
|
1336
|
-
var PSql = /** @class */ (function () {
|
|
1337
|
-
function PSql(containerName) {
|
|
1338
|
-
this.containerName = containerName;
|
|
1339
|
-
this.container = new Docker(this.containerName, binaryName);
|
|
1340
|
-
}
|
|
1341
|
-
PSql.prototype.execRx = function (cmd, db, username) {
|
|
1342
|
-
var dbOptions = db ? ['-d', db] : [];
|
|
1343
|
-
var commonArgs = __spreadArrays(['-qtAX', '-U', username], dbOptions, ['-c']).join(' ') + cmd;
|
|
1344
|
-
return this.containerName
|
|
1345
|
-
? this.container.execRx(commonArgs)
|
|
1346
|
-
: execRx([binaryName, commonArgs].join(' '));
|
|
1347
|
-
};
|
|
1348
|
-
return PSql;
|
|
1349
|
-
}());
|
|
1350
|
-
|
|
1351
|
-
export { Docker, PSql, execPromise, execRx, execRxAsJson, execRxAsLines, exit, listen };
|
|
1352
|
-
//# sourceMappingURL=index.es.js.map
|