@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.
- package/CHANGELOG.md +14 -0
- package/dist/cjs/index.js +687 -589
- package/dist/es/components/access-type.js +102 -25
- package/package.json +43 -44
|
@@ -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(
|
|
778
|
-
var
|
|
779
|
-
selectedPlan =
|
|
780
|
-
|
|
781
|
-
couponCode =
|
|
782
|
-
|
|
783
|
-
recipientSubscriber =
|
|
784
|
-
|
|
785
|
-
planType =
|
|
786
|
-
|
|
787
|
-
storyId =
|
|
788
|
-
|
|
789
|
-
storyHeadline =
|
|
790
|
-
|
|
791
|
-
storySlug =
|
|
792
|
-
|
|
793
|
-
paymentType =
|
|
794
|
-
|
|
795
|
-
successUrl =
|
|
796
|
-
|
|
797
|
-
returnUrl =
|
|
798
|
-
|
|
799
|
-
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": "
|
|
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.
|
|
25
|
+
"@babel/runtime": "^7.16.3",
|
|
26
26
|
"atob": "^2.1.2",
|
|
27
|
-
"classnames": "^2.
|
|
27
|
+
"classnames": "^2.3.1",
|
|
28
28
|
"empty-web-gif": "^1.0.1",
|
|
29
|
-
"get-video-id": "^3.4.
|
|
29
|
+
"get-video-id": "^3.4.3",
|
|
30
30
|
"get-youtube-id": "^1.0.1",
|
|
31
|
-
"papaparse": "^5.
|
|
31
|
+
"papaparse": "^5.3.1",
|
|
32
32
|
"prop-types": "^15.7.2",
|
|
33
|
-
"quintype-js": "^1.2.
|
|
34
|
-
"react": "^16.
|
|
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.
|
|
38
|
-
"react-youtube": "^7.
|
|
39
|
-
"redux": "^4.
|
|
40
|
-
"wretch": "^1.
|
|
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.
|
|
44
|
-
"@babel/core": "^7.
|
|
45
|
-
"@babel/eslint-parser": "^7.
|
|
46
|
-
"@babel/plugin-external-helpers": "^7.
|
|
47
|
-
"@babel/plugin-proposal-class-properties": "^7.
|
|
48
|
-
"@babel/plugin-syntax-dynamic-import": "^7.
|
|
49
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
50
|
-
"@babel/preset-env": "^7.
|
|
51
|
-
"@babel/preset-react": "^7.
|
|
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": "^
|
|
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": "^
|
|
58
|
-
"eslint": "^
|
|
59
|
-
"eslint-config-prettier": "^
|
|
60
|
-
"eslint-config-standard": "^
|
|
61
|
-
"eslint-plugin-import": "^2.
|
|
62
|
-
"eslint-plugin-jest": "^
|
|
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": "^
|
|
65
|
-
"eslint-plugin-promise": "^5.1.
|
|
66
|
-
"eslint-plugin-react": "^7.
|
|
67
|
-
"eslint-plugin-standard": "^4.0
|
|
68
|
-
"gh-pages": "^2.
|
|
69
|
-
"husky": "^
|
|
70
|
-
"jest": "^
|
|
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.
|
|
73
|
-
"lint-staged": "^11.
|
|
74
|
-
"onchange": "^
|
|
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": "
|
|
77
|
-
"react-dom": "^16.
|
|
76
|
+
"prettier": "2.4.1",
|
|
77
|
+
"react-dom": "^16.14.0",
|
|
78
78
|
"react-testing-library": "^7.0.0",
|
|
79
|
-
"rimraf": "^
|
|
80
|
-
"rollup": "^
|
|
79
|
+
"rimraf": "^3.0.2",
|
|
80
|
+
"rollup": "^2.59.0",
|
|
81
81
|
"rollup-plugin-babel": "^4.3.2",
|
|
82
|
-
"standard-version": "^
|
|
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.
|
|
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"
|