@blocklet/meta 1.16.49-beta-20250815-032308-7bcf0b85 → 1.16.49-beta-20250821-102221-1b7283d6

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.
package/lib/blocklet.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { BlockletState } from '@abtnode/client';
1
+ import type { BlockletState } from '@blocklet/server-js';
2
2
  type TComponentInternalInfo = {
3
3
  title: string;
4
4
  did: string;
@@ -1,8 +1,8 @@
1
- import { UserInfo } from '@abtnode/client';
1
+ import { UserInfo } from '@blocklet/server-js';
2
2
  export declare function getPermanentDid(user: UserInfo): string;
3
- export declare function getConnectedAccounts(user: UserInfo): import("@abtnode/client").ConnectedAccount[];
3
+ export declare function getConnectedAccounts(user: UserInfo): import("@blocklet/server-js").ConnectedAccount[];
4
4
  export declare function getConnectedDids(user: UserInfo): string[];
5
- export declare function getWallet(user: UserInfo): import("@abtnode/client").ConnectedAccount;
5
+ export declare function getWallet(user: UserInfo): import("@blocklet/server-js").ConnectedAccount;
6
6
  export declare function getWalletDid(user: UserInfo): string;
7
7
  export declare function getSourceProvider(user: UserInfo): string;
8
8
  export declare function getSourceProviders(user: UserInfo): string[];
package/lib/index.d.ts CHANGED
@@ -69,7 +69,7 @@ declare const _default: {
69
69
  fixService: (meta: import("./types").TBlockletMeta) => import("./types").TBlockletMeta;
70
70
  toBlockletDid: (name: string | Buffer) => string;
71
71
  getBlockletWallet: (didOrSk: string, nodeSk?: string, type?: import("@arcblock/did").DIDType | "default" | "eth" | "ethereum", index?: number) => import("@ocap/wallet").WalletObject;
72
- getBlockletInfo: (state: import("@abtnode/client").BlockletState, nodeSk?: string, { returnWallet }?: {
72
+ getBlockletInfo: (state: import("@blocklet/server-js").BlockletState, nodeSk?: string, { returnWallet }?: {
73
73
  returnWallet?: boolean;
74
74
  }) => {
75
75
  did: string;
package/lib/info.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { WalletObject } from '@ocap/wallet';
2
- import { BlockletState } from '@abtnode/client';
2
+ import { BlockletState } from '@blocklet/server-js';
3
3
  declare const getBlockletInfo: (state: BlockletState, nodeSk?: string, { returnWallet }?: {
4
4
  returnWallet?: boolean;
5
5
  }) => {
@@ -537,13 +537,31 @@ exports.cleanOldNavigationHistory = cleanOldNavigationHistory;
537
537
  function parseNavigation(blocklet = {}, options = {}) {
538
538
  const { beforeProcess = (v) => v } = options;
539
539
  const { navigationList: builtinNavigation, components } = parseBlockletNavigationList(blocklet);
540
+ const navigationMap = new Map();
541
+ builtinNavigation.forEach((item) => {
542
+ item.items?.forEach((child) => {
543
+ navigationMap.set((0, ufo_1.joinURL)(item.id, child.id), child);
544
+ });
545
+ });
540
546
  // 移除存在 db 中的默认导航
541
547
  if (blocklet?.settings?.navigations) {
542
548
  if (!Array.isArray(blocklet.settings.navigations)) {
543
549
  blocklet.settings.navigations = [];
544
550
  }
545
551
  else {
546
- blocklet.settings.navigations = [...blocklet.settings.navigations].filter((item) => !(item?.parent === '/team' && item.from === 'team-tmpl'));
552
+ blocklet.settings.navigations = [...blocklet.settings.navigations]
553
+ .filter((item) => !(item?.parent === '/team' && item.from === 'team-tmpl'))
554
+ .map((item) => {
555
+ // 兼容历史数据,如果存储的没有 private 字段但是 blocklet.yml 有这个字段,则将 blocklet.yml 的 private 字段赋值给 blocklet.settings.navigations
556
+ // private 字段不会被修改,只会在 blocklet.yml 中存在
557
+ if (item.section === 'userCenter' && !Object.prototype.hasOwnProperty.call(item, 'private')) {
558
+ const target = navigationMap.get(item.id);
559
+ if (target && Object.prototype.hasOwnProperty.call(target, 'private')) {
560
+ item.private = target.private;
561
+ }
562
+ }
563
+ return item;
564
+ });
547
565
  }
548
566
  }
549
567
  const customNavigationList = normalizeNavigationList(cleanOldNavigationHistory(blocklet?.settings?.navigations || [])).map(normalizeI18nFields);
@@ -1,7 +1,7 @@
1
1
  import v2 from './v2';
2
2
  export declare const createNftFactoryItx: ({ meta, tokens, shares, issuers, serviceUrl, }: {
3
3
  meta: import("../types").TBlockletMeta;
4
- tokens: Pick<import("@abtnode/client").BlockletPaymentPrice, "address" | "value">[];
4
+ tokens: Pick<import("@blocklet/server-js").BlockletPaymentPrice, "address" | "value">[];
5
5
  shares: {
6
6
  value: number;
7
7
  address: string;
@@ -15,7 +15,7 @@ export declare const createNftFactoryItx: ({ meta, tokens, shares, issuers, serv
15
15
  limit: number;
16
16
  trustedIssuers: string[];
17
17
  input: {
18
- tokens: Pick<import("@abtnode/client").BlockletPaymentPrice, "value" | "address">[];
18
+ tokens: Pick<import("@blocklet/server-js").BlockletPaymentPrice, "value" | "address">[];
19
19
  assets: any[];
20
20
  variables: any[];
21
21
  };
@@ -85,7 +85,7 @@ export { v2 };
85
85
  declare const _default: {
86
86
  createNftFactoryItx: ({ meta, tokens, shares, issuers, serviceUrl, }: {
87
87
  meta: import("../types").TBlockletMeta;
88
- tokens: Pick<import("@abtnode/client").BlockletPaymentPrice, "address" | "value">[];
88
+ tokens: Pick<import("@blocklet/server-js").BlockletPaymentPrice, "address" | "value">[];
89
89
  shares: {
90
90
  value: number;
91
91
  address: string;
@@ -99,7 +99,7 @@ declare const _default: {
99
99
  limit: number;
100
100
  trustedIssuers: string[];
101
101
  input: {
102
- tokens: Pick<import("@abtnode/client").BlockletPaymentPrice, "value" | "address">[];
102
+ tokens: Pick<import("@blocklet/server-js").BlockletPaymentPrice, "value" | "address">[];
103
103
  assets: any[];
104
104
  variables: any[];
105
105
  };
@@ -1,4 +1,4 @@
1
- import { BlockletPaymentPrice } from '@abtnode/client';
1
+ import { BlockletPaymentPrice } from '@blocklet/server-js';
2
2
  import { TBlockletMeta } from '../types';
3
3
  declare const createShareContract: ({ tokens, shares, }: {
4
4
  tokens?: Pick<BlockletPaymentPrice, "address" | "value">[];
package/lib/schema.js CHANGED
@@ -437,6 +437,7 @@ const navigationItemProps = {
437
437
  role: Joi.array().items(Joi.string().min(1)).single(),
438
438
  icon: Joi.string().min(1),
439
439
  visible: Joi.boolean(),
440
+ private: Joi.boolean(), // 是否私有,访问其他用户个人中心时是否可见
440
441
  };
441
442
  const navigationItemSchema = Joi.object({
442
443
  ...navigationItemProps,
@@ -235,6 +235,7 @@ export interface TNavigationItem {
235
235
  */
236
236
  [x: string]: string;
237
237
  };
238
+ private?: boolean;
238
239
  role?: string[];
239
240
  section?: string[];
240
241
  title: string | {
@@ -251,6 +252,7 @@ export interface TNavigationItem {
251
252
  */
252
253
  [x: string]: string;
253
254
  };
255
+ private?: boolean;
254
256
  role?: string[];
255
257
  section?: string[];
256
258
  title: string | {
package/lib/util.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { BlockletState, ComponentState } from '@abtnode/client';
1
+ import type { BlockletState, ComponentState } from '@blocklet/server-js';
2
2
  import type { Request } from 'express';
3
3
  import { hasStartEngine, isGatewayBlocklet, isPackBlocklet } from './engine';
4
4
  import type { TBlockletMeta, TEnvironment } from './types';
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.49-beta-20250815-032308-7bcf0b85",
6
+ "version": "1.16.49-beta-20250821-102221-1b7283d6",
7
7
  "description": "Library to parse/validate/fix blocklet meta",
8
8
  "main": "./lib/index.js",
9
9
  "typings": "./lib/index.d.ts",
@@ -25,19 +25,19 @@
25
25
  "author": "wangshijun <wangshijun2020@gmail.com> (http://github.com/wangshijun)",
26
26
  "license": "Apache-2.0",
27
27
  "dependencies": {
28
- "@abtnode/constant": "1.16.49-beta-20250815-032308-7bcf0b85",
29
- "@abtnode/db-cache": "1.16.49-beta-20250815-032308-7bcf0b85",
30
- "@abtnode/docker-utils": "1.16.49-beta-20250815-032308-7bcf0b85",
31
- "@arcblock/did": "1.21.2",
32
- "@arcblock/did-ext": "1.21.2",
33
- "@arcblock/did-util": "1.21.2",
34
- "@arcblock/jwt": "1.21.2",
35
- "@blocklet/constant": "1.16.49-beta-20250815-032308-7bcf0b85",
36
- "@ocap/asset": "1.21.2",
37
- "@ocap/mcrypto": "1.21.2",
38
- "@ocap/types": "1.21.2",
39
- "@ocap/util": "1.21.2",
40
- "@ocap/wallet": "1.21.2",
28
+ "@abtnode/constant": "1.16.49-beta-20250821-102221-1b7283d6",
29
+ "@abtnode/db-cache": "1.16.49-beta-20250821-102221-1b7283d6",
30
+ "@abtnode/docker-utils": "1.16.49-beta-20250821-102221-1b7283d6",
31
+ "@arcblock/did": "1.22.2",
32
+ "@arcblock/did-ext": "1.22.2",
33
+ "@arcblock/did-util": "1.22.2",
34
+ "@arcblock/jwt": "1.22.2",
35
+ "@blocklet/constant": "1.16.49-beta-20250821-102221-1b7283d6",
36
+ "@ocap/asset": "1.22.2",
37
+ "@ocap/mcrypto": "1.22.2",
38
+ "@ocap/types": "1.22.2",
39
+ "@ocap/util": "1.22.2",
40
+ "@ocap/wallet": "1.22.2",
41
41
  "ajv": "^8.11.0",
42
42
  "axios": "^1.7.9",
43
43
  "cjk-length": "^1.0.0",
@@ -82,5 +82,5 @@
82
82
  "ts-node": "^10.9.1",
83
83
  "typescript": "^5.6.3"
84
84
  },
85
- "gitHead": "75dd236eb42d14a5093c1364e51625412aa91790"
85
+ "gitHead": "4fdd3b0cfb87b45ff8c0d539f83c3ddcbd71465b"
86
86
  }