shred-api-client 1.10.9 → 1.10.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.
@@ -1,10 +1,10 @@
1
1
  import Environment from "../model/Env";
2
- import { NotificationSchema, Notification } from "../model/Notification.schema";
2
+ import { NotificationSchema, NotificationDetail } from "../model/Notification.schema";
3
3
  import Context from "../model/Context";
4
4
  declare class NotificationAPI implements NotificationSchema {
5
5
  private env;
6
6
  private clientHTTP;
7
7
  constructor(env: Environment);
8
- push(ctx: Context, notification: Notification): Promise<boolean>;
8
+ push(ctx: Context, notification: NotificationDetail): Promise<boolean>;
9
9
  }
10
10
  export default NotificationAPI;
@@ -1,7 +1,7 @@
1
1
  import Context from "./Context";
2
2
  import { Notification } from "./../namespace";
3
3
  interface NotificationSchema {
4
- push: (context: Context, notification: Notification) => Promise<boolean>;
4
+ push: (context: Context, notification: NotificationDetail) => Promise<boolean>;
5
5
  }
6
6
  declare const NotificationEndpoints: {
7
7
  Push: {
@@ -14,9 +14,16 @@ type Criteria = {
14
14
  params: Record<string, any>;
15
15
  };
16
16
  type History = {
17
+ batchId: string;
17
18
  executedAt: number;
19
+ timezone: string;
18
20
  status: "success" | "failed" | "info" | "warn";
19
- notifiedUsers?: number;
21
+ users: {
22
+ total: number;
23
+ success: number;
24
+ error: number;
25
+ };
26
+ errorList?: string[];
20
27
  executionTimeDuration?: number;
21
28
  };
22
29
  type Trigger = {
@@ -24,7 +31,7 @@ type Trigger = {
24
31
  title: string;
25
32
  description: string;
26
33
  transportType: Notification.TransportType[];
27
- notification: Notification;
34
+ notification: NotificationDetail;
28
35
  executionTime: string;
29
36
  repeatDays: Notification.WeekDay[];
30
37
  history?: History[];
@@ -36,10 +43,10 @@ type Trigger = {
36
43
  createdAt?: number;
37
44
  modified?: number;
38
45
  };
39
- type Notification = {
46
+ type NotificationDetail = {
40
47
  title: string;
41
48
  body: string;
42
49
  userToken?: string;
43
50
  metadata?: any;
44
51
  };
45
- export { NotificationSchema, NotificationEndpoints, Notification, Trigger, Criteria, History, };
52
+ export { NotificationSchema, NotificationEndpoints, NotificationDetail, Trigger, Criteria, History, };
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Notification = exports.NotificationEndpoints = void 0;
4
- const namespace_1 = require("./../namespace");
5
- Object.defineProperty(exports, "Notification", { enumerable: true, get: function () { return namespace_1.Notification; } });
3
+ exports.NotificationEndpoints = void 0;
6
4
  const NotificationEndpoints = {
7
5
  Push: {
8
6
  uri: "/notifications/push/",
@@ -1,5 +1,5 @@
1
1
  import { Product as TProduct, Subscription as TSubscription, Charge as TCharge } from "./model/Subscription.schema";
2
- import { Trigger as TTrigger, Criteria as TCriteria, Notification as TNContent, History as THistory } from "./model/Notification.schema";
2
+ import { Trigger as TTrigger, Criteria as TCriteria, NotificationDetail as TNContent, History as THistory } from "./model/Notification.schema";
3
3
  import { System as TSystem, User as TUser, Preferences as UserPreferences, Role as TRole } from "./model/User.schema";
4
4
  import { Email as TEmail } from "./model/Email.schema";
5
5
  import { Asset as TAsset } from "./model/Asset.schema";
@@ -59,7 +59,7 @@ export declare namespace Notification {
59
59
  type Trigger = TTrigger;
60
60
  type Criteria = TCriteria;
61
61
  type History = THistory;
62
- type Item = TNContent;
62
+ type Detail = TNContent;
63
63
  }
64
64
  export declare namespace User {
65
65
  type Preferences = UserPreferences;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shred-api-client",
3
- "version": "1.10.9",
3
+ "version": "1.10.11",
4
4
  "description": "API Client for Shred",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",