@trycourier/react-hooks 1.51.2-internal.415b75f.0 → 1.52.2-internal.5e81a39.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/README.md
CHANGED
|
@@ -35,7 +35,8 @@ import { useElementalInbox } from "@trycourier/react-hooks";
|
|
|
35
35
|
const MyApp = () => {
|
|
36
36
|
/**
|
|
37
37
|
* Auth token for courier provider, can be a token from Courier's auth/issue-token endpoint
|
|
38
|
-
* or a JWT signed with a valid courier api key. Must include scope: "user_id:<user_id_here> inbox:read:messages"
|
|
38
|
+
* or a JWT signed with a valid courier api key. Must include scope: "user_id:<user_id_here> inbox:read:messages",
|
|
39
|
+
* you must also include the "inbox:write:events" scope if making a write request or mutation as well.
|
|
39
40
|
*
|
|
40
41
|
* For more information on the auth/issue-token endpoint, visit:
|
|
41
42
|
* https://courier.com/docs/reference/auth/intro/
|
|
@@ -35,6 +35,8 @@ var _rehydrateMessages2 = require("./actions/rehydrate-messages");
|
|
|
35
35
|
|
|
36
36
|
var _newMessage2 = require("./actions/new-message");
|
|
37
37
|
|
|
38
|
+
var _markMessageOpened3 = require("./actions/mark-message-opened");
|
|
39
|
+
|
|
38
40
|
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; }
|
|
39
41
|
|
|
40
42
|
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; }
|
|
@@ -315,15 +317,16 @@ var useInboxActions = function useInboxActions() {
|
|
|
315
317
|
return markMessageUnread;
|
|
316
318
|
}(),
|
|
317
319
|
markMessageOpened: function () {
|
|
318
|
-
var
|
|
320
|
+
var _markMessageOpened2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(messageId, trackingId) {
|
|
319
321
|
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
320
322
|
while (1) {
|
|
321
323
|
switch (_context5.prev = _context5.next) {
|
|
322
324
|
case 0:
|
|
323
|
-
|
|
325
|
+
dispatch((0, _markMessageOpened3.markMessageOpened)(messageId));
|
|
326
|
+
_context5.next = 3;
|
|
324
327
|
return events.trackEvent(trackingId);
|
|
325
328
|
|
|
326
|
-
case
|
|
329
|
+
case 3:
|
|
327
330
|
case "end":
|
|
328
331
|
return _context5.stop();
|
|
329
332
|
}
|
|
@@ -331,8 +334,8 @@ var useInboxActions = function useInboxActions() {
|
|
|
331
334
|
}, _callee5);
|
|
332
335
|
}));
|
|
333
336
|
|
|
334
|
-
function markMessageOpened(_x6) {
|
|
335
|
-
return
|
|
337
|
+
function markMessageOpened(_x6, _x7) {
|
|
338
|
+
return _markMessageOpened2.apply(this, arguments);
|
|
336
339
|
}
|
|
337
340
|
|
|
338
341
|
return markMessageOpened;
|
|
@@ -355,7 +358,7 @@ var useInboxActions = function useInboxActions() {
|
|
|
355
358
|
}, _callee6);
|
|
356
359
|
}));
|
|
357
360
|
|
|
358
|
-
function markMessageArchived(
|
|
361
|
+
function markMessageArchived(_x8, _x9) {
|
|
359
362
|
return _markMessageArchived2.apply(this, arguments);
|
|
360
363
|
}
|
|
361
364
|
|
|
@@ -364,6 +367,10 @@ var useInboxActions = function useInboxActions() {
|
|
|
364
367
|
newMessage: function newMessage(message) {
|
|
365
368
|
var _message$data, _message$data2;
|
|
366
369
|
|
|
370
|
+
if (!message.messageId) {
|
|
371
|
+
return;
|
|
372
|
+
}
|
|
373
|
+
|
|
367
374
|
dispatch((0, _newMessage2.newMessage)({
|
|
368
375
|
icon: message.icon,
|
|
369
376
|
messageId: message.messageId,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trycourier/react-hooks",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.52.2-internal.5e81a39.0+5e81a39",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "typings/index.d.ts",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"concat-md": "^0.3.5"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@trycourier/client-graphql": "^1.
|
|
23
|
+
"@trycourier/client-graphql": "^1.52.2-internal.5e81a39.0+5e81a39",
|
|
24
24
|
"deep-extend": "^0.6.0",
|
|
25
25
|
"rimraf": "^3.0.2"
|
|
26
26
|
},
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
".": "./dist/index.js",
|
|
37
37
|
"./use-inbox": "./dist/inbox/use-inbox.js"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "5e81a3918cf9a6c74f77db91b606e36041671736"
|
|
40
40
|
}
|
|
@@ -15,7 +15,7 @@ interface IInboxActions {
|
|
|
15
15
|
markMessageArchived: (messageId: string, trackingId: string) => Promise<void>;
|
|
16
16
|
markMessageRead: (messageId: string, trackingId?: string) => Promise<void>;
|
|
17
17
|
markMessageUnread: (messageId: string, trackingId: string) => Promise<void>;
|
|
18
|
-
markMessageOpened: (trackingId: string) => Promise<void>;
|
|
18
|
+
markMessageOpened: (messageId: string, trackingId: string) => Promise<void>;
|
|
19
19
|
rehydrateMessages: (payload: RehydrateMessages["payload"]) => void;
|
|
20
20
|
setCurrentTab: (newTab: ITab) => void;
|
|
21
21
|
setView: (view: "messages" | "preferences") => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-inbox-actions.d.ts","sourceRoot":"","sources":["../../src/inbox/use-inbox-actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,eAAe,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AASvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAQhE,OAAO,EAEL,iBAAiB,EAClB,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"use-inbox-actions.d.ts","sourceRoot":"","sources":["../../src/inbox/use-inbox-actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,eAAe,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AASvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAQhE,OAAO,EAEL,iBAAiB,EAClB,MAAM,8BAA8B,CAAC;AAItC,MAAM,WAAW,oBAAoB;IACnC,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,aAAa;IACrB,iBAAiB,EAAE,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;IAC3C,aAAa,EAAE,CAAC,MAAM,CAAC,EAAE,oBAAoB,KAAK,IAAI,CAAC;IACvD,qBAAqB,EAAE,CAAC,MAAM,CAAC,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC7D,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,mBAAmB,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9E,eAAe,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,I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