@vasrefil/api-toolkit 1.13.2 → 1.13.6

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.
@@ -3,6 +3,7 @@ declare class NotificationApi_ {
3
3
  send_email: (payload: ISendEmailPayload[]) => Promise<any>;
4
4
  send_push: (payload: ISendPushPayload[]) => Promise<any>;
5
5
  link_external_id_push: (payload: ILinkExternalIdPushPayload) => Promise<any>;
6
+ unlink_external_id_push: (external_id: string) => Promise<any>;
6
7
  private api_request;
7
8
  }
8
9
  export declare const NotificationApi: NotificationApi_;
@@ -41,8 +41,8 @@ class NotificationApi_ {
41
41
  try {
42
42
  const { external_id, subscription_id } = payload;
43
43
  const resp = await this.api_request({
44
- method: 'POST',
45
- endpoint: `subscriptions/${subscription_id}/identity`,
44
+ method: 'PATCH',
45
+ endpoint: `push/subscriptions/${subscription_id}/identity`,
46
46
  body: {
47
47
  external_id
48
48
  }
@@ -54,6 +54,19 @@ class NotificationApi_ {
54
54
  throw err;
55
55
  }
56
56
  };
57
+ this.unlink_external_id_push = async (external_id) => {
58
+ try {
59
+ const resp = await this.api_request({
60
+ method: 'DELETE',
61
+ endpoint: `push/users/${external_id}/identity`,
62
+ });
63
+ return resp;
64
+ }
65
+ catch (error) {
66
+ const err = helpers_1.RequestHelper.get_error(error);
67
+ throw err;
68
+ }
69
+ };
57
70
  this.api_request = async (request) => {
58
71
  try {
59
72
  const resp = await (0, api_request_util_1.ApiRequest)({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vasrefil/api-toolkit",
3
3
  "description": "This is Vasrefil API toolkit",
4
- "version": "1.13.2",
4
+ "version": "1.13.6",
5
5
  "author": "Sodiq Alabi",
6
6
  "main": "dist/public-api.js",
7
7
  "types": "dist/public-api.d.ts",