@blocklet/meta 1.16.28-beta-bfbab430 → 1.16.28-beta-641c9f13
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/engine.d.ts +0 -1
- package/lib/engine.js +1 -3
- package/lib/nft-templates.js +3 -6
- package/lib/parse-navigation-from-blocklet.js +2 -2
- package/lib/payment/v1.js +2 -5
- package/lib/payment/v2.js +3 -3
- package/lib/types/schema.d.ts +1 -1
- package/lib/util-meta.js +2 -2
- package/lib/util.d.ts +2 -3
- package/lib/util.js +4 -6
- package/package.json +6 -6
package/lib/engine.d.ts
CHANGED
|
@@ -6,6 +6,5 @@ import { TEngine, TBlockletMeta } from './types';
|
|
|
6
6
|
export declare const getBlockletEngine: (meta: any) => TEngine;
|
|
7
7
|
export declare const isGatewayBlocklet: (meta: TBlockletMeta) => boolean;
|
|
8
8
|
export declare const isPackBlocklet: (meta: TBlockletMeta) => boolean;
|
|
9
|
-
export declare const isEngineBlocklet: (meta: TBlockletMeta) => boolean;
|
|
10
9
|
export declare const hasStartEngine: (meta: any) => boolean;
|
|
11
10
|
export declare const hasMountPoint: (meta: any) => boolean;
|
package/lib/engine.js
CHANGED
|
@@ -3,7 +3,7 @@ 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.hasMountPoint = exports.hasStartEngine = exports.
|
|
6
|
+
exports.hasMountPoint = exports.hasStartEngine = exports.isPackBlocklet = exports.isGatewayBlocklet = exports.getBlockletEngine = void 0;
|
|
7
7
|
const os_1 = __importDefault(require("os"));
|
|
8
8
|
const constant_1 = require("@blocklet/constant");
|
|
9
9
|
/**
|
|
@@ -36,8 +36,6 @@ const isGatewayBlocklet = (meta) => meta?.group === constant_1.BlockletGroup.gat
|
|
|
36
36
|
exports.isGatewayBlocklet = isGatewayBlocklet;
|
|
37
37
|
const isPackBlocklet = (meta) => meta?.group === constant_1.BlockletGroup.pack;
|
|
38
38
|
exports.isPackBlocklet = isPackBlocklet;
|
|
39
|
-
const isEngineBlocklet = (meta) => meta?.group === constant_1.BlockletGroup.engine;
|
|
40
|
-
exports.isEngineBlocklet = isEngineBlocklet;
|
|
41
39
|
const hasStartEngine = (meta) => !!meta?.main || (0, exports.getBlockletEngine)((meta || {})).interpreter === 'blocklet';
|
|
42
40
|
exports.hasStartEngine = hasStartEngine;
|
|
43
41
|
const hasMountPoint = (meta) => ((0, exports.hasStartEngine)(meta) || (meta?.interfaces || []).find((x) => x.type === constant_1.BLOCKLET_INTERFACE_TYPE_WEB)) &&
|
package/lib/nft-templates.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.getBlockletPurchaseTemplate = void 0;
|
|
7
|
-
const
|
|
4
|
+
const ufo_1 = require("ufo");
|
|
8
5
|
const getBlockletPurchaseTemplate = (serviceUrl = 'https://registry.arcblock.io') => ({
|
|
9
6
|
type: 'vc',
|
|
10
7
|
value: {
|
|
@@ -30,11 +27,11 @@ const getBlockletPurchaseTemplate = (serviceUrl = 'https://registry.arcblock.io'
|
|
|
30
27
|
},
|
|
31
28
|
display: {
|
|
32
29
|
type: 'url',
|
|
33
|
-
content: (0,
|
|
30
|
+
content: (0, ufo_1.joinURL)(serviceUrl, '/api/nft/display'), // accept asset-did in query param
|
|
34
31
|
},
|
|
35
32
|
},
|
|
36
33
|
credentialStatus: {
|
|
37
|
-
id: (0,
|
|
34
|
+
id: (0, ufo_1.joinURL)(serviceUrl, '/api/nft/status'),
|
|
38
35
|
type: 'NFTStatusList2021',
|
|
39
36
|
scope: 'public',
|
|
40
37
|
},
|
|
@@ -10,7 +10,7 @@ const pick_1 = __importDefault(require("lodash/pick"));
|
|
|
10
10
|
const isNil_1 = __importDefault(require("lodash/isNil"));
|
|
11
11
|
const omit_1 = __importDefault(require("lodash/omit"));
|
|
12
12
|
const cloneDeep_1 = __importDefault(require("lodash/cloneDeep"));
|
|
13
|
-
const
|
|
13
|
+
const ufo_1 = require("ufo");
|
|
14
14
|
const path_1 = __importDefault(require("path"));
|
|
15
15
|
const is_absolute_url_1 = __importDefault(require("is-absolute-url"));
|
|
16
16
|
const lodash_1 = require("lodash");
|
|
@@ -214,7 +214,7 @@ function parseBlockletNavigationList(blocklet = {}) {
|
|
|
214
214
|
const childBase = child.mountPoint;
|
|
215
215
|
const mergeName = [parentName, currentName, childName].filter(Boolean).join('.');
|
|
216
216
|
const childNavigation = child.meta.navigation || [];
|
|
217
|
-
const mergeBase = (0,
|
|
217
|
+
const mergeBase = (0, ufo_1.joinURL)(parentBase, currentBase, childBase);
|
|
218
218
|
if (child.meta?.capabilities?.navigation !== false) {
|
|
219
219
|
components.push({
|
|
220
220
|
did: child.meta.did,
|
package/lib/payment/v1.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.createNftFactoryItx = exports.createShareContract = void 0;
|
|
7
|
-
const
|
|
4
|
+
const ufo_1 = require("ufo");
|
|
8
5
|
const util_1 = require("@ocap/util");
|
|
9
6
|
const asset_1 = require("@ocap/asset");
|
|
10
7
|
const did_util_1 = require("@arcblock/did-util");
|
|
@@ -60,7 +57,7 @@ const createNftFactoryItx = ({ meta, tokens, shares, issuers, serviceUrl, }) =>
|
|
|
60
57
|
type: 'json',
|
|
61
58
|
value: {
|
|
62
59
|
did: meta.did,
|
|
63
|
-
url: (0,
|
|
60
|
+
url: (0, ufo_1.joinURL)(serviceUrl, `/blocklet/${meta.did}`),
|
|
64
61
|
name: meta.name,
|
|
65
62
|
},
|
|
66
63
|
},
|
package/lib/payment/v2.js
CHANGED
|
@@ -30,7 +30,7 @@ exports.version = exports.checkFreeBlocklet = exports.verifyNftFactory = exports
|
|
|
30
30
|
/* eslint-disable no-await-in-loop */
|
|
31
31
|
const crypto_1 = __importDefault(require("crypto"));
|
|
32
32
|
const debug_1 = __importDefault(require("debug"));
|
|
33
|
-
const
|
|
33
|
+
const ufo_1 = require("ufo");
|
|
34
34
|
const json_stable_stringify_1 = __importDefault(require("json-stable-stringify"));
|
|
35
35
|
const get_1 = __importDefault(require("lodash/get"));
|
|
36
36
|
const pick_1 = __importDefault(require("lodash/pick"));
|
|
@@ -60,7 +60,7 @@ const safeMul = (a, b) => Number((0, util_1.fromUnitToToken)((0, util_1.fromToke
|
|
|
60
60
|
.div(defaultDecimalsBN)));
|
|
61
61
|
const md5 = (str) => crypto_1.default.createHash('md5').update(str).digest('hex');
|
|
62
62
|
const getStoreInfo = async (url) => {
|
|
63
|
-
const storeMetaUrl = (0,
|
|
63
|
+
const storeMetaUrl = (0, ufo_1.joinURL)(new URL(url).origin, BLOCKLET_STORE_META_PATH);
|
|
64
64
|
const { data: info } = await axios_1.default.get(storeMetaUrl, { timeout: 8000 });
|
|
65
65
|
return info;
|
|
66
66
|
};
|
|
@@ -328,7 +328,7 @@ const innerCreateNftFactoryItx = ({ meta, issuers, serviceUrl, storeSignatures,
|
|
|
328
328
|
type: 'json',
|
|
329
329
|
value: {
|
|
330
330
|
did: meta.did,
|
|
331
|
-
url: (0,
|
|
331
|
+
url: (0, ufo_1.joinURL)(serviceUrl, `/blocklet/${meta.did}`),
|
|
332
332
|
name: meta.name,
|
|
333
333
|
version: meta.version,
|
|
334
334
|
payment: {
|
package/lib/types/schema.d.ts
CHANGED
|
@@ -47,7 +47,7 @@ export interface TBlockletMeta {
|
|
|
47
47
|
environments?: TEnvironment[];
|
|
48
48
|
files?: string[];
|
|
49
49
|
gitHash?: string;
|
|
50
|
-
group?: 'dapp' | 'static' | 'gateway' | 'pack'
|
|
50
|
+
group?: 'dapp' | 'static' | 'gateway' | 'pack';
|
|
51
51
|
homepage?: string;
|
|
52
52
|
htmlAst?: any;
|
|
53
53
|
interfaces?: TInterface[];
|
package/lib/util-meta.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.getSourceUrlsFromConfig = exports.getBlockletMetaFromUrls = exports.getB
|
|
|
7
7
|
const url_1 = require("url");
|
|
8
8
|
const fs_1 = __importDefault(require("fs"));
|
|
9
9
|
const promise_any_1 = __importDefault(require("promise.any"));
|
|
10
|
-
const
|
|
10
|
+
const ufo_1 = require("ufo");
|
|
11
11
|
const constant_1 = __importDefault(require("@abtnode/constant"));
|
|
12
12
|
const axios_1 = __importDefault(require("./axios"));
|
|
13
13
|
const did_1 = __importDefault(require("./did"));
|
|
@@ -136,7 +136,7 @@ const getSourceUrlsFromConfig = (config) => {
|
|
|
136
136
|
// FIXME: @linchen the format or version is semverRange, blocklet store should support it
|
|
137
137
|
return [store]
|
|
138
138
|
.flat()
|
|
139
|
-
.map((x) => (0,
|
|
139
|
+
.map((x) => (0, ufo_1.joinURL)(x, BLOCKLET_STORE_API_BLOCKLET_PREFIX, (0, did_1.default)(name), !version || version === 'latest' ? '' : version, 'blocklet.json'));
|
|
140
140
|
}
|
|
141
141
|
if (config.resolved) {
|
|
142
142
|
return [config.resolved];
|
package/lib/util.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { BlockletState, ComponentState } from '@abtnode/client';
|
|
2
2
|
import type { Request } from 'express';
|
|
3
|
-
import { hasStartEngine,
|
|
3
|
+
import { hasStartEngine, isGatewayBlocklet, isPackBlocklet } from './engine';
|
|
4
4
|
import type { TBlockletMeta, TEnvironment } from './types';
|
|
5
5
|
type TConfig = TEnvironment & {
|
|
6
6
|
key: string;
|
|
@@ -151,7 +151,7 @@ declare const hasResourceType: (component: ComponentState, { type, did }?: {
|
|
|
151
151
|
type: string;
|
|
152
152
|
did: string;
|
|
153
153
|
}) => boolean;
|
|
154
|
-
export { isFreeBlocklet, isFreeComponent, forEachBlocklet, forEachBlockletSync, forEachChild, forEachChildSync, forEachComponentV2, forEachComponentV2Sync, isDeletableBlocklet, getSharedConfigObj, getAppMissingConfigs, getComponentMissingConfigs, isEnvShareableToClient, isEnvShareable, wipeSensitiveData, hasRunnableComponent, getAppName, getAppName as getDisplayName, getAppDescription, fixBlockletStatus, findWebInterface, findWebInterfacePort, findServiceFromMeta, getWhoCanAccess, getComponentWhoCanAccess, replaceSlotToIp, getComponentId, getComponentName, getComponentBundleId, findComponent, findComponentById, findComponentV2, findComponentByIdV2, filterComponentsV2, getParentComponentName, getConnectAppUrl, getChainInfo, getBlockletChainInfo, isExternalBlocklet, isPreferenceKey, getRolesFromAuthConfig, getBlockletAppIdList, getBlockletServices, isInProgress, isBeforeInstalled, isRunning, isAccessible, isGatewayBlocklet,
|
|
154
|
+
export { isFreeBlocklet, isFreeComponent, forEachBlocklet, forEachBlockletSync, forEachChild, forEachChildSync, forEachComponentV2, forEachComponentV2Sync, isDeletableBlocklet, getSharedConfigObj, getAppMissingConfigs, getComponentMissingConfigs, isEnvShareableToClient, isEnvShareable, wipeSensitiveData, hasRunnableComponent, getAppName, getAppName as getDisplayName, getAppDescription, fixBlockletStatus, findWebInterface, findWebInterfacePort, findServiceFromMeta, getWhoCanAccess, getComponentWhoCanAccess, replaceSlotToIp, getComponentId, getComponentName, getComponentBundleId, findComponent, findComponentById, findComponentV2, findComponentByIdV2, filterComponentsV2, getParentComponentName, getConnectAppUrl, getChainInfo, getBlockletChainInfo, isExternalBlocklet, isPreferenceKey, getRolesFromAuthConfig, getBlockletAppIdList, getBlockletServices, isInProgress, isBeforeInstalled, isRunning, isAccessible, isGatewayBlocklet, isPackBlocklet, hasStartEngine, hasResourceType, };
|
|
155
155
|
declare const _default: {
|
|
156
156
|
isFreeBlocklet: (meta: TBlockletMeta) => boolean;
|
|
157
157
|
isFreeComponent: (meta: TBlockletMeta) => boolean;
|
|
@@ -260,7 +260,6 @@ declare const _default: {
|
|
|
260
260
|
isRunning: (status: string | number) => boolean;
|
|
261
261
|
isAccessible: (status: string | number) => boolean;
|
|
262
262
|
isGatewayBlocklet: (meta: TBlockletMeta) => boolean;
|
|
263
|
-
isEngineBlocklet: (meta: TBlockletMeta) => boolean;
|
|
264
263
|
isPackBlocklet: (meta: TBlockletMeta) => boolean;
|
|
265
264
|
hasStartEngine: (meta: any) => boolean;
|
|
266
265
|
hasResourceType: (component: ComponentState, { type, did }?: {
|
package/lib/util.js
CHANGED
|
@@ -3,18 +3,17 @@ 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.
|
|
7
|
-
exports.hasResourceType = exports.hasStartEngine =
|
|
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;
|
|
8
8
|
/* eslint-disable no-await-in-loop */
|
|
9
9
|
const get_1 = __importDefault(require("lodash/get"));
|
|
10
10
|
const uniq_1 = __importDefault(require("lodash/uniq"));
|
|
11
|
-
const
|
|
11
|
+
const ufo_1 = require("ufo");
|
|
12
12
|
const p_limit_1 = __importDefault(require("p-limit"));
|
|
13
13
|
const constant_1 = __importDefault(require("@abtnode/constant"));
|
|
14
14
|
const constant_2 = require("@blocklet/constant");
|
|
15
15
|
const engine_1 = require("./engine");
|
|
16
16
|
Object.defineProperty(exports, "hasStartEngine", { enumerable: true, get: function () { return engine_1.hasStartEngine; } });
|
|
17
|
-
Object.defineProperty(exports, "isEngineBlocklet", { enumerable: true, get: function () { return engine_1.isEngineBlocklet; } });
|
|
18
17
|
Object.defineProperty(exports, "isGatewayBlocklet", { enumerable: true, get: function () { return engine_1.isGatewayBlocklet; } });
|
|
19
18
|
Object.defineProperty(exports, "isPackBlocklet", { enumerable: true, get: function () { return engine_1.isPackBlocklet; } });
|
|
20
19
|
const { NODE_SERVICES, SLOT_FOR_IP_DNS_SITE, WHO_CAN_ACCESS, WHO_CAN_ACCESS_PREFIX_ROLES } = constant_1.default;
|
|
@@ -592,7 +591,7 @@ const getConnectAppUrl = ({ request, baseUrl }) => {
|
|
|
592
591
|
// Child blocklets should set appInfo.link to exactly the same path as the root blocklet
|
|
593
592
|
let appUrl = baseUrl;
|
|
594
593
|
if (blockletDid !== blockletRealDid && pathPrefix !== groupPathPrefix) {
|
|
595
|
-
appUrl = (0,
|
|
594
|
+
appUrl = (0, ufo_1.joinURL)(appUrl, '/').replace(pathPrefix, groupPathPrefix);
|
|
596
595
|
}
|
|
597
596
|
return appUrl;
|
|
598
597
|
};
|
|
@@ -769,7 +768,6 @@ exports.default = {
|
|
|
769
768
|
isRunning,
|
|
770
769
|
isAccessible,
|
|
771
770
|
isGatewayBlocklet: engine_1.isGatewayBlocklet,
|
|
772
|
-
isEngineBlocklet: engine_1.isEngineBlocklet,
|
|
773
771
|
isPackBlocklet: engine_1.isPackBlocklet,
|
|
774
772
|
hasStartEngine: engine_1.hasStartEngine,
|
|
775
773
|
hasResourceType,
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.16.28-beta-
|
|
6
|
+
"version": "1.16.28-beta-641c9f13",
|
|
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.28-beta-
|
|
28
|
+
"@abtnode/constant": "1.16.28-beta-641c9f13",
|
|
29
29
|
"@arcblock/did": "1.18.123",
|
|
30
30
|
"@arcblock/did-ext": "1.18.123",
|
|
31
31
|
"@arcblock/did-util": "1.18.123",
|
|
32
32
|
"@arcblock/jwt": "1.18.123",
|
|
33
|
-
"@blocklet/constant": "1.16.28-beta-
|
|
33
|
+
"@blocklet/constant": "1.16.28-beta-641c9f13",
|
|
34
34
|
"@ocap/asset": "1.18.123",
|
|
35
35
|
"@ocap/mcrypto": "1.18.123",
|
|
36
36
|
"@ocap/types": "1.18.123",
|
|
37
37
|
"@ocap/util": "1.18.123",
|
|
38
38
|
"@ocap/wallet": "1.18.123",
|
|
39
39
|
"ajv": "^8.11.0",
|
|
40
|
-
"axios": "^
|
|
40
|
+
"axios": "^1.7.2",
|
|
41
41
|
"cjk-length": "^1.0.0",
|
|
42
42
|
"debug": "^4.3.4",
|
|
43
43
|
"fs-extra": "^11.2.0",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"p-limit": "^3.1.0",
|
|
55
55
|
"promise.any": "^2.0.4",
|
|
56
56
|
"slugify": "^1.6.5",
|
|
57
|
-
"
|
|
57
|
+
"ufo": "^1.5.3",
|
|
58
58
|
"utility-types": "^3.10.0",
|
|
59
59
|
"validate-npm-package-name": "^3.0.0"
|
|
60
60
|
},
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"ts-node": "^10.9.1",
|
|
80
80
|
"typescript": "^5.0.4"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "eb1fa63e4ed26fe5ba230845a318faa29408138b"
|
|
83
83
|
}
|