@blocklet/meta 1.16.30-beta-958ae719 → 1.16.30-beta-b80c7bcd

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/blockies.js CHANGED
@@ -3,7 +3,9 @@
3
3
  /* eslint-disable prefer-destructuring */
4
4
  // Forked from https://github.com/download13/blockies
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.createBlockiesSvg = exports.buildOpts = exports.createImageData = void 0;
6
+ exports.createImageData = createImageData;
7
+ exports.buildOpts = buildOpts;
8
+ exports.createBlockiesSvg = createBlockiesSvg;
7
9
  // The random number is a js implementation of the Xorshift PRNG
8
10
  const randseed = new Array(4); // Xorshift: [x, y, z, w] 32 bit values
9
11
  function seedrand(seed) {
@@ -52,7 +54,6 @@ function createImageData(size) {
52
54
  }
53
55
  return data;
54
56
  }
55
- exports.createImageData = createImageData;
56
57
  function buildOpts(opts) {
57
58
  seedrand(opts.seed);
58
59
  const newOpts = {
@@ -65,7 +66,6 @@ function buildOpts(opts) {
65
66
  };
66
67
  return newOpts;
67
68
  }
68
- exports.buildOpts = buildOpts;
69
69
  function createBlockiesSvg(address, size = 8, caseSensitive = false, scale = 10) {
70
70
  if (!address)
71
71
  throw new Error('Address is required');
@@ -105,4 +105,3 @@ function createBlockiesSvg(address, size = 8, caseSensitive = false, scale = 10)
105
105
  </g>
106
106
  </svg>`;
107
107
  }
108
- exports.createBlockiesSvg = createBlockiesSvg;
package/lib/blocklet.d.ts CHANGED
@@ -17,6 +17,6 @@ type TComponentInternalInfo = {
17
17
  declare const getComponentsInternalInfo: (app: BlockletState) => Array<TComponentInternalInfo>;
18
18
  export { getComponentsInternalInfo, TComponentInternalInfo };
19
19
  declare const _default: {
20
- getComponentsInternalInfo: (app: BlockletState) => TComponentInternalInfo[];
20
+ getComponentsInternalInfo: (app: BlockletState) => Array<TComponentInternalInfo>;
21
21
  };
22
22
  export default _default;
package/lib/did-utils.js CHANGED
@@ -1,39 +1,38 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getSourceProviders = exports.getSourceProvider = exports.getWalletDid = exports.getWallet = exports.getConnectedDids = exports.getConnectedAccounts = exports.getPermanentDid = void 0;
3
+ exports.getPermanentDid = getPermanentDid;
4
+ exports.getConnectedAccounts = getConnectedAccounts;
5
+ exports.getConnectedDids = getConnectedDids;
6
+ exports.getWallet = getWallet;
7
+ exports.getWalletDid = getWalletDid;
8
+ exports.getSourceProvider = getSourceProvider;
9
+ exports.getSourceProviders = getSourceProviders;
4
10
  const constant_1 = require("@blocklet/constant");
5
11
  function getPermanentDid(user) {
6
12
  return user?.did;
7
13
  }
8
- exports.getPermanentDid = getPermanentDid;
9
14
  function getConnectedAccounts(user) {
10
15
  const connectedAccounts = user?.connectedAccounts || [];
11
16
  return connectedAccounts;
12
17
  }
13
- exports.getConnectedAccounts = getConnectedAccounts;
14
18
  function getConnectedDids(user) {
15
19
  const connectedAccounts = getConnectedAccounts(user);
16
20
  const didList = connectedAccounts.map((item) => item.did);
17
21
  return didList;
18
22
  }
19
- exports.getConnectedDids = getConnectedDids;
20
23
  function getWallet(user) {
21
24
  const connectedAccounts = getConnectedAccounts(user);
22
25
  const walletAccount = connectedAccounts.find((item) => item.provider === constant_1.LOGIN_PROVIDER.WALLET);
23
26
  return walletAccount;
24
27
  }
25
- exports.getWallet = getWallet;
26
28
  function getWalletDid(user) {
27
29
  const walletAccount = getWallet(user);
28
30
  return walletAccount?.did;
29
31
  }
30
- exports.getWalletDid = getWalletDid;
31
32
  function getSourceProvider(user) {
32
33
  return user?.sourceProvider || constant_1.LOGIN_PROVIDER.WALLET;
33
34
  }
34
- exports.getSourceProvider = getSourceProvider;
35
35
  function getSourceProviders(user) {
36
36
  const connectedAccounts = getConnectedAccounts(user);
37
37
  return connectedAccounts.map((item) => item.provider);
38
38
  }
39
- exports.getSourceProviders = getSourceProviders;
package/lib/did.d.ts CHANGED
@@ -1,3 +1,2 @@
1
- /// <reference types="node" />
2
1
  declare const toBlockletDid: (name: string | Buffer) => string;
3
2
  export = toBlockletDid;
package/lib/fix.d.ts CHANGED
@@ -4,7 +4,7 @@ declare const fixRepository: (data: any) => void;
4
4
  declare const fixFiles: (data: any) => void;
5
5
  declare const fixKeywords: (data: any) => void;
6
6
  declare const fixTags: (data: any) => void;
7
- declare const formatPerson: (person: string | Record<string, any>) => string;
7
+ declare const formatPerson: (person: string | Record<string, unknown>) => string;
8
8
  declare const parsePerson: (person: string) => any;
9
9
  declare const fixPerson: (data: any) => any;
10
10
  declare const fixInterfaces: (meta: any, removeMerged?: boolean) => any;
@@ -28,7 +28,7 @@ declare const _default: {
28
28
  fixPerson: (data: any) => any;
29
29
  fixTags: (data: any) => void;
30
30
  fixName: (meta: any) => any;
31
- formatPerson: (person: string | Record<string, any>) => string;
31
+ formatPerson: (person: string | Record<string, unknown>) => string;
32
32
  parsePerson: (person: string) => any;
33
33
  fixInterfaces: (meta: any, removeMerged?: boolean) => any;
34
34
  fixService: (meta: import("./types").TBlockletMeta) => import("./types").TBlockletMeta;
package/lib/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import * as constants from './constants';
3
2
  import parse from './parse';
4
3
  import toBlockletDid from './did';
@@ -60,14 +59,14 @@ declare const _default: {
60
59
  schemaOptions?: any;
61
60
  }) => import("./types").TBlockletMeta;
62
61
  fixAndValidateService: (meta: import("./types").TBlockletMeta) => import("./types").TBlockletMeta;
63
- formatPerson: (person: string | Record<string, any>) => string;
62
+ formatPerson: (person: string | Record<string, unknown>) => string;
64
63
  parsePerson: (person: string) => any;
65
64
  fixPerson: (data: any) => any;
66
65
  fixInterfaces: (meta: any, removeMerged?: boolean) => any;
67
66
  fixName: (meta: any) => any;
68
67
  fixService: (meta: import("./types").TBlockletMeta) => import("./types").TBlockletMeta;
69
68
  toBlockletDid: (name: string | Buffer) => string;
70
- getBlockletWallet: (didOrSk: string, nodeSk?: string, type?: "ethereum" | "default" | "eth" | import("@arcblock/did").DIDType, index?: number) => import("@ocap/wallet").WalletObject<string>;
69
+ getBlockletWallet: (didOrSk: string, nodeSk?: string, type?: import("@arcblock/did").DIDType | "default" | "eth" | "ethereum", index?: number) => import("@ocap/wallet").WalletObject;
71
70
  getBlockletInfo: (state: import("@abtnode/client").BlockletState, nodeSk?: string, { returnWallet }?: {
72
71
  returnWallet?: boolean;
73
72
  }) => {
@@ -79,8 +78,8 @@ declare const _default: {
79
78
  appUrl: string;
80
79
  secret: string;
81
80
  tenantMode: string;
82
- wallet: import("@ocap/wallet").WalletObject<string>;
83
- permanentWallet: import("@ocap/wallet").WalletObject<string>;
81
+ wallet: import("@ocap/wallet").WalletObject;
82
+ permanentWallet: import("@ocap/wallet").WalletObject;
84
83
  };
85
84
  getBlockletEngine: (meta: any) => import("./types").TEngine;
86
85
  verifyMultiSig: (blockletMeta: import("./types").TBlockletMeta) => boolean;
@@ -3,7 +3,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.sortRootNavigation = exports.cleanOldNavigationHistory = exports.splitNavigationBySection = exports.flattenNavigation = exports.checkLink = exports.joinLink = exports.cleanOrphanNavigation = exports.filterNavigation = exports.nestNavigationList = exports.isMatchSection = exports.deepWalk = exports.parseNavigation = void 0;
6
+ exports.sortRootNavigation = exports.cleanOldNavigationHistory = exports.checkLink = void 0;
7
+ exports.parseNavigation = parseNavigation;
8
+ exports.deepWalk = deepWalk;
9
+ exports.isMatchSection = isMatchSection;
10
+ exports.nestNavigationList = nestNavigationList;
11
+ exports.filterNavigation = filterNavigation;
12
+ exports.cleanOrphanNavigation = cleanOrphanNavigation;
13
+ exports.joinLink = joinLink;
14
+ exports.flattenNavigation = flattenNavigation;
15
+ exports.splitNavigationBySection = splitNavigationBySection;
7
16
  const unionWith_1 = __importDefault(require("lodash/unionWith"));
8
17
  const isEqual_1 = __importDefault(require("lodash/isEqual"));
9
18
  const pick_1 = __importDefault(require("lodash/pick"));
@@ -40,7 +49,6 @@ function deepWalk(tree, cb = () => { }, { key = 'children', order = 'first' } =
40
49
  }
41
50
  walk(tree);
42
51
  }
43
- exports.deepWalk = deepWalk;
44
52
  /**
45
53
  * 判断一个传入值是否属于一个 section
46
54
  * @param {SectionType | SectionType[]} sections 需要判断的对象
@@ -55,7 +63,6 @@ function isMatchSection(sections, section) {
55
63
  }
56
64
  return sections === section;
57
65
  }
58
- exports.isMatchSection = isMatchSection;
59
66
  function tryParseItem(item) {
60
67
  try {
61
68
  return JSON.parse(item);
@@ -143,7 +150,6 @@ function joinLink(navigation, components) {
143
150
  }, { key: 'items' });
144
151
  return copyNavigation;
145
152
  }
146
- exports.joinLink = joinLink;
147
153
  /**
148
154
  * 将树状结构的导航列表进行扁平化处理
149
155
  * @param {array} navigationList 树状结构的导航列表
@@ -180,7 +186,6 @@ function flattenNavigation(list = [], { depth = 1, transform = (v) => v } = {})
180
186
  }, { key: 'items', order: 'last' });
181
187
  return finalList;
182
188
  }
183
- exports.flattenNavigation = flattenNavigation;
184
189
  /**
185
190
  * 将 blocklet 中的数据进行处理,获得当前应用的导航数据及组件数据
186
191
  * @param {object} blocklet blocklet 应用实例对象
@@ -417,7 +422,6 @@ function splitNavigationBySection(navigation) {
417
422
  }
418
423
  return allNavigationList;
419
424
  }
420
- exports.splitNavigationBySection = splitNavigationBySection;
421
425
  /**
422
426
  * 将导航数据进行层叠处理
423
427
  * @param {array} list 扁平化的导航数据
@@ -445,7 +449,6 @@ function nestNavigationList(list = []) {
445
449
  }, null);
446
450
  return cloneList;
447
451
  }
448
- exports.nestNavigationList = nestNavigationList;
449
452
  function filterNavigation(navigationList, components = []) {
450
453
  const nestedNavigation = nestNavigationList(navigationList);
451
454
  deepWalk(nestedNavigation, (item) => {
@@ -475,7 +478,6 @@ function filterNavigation(navigationList, components = []) {
475
478
  });
476
479
  return filteredNavigation;
477
480
  }
478
- exports.filterNavigation = filterNavigation;
479
481
  function cleanOrphanNavigation(list) {
480
482
  // 将仅有一个 child 的菜单提升到上一级
481
483
  return list.map((item) => {
@@ -487,7 +489,6 @@ function cleanOrphanNavigation(list) {
487
489
  return item;
488
490
  });
489
491
  }
490
- exports.cleanOrphanNavigation = cleanOrphanNavigation;
491
492
  const sortRootNavigation = (navigation) => {
492
493
  const [root, other] = (0, lodash_1.partition)(navigation, (x) => x.id === '/team');
493
494
  return [...root, ...other];
@@ -543,4 +544,3 @@ function parseNavigation(blocklet = {}, options = {}) {
543
544
  });
544
545
  return { navigationList: rawNavigation, components, builtinList: flatNavigation };
545
546
  }
546
- exports.parseNavigation = parseNavigation;
@@ -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, "value" | "address">[];
4
+ tokens: Pick<import("@abtnode/client").BlockletPaymentPrice, "address" | "value">[];
5
5
  shares: {
6
6
  value: number;
7
7
  address: string;
@@ -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, "value" | "address">[];
88
+ tokens: Pick<import("@abtnode/client").BlockletPaymentPrice, "address" | "value">[];
89
89
  shares: {
90
90
  value: number;
91
91
  address: string;
@@ -196,10 +196,10 @@ declare const _default: {
196
196
  };
197
197
  input?: any;
198
198
  address?: string;
199
- hooks?: {
199
+ hooks?: Array<{
200
200
  type: string;
201
201
  hook: string;
202
- }[];
202
+ }>;
203
203
  };
204
204
  signerWallet: any;
205
205
  }) => Promise<any>;
@@ -207,18 +207,18 @@ declare const _default: {
207
207
  version: string;
208
208
  _test: {
209
209
  getPriceTokens: (meta: any, ocapClient: any) => Promise<any>;
210
- getFactoryInput: (inputTokens: {
210
+ getFactoryInput: (inputTokens: Array<{
211
211
  address: string;
212
212
  value: string | number;
213
213
  decimal: number;
214
- }[], { formatToken }?: {
214
+ }>, { formatToken }?: {
215
215
  formatToken?: boolean;
216
216
  }) => {
217
- tokens: {
217
+ tokens: Array<{
218
218
  address: string;
219
219
  value: string | number;
220
220
  decimal: number;
221
- }[];
221
+ }>;
222
222
  assets: [];
223
223
  variables: [];
224
224
  };
@@ -236,9 +236,9 @@ declare const _default: {
236
236
  }>;
237
237
  getContract: ({ meta, priceTokens, components, }: {
238
238
  meta: import("../types").TBlockletMeta;
239
- priceTokens: {
239
+ priceTokens: Array<{
240
240
  decimal: number;
241
- }[];
241
+ }>;
242
242
  components: any;
243
243
  }) => {
244
244
  code: string;
@@ -1,7 +1,7 @@
1
1
  import { BlockletPaymentPrice } from '@abtnode/client';
2
2
  import { TBlockletMeta } from '../types';
3
3
  declare const createShareContract: ({ tokens, shares, }: {
4
- tokens?: Pick<BlockletPaymentPrice, 'address' | 'value'>[];
4
+ tokens?: Pick<BlockletPaymentPrice, "address" | "value">[];
5
5
  shares: {
6
6
  value: number;
7
7
  address: string;
@@ -9,7 +9,7 @@ declare const createShareContract: ({ tokens, shares, }: {
9
9
  }) => string;
10
10
  declare const createNftFactoryItx: ({ meta, tokens, shares, issuers, serviceUrl, }: {
11
11
  meta: TBlockletMeta;
12
- tokens: Pick<BlockletPaymentPrice, 'address' | 'value'>[];
12
+ tokens: Pick<BlockletPaymentPrice, "address" | "value">[];
13
13
  shares: {
14
14
  value: number;
15
15
  address: string;
@@ -93,7 +93,7 @@ export { createShareContract };
93
93
  export { createNftFactoryItx };
94
94
  declare const _default: {
95
95
  createShareContract: ({ tokens, shares, }: {
96
- tokens?: Pick<BlockletPaymentPrice, "value" | "address">[];
96
+ tokens?: Pick<BlockletPaymentPrice, "address" | "value">[];
97
97
  shares: {
98
98
  value: number;
99
99
  address: string;
@@ -101,7 +101,7 @@ declare const _default: {
101
101
  }) => string;
102
102
  createNftFactoryItx: ({ meta, tokens, shares, issuers, serviceUrl, }: {
103
103
  meta: TBlockletMeta;
104
- tokens: Pick<BlockletPaymentPrice, "value" | "address">[];
104
+ tokens: Pick<BlockletPaymentPrice, "address" | "value">[];
105
105
  shares: {
106
106
  value: number;
107
107
  address: string;
@@ -185,10 +185,10 @@ declare const _default: {
185
185
  };
186
186
  input?: any;
187
187
  address?: string;
188
- hooks?: {
188
+ hooks?: Array<{
189
189
  type: string;
190
190
  hook: string;
191
- }[];
191
+ }>;
192
192
  };
193
193
  signerWallet: any;
194
194
  }) => Promise<any>;
@@ -196,18 +196,18 @@ declare const _default: {
196
196
  version: string;
197
197
  _test: {
198
198
  getPriceTokens: (meta: any, ocapClient: any) => Promise<any>;
199
- getFactoryInput: (inputTokens: {
199
+ getFactoryInput: (inputTokens: Array<{
200
200
  address: string;
201
201
  value: string | number;
202
202
  decimal: number;
203
- }[], { formatToken }?: {
203
+ }>, { formatToken }?: {
204
204
  formatToken?: boolean;
205
205
  }) => {
206
- tokens: {
206
+ tokens: Array<{
207
207
  address: string;
208
208
  value: string | number;
209
209
  decimal: number;
210
- }[];
210
+ }>;
211
211
  assets: [];
212
212
  variables: [];
213
213
  };
@@ -225,9 +225,9 @@ declare const _default: {
225
225
  }>;
226
226
  getContract: ({ meta, priceTokens, components, }: {
227
227
  meta: TBlockletMeta;
228
- priceTokens: {
228
+ priceTokens: Array<{
229
229
  decimal: number;
230
- }[];
230
+ }>;
231
231
  components: any;
232
232
  }) => {
233
233
  code: string;
package/lib/schema.d.ts CHANGED
@@ -46,7 +46,7 @@ declare const _default: {
46
46
  ensureComponentStore?: boolean;
47
47
  ensureName?: boolean;
48
48
  skipValidateDidName?: boolean;
49
- }) => JOI.ObjectSchema<any>;
49
+ }) => JOI.ObjectSchema;
50
50
  interfaceSchema: JOI.ObjectSchema<any>;
51
51
  environmentSchema: JOI.ObjectSchema<any>;
52
52
  environmentNameSchema: JOI.StringSchema<string>;
package/lib/schema.js CHANGED
@@ -568,7 +568,7 @@ const blockletMetaProps = {
568
568
  }))
569
569
  .optional(),
570
570
  timeout: Joi.object({
571
- start: Joi.number().min(10).max(600),
571
+ start: Joi.number().min(10).max(600), // start check timeout, 10 seconds ~ 10 minutes
572
572
  script: Joi.number().min(1).max(1800), // hook/migration timeout, 1 seconds ~ 30 minutes
573
573
  }).default({ start: 60 }),
574
574
  requirements: Joi.object({
@@ -631,9 +631,9 @@ const blockletMetaProps = {
631
631
  didSpace: Joi.string()
632
632
  .valid(...Object.values(constant_2.BLOCKLET_APP_SPACE_REQUIREMENT))
633
633
  .optional(),
634
- navigation: Joi.boolean().default(true),
635
- serverless: Joi.boolean().optional(),
636
- component: Joi.boolean(),
634
+ navigation: Joi.boolean().default(true), // Should blocklet join navigation auto-merge process
635
+ serverless: Joi.boolean().optional(), // Can the blocklet be installed on serverless
636
+ component: Joi.boolean(), // Can blocklet become a component and be composed by other blocklets
637
637
  sitemap: Joi.boolean().optional(), // Does this blocklet supports composable sitemap
638
638
  }).default({}),
639
639
  // Other contents to be included in the bundle
@@ -24,14 +24,14 @@ export interface TBlockletMeta {
24
24
  mountPoint?: TMountPoint;
25
25
  name?: TBlockletName;
26
26
  required?: boolean;
27
- source: {
27
+ source: ({
28
28
  url: string | string[];
29
29
  version?: 'latest' | string;
30
- } | {
30
+ }) | ({
31
31
  name: TBlockletName;
32
32
  store?: string;
33
33
  version?: 'latest' | string;
34
- };
34
+ });
35
35
  title?: TTitle;
36
36
  })[];
37
37
  contributors?: TPerson[];
@@ -78,14 +78,14 @@ export interface TBlockletMeta {
78
78
  value: number;
79
79
  }[];
80
80
  };
81
- repository?: string | {
81
+ repository?: string | ({
82
82
  directory?: string;
83
83
  type: 'git' | 'https' | 'svn';
84
84
  url: string;
85
- };
85
+ });
86
86
  requirements?: {
87
87
  abtnode?: string;
88
- cpu?: '*' | 'arm' | 'arm64' | 'ia32' | 'mips' | 'mipsel' | 'ppc' | 'ppc64' | 's390' | 's390x' | 'x32' | 'x64' | ('arm' | 'arm64' | 'ia32' | 'mips' | 'mipsel' | 'ppc' | 'ppc64' | 's390' | 's390x' | 'x32' | 'x64')[];
88
+ cpu?: ('*' | 'arm' | 'arm64' | 'ia32' | 'mips' | 'mipsel' | 'ppc' | 'ppc64' | 's390' | 's390x' | 'x32' | 'x64') | (('arm' | 'arm64' | 'ia32' | 'mips' | 'mipsel' | 'ppc' | 'ppc64' | 's390' | 's390x' | 'x32' | 'x64')[]);
89
89
  fuels?: {
90
90
  address?: string;
91
91
  endpoint: string;
@@ -93,7 +93,7 @@ export interface TBlockletMeta {
93
93
  value: string;
94
94
  }[];
95
95
  nodejs?: string;
96
- os?: '*' | 'aix' | 'darwin' | 'freebsd' | 'linux' | 'openbsd' | 'sunos' | 'win32' | ('aix' | 'darwin' | 'freebsd' | 'linux' | 'openbsd' | 'sunos' | 'win32')[];
96
+ os?: ('*' | 'aix' | 'darwin' | 'freebsd' | 'linux' | 'openbsd' | 'sunos' | 'win32') | (('aix' | 'darwin' | 'freebsd' | 'linux' | 'openbsd' | 'sunos' | 'win32')[]);
97
97
  server?: string;
98
98
  };
99
99
  resource?: {
@@ -126,14 +126,14 @@ export interface TComponent {
126
126
  mountPoint?: TMountPoint;
127
127
  name?: TBlockletName;
128
128
  required?: boolean;
129
- source: {
129
+ source: ({
130
130
  url: string | string[];
131
131
  version?: 'latest' | string;
132
- } | {
132
+ }) | ({
133
133
  name: TBlockletName;
134
134
  store?: string;
135
135
  version?: 'latest' | string;
136
- };
136
+ });
137
137
  title?: TTitle;
138
138
  }
139
139
  export type TDescription = string;
@@ -158,15 +158,15 @@ export interface TEngine {
158
158
  args?: string[];
159
159
  interpreter?: 'binary' | 'node' | 'blocklet';
160
160
  platform?: 'aix' | 'darwin' | 'freebsd' | 'linux' | 'openbsd' | 'sunos' | 'win32';
161
- source?: string | {
161
+ source?: string | ({
162
162
  name: TBlockletName;
163
163
  url: string;
164
164
  version?: 'latest' | string;
165
- } | {
165
+ }) | ({
166
166
  name: TBlockletName;
167
167
  store: string;
168
168
  version?: 'latest' | string;
169
- };
169
+ });
170
170
  }
171
171
  export interface TEnvironment {
172
172
  default?: string;
@@ -37,6 +37,6 @@ declare const _default: {
37
37
  ensureTarball?: boolean;
38
38
  logger?: any;
39
39
  }) => Promise<any>;
40
- getSourceUrlsFromConfig: (config: any) => string[];
40
+ getSourceUrlsFromConfig: (config: TComponent & any) => string[];
41
41
  };
42
42
  export default _default;
package/lib/util.d.ts CHANGED
@@ -170,7 +170,7 @@ declare const _default: {
170
170
  forEachBlockletSync: (blocklet: any, cb: Function) => Promise<unknown>;
171
171
  forEachChild: (blocklet: any, cb: Function, params?: any) => Promise<any>;
172
172
  forEachChildSync: (blocklet: BlockletState, cb: Function) => Promise<any>;
173
- forEachComponentV2: (blocklet: BlockletState, cb: Function, { parallel, concurrencyLimit, sync, }?: {
173
+ forEachComponentV2: (blocklet: TApp, cb: Function, { parallel, concurrencyLimit, sync, }?: {
174
174
  parallel?: boolean;
175
175
  concurrencyLimit?: number;
176
176
  sync?: boolean;
@@ -189,7 +189,7 @@ declare const _default: {
189
189
  getAppUrl: typeof getAppUrl;
190
190
  getDisplayName: (blocklet: BlockletState, onlyUseMeta?: boolean) => string;
191
191
  fixBlockletStatus: (blocklet?: BlockletState) => void;
192
- findWebInterface: (blocklet?: TBlockletMeta | BlockletState) => any;
192
+ findWebInterface: (blocklet?: BlockletState | TBlockletMeta) => any;
193
193
  findWebInterfacePort: (blocklet?: BlockletState) => any;
194
194
  findServiceFromMeta: (meta?: TBlockletMeta, ServiceName?: string) => any;
195
195
  getWhoCanAccess: (blocklet?: BlockletState) => any;
@@ -199,20 +199,20 @@ declare const _default: {
199
199
  meta?: {
200
200
  did?: string;
201
201
  };
202
- }, ancestors?: {
202
+ }, ancestors?: Array<{
203
203
  meta?: {
204
204
  did?: string;
205
205
  };
206
- }[]) => string;
206
+ }>) => string;
207
207
  getComponentName: (component?: {
208
208
  meta?: {
209
209
  name?: string;
210
210
  };
211
- }, ancestors?: {
211
+ }, ancestors?: Array<{
212
212
  meta?: {
213
213
  name?: string;
214
214
  };
215
- }[]) => string;
215
+ }>) => string;
216
216
  getComponentBundleId: (component: {
217
217
  meta: {
218
218
  bundleName: string;
@@ -220,26 +220,26 @@ declare const _default: {
220
220
  };
221
221
  }) => string;
222
222
  findComponent: (blocklet: TComponent, isEqualFn: (component: TComponent, context: {
223
- ancestors: TComponent[];
223
+ ancestors: Array<TComponent>;
224
224
  }) => boolean, { _ancestors, returnAncestors, }?: {
225
- _ancestors?: TComponent[];
225
+ _ancestors?: Array<TComponent>;
226
226
  returnAncestors?: boolean;
227
227
  }) => TComponent | {
228
228
  component: TComponent;
229
- ancestors: TComponent[];
229
+ ancestors: Array<TComponent>;
230
230
  };
231
- findComponentById: (blocklet: TComponent, componentId: string | string[], { returnAncestors, }?: {
231
+ findComponentById: (blocklet: TComponent, componentId: string | Array<string>, { returnAncestors, }?: {
232
232
  returnAncestors?: boolean;
233
233
  }) => TComponent | {
234
234
  component: TComponent;
235
- ancestors: TComponent[];
235
+ ancestors: Array<TComponent>;
236
236
  };
237
- findComponentV2: (app: BlockletState, isEqualFn: (component: TComponent, app: BlockletState) => boolean) => ComponentState;
238
- findComponentByIdV2: (app: BlockletState, componentId: string | string[]) => ComponentState;
239
- filterComponentsV2: (app: BlockletState, isEqualFn: (component: TComponent, app: BlockletState) => boolean) => any[];
237
+ findComponentV2: (app: TApp, isEqualFn: (component: TComponent, app: TApp) => boolean) => ComponentState;
238
+ findComponentByIdV2: (app: TApp, componentId: string | Array<string>) => ComponentState;
239
+ filterComponentsV2: (app: TApp, isEqualFn: (component: TComponent, app: TApp) => boolean) => any[];
240
240
  getParentComponentName: (name?: string) => string;
241
241
  getConnectAppUrl: ({ request, baseUrl }: {
242
- request: Partial<Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>>;
242
+ request: Partial<Request>;
243
243
  baseUrl: string;
244
244
  }) => string;
245
245
  getChainInfo: (env: Record<string, string>) => ChainInfo;
@@ -248,13 +248,13 @@ declare const _default: {
248
248
  isPreferenceKey: (x: Partial<TConfig>) => Boolean;
249
249
  getRolesFromAuthConfig: (config: {
250
250
  whoCanAccess: string;
251
- }) => string[];
252
- getBlockletServices: (blocklet: Partial<BlockletState>) => {
251
+ }) => Array<string>;
252
+ getBlockletServices: (blocklet: Partial<BlockletState>) => Array<{
253
253
  name: string;
254
254
  protocol: string;
255
255
  port: number;
256
256
  upstreamPort: number;
257
- }[];
257
+ }>;
258
258
  isInProgress: (status: string | number) => boolean;
259
259
  isBeforeInstalled: (status: string | number) => boolean;
260
260
  isRunning: (status: string | number) => boolean;
package/lib/util.js CHANGED
@@ -3,8 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.isPackBlocklet = exports.isGatewayBlocklet = exports.isAccessible = exports.isRunning = exports.isBeforeInstalled = exports.isInProgress = exports.getBlockletServices = exports.getBlockletAppIdList = exports.getRolesFromAuthConfig = exports.isPreferenceKey = exports.isExternalBlocklet = exports.getBlockletChainInfo = exports.getChainInfo = exports.getConnectAppUrl = exports.getParentComponentName = exports.filterComponentsV2 = exports.findComponentByIdV2 = exports.findComponentV2 = exports.findComponentById = exports.findComponent = exports.getComponentBundleId = exports.getComponentName = exports.getComponentId = exports.replaceSlotToIp = exports.getComponentWhoCanAccess = exports.getWhoCanAccess = exports.findServiceFromMeta = exports.findWebInterfacePort = exports.findWebInterface = exports.fixBlockletStatus = exports.getAppDescription = exports.getDisplayName = exports.getAppName = exports.hasRunnableComponent = exports.wipeSensitiveData = exports.isEnvShareable = exports.isEnvShareableToClient = exports.getComponentMissingConfigs = exports.getAppMissingConfigs = exports.getSharedConfigObj = exports.isDeletableBlocklet = exports.forEachComponentV2Sync = exports.forEachComponentV2 = exports.forEachChildSync = exports.forEachChild = exports.forEachBlockletSync = exports.forEachBlocklet = exports.isFreeComponent = exports.isFreeBlocklet = exports.getAppUrl = void 0;
7
- exports.hasResourceType = exports.hasStartEngine = void 0;
6
+ exports.hasStartEngine = exports.isPackBlocklet = exports.isGatewayBlocklet = exports.isAccessible = exports.isRunning = exports.isBeforeInstalled = exports.isInProgress = exports.getBlockletServices = exports.getBlockletAppIdList = exports.getRolesFromAuthConfig = exports.isPreferenceKey = exports.isExternalBlocklet = exports.getBlockletChainInfo = exports.getChainInfo = exports.getConnectAppUrl = exports.getParentComponentName = exports.filterComponentsV2 = exports.findComponentByIdV2 = exports.findComponentV2 = exports.findComponentById = exports.findComponent = exports.getComponentBundleId = exports.getComponentName = exports.getComponentId = exports.replaceSlotToIp = exports.getComponentWhoCanAccess = exports.getWhoCanAccess = exports.findServiceFromMeta = exports.findWebInterfacePort = exports.findWebInterface = exports.fixBlockletStatus = exports.getAppDescription = exports.getDisplayName = exports.getAppName = exports.hasRunnableComponent = exports.wipeSensitiveData = exports.isEnvShareable = exports.isEnvShareableToClient = exports.getComponentMissingConfigs = exports.getAppMissingConfigs = exports.getSharedConfigObj = exports.isDeletableBlocklet = exports.forEachComponentV2Sync = exports.forEachComponentV2 = exports.forEachChildSync = exports.forEachChild = exports.forEachBlockletSync = exports.forEachBlocklet = exports.isFreeComponent = exports.isFreeBlocklet = void 0;
7
+ exports.hasResourceType = void 0;
8
+ exports.getAppUrl = getAppUrl;
8
9
  /* eslint-disable no-await-in-loop */
9
10
  const get_1 = __importDefault(require("lodash/get"));
10
11
  const uniq_1 = __importDefault(require("lodash/uniq"));
@@ -492,7 +493,6 @@ function getAppUrl(blocklet) {
492
493
  const appUrl = appUrls?.[0];
493
494
  return appUrl;
494
495
  }
495
- exports.getAppUrl = getAppUrl;
496
496
  const fixBlockletStatus = (blocklet) => {
497
497
  if (!blocklet) {
498
498
  return;
package/lib/wallet.d.ts CHANGED
@@ -5,5 +5,5 @@ import { DIDType } from '@arcblock/did';
5
5
  *
6
6
  * Spec: https://github.com/ArcBlock/ABT-DID-Protocol#request-did-authentication
7
7
  */
8
- declare const getApplicationWallet: (didOrSk: string, nodeSk?: string, type?: DIDType | 'default' | 'eth' | 'ethereum', index?: number) => WalletObject;
8
+ declare const getApplicationWallet: (didOrSk: string, nodeSk?: string, type?: DIDType | "default" | "eth" | "ethereum", index?: number) => WalletObject;
9
9
  export = getApplicationWallet;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.30-beta-958ae719",
6
+ "version": "1.16.30-beta-b80c7bcd",
7
7
  "description": "Library to parse/validate/fix blocklet meta",
8
8
  "main": "./lib/index.js",
9
9
  "typings": "./lib/index.d.ts",
@@ -25,12 +25,12 @@
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.30-beta-958ae719",
28
+ "@abtnode/constant": "1.16.30-beta-b80c7bcd",
29
29
  "@arcblock/did": "1.18.128",
30
30
  "@arcblock/did-ext": "1.18.128",
31
31
  "@arcblock/did-util": "1.18.128",
32
32
  "@arcblock/jwt": "1.18.128",
33
- "@blocklet/constant": "1.16.30-beta-958ae719",
33
+ "@blocklet/constant": "1.16.30-beta-b80c7bcd",
34
34
  "@ocap/asset": "1.18.128",
35
35
  "@ocap/mcrypto": "1.18.128",
36
36
  "@ocap/types": "1.18.128",
@@ -79,5 +79,5 @@
79
79
  "ts-node": "^10.9.1",
80
80
  "typescript": "^5.0.4"
81
81
  },
82
- "gitHead": "75590ff3be51e7fe2a070124541aebc203ed16dc"
82
+ "gitHead": "9d68833290b1a59357b7c362018416b82b5d1503"
83
83
  }