@blocklet/sdk 1.16.41-beta-20250319-034744-5c62f533 → 1.16.41-beta-20250321-223009-25dace48

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.
@@ -62,5 +62,6 @@ interface AuthService {
62
62
  getComponent(did: string): Promise<Client.ComponentState>;
63
63
  getTrustedDomains(): Promise<string[]>;
64
64
  getVault(): Promise<string>;
65
+ updateUserAddress(args: OmitTeamDid<Client.RequestUpdateUserAddressInput>): Promise<Client.ResponseUser>;
65
66
  }
66
67
  export = AuthService;
@@ -69,6 +69,8 @@ class AuthService {
69
69
  'updateUserApproval',
70
70
  'updateUserTags',
71
71
  'updateUserExtra',
72
+ // updateUserInfo
73
+ 'updateUserAddress',
72
74
  // tagging
73
75
  'getTags',
74
76
  'createTag',
@@ -20,7 +20,9 @@ function getFederatedMasterAppInfo({ blocklet, sourceAppPid, version, groupPathP
20
20
  const master = federated.sites.find((x) => x.appPid === sourceAppPid);
21
21
  if (!master) {
22
22
  config_1.default.logger.error('Federated master app not found', { sourceAppPid });
23
- throw new Error(`Federated master app not found: ${sourceAppPid}`);
23
+ // FIXME: @zhanghan 暂时先返回 null,确保 service 不会挂掉
24
+ return null;
25
+ // throw new Error(`Federated master app not found: ${sourceAppPid}`);
24
26
  }
25
27
  return {
26
28
  name: master.appName,
@@ -19,6 +19,7 @@ declare const sendToUser: (receiver: string | string[], notification: TNotificat
19
19
  keepForOfflineUser?: boolean;
20
20
  locale?: string;
21
21
  channels?: ("app" | "email" | "push" | "webhook")[];
22
+ raw?: boolean;
22
23
  }, pathname?: string, port?: string) => Promise<any>;
23
24
  declare const sendToAppChannel: (channel: string, event: string, notification: TNotificationInput, { appDid, appSk }: TNotificationSender, options?: TSendOptions, port?: string) => Promise<any>;
24
25
  declare const sendToRelay: (topic: string, event: string, data: any, { appDid, appSk }: TNotificationSender, port?: string) => Promise<any>;
@@ -29,6 +30,7 @@ declare const _default: {
29
30
  keepForOfflineUser?: boolean;
30
31
  locale?: string;
31
32
  channels?: ("app" | "email" | "push" | "webhook")[];
33
+ raw?: boolean;
32
34
  }, pathname?: string, port?: string) => Promise<any>;
33
35
  sendToAppChannel: (channel: string, event: string, notification: TNotificationInput, { appDid, appSk }: TNotificationSender, options?: TSendOptions, port?: string) => Promise<any>;
34
36
  sendToRelay: (topic: string, event: string, data: any, { appDid, appSk }: TNotificationSender, port?: string) => Promise<any>;
@@ -71,7 +71,7 @@ const sendToUser = async (receiver, notification, { appDid, appSk, type }, optio
71
71
  if (pathname === 'send-to-mail') {
72
72
  await (0, index_1.validateEmail)(receiver);
73
73
  }
74
- const opt = (0, pick_1.default)(options, ['keepForOfflineUser', 'locale', 'channels']);
74
+ const opt = (0, pick_1.default)(options, ['keepForOfflineUser', 'locale', 'channels', 'raw']);
75
75
  await (0, index_1.validateOption)(opt);
76
76
  if (SERVER_MODE !== NODE_MODES.DEBUG) {
77
77
  await (0, index_1.validateNotification)(notification);
@@ -62,7 +62,7 @@ class WalletHandlers extends did_auth_1.WalletHandlers {
62
62
  ...opts,
63
63
  });
64
64
  this.getConnectedDid = ({ req, didwallet, extraParams }) => {
65
- if (extraParams && extraParams.autoConnect === 'false') {
65
+ if (['false', false].includes(extraParams?.autoConnect)) {
66
66
  return null;
67
67
  }
68
68
  if (!this.enableConnect) {
@@ -79,6 +79,10 @@ class WalletHandlers extends did_auth_1.WalletHandlers {
79
79
  // @ts-ignore
80
80
  this.on('updated', (session) => {
81
81
  this.sendToRelayFn(session.token, 'updated', session).catch(console.error);
82
+ // NOTICE: 如果当前的 did-connect 会话是和其他会话是关联的,则需要将消息广播到关联的 channel
83
+ if (session.sourceToken) {
84
+ this.sendToRelayFn(session.sourceToken, 'updated', session).catch(console.error);
85
+ }
82
86
  });
83
87
  }
84
88
  attach({ onStart = noop, ...opts }) {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.41-beta-20250319-034744-5c62f533",
6
+ "version": "1.16.41-beta-20250321-223009-25dace48",
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,16 +27,16 @@
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.41-beta-20250319-034744-5c62f533",
31
- "@abtnode/constant": "1.16.41-beta-20250319-034744-5c62f533",
32
- "@abtnode/util": "1.16.41-beta-20250319-034744-5c62f533",
30
+ "@abtnode/client": "1.16.41-beta-20250321-223009-25dace48",
31
+ "@abtnode/constant": "1.16.41-beta-20250321-223009-25dace48",
32
+ "@abtnode/util": "1.16.41-beta-20250321-223009-25dace48",
33
33
  "@arcblock/did": "1.19.15",
34
34
  "@arcblock/did-auth": "1.19.15",
35
35
  "@arcblock/jwt": "1.19.15",
36
36
  "@arcblock/ws": "1.19.15",
37
- "@blocklet/constant": "1.16.41-beta-20250319-034744-5c62f533",
38
- "@blocklet/env": "1.16.41-beta-20250319-034744-5c62f533",
39
- "@blocklet/meta": "1.16.41-beta-20250319-034744-5c62f533",
37
+ "@blocklet/constant": "1.16.41-beta-20250321-223009-25dace48",
38
+ "@blocklet/env": "1.16.41-beta-20250321-223009-25dace48",
39
+ "@blocklet/meta": "1.16.41-beta-20250321-223009-25dace48",
40
40
  "@did-connect/authenticator": "^2.2.7",
41
41
  "@did-connect/handler": "^2.2.7",
42
42
  "@nedb/core": "^2.1.5",
@@ -82,5 +82,5 @@
82
82
  "ts-node": "^10.9.1",
83
83
  "typescript": "^5.6.3"
84
84
  },
85
- "gitHead": "c7d75c3c1dc4d29bef4f08c553cdfe7cf36e9492"
85
+ "gitHead": "b12975e9604c4faf73766feb325f9124226bfff1"
86
86
  }
@@ -1,8 +0,0 @@
1
- export interface TEmailConfig {
2
- from: string;
3
- host: string;
4
- password: string;
5
- port: number;
6
- secure?: boolean;
7
- user: string;
8
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- /* eslint-disable @typescript-eslint/indent */
3
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +0,0 @@
1
- import Joi from 'joi';
2
- declare const emailConfigSchema: Joi.ObjectSchema<any>;
3
- export { emailConfigSchema };
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.emailConfigSchema = void 0;
7
- /* eslint-disable import/prefer-default-export */
8
- const joi_1 = __importDefault(require("joi"));
9
- const emailConfigSchema = joi_1.default.object({
10
- from: joi_1.default.string().email().required(),
11
- host: joi_1.default.string().hostname().required(),
12
- port: joi_1.default.number().port().required(),
13
- user: joi_1.default.string().required(),
14
- password: joi_1.default.string().required(),
15
- secure: joi_1.default.boolean().optional().default(false),
16
- })
17
- .empty(null)
18
- .meta({ className: 'TEmailConfig' });
19
- exports.emailConfigSchema = emailConfigSchema;