@knocklabs/node 0.4.0 → 0.4.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knocklabs/node",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Library for interacting with the Knock API",
5
5
  "homepage": "https://github.com/knocklabs/knock-node",
6
6
  "author": "@knocklabs",
@@ -11,6 +11,7 @@ export declare class Users {
11
11
  get(userId: string): Promise<User>;
12
12
  delete(userId: string): Promise<null>;
13
13
  bulkDelete(userIds: string[]): Promise<BulkOperation>;
14
+ merge(toUserId: string, fromUserId: string): Promise<User>;
14
15
  getFeed(userId: string, channelId: string, feedOptions?: UserFeedOptions): Promise<any>;
15
16
  getAllPreferences(userId: string): Promise<any>;
16
17
  getPrefences(userId: string, options?: PreferenceOptions): Promise<PreferenceSet>;
@@ -59,6 +59,17 @@ class Users {
59
59
  return data;
60
60
  });
61
61
  }
62
+ merge(toUserId, fromUserId) {
63
+ return __awaiter(this, void 0, void 0, function* () {
64
+ if (!toUserId || !fromUserId) {
65
+ throw new Error(`Incomplete arguments. You must provide both a 'toUserId' and a 'fromUserId'.`);
66
+ }
67
+ const { data } = yield this.knock.post(`/v1/users/${toUserId}/merge`, {
68
+ from_user_id: fromUserId,
69
+ });
70
+ return data;
71
+ });
72
+ }
62
73
  //
63
74
  // Feeds
64
75
  //
@@ -1,12 +1,12 @@
1
1
  import { ObjectRef } from "../objects/interfaces";
2
- export interface TriggerWorkflowProperties {
2
+ export interface TriggerWorkflowProperties<T = {
3
+ [key: string]: any;
4
+ }> {
3
5
  actor?: string | ObjectRef;
4
6
  recipients?: string[] | ObjectRef[];
5
7
  cancellationKey?: string;
6
8
  tenant?: string;
7
- data?: {
8
- [key: string]: any;
9
- };
9
+ data?: T;
10
10
  }
11
11
  export interface CancelWorkflowProperties {
12
12
  recipients?: string[] | ObjectRef;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knocklabs/node",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Library for interacting with the Knock API",
5
5
  "homepage": "https://github.com/knocklabs/knock-node",
6
6
  "author": "@knocklabs",