@quintype/components 3.4.2-access-token-api.0 → 3.4.2-paywall-loader.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/cjs/index.js CHANGED
@@ -5159,7 +5159,7 @@ var AccessTypeBase = /*#__PURE__*/function (_React$Component) {
5159
5159
  return null;
5160
5160
  };
5161
5161
  _context8.next = 3;
5162
- return fetch("/api/auth/v1/access-token/integrations/".concat(_this.props.accessTypeBkIntegrationId));
5162
+ return fetch("/api/v1/access-token/integrations/".concat(_this.props.accessTypeBkIntegrationId));
5163
5163
 
5164
5164
  case 3:
5165
5165
  jwtResponse = _context8.sent;
@@ -5454,7 +5454,7 @@ var AccessTypeBase = /*#__PURE__*/function (_React$Component) {
5454
5454
 
5455
5455
  _defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "checkAccess", /*#__PURE__*/function () {
5456
5456
  var _ref13 = _asyncToGenerator__default["default"]( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee11(assetId) {
5457
- var asset, _yield$awaitHelper9, error, accessData, accessById, granted, grantReason, _accessData$data, data;
5457
+ var asset, _yield$awaitHelper9, error, accessData, accessById, _ref14, granted, grantReason, _ref14$data, data;
5458
5458
 
5459
5459
  return _regeneratorRuntime__default["default"].wrap(function _callee11$(_context11) {
5460
5460
  while (1) {
@@ -5482,13 +5482,22 @@ var AccessTypeBase = /*#__PURE__*/function (_React$Component) {
5482
5482
  _yield$awaitHelper9 = _context11.sent;
5483
5483
  error = _yield$awaitHelper9.error;
5484
5484
  accessData = _yield$awaitHelper9.data;
5485
+
5486
+ if (!error) {
5487
+ _context11.next = 12;
5488
+ break;
5489
+ }
5490
+
5491
+ return _context11.abrupt("return", error);
5492
+
5493
+ case 12:
5485
5494
  accessById = _defineProperty__default["default"]({}, assetId, accessData);
5486
5495
 
5487
5496
  _this.props.accessUpdated(accessById);
5488
5497
 
5489
5498
  _this.props.accessIsLoading(false);
5490
5499
 
5491
- granted = accessData.granted, grantReason = accessData.grantReason, _accessData$data = accessData.data, data = _accessData$data === void 0 ? {} : _accessData$data;
5500
+ _ref14 = accessData || {}, granted = _ref14.granted, grantReason = _ref14.grantReason, _ref14$data = _ref14.data, data = _ref14$data === void 0 ? {} : _ref14$data;
5492
5501
 
5493
5502
  if (!_this.props.disableMetering && granted && grantReason === "METERING") {
5494
5503
  _this.pingBackMeteredStory(asset, accessData);
@@ -5496,14 +5505,6 @@ var AccessTypeBase = /*#__PURE__*/function (_React$Component) {
5496
5505
  _this.props.meterUpdated(data.numberRemaining || -1);
5497
5506
  }
5498
5507
 
5499
- if (!error) {
5500
- _context11.next = 17;
5501
- break;
5502
- }
5503
-
5504
- return _context11.abrupt("return", error);
5505
-
5506
- case 17:
5507
5508
  return _context11.abrupt("return", accessById);
5508
5509
 
5509
5510
  case 18:
@@ -5549,7 +5550,7 @@ var AccessTypeBase = /*#__PURE__*/function (_React$Component) {
5549
5550
  })));
5550
5551
 
5551
5552
  _defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "setSubscriberMetadata", /*#__PURE__*/function () {
5552
- var _ref15 = _asyncToGenerator__default["default"]( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee13(subscriberMetadata) {
5553
+ var _ref16 = _asyncToGenerator__default["default"]( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee13(subscriberMetadata) {
5553
5554
  var response;
5554
5555
  return _regeneratorRuntime__default["default"].wrap(function _callee13$(_context13) {
5555
5556
  while (1) {
@@ -5579,7 +5580,7 @@ var AccessTypeBase = /*#__PURE__*/function (_React$Component) {
5579
5580
  }));
5580
5581
 
5581
5582
  return function (_x9) {
5582
- return _ref15.apply(this, arguments);
5583
+ return _ref16.apply(this, arguments);
5583
5584
  };
5584
5585
  }());
5585
5586
 
@@ -5595,29 +5596,29 @@ var AccessTypeBase = /*#__PURE__*/function (_React$Component) {
5595
5596
  }
5596
5597
  }, {
5597
5598
  key: "makePaymentObject",
5598
- value: function makePaymentObject(_ref16) {
5599
- var _ref16$selectedPlan = _ref16.selectedPlan,
5600
- selectedPlan = _ref16$selectedPlan === void 0 ? {} : _ref16$selectedPlan,
5601
- _ref16$couponCode = _ref16.couponCode,
5602
- couponCode = _ref16$couponCode === void 0 ? "" : _ref16$couponCode,
5603
- _ref16$recipientSubsc = _ref16.recipientSubscriber,
5604
- recipientSubscriber = _ref16$recipientSubsc === void 0 ? {} : _ref16$recipientSubsc,
5605
- _ref16$planType = _ref16.planType,
5606
- planType = _ref16$planType === void 0 ? "" : _ref16$planType,
5607
- _ref16$storyId = _ref16.storyId,
5608
- storyId = _ref16$storyId === void 0 ? "" : _ref16$storyId,
5609
- _ref16$storyHeadline = _ref16.storyHeadline,
5610
- storyHeadline = _ref16$storyHeadline === void 0 ? "" : _ref16$storyHeadline,
5611
- _ref16$storySlug = _ref16.storySlug,
5612
- storySlug = _ref16$storySlug === void 0 ? "" : _ref16$storySlug,
5613
- _ref16$paymentType = _ref16.paymentType,
5614
- paymentType = _ref16$paymentType === void 0 ? "" : _ref16$paymentType,
5615
- _ref16$successUrl = _ref16.successUrl,
5616
- successUrl = _ref16$successUrl === void 0 ? "" : _ref16$successUrl,
5617
- _ref16$returnUrl = _ref16.returnUrl,
5618
- returnUrl = _ref16$returnUrl === void 0 ? "" : _ref16$returnUrl,
5619
- _ref16$cancelUrl = _ref16.cancelUrl,
5620
- cancelUrl = _ref16$cancelUrl === void 0 ? "" : _ref16$cancelUrl;
5599
+ value: function makePaymentObject(_ref17) {
5600
+ var _ref17$selectedPlan = _ref17.selectedPlan,
5601
+ selectedPlan = _ref17$selectedPlan === void 0 ? {} : _ref17$selectedPlan,
5602
+ _ref17$couponCode = _ref17.couponCode,
5603
+ couponCode = _ref17$couponCode === void 0 ? "" : _ref17$couponCode,
5604
+ _ref17$recipientSubsc = _ref17.recipientSubscriber,
5605
+ recipientSubscriber = _ref17$recipientSubsc === void 0 ? {} : _ref17$recipientSubsc,
5606
+ _ref17$planType = _ref17.planType,
5607
+ planType = _ref17$planType === void 0 ? "" : _ref17$planType,
5608
+ _ref17$storyId = _ref17.storyId,
5609
+ storyId = _ref17$storyId === void 0 ? "" : _ref17$storyId,
5610
+ _ref17$storyHeadline = _ref17.storyHeadline,
5611
+ storyHeadline = _ref17$storyHeadline === void 0 ? "" : _ref17$storyHeadline,
5612
+ _ref17$storySlug = _ref17.storySlug,
5613
+ storySlug = _ref17$storySlug === void 0 ? "" : _ref17$storySlug,
5614
+ _ref17$paymentType = _ref17.paymentType,
5615
+ paymentType = _ref17$paymentType === void 0 ? "" : _ref17$paymentType,
5616
+ _ref17$successUrl = _ref17.successUrl,
5617
+ successUrl = _ref17$successUrl === void 0 ? "" : _ref17$successUrl,
5618
+ _ref17$returnUrl = _ref17.returnUrl,
5619
+ returnUrl = _ref17$returnUrl === void 0 ? "" : _ref17$returnUrl,
5620
+ _ref17$cancelUrl = _ref17.cancelUrl,
5621
+ cancelUrl = _ref17$cancelUrl === void 0 ? "" : _ref17$cancelUrl;
5621
5622
  var id = selectedPlan.id,
5622
5623
  title = selectedPlan.title,
5623
5624
  description = selectedPlan.description,
@@ -429,7 +429,7 @@ var AccessTypeBase = /*#__PURE__*/function (_React$Component) {
429
429
  return null;
430
430
  };
431
431
  _context8.next = 3;
432
- return fetch("/api/auth/v1/access-token/integrations/".concat(_this.props.accessTypeBkIntegrationId));
432
+ return fetch("/api/v1/access-token/integrations/".concat(_this.props.accessTypeBkIntegrationId));
433
433
 
434
434
  case 3:
435
435
  jwtResponse = _context8.sent;
@@ -724,7 +724,7 @@ var AccessTypeBase = /*#__PURE__*/function (_React$Component) {
724
724
 
725
725
  _defineProperty(_assertThisInitialized(_this), "checkAccess", /*#__PURE__*/function () {
726
726
  var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(assetId) {
727
- var asset, _yield$awaitHelper9, error, accessData, accessById, granted, grantReason, _accessData$data, data;
727
+ var asset, _yield$awaitHelper9, error, accessData, accessById, _ref14, granted, grantReason, _ref14$data, data;
728
728
 
729
729
  return _regeneratorRuntime.wrap(function _callee11$(_context11) {
730
730
  while (1) {
@@ -752,13 +752,22 @@ var AccessTypeBase = /*#__PURE__*/function (_React$Component) {
752
752
  _yield$awaitHelper9 = _context11.sent;
753
753
  error = _yield$awaitHelper9.error;
754
754
  accessData = _yield$awaitHelper9.data;
755
+
756
+ if (!error) {
757
+ _context11.next = 12;
758
+ break;
759
+ }
760
+
761
+ return _context11.abrupt("return", error);
762
+
763
+ case 12:
755
764
  accessById = _defineProperty({}, assetId, accessData);
756
765
 
757
766
  _this.props.accessUpdated(accessById);
758
767
 
759
768
  _this.props.accessIsLoading(false);
760
769
 
761
- granted = accessData.granted, grantReason = accessData.grantReason, _accessData$data = accessData.data, data = _accessData$data === void 0 ? {} : _accessData$data;
770
+ _ref14 = accessData || {}, granted = _ref14.granted, grantReason = _ref14.grantReason, _ref14$data = _ref14.data, data = _ref14$data === void 0 ? {} : _ref14$data;
762
771
 
763
772
  if (!_this.props.disableMetering && granted && grantReason === "METERING") {
764
773
  _this.pingBackMeteredStory(asset, accessData);
@@ -766,14 +775,6 @@ var AccessTypeBase = /*#__PURE__*/function (_React$Component) {
766
775
  _this.props.meterUpdated(data.numberRemaining || -1);
767
776
  }
768
777
 
769
- if (!error) {
770
- _context11.next = 17;
771
- break;
772
- }
773
-
774
- return _context11.abrupt("return", error);
775
-
776
- case 17:
777
778
  return _context11.abrupt("return", accessById);
778
779
 
779
780
  case 18:
@@ -819,7 +820,7 @@ var AccessTypeBase = /*#__PURE__*/function (_React$Component) {
819
820
  })));
820
821
 
821
822
  _defineProperty(_assertThisInitialized(_this), "setSubscriberMetadata", /*#__PURE__*/function () {
822
- var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(subscriberMetadata) {
823
+ var _ref16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(subscriberMetadata) {
823
824
  var response;
824
825
  return _regeneratorRuntime.wrap(function _callee13$(_context13) {
825
826
  while (1) {
@@ -849,7 +850,7 @@ var AccessTypeBase = /*#__PURE__*/function (_React$Component) {
849
850
  }));
850
851
 
851
852
  return function (_x9) {
852
- return _ref15.apply(this, arguments);
853
+ return _ref16.apply(this, arguments);
853
854
  };
854
855
  }());
855
856
 
@@ -865,29 +866,29 @@ var AccessTypeBase = /*#__PURE__*/function (_React$Component) {
865
866
  }
866
867
  }, {
867
868
  key: "makePaymentObject",
868
- value: function makePaymentObject(_ref16) {
869
- var _ref16$selectedPlan = _ref16.selectedPlan,
870
- selectedPlan = _ref16$selectedPlan === void 0 ? {} : _ref16$selectedPlan,
871
- _ref16$couponCode = _ref16.couponCode,
872
- couponCode = _ref16$couponCode === void 0 ? "" : _ref16$couponCode,
873
- _ref16$recipientSubsc = _ref16.recipientSubscriber,
874
- recipientSubscriber = _ref16$recipientSubsc === void 0 ? {} : _ref16$recipientSubsc,
875
- _ref16$planType = _ref16.planType,
876
- planType = _ref16$planType === void 0 ? "" : _ref16$planType,
877
- _ref16$storyId = _ref16.storyId,
878
- storyId = _ref16$storyId === void 0 ? "" : _ref16$storyId,
879
- _ref16$storyHeadline = _ref16.storyHeadline,
880
- storyHeadline = _ref16$storyHeadline === void 0 ? "" : _ref16$storyHeadline,
881
- _ref16$storySlug = _ref16.storySlug,
882
- storySlug = _ref16$storySlug === void 0 ? "" : _ref16$storySlug,
883
- _ref16$paymentType = _ref16.paymentType,
884
- paymentType = _ref16$paymentType === void 0 ? "" : _ref16$paymentType,
885
- _ref16$successUrl = _ref16.successUrl,
886
- successUrl = _ref16$successUrl === void 0 ? "" : _ref16$successUrl,
887
- _ref16$returnUrl = _ref16.returnUrl,
888
- returnUrl = _ref16$returnUrl === void 0 ? "" : _ref16$returnUrl,
889
- _ref16$cancelUrl = _ref16.cancelUrl,
890
- cancelUrl = _ref16$cancelUrl === void 0 ? "" : _ref16$cancelUrl;
869
+ value: function makePaymentObject(_ref17) {
870
+ var _ref17$selectedPlan = _ref17.selectedPlan,
871
+ selectedPlan = _ref17$selectedPlan === void 0 ? {} : _ref17$selectedPlan,
872
+ _ref17$couponCode = _ref17.couponCode,
873
+ couponCode = _ref17$couponCode === void 0 ? "" : _ref17$couponCode,
874
+ _ref17$recipientSubsc = _ref17.recipientSubscriber,
875
+ recipientSubscriber = _ref17$recipientSubsc === void 0 ? {} : _ref17$recipientSubsc,
876
+ _ref17$planType = _ref17.planType,
877
+ planType = _ref17$planType === void 0 ? "" : _ref17$planType,
878
+ _ref17$storyId = _ref17.storyId,
879
+ storyId = _ref17$storyId === void 0 ? "" : _ref17$storyId,
880
+ _ref17$storyHeadline = _ref17.storyHeadline,
881
+ storyHeadline = _ref17$storyHeadline === void 0 ? "" : _ref17$storyHeadline,
882
+ _ref17$storySlug = _ref17.storySlug,
883
+ storySlug = _ref17$storySlug === void 0 ? "" : _ref17$storySlug,
884
+ _ref17$paymentType = _ref17.paymentType,
885
+ paymentType = _ref17$paymentType === void 0 ? "" : _ref17$paymentType,
886
+ _ref17$successUrl = _ref17.successUrl,
887
+ successUrl = _ref17$successUrl === void 0 ? "" : _ref17$successUrl,
888
+ _ref17$returnUrl = _ref17.returnUrl,
889
+ returnUrl = _ref17$returnUrl === void 0 ? "" : _ref17$returnUrl,
890
+ _ref17$cancelUrl = _ref17.cancelUrl,
891
+ cancelUrl = _ref17$cancelUrl === void 0 ? "" : _ref17$cancelUrl;
891
892
  var id = selectedPlan.id,
892
893
  title = selectedPlan.title,
893
894
  description = selectedPlan.description,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quintype/components",
3
- "version": "3.4.2-access-token-api.0",
3
+ "version": "3.4.2-paywall-loader.0",
4
4
  "description": "Components to help build Quintype Node.js apps",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/es/index.js",