@blocklet/sdk 1.16.49-beta-20250812-040454-05aece54 → 1.16.49-beta-20250813-141500-f02b41b4

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.
@@ -44,10 +44,12 @@ const ufo_1 = require("ufo");
44
44
  const p_retry_1 = __importDefault(require("p-retry"));
45
45
  const wait_port_1 = __importDefault(require("wait-port"));
46
46
  const constant_1 = require("@blocklet/constant");
47
+ const debug_1 = __importDefault(require("debug"));
47
48
  const config_1 = __importStar(require("../config"));
48
49
  const Util = __importStar(require("./util"));
49
50
  const component_api_1 = __importDefault(require("../util/component-api"));
50
51
  const parse_docker_endpoint_1 = require("../util/parse-docker-endpoint");
52
+ const debug = (0, debug_1.default)('@blocklet/sdk:component');
51
53
  // eslint-disable-next-line require-await
52
54
  const doCall = async ({ url, headers = {}, ...options }, retryOptions = {}) => (0, p_retry_1.default)(async () => {
53
55
  const startTime = Date.now();
@@ -59,7 +61,7 @@ const doCall = async ({ url, headers = {}, ...options }, retryOptions = {}) => (
59
61
  headers,
60
62
  });
61
63
  const duration = Date.now() - startTime;
62
- config_1.default.logger.info(`component.call succeed in ${duration}ms: ${url} `);
64
+ debug(`component.call succeed in ${duration}ms: ${url} `);
63
65
  return res;
64
66
  }
65
67
  catch (error) {
@@ -129,6 +129,7 @@ export interface TSendOptions {
129
129
  * Any Property
130
130
  */
131
131
  [x: string]: any;
132
+ allowUnsubscribe?: boolean;
132
133
  channels?: ('app' | 'email' | 'push' | 'webhook')[];
133
134
  keepForOfflineUser?: boolean;
134
135
  locale?: string;
@@ -72,7 +72,7 @@ const sendToUser = async (receiver, notification, { appDid, appSk, type }, optio
72
72
  if (pathname === 'send-to-mail') {
73
73
  await (0, index_1.validateEmail)(receiver);
74
74
  }
75
- const opt = (0, pick_1.default)(options, ['keepForOfflineUser', 'locale', 'channels', 'raw', 'ttl']);
75
+ const opt = (0, pick_1.default)(options, ['keepForOfflineUser', 'locale', 'channels', 'raw', 'ttl', 'allowUnsubscribe']);
76
76
  await (0, index_1.validateOption)(opt);
77
77
  if (SERVER_MODE !== NODE_MODES.DEBUG) {
78
78
  await (0, index_1.validateNotification)(notification);
@@ -285,6 +285,7 @@ const optionSchema = Joi.object({
285
285
  .items(Joi.allow('app', 'email', 'push', 'webhook'))
286
286
  .optional(),
287
287
  ttl: Joi.number().integer().min(0).max(7200).optional(), // 0-7200 分钟
288
+ allowUnsubscribe: Joi.boolean().optional(),
288
289
  })
289
290
  .unknown()
290
291
  .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.49-beta-20250812-040454-05aece54",
6
+ "version": "1.16.49-beta-20250813-141500-f02b41b4",
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,19 +27,19 @@
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.49-beta-20250812-040454-05aece54",
31
- "@abtnode/constant": "1.16.49-beta-20250812-040454-05aece54",
32
- "@abtnode/db-cache": "1.16.49-beta-20250812-040454-05aece54",
33
- "@abtnode/util": "1.16.49-beta-20250812-040454-05aece54",
30
+ "@abtnode/client": "1.16.49-beta-20250813-141500-f02b41b4",
31
+ "@abtnode/constant": "1.16.49-beta-20250813-141500-f02b41b4",
32
+ "@abtnode/db-cache": "1.16.49-beta-20250813-141500-f02b41b4",
33
+ "@abtnode/util": "1.16.49-beta-20250813-141500-f02b41b4",
34
34
  "@arcblock/did": "1.21.2",
35
35
  "@arcblock/did-connect-js": "1.21.2",
36
36
  "@arcblock/jwt": "1.21.2",
37
- "@arcblock/ws": "1.21.2",
38
- "@blocklet/constant": "1.16.49-beta-20250812-040454-05aece54",
39
- "@blocklet/env": "1.16.49-beta-20250812-040454-05aece54",
37
+ "@arcblock/ws": "1.21.3",
38
+ "@blocklet/constant": "1.16.49-beta-20250813-141500-f02b41b4",
39
+ "@blocklet/env": "1.16.49-beta-20250813-141500-f02b41b4",
40
40
  "@blocklet/error": "^0.2.5",
41
- "@blocklet/meta": "1.16.49-beta-20250812-040454-05aece54",
42
- "@blocklet/theme": "^3.1.7",
41
+ "@blocklet/meta": "1.16.49-beta-20250813-141500-f02b41b4",
42
+ "@blocklet/theme": "^3.1.17",
43
43
  "@did-connect/authenticator": "^2.2.8",
44
44
  "@did-connect/handler": "^2.2.8",
45
45
  "@nedb/core": "^2.1.5",
@@ -85,5 +85,5 @@
85
85
  "ts-node": "^10.9.1",
86
86
  "typescript": "^5.6.3"
87
87
  },
88
- "gitHead": "c07b7f3d216fb12d530eba91423f4f9b6d344533"
88
+ "gitHead": "ff97c4a29a0eac939237a935e391d5d1b9c6eec2"
89
89
  }