@trycourier/courier 5.5.0 → 5.7.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
@@ -748,6 +748,7 @@ const { audienceId } = await courier.audiences.put({
748
748
  // To retrieve list of members in a given audience, you can use the following:
749
749
  const { items: audienceMembers } = await courier.audiences.listMembers(
750
750
  audienceId
751
+ cursor: "<CURSOR>", // optional
751
752
  );
752
753
 
753
754
  // To send a notification to all users that match the given filter criteria, you can use the following:
@@ -3,7 +3,11 @@ import * as AudienceTypes from "./types";
3
3
  export declare const audiences: (options: ICourierClientConfiguration) => {
4
4
  delete: (audienceId: string) => Promise<void>;
5
5
  get: (audienceId: string) => Promise<AudienceTypes.IAudience>;
6
- listAudiences: () => Promise<AudienceTypes.IAudienceListResponse>;
7
- listMembers: (audienceId: string) => Promise<AudienceTypes.IAudienceMemberListResponse>;
6
+ listAudiences: (params?: {
7
+ cursor: string;
8
+ } | undefined) => Promise<AudienceTypes.IAudienceListResponse>;
9
+ listMembers: (audienceId: string, params?: {
10
+ cursor: string;
11
+ } | undefined) => Promise<AudienceTypes.IAudienceMemberListResponse>;
8
12
  put: (audience: Omit<AudienceTypes.IAudience, "created_at" | "updated_at">) => Promise<AudienceTypes.IAudience>;
9
13
  };
@@ -61,11 +61,11 @@ var getAudience = function (options) {
61
61
  }); };
62
62
  };
63
63
  var listAudiences = function (options) {
64
- return function () { return __awaiter(void 0, void 0, void 0, function () {
64
+ return function (params) { return __awaiter(void 0, void 0, void 0, function () {
65
65
  var response;
66
66
  return __generator(this, function (_a) {
67
67
  switch (_a.label) {
68
- case 0: return [4 /*yield*/, options.httpClient.get("/audiences")];
68
+ case 0: return [4 /*yield*/, options.httpClient.get("/audiences", params)];
69
69
  case 1:
70
70
  response = _a.sent();
71
71
  return [2 /*return*/, response.data];
@@ -74,11 +74,11 @@ var listAudiences = function (options) {
74
74
  }); };
75
75
  };
76
76
  var listMembers = function (options) {
77
- return function (audienceId) { return __awaiter(void 0, void 0, void 0, function () {
77
+ return function (audienceId, params) { return __awaiter(void 0, void 0, void 0, function () {
78
78
  var response;
79
79
  return __generator(this, function (_a) {
80
80
  switch (_a.label) {
81
- case 0: return [4 /*yield*/, options.httpClient.get("/audiences/" + audienceId + "/members")];
81
+ case 0: return [4 /*yield*/, options.httpClient.get("/audiences/" + audienceId + "/members", params)];
82
82
  case 1:
83
83
  response = _a.sent();
84
84
  return [2 /*return*/, response.data];
@@ -54,8 +54,12 @@ export interface IAudiencePutResponse {
54
54
  export interface ICourierClientAudiences {
55
55
  delete: (id: string) => Promise<void>;
56
56
  get: (id: string) => Promise<IAudience>;
57
- listAudiences: () => Promise<IAudienceListResponse>;
58
- listMembers: (id: string) => Promise<IAudienceMemberListResponse>;
57
+ listAudiences: (params?: {
58
+ cursor: string;
59
+ }) => Promise<IAudienceListResponse>;
60
+ listMembers: (id: string, params?: {
61
+ cursor: string;
62
+ }) => Promise<IAudienceMemberListResponse>;
59
63
  put: (audience: Omit<IAudience, "created_at" | "updated_at">) => Promise<IAudience>;
60
64
  }
61
65
  export {};
package/lib/client.js CHANGED
@@ -117,7 +117,8 @@ var getMessages = function (options) {
117
117
  notification: params === null || params === void 0 ? void 0 : params.notificationId,
118
118
  recipient: params === null || params === void 0 ? void 0 : params.recipientId,
119
119
  status: params === null || params === void 0 ? void 0 : params.status,
120
- tags: params === null || params === void 0 ? void 0 : params.tags
120
+ tags: params === null || params === void 0 ? void 0 : params.tags,
121
+ traceId: params === null || params === void 0 ? void 0 : params.traceId
121
122
  }
122
123
  })];
123
124
  case 1:
package/lib/types.d.ts CHANGED
@@ -112,6 +112,7 @@ export interface ICourierMessagesGetParameters {
112
112
  recipientId?: string;
113
113
  status?: string | string[];
114
114
  tags?: string | string[];
115
+ traceId?: string;
115
116
  }
116
117
  export interface ICourierMessagesGetResponse {
117
118
  paging: ICourierPaging;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trycourier/courier",
3
- "version": "5.5.0",
3
+ "version": "5.7.0",
4
4
  "description": "A node.js module for communicating with the Courier REST API.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",