@quintype/components 2.32.0 → 3.0.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.
@@ -762,6 +762,70 @@ var AccessTypeBase = /*#__PURE__*/function (_React$Component) {
762
762
  };
763
763
  }());
764
764
 
765
+ _defineProperty(_assertThisInitialized(_this), "getSubscriberMetadata", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12() {
766
+ var metadata;
767
+ return _regeneratorRuntime.wrap(function _callee12$(_context12) {
768
+ while (1) {
769
+ switch (_context12.prev = _context12.next) {
770
+ case 0:
771
+ if (global.AccessType) {
772
+ _context12.next = 2;
773
+ break;
774
+ }
775
+
776
+ return _context12.abrupt("return", {});
777
+
778
+ case 2:
779
+ _context12.next = 4;
780
+ return awaitHelper(global.AccessType.getSubscriberMetadata());
781
+
782
+ case 4:
783
+ metadata = _context12.sent;
784
+ return _context12.abrupt("return", metadata);
785
+
786
+ case 6:
787
+ case "end":
788
+ return _context12.stop();
789
+ }
790
+ }
791
+ }, _callee12);
792
+ })));
793
+
794
+ _defineProperty(_assertThisInitialized(_this), "setSubscriberMetadata", /*#__PURE__*/function () {
795
+ var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(subscriberMetadata) {
796
+ var response;
797
+ return _regeneratorRuntime.wrap(function _callee13$(_context13) {
798
+ while (1) {
799
+ switch (_context13.prev = _context13.next) {
800
+ case 0:
801
+ if (!(!global.AccessType || !subscriberMetadata)) {
802
+ _context13.next = 2;
803
+ break;
804
+ }
805
+
806
+ return _context13.abrupt("return", {});
807
+
808
+ case 2:
809
+ _context13.next = 4;
810
+ return awaitHelper(global.AccessType.setSubscriberMetadata(subscriberMetadata));
811
+
812
+ case 4:
813
+ response = _context13.sent;
814
+ return _context13.abrupt("return", response);
815
+
816
+ case 6:
817
+ case "end":
818
+ return _context13.stop();
819
+ }
820
+ }
821
+ }, _callee13);
822
+ }));
823
+
824
+ return function (_x9) {
825
+ return _ref15.apply(this, arguments);
826
+ };
827
+ }());
828
+
765
829
  _this.prodHost = props.prodHost || "https://www.accesstype.com";
766
830
  _this.stagingHost = props.stagingHost || "https://staging.accesstype.com";
767
831
  return _this;
@@ -774,29 +838,29 @@ var AccessTypeBase = /*#__PURE__*/function (_React$Component) {
774
838
  }
775
839
  }, {
776
840
  key: "makePaymentObject",
777
- value: function makePaymentObject(_ref14) {
778
- var _ref14$selectedPlan = _ref14.selectedPlan,
779
- selectedPlan = _ref14$selectedPlan === void 0 ? {} : _ref14$selectedPlan,
780
- _ref14$couponCode = _ref14.couponCode,
781
- couponCode = _ref14$couponCode === void 0 ? "" : _ref14$couponCode,
782
- _ref14$recipientSubsc = _ref14.recipientSubscriber,
783
- recipientSubscriber = _ref14$recipientSubsc === void 0 ? {} : _ref14$recipientSubsc,
784
- _ref14$planType = _ref14.planType,
785
- planType = _ref14$planType === void 0 ? "" : _ref14$planType,
786
- _ref14$storyId = _ref14.storyId,
787
- storyId = _ref14$storyId === void 0 ? "" : _ref14$storyId,
788
- _ref14$storyHeadline = _ref14.storyHeadline,
789
- storyHeadline = _ref14$storyHeadline === void 0 ? "" : _ref14$storyHeadline,
790
- _ref14$storySlug = _ref14.storySlug,
791
- storySlug = _ref14$storySlug === void 0 ? "" : _ref14$storySlug,
792
- _ref14$paymentType = _ref14.paymentType,
793
- paymentType = _ref14$paymentType === void 0 ? "" : _ref14$paymentType,
794
- _ref14$successUrl = _ref14.successUrl,
795
- successUrl = _ref14$successUrl === void 0 ? "" : _ref14$successUrl,
796
- _ref14$returnUrl = _ref14.returnUrl,
797
- returnUrl = _ref14$returnUrl === void 0 ? "" : _ref14$returnUrl,
798
- _ref14$cancelUrl = _ref14.cancelUrl,
799
- cancelUrl = _ref14$cancelUrl === void 0 ? "" : _ref14$cancelUrl;
841
+ value: function makePaymentObject(_ref16) {
842
+ var _ref16$selectedPlan = _ref16.selectedPlan,
843
+ selectedPlan = _ref16$selectedPlan === void 0 ? {} : _ref16$selectedPlan,
844
+ _ref16$couponCode = _ref16.couponCode,
845
+ couponCode = _ref16$couponCode === void 0 ? "" : _ref16$couponCode,
846
+ _ref16$recipientSubsc = _ref16.recipientSubscriber,
847
+ recipientSubscriber = _ref16$recipientSubsc === void 0 ? {} : _ref16$recipientSubsc,
848
+ _ref16$planType = _ref16.planType,
849
+ planType = _ref16$planType === void 0 ? "" : _ref16$planType,
850
+ _ref16$storyId = _ref16.storyId,
851
+ storyId = _ref16$storyId === void 0 ? "" : _ref16$storyId,
852
+ _ref16$storyHeadline = _ref16.storyHeadline,
853
+ storyHeadline = _ref16$storyHeadline === void 0 ? "" : _ref16$storyHeadline,
854
+ _ref16$storySlug = _ref16.storySlug,
855
+ storySlug = _ref16$storySlug === void 0 ? "" : _ref16$storySlug,
856
+ _ref16$paymentType = _ref16.paymentType,
857
+ paymentType = _ref16$paymentType === void 0 ? "" : _ref16$paymentType,
858
+ _ref16$successUrl = _ref16.successUrl,
859
+ successUrl = _ref16$successUrl === void 0 ? "" : _ref16$successUrl,
860
+ _ref16$returnUrl = _ref16.returnUrl,
861
+ returnUrl = _ref16$returnUrl === void 0 ? "" : _ref16$returnUrl,
862
+ _ref16$cancelUrl = _ref16.cancelUrl,
863
+ cancelUrl = _ref16$cancelUrl === void 0 ? "" : _ref16$cancelUrl;
800
864
  var id = selectedPlan.id,
801
865
  title = selectedPlan.title,
802
866
  description = selectedPlan.description,
@@ -887,7 +951,9 @@ var AccessTypeBase = /*#__PURE__*/function (_React$Component) {
887
951
  accessIsLoading: this.props.accessIsLoading,
888
952
  getAssetPlans: this.props.getAssetPlans,
889
953
  validateCoupon: this.validateCoupon,
890
- cancelSubscription: this.cancelSubscription
954
+ cancelSubscription: this.cancelSubscription,
955
+ getSubscriberMetadata: this.getSubscriberMetadata,
956
+ setSubscriberMetadata: this.setSubscriberMetadata
891
957
  });
892
958
  }
893
959
  }]);
@@ -962,6 +1028,14 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch) {
962
1028
  * initOmisePayment| selectedPlan(object), planType(string) | Initialize the Omise payment
963
1029
  * initAdyenPayment| selectedPlan(object), planType(string), AdyenModal(React Component), locale(string) | Initialize Adyen Payment
964
1030
  * getAssetPlans| storyId(string) | Get Asset Subscription Plans
1031
+ * getSubscriberMetadata| Get the Subscriber Metadata
1032
+ * setSubscriberMetadata| subscriberMetadata(object), subscriberMetadata={"address": {
1033
+ "line1": "221B Bakers Street",
1034
+ "line2": "Near Watson Library",
1035
+ "city": "London",
1036
+ "state": "",
1037
+ },
1038
+ "phone_number": "007"}} | Update the Subscriber Metadata
965
1039
  * validateCoupon| selectedPlan(object), couponCode (string) | Validate coupon with plan
966
1040
  * cancelSubscription| subscriptionId(number) | Cancel a subscription
967
1041
  * getSubscriptionForUser | -NA- | Gets the subscriptions of the current logged in user
@@ -1009,7 +1083,7 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch) {
1009
1083
  * stagingHost="https://staging.accesstype.com"
1010
1084
  * accessTypeBkIntegrationId={accessTypeBkIntegrationId}
1011
1085
  * >
1012
- * {({ initAccessType, checkAccess, accessUpdated, accessIsLoading, validateCoupon, initRazorPayPayment, initStripePayment, initPaypalPayment, getSubscriptionForUser }) => (
1086
+ * {({ initAccessType, checkAccess, accessUpdated, accessIsLoading, validateCoupon, initRazorPayPayment, initStripePayment, initPaypalPayment, getSubscriptionForUser, getSubscriberMetadata, setSubscriberMetadata }) => (
1013
1087
  * <div>
1014
1088
  * <PaymentCheckoutLayout
1015
1089
  * accessIsLoading={accessIsLoading}
@@ -1020,6 +1094,9 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch) {
1020
1094
  * initStripePayment={initStripePayment}
1021
1095
  * initPaypalPayment={initPaypalPayment}
1022
1096
  * getSubscriptionForUser={getSubscriptionForUser}
1097
+ * getgetSubscriberMetadata={getgetSubscriberMetadata}
1098
+ * setSubscriberMetadata={setSubscriberMetadata}
1099
+ *
1023
1100
  * {...this.props}
1024
1101
  * />
1025
1102
  * </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quintype/components",
3
- "version": "2.32.0",
3
+ "version": "3.0.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",
@@ -22,64 +22,64 @@
22
22
  },
23
23
  "homepage": "https://github.com/quintype/quintype-node-components#readme",
24
24
  "dependencies": {
25
- "@babel/runtime": "^7.4.4",
25
+ "@babel/runtime": "^7.16.3",
26
26
  "atob": "^2.1.2",
27
- "classnames": "^2.2.6",
27
+ "classnames": "^2.3.1",
28
28
  "empty-web-gif": "^1.0.1",
29
- "get-video-id": "^3.4.1",
29
+ "get-video-id": "^3.4.3",
30
30
  "get-youtube-id": "^1.0.1",
31
- "papaparse": "^5.2.0",
31
+ "papaparse": "^5.3.1",
32
32
  "prop-types": "^15.7.2",
33
- "quintype-js": "^1.2.0",
34
- "react": "^16.8.6",
33
+ "quintype-js": "^1.2.1",
34
+ "react": "^16.14.0",
35
35
  "react-dailymotion": "^0.4.1",
36
36
  "react-dfp": "quintype/react-dfp",
37
- "react-redux": "^7.0.3",
38
- "react-youtube": "^7.9.0",
39
- "redux": "^4.0.1",
40
- "wretch": "^1.5.2"
37
+ "react-redux": "^7.2.6",
38
+ "react-youtube": "^7.13.1",
39
+ "redux": "^4.1.2",
40
+ "wretch": "^1.7.6"
41
41
  },
42
42
  "devDependencies": {
43
- "@babel/cli": "^7.4.4",
44
- "@babel/core": "^7.4.4",
45
- "@babel/eslint-parser": "^7.14.5",
46
- "@babel/plugin-external-helpers": "^7.2.0",
47
- "@babel/plugin-proposal-class-properties": "^7.4.4",
48
- "@babel/plugin-syntax-dynamic-import": "^7.2.0",
49
- "@babel/plugin-transform-runtime": "^7.4.4",
50
- "@babel/preset-env": "^7.4.4",
51
- "@babel/preset-react": "^7.0.0",
43
+ "@babel/cli": "^7.16.0",
44
+ "@babel/core": "^7.16.0",
45
+ "@babel/eslint-parser": "^7.16.3",
46
+ "@babel/plugin-external-helpers": "^7.16.0",
47
+ "@babel/plugin-proposal-class-properties": "^7.16.0",
48
+ "@babel/plugin-syntax-dynamic-import": "^7.8.3",
49
+ "@babel/plugin-transform-runtime": "^7.16.0",
50
+ "@babel/preset-env": "^7.16.0",
51
+ "@babel/preset-react": "^7.16.0",
52
52
  "babel-eslint": "^10.0.3",
53
- "babel-jest": "^24.8.0",
53
+ "babel-jest": "^27.3.1",
54
54
  "babel-plugin-annotate-pure-calls": "^0.4.0",
55
55
  "babel-plugin-quintype-assets": "^1.1.1",
56
56
  "babel-plugin-transform-react-remove-prop-types": "^0.4.24",
57
- "better-docs": "^1.2.2",
58
- "eslint": "^6.3.0",
59
- "eslint-config-prettier": "^4.2.0",
60
- "eslint-config-standard": "^12.0.0",
61
- "eslint-plugin-import": "^2.23.4",
62
- "eslint-plugin-jest": "^23.20.0",
57
+ "better-docs": "^2.3.2",
58
+ "eslint": "^8.2.0",
59
+ "eslint-config-prettier": "^8.3.0",
60
+ "eslint-config-standard": "^16.0.3",
61
+ "eslint-plugin-import": "^2.25.3",
62
+ "eslint-plugin-jest": "^25.2.4",
63
63
  "eslint-plugin-node": "^11.1.0",
64
- "eslint-plugin-prettier": "^3.0.1",
65
- "eslint-plugin-promise": "^5.1.0",
66
- "eslint-plugin-react": "^7.16.0",
67
- "eslint-plugin-standard": "^4.0.1",
68
- "gh-pages": "^2.1.1",
69
- "husky": "^3.0.5",
70
- "jest": "^24.8.0",
64
+ "eslint-plugin-prettier": "^4.0.0",
65
+ "eslint-plugin-promise": "^5.1.1",
66
+ "eslint-plugin-react": "^7.27.0",
67
+ "eslint-plugin-standard": "^4.1.0",
68
+ "gh-pages": "^3.2.3",
69
+ "husky": "^7.0.4",
70
+ "jest": "^27.3.1",
71
71
  "jest-dom": "^3.2.2",
72
- "jsdoc": "^3.6.3",
73
- "lint-staged": "^11.0.0",
74
- "onchange": "^4.1.0",
72
+ "jsdoc": "^3.6.7",
73
+ "lint-staged": "^11.2.6",
74
+ "onchange": "^7.1.0",
75
75
  "parcel-bundler": "^1.12.4",
76
- "prettier": "1.17.0",
77
- "react-dom": "^16.8.6",
76
+ "prettier": "2.4.1",
77
+ "react-dom": "^16.14.0",
78
78
  "react-testing-library": "^7.0.0",
79
- "rimraf": "^2.6.3",
80
- "rollup": "^1.10.1",
79
+ "rimraf": "^3.0.2",
80
+ "rollup": "^2.59.0",
81
81
  "rollup-plugin-babel": "^4.3.2",
82
- "standard-version": "^8.0.1"
82
+ "standard-version": "^9.3.2"
83
83
  },
84
84
  "husky": {
85
85
  "hooks": {
@@ -93,7 +93,7 @@
93
93
  ]
94
94
  },
95
95
  "peerDependencies": {
96
- "lodash": "^4.17.11"
96
+ "lodash": "^4.17.21"
97
97
  },
98
98
  "scripts": {
99
99
  "build:cjs": "npx rollup -c",
@@ -102,7 +102,6 @@
102
102
  "clean:dist": "rimraf dist",
103
103
  "docs": "rimraf docs && jsdoc -c jsdoc.json",
104
104
  "prepack": "npm run build",
105
- "prepublishOnly": "./bin-dev-scripts/standard-version-release.sh",
106
105
  "sync-files-to": "npx onchange --verbose --wait --await-write-finish 'src/**/*' -- ./bin-dev-scripts/sync-to.sh",
107
106
  "test": "jest --config jest.config.js",
108
107
  "test:cover": "jest --coverage --watchAll; open coverage/index.html"