@knocklabs/node 0.6.8 → 0.6.11

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
@@ -42,7 +42,7 @@ const { Knock } = require("@knocklabs/node");
42
42
  const knockClient = new Knock("sk_12345");
43
43
 
44
44
  // The key of the workflow (from Knock dashboard)
45
- await knockClient.notify("dinosaurs-loose", {
45
+ await knockClient.workflows.trigger("dinosaurs-loose", {
46
46
  // user id of who performed the action
47
47
  actor: "dnedry",
48
48
  // list of user ids for who should receive the notification
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knocklabs/node",
3
- "version": "0.6.8",
3
+ "version": "0.6.11",
4
4
  "description": "Library for interacting with the Knock API",
5
5
  "homepage": "https://github.com/knocklabs/knock-node",
6
6
  "author": "@knocklabs",
@@ -74,6 +74,9 @@ class FetchClient {
74
74
  }
75
75
  function appendParams(key, value, parentKey) {
76
76
  const fullKey = parentKey ? `${parentKey}[${key}]` : key;
77
+ // Skip undefined values
78
+ if (value === undefined)
79
+ return;
77
80
  if (typeof value === "object" &&
78
81
  value !== null &&
79
82
  !(value instanceof Date) &&
@@ -10,7 +10,7 @@ export declare class Messages {
10
10
  getContent(messageId: string): Promise<MessageContent>;
11
11
  getEvents(messageId: string, paginationOptions?: PaginationOptions): Promise<PaginatedItemsResponse<MessageEvent>>;
12
12
  getActivities(messageId: string, filteringOptions?: ListMessageActivitiesOptions): Promise<PaginatedItemsResponse<Activity>>;
13
- setStatus(messageId: string, status: MessageEngagementStatus): Promise<Message>;
14
- deleteStatus(messageId: string, status: MessageEngagementStatus): Promise<Message>;
15
- batchSetStatus(messageIds: string[], status: MessageEngagementStatus | "unseen" | "unread" | "unarchived"): Promise<Message[]>;
13
+ setStatus(messageId: string, status: Exclude<MessageEngagementStatus, "link_clicked">): Promise<Message>;
14
+ deleteStatus(messageId: string, status: Exclude<MessageEngagementStatus, "link_clicked">): Promise<Message>;
15
+ batchSetStatus(messageIds: string[], status: Exclude<MessageEngagementStatus, "link_clicked"> | "unseen" | "unread" | "unarchived"): Promise<Message[]>;
16
16
  }
@@ -44,5 +44,5 @@ type WorkflowSource = {
44
44
  key: string;
45
45
  };
46
46
  type MessageStatus = "queued" | "sent" | "delivered" | "undelivered" | "not_sent";
47
- export type MessageEngagementStatus = "seen" | "read" | "archived";
47
+ export type MessageEngagementStatus = "seen" | "read" | "archived" | "interacted" | "link_clicked";
48
48
  export {};
@@ -27,8 +27,7 @@ export interface BulkAddSubscriptionsOption<T = CommonMetadata> {
27
27
  recipients: (IdentifyUserProperties | SetObjectProperties | string)[];
28
28
  }
29
29
  export interface ListObjectOptions extends PaginationOptions {
30
- object_id?: string;
31
- name?: string;
30
+ include?: Array<"preferences">;
32
31
  }
33
32
  export interface ListObjectSubscriptionsOptions extends PaginationOptions {
34
33
  recipients?: Recipient[];
@@ -27,9 +27,7 @@ export interface UserFeedOptions extends PaginationOptions {
27
27
  trigger_data?: Record<string, any>;
28
28
  }
29
29
  export interface ListUserOptions extends PaginationOptions {
30
- name?: string;
31
- email?: string;
32
- user_id?: string;
30
+ include?: Array<"preferences">;
33
31
  }
34
32
  export interface ListSubscriptionsOptions extends PaginationOptions {
35
33
  objects?: ObjectRef[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knocklabs/node",
3
- "version": "0.6.8",
3
+ "version": "0.6.11",
4
4
  "description": "Library for interacting with the Knock API",
5
5
  "homepage": "https://github.com/knocklabs/knock-node",
6
6
  "author": "@knocklabs",
@@ -45,4 +45,4 @@
45
45
  "engines": {
46
46
  "node": ">=17.5.0"
47
47
  }
48
- }
48
+ }