@trycourier/react-provider 1.8.0 → 1.9.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/index.js CHANGED
@@ -94,7 +94,7 @@ var CourierProvider = function CourierProvider(_ref) {
94
94
  _transport = _ref.transport,
95
95
  userId = _ref.userId,
96
96
  userSignature = _ref.userSignature,
97
- wsUrl = _ref.wsUrl;
97
+ wsOptions = _ref.wsOptions;
98
98
 
99
99
  var middleware = [].concat((0, _toConsumableArray2["default"])(_middleware), (0, _toConsumableArray2["default"])(_middleware2["default"]));
100
100
  var useReducer = (0, _react.useCallback)(_createReducer["default"].apply(void 0, (0, _toConsumableArray2["default"])(middleware)), [_middleware]);
@@ -115,10 +115,10 @@ var CourierProvider = function CourierProvider(_ref) {
115
115
  return new _courier.CourierTransport({
116
116
  userSignature: userSignature,
117
117
  clientKey: clientKey,
118
- wsUrl: wsUrl
118
+ wsOptions: wsOptions
119
119
  });
120
120
  }
121
- }, [_transport, clientKey, wsUrl, userSignature]);
121
+ }, [_transport, clientKey, wsOptions, userSignature]);
122
122
 
123
123
  var _useReducer = useReducer(_reducer["default"], {
124
124
  apiUrl: apiUrl,
@@ -23,8 +23,6 @@ var _ws = require("../../ws");
23
23
 
24
24
  var _base = require("../base");
25
25
 
26
- var _constants = require("./constants");
27
-
28
26
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
29
27
 
30
28
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
@@ -52,8 +50,8 @@ var CourierTransport = /*#__PURE__*/function (_Transport) {
52
50
  _this.userSignature = options.userSignature;
53
51
  _this.ws = new _ws.WS({
54
52
  clientKey: options.clientKey,
55
- userSignature: options.userSignature,
56
- url: options.wsUrl || _constants.COURIER_WS_URL || "wss://1x60p1o3h8.execute-api.us-east-1.amazonaws.com/production"
53
+ options: options.wsOptions,
54
+ userSignature: options.userSignature
57
55
  });
58
56
 
59
57
  _this.ws.connect();
@@ -0,0 +1 @@
1
+ "use strict";
package/dist/ws.js CHANGED
@@ -25,44 +25,55 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
25
25
 
26
26
  var WS = /*#__PURE__*/function () {
27
27
  function WS(_ref) {
28
- var url = _ref.url,
29
- clientKey = _ref.clientKey,
28
+ var _ref2, _options$url;
29
+
30
+ var clientKey = _ref.clientKey,
31
+ options = _ref.options,
30
32
  userSignature = _ref.userSignature;
31
33
  (0, _classCallCheck2["default"])(this, WS);
32
34
  this.messageCallback = null;
33
35
  this.connection = undefined;
34
36
  this.connected = false;
35
- this.url = url;
37
+ this.url = (_ref2 = (_options$url = options === null || options === void 0 ? void 0 : options.url) !== null && _options$url !== void 0 ? _options$url : "") !== null && _ref2 !== void 0 ? _ref2 : "wss://1x60p1o3h8.execute-api.us-east-1.amazonaws.com/production";
36
38
  this.clientKey = clientKey;
37
39
  this.userSignature = userSignature;
38
40
  this.subscriptions = [];
41
+ this.connectionTimeout = options === null || options === void 0 ? void 0 : options.connectionTimeout;
42
+ this.onError = options === null || options === void 0 ? void 0 : options.onError;
39
43
  }
40
44
 
41
45
  (0, _createClass2["default"])(WS, [{
42
46
  key: "connect",
43
47
  value: function connect() {
44
- this.connection = new _reconnectingWebsocket["default"]("".concat(this.url, "/?clientKey=").concat(this.clientKey));
45
- this.connection.onopen = this.onOpen.bind(this);
46
- this.connection.onclose = this.onClose.bind(this);
47
- this.connection.onerror = this.onError.bind(this);
48
- this.connection.onmessage = this.onMessage.bind(this);
48
+ this.connection = new _reconnectingWebsocket["default"]("".concat(this.url, "/?clientKey=").concat(this.clientKey), [], {
49
+ connectionTimeout: this.connectionTimeout
50
+ });
51
+ this.connection.onopen = this._onOpen.bind(this);
52
+ this.connection.onclose = this._onClose.bind(this);
53
+ this.connection.onerror = this._onError.bind(this);
54
+ this.connection.onmessage = this._onMessage.bind(this);
49
55
  }
50
56
  }, {
51
- key: "onError",
52
- value: function onError() {
57
+ key: "_onError",
58
+ value: function _onError(event) {
53
59
  var _this$connection;
54
60
 
55
- console.error("Error Connecting to Courier Push");
61
+ if (this.onError) {
62
+ this.onError(event);
63
+ } else {
64
+ console.error("Error Connecting to Courier Push");
65
+ }
66
+
56
67
  (_this$connection = this.connection) === null || _this$connection === void 0 ? void 0 : _this$connection.close();
57
68
  }
58
69
  }, {
59
- key: "onClose",
60
- value: function onClose() {
70
+ key: "_onClose",
71
+ value: function _onClose() {
61
72
  this.connected = false;
62
73
  }
63
74
  }, {
64
- key: "onOpen",
65
- value: function onOpen() {
75
+ key: "_onOpen",
76
+ value: function _onOpen() {
66
77
  this.connected = true;
67
78
 
68
79
  var _iterator = _createForOfIteratorHelper(this.subscriptions),
@@ -89,9 +100,9 @@ var WS = /*#__PURE__*/function () {
89
100
  }
90
101
  }
91
102
  }, {
92
- key: "onMessage",
93
- value: function onMessage(_ref2) {
94
- var data = _ref2.data;
103
+ key: "_onMessage",
104
+ value: function _onMessage(_ref3) {
105
+ var data = _ref3.data;
95
106
  var message;
96
107
 
97
108
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trycourier/react-provider",
3
- "version": "1.8.0",
3
+ "version": "1.9.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "typings/index.d.ts",
@@ -31,5 +31,5 @@
31
31
  "dist/",
32
32
  "typings/"
33
33
  ],
34
- "gitHead": "bb3d1a125239caca17004a517437a1472105d0a1"
34
+ "gitHead": "0f0996db8e91b1750f184ba3d14cee4ce2e58352"
35
35
  }
@@ -1,10 +1,10 @@
1
1
  import React from "react";
2
- import { ICourierProviderProps, ICourierContext, Brand } from "./types";
2
+ import { ICourierProviderProps, ICourierContext, Brand, WSOptions } from "./types";
3
3
  import { ICourierMessage, ITextBlock, IActionBlock } from "./transports/types";
4
4
  export * from "./transports";
5
5
  export * from "./hooks";
6
6
  export declare const registerReducer: (scope: any, reducer: any) => void;
7
- export type { Brand, ITextBlock, IActionBlock, ICourierMessage, ICourierContext, };
7
+ export type { Brand, WSOptions, ITextBlock, IActionBlock, ICourierMessage, ICourierContext, };
8
8
  export declare const CourierContext: React.Context<ICourierContext | undefined>;
9
9
  export declare const CourierProvider: React.FunctionComponent<ICourierProviderProps>;
10
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAOA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAG/D,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGxE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAK/E,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AAExB,eAAO,MAAM,eAAe,oCAAmB,CAAC;AAEhD,YAAY,EACV,KAAK,EACL,UAAU,EACV,YAAY,EACZ,eAAe,EACf,eAAe,GAChB,CAAC;AAEF,eAAO,MAAM,cAAc,4CAE1B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,iBAAiB,CAAC,qBAAqB,CAiK1E,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAOA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAG/D,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,KAAK,EACL,SAAS,EACV,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAK/E,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AAExB,eAAO,MAAM,eAAe,oCAAmB,CAAC;AAEhD,YAAY,EACV,KAAK,EACL,SAAS,EACT,UAAU,EACV,YAAY,EACZ,eAAe,EACf,eAAe,GAChB,CAAC;AAEF,eAAO,MAAM,cAAc,4CAE1B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,iBAAiB,CAAC,qBAAqB,CAiK1E,CAAC"}
@@ -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,CAAC;IACjB,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC;IAC5B,SAAS,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IACjC,UAAkB,WAAW,CAAC,EAAE,WAAW,CAAC;gBAEhC,OAAO,EAAE,iBAAiB;IAoBtC,IAAI,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;IAUpC,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;IAchD,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;CAGnD"}
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;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,qBAAa,gBAAiB,SAAQ,SAAS;IAC7C,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC;IACjB,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC;IAC5B,SAAS,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IACjC,UAAkB,WAAW,CAAC,EAAE,WAAW,CAAC;gBAEhC,OAAO,EAAE,iBAAiB;IAkBtC,IAAI,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;IAUpC,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;IAchD,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;CAGnD"}
@@ -1,6 +1,11 @@
1
+ import { ErrorEvent } from "reconnecting-websocket";
1
2
  export interface ITransportOptions {
2
3
  clientKey: string;
3
4
  userSignature?: string;
4
- wsUrl?: string;
5
+ wsOptions?: {
6
+ url?: string;
7
+ connectionTimeout?: number;
8
+ onError?: (event: ErrorEvent) => void;
9
+ };
5
10
  }
6
11
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/transports/courier/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/transports/courier/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE;QACV,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;KACvC,CAAC;CACH"}
@@ -1,5 +1,12 @@
1
1
  import { Transport } from "./transports";
2
2
  import { Interceptor } from "./transports/types";
3
+ import { ErrorEvent } from "reconnecting-websocket";
4
+ export declare type ErrorEventHandler = (event: ErrorEvent) => void;
5
+ export declare type WSOptions = {
6
+ url?: string;
7
+ onError?: ErrorEventHandler;
8
+ connectionTimeout?: number;
9
+ };
3
10
  export interface Brand {
4
11
  inapp?: {
5
12
  disableCourierFooter?: boolean;
@@ -34,12 +41,12 @@ export interface ICourierProviderProps {
34
41
  brand?: Brand;
35
42
  brandId?: string;
36
43
  clientKey?: string;
44
+ middleware?: any;
45
+ onMessage?: Interceptor;
37
46
  transport?: Transport;
38
47
  userId?: string;
39
48
  userSignature?: string;
40
- wsUrl?: string;
41
- middleware?: any;
42
- onMessage?: Interceptor;
49
+ wsOptions?: WSOptions;
43
50
  }
44
51
  export interface ICourierContext extends ICourierProviderProps {
45
52
  dispatch?: (action: {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,WAAW,KAAK;IACpB,KAAK,CAAC,EAAE;QACN,oBAAoB,CAAC,EAAE,OAAO,CAAC;QAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,kBAAkB,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AAS,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;CACH;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AACD,MAAM,WAAW,eAAgB,SAAQ,qBAAqB;IAC5D,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,GAAG,CAAA;KAAE,KAAK,IAAI,CAAC;IAC5D,aAAa,CAAC,EAAE,GAAG,CAAC;CACrB"}
package/typings/ws.d.ts CHANGED
@@ -1,23 +1,30 @@
1
1
  import { ICourierEventCallback } from "./transports/types";
2
- import ReconnectingWebSocket from "reconnecting-websocket";
2
+ import ReconnectingWebSocket, { ErrorEvent } from "reconnecting-websocket";
3
+ import { ErrorEventHandler } from "./types";
3
4
  export declare class WS {
4
5
  connection?: ReconnectingWebSocket;
5
6
  private subscriptions;
6
- protected connected: any;
7
- protected messageCallback: any;
8
- private url;
9
7
  private clientKey;
8
+ private connectionTimeout?;
9
+ private onError?;
10
+ private url;
10
11
  private userSignature?;
11
- constructor({ url, clientKey, userSignature, }: {
12
- url: string;
12
+ protected connected: any;
13
+ protected messageCallback: any;
14
+ constructor({ clientKey, options, userSignature, }: {
13
15
  clientKey: string;
16
+ options?: {
17
+ connectionTimeout?: number;
18
+ onError?: ErrorEventHandler;
19
+ url?: string;
20
+ };
14
21
  userSignature?: string;
15
22
  });
16
23
  connect(): void;
17
- onError(): void;
18
- onClose(): void;
19
- onOpen(): void;
20
- onMessage({ data }: {
24
+ _onError(event: ErrorEvent): void;
25
+ _onClose(): void;
26
+ _onOpen(): void;
27
+ _onMessage({ data }: {
21
28
  data: string;
22
29
  }): void;
23
30
  subscribe(channel: string, event: string, callback: ICourierEventCallback): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"ws.d.ts","sourceRoot":"","sources":["../src/ws.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAmB,MAAM,oBAAoB,CAAC;AAC5E,OAAO,qBAAqB,MAAM,wBAAwB,CAAC;AAE3D,qBAAa,EAAE;IACb,UAAU,CAAC,EAAE,qBAAqB,CAAC;IACnC,OAAO,CAAC,aAAa,CAIlB;IACH,SAAS,CAAC,SAAS,MAAC;IACpB,SAAS,CAAC,eAAe,MAAC;IAC1B,OAAO,CAAC,GAAG,CAAS;IACpB,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,aAAa,CAAC,CAAS;gBAEnB,EACV,GAAG,EACH,SAAS,EACT,aAAa,GACd,EAAE;QACD,GAAG,EAAE,MAAM,CAAC;QACZ,SAAS,EAAE,MAAM,CAAC;QAClB,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB;IAUD,OAAO,IAAI,IAAI;IAWf,OAAO,IAAI,IAAI;IAKf,OAAO,IAAI,IAAI;IAIf,MAAM,IAAI,IAAI;IAiBd,SAAS,CAAC,EAAE,IAAI,EAAE,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAwBrC,SAAS,CACb,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,qBAAqB,GAC9B,OAAO,CAAC,IAAI,CAAC;IAqBhB,IAAI,CAAC,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,GAAG,IAAI;IAS3C,WAAW,CA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,OAAO,CAAC,IAAI,CAAC;IAqBhB,IAAI,CAAC,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,GAAG,IAAI;IAS3C,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAiBjD,KAAK,IAAI,IAAI;CAGd"}
@@ -1,8 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.COURIER_WS_URL = void 0;
7
- var COURIER_WS_URL = "";
8
- exports.COURIER_WS_URL = COURIER_WS_URL;
@@ -1,2 +0,0 @@
1
- export declare const COURIER_WS_URL: string | undefined;
2
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/transports/courier/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,oBAA6B,CAAC"}