@blocklet/meta 1.8.33 → 1.8.35

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.
Files changed (58) hide show
  1. package/lib/channel.d.ts +27 -0
  2. package/lib/channel.js +32 -32
  3. package/lib/constants.d.ts +2 -0
  4. package/lib/constants.js +6 -3
  5. package/lib/did.d.ts +10 -0
  6. package/lib/did.js +18 -24
  7. package/lib/engine.d.ts +7 -0
  8. package/lib/engine.js +21 -25
  9. package/lib/entry.d.ts +3 -0
  10. package/lib/entry.js +51 -64
  11. package/lib/extension.d.ts +10 -0
  12. package/lib/extension.js +78 -77
  13. package/lib/file.d.ts +21 -0
  14. package/lib/file.js +44 -39
  15. package/lib/fix.d.ts +33 -0
  16. package/lib/fix.js +218 -208
  17. package/lib/get-component-process-id.d.ts +5 -0
  18. package/lib/get-component-process-id.js +13 -14
  19. package/lib/has-reserved-key.d.ts +3 -0
  20. package/lib/has-reserved-key.js +10 -9
  21. package/lib/index.d.ts +82 -0
  22. package/lib/index.js +51 -34
  23. package/lib/info.d.ts +13 -0
  24. package/lib/info.js +58 -60
  25. package/lib/name.d.ts +5 -0
  26. package/lib/name.js +14 -7
  27. package/lib/nft-templates.d.ts +86 -0
  28. package/lib/nft-templates.js +47 -42
  29. package/lib/parse-navigation.d.ts +3 -0
  30. package/lib/parse-navigation.js +168 -209
  31. package/lib/parse.d.ts +22 -0
  32. package/lib/parse.js +71 -82
  33. package/lib/payment/index.d.ts +254 -0
  34. package/lib/payment/index.js +13 -6
  35. package/lib/payment/v1.d.ts +185 -0
  36. package/lib/payment/v1.js +80 -81
  37. package/lib/payment/v2.d.ts +242 -0
  38. package/lib/payment/v2.js +453 -531
  39. package/lib/schema.d.ts +50 -0
  40. package/lib/schema.js +405 -397
  41. package/lib/service-configs/auth.json +61 -61
  42. package/lib/service.d.ts +26 -0
  43. package/lib/service.js +69 -85
  44. package/lib/types/index.d.ts +1 -0
  45. package/lib/types/index.js +18 -0
  46. package/lib/types/schema.d.ts +241 -0
  47. package/lib/types/schema.js +3 -0
  48. package/lib/util-meta.d.ts +42 -0
  49. package/lib/util-meta.js +138 -158
  50. package/lib/util.d.ts +185 -0
  51. package/lib/util.js +359 -414
  52. package/lib/validate.d.ts +10 -0
  53. package/lib/validate.js +28 -34
  54. package/lib/verify-multi-sig.d.ts +3 -0
  55. package/lib/verify-multi-sig.js +94 -101
  56. package/lib/wallet.d.ts +9 -0
  57. package/lib/wallet.js +17 -27
  58. package/package.json +41 -18
package/lib/fix.d.ts ADDED
@@ -0,0 +1,33 @@
1
+ import { fixAndValidateService } from './validate';
2
+ declare const fixRequired: (data: any, dir: string) => void;
3
+ declare const fixRepository: (data: any) => void;
4
+ declare const fixFiles: (data: any) => void;
5
+ declare const fixKeywords: (data: any) => void;
6
+ declare const fixTags: (data: any) => void;
7
+ declare const formatPerson: (person: string | Record<string, any>) => string;
8
+ declare const parsePerson: (person: string) => any;
9
+ declare const fixPerson: (data: any) => any;
10
+ declare const fixInterfaces: (meta: any, removeMerged?: boolean) => any;
11
+ export { fixRequired };
12
+ export { fixRepository };
13
+ export { fixFiles };
14
+ export { fixKeywords };
15
+ export { fixPerson };
16
+ export { fixTags };
17
+ export { formatPerson };
18
+ export { parsePerson };
19
+ export { fixInterfaces };
20
+ export { fixAndValidateService as fixService };
21
+ declare const _default: {
22
+ fixRequired: (data: any, dir: string) => void;
23
+ fixRepository: (data: any) => void;
24
+ fixFiles: (data: any) => void;
25
+ fixKeywords: (data: any) => void;
26
+ fixPerson: (data: any) => any;
27
+ fixTags: (data: any) => void;
28
+ formatPerson: (person: string | Record<string, any>) => string;
29
+ parsePerson: (person: string) => any;
30
+ fixInterfaces: (meta: any, removeMerged?: boolean) => any;
31
+ fixService: (meta: import("./types").TBlockletMeta) => import("./types").TBlockletMeta;
32
+ };
33
+ export default _default;
package/lib/fix.js CHANGED
@@ -1,235 +1,245 @@
1
- /* eslint-disable prefer-destructuring */
2
- const fs = require('fs');
3
- const path = require('path');
4
- const get = require('lodash/get');
5
- const gitInfo = require('hosted-git-info');
6
- const debug = require('debug')('@blocklet/meta:fix');
7
-
8
- const { fixAndValidateService } = require('./validate');
9
- const {
10
- BLOCKLET_DEFAULT_VERSION,
11
- BLOCKLET_DEFAULT_PORT_NAME,
12
- BLOCKLET_DYNAMIC_PATH_PREFIX,
13
- BLOCKLET_INTERFACE_TYPE_WEB,
14
- BLOCKLET_INTERFACE_PUBLIC,
15
- } = require('./constants');
16
-
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.fixService = exports.fixInterfaces = exports.parsePerson = exports.formatPerson = exports.fixTags = exports.fixPerson = exports.fixKeywords = exports.fixFiles = exports.fixRepository = exports.fixRequired = void 0;
30
+ const fs_1 = __importDefault(require("fs"));
31
+ const path_1 = __importDefault(require("path"));
32
+ const get_1 = __importDefault(require("lodash/get"));
33
+ const gitInfo = __importStar(require("hosted-git-info"));
34
+ const debug_1 = __importDefault(require("debug"));
35
+ const validate_1 = require("./validate");
36
+ Object.defineProperty(exports, "fixService", { enumerable: true, get: function () { return validate_1.fixAndValidateService; } });
37
+ const constants_1 = __importDefault(require("./constants"));
38
+ const debug = (0, debug_1.default)('@blocklet/meta:fix');
39
+ const { BLOCKLET_DEFAULT_VERSION, BLOCKLET_DEFAULT_PORT_NAME, BLOCKLET_DYNAMIC_PATH_PREFIX, BLOCKLET_INTERFACE_TYPE_WEB, BLOCKLET_INTERFACE_PUBLIC, } = constants_1.default;
17
40
  // Assign sensible defaults: name/description/main/group/version/public_url
18
41
  const fixRequired = (data, dir) => {
19
- if (!data.name) {
20
- data.name = path.basename(dir);
21
- }
22
-
23
- if (!data.description) {
24
- data.description = `Blocklet from ${dir}`;
25
- }
26
-
27
- if (!data.version) {
28
- data.version = BLOCKLET_DEFAULT_VERSION;
29
- }
30
-
31
- if (!data.main && !data.group) {
32
- debug('guess main and group', dir);
33
- data.group = 'static';
34
-
35
- const items = ['.'].concat(fs.readdirSync(dir));
36
- const item = items.find(
37
- (x) => fs.existsSync(path.resolve(dir, x, 'index.html')) || fs.existsSync(path.resolve(dir, x, 'index.htm'))
38
- );
39
- if (item) {
40
- data.main = item;
41
- }
42
- }
43
-
44
- if (!data.group) {
45
- const main = path.join(dir, data.main);
46
- try {
47
- const stat = fs.statSync(main);
48
- if (stat.isDirectory()) {
42
+ if (!data.name) {
43
+ data.name = path_1.default.basename(dir);
44
+ }
45
+ if (!data.description) {
46
+ data.description = `Blocklet from ${dir}`;
47
+ }
48
+ if (!data.version) {
49
+ data.version = BLOCKLET_DEFAULT_VERSION;
50
+ }
51
+ if (!data.main && !data.group) {
52
+ debug('guess main and group', dir);
49
53
  data.group = 'static';
50
- } else {
51
- data.group = 'dapp';
52
- }
53
- } catch (err) {
54
- data.group = 'static';
54
+ const items = ['.'].concat(fs_1.default.readdirSync(dir));
55
+ const item = items.find((x) => fs_1.default.existsSync(path_1.default.resolve(dir, x, 'index.html')) || fs_1.default.existsSync(path_1.default.resolve(dir, x, 'index.htm')));
56
+ if (item) {
57
+ data.main = item;
58
+ }
59
+ }
60
+ if (!data.group) {
61
+ const main = path_1.default.join(dir, data.main);
62
+ try {
63
+ const stat = fs_1.default.statSync(main);
64
+ if (stat.isDirectory()) {
65
+ data.group = 'static';
66
+ }
67
+ else {
68
+ data.group = 'dapp';
69
+ }
70
+ }
71
+ catch (err) {
72
+ data.group = 'static';
73
+ }
55
74
  }
56
- }
57
75
  };
58
-
76
+ exports.fixRequired = fixRequired;
59
77
  const fixRepository = (data) => {
60
- if (!data.repository) return;
61
- if (typeof data.repository === 'string') {
62
- data.repository = {
63
- type: 'git',
64
- url: data.repository,
65
- };
66
- }
67
- if (data.repository.url) {
68
- const info = gitInfo.fromUrl(data.repository.url);
69
- if (info) {
70
- data.repository.url = info.getDefaultRepresentation() === 'shortcut' ? info.https() : info.toString();
78
+ if (!data.repository)
79
+ return;
80
+ if (typeof data.repository === 'string') {
81
+ data.repository = {
82
+ type: 'git',
83
+ url: data.repository,
84
+ };
85
+ }
86
+ if (data.repository.url) {
87
+ const info = gitInfo.fromUrl(data.repository.url);
88
+ if (info) {
89
+ data.repository.url = info.getDefaultRepresentation() === 'shortcut' ? info.https() : info.toString();
90
+ }
71
91
  }
72
- }
73
92
  };
74
-
93
+ exports.fixRepository = fixRepository;
75
94
  const fixFiles = (data) => {
76
- if (!Array.isArray(data.files)) {
77
- delete data.files;
78
- } else if (data.files) {
79
- data.files = data.files.filter((file) => {
80
- return !(!file || typeof file !== 'string');
81
- });
82
- }
95
+ if (!Array.isArray(data.files)) {
96
+ delete data.files;
97
+ }
98
+ else if (data.files) {
99
+ data.files = data.files.filter((file) => {
100
+ return !(!file || typeof file !== 'string');
101
+ });
102
+ }
83
103
  };
84
-
104
+ exports.fixFiles = fixFiles;
85
105
  const fixKeywords = (data) => {
86
- if (typeof data.keywords === 'string') {
87
- data.keywords = data.keywords.split(/,\s+/);
88
- }
89
- if (data.keywords && !Array.isArray(data.keywords)) {
90
- delete data.keywords;
91
- } else if (data.keywords) {
92
- data.keywords = data.keywords.filter((kw) => {
93
- return !(typeof kw !== 'string' || !kw);
94
- });
95
- }
106
+ if (typeof data.keywords === 'string') {
107
+ data.keywords = data.keywords.split(/,\s+/);
108
+ }
109
+ if (data.keywords && !Array.isArray(data.keywords)) {
110
+ delete data.keywords;
111
+ }
112
+ else if (data.keywords) {
113
+ data.keywords = data.keywords.filter((kw) => {
114
+ return !(typeof kw !== 'string' || !kw);
115
+ });
116
+ }
96
117
  };
97
-
118
+ exports.fixKeywords = fixKeywords;
98
119
  const fixTags = (data) => {
99
- if (typeof data.tags === 'string') {
100
- data.tags = data.tags.split(/,\s+/);
101
- }
102
- if (data.tags && !Array.isArray(data.tags)) {
103
- delete data.tags;
104
- } else if (data.tags) {
105
- data.tags = data.tags.filter((t) => {
106
- return !(typeof t !== 'string' || !t);
107
- });
108
- }
120
+ if (typeof data.tags === 'string') {
121
+ data.tags = data.tags.split(/,\s+/);
122
+ }
123
+ if (data.tags && !Array.isArray(data.tags)) {
124
+ delete data.tags;
125
+ }
126
+ else if (data.tags) {
127
+ data.tags = data.tags.filter((t) => {
128
+ return !(typeof t !== 'string' || !t);
129
+ });
130
+ }
109
131
  };
110
-
132
+ exports.fixTags = fixTags;
111
133
  const updatePerson = (data, fn) => {
112
- if (data.author) data.author = fn(data.author);
113
- ['maintainers', 'contributors'].forEach((key) => {
114
- if (!Array.isArray(data[key])) {
115
- return;
116
- }
117
- data[key] = data[key].map(fn);
118
- });
119
-
120
- return data;
134
+ if (data.author)
135
+ data.author = fn(data.author);
136
+ ['maintainers', 'contributors'].forEach((key) => {
137
+ if (!Array.isArray(data[key])) {
138
+ return;
139
+ }
140
+ data[key] = data[key].map(fn);
141
+ });
142
+ return data;
121
143
  };
122
-
123
144
  const formatPerson = (person) => {
124
- if (!person) {
125
- return '';
126
- }
127
- if (typeof person === 'string') {
128
- return person;
129
- }
130
- const name = person.name || '';
131
- const u = person.url || person.web;
132
- const url = u ? ` (${u})` : '';
133
- const e = person.email || person.mail;
134
- const email = e ? ` <${e}>` : '';
135
- return name + email + url;
145
+ if (!person) {
146
+ return '';
147
+ }
148
+ if (typeof person === 'string') {
149
+ return person;
150
+ }
151
+ const name = person.name || '';
152
+ const u = person.url || person.web;
153
+ const url = u ? ` (${u})` : '';
154
+ const e = person.email || person.mail;
155
+ const email = e ? ` <${e}>` : '';
156
+ return name + email + url;
136
157
  };
137
-
158
+ exports.formatPerson = formatPerson;
138
159
  const parsePerson = (person) => {
139
- if (typeof person !== 'string') {
140
- return person;
141
- }
142
- const name = person.match(/^([^(<]+)/);
143
- const url = person.match(/\(([^)]+)\)/);
144
- const email = person.match(/<([^>]+)>/);
145
- const obj = {};
146
- if (name && name[0].trim()) obj.name = name[0].trim();
147
- if (email) {
148
- obj.email = email[1];
149
- }
150
- if (url) {
151
- obj.url = url[1];
152
- }
153
- return obj;
160
+ if (typeof person !== 'string') {
161
+ return person;
162
+ }
163
+ const name = person.match(/^([^(<]+)/);
164
+ const url = person.match(/\(([^)]+)\)/);
165
+ const email = person.match(/<([^>]+)>/);
166
+ const obj = {};
167
+ if (name && name[0].trim())
168
+ obj.name = name[0].trim();
169
+ if (email) {
170
+ [, obj.email] = email;
171
+ }
172
+ if (url) {
173
+ [, obj.url] = url;
174
+ }
175
+ return obj;
154
176
  };
155
-
177
+ exports.parsePerson = parsePerson;
156
178
  const fixPerson = (data) => {
157
- updatePerson(data, formatPerson);
158
- updatePerson(data, parsePerson);
159
- return data;
179
+ updatePerson(data, formatPerson);
180
+ updatePerson(data, parsePerson);
181
+ return data;
160
182
  };
161
-
183
+ exports.fixPerson = fixPerson;
162
184
  const fixInterfaces = (meta, removeMerged = true) => {
163
- if (!Array.isArray(meta.interfaces)) {
164
- meta.interfaces = [];
165
- }
166
-
167
- if (meta.interfaces.length) {
168
- // Web interfaces should always use http protocol
169
- meta.interfaces.forEach((x) => {
170
- if (x.type === BLOCKLET_INTERFACE_TYPE_WEB) {
171
- x.protocol = 'http';
172
- }
185
+ if (!Array.isArray(meta.interfaces)) {
186
+ meta.interfaces = [];
187
+ }
188
+ if (meta.interfaces.length) {
189
+ // Web interfaces should always use http protocol
190
+ meta.interfaces.forEach((x) => {
191
+ if (x.type === BLOCKLET_INTERFACE_TYPE_WEB) {
192
+ x.protocol = 'http';
193
+ }
194
+ });
195
+ return meta;
196
+ }
197
+ const supportDynamicPathPrefix = (0, get_1.default)(meta, 'capabilities.dynamicPathPrefix', true);
198
+ const prefix = supportDynamicPathPrefix ? BLOCKLET_DYNAMIC_PATH_PREFIX : '/';
199
+ const addInterface = ({ type = 'web', name, path: _path = '/', // eslint-disable-line no-shadow
200
+ protocol = 'http', port = BLOCKLET_DEFAULT_PORT_NAME, }) => {
201
+ meta.interfaces.push({ type, name, path: _path, prefix, port, protocol });
202
+ };
203
+ [BLOCKLET_INTERFACE_PUBLIC].forEach((x) => {
204
+ if (meta[x]) {
205
+ addInterface({ name: x, path: meta[x] });
206
+ }
173
207
  });
208
+ if (Array.isArray(meta.exposeServices)) {
209
+ meta.exposeServices.forEach((x) => {
210
+ addInterface({
211
+ type: 'service',
212
+ name: x.protocol,
213
+ protocol: x.protocol,
214
+ port: {
215
+ internal: `BLOCKLET_${x.protocol}_PORT`.toUpperCase(),
216
+ external: x.port,
217
+ },
218
+ });
219
+ });
220
+ }
221
+ if (removeMerged) {
222
+ delete meta.publicUrl;
223
+ delete meta.adminUrl;
224
+ delete meta.configUrl;
225
+ delete meta.docUrl;
226
+ delete meta.exposeServices;
227
+ if (meta.capabilities) {
228
+ delete meta.capabilities.dynamicPathPrefix;
229
+ }
230
+ }
174
231
  return meta;
175
- }
176
-
177
- const supportDynamicPathPrefix = get(meta, 'capabilities.dynamicPathPrefix', true);
178
- const prefix = supportDynamicPathPrefix ? BLOCKLET_DYNAMIC_PATH_PREFIX : '/';
179
-
180
- const addInterface = ({
181
- type = 'web',
182
- name,
183
- path = '/', // eslint-disable-line no-shadow
184
- protocol = 'http',
185
- port = BLOCKLET_DEFAULT_PORT_NAME,
186
- }) => {
187
- meta.interfaces.push({ type, name, path, prefix, port, protocol });
188
- };
189
-
190
- [BLOCKLET_INTERFACE_PUBLIC].forEach((x) => {
191
- if (meta[x]) {
192
- addInterface({ name: x, path: meta[x] });
193
- }
194
- });
195
-
196
- if (Array.isArray(meta.exposeServices)) {
197
- meta.exposeServices.forEach((x) => {
198
- addInterface({
199
- type: 'service',
200
- name: x.protocol,
201
- protocol: x.protocol,
202
- port: {
203
- internal: `BLOCKLET_${x.protocol}_PORT`.toUpperCase(),
204
- external: x.port,
205
- },
206
- });
207
- });
208
- }
209
-
210
- if (removeMerged) {
211
- delete meta.publicUrl;
212
- delete meta.adminUrl;
213
- delete meta.configUrl;
214
- delete meta.docUrl;
215
- delete meta.exposeServices;
216
- if (meta.capabilities) {
217
- delete meta.capabilities.dynamicPathPrefix;
218
- }
219
- }
220
-
221
- return meta;
222
232
  };
223
-
224
- module.exports = {
225
- fixRequired,
226
- fixRepository,
227
- fixFiles,
228
- fixKeywords,
229
- fixPerson,
230
- fixTags,
231
- formatPerson,
232
- parsePerson,
233
- fixInterfaces,
234
- fixService: fixAndValidateService,
233
+ exports.fixInterfaces = fixInterfaces;
234
+ exports.default = {
235
+ fixRequired,
236
+ fixRepository,
237
+ fixFiles,
238
+ fixKeywords,
239
+ fixPerson,
240
+ fixTags,
241
+ formatPerson,
242
+ parsePerson,
243
+ fixInterfaces,
244
+ fixService: validate_1.fixAndValidateService,
235
245
  };
@@ -0,0 +1,5 @@
1
+ import { TBlockletMeta } from './types';
2
+ declare const getComponentProcessId: (component: {
3
+ meta: TBlockletMeta;
4
+ }, ancestors?: any[]) => string;
5
+ export = getComponentProcessId;
@@ -1,17 +1,16 @@
1
- const crypto = require('crypto');
2
-
3
- const md5 = (str) => crypto.createHash('md5').update(str).digest('hex');
4
-
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ const crypto_1 = __importDefault(require("crypto"));
6
+ const md5 = (str) => crypto_1.default.createHash('md5').update(str).digest('hex');
5
7
  const getComponentProcessId = (component, ancestors = []) => {
6
- const name = !ancestors.length
7
- ? component.meta.name
8
- : `${ancestors.map((x) => encodeURIComponent(x.meta.name)).join('/')}/${encodeURIComponent(component.meta.name)}`;
9
-
10
- if (name.length < 240) {
11
- return name;
12
- }
13
-
14
- return md5(name);
8
+ const name = !ancestors.length
9
+ ? component.meta.name
10
+ : `${ancestors.map((x) => encodeURIComponent(x.meta.name)).join('/')}/${encodeURIComponent(component.meta.name)}`;
11
+ if (name.length < 240) {
12
+ return name;
13
+ }
14
+ return md5(name);
15
15
  };
16
-
17
16
  module.exports = getComponentProcessId;
@@ -0,0 +1,3 @@
1
+ import { TEnvironment } from './types';
2
+ declare const hasReservedKey: (environments: TEnvironment[]) => boolean;
3
+ export = hasReservedKey;
@@ -1,14 +1,15 @@
1
- const { BLOCKLET_CONFIGURABLE_KEY } = require('./constants');
2
-
3
- const hasReservedKey = (environments) =>
4
- environments.some((x) => {
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ const constants_1 = __importDefault(require("./constants"));
6
+ const { BLOCKLET_CONFIGURABLE_KEY } = constants_1.default;
7
+ const hasReservedKey = (environments) => environments.some((x) => {
8
+ // @ts-ignore
5
9
  const key = (x.key || x.name || '').toString();
6
-
7
10
  if (key.startsWith('ABT_NODE_')) {
8
- return true;
11
+ return true;
9
12
  }
10
-
11
13
  return !!(key.startsWith('BLOCKLET_') && !BLOCKLET_CONFIGURABLE_KEY[key]);
12
- });
13
-
14
+ });
14
15
  module.exports = hasReservedKey;
package/lib/index.d.ts ADDED
@@ -0,0 +1,82 @@
1
+ /// <reference types="node" />
2
+ import constants from './constants';
3
+ import parse from './parse';
4
+ import toBlockletDid from './did';
5
+ import getBlockletWallet from './wallet';
6
+ import getBlockletInfo from './info';
7
+ import getBlockletEngine from './engine';
8
+ import { validateMeta, fixAndValidateService } from './validate';
9
+ import { formatPerson, parsePerson, fixPerson, fixInterfaces, fixService } from './fix';
10
+ import { list, select, update } from './file';
11
+ import verifyMultiSig from './verify-multi-sig';
12
+ export { constants };
13
+ export { list };
14
+ export { select };
15
+ export { update };
16
+ export { parse };
17
+ export { validateMeta };
18
+ export { fixAndValidateService };
19
+ export { formatPerson };
20
+ export { parsePerson };
21
+ export { fixPerson };
22
+ export { fixInterfaces };
23
+ export { fixService };
24
+ export { toBlockletDid };
25
+ export { getBlockletWallet };
26
+ export { getBlockletInfo };
27
+ export { getBlockletEngine };
28
+ export { verifyMultiSig };
29
+ declare const _default: {
30
+ constants: any;
31
+ list: any[];
32
+ select: (dir: string, { throwOnError }?: {
33
+ throwOnError?: boolean;
34
+ }) => string;
35
+ update: (file: string, meta: import("./types").TBlockletMeta, { fix }?: {
36
+ fix?: boolean;
37
+ }) => void;
38
+ parse: (dir: string, { ensureMain, ensureFiles, ensureDist, extraRawAttrs, serviceMetas, schemaOptions, fix, }?: {
39
+ ensureMain?: boolean;
40
+ ensureFiles?: boolean;
41
+ ensureDist?: boolean;
42
+ extraRawAttrs?: any;
43
+ serviceMetas?: any;
44
+ schemaOptions?: any;
45
+ enableDefaults?: boolean;
46
+ extraAttrSpec?: any;
47
+ fix?: boolean;
48
+ }) => import("./types").TBlockletMeta;
49
+ validateMeta: (meta: any, { ensureMain, ensureFiles, ensureDist, schemaOptions, }?: {
50
+ ensureMain?: boolean;
51
+ ensureFiles?: boolean;
52
+ ensureDist?: boolean;
53
+ schemaOptions?: any;
54
+ }) => import("./types").TBlockletMeta;
55
+ fixAndValidateService: (meta: import("./types").TBlockletMeta) => import("./types").TBlockletMeta;
56
+ formatPerson: (person: string | Record<string, any>) => string;
57
+ parsePerson: (person: string) => any;
58
+ fixPerson: (data: any) => any;
59
+ fixInterfaces: (meta: any, removeMerged?: boolean) => any;
60
+ fixService: (meta: import("./types").TBlockletMeta) => import("./types").TBlockletMeta;
61
+ toBlockletDid: {
62
+ (name: string | Buffer): string;
63
+ toExternalBlocklet(name: string, userDid: string, { didOnly, nameOnly }?: {
64
+ didOnly?: boolean;
65
+ nameOnly?: boolean;
66
+ }): string | Pick<import("./types").TBlockletMeta, "name" | "did">;
67
+ };
68
+ getBlockletWallet: (blockletDid: string, nodeSk?: string, type?: import("@arcblock/did").DIDType, index?: number) => import("@ocap/wallet").WalletObject<string>;
69
+ getBlockletInfo: (state: import("@abtnode/client").BlockletState, nodeSk?: string, { returnWallet }?: {
70
+ returnWallet?: boolean;
71
+ }) => {
72
+ did: string;
73
+ name: string;
74
+ description: string;
75
+ passportColor?: string;
76
+ appUrl: string;
77
+ wallet?: import("@ocap/wallet").WalletObject<string>;
78
+ };
79
+ getBlockletEngine: (meta: import("./types").TBlockletMeta) => import("./types").TEngine;
80
+ verifyMultiSig: (blockletMeta: import("./types").TBlockletMeta) => boolean;
81
+ };
82
+ export default _default;