@blocklet/sdk 1.16.29-beta-e04c6f40 → 1.16.29-beta-db5c4ed6

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.
@@ -15,12 +15,20 @@ export type TNotificationSender = {
15
15
  * @param {Object} options
16
16
  * @returns
17
17
  */
18
- declare const sendToUser: (receiver: string | string[], notification: TNotification | TNotificationInput, { appDid, appSk, type }: TNotificationSender, port?: string, options?: {}, pathname?: string) => Promise<any>;
18
+ declare const sendToUser: (receiver: string | string[], notification: TNotification | TNotificationInput, { appDid, appSk, type }: TNotificationSender, port?: string, options?: {
19
+ keepForOfflineUser?: boolean;
20
+ locale?: string;
21
+ channels?: ('app' | 'email' | 'push' | 'webhook')[];
22
+ }, pathname?: string) => Promise<any>;
19
23
  declare const sendToAppChannel: (channel: string, event: string, notification: TNotificationInput, { appDid, appSk }: TNotificationSender, port?: string, options?: TSendOptions) => Promise<any>;
20
24
  declare const sendToRelay: (topic: string, event: string, data: any, { appDid, appSk }: TNotificationSender, port?: string) => Promise<any>;
21
25
  export { sendToUser, sendToAppChannel, sendToRelay };
22
26
  declare const _default: {
23
- sendToUser: (receiver: string | string[], notification: TNotification | TNotificationInput, { appDid, appSk, type }: TNotificationSender, port?: string, options?: {}, pathname?: string) => Promise<any>;
27
+ sendToUser: (receiver: string | string[], notification: TNotification | TNotificationInput, { appDid, appSk, type }: TNotificationSender, port?: string, options?: {
28
+ keepForOfflineUser?: boolean;
29
+ locale?: string;
30
+ channels?: ("push" | "app" | "email" | "webhook")[];
31
+ }, pathname?: string) => Promise<any>;
24
32
  sendToAppChannel: (channel: string, event: string, notification: TNotificationInput, { appDid, appSk }: TNotificationSender, port?: string, options?: TSendOptions) => Promise<any>;
25
33
  sendToRelay: (topic: string, event: string, data: any, { appDid, appSk }: TNotificationSender, port?: string) => Promise<any>;
26
34
  };
@@ -60,7 +60,7 @@ const sendToUser = async (receiver, notification, { appDid, appSk, type }, port
60
60
  if (pathname === 'send-to-mail') {
61
61
  await (0, index_1.validateEmail)(receiver);
62
62
  }
63
- const opt = (0, pick_1.default)(options, ['keepForOfflineUser', 'locale']);
63
+ const opt = (0, pick_1.default)(options, ['keepForOfflineUser', 'locale', 'channels']);
64
64
  await (0, index_1.validateOption)(opt);
65
65
  if (SERVER_MODE !== NODE_MODES.DEBUG) {
66
66
  await (0, index_1.validateNotification)(notification);
@@ -206,7 +206,9 @@ const inputReceiverSchema = Joi.array().items(receiverSchema).single().required(
206
206
  const optionSchema = Joi.object({
207
207
  keepForOfflineUser: Joi.boolean(),
208
208
  locale: Joi.string(),
209
- channels: Joi.array().items(Joi.allow('app', 'email', 'push', 'webhook')).optional(),
209
+ channels: Joi.array()
210
+ .items(Joi.allow('app', 'email', 'push', 'webhook'))
211
+ .optional(),
210
212
  })
211
213
  .unknown()
212
214
  .meta({ className: 'TSendOptions', unknownType: 'any' });
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.29-beta-e04c6f40",
6
+ "version": "1.16.29-beta-db5c4ed6",
7
7
  "description": "graphql client to read/write data on abt node",
8
8
  "main": "lib/index.js",
9
9
  "typings": "lib/index.d.ts",
@@ -27,20 +27,20 @@
27
27
  "author": "linchen1987 <linchen.1987@foxmail.com> (http://github.com/linchen1987)",
28
28
  "license": "Apache-2.0",
29
29
  "dependencies": {
30
- "@abtnode/client": "1.16.29-beta-e04c6f40",
31
- "@abtnode/constant": "1.16.29-beta-e04c6f40",
32
- "@arcblock/did": "1.18.123",
33
- "@arcblock/did-auth": "1.18.123",
34
- "@arcblock/jwt": "1.18.123",
35
- "@arcblock/ws": "1.18.123",
36
- "@blocklet/constant": "1.16.29-beta-e04c6f40",
37
- "@blocklet/env": "1.16.29-beta-e04c6f40",
38
- "@blocklet/meta": "1.16.29-beta-e04c6f40",
30
+ "@abtnode/client": "1.16.29-beta-db5c4ed6",
31
+ "@abtnode/constant": "1.16.29-beta-db5c4ed6",
32
+ "@arcblock/did": "1.18.124",
33
+ "@arcblock/did-auth": "1.18.124",
34
+ "@arcblock/jwt": "1.18.124",
35
+ "@arcblock/ws": "1.18.124",
36
+ "@blocklet/constant": "1.16.29-beta-db5c4ed6",
37
+ "@blocklet/env": "1.16.29-beta-db5c4ed6",
38
+ "@blocklet/meta": "1.16.29-beta-db5c4ed6",
39
39
  "@did-connect/authenticator": "^2.2.4",
40
40
  "@did-connect/handler": "^2.2.4",
41
41
  "@nedb/core": "^2.1.5",
42
- "@ocap/mcrypto": "1.18.123",
43
- "@ocap/wallet": "1.18.123",
42
+ "@ocap/mcrypto": "1.18.124",
43
+ "@ocap/wallet": "1.18.124",
44
44
  "axios": "^1.7.2",
45
45
  "cheerio": "^1.0.0-rc.12",
46
46
  "fs-extra": "^11.2.0",
@@ -57,7 +57,7 @@
57
57
  "@nedb/core": "^2.1.2"
58
58
  },
59
59
  "devDependencies": {
60
- "@arcblock/eslint-config-ts": "^0.3.0",
60
+ "@arcblock/eslint-config-ts": "^0.3.2",
61
61
  "@types/express": "^4.17.14",
62
62
  "@types/jest": "^29.5.11",
63
63
  "@types/json-stable-stringify": "^1.0.34",
@@ -66,14 +66,14 @@
66
66
  "@typescript-eslint/eslint-plugin": "^5.40.1",
67
67
  "@typescript-eslint/parser": "^5.40.1",
68
68
  "detect-port": "^1.5.1",
69
- "eslint": "^8.25.0",
69
+ "eslint": "^8.57.0",
70
70
  "jest": "^29.7.0",
71
71
  "joi-to-typescript": "^4.0.7",
72
72
  "json-stable-stringify": "^1.0.1",
73
- "prettier": "^2.7.1",
73
+ "prettier": "^3.3.2",
74
74
  "ts-jest": "^29.1.1",
75
75
  "ts-node": "^10.9.1",
76
76
  "typescript": "^5.0.4"
77
77
  },
78
- "gitHead": "f3e8f2ce931215b95ada33e87aee997d8ae52a69"
78
+ "gitHead": "b15f6442fd30f217c08c7f892dce5d38e340ea28"
79
79
  }