@trycourier/react-provider 1.0.3-internal.f30ae97.0 → 1.2.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.
@@ -15,8 +15,6 @@ var _urql = require("urql");
15
15
 
16
16
  var GraphQLClient = /*#__PURE__*/function () {
17
17
  function GraphQLClient(_ref) {
18
- var _ref2;
19
-
20
18
  var clientKey = _ref.clientKey,
21
19
  userId = _ref.userId,
22
20
  userSignature = _ref.userSignature,
@@ -28,7 +26,7 @@ var GraphQLClient = /*#__PURE__*/function () {
28
26
  }
29
27
 
30
28
  this.client = (0, _urql.createClient)({
31
- url: "".concat((_ref2 = apiUrl !== null && apiUrl !== void 0 ? apiUrl : process.env.API_URL) !== null && _ref2 !== void 0 ? _ref2 : "https://api.courier.com", "/client/q"),
29
+ url: "".concat(apiUrl || process.env.API_URL || "https://api.courier.com", "/client/q"),
32
30
  requestPolicy: "network-only",
33
31
  fetchOptions: function fetchOptions() {
34
32
  var headers = {
@@ -11,13 +11,13 @@ var useCourierActions = function useCourierActions(dispatch) {
11
11
  return {
12
12
  initToast: function initToast(payload) {
13
13
  dispatch({
14
- type: "INIT_TOAST",
14
+ type: "toast/INIT",
15
15
  payload: payload
16
16
  });
17
17
  },
18
18
  initInbox: function initInbox(payload) {
19
19
  dispatch({
20
- type: "INIT_INBOX",
20
+ type: "inbox/INIT",
21
21
  payload: payload
22
22
  });
23
23
  },
@@ -39,8 +39,6 @@ var CourierTransport = /*#__PURE__*/function (_Transport) {
39
39
  var _super = _createSuper(CourierTransport);
40
40
 
41
41
  function CourierTransport(options) {
42
- var _ref, _options$wsUrl;
43
-
44
42
  var _this;
45
43
 
46
44
  (0, _classCallCheck2["default"])(this, CourierTransport);
@@ -54,7 +52,7 @@ var CourierTransport = /*#__PURE__*/function (_Transport) {
54
52
  _this.userSignature = options.userSignature;
55
53
  _this.ws = new _ws.WS({
56
54
  clientKey: options.clientKey,
57
- url: (_ref = (_options$wsUrl = options.wsUrl) !== null && _options$wsUrl !== void 0 ? _options$wsUrl : _constants.COURIER_WS_URL) !== null && _ref !== void 0 ? _ref : "wss://1x60p1o3h8.execute-api.us-east-1.amazonaws.com/production"
55
+ url: options.wsUrl || _constants.COURIER_WS_URL || "wss://1x60p1o3h8.execute-api.us-east-1.amazonaws.com/production"
58
56
  });
59
57
 
60
58
  _this.ws.connect();
@@ -76,8 +74,8 @@ var CourierTransport = /*#__PURE__*/function (_Transport) {
76
74
  value: function subscribe(channel, event) {
77
75
  var _this2 = this;
78
76
 
79
- this.ws.subscribe(channel, event !== null && event !== void 0 ? event : "*", function (_ref2) {
80
- var data = _ref2.data;
77
+ this.ws.subscribe(channel, event !== null && event !== void 0 ? event : "*", function (_ref) {
78
+ var data = _ref.data;
81
79
 
82
80
  if (_this2.interceptor) {
83
81
  data = _this2.interceptor(data);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trycourier/react-provider",
3
- "version": "1.0.3-internal.f30ae97.0+f30ae97",
3
+ "version": "1.2.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "typings/index.d.ts",
@@ -30,5 +30,5 @@
30
30
  "dist/",
31
31
  "typings/"
32
32
  ],
33
- "gitHead": "f30ae9795511eae0d77d00978be17bce94f6c0ef"
33
+ "gitHead": "da3d2e178c2698fa1575865cadc8de18013233f3"
34
34
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/transports/courier/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAExD,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,qBAAa,gBAAiB,SAAQ,SAAS;IAC7C,SAAS,CAAC,EAAE,EAAE,EAAE,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