shred-api-client 1.10.2 → 1.10.4

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.
@@ -1,4 +1,5 @@
1
1
  import Context from "./Context";
2
+ import { Notification } from "./../namespace";
2
3
  interface PushNotificationSchema {
3
4
  push: (context: Context, notification: PushNotification) => Promise<boolean>;
4
5
  }
@@ -8,10 +9,31 @@ declare const PushNotificationEndpoints: {
8
9
  method: string;
9
10
  };
10
11
  };
12
+ type NotificationCriteria = {
13
+ type: Notification.CriteriaType;
14
+ params: Record<string, any>;
15
+ };
16
+ type NotificationTrigger = {
17
+ id: string;
18
+ title: string;
19
+ description: string;
20
+ transportType: [{
21
+ active: boolean;
22
+ type: Notification.TransportType;
23
+ }];
24
+ notification: {
25
+ title: string;
26
+ body: string;
27
+ };
28
+ schedule: string;
29
+ criteria: NotificationCriteria;
30
+ createdAt?: number;
31
+ modified?: number;
32
+ };
11
33
  type PushNotification = {
12
34
  title: string;
13
35
  body: string;
14
36
  userToken: string;
15
37
  metadata: any;
16
38
  };
17
- export { PushNotificationSchema, PushNotificationEndpoints, PushNotification };
39
+ export { PushNotificationSchema, PushNotificationEndpoints, PushNotification, NotificationTrigger, NotificationCriteria, };
@@ -1,4 +1,5 @@
1
1
  import { Product as TProduct, Subscription as TSubscription, Charge as TCharge } from "./model/Subscription.schema";
2
+ import { NotificationTrigger as TTrigger, NotificationCriteria as TCriteria } from "./model/PushNotification.schema";
2
3
  import { System as TSystem, User as TUser, Preferences as UserPreferences, Role as TRole } from "./model/User.schema";
3
4
  import { Email as TEmail } from "./model/Email.schema";
4
5
  import { Asset as TAsset } from "./model/Asset.schema";
@@ -24,6 +25,20 @@ export declare namespace Shred {
24
25
  type Category = TCategory;
25
26
  }
26
27
  }
28
+ export declare namespace Notification {
29
+ enum CriteriaType {
30
+ NoLogin = "noLogin",
31
+ NoProjects = "noProjects",
32
+ InactiveUsers = "inactiveUsers",
33
+ NoSubscription = "noSubscription"
34
+ }
35
+ enum TransportType {
36
+ Push = "push",
37
+ Email = "email"
38
+ }
39
+ type Trigger = TTrigger;
40
+ type Criteria = TCriteria;
41
+ }
27
42
  export declare namespace User {
28
43
  type Preferences = UserPreferences;
29
44
  }
package/dist/namespace.js CHANGED
@@ -1,2 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Notification = void 0;
4
+ var Notification;
5
+ (function (Notification) {
6
+ let CriteriaType;
7
+ (function (CriteriaType) {
8
+ CriteriaType["NoLogin"] = "noLogin";
9
+ CriteriaType["NoProjects"] = "noProjects";
10
+ CriteriaType["InactiveUsers"] = "inactiveUsers";
11
+ CriteriaType["NoSubscription"] = "noSubscription";
12
+ })(CriteriaType = Notification.CriteriaType || (Notification.CriteriaType = {}));
13
+ let TransportType;
14
+ (function (TransportType) {
15
+ TransportType["Push"] = "push";
16
+ TransportType["Email"] = "email";
17
+ })(TransportType = Notification.TransportType || (Notification.TransportType = {}));
18
+ })(Notification || (exports.Notification = Notification = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shred-api-client",
3
- "version": "1.10.2",
3
+ "version": "1.10.4",
4
4
  "description": "API Client for Shred",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",