@infrab4a/connect 4.3.0-beta.0 → 4.3.0-beta.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/index.cjs.js +758 -665
- package/index.esm.js +577 -500
- package/package.json +1 -1
- package/src/domain/catalog/models/index.d.ts +0 -1
- package/src/domain/catalog/models/types/shop-description.type.d.ts +0 -1
- package/src/domain/catalog/repositories/index.d.ts +0 -1
- package/src/domain/shop-settings/models/types/index.d.ts +0 -3
- package/src/domain/shop-settings/models/types/sections.type.d.ts +0 -6
- package/src/infra/hasura-graphql/repositories/catalog/index.d.ts +0 -1
- package/src/domain/catalog/models/product-reviews.d.ts +0 -20
- package/src/domain/catalog/repositories/product-reviews.repository.d.ts +0 -6
- package/src/domain/shop-settings/models/types/brands-carousel.type.d.ts +0 -3
- package/src/domain/shop-settings/models/types/landing-page.d.ts +0 -8
- package/src/domain/shop-settings/models/types/promotion-page.d.ts +0 -10
- package/src/infra/hasura-graphql/repositories/catalog/product-review-hasura-graphql.repository.d.ts +0 -12
package/index.cjs.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
require('reflect-metadata');
|
|
6
6
|
var classTransformer = require('class-transformer');
|
|
7
|
-
var
|
|
7
|
+
var tslib_1 = require('tslib');
|
|
8
8
|
var dateFns = require('date-fns');
|
|
9
9
|
var lodash = require('lodash');
|
|
10
10
|
var debug = require('debug');
|
|
@@ -16,6 +16,25 @@ var gqlQueryBuilder = require('gql-query-builder');
|
|
|
16
16
|
|
|
17
17
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
18
18
|
|
|
19
|
+
function _interopNamespace(e) {
|
|
20
|
+
if (e && e.__esModule) return e;
|
|
21
|
+
var n = Object.create(null);
|
|
22
|
+
if (e) {
|
|
23
|
+
Object.keys(e).forEach(function (k) {
|
|
24
|
+
if (k !== 'default') {
|
|
25
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
26
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
get: function () { return e[k]; }
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
n["default"] = e;
|
|
34
|
+
return Object.freeze(n);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
var tslib_1__namespace = /*#__PURE__*/_interopNamespace(tslib_1);
|
|
19
38
|
var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
|
|
20
39
|
|
|
21
40
|
class BaseModel {
|
|
@@ -297,165 +316,165 @@ class Payment extends BaseModel {
|
|
|
297
316
|
return ['id'];
|
|
298
317
|
}
|
|
299
318
|
}
|
|
300
|
-
|
|
319
|
+
tslib_1.__decorate([
|
|
301
320
|
classTransformer.Expose({ name: 'refuse_reason' }),
|
|
302
|
-
|
|
321
|
+
tslib_1.__metadata("design:type", String)
|
|
303
322
|
], Payment.prototype, "refuseReason", void 0);
|
|
304
|
-
|
|
323
|
+
tslib_1.__decorate([
|
|
305
324
|
classTransformer.Expose({ name: 'status_reason' }),
|
|
306
|
-
|
|
325
|
+
tslib_1.__metadata("design:type", String)
|
|
307
326
|
], Payment.prototype, "statusReason", void 0);
|
|
308
|
-
|
|
327
|
+
tslib_1.__decorate([
|
|
309
328
|
classTransformer.Expose({ name: 'acquirer_response_code' }),
|
|
310
|
-
|
|
329
|
+
tslib_1.__metadata("design:type", String)
|
|
311
330
|
], Payment.prototype, "acquirerResponseCode", void 0);
|
|
312
|
-
|
|
331
|
+
tslib_1.__decorate([
|
|
313
332
|
classTransformer.Expose({ name: 'acquirer_name' }),
|
|
314
|
-
|
|
333
|
+
tslib_1.__metadata("design:type", String)
|
|
315
334
|
], Payment.prototype, "acquirerName", void 0);
|
|
316
|
-
|
|
335
|
+
tslib_1.__decorate([
|
|
317
336
|
classTransformer.Expose({ name: 'acquirer_id' }),
|
|
318
|
-
|
|
337
|
+
tslib_1.__metadata("design:type", String)
|
|
319
338
|
], Payment.prototype, "acquirerId", void 0);
|
|
320
|
-
|
|
339
|
+
tslib_1.__decorate([
|
|
321
340
|
classTransformer.Expose({ name: 'authorization_code' }),
|
|
322
|
-
|
|
341
|
+
tslib_1.__metadata("design:type", String)
|
|
323
342
|
], Payment.prototype, "authorizationCode", void 0);
|
|
324
|
-
|
|
343
|
+
tslib_1.__decorate([
|
|
325
344
|
classTransformer.Expose({ name: 'soft_descriptor' }),
|
|
326
|
-
|
|
345
|
+
tslib_1.__metadata("design:type", String)
|
|
327
346
|
], Payment.prototype, "softDescriptor", void 0);
|
|
328
|
-
|
|
347
|
+
tslib_1.__decorate([
|
|
329
348
|
classTransformer.Expose({ name: 'date_created' }),
|
|
330
|
-
|
|
349
|
+
tslib_1.__metadata("design:type", String)
|
|
331
350
|
], Payment.prototype, "dateCreated", void 0);
|
|
332
|
-
|
|
351
|
+
tslib_1.__decorate([
|
|
333
352
|
classTransformer.Expose({ name: 'date_updated' }),
|
|
334
|
-
|
|
353
|
+
tslib_1.__metadata("design:type", String)
|
|
335
354
|
], Payment.prototype, "dateUpdated", void 0);
|
|
336
|
-
|
|
355
|
+
tslib_1.__decorate([
|
|
337
356
|
classTransformer.Expose({ name: 'authorized_amount' }),
|
|
338
|
-
|
|
357
|
+
tslib_1.__metadata("design:type", Number)
|
|
339
358
|
], Payment.prototype, "authorizedAmount", void 0);
|
|
340
|
-
|
|
359
|
+
tslib_1.__decorate([
|
|
341
360
|
classTransformer.Expose({ name: 'paid_amount' }),
|
|
342
|
-
|
|
361
|
+
tslib_1.__metadata("design:type", Number)
|
|
343
362
|
], Payment.prototype, "paidAmount", void 0);
|
|
344
|
-
|
|
363
|
+
tslib_1.__decorate([
|
|
345
364
|
classTransformer.Expose({ name: 'refunded_amount' }),
|
|
346
|
-
|
|
365
|
+
tslib_1.__metadata("design:type", Number)
|
|
347
366
|
], Payment.prototype, "refundedAmount", void 0);
|
|
348
|
-
|
|
367
|
+
tslib_1.__decorate([
|
|
349
368
|
classTransformer.Expose({ name: 'card_holder_name' }),
|
|
350
|
-
|
|
369
|
+
tslib_1.__metadata("design:type", String)
|
|
351
370
|
], Payment.prototype, "cardHolderName", void 0);
|
|
352
|
-
|
|
371
|
+
tslib_1.__decorate([
|
|
353
372
|
classTransformer.Expose({ name: 'card_last_digits' }),
|
|
354
|
-
|
|
373
|
+
tslib_1.__metadata("design:type", String)
|
|
355
374
|
], Payment.prototype, "cardLastDigits", void 0);
|
|
356
|
-
|
|
375
|
+
tslib_1.__decorate([
|
|
357
376
|
classTransformer.Expose({ name: 'card_first_digits' }),
|
|
358
|
-
|
|
377
|
+
tslib_1.__metadata("design:type", String)
|
|
359
378
|
], Payment.prototype, "cardFirstDigits", void 0);
|
|
360
|
-
|
|
379
|
+
tslib_1.__decorate([
|
|
361
380
|
classTransformer.Expose({ name: 'card_brand' }),
|
|
362
|
-
|
|
381
|
+
tslib_1.__metadata("design:type", String)
|
|
363
382
|
], Payment.prototype, "cardBrand", void 0);
|
|
364
|
-
|
|
383
|
+
tslib_1.__decorate([
|
|
365
384
|
classTransformer.Expose({ name: 'card_pin_mode' }),
|
|
366
|
-
|
|
385
|
+
tslib_1.__metadata("design:type", String)
|
|
367
386
|
], Payment.prototype, "cardPinMode", void 0);
|
|
368
|
-
|
|
387
|
+
tslib_1.__decorate([
|
|
369
388
|
classTransformer.Expose({ name: 'card_magstripe_fallback' }),
|
|
370
|
-
|
|
389
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
371
390
|
], Payment.prototype, "cardMagstripeFallback", void 0);
|
|
372
|
-
|
|
391
|
+
tslib_1.__decorate([
|
|
373
392
|
classTransformer.Expose({ name: 'cvm_pin' }),
|
|
374
|
-
|
|
393
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
375
394
|
], Payment.prototype, "cvmPin", void 0);
|
|
376
|
-
|
|
395
|
+
tslib_1.__decorate([
|
|
377
396
|
classTransformer.Expose({ name: 'postback_url' }),
|
|
378
|
-
|
|
397
|
+
tslib_1.__metadata("design:type", String)
|
|
379
398
|
], Payment.prototype, "postbackUrl", void 0);
|
|
380
|
-
|
|
399
|
+
tslib_1.__decorate([
|
|
381
400
|
classTransformer.Expose({ name: 'payment_method' }),
|
|
382
|
-
|
|
401
|
+
tslib_1.__metadata("design:type", String)
|
|
383
402
|
], Payment.prototype, "paymentMethod", void 0);
|
|
384
|
-
|
|
403
|
+
tslib_1.__decorate([
|
|
385
404
|
classTransformer.Expose({ name: 'capture_method' }),
|
|
386
|
-
|
|
405
|
+
tslib_1.__metadata("design:type", String)
|
|
387
406
|
], Payment.prototype, "captureMethod", void 0);
|
|
388
|
-
|
|
407
|
+
tslib_1.__decorate([
|
|
389
408
|
classTransformer.Expose({ name: 'antifraud_score' }),
|
|
390
|
-
|
|
409
|
+
tslib_1.__metadata("design:type", String)
|
|
391
410
|
], Payment.prototype, "antifraudScore", void 0);
|
|
392
|
-
|
|
411
|
+
tslib_1.__decorate([
|
|
393
412
|
classTransformer.Expose({ name: 'boleto_url' }),
|
|
394
|
-
|
|
413
|
+
tslib_1.__metadata("design:type", String)
|
|
395
414
|
], Payment.prototype, "boletoUrl", void 0);
|
|
396
|
-
|
|
415
|
+
tslib_1.__decorate([
|
|
397
416
|
classTransformer.Expose({ name: 'boleto_barcode' }),
|
|
398
|
-
|
|
417
|
+
tslib_1.__metadata("design:type", String)
|
|
399
418
|
], Payment.prototype, "boletoBarcode", void 0);
|
|
400
|
-
|
|
419
|
+
tslib_1.__decorate([
|
|
401
420
|
classTransformer.Expose({ name: 'boleto_expiration_date' }),
|
|
402
|
-
|
|
421
|
+
tslib_1.__metadata("design:type", String)
|
|
403
422
|
], Payment.prototype, "boletoExpirationDate", void 0);
|
|
404
|
-
|
|
423
|
+
tslib_1.__decorate([
|
|
405
424
|
classTransformer.Expose({ name: 'subscription_id' }),
|
|
406
|
-
|
|
425
|
+
tslib_1.__metadata("design:type", String)
|
|
407
426
|
], Payment.prototype, "subscriptionId", void 0);
|
|
408
|
-
|
|
427
|
+
tslib_1.__decorate([
|
|
409
428
|
classTransformer.Expose({ name: 'split_rules' }),
|
|
410
|
-
|
|
429
|
+
tslib_1.__metadata("design:type", String)
|
|
411
430
|
], Payment.prototype, "splitRules", void 0);
|
|
412
|
-
|
|
431
|
+
tslib_1.__decorate([
|
|
413
432
|
classTransformer.Expose({ name: 'antifraud_metadata' }),
|
|
414
|
-
|
|
433
|
+
tslib_1.__metadata("design:type", Object)
|
|
415
434
|
], Payment.prototype, "antifraudMetadata", void 0);
|
|
416
|
-
|
|
435
|
+
tslib_1.__decorate([
|
|
417
436
|
classTransformer.Expose({ name: 'reference_key' }),
|
|
418
|
-
|
|
437
|
+
tslib_1.__metadata("design:type", String)
|
|
419
438
|
], Payment.prototype, "referenceKey", void 0);
|
|
420
|
-
|
|
439
|
+
tslib_1.__decorate([
|
|
421
440
|
classTransformer.Expose({ name: 'local_transaction_id' }),
|
|
422
|
-
|
|
441
|
+
tslib_1.__metadata("design:type", String)
|
|
423
442
|
], Payment.prototype, "localTransactionId", void 0);
|
|
424
|
-
|
|
443
|
+
tslib_1.__decorate([
|
|
425
444
|
classTransformer.Expose({ name: 'local_time' }),
|
|
426
|
-
|
|
445
|
+
tslib_1.__metadata("design:type", String)
|
|
427
446
|
], Payment.prototype, "localTime", void 0);
|
|
428
|
-
|
|
447
|
+
tslib_1.__decorate([
|
|
429
448
|
classTransformer.Expose({ name: 'fraud_covered' }),
|
|
430
|
-
|
|
449
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
431
450
|
], Payment.prototype, "fraudCovered", void 0);
|
|
432
|
-
|
|
451
|
+
tslib_1.__decorate([
|
|
433
452
|
classTransformer.Expose({ name: 'fraud_reimbursed' }),
|
|
434
|
-
|
|
453
|
+
tslib_1.__metadata("design:type", String)
|
|
435
454
|
], Payment.prototype, "fraudReimbursed", void 0);
|
|
436
|
-
|
|
455
|
+
tslib_1.__decorate([
|
|
437
456
|
classTransformer.Expose({ name: 'order_id' }),
|
|
438
|
-
|
|
457
|
+
tslib_1.__metadata("design:type", String)
|
|
439
458
|
], Payment.prototype, "orderId", void 0);
|
|
440
|
-
|
|
459
|
+
tslib_1.__decorate([
|
|
441
460
|
classTransformer.Expose({ name: 'risk_level' }),
|
|
442
|
-
|
|
461
|
+
tslib_1.__metadata("design:type", String)
|
|
443
462
|
], Payment.prototype, "riskLevel", void 0);
|
|
444
|
-
|
|
463
|
+
tslib_1.__decorate([
|
|
445
464
|
classTransformer.Expose({ name: 'receipt_url' }),
|
|
446
|
-
|
|
465
|
+
tslib_1.__metadata("design:type", String)
|
|
447
466
|
], Payment.prototype, "receiptUrl", void 0);
|
|
448
|
-
|
|
467
|
+
tslib_1.__decorate([
|
|
449
468
|
classTransformer.Expose({ name: 'private_label' }),
|
|
450
|
-
|
|
469
|
+
tslib_1.__metadata("design:type", String)
|
|
451
470
|
], Payment.prototype, "privateLabel", void 0);
|
|
452
|
-
|
|
471
|
+
tslib_1.__decorate([
|
|
453
472
|
classTransformer.Expose({ name: 'pix_qr_code' }),
|
|
454
|
-
|
|
473
|
+
tslib_1.__metadata("design:type", String)
|
|
455
474
|
], Payment.prototype, "pixQrCode", void 0);
|
|
456
|
-
|
|
475
|
+
tslib_1.__decorate([
|
|
457
476
|
classTransformer.Expose({ name: 'pix_expiration_date' }),
|
|
458
|
-
|
|
477
|
+
tslib_1.__metadata("design:type", String)
|
|
459
478
|
], Payment.prototype, "pixExpirationDate", void 0);
|
|
460
479
|
|
|
461
480
|
class SubscriptionPayment extends BaseModel {
|
|
@@ -463,406 +482,483 @@ class SubscriptionPayment extends BaseModel {
|
|
|
463
482
|
return ['id', 'subscriptionId'];
|
|
464
483
|
}
|
|
465
484
|
}
|
|
466
|
-
|
|
485
|
+
tslib_1.__decorate([
|
|
467
486
|
classTransformer.Type(() => Payment),
|
|
468
|
-
|
|
487
|
+
tslib_1.__metadata("design:type", Payment)
|
|
469
488
|
], SubscriptionPayment.prototype, "payment", void 0);
|
|
470
489
|
|
|
471
|
-
|
|
472
|
-
|
|
490
|
+
/** PURE_IMPORTS_START PURE_IMPORTS_END */
|
|
491
|
+
function isFunction(x) {
|
|
492
|
+
return typeof x === 'function';
|
|
473
493
|
}
|
|
474
494
|
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
495
|
+
/** PURE_IMPORTS_START PURE_IMPORTS_END */
|
|
496
|
+
var _enable_super_gross_mode_that_will_cause_bad_things = false;
|
|
497
|
+
var config = {
|
|
498
|
+
Promise: undefined,
|
|
499
|
+
set useDeprecatedSynchronousErrorHandling(value) {
|
|
500
|
+
if (value) {
|
|
501
|
+
var error = /*@__PURE__*/ new Error();
|
|
502
|
+
/*@__PURE__*/ console.warn('DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n' + error.stack);
|
|
503
|
+
}
|
|
504
|
+
_enable_super_gross_mode_that_will_cause_bad_things = value;
|
|
505
|
+
},
|
|
506
|
+
get useDeprecatedSynchronousErrorHandling() {
|
|
507
|
+
return _enable_super_gross_mode_that_will_cause_bad_things;
|
|
508
|
+
},
|
|
509
|
+
};
|
|
510
|
+
|
|
511
|
+
/** PURE_IMPORTS_START PURE_IMPORTS_END */
|
|
512
|
+
function hostReportError(err) {
|
|
513
|
+
setTimeout(function () { throw err; }, 0);
|
|
484
514
|
}
|
|
485
515
|
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
516
|
+
/** PURE_IMPORTS_START _config,_util_hostReportError PURE_IMPORTS_END */
|
|
517
|
+
var empty = {
|
|
518
|
+
closed: true,
|
|
519
|
+
next: function (value) { },
|
|
520
|
+
error: function (err) {
|
|
521
|
+
if (config.useDeprecatedSynchronousErrorHandling) {
|
|
522
|
+
throw err;
|
|
523
|
+
}
|
|
524
|
+
else {
|
|
525
|
+
hostReportError(err);
|
|
526
|
+
}
|
|
527
|
+
},
|
|
528
|
+
complete: function () { }
|
|
529
|
+
};
|
|
496
530
|
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
531
|
+
/** PURE_IMPORTS_START PURE_IMPORTS_END */
|
|
532
|
+
var isArray = /*@__PURE__*/ (function () { return Array.isArray || (function (x) { return x && typeof x.length === 'number'; }); })();
|
|
533
|
+
|
|
534
|
+
/** PURE_IMPORTS_START PURE_IMPORTS_END */
|
|
535
|
+
function isObject(x) {
|
|
536
|
+
return x !== null && typeof x === 'object';
|
|
502
537
|
}
|
|
503
538
|
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
539
|
+
/** PURE_IMPORTS_START PURE_IMPORTS_END */
|
|
540
|
+
var UnsubscriptionErrorImpl = /*@__PURE__*/ (function () {
|
|
541
|
+
function UnsubscriptionErrorImpl(errors) {
|
|
542
|
+
Error.call(this);
|
|
543
|
+
this.message = errors ?
|
|
544
|
+
errors.length + " errors occurred during unsubscription:\n" + errors.map(function (err, i) { return i + 1 + ") " + err.toString(); }).join('\n ') : '';
|
|
545
|
+
this.name = 'UnsubscriptionError';
|
|
546
|
+
this.errors = errors;
|
|
547
|
+
return this;
|
|
548
|
+
}
|
|
549
|
+
UnsubscriptionErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype);
|
|
550
|
+
return UnsubscriptionErrorImpl;
|
|
551
|
+
})();
|
|
552
|
+
var UnsubscriptionError = UnsubscriptionErrorImpl;
|
|
553
|
+
|
|
554
|
+
/** PURE_IMPORTS_START _util_isArray,_util_isObject,_util_isFunction,_util_UnsubscriptionError PURE_IMPORTS_END */
|
|
555
|
+
var Subscription$1 = /*@__PURE__*/ (function () {
|
|
556
|
+
function Subscription(unsubscribe) {
|
|
507
557
|
this.closed = false;
|
|
508
|
-
this.
|
|
509
|
-
this.
|
|
558
|
+
this._parentOrParents = null;
|
|
559
|
+
this._subscriptions = null;
|
|
560
|
+
if (unsubscribe) {
|
|
561
|
+
this._ctorUnsubscribe = true;
|
|
562
|
+
this._unsubscribe = unsubscribe;
|
|
563
|
+
}
|
|
510
564
|
}
|
|
511
565
|
Subscription.prototype.unsubscribe = function () {
|
|
512
|
-
var e_1, _a, e_2, _b;
|
|
513
566
|
var errors;
|
|
514
|
-
if (
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
try {
|
|
529
|
-
if (_parentage_1_1 && !_parentage_1_1.done && (_a = _parentage_1.return)) _a.call(_parentage_1);
|
|
530
|
-
}
|
|
531
|
-
finally { if (e_1) throw e_1.error; }
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
else {
|
|
535
|
-
_parentage.remove(this);
|
|
536
|
-
}
|
|
567
|
+
if (this.closed) {
|
|
568
|
+
return;
|
|
569
|
+
}
|
|
570
|
+
var _a = this, _parentOrParents = _a._parentOrParents, _ctorUnsubscribe = _a._ctorUnsubscribe, _unsubscribe = _a._unsubscribe, _subscriptions = _a._subscriptions;
|
|
571
|
+
this.closed = true;
|
|
572
|
+
this._parentOrParents = null;
|
|
573
|
+
this._subscriptions = null;
|
|
574
|
+
if (_parentOrParents instanceof Subscription) {
|
|
575
|
+
_parentOrParents.remove(this);
|
|
576
|
+
}
|
|
577
|
+
else if (_parentOrParents !== null) {
|
|
578
|
+
for (var index = 0; index < _parentOrParents.length; ++index) {
|
|
579
|
+
var parent_1 = _parentOrParents[index];
|
|
580
|
+
parent_1.remove(this);
|
|
537
581
|
}
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
}
|
|
543
|
-
catch (e) {
|
|
544
|
-
errors = e instanceof UnsubscriptionError ? e.errors : [e];
|
|
545
|
-
}
|
|
582
|
+
}
|
|
583
|
+
if (isFunction(_unsubscribe)) {
|
|
584
|
+
if (_ctorUnsubscribe) {
|
|
585
|
+
this._unsubscribe = undefined;
|
|
546
586
|
}
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
587
|
+
try {
|
|
588
|
+
_unsubscribe.call(this);
|
|
589
|
+
}
|
|
590
|
+
catch (e) {
|
|
591
|
+
errors = e instanceof UnsubscriptionError ? flattenUnsubscriptionErrors(e.errors) : [e];
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
if (isArray(_subscriptions)) {
|
|
595
|
+
var index = -1;
|
|
596
|
+
var len = _subscriptions.length;
|
|
597
|
+
while (++index < len) {
|
|
598
|
+
var sub = _subscriptions[index];
|
|
599
|
+
if (isObject(sub)) {
|
|
600
|
+
try {
|
|
601
|
+
sub.unsubscribe();
|
|
602
|
+
}
|
|
603
|
+
catch (e) {
|
|
604
|
+
errors = errors || [];
|
|
605
|
+
if (e instanceof UnsubscriptionError) {
|
|
606
|
+
errors = errors.concat(flattenUnsubscriptionErrors(e.errors));
|
|
555
607
|
}
|
|
556
|
-
|
|
557
|
-
errors
|
|
558
|
-
if (err instanceof UnsubscriptionError) {
|
|
559
|
-
errors = tslib.__spreadArray(tslib.__spreadArray([], tslib.__read(errors)), tslib.__read(err.errors));
|
|
560
|
-
}
|
|
561
|
-
else {
|
|
562
|
-
errors.push(err);
|
|
563
|
-
}
|
|
608
|
+
else {
|
|
609
|
+
errors.push(e);
|
|
564
610
|
}
|
|
565
611
|
}
|
|
566
612
|
}
|
|
567
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
568
|
-
finally {
|
|
569
|
-
try {
|
|
570
|
-
if (_finalizers_1_1 && !_finalizers_1_1.done && (_b = _finalizers_1.return)) _b.call(_finalizers_1);
|
|
571
|
-
}
|
|
572
|
-
finally { if (e_2) throw e_2.error; }
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
if (errors) {
|
|
576
|
-
throw new UnsubscriptionError(errors);
|
|
577
613
|
}
|
|
578
614
|
}
|
|
615
|
+
if (errors) {
|
|
616
|
+
throw new UnsubscriptionError(errors);
|
|
617
|
+
}
|
|
579
618
|
};
|
|
580
619
|
Subscription.prototype.add = function (teardown) {
|
|
581
|
-
var
|
|
582
|
-
if (teardown
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
620
|
+
var subscription = teardown;
|
|
621
|
+
if (!teardown) {
|
|
622
|
+
return Subscription.EMPTY;
|
|
623
|
+
}
|
|
624
|
+
switch (typeof teardown) {
|
|
625
|
+
case 'function':
|
|
626
|
+
subscription = new Subscription(teardown);
|
|
627
|
+
case 'object':
|
|
628
|
+
if (subscription === this || subscription.closed || typeof subscription.unsubscribe !== 'function') {
|
|
629
|
+
return subscription;
|
|
630
|
+
}
|
|
631
|
+
else if (this.closed) {
|
|
632
|
+
subscription.unsubscribe();
|
|
633
|
+
return subscription;
|
|
592
634
|
}
|
|
593
|
-
|
|
635
|
+
else if (!(subscription instanceof Subscription)) {
|
|
636
|
+
var tmp = subscription;
|
|
637
|
+
subscription = new Subscription();
|
|
638
|
+
subscription._subscriptions = [tmp];
|
|
639
|
+
}
|
|
640
|
+
break;
|
|
641
|
+
default: {
|
|
642
|
+
throw new Error('unrecognized teardown ' + teardown + ' added to Subscription.');
|
|
594
643
|
}
|
|
595
644
|
}
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
return _parentage === parent || (Array.isArray(_parentage) && _parentage.includes(parent));
|
|
600
|
-
};
|
|
601
|
-
Subscription.prototype._addParent = function (parent) {
|
|
602
|
-
var _parentage = this._parentage;
|
|
603
|
-
this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;
|
|
604
|
-
};
|
|
605
|
-
Subscription.prototype._removeParent = function (parent) {
|
|
606
|
-
var _parentage = this._parentage;
|
|
607
|
-
if (_parentage === parent) {
|
|
608
|
-
this._parentage = null;
|
|
645
|
+
var _parentOrParents = subscription._parentOrParents;
|
|
646
|
+
if (_parentOrParents === null) {
|
|
647
|
+
subscription._parentOrParents = this;
|
|
609
648
|
}
|
|
610
|
-
else if (
|
|
611
|
-
|
|
649
|
+
else if (_parentOrParents instanceof Subscription) {
|
|
650
|
+
if (_parentOrParents === this) {
|
|
651
|
+
return subscription;
|
|
652
|
+
}
|
|
653
|
+
subscription._parentOrParents = [_parentOrParents, this];
|
|
654
|
+
}
|
|
655
|
+
else if (_parentOrParents.indexOf(this) === -1) {
|
|
656
|
+
_parentOrParents.push(this);
|
|
657
|
+
}
|
|
658
|
+
else {
|
|
659
|
+
return subscription;
|
|
660
|
+
}
|
|
661
|
+
var subscriptions = this._subscriptions;
|
|
662
|
+
if (subscriptions === null) {
|
|
663
|
+
this._subscriptions = [subscription];
|
|
612
664
|
}
|
|
665
|
+
else {
|
|
666
|
+
subscriptions.push(subscription);
|
|
667
|
+
}
|
|
668
|
+
return subscription;
|
|
613
669
|
};
|
|
614
|
-
Subscription.prototype.remove = function (
|
|
615
|
-
var
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
670
|
+
Subscription.prototype.remove = function (subscription) {
|
|
671
|
+
var subscriptions = this._subscriptions;
|
|
672
|
+
if (subscriptions) {
|
|
673
|
+
var subscriptionIndex = subscriptions.indexOf(subscription);
|
|
674
|
+
if (subscriptionIndex !== -1) {
|
|
675
|
+
subscriptions.splice(subscriptionIndex, 1);
|
|
676
|
+
}
|
|
619
677
|
}
|
|
620
678
|
};
|
|
621
|
-
Subscription.EMPTY = (function () {
|
|
622
|
-
var empty = new Subscription();
|
|
679
|
+
Subscription.EMPTY = (function (empty) {
|
|
623
680
|
empty.closed = true;
|
|
624
681
|
return empty;
|
|
625
|
-
}
|
|
682
|
+
}(new Subscription()));
|
|
626
683
|
return Subscription;
|
|
627
684
|
}());
|
|
628
|
-
|
|
629
|
-
function
|
|
630
|
-
return (value instanceof Subscription$1 ||
|
|
631
|
-
(value && 'closed' in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe)));
|
|
632
|
-
}
|
|
633
|
-
function execFinalizer(finalizer) {
|
|
634
|
-
if (isFunction(finalizer)) {
|
|
635
|
-
finalizer();
|
|
636
|
-
}
|
|
637
|
-
else {
|
|
638
|
-
finalizer.unsubscribe();
|
|
639
|
-
}
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
var config = {
|
|
643
|
-
onUnhandledError: null,
|
|
644
|
-
onStoppedNotification: null,
|
|
645
|
-
Promise: undefined,
|
|
646
|
-
useDeprecatedSynchronousErrorHandling: false,
|
|
647
|
-
useDeprecatedNextContext: false,
|
|
648
|
-
};
|
|
649
|
-
|
|
650
|
-
var timeoutProvider = {
|
|
651
|
-
setTimeout: function (handler, timeout) {
|
|
652
|
-
var args = [];
|
|
653
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
|
654
|
-
args[_i - 2] = arguments[_i];
|
|
655
|
-
}
|
|
656
|
-
var delegate = timeoutProvider.delegate;
|
|
657
|
-
if (delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) {
|
|
658
|
-
return delegate.setTimeout.apply(delegate, tslib.__spreadArray([handler, timeout], tslib.__read(args)));
|
|
659
|
-
}
|
|
660
|
-
return setTimeout.apply(void 0, tslib.__spreadArray([handler, timeout], tslib.__read(args)));
|
|
661
|
-
},
|
|
662
|
-
clearTimeout: function (handle) {
|
|
663
|
-
var delegate = timeoutProvider.delegate;
|
|
664
|
-
return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearTimeout) || clearTimeout)(handle);
|
|
665
|
-
},
|
|
666
|
-
delegate: undefined,
|
|
667
|
-
};
|
|
668
|
-
|
|
669
|
-
function reportUnhandledError(err) {
|
|
670
|
-
timeoutProvider.setTimeout(function () {
|
|
671
|
-
{
|
|
672
|
-
throw err;
|
|
673
|
-
}
|
|
674
|
-
});
|
|
675
|
-
}
|
|
676
|
-
|
|
677
|
-
function noop() { }
|
|
678
|
-
|
|
679
|
-
var context = null;
|
|
680
|
-
function errorContext(cb) {
|
|
681
|
-
if (config.useDeprecatedSynchronousErrorHandling) {
|
|
682
|
-
var isRoot = !context;
|
|
683
|
-
if (isRoot) {
|
|
684
|
-
context = { errorThrown: false, error: null };
|
|
685
|
-
}
|
|
686
|
-
cb();
|
|
687
|
-
if (isRoot) {
|
|
688
|
-
var _a = context, errorThrown = _a.errorThrown, error = _a.error;
|
|
689
|
-
context = null;
|
|
690
|
-
if (errorThrown) {
|
|
691
|
-
throw error;
|
|
692
|
-
}
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
else {
|
|
696
|
-
cb();
|
|
697
|
-
}
|
|
685
|
+
function flattenUnsubscriptionErrors(errors) {
|
|
686
|
+
return errors.reduce(function (errs, err) { return errs.concat((err instanceof UnsubscriptionError) ? err.errors : err); }, []);
|
|
698
687
|
}
|
|
699
688
|
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
689
|
+
/** PURE_IMPORTS_START PURE_IMPORTS_END */
|
|
690
|
+
var rxSubscriber = /*@__PURE__*/ (function () {
|
|
691
|
+
return typeof Symbol === 'function'
|
|
692
|
+
? /*@__PURE__*/ Symbol('rxSubscriber')
|
|
693
|
+
: '@@rxSubscriber_' + /*@__PURE__*/ Math.random();
|
|
694
|
+
})();
|
|
695
|
+
|
|
696
|
+
/** PURE_IMPORTS_START tslib,_util_isFunction,_Observer,_Subscription,_internal_symbol_rxSubscriber,_config,_util_hostReportError PURE_IMPORTS_END */
|
|
697
|
+
var Subscriber = /*@__PURE__*/ (function (_super) {
|
|
698
|
+
tslib_1__namespace.__extends(Subscriber, _super);
|
|
699
|
+
function Subscriber(destinationOrNext, error, complete) {
|
|
703
700
|
var _this = _super.call(this) || this;
|
|
701
|
+
_this.syncErrorValue = null;
|
|
702
|
+
_this.syncErrorThrown = false;
|
|
703
|
+
_this.syncErrorThrowable = false;
|
|
704
704
|
_this.isStopped = false;
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
705
|
+
switch (arguments.length) {
|
|
706
|
+
case 0:
|
|
707
|
+
_this.destination = empty;
|
|
708
|
+
break;
|
|
709
|
+
case 1:
|
|
710
|
+
if (!destinationOrNext) {
|
|
711
|
+
_this.destination = empty;
|
|
712
|
+
break;
|
|
713
|
+
}
|
|
714
|
+
if (typeof destinationOrNext === 'object') {
|
|
715
|
+
if (destinationOrNext instanceof Subscriber) {
|
|
716
|
+
_this.syncErrorThrowable = destinationOrNext.syncErrorThrowable;
|
|
717
|
+
_this.destination = destinationOrNext;
|
|
718
|
+
destinationOrNext.add(_this);
|
|
719
|
+
}
|
|
720
|
+
else {
|
|
721
|
+
_this.syncErrorThrowable = true;
|
|
722
|
+
_this.destination = new SafeSubscriber(_this, destinationOrNext);
|
|
723
|
+
}
|
|
724
|
+
break;
|
|
725
|
+
}
|
|
726
|
+
default:
|
|
727
|
+
_this.syncErrorThrowable = true;
|
|
728
|
+
_this.destination = new SafeSubscriber(_this, destinationOrNext, error, complete);
|
|
729
|
+
break;
|
|
713
730
|
}
|
|
714
731
|
return _this;
|
|
715
732
|
}
|
|
733
|
+
Subscriber.prototype[rxSubscriber] = function () { return this; };
|
|
716
734
|
Subscriber.create = function (next, error, complete) {
|
|
717
|
-
|
|
735
|
+
var subscriber = new Subscriber(next, error, complete);
|
|
736
|
+
subscriber.syncErrorThrowable = false;
|
|
737
|
+
return subscriber;
|
|
718
738
|
};
|
|
719
739
|
Subscriber.prototype.next = function (value) {
|
|
720
|
-
if (this.isStopped)
|
|
721
|
-
else {
|
|
740
|
+
if (!this.isStopped) {
|
|
722
741
|
this._next(value);
|
|
723
742
|
}
|
|
724
743
|
};
|
|
725
744
|
Subscriber.prototype.error = function (err) {
|
|
726
|
-
if (this.isStopped)
|
|
727
|
-
else {
|
|
745
|
+
if (!this.isStopped) {
|
|
728
746
|
this.isStopped = true;
|
|
729
747
|
this._error(err);
|
|
730
748
|
}
|
|
731
749
|
};
|
|
732
750
|
Subscriber.prototype.complete = function () {
|
|
733
|
-
if (this.isStopped)
|
|
734
|
-
else {
|
|
751
|
+
if (!this.isStopped) {
|
|
735
752
|
this.isStopped = true;
|
|
736
753
|
this._complete();
|
|
737
754
|
}
|
|
738
755
|
};
|
|
739
756
|
Subscriber.prototype.unsubscribe = function () {
|
|
740
|
-
if (
|
|
741
|
-
|
|
742
|
-
_super.prototype.unsubscribe.call(this);
|
|
743
|
-
this.destination = null;
|
|
757
|
+
if (this.closed) {
|
|
758
|
+
return;
|
|
744
759
|
}
|
|
760
|
+
this.isStopped = true;
|
|
761
|
+
_super.prototype.unsubscribe.call(this);
|
|
745
762
|
};
|
|
746
763
|
Subscriber.prototype._next = function (value) {
|
|
747
764
|
this.destination.next(value);
|
|
748
765
|
};
|
|
749
766
|
Subscriber.prototype._error = function (err) {
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
}
|
|
753
|
-
finally {
|
|
754
|
-
this.unsubscribe();
|
|
755
|
-
}
|
|
767
|
+
this.destination.error(err);
|
|
768
|
+
this.unsubscribe();
|
|
756
769
|
};
|
|
757
770
|
Subscriber.prototype._complete = function () {
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
771
|
+
this.destination.complete();
|
|
772
|
+
this.unsubscribe();
|
|
773
|
+
};
|
|
774
|
+
Subscriber.prototype._unsubscribeAndRecycle = function () {
|
|
775
|
+
var _parentOrParents = this._parentOrParents;
|
|
776
|
+
this._parentOrParents = null;
|
|
777
|
+
this.unsubscribe();
|
|
778
|
+
this.closed = false;
|
|
779
|
+
this.isStopped = false;
|
|
780
|
+
this._parentOrParents = _parentOrParents;
|
|
781
|
+
return this;
|
|
764
782
|
};
|
|
765
783
|
return Subscriber;
|
|
766
784
|
}(Subscription$1));
|
|
767
|
-
var
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
785
|
+
var SafeSubscriber = /*@__PURE__*/ (function (_super) {
|
|
786
|
+
tslib_1__namespace.__extends(SafeSubscriber, _super);
|
|
787
|
+
function SafeSubscriber(_parentSubscriber, observerOrNext, error, complete) {
|
|
788
|
+
var _this = _super.call(this) || this;
|
|
789
|
+
_this._parentSubscriber = _parentSubscriber;
|
|
790
|
+
var next;
|
|
791
|
+
var context = _this;
|
|
792
|
+
if (isFunction(observerOrNext)) {
|
|
793
|
+
next = observerOrNext;
|
|
794
|
+
}
|
|
795
|
+
else if (observerOrNext) {
|
|
796
|
+
next = observerOrNext.next;
|
|
797
|
+
error = observerOrNext.error;
|
|
798
|
+
complete = observerOrNext.complete;
|
|
799
|
+
if (observerOrNext !== empty) {
|
|
800
|
+
context = Object.create(observerOrNext);
|
|
801
|
+
if (isFunction(context.unsubscribe)) {
|
|
802
|
+
_this.add(context.unsubscribe.bind(context));
|
|
803
|
+
}
|
|
804
|
+
context.unsubscribe = _this.unsubscribe.bind(_this);
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
_this._context = context;
|
|
808
|
+
_this._next = next;
|
|
809
|
+
_this._error = error;
|
|
810
|
+
_this._complete = complete;
|
|
811
|
+
return _this;
|
|
774
812
|
}
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
813
|
+
SafeSubscriber.prototype.next = function (value) {
|
|
814
|
+
if (!this.isStopped && this._next) {
|
|
815
|
+
var _parentSubscriber = this._parentSubscriber;
|
|
816
|
+
if (!config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
|
|
817
|
+
this.__tryOrUnsub(this._next, value);
|
|
780
818
|
}
|
|
781
|
-
|
|
782
|
-
|
|
819
|
+
else if (this.__tryOrSetError(_parentSubscriber, this._next, value)) {
|
|
820
|
+
this.unsubscribe();
|
|
783
821
|
}
|
|
784
822
|
}
|
|
785
823
|
};
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
824
|
+
SafeSubscriber.prototype.error = function (err) {
|
|
825
|
+
if (!this.isStopped) {
|
|
826
|
+
var _parentSubscriber = this._parentSubscriber;
|
|
827
|
+
var useDeprecatedSynchronousErrorHandling = config.useDeprecatedSynchronousErrorHandling;
|
|
828
|
+
if (this._error) {
|
|
829
|
+
if (!useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
|
|
830
|
+
this.__tryOrUnsub(this._error, err);
|
|
831
|
+
this.unsubscribe();
|
|
832
|
+
}
|
|
833
|
+
else {
|
|
834
|
+
this.__tryOrSetError(_parentSubscriber, this._error, err);
|
|
835
|
+
this.unsubscribe();
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
else if (!_parentSubscriber.syncErrorThrowable) {
|
|
839
|
+
this.unsubscribe();
|
|
840
|
+
if (useDeprecatedSynchronousErrorHandling) {
|
|
841
|
+
throw err;
|
|
842
|
+
}
|
|
843
|
+
hostReportError(err);
|
|
791
844
|
}
|
|
792
|
-
|
|
793
|
-
|
|
845
|
+
else {
|
|
846
|
+
if (useDeprecatedSynchronousErrorHandling) {
|
|
847
|
+
_parentSubscriber.syncErrorValue = err;
|
|
848
|
+
_parentSubscriber.syncErrorThrown = true;
|
|
849
|
+
}
|
|
850
|
+
else {
|
|
851
|
+
hostReportError(err);
|
|
852
|
+
}
|
|
853
|
+
this.unsubscribe();
|
|
794
854
|
}
|
|
795
855
|
}
|
|
796
|
-
|
|
797
|
-
|
|
856
|
+
};
|
|
857
|
+
SafeSubscriber.prototype.complete = function () {
|
|
858
|
+
var _this = this;
|
|
859
|
+
if (!this.isStopped) {
|
|
860
|
+
var _parentSubscriber = this._parentSubscriber;
|
|
861
|
+
if (this._complete) {
|
|
862
|
+
var wrappedComplete = function () { return _this._complete.call(_this._context); };
|
|
863
|
+
if (!config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
|
|
864
|
+
this.__tryOrUnsub(wrappedComplete);
|
|
865
|
+
this.unsubscribe();
|
|
866
|
+
}
|
|
867
|
+
else {
|
|
868
|
+
this.__tryOrSetError(_parentSubscriber, wrappedComplete);
|
|
869
|
+
this.unsubscribe();
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
else {
|
|
873
|
+
this.unsubscribe();
|
|
874
|
+
}
|
|
798
875
|
}
|
|
799
876
|
};
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
877
|
+
SafeSubscriber.prototype.__tryOrUnsub = function (fn, value) {
|
|
878
|
+
try {
|
|
879
|
+
fn.call(this._context, value);
|
|
880
|
+
}
|
|
881
|
+
catch (err) {
|
|
882
|
+
this.unsubscribe();
|
|
883
|
+
if (config.useDeprecatedSynchronousErrorHandling) {
|
|
884
|
+
throw err;
|
|
805
885
|
}
|
|
806
|
-
|
|
807
|
-
|
|
886
|
+
else {
|
|
887
|
+
hostReportError(err);
|
|
808
888
|
}
|
|
809
889
|
}
|
|
810
890
|
};
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
tslib.__extends(SafeSubscriber, _super);
|
|
815
|
-
function SafeSubscriber(observerOrNext, error, complete) {
|
|
816
|
-
var _this = _super.call(this) || this;
|
|
817
|
-
var partialObserver;
|
|
818
|
-
if (isFunction(observerOrNext) || !observerOrNext) {
|
|
819
|
-
partialObserver = {
|
|
820
|
-
next: (observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : undefined),
|
|
821
|
-
error: error !== null && error !== void 0 ? error : undefined,
|
|
822
|
-
complete: complete !== null && complete !== void 0 ? complete : undefined,
|
|
823
|
-
};
|
|
891
|
+
SafeSubscriber.prototype.__tryOrSetError = function (parent, fn, value) {
|
|
892
|
+
if (!config.useDeprecatedSynchronousErrorHandling) {
|
|
893
|
+
throw new Error('bad call');
|
|
824
894
|
}
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
complete: observerOrNext.complete && bind(observerOrNext.complete, context_1),
|
|
834
|
-
};
|
|
895
|
+
try {
|
|
896
|
+
fn.call(this._context, value);
|
|
897
|
+
}
|
|
898
|
+
catch (err) {
|
|
899
|
+
if (config.useDeprecatedSynchronousErrorHandling) {
|
|
900
|
+
parent.syncErrorValue = err;
|
|
901
|
+
parent.syncErrorThrown = true;
|
|
902
|
+
return true;
|
|
835
903
|
}
|
|
836
904
|
else {
|
|
837
|
-
|
|
905
|
+
hostReportError(err);
|
|
906
|
+
return true;
|
|
838
907
|
}
|
|
839
908
|
}
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
909
|
+
return false;
|
|
910
|
+
};
|
|
911
|
+
SafeSubscriber.prototype._unsubscribe = function () {
|
|
912
|
+
var _parentSubscriber = this._parentSubscriber;
|
|
913
|
+
this._context = null;
|
|
914
|
+
this._parentSubscriber = null;
|
|
915
|
+
_parentSubscriber.unsubscribe();
|
|
916
|
+
};
|
|
843
917
|
return SafeSubscriber;
|
|
844
918
|
}(Subscriber));
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
919
|
+
|
|
920
|
+
/** PURE_IMPORTS_START _Subscriber PURE_IMPORTS_END */
|
|
921
|
+
function canReportError(observer) {
|
|
922
|
+
while (observer) {
|
|
923
|
+
var _a = observer, closed_1 = _a.closed, destination = _a.destination, isStopped = _a.isStopped;
|
|
924
|
+
if (closed_1 || isStopped) {
|
|
925
|
+
return false;
|
|
926
|
+
}
|
|
927
|
+
else if (destination && destination instanceof Subscriber) {
|
|
928
|
+
observer = destination;
|
|
929
|
+
}
|
|
930
|
+
else {
|
|
931
|
+
observer = null;
|
|
932
|
+
}
|
|
848
933
|
}
|
|
934
|
+
return true;
|
|
849
935
|
}
|
|
850
|
-
|
|
851
|
-
|
|
936
|
+
|
|
937
|
+
/** PURE_IMPORTS_START _Subscriber,_symbol_rxSubscriber,_Observer PURE_IMPORTS_END */
|
|
938
|
+
function toSubscriber(nextOrObserver, error, complete) {
|
|
939
|
+
if (nextOrObserver) {
|
|
940
|
+
if (nextOrObserver instanceof Subscriber) {
|
|
941
|
+
return nextOrObserver;
|
|
942
|
+
}
|
|
943
|
+
if (nextOrObserver[rxSubscriber]) {
|
|
944
|
+
return nextOrObserver[rxSubscriber]();
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
if (!nextOrObserver && !error && !complete) {
|
|
948
|
+
return new Subscriber(empty);
|
|
949
|
+
}
|
|
950
|
+
return new Subscriber(nextOrObserver, error, complete);
|
|
852
951
|
}
|
|
853
|
-
var EMPTY_OBSERVER = {
|
|
854
|
-
closed: true,
|
|
855
|
-
next: noop,
|
|
856
|
-
error: defaultErrorHandler,
|
|
857
|
-
complete: noop,
|
|
858
|
-
};
|
|
859
952
|
|
|
860
|
-
|
|
953
|
+
/** PURE_IMPORTS_START PURE_IMPORTS_END */
|
|
954
|
+
var observable = /*@__PURE__*/ (function () { return typeof Symbol === 'function' && Symbol.observable || '@@observable'; })();
|
|
861
955
|
|
|
956
|
+
/** PURE_IMPORTS_START PURE_IMPORTS_END */
|
|
862
957
|
function identity(x) {
|
|
863
958
|
return x;
|
|
864
959
|
}
|
|
865
960
|
|
|
961
|
+
/** PURE_IMPORTS_START _identity PURE_IMPORTS_END */
|
|
866
962
|
function pipeFromArray(fns) {
|
|
867
963
|
if (fns.length === 0) {
|
|
868
964
|
return identity;
|
|
@@ -875,8 +971,10 @@ function pipeFromArray(fns) {
|
|
|
875
971
|
};
|
|
876
972
|
}
|
|
877
973
|
|
|
878
|
-
|
|
974
|
+
/** PURE_IMPORTS_START _util_canReportError,_util_toSubscriber,_symbol_observable,_util_pipe,_config PURE_IMPORTS_END */
|
|
975
|
+
var Observable = /*@__PURE__*/ (function () {
|
|
879
976
|
function Observable(subscribe) {
|
|
977
|
+
this._isScalar = false;
|
|
880
978
|
if (subscribe) {
|
|
881
979
|
this._subscribe = subscribe;
|
|
882
980
|
}
|
|
@@ -888,52 +986,64 @@ var Observable = (function () {
|
|
|
888
986
|
return observable;
|
|
889
987
|
};
|
|
890
988
|
Observable.prototype.subscribe = function (observerOrNext, error, complete) {
|
|
891
|
-
var
|
|
892
|
-
var
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
:
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
989
|
+
var operator = this.operator;
|
|
990
|
+
var sink = toSubscriber(observerOrNext, error, complete);
|
|
991
|
+
if (operator) {
|
|
992
|
+
sink.add(operator.call(sink, this.source));
|
|
993
|
+
}
|
|
994
|
+
else {
|
|
995
|
+
sink.add(this.source || (config.useDeprecatedSynchronousErrorHandling && !sink.syncErrorThrowable) ?
|
|
996
|
+
this._subscribe(sink) :
|
|
997
|
+
this._trySubscribe(sink));
|
|
998
|
+
}
|
|
999
|
+
if (config.useDeprecatedSynchronousErrorHandling) {
|
|
1000
|
+
if (sink.syncErrorThrowable) {
|
|
1001
|
+
sink.syncErrorThrowable = false;
|
|
1002
|
+
if (sink.syncErrorThrown) {
|
|
1003
|
+
throw sink.syncErrorValue;
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
return sink;
|
|
905
1008
|
};
|
|
906
1009
|
Observable.prototype._trySubscribe = function (sink) {
|
|
907
1010
|
try {
|
|
908
1011
|
return this._subscribe(sink);
|
|
909
1012
|
}
|
|
910
1013
|
catch (err) {
|
|
911
|
-
|
|
1014
|
+
if (config.useDeprecatedSynchronousErrorHandling) {
|
|
1015
|
+
sink.syncErrorThrown = true;
|
|
1016
|
+
sink.syncErrorValue = err;
|
|
1017
|
+
}
|
|
1018
|
+
if (canReportError(sink)) {
|
|
1019
|
+
sink.error(err);
|
|
1020
|
+
}
|
|
1021
|
+
else {
|
|
1022
|
+
console.warn(err);
|
|
1023
|
+
}
|
|
912
1024
|
}
|
|
913
1025
|
};
|
|
914
1026
|
Observable.prototype.forEach = function (next, promiseCtor) {
|
|
915
1027
|
var _this = this;
|
|
916
1028
|
promiseCtor = getPromiseCtor(promiseCtor);
|
|
917
1029
|
return new promiseCtor(function (resolve, reject) {
|
|
918
|
-
var
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
1030
|
+
var subscription;
|
|
1031
|
+
subscription = _this.subscribe(function (value) {
|
|
1032
|
+
try {
|
|
1033
|
+
next(value);
|
|
1034
|
+
}
|
|
1035
|
+
catch (err) {
|
|
1036
|
+
reject(err);
|
|
1037
|
+
if (subscription) {
|
|
1038
|
+
subscription.unsubscribe();
|
|
926
1039
|
}
|
|
927
|
-
}
|
|
928
|
-
|
|
929
|
-
complete: resolve,
|
|
930
|
-
});
|
|
931
|
-
_this.subscribe(subscriber);
|
|
1040
|
+
}
|
|
1041
|
+
}, reject, resolve);
|
|
932
1042
|
});
|
|
933
1043
|
};
|
|
934
1044
|
Observable.prototype._subscribe = function (subscriber) {
|
|
935
|
-
var
|
|
936
|
-
return
|
|
1045
|
+
var source = this.source;
|
|
1046
|
+
return source && source.subscribe(subscriber);
|
|
937
1047
|
};
|
|
938
1048
|
Observable.prototype[observable] = function () {
|
|
939
1049
|
return this;
|
|
@@ -943,6 +1053,9 @@ var Observable = (function () {
|
|
|
943
1053
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
944
1054
|
operations[_i] = arguments[_i];
|
|
945
1055
|
}
|
|
1056
|
+
if (operations.length === 0) {
|
|
1057
|
+
return this;
|
|
1058
|
+
}
|
|
946
1059
|
return pipeFromArray(operations)(this);
|
|
947
1060
|
};
|
|
948
1061
|
Observable.prototype.toPromise = function (promiseCtor) {
|
|
@@ -950,7 +1063,7 @@ var Observable = (function () {
|
|
|
950
1063
|
promiseCtor = getPromiseCtor(promiseCtor);
|
|
951
1064
|
return new promiseCtor(function (resolve, reject) {
|
|
952
1065
|
var value;
|
|
953
|
-
_this.subscribe(function (x) { return
|
|
1066
|
+
_this.subscribe(function (x) { return value = x; }, function (err) { return reject(err); }, function () { return resolve(value); });
|
|
954
1067
|
});
|
|
955
1068
|
};
|
|
956
1069
|
Observable.create = function (subscribe) {
|
|
@@ -959,139 +1072,155 @@ var Observable = (function () {
|
|
|
959
1072
|
return Observable;
|
|
960
1073
|
}());
|
|
961
1074
|
function getPromiseCtor(promiseCtor) {
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
}
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
}
|
|
968
|
-
|
|
969
|
-
return (value && value instanceof Subscriber) || (isObserver(value) && isSubscription(value));
|
|
1075
|
+
if (!promiseCtor) {
|
|
1076
|
+
promiseCtor = config.Promise || Promise;
|
|
1077
|
+
}
|
|
1078
|
+
if (!promiseCtor) {
|
|
1079
|
+
throw new Error('no Promise impl found');
|
|
1080
|
+
}
|
|
1081
|
+
return promiseCtor;
|
|
970
1082
|
}
|
|
971
1083
|
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
this
|
|
1084
|
+
/** PURE_IMPORTS_START PURE_IMPORTS_END */
|
|
1085
|
+
var ObjectUnsubscribedErrorImpl = /*@__PURE__*/ (function () {
|
|
1086
|
+
function ObjectUnsubscribedErrorImpl() {
|
|
1087
|
+
Error.call(this);
|
|
976
1088
|
this.message = 'object unsubscribed';
|
|
1089
|
+
this.name = 'ObjectUnsubscribedError';
|
|
1090
|
+
return this;
|
|
1091
|
+
}
|
|
1092
|
+
ObjectUnsubscribedErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype);
|
|
1093
|
+
return ObjectUnsubscribedErrorImpl;
|
|
1094
|
+
})();
|
|
1095
|
+
var ObjectUnsubscribedError = ObjectUnsubscribedErrorImpl;
|
|
1096
|
+
|
|
1097
|
+
/** PURE_IMPORTS_START tslib,_Subscription PURE_IMPORTS_END */
|
|
1098
|
+
var SubjectSubscription = /*@__PURE__*/ (function (_super) {
|
|
1099
|
+
tslib_1__namespace.__extends(SubjectSubscription, _super);
|
|
1100
|
+
function SubjectSubscription(subject, subscriber) {
|
|
1101
|
+
var _this = _super.call(this) || this;
|
|
1102
|
+
_this.subject = subject;
|
|
1103
|
+
_this.subscriber = subscriber;
|
|
1104
|
+
_this.closed = false;
|
|
1105
|
+
return _this;
|
|
1106
|
+
}
|
|
1107
|
+
SubjectSubscription.prototype.unsubscribe = function () {
|
|
1108
|
+
if (this.closed) {
|
|
1109
|
+
return;
|
|
1110
|
+
}
|
|
1111
|
+
this.closed = true;
|
|
1112
|
+
var subject = this.subject;
|
|
1113
|
+
var observers = subject.observers;
|
|
1114
|
+
this.subject = null;
|
|
1115
|
+
if (!observers || observers.length === 0 || subject.isStopped || subject.closed) {
|
|
1116
|
+
return;
|
|
1117
|
+
}
|
|
1118
|
+
var subscriberIndex = observers.indexOf(this.subscriber);
|
|
1119
|
+
if (subscriberIndex !== -1) {
|
|
1120
|
+
observers.splice(subscriberIndex, 1);
|
|
1121
|
+
}
|
|
977
1122
|
};
|
|
978
|
-
|
|
1123
|
+
return SubjectSubscription;
|
|
1124
|
+
}(Subscription$1));
|
|
979
1125
|
|
|
980
|
-
|
|
981
|
-
|
|
1126
|
+
/** PURE_IMPORTS_START tslib,_Observable,_Subscriber,_Subscription,_util_ObjectUnsubscribedError,_SubjectSubscription,_internal_symbol_rxSubscriber PURE_IMPORTS_END */
|
|
1127
|
+
var SubjectSubscriber = /*@__PURE__*/ (function (_super) {
|
|
1128
|
+
tslib_1__namespace.__extends(SubjectSubscriber, _super);
|
|
1129
|
+
function SubjectSubscriber(destination) {
|
|
1130
|
+
var _this = _super.call(this, destination) || this;
|
|
1131
|
+
_this.destination = destination;
|
|
1132
|
+
return _this;
|
|
1133
|
+
}
|
|
1134
|
+
return SubjectSubscriber;
|
|
1135
|
+
}(Subscriber));
|
|
1136
|
+
var Subject = /*@__PURE__*/ (function (_super) {
|
|
1137
|
+
tslib_1__namespace.__extends(Subject, _super);
|
|
982
1138
|
function Subject() {
|
|
983
1139
|
var _this = _super.call(this) || this;
|
|
984
|
-
_this.closed = false;
|
|
985
|
-
_this.currentObservers = null;
|
|
986
1140
|
_this.observers = [];
|
|
1141
|
+
_this.closed = false;
|
|
987
1142
|
_this.isStopped = false;
|
|
988
1143
|
_this.hasError = false;
|
|
989
1144
|
_this.thrownError = null;
|
|
990
1145
|
return _this;
|
|
991
1146
|
}
|
|
1147
|
+
Subject.prototype[rxSubscriber] = function () {
|
|
1148
|
+
return new SubjectSubscriber(this);
|
|
1149
|
+
};
|
|
992
1150
|
Subject.prototype.lift = function (operator) {
|
|
993
1151
|
var subject = new AnonymousSubject(this, this);
|
|
994
1152
|
subject.operator = operator;
|
|
995
1153
|
return subject;
|
|
996
1154
|
};
|
|
997
|
-
Subject.prototype.
|
|
1155
|
+
Subject.prototype.next = function (value) {
|
|
998
1156
|
if (this.closed) {
|
|
999
1157
|
throw new ObjectUnsubscribedError();
|
|
1000
1158
|
}
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
var
|
|
1006
|
-
|
|
1007
|
-
if (!_this.isStopped) {
|
|
1008
|
-
if (!_this.currentObservers) {
|
|
1009
|
-
_this.currentObservers = Array.from(_this.observers);
|
|
1010
|
-
}
|
|
1011
|
-
try {
|
|
1012
|
-
for (var _b = tslib.__values(_this.currentObservers), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1013
|
-
var observer = _c.value;
|
|
1014
|
-
observer.next(value);
|
|
1015
|
-
}
|
|
1016
|
-
}
|
|
1017
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
1018
|
-
finally {
|
|
1019
|
-
try {
|
|
1020
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1021
|
-
}
|
|
1022
|
-
finally { if (e_1) throw e_1.error; }
|
|
1023
|
-
}
|
|
1159
|
+
if (!this.isStopped) {
|
|
1160
|
+
var observers = this.observers;
|
|
1161
|
+
var len = observers.length;
|
|
1162
|
+
var copy = observers.slice();
|
|
1163
|
+
for (var i = 0; i < len; i++) {
|
|
1164
|
+
copy[i].next(value);
|
|
1024
1165
|
}
|
|
1025
|
-
}
|
|
1166
|
+
}
|
|
1026
1167
|
};
|
|
1027
1168
|
Subject.prototype.error = function (err) {
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
}
|
|
1169
|
+
if (this.closed) {
|
|
1170
|
+
throw new ObjectUnsubscribedError();
|
|
1171
|
+
}
|
|
1172
|
+
this.hasError = true;
|
|
1173
|
+
this.thrownError = err;
|
|
1174
|
+
this.isStopped = true;
|
|
1175
|
+
var observers = this.observers;
|
|
1176
|
+
var len = observers.length;
|
|
1177
|
+
var copy = observers.slice();
|
|
1178
|
+
for (var i = 0; i < len; i++) {
|
|
1179
|
+
copy[i].error(err);
|
|
1180
|
+
}
|
|
1181
|
+
this.observers.length = 0;
|
|
1040
1182
|
};
|
|
1041
1183
|
Subject.prototype.complete = function () {
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1184
|
+
if (this.closed) {
|
|
1185
|
+
throw new ObjectUnsubscribedError();
|
|
1186
|
+
}
|
|
1187
|
+
this.isStopped = true;
|
|
1188
|
+
var observers = this.observers;
|
|
1189
|
+
var len = observers.length;
|
|
1190
|
+
var copy = observers.slice();
|
|
1191
|
+
for (var i = 0; i < len; i++) {
|
|
1192
|
+
copy[i].complete();
|
|
1193
|
+
}
|
|
1194
|
+
this.observers.length = 0;
|
|
1053
1195
|
};
|
|
1054
1196
|
Subject.prototype.unsubscribe = function () {
|
|
1055
|
-
this.isStopped =
|
|
1056
|
-
this.
|
|
1197
|
+
this.isStopped = true;
|
|
1198
|
+
this.closed = true;
|
|
1199
|
+
this.observers = null;
|
|
1057
1200
|
};
|
|
1058
|
-
Object.defineProperty(Subject.prototype, "observed", {
|
|
1059
|
-
get: function () {
|
|
1060
|
-
var _a;
|
|
1061
|
-
return ((_a = this.observers) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
1062
|
-
},
|
|
1063
|
-
enumerable: false,
|
|
1064
|
-
configurable: true
|
|
1065
|
-
});
|
|
1066
1201
|
Subject.prototype._trySubscribe = function (subscriber) {
|
|
1067
|
-
this.
|
|
1068
|
-
|
|
1202
|
+
if (this.closed) {
|
|
1203
|
+
throw new ObjectUnsubscribedError();
|
|
1204
|
+
}
|
|
1205
|
+
else {
|
|
1206
|
+
return _super.prototype._trySubscribe.call(this, subscriber);
|
|
1207
|
+
}
|
|
1069
1208
|
};
|
|
1070
1209
|
Subject.prototype._subscribe = function (subscriber) {
|
|
1071
|
-
this.
|
|
1072
|
-
|
|
1073
|
-
return this._innerSubscribe(subscriber);
|
|
1074
|
-
};
|
|
1075
|
-
Subject.prototype._innerSubscribe = function (subscriber) {
|
|
1076
|
-
var _this = this;
|
|
1077
|
-
var _a = this, hasError = _a.hasError, isStopped = _a.isStopped, observers = _a.observers;
|
|
1078
|
-
if (hasError || isStopped) {
|
|
1079
|
-
return EMPTY_SUBSCRIPTION;
|
|
1210
|
+
if (this.closed) {
|
|
1211
|
+
throw new ObjectUnsubscribedError();
|
|
1080
1212
|
}
|
|
1081
|
-
this.
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
_this.currentObservers = null;
|
|
1085
|
-
arrRemove(observers, subscriber);
|
|
1086
|
-
});
|
|
1087
|
-
};
|
|
1088
|
-
Subject.prototype._checkFinalizedStatuses = function (subscriber) {
|
|
1089
|
-
var _a = this, hasError = _a.hasError, thrownError = _a.thrownError, isStopped = _a.isStopped;
|
|
1090
|
-
if (hasError) {
|
|
1091
|
-
subscriber.error(thrownError);
|
|
1213
|
+
else if (this.hasError) {
|
|
1214
|
+
subscriber.error(this.thrownError);
|
|
1215
|
+
return Subscription$1.EMPTY;
|
|
1092
1216
|
}
|
|
1093
|
-
else if (isStopped) {
|
|
1217
|
+
else if (this.isStopped) {
|
|
1094
1218
|
subscriber.complete();
|
|
1219
|
+
return Subscription$1.EMPTY;
|
|
1220
|
+
}
|
|
1221
|
+
else {
|
|
1222
|
+
this.observers.push(subscriber);
|
|
1223
|
+
return new SubjectSubscription(this, subscriber);
|
|
1095
1224
|
}
|
|
1096
1225
|
};
|
|
1097
1226
|
Subject.prototype.asObservable = function () {
|
|
@@ -1104,8 +1233,8 @@ var Subject = (function (_super) {
|
|
|
1104
1233
|
};
|
|
1105
1234
|
return Subject;
|
|
1106
1235
|
}(Observable));
|
|
1107
|
-
var AnonymousSubject = (function (_super) {
|
|
1108
|
-
|
|
1236
|
+
var AnonymousSubject = /*@__PURE__*/ (function (_super) {
|
|
1237
|
+
tslib_1__namespace.__extends(AnonymousSubject, _super);
|
|
1109
1238
|
function AnonymousSubject(destination, source) {
|
|
1110
1239
|
var _this = _super.call(this) || this;
|
|
1111
1240
|
_this.destination = destination;
|
|
@@ -1113,20 +1242,31 @@ var AnonymousSubject = (function (_super) {
|
|
|
1113
1242
|
return _this;
|
|
1114
1243
|
}
|
|
1115
1244
|
AnonymousSubject.prototype.next = function (value) {
|
|
1116
|
-
var
|
|
1117
|
-
|
|
1245
|
+
var destination = this.destination;
|
|
1246
|
+
if (destination && destination.next) {
|
|
1247
|
+
destination.next(value);
|
|
1248
|
+
}
|
|
1118
1249
|
};
|
|
1119
1250
|
AnonymousSubject.prototype.error = function (err) {
|
|
1120
|
-
var
|
|
1121
|
-
|
|
1251
|
+
var destination = this.destination;
|
|
1252
|
+
if (destination && destination.error) {
|
|
1253
|
+
this.destination.error(err);
|
|
1254
|
+
}
|
|
1122
1255
|
};
|
|
1123
1256
|
AnonymousSubject.prototype.complete = function () {
|
|
1124
|
-
var
|
|
1125
|
-
|
|
1257
|
+
var destination = this.destination;
|
|
1258
|
+
if (destination && destination.complete) {
|
|
1259
|
+
this.destination.complete();
|
|
1260
|
+
}
|
|
1126
1261
|
};
|
|
1127
1262
|
AnonymousSubject.prototype._subscribe = function (subscriber) {
|
|
1128
|
-
var
|
|
1129
|
-
|
|
1263
|
+
var source = this.source;
|
|
1264
|
+
if (source) {
|
|
1265
|
+
return this.source.subscribe(subscriber);
|
|
1266
|
+
}
|
|
1267
|
+
else {
|
|
1268
|
+
return Subscription$1.EMPTY;
|
|
1269
|
+
}
|
|
1130
1270
|
};
|
|
1131
1271
|
return AnonymousSubject;
|
|
1132
1272
|
}(Subject));
|
|
@@ -1687,9 +1827,9 @@ class User extends BaseModel {
|
|
|
1687
1827
|
return ['id'];
|
|
1688
1828
|
}
|
|
1689
1829
|
}
|
|
1690
|
-
|
|
1830
|
+
tslib_1.__decorate([
|
|
1691
1831
|
classTransformer.Type(() => BeautyProfile),
|
|
1692
|
-
|
|
1832
|
+
tslib_1.__metadata("design:type", BeautyProfile)
|
|
1693
1833
|
], User.prototype, "beautyProfile", void 0);
|
|
1694
1834
|
|
|
1695
1835
|
class Address extends BaseModel {
|
|
@@ -1709,33 +1849,33 @@ class Subscription extends BaseModel {
|
|
|
1709
1849
|
return ['id'];
|
|
1710
1850
|
}
|
|
1711
1851
|
}
|
|
1712
|
-
|
|
1852
|
+
tslib_1.__decorate([
|
|
1713
1853
|
classTransformer.Type(() => User),
|
|
1714
|
-
|
|
1854
|
+
tslib_1.__metadata("design:type", User)
|
|
1715
1855
|
], Subscription.prototype, "user", void 0);
|
|
1716
|
-
|
|
1856
|
+
tslib_1.__decorate([
|
|
1717
1857
|
classTransformer.Type(() => SubscriptionPlan),
|
|
1718
|
-
|
|
1858
|
+
tslib_1.__metadata("design:type", SubscriptionPlan)
|
|
1719
1859
|
], Subscription.prototype, "subscriptionPlan", void 0);
|
|
1720
|
-
|
|
1860
|
+
tslib_1.__decorate([
|
|
1721
1861
|
classTransformer.Type(() => UserAddress),
|
|
1722
|
-
|
|
1862
|
+
tslib_1.__metadata("design:type", UserAddress)
|
|
1723
1863
|
], Subscription.prototype, "shippingAddress", void 0);
|
|
1724
|
-
|
|
1864
|
+
tslib_1.__decorate([
|
|
1725
1865
|
classTransformer.Type(() => UserAddress),
|
|
1726
|
-
|
|
1866
|
+
tslib_1.__metadata("design:type", UserAddress)
|
|
1727
1867
|
], Subscription.prototype, "billingAddress", void 0);
|
|
1728
|
-
|
|
1868
|
+
tslib_1.__decorate([
|
|
1729
1869
|
classTransformer.Type(() => Coupon),
|
|
1730
|
-
|
|
1870
|
+
tslib_1.__metadata("design:type", Coupon)
|
|
1731
1871
|
], Subscription.prototype, "coupon", void 0);
|
|
1732
|
-
|
|
1872
|
+
tslib_1.__decorate([
|
|
1733
1873
|
classTransformer.Type(() => Edition),
|
|
1734
|
-
|
|
1874
|
+
tslib_1.__metadata("design:type", Array)
|
|
1735
1875
|
], Subscription.prototype, "editions", void 0);
|
|
1736
|
-
|
|
1876
|
+
tslib_1.__decorate([
|
|
1737
1877
|
classTransformer.Type(() => SubscriptionPayment),
|
|
1738
|
-
|
|
1878
|
+
tslib_1.__metadata("design:type", Array)
|
|
1739
1879
|
], Subscription.prototype, "payment", void 0);
|
|
1740
1880
|
|
|
1741
1881
|
class Filter extends BaseModel {
|
|
@@ -1749,13 +1889,13 @@ class CategoryBase extends BaseModel {
|
|
|
1749
1889
|
return ['id'];
|
|
1750
1890
|
}
|
|
1751
1891
|
}
|
|
1752
|
-
|
|
1892
|
+
tslib_1.__decorate([
|
|
1753
1893
|
classTransformer.Type(() => CategoryBase),
|
|
1754
|
-
|
|
1894
|
+
tslib_1.__metadata("design:type", CategoryBase)
|
|
1755
1895
|
], CategoryBase.prototype, "parent", void 0);
|
|
1756
|
-
|
|
1896
|
+
tslib_1.__decorate([
|
|
1757
1897
|
classTransformer.Type(() => Filter),
|
|
1758
|
-
|
|
1898
|
+
tslib_1.__metadata("design:type", Array)
|
|
1759
1899
|
], CategoryBase.prototype, "filters", void 0);
|
|
1760
1900
|
|
|
1761
1901
|
class CategoryForProduct extends CategoryBase {
|
|
@@ -1793,9 +1933,9 @@ class ProductForKit extends ProductBase {
|
|
|
1793
1933
|
return ['id'];
|
|
1794
1934
|
}
|
|
1795
1935
|
}
|
|
1796
|
-
|
|
1936
|
+
tslib_1.__decorate([
|
|
1797
1937
|
classTransformer.Type(() => CategoryForProduct),
|
|
1798
|
-
|
|
1938
|
+
tslib_1.__metadata("design:type", CategoryForProduct)
|
|
1799
1939
|
], ProductForKit.prototype, "category", void 0);
|
|
1800
1940
|
|
|
1801
1941
|
class KitProduct extends BaseModel {
|
|
@@ -1803,13 +1943,13 @@ class KitProduct extends BaseModel {
|
|
|
1803
1943
|
return ['productId', 'kitProductId'];
|
|
1804
1944
|
}
|
|
1805
1945
|
}
|
|
1806
|
-
|
|
1946
|
+
tslib_1.__decorate([
|
|
1807
1947
|
classTransformer.Type(() => ProductForKit),
|
|
1808
|
-
|
|
1948
|
+
tslib_1.__metadata("design:type", ProductForKit)
|
|
1809
1949
|
], KitProduct.prototype, "kit", void 0);
|
|
1810
|
-
|
|
1950
|
+
tslib_1.__decorate([
|
|
1811
1951
|
classTransformer.Type(() => ProductForKit),
|
|
1812
|
-
|
|
1952
|
+
tslib_1.__metadata("design:type", ProductForKit)
|
|
1813
1953
|
], KitProduct.prototype, "product", void 0);
|
|
1814
1954
|
|
|
1815
1955
|
class ProductForCategory extends ProductBase {
|
|
@@ -1817,9 +1957,9 @@ class ProductForCategory extends ProductBase {
|
|
|
1817
1957
|
return ['id'];
|
|
1818
1958
|
}
|
|
1819
1959
|
}
|
|
1820
|
-
|
|
1960
|
+
tslib_1.__decorate([
|
|
1821
1961
|
classTransformer.Type(() => KitProduct),
|
|
1822
|
-
|
|
1962
|
+
tslib_1.__metadata("design:type", Array)
|
|
1823
1963
|
], ProductForCategory.prototype, "kitProducts", void 0);
|
|
1824
1964
|
|
|
1825
1965
|
class Category extends CategoryBase {
|
|
@@ -1827,9 +1967,9 @@ class Category extends CategoryBase {
|
|
|
1827
1967
|
return ['id'];
|
|
1828
1968
|
}
|
|
1829
1969
|
}
|
|
1830
|
-
|
|
1970
|
+
tslib_1.__decorate([
|
|
1831
1971
|
classTransformer.Type(() => ProductForCategory),
|
|
1832
|
-
|
|
1972
|
+
tslib_1.__metadata("design:type", Array)
|
|
1833
1973
|
], Category.prototype, "childrenProducts", void 0);
|
|
1834
1974
|
|
|
1835
1975
|
class CategoryCollectionChildren extends BaseModel {
|
|
@@ -1837,9 +1977,9 @@ class CategoryCollectionChildren extends BaseModel {
|
|
|
1837
1977
|
return ['collectionId', 'categoryId'];
|
|
1838
1978
|
}
|
|
1839
1979
|
}
|
|
1840
|
-
|
|
1980
|
+
tslib_1.__decorate([
|
|
1841
1981
|
classTransformer.Type(() => CategoryCollectionChildren),
|
|
1842
|
-
|
|
1982
|
+
tslib_1.__metadata("design:type", CategoryCollectionChildren)
|
|
1843
1983
|
], CategoryCollectionChildren.prototype, "parent", void 0);
|
|
1844
1984
|
|
|
1845
1985
|
class CategoryFilter extends BaseModel {
|
|
@@ -1847,13 +1987,13 @@ class CategoryFilter extends BaseModel {
|
|
|
1847
1987
|
return ['id'];
|
|
1848
1988
|
}
|
|
1849
1989
|
}
|
|
1850
|
-
|
|
1990
|
+
tslib_1.__decorate([
|
|
1851
1991
|
classTransformer.Type(() => Filter),
|
|
1852
|
-
|
|
1992
|
+
tslib_1.__metadata("design:type", Filter)
|
|
1853
1993
|
], CategoryFilter.prototype, "filter", void 0);
|
|
1854
|
-
|
|
1994
|
+
tslib_1.__decorate([
|
|
1855
1995
|
classTransformer.Type(() => Category),
|
|
1856
|
-
|
|
1996
|
+
tslib_1.__metadata("design:type", Category)
|
|
1857
1997
|
], CategoryFilter.prototype, "category", void 0);
|
|
1858
1998
|
|
|
1859
1999
|
exports.GenderDestination = void 0;
|
|
@@ -1882,21 +2022,15 @@ class Product extends ProductBase {
|
|
|
1882
2022
|
return ['id'];
|
|
1883
2023
|
}
|
|
1884
2024
|
}
|
|
1885
|
-
|
|
2025
|
+
tslib_1.__decorate([
|
|
1886
2026
|
classTransformer.Type(() => CategoryForProduct),
|
|
1887
|
-
|
|
2027
|
+
tslib_1.__metadata("design:type", CategoryForProduct)
|
|
1888
2028
|
], Product.prototype, "category", void 0);
|
|
1889
|
-
|
|
2029
|
+
tslib_1.__decorate([
|
|
1890
2030
|
classTransformer.Type(() => KitProduct),
|
|
1891
|
-
|
|
2031
|
+
tslib_1.__metadata("design:type", Array)
|
|
1892
2032
|
], Product.prototype, "kitProducts", void 0);
|
|
1893
2033
|
|
|
1894
|
-
class ProductReviews extends BaseModel {
|
|
1895
|
-
static get identifiersFields() {
|
|
1896
|
-
return ['id'];
|
|
1897
|
-
}
|
|
1898
|
-
}
|
|
1899
|
-
|
|
1900
2034
|
class Variant extends BaseModel {
|
|
1901
2035
|
static get identifiersFields() {
|
|
1902
2036
|
return ['id', 'productId'];
|
|
@@ -1914,9 +2048,9 @@ class Buy2Win extends BaseModel {
|
|
|
1914
2048
|
return ['id'];
|
|
1915
2049
|
}
|
|
1916
2050
|
}
|
|
1917
|
-
|
|
2051
|
+
tslib_1.__decorate([
|
|
1918
2052
|
classTransformer.Type(() => Category),
|
|
1919
|
-
|
|
2053
|
+
tslib_1.__metadata("design:type", Array)
|
|
1920
2054
|
], Buy2Win.prototype, "categories", void 0);
|
|
1921
2055
|
|
|
1922
2056
|
class CampaignDashboard extends BaseModel {
|
|
@@ -1945,29 +2079,29 @@ class Checkout extends BaseModel {
|
|
|
1945
2079
|
return ['id'];
|
|
1946
2080
|
}
|
|
1947
2081
|
}
|
|
1948
|
-
|
|
2082
|
+
tslib_1.__decorate([
|
|
1949
2083
|
classTransformer.Type(() => LineItem),
|
|
1950
|
-
|
|
2084
|
+
tslib_1.__metadata("design:type", Array)
|
|
1951
2085
|
], Checkout.prototype, "lineItems", void 0);
|
|
1952
|
-
|
|
2086
|
+
tslib_1.__decorate([
|
|
1953
2087
|
classTransformer.Type(() => User),
|
|
1954
|
-
|
|
2088
|
+
tslib_1.__metadata("design:type", User)
|
|
1955
2089
|
], Checkout.prototype, "user", void 0);
|
|
1956
|
-
|
|
2090
|
+
tslib_1.__decorate([
|
|
1957
2091
|
classTransformer.Type(() => UserAddress),
|
|
1958
|
-
|
|
2092
|
+
tslib_1.__metadata("design:type", UserAddress)
|
|
1959
2093
|
], Checkout.prototype, "shippingAddress", void 0);
|
|
1960
|
-
|
|
2094
|
+
tslib_1.__decorate([
|
|
1961
2095
|
classTransformer.Type(() => UserAddress),
|
|
1962
|
-
|
|
2096
|
+
tslib_1.__metadata("design:type", UserAddress)
|
|
1963
2097
|
], Checkout.prototype, "billingAddress", void 0);
|
|
1964
|
-
|
|
2098
|
+
tslib_1.__decorate([
|
|
1965
2099
|
classTransformer.Type(() => ShippingMethod),
|
|
1966
|
-
|
|
2100
|
+
tslib_1.__metadata("design:type", ShippingMethod)
|
|
1967
2101
|
], Checkout.prototype, "shipping", void 0);
|
|
1968
|
-
|
|
2102
|
+
tslib_1.__decorate([
|
|
1969
2103
|
classTransformer.Type(() => Coupon),
|
|
1970
|
-
|
|
2104
|
+
tslib_1.__metadata("design:type", Coupon)
|
|
1971
2105
|
], Checkout.prototype, "coupon", void 0);
|
|
1972
2106
|
|
|
1973
2107
|
exports.OrderStatus = void 0;
|
|
@@ -1984,9 +2118,9 @@ exports.OrderStatus = void 0;
|
|
|
1984
2118
|
|
|
1985
2119
|
class Order extends Checkout {
|
|
1986
2120
|
}
|
|
1987
|
-
|
|
2121
|
+
tslib_1.__decorate([
|
|
1988
2122
|
classTransformer.Type(() => Payment),
|
|
1989
|
-
|
|
2123
|
+
tslib_1.__metadata("design:type", Payment)
|
|
1990
2124
|
], Order.prototype, "payment", void 0);
|
|
1991
2125
|
|
|
1992
2126
|
class CheckoutSubscription extends BaseModel {
|
|
@@ -1994,21 +2128,21 @@ class CheckoutSubscription extends BaseModel {
|
|
|
1994
2128
|
return ['id'];
|
|
1995
2129
|
}
|
|
1996
2130
|
}
|
|
1997
|
-
|
|
2131
|
+
tslib_1.__decorate([
|
|
1998
2132
|
classTransformer.Type(() => UserAddress),
|
|
1999
|
-
|
|
2133
|
+
tslib_1.__metadata("design:type", UserAddress)
|
|
2000
2134
|
], CheckoutSubscription.prototype, "shippingAddress", void 0);
|
|
2001
|
-
|
|
2135
|
+
tslib_1.__decorate([
|
|
2002
2136
|
classTransformer.Type(() => UserAddress),
|
|
2003
|
-
|
|
2137
|
+
tslib_1.__metadata("design:type", UserAddress)
|
|
2004
2138
|
], CheckoutSubscription.prototype, "billingAddress", void 0);
|
|
2005
|
-
|
|
2139
|
+
tslib_1.__decorate([
|
|
2006
2140
|
classTransformer.Type(() => SubscriptionPlan),
|
|
2007
|
-
|
|
2141
|
+
tslib_1.__metadata("design:type", SubscriptionPlan)
|
|
2008
2142
|
], CheckoutSubscription.prototype, "subscriptionPlan", void 0);
|
|
2009
|
-
|
|
2143
|
+
tslib_1.__decorate([
|
|
2010
2144
|
classTransformer.Type(() => Coupon),
|
|
2011
|
-
|
|
2145
|
+
tslib_1.__metadata("design:type", Coupon)
|
|
2012
2146
|
], CheckoutSubscription.prototype, "coupon", void 0);
|
|
2013
2147
|
|
|
2014
2148
|
class SubscriptionMaterialization extends BaseModel {
|
|
@@ -2016,33 +2150,33 @@ class SubscriptionMaterialization extends BaseModel {
|
|
|
2016
2150
|
return ['id'];
|
|
2017
2151
|
}
|
|
2018
2152
|
}
|
|
2019
|
-
|
|
2153
|
+
tslib_1.__decorate([
|
|
2020
2154
|
classTransformer.Type(() => User),
|
|
2021
|
-
|
|
2155
|
+
tslib_1.__metadata("design:type", User)
|
|
2022
2156
|
], SubscriptionMaterialization.prototype, "user", void 0);
|
|
2023
|
-
|
|
2157
|
+
tslib_1.__decorate([
|
|
2024
2158
|
classTransformer.Type(() => SubscriptionPlan),
|
|
2025
|
-
|
|
2159
|
+
tslib_1.__metadata("design:type", SubscriptionPlan)
|
|
2026
2160
|
], SubscriptionMaterialization.prototype, "subscriptionPlan", void 0);
|
|
2027
|
-
|
|
2161
|
+
tslib_1.__decorate([
|
|
2028
2162
|
classTransformer.Type(() => UserAddress),
|
|
2029
|
-
|
|
2163
|
+
tslib_1.__metadata("design:type", UserAddress)
|
|
2030
2164
|
], SubscriptionMaterialization.prototype, "shippingAddress", void 0);
|
|
2031
|
-
|
|
2165
|
+
tslib_1.__decorate([
|
|
2032
2166
|
classTransformer.Type(() => UserAddress),
|
|
2033
|
-
|
|
2167
|
+
tslib_1.__metadata("design:type", UserAddress)
|
|
2034
2168
|
], SubscriptionMaterialization.prototype, "billingAddress", void 0);
|
|
2035
|
-
|
|
2169
|
+
tslib_1.__decorate([
|
|
2036
2170
|
classTransformer.Type(() => Coupon),
|
|
2037
|
-
|
|
2171
|
+
tslib_1.__metadata("design:type", Coupon)
|
|
2038
2172
|
], SubscriptionMaterialization.prototype, "coupon", void 0);
|
|
2039
|
-
|
|
2173
|
+
tslib_1.__decorate([
|
|
2040
2174
|
classTransformer.Type(() => Edition),
|
|
2041
|
-
|
|
2175
|
+
tslib_1.__metadata("design:type", Array)
|
|
2042
2176
|
], SubscriptionMaterialization.prototype, "editions", void 0);
|
|
2043
|
-
|
|
2177
|
+
tslib_1.__decorate([
|
|
2044
2178
|
classTransformer.Type(() => SubscriptionPayment),
|
|
2045
|
-
|
|
2179
|
+
tslib_1.__metadata("design:type", SubscriptionPayment)
|
|
2046
2180
|
], SubscriptionMaterialization.prototype, "payment", void 0);
|
|
2047
2181
|
|
|
2048
2182
|
class SubscriptionSummary extends BaseModel {
|
|
@@ -2468,7 +2602,7 @@ class ProductsIndex {
|
|
|
2468
2602
|
}
|
|
2469
2603
|
async save(product) {
|
|
2470
2604
|
try {
|
|
2471
|
-
const { createdAt, updatedAt, kitProducts } = product, data =
|
|
2605
|
+
const { createdAt, updatedAt, kitProducts } = product, data = tslib_1.__rest(product, ["createdAt", "updatedAt", "kitProducts"]);
|
|
2472
2606
|
this.adapter.save(this.index, data);
|
|
2473
2607
|
}
|
|
2474
2608
|
catch (error) {
|
|
@@ -4067,20 +4201,20 @@ class CategoryHasuraGraphQL extends Category {
|
|
|
4067
4201
|
|
|
4068
4202
|
class ProductHasuraGraphQL extends Product {
|
|
4069
4203
|
}
|
|
4070
|
-
|
|
4204
|
+
tslib_1.__decorate([
|
|
4071
4205
|
classTransformer.Type(() => KitProductHasuraGraphQL),
|
|
4072
|
-
|
|
4206
|
+
tslib_1.__metadata("design:type", Array)
|
|
4073
4207
|
], ProductHasuraGraphQL.prototype, "kitProducts", void 0);
|
|
4074
4208
|
|
|
4075
4209
|
class KitProductHasuraGraphQL extends KitProduct {
|
|
4076
4210
|
}
|
|
4077
|
-
|
|
4211
|
+
tslib_1.__decorate([
|
|
4078
4212
|
classTransformer.Type(() => ProductHasuraGraphQL),
|
|
4079
|
-
|
|
4213
|
+
tslib_1.__metadata("design:type", ProductHasuraGraphQL)
|
|
4080
4214
|
], KitProductHasuraGraphQL.prototype, "kit", void 0);
|
|
4081
|
-
|
|
4215
|
+
tslib_1.__decorate([
|
|
4082
4216
|
classTransformer.Type(() => ProductHasuraGraphQL),
|
|
4083
|
-
|
|
4217
|
+
tslib_1.__metadata("design:type", ProductHasuraGraphQL)
|
|
4084
4218
|
], KitProductHasuraGraphQL.prototype, "product", void 0);
|
|
4085
4219
|
|
|
4086
4220
|
class VariantHasuraGraphQL extends Variant {
|
|
@@ -4322,7 +4456,7 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
4322
4456
|
this.categoryFilterRepository = categoryFilterRepository;
|
|
4323
4457
|
}
|
|
4324
4458
|
async create(params) {
|
|
4325
|
-
const { metadata } = params, data =
|
|
4459
|
+
const { metadata } = params, data = tslib_1.__rest(params, ["metadata"]);
|
|
4326
4460
|
return super.create(Object.assign(Object.assign({}, data), { isWishlist: false, metadata: metadata || { description: null, title: null } }));
|
|
4327
4461
|
}
|
|
4328
4462
|
async get(identifiers) {
|
|
@@ -4332,7 +4466,7 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
4332
4466
|
: super.get(identifiers);
|
|
4333
4467
|
}
|
|
4334
4468
|
async update(params) {
|
|
4335
|
-
const { products, id: checkId, metadata, filters } = params, data =
|
|
4469
|
+
const { products, id: checkId, metadata, filters } = params, data = tslib_1.__rest(params, ["products", "id", "metadata", "filters"]);
|
|
4336
4470
|
const plainData = this.paramsToPlain({ id: checkId });
|
|
4337
4471
|
const id = await this.getId(plainData.id);
|
|
4338
4472
|
const category = await super.update(Object.assign(Object.assign({ id }, data), { isWishlist: false }));
|
|
@@ -4584,7 +4718,7 @@ class FilterHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGrap
|
|
|
4584
4718
|
this.categoryFilterRepository = categoryFilterRepository;
|
|
4585
4719
|
}
|
|
4586
4720
|
async update(params) {
|
|
4587
|
-
const { options } = params, data =
|
|
4721
|
+
const { options } = params, data = tslib_1.__rest(params, ["options"]);
|
|
4588
4722
|
const filter = await super.update(data);
|
|
4589
4723
|
filter.options = await this.updateOptions(+data.id, { options });
|
|
4590
4724
|
return filter;
|
|
@@ -4720,10 +4854,9 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
4720
4854
|
howToUse: data.how_to_use,
|
|
4721
4855
|
brand: data.brand_description,
|
|
4722
4856
|
ingredients: data.ingredients,
|
|
4723
|
-
purpose: data.purpose,
|
|
4724
4857
|
}),
|
|
4725
4858
|
bindFindFilter: (filters) => {
|
|
4726
|
-
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(
|
|
4859
|
+
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, ((filters === null || filters === void 0 ? void 0 : filters.description) && { description: filters.description })), (filters.differentials && { differentials: filters.differentials })), (filters.whoMustUse && {
|
|
4727
4860
|
who_must_use: filters.whoMustUse,
|
|
4728
4861
|
})), (filters.howToUse && {
|
|
4729
4862
|
how_to_use: filters.howToUse,
|
|
@@ -4731,13 +4864,11 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
4731
4864
|
brand_description: filters.brand,
|
|
4732
4865
|
})), (filters.ingredients && {
|
|
4733
4866
|
ingredients: filters.ingredients,
|
|
4734
|
-
})), (filters.purpose && {
|
|
4735
|
-
purpose: filters.purpose,
|
|
4736
4867
|
}));
|
|
4737
4868
|
},
|
|
4738
|
-
bindPersistData: (descriptionData) => (Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(
|
|
4869
|
+
bindPersistData: (descriptionData) => (Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, ((descriptionData === null || descriptionData === void 0 ? void 0 : descriptionData.description) && { description: descriptionData.description })), (descriptionData.differentials && { differentials: descriptionData.differentials })), (descriptionData.whoMustUse && {
|
|
4739
4870
|
who_must_use: descriptionData.whoMustUse,
|
|
4740
|
-
})), (descriptionData.howToUse && { how_to_use: descriptionData.howToUse })), (descriptionData.brand && { brand_description: descriptionData.brand })), (descriptionData.ingredients && { ingredients: descriptionData.ingredients }))
|
|
4871
|
+
})), (descriptionData.howToUse && { how_to_use: descriptionData.howToUse })), (descriptionData.brand && { brand_description: descriptionData.brand })), (descriptionData.ingredients && { ingredients: descriptionData.ingredients }))),
|
|
4741
4872
|
},
|
|
4742
4873
|
},
|
|
4743
4874
|
{ differentials: { columnName: 'differentials' } },
|
|
@@ -4745,7 +4876,6 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
4745
4876
|
{ howToUse: { columnName: 'how_to_use' } },
|
|
4746
4877
|
{ brandDescription: { columnName: 'brand_description' } },
|
|
4747
4878
|
{ ingredients: { columnName: 'ingredients' } },
|
|
4748
|
-
{ purpose: { columnName: 'purpose' } },
|
|
4749
4879
|
{ hasVariants: { columnName: 'has_variants' } },
|
|
4750
4880
|
{
|
|
4751
4881
|
images: {
|
|
@@ -4861,7 +4991,7 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
4861
4991
|
];
|
|
4862
4992
|
}
|
|
4863
4993
|
async create(params) {
|
|
4864
|
-
const { metadata } = params, data =
|
|
4994
|
+
const { metadata } = params, data = tslib_1.__rest(params, ["metadata"]);
|
|
4865
4995
|
const product = await super.create(lodash.omit(Object.assign(Object.assign({}, data), { metadata: metadata || { description: null, title: null } }), ['reviews']));
|
|
4866
4996
|
try {
|
|
4867
4997
|
product.reviews = data.reviews && (await this.updateReviews(+product.id, data));
|
|
@@ -4884,7 +5014,7 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
4884
5014
|
}
|
|
4885
5015
|
async find(params) {
|
|
4886
5016
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
4887
|
-
const _o = params || {}, { filters, fields } = _o, options =
|
|
5017
|
+
const _o = params || {}, { filters, fields } = _o, options = tslib_1.__rest(_o, ["filters", "fields"]);
|
|
4888
5018
|
const bindFields = fields ||
|
|
4889
5019
|
this.fields
|
|
4890
5020
|
.map((field) => (typeof field === 'string' ? field : Object.keys(field).shift()))
|
|
@@ -4922,7 +5052,7 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
4922
5052
|
return product;
|
|
4923
5053
|
}
|
|
4924
5054
|
async update(params) {
|
|
4925
|
-
const { categories, kitProducts, reviews, id: checkId, rate, metadata } = params, data =
|
|
5055
|
+
const { categories, kitProducts, reviews, id: checkId, rate, metadata } = params, data = tslib_1.__rest(params, ["categories", "kitProducts", "reviews", "id", "rate", "metadata"]);
|
|
4926
5056
|
const plainData = this.paramsToPlain({ id: checkId });
|
|
4927
5057
|
const id = await this.getId(plainData.id);
|
|
4928
5058
|
const product = await super.update(Object.assign({ id }, data));
|
|
@@ -5129,41 +5259,6 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
5129
5259
|
}
|
|
5130
5260
|
}
|
|
5131
5261
|
|
|
5132
|
-
class ProductReviewsHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
5133
|
-
constructor({ endpoint, authOptions, interceptors, }) {
|
|
5134
|
-
super({
|
|
5135
|
-
tableName: 'product_review',
|
|
5136
|
-
model: ProductReviews,
|
|
5137
|
-
endpoint,
|
|
5138
|
-
authOptions,
|
|
5139
|
-
interceptors,
|
|
5140
|
-
fields: [
|
|
5141
|
-
'id',
|
|
5142
|
-
{ productId: { columnName: 'product_id' } },
|
|
5143
|
-
'shop',
|
|
5144
|
-
'rate',
|
|
5145
|
-
'author',
|
|
5146
|
-
'email',
|
|
5147
|
-
'location',
|
|
5148
|
-
'review',
|
|
5149
|
-
'status',
|
|
5150
|
-
'title',
|
|
5151
|
-
{ personId: { columnName: 'person_id' } },
|
|
5152
|
-
'points',
|
|
5153
|
-
{ orderId: { columnName: 'order_id' } },
|
|
5154
|
-
{ createdAt: { columnName: 'created_at' } },
|
|
5155
|
-
{ updatedAt: { columnName: 'updated_at' } },
|
|
5156
|
-
],
|
|
5157
|
-
});
|
|
5158
|
-
}
|
|
5159
|
-
aproveReview(id) {
|
|
5160
|
-
return this.update({ id, status: true });
|
|
5161
|
-
}
|
|
5162
|
-
disaproveReview(id) {
|
|
5163
|
-
return this.update({ id, status: false });
|
|
5164
|
-
}
|
|
5165
|
-
}
|
|
5166
|
-
|
|
5167
5262
|
class VariantHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
5168
5263
|
constructor({ endpoint, authOptions, interceptors, }) {
|
|
5169
5264
|
super({
|
|
@@ -5242,11 +5337,11 @@ class VariantHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
5242
5337
|
return variant;
|
|
5243
5338
|
}
|
|
5244
5339
|
async find(params) {
|
|
5245
|
-
const _a = params || {}, { filters } = _a, options =
|
|
5340
|
+
const _a = params || {}, { filters } = _a, options = tslib_1.__rest(_a, ["filters"]);
|
|
5246
5341
|
return super.find(Object.assign(Object.assign({}, options), { filters: Object.assign({ productId: { operator: exports.Where.ISNOTNULL } }, filters) }));
|
|
5247
5342
|
}
|
|
5248
5343
|
async update(params) {
|
|
5249
|
-
const { productId, id: checkId } = params, data =
|
|
5344
|
+
const { productId, id: checkId } = params, data = tslib_1.__rest(params, ["productId", "id"]);
|
|
5250
5345
|
const dataWithProductId = this.paramsToPlain({ id: checkId, productId });
|
|
5251
5346
|
const id = await this.getId(dataWithProductId.id);
|
|
5252
5347
|
const product = await super.update(Object.assign({ id }, data));
|
|
@@ -5354,7 +5449,7 @@ class WishlistHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
5354
5449
|
this.categoryFilterRepository = categoryFilterRepository;
|
|
5355
5450
|
}
|
|
5356
5451
|
async create(params) {
|
|
5357
|
-
const { metadata } = params, data =
|
|
5452
|
+
const { metadata } = params, data = tslib_1.__rest(params, ["metadata"]);
|
|
5358
5453
|
return super.create(Object.assign(Object.assign({}, data), { isWishlist: true, isCollection: true, brandCategory: false, metadata: metadata || { description: data.description, title: data.name } }));
|
|
5359
5454
|
}
|
|
5360
5455
|
async get(identifiers) {
|
|
@@ -5364,7 +5459,7 @@ class WishlistHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
5364
5459
|
return data;
|
|
5365
5460
|
}
|
|
5366
5461
|
async update(params) {
|
|
5367
|
-
const { products, id: checkId, metadata, filters } = params, data =
|
|
5462
|
+
const { products, id: checkId, metadata, filters } = params, data = tslib_1.__rest(params, ["products", "id", "metadata", "filters"]);
|
|
5368
5463
|
const plainData = this.paramsToPlain({ id: checkId });
|
|
5369
5464
|
const id = plainData.id;
|
|
5370
5465
|
const category = await super.update(Object.assign(Object.assign({ id }, data), { isWishlist: true, isCollection: true, brandCategory: false }));
|
|
@@ -5660,8 +5755,6 @@ exports.Product = Product;
|
|
|
5660
5755
|
exports.ProductFirestoreRepository = ProductFirestoreRepository;
|
|
5661
5756
|
exports.ProductHasuraGraphQL = ProductHasuraGraphQL;
|
|
5662
5757
|
exports.ProductHasuraGraphQLRepository = ProductHasuraGraphQLRepository;
|
|
5663
|
-
exports.ProductReviews = ProductReviews;
|
|
5664
|
-
exports.ProductReviewsHasuraGraphQLRepository = ProductReviewsHasuraGraphQLRepository;
|
|
5665
5758
|
exports.ProductVariantFirestoreRepository = ProductVariantFirestoreRepository;
|
|
5666
5759
|
exports.ProductsIndex = ProductsIndex;
|
|
5667
5760
|
exports.RecoveryPassword = RecoveryPassword;
|