@openclaw/feishu 2026.7.2-beta.2 → 2026.7.2-beta.4
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/dist/api.js +4 -4
- package/dist/{app-registration-BzkyrVZu.js → app-registration-cN1bVV6s.js} +5 -5
- package/dist/{channel-X30GQVwc.js → channel-DB1x6UJX.js} +33 -24
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.runtime-By2uqa3Q.js → channel.runtime-B5yAAvbT.js} +102 -17
- package/dist/{client-87BmeMpj.js → client-Dee7cKsS.js} +62 -1
- package/dist/{doctor-contract-DXH5hux1.js → doctor-contract-Cw5sdjOm.js} +29 -41
- package/dist/doctor-contract-api.js +1 -1
- package/dist/{drive-B4E8OXZ0.js → drive-_zrcOxzS.js} +2 -2
- package/dist/{send-DrWM_Ilf.js → media-CRJunSRr.js} +1075 -1017
- package/dist/{monitor-CHl0bWzb.js → monitor-8CLu6myv.js} +5 -4
- package/dist/{monitor.account-BSRV2hIF.js → monitor.account-CkYj45PC.js} +2113 -809
- package/dist/monitor.startup-CSUPT_U1.js +143 -0
- package/dist/{probe-BgboTHIn.js → probe-Za1kgUvx.js} +70 -10
- package/dist/{secret-contract-DnlMcrn5.js → secret-contract-BCpDLdg9.js} +17 -26
- package/dist/secret-contract-api.js +1 -1
- package/dist/{send-result-DsqTk27v.js → send-result-DfE5Fhz6.js} +22 -11
- package/dist/setup-api.js +1 -1
- package/node_modules/@larksuiteoapi/node-sdk/README.md +13 -0
- package/node_modules/@larksuiteoapi/node-sdk/README.zh.md +12 -0
- package/node_modules/@larksuiteoapi/node-sdk/es/index.js +8950 -3084
- package/node_modules/@larksuiteoapi/node-sdk/lib/index.js +8951 -3083
- package/node_modules/@larksuiteoapi/node-sdk/package.json +1 -1
- package/node_modules/@larksuiteoapi/node-sdk/types/index.d.ts +12522 -698
- package/node_modules/@protobufjs/utf8/CHANGELOG.md +8 -0
- package/node_modules/@protobufjs/utf8/index.js +29 -18
- package/node_modules/@protobufjs/utf8/package.json +2 -2
- package/node_modules/@protobufjs/utf8/tests/index.js +5 -0
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/fs/promises.d.ts +16 -6
- package/node_modules/@types/node/package.json +2 -2
- package/node_modules/agent-base/README.md +145 -0
- package/node_modules/agent-base/dist/src/index.d.ts +78 -0
- package/node_modules/agent-base/dist/src/index.js +203 -0
- package/node_modules/agent-base/dist/src/index.js.map +1 -0
- package/node_modules/agent-base/dist/src/promisify.d.ts +4 -0
- package/node_modules/agent-base/dist/src/promisify.js +18 -0
- package/node_modules/agent-base/dist/src/promisify.js.map +1 -0
- package/node_modules/agent-base/package.json +64 -0
- package/node_modules/agent-base/src/index.ts +345 -0
- package/node_modules/agent-base/src/promisify.ts +33 -0
- package/node_modules/axios/CHANGELOG.md +197 -1
- package/node_modules/axios/README.md +424 -256
- package/node_modules/axios/dist/axios.js +589 -204
- package/node_modules/axios/dist/axios.min.js +3 -3
- package/node_modules/axios/dist/axios.min.js.map +1 -1
- package/node_modules/axios/dist/browser/axios.cjs +630 -185
- package/node_modules/axios/dist/esm/axios.js +630 -185
- package/node_modules/axios/dist/esm/axios.min.js +2 -2
- package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
- package/node_modules/axios/dist/node/axios.cjs +949 -301
- package/node_modules/axios/index.d.cts +28 -5
- package/node_modules/axios/index.d.ts +24 -3
- package/node_modules/axios/lib/adapters/adapters.js +1 -1
- package/node_modules/axios/lib/adapters/fetch.js +223 -49
- package/node_modules/axios/lib/adapters/http.js +408 -193
- package/node_modules/axios/lib/adapters/xhr.js +3 -1
- package/node_modules/axios/lib/core/Axios.js +4 -2
- package/node_modules/axios/lib/core/AxiosError.js +13 -1
- package/node_modules/axios/lib/core/AxiosHeaders.js +13 -42
- package/node_modules/axios/lib/core/buildFullPath.js +29 -1
- package/node_modules/axios/lib/core/mergeConfig.js +35 -0
- package/node_modules/axios/lib/defaults/transitional.js +2 -0
- package/node_modules/axios/lib/env/data.js +1 -1
- package/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +1 -3
- package/node_modules/axios/lib/helpers/Http2Sessions.js +119 -0
- package/node_modules/axios/lib/helpers/buildURL.js +7 -4
- package/node_modules/axios/lib/helpers/composeSignals.js +48 -47
- package/node_modules/axios/lib/helpers/cookies.js +5 -1
- package/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +16 -11
- package/node_modules/axios/lib/helpers/formDataToJSON.js +26 -4
- package/node_modules/axios/lib/helpers/formDataToStream.js +2 -2
- package/node_modules/axios/lib/helpers/fromDataURI.js +20 -5
- package/node_modules/axios/lib/helpers/progressEventReducer.js +3 -0
- package/node_modules/axios/lib/helpers/resolveConfig.js +26 -13
- package/node_modules/axios/lib/helpers/sanitizeHeaderValue.js +60 -0
- package/node_modules/axios/lib/helpers/shouldBypassProxy.js +33 -1
- package/node_modules/axios/lib/helpers/toFormData.js +48 -12
- package/node_modules/axios/lib/helpers/validator.js +1 -1
- package/node_modules/axios/lib/utils.js +105 -19
- package/node_modules/axios/package.json +31 -13
- package/node_modules/https-proxy-agent/README.md +137 -0
- package/node_modules/https-proxy-agent/dist/agent.d.ts +30 -0
- package/node_modules/https-proxy-agent/dist/agent.js +177 -0
- package/node_modules/https-proxy-agent/dist/agent.js.map +1 -0
- package/node_modules/https-proxy-agent/dist/index.d.ts +23 -0
- package/node_modules/https-proxy-agent/dist/index.js +14 -0
- package/node_modules/https-proxy-agent/dist/index.js.map +1 -0
- package/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts +7 -0
- package/node_modules/https-proxy-agent/dist/parse-proxy-response.js +66 -0
- package/node_modules/https-proxy-agent/dist/parse-proxy-response.js.map +1 -0
- package/node_modules/https-proxy-agent/package.json +56 -0
- package/node_modules/protobufjs/dist/light/protobuf.js +145 -188
- package/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/dist/minimal/protobuf.js +33 -76
- package/node_modules/protobufjs/dist/minimal/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/dist/protobuf.js +168 -208
- package/node_modules/protobufjs/dist/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/index.d.ts +0 -8
- package/node_modules/protobufjs/package.json +2 -3
- package/node_modules/protobufjs/src/parse.js +3 -0
- package/node_modules/protobufjs/src/util/minimal.js +0 -3
- package/node_modules/qs/CHANGELOG.md +11 -0
- package/node_modules/qs/dist/qs.js +17 -17
- package/node_modules/qs/lib/parse.js +19 -8
- package/node_modules/qs/lib/utils.js +47 -8
- package/node_modules/qs/package.json +6 -5
- package/node_modules/qs/test/parse.js +230 -0
- package/node_modules/qs/test/utils.js +194 -0
- package/node_modules/typebox/build/compile/validator.d.mts +1 -4
- package/node_modules/typebox/build/guard/guard.d.mts +1 -1
- package/node_modules/typebox/build/guard/guard.mjs +5 -2
- package/node_modules/typebox/build/guard/string.mjs +16 -4
- package/node_modules/typebox/build/schema/engine/_functions.mjs +34 -15
- package/node_modules/typebox/build/type/action/readonly_object.d.mts +5 -0
- package/node_modules/typebox/build/type/action/readonly_object.mjs +8 -0
- package/node_modules/typebox/build/typebox.d.mts +1 -1
- package/node_modules/typebox/build/typebox.mjs +1 -1
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/typebox/readme.md +29 -32
- package/node_modules/ws/lib/receiver.js +15 -32
- package/node_modules/ws/lib/websocket-server.js +4 -4
- package/node_modules/ws/lib/websocket.js +4 -4
- package/node_modules/ws/package.json +5 -1
- package/npm-shrinkwrap.json +58 -38
- package/openclaw.plugin.json +26 -10
- package/package.json +20 -7
- package/dist/monitor.startup-Cy8NPGAX.js +0 -43
- package/node_modules/@protobufjs/inquire/CHANGELOG.md +0 -8
- package/node_modules/@protobufjs/inquire/LICENSE +0 -26
- package/node_modules/@protobufjs/inquire/README.md +0 -13
- package/node_modules/@protobufjs/inquire/index.d.ts +0 -10
- package/node_modules/@protobufjs/inquire/index.js +0 -38
- package/node_modules/@protobufjs/inquire/package.json +0 -21
- package/node_modules/@protobufjs/inquire/tests/data/array.js +0 -1
- package/node_modules/@protobufjs/inquire/tests/data/emptyArray.js +0 -1
- package/node_modules/@protobufjs/inquire/tests/data/emptyObject.js +0 -1
- package/node_modules/@protobufjs/inquire/tests/data/object.js +0 -1
- package/node_modules/@protobufjs/inquire/tests/index.js +0 -20
- package/node_modules/axios/dist/axios.js.map +0 -1
- package/node_modules/axios/dist/browser/axios.cjs.map +0 -1
- package/node_modules/axios/dist/esm/axios.js.map +0 -1
- package/node_modules/axios/dist/node/axios.cjs.map +0 -1
package/openclaw.plugin.json
CHANGED
|
@@ -294,14 +294,6 @@
|
|
|
294
294
|
]
|
|
295
295
|
}
|
|
296
296
|
},
|
|
297
|
-
"channelEnvVars": {
|
|
298
|
-
"feishu": [
|
|
299
|
-
"FEISHU_APP_ID",
|
|
300
|
-
"FEISHU_APP_SECRET",
|
|
301
|
-
"FEISHU_VERIFICATION_TOKEN",
|
|
302
|
-
"FEISHU_ENCRYPT_KEY"
|
|
303
|
-
]
|
|
304
|
-
},
|
|
305
297
|
"skills": [
|
|
306
298
|
"./skills"
|
|
307
299
|
],
|
|
@@ -455,6 +447,12 @@
|
|
|
455
447
|
"enabled"
|
|
456
448
|
]
|
|
457
449
|
},
|
|
450
|
+
"allowBots": {
|
|
451
|
+
"type": "boolean"
|
|
452
|
+
},
|
|
453
|
+
"vcAutoJoin": {
|
|
454
|
+
"type": "boolean"
|
|
455
|
+
},
|
|
458
456
|
"typingIndicator": {
|
|
459
457
|
"type": "boolean"
|
|
460
458
|
}
|
|
@@ -520,6 +518,12 @@
|
|
|
520
518
|
"enabled"
|
|
521
519
|
]
|
|
522
520
|
},
|
|
521
|
+
"allowBots": {
|
|
522
|
+
"type": "boolean"
|
|
523
|
+
},
|
|
524
|
+
"vcAutoJoin": {
|
|
525
|
+
"type": "boolean"
|
|
526
|
+
},
|
|
523
527
|
"typingIndicator": {
|
|
524
528
|
"type": "boolean"
|
|
525
529
|
},
|
|
@@ -1039,7 +1043,7 @@
|
|
|
1039
1043
|
"exclusiveMinimum": 0,
|
|
1040
1044
|
"maximum": 300000
|
|
1041
1045
|
},
|
|
1042
|
-
"
|
|
1046
|
+
"heartbeatVisibility": {
|
|
1043
1047
|
"type": "object",
|
|
1044
1048
|
"properties": {
|
|
1045
1049
|
"visibility": {
|
|
@@ -1178,6 +1182,12 @@
|
|
|
1178
1182
|
"default": true,
|
|
1179
1183
|
"type": "boolean"
|
|
1180
1184
|
},
|
|
1185
|
+
"allowBots": {
|
|
1186
|
+
"type": "boolean"
|
|
1187
|
+
},
|
|
1188
|
+
"vcAutoJoin": {
|
|
1189
|
+
"type": "boolean"
|
|
1190
|
+
},
|
|
1181
1191
|
"tts": {
|
|
1182
1192
|
"type": "object",
|
|
1183
1193
|
"properties": {
|
|
@@ -1800,7 +1810,7 @@
|
|
|
1800
1810
|
"exclusiveMinimum": 0,
|
|
1801
1811
|
"maximum": 300000
|
|
1802
1812
|
},
|
|
1803
|
-
"
|
|
1813
|
+
"heartbeatVisibility": {
|
|
1804
1814
|
"type": "object",
|
|
1805
1815
|
"properties": {
|
|
1806
1816
|
"visibility": {
|
|
@@ -1936,6 +1946,12 @@
|
|
|
1936
1946
|
"resolveSenderNames": {
|
|
1937
1947
|
"type": "boolean"
|
|
1938
1948
|
},
|
|
1949
|
+
"allowBots": {
|
|
1950
|
+
"type": "boolean"
|
|
1951
|
+
},
|
|
1952
|
+
"vcAutoJoin": {
|
|
1953
|
+
"type": "boolean"
|
|
1954
|
+
},
|
|
1939
1955
|
"tts": {
|
|
1940
1956
|
"type": "object",
|
|
1941
1957
|
"properties": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/feishu",
|
|
3
|
-
"version": "2026.7.2-beta.
|
|
3
|
+
"version": "2026.7.2-beta.4",
|
|
4
4
|
"description": "OpenClaw Feishu/Lark channel plugin for chats and workplace tools (community maintained by @m1heng).",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -8,15 +8,15 @@
|
|
|
8
8
|
},
|
|
9
9
|
"type": "module",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@larksuiteoapi/node-sdk": "1.
|
|
11
|
+
"@larksuiteoapi/node-sdk": "1.71.1",
|
|
12
12
|
"mdast-util-from-markdown": "2.0.3",
|
|
13
13
|
"mdast-util-gfm-table": "2.0.0",
|
|
14
14
|
"micromark-extension-gfm-table": "2.1.1",
|
|
15
|
-
"typebox": "1.3.
|
|
15
|
+
"typebox": "1.3.6",
|
|
16
16
|
"zod": "4.4.3"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"openclaw": ">=2026.7.2-beta.
|
|
19
|
+
"openclaw": ">=2026.7.2-beta.4"
|
|
20
20
|
},
|
|
21
21
|
"peerDependenciesMeta": {
|
|
22
22
|
"openclaw": {
|
|
@@ -30,6 +30,16 @@
|
|
|
30
30
|
"setupEntry": "./dist/setup-entry.js",
|
|
31
31
|
"channel": {
|
|
32
32
|
"id": "feishu",
|
|
33
|
+
"configuredState": {
|
|
34
|
+
"env": {
|
|
35
|
+
"anyOf": [
|
|
36
|
+
"FEISHU_APP_ID",
|
|
37
|
+
"FEISHU_APP_SECRET",
|
|
38
|
+
"FEISHU_VERIFICATION_TOKEN",
|
|
39
|
+
"FEISHU_ENCRYPT_KEY"
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
},
|
|
33
43
|
"label": "Feishu",
|
|
34
44
|
"selectionLabel": "Feishu/Lark (飞书)",
|
|
35
45
|
"docsPath": "/channels/feishu",
|
|
@@ -39,7 +49,10 @@
|
|
|
39
49
|
"lark"
|
|
40
50
|
],
|
|
41
51
|
"order": 35,
|
|
42
|
-
"quickstartAllowFrom": true
|
|
52
|
+
"quickstartAllowFrom": true,
|
|
53
|
+
"setup": {
|
|
54
|
+
"fields": []
|
|
55
|
+
}
|
|
43
56
|
},
|
|
44
57
|
"install": {
|
|
45
58
|
"npmSpec": "@openclaw/feishu",
|
|
@@ -47,10 +60,10 @@
|
|
|
47
60
|
"minHostVersion": ">=2026.5.29"
|
|
48
61
|
},
|
|
49
62
|
"compat": {
|
|
50
|
-
"pluginApi": ">=2026.7.2-beta.
|
|
63
|
+
"pluginApi": ">=2026.7.2-beta.4"
|
|
51
64
|
},
|
|
52
65
|
"build": {
|
|
53
|
-
"openclawVersion": "2026.7.2-beta.
|
|
66
|
+
"openclawVersion": "2026.7.2-beta.4"
|
|
54
67
|
},
|
|
55
68
|
"release": {
|
|
56
69
|
"publishToClawHub": true,
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { t as probeFeishu } from "./probe-BgboTHIn.js";
|
|
2
|
-
import { parseStrictPositiveInteger } from "openclaw/plugin-sdk/number-runtime";
|
|
3
|
-
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
|
-
//#region extensions/feishu/src/monitor-startup-timeout.ts
|
|
5
|
-
const FEISHU_STARTUP_BOT_INFO_TIMEOUT_DEFAULT_MS = 3e4;
|
|
6
|
-
const FEISHU_STARTUP_BOT_INFO_TIMEOUT_ENV = "OPENCLAW_FEISHU_STARTUP_PROBE_TIMEOUT_MS";
|
|
7
|
-
function resolveStartupProbeTimeoutMs(env = process.env) {
|
|
8
|
-
const raw = env[FEISHU_STARTUP_BOT_INFO_TIMEOUT_ENV];
|
|
9
|
-
if (raw) {
|
|
10
|
-
const parsed = parseStrictPositiveInteger(raw);
|
|
11
|
-
if (parsed !== void 0) return parsed;
|
|
12
|
-
console.warn(`[feishu] ${FEISHU_STARTUP_BOT_INFO_TIMEOUT_ENV}="${raw}" is invalid; using default ${FEISHU_STARTUP_BOT_INFO_TIMEOUT_DEFAULT_MS}ms`);
|
|
13
|
-
}
|
|
14
|
-
return FEISHU_STARTUP_BOT_INFO_TIMEOUT_DEFAULT_MS;
|
|
15
|
-
}
|
|
16
|
-
//#endregion
|
|
17
|
-
//#region extensions/feishu/src/monitor.startup.ts
|
|
18
|
-
const FEISHU_STARTUP_BOT_INFO_TIMEOUT_MS = resolveStartupProbeTimeoutMs();
|
|
19
|
-
function isTimeoutErrorMessage(message) {
|
|
20
|
-
const lower = normalizeLowercaseStringOrEmpty(message);
|
|
21
|
-
return lower.includes("timeout") || lower.includes("timed out");
|
|
22
|
-
}
|
|
23
|
-
function isAbortErrorMessage(message) {
|
|
24
|
-
return normalizeLowercaseStringOrEmpty(message).includes("aborted");
|
|
25
|
-
}
|
|
26
|
-
async function fetchBotIdentityForMonitor(account, options = {}) {
|
|
27
|
-
if (options.abortSignal?.aborted) return {};
|
|
28
|
-
const timeoutMs = options.timeoutMs ?? FEISHU_STARTUP_BOT_INFO_TIMEOUT_MS;
|
|
29
|
-
const result = await probeFeishu(account, {
|
|
30
|
-
timeoutMs,
|
|
31
|
-
abortSignal: options.abortSignal
|
|
32
|
-
});
|
|
33
|
-
if (result.ok) return {
|
|
34
|
-
botOpenId: result.botOpenId,
|
|
35
|
-
botName: result.botName
|
|
36
|
-
};
|
|
37
|
-
const probeError = result.error ?? void 0;
|
|
38
|
-
if (options.abortSignal?.aborted || isAbortErrorMessage(probeError)) return {};
|
|
39
|
-
if (isTimeoutErrorMessage(probeError)) (options.runtime?.error ?? console.error)(`feishu[${account.accountId}]: bot info probe timed out after ${timeoutMs}ms; continuing startup`);
|
|
40
|
-
return {};
|
|
41
|
-
}
|
|
42
|
-
//#endregion
|
|
43
|
-
export { fetchBotIdentityForMonitor as t };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
## [1.1.2](https://github.com/protobufjs/protobuf.js/compare/inquire-v1.1.1...inquire-v1.1.2) (2026-05-17)
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
### Bug Fixes
|
|
7
|
-
|
|
8
|
-
* Backport bundler-safe optional module lookups ([#2254](https://github.com/protobufjs/protobuf.js/issues/2254)) ([0853a62](https://github.com/protobufjs/protobuf.js/commit/0853a625680f9247596b84ef48082b8f4e554797))
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
Copyright (c) 2016, Daniel Wirtz All rights reserved.
|
|
2
|
-
|
|
3
|
-
Redistribution and use in source and binary forms, with or without
|
|
4
|
-
modification, are permitted provided that the following conditions are
|
|
5
|
-
met:
|
|
6
|
-
|
|
7
|
-
* Redistributions of source code must retain the above copyright
|
|
8
|
-
notice, this list of conditions and the following disclaimer.
|
|
9
|
-
* Redistributions in binary form must reproduce the above copyright
|
|
10
|
-
notice, this list of conditions and the following disclaimer in the
|
|
11
|
-
documentation and/or other materials provided with the distribution.
|
|
12
|
-
* Neither the name of its author, nor the names of its contributors
|
|
13
|
-
may be used to endorse or promote products derived from this software
|
|
14
|
-
without specific prior written permission.
|
|
15
|
-
|
|
16
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
17
|
-
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
18
|
-
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
19
|
-
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
20
|
-
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
21
|
-
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
22
|
-
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
23
|
-
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
24
|
-
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
25
|
-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
26
|
-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
@protobufjs/inquire
|
|
2
|
-
===================
|
|
3
|
-
[](https://www.npmjs.com/package/@protobufjs/inquire)
|
|
4
|
-
|
|
5
|
-
Requires a module only if available and hides the require call from bundlers.
|
|
6
|
-
|
|
7
|
-
API
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
* **inquire(moduleName: `string`): `?Object`**<br />
|
|
11
|
-
Requires a module only if available.
|
|
12
|
-
|
|
13
|
-
**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export = inquire;
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Requires a module only if available.
|
|
5
|
-
* @memberof util
|
|
6
|
-
* @param {string} moduleName Module to require
|
|
7
|
-
* @returns {?Object} Required module if available and not empty, otherwise `null`
|
|
8
|
-
* @deprecated Legacy optional require helper. Will be removed in a future release.
|
|
9
|
-
*/
|
|
10
|
-
declare function inquire(moduleName: string): object;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
module.exports = inquire;
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Requires a module only if available.
|
|
6
|
-
* @memberof util
|
|
7
|
-
* @param {string} moduleName Module to require
|
|
8
|
-
* @returns {?Object} Required module if available and not empty, otherwise `null`
|
|
9
|
-
* @deprecated Legacy optional require helper. Will be removed in a future release.
|
|
10
|
-
*/
|
|
11
|
-
function inquire(moduleName) {
|
|
12
|
-
try {
|
|
13
|
-
if (typeof require !== "function") {
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
var mod = require(moduleName);
|
|
17
|
-
if (mod && (mod.length || Object.keys(mod).length)) return mod;
|
|
18
|
-
return null;
|
|
19
|
-
} catch (err) {
|
|
20
|
-
// ignore
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/*
|
|
26
|
-
// maybe worth a shot to prevent renaming issues:
|
|
27
|
-
// see: https://github.com/webpack/webpack/blob/master/lib/dependencies/CommonJsRequireDependencyParserPlugin.js
|
|
28
|
-
// triggers on:
|
|
29
|
-
// - expression require.cache
|
|
30
|
-
// - expression require (???)
|
|
31
|
-
// - call require
|
|
32
|
-
// - call require:commonjs:item
|
|
33
|
-
// - call require:commonjs:context
|
|
34
|
-
|
|
35
|
-
Object.defineProperty(Function.prototype, "__self", { get: function() { return this; } });
|
|
36
|
-
var r = require.__self;
|
|
37
|
-
delete Function.prototype.__self;
|
|
38
|
-
*/
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@protobufjs/inquire",
|
|
3
|
-
"description": "Requires a module only if available and hides the require call from bundlers.",
|
|
4
|
-
"version": "1.1.2",
|
|
5
|
-
"author": "Daniel Wirtz <dcode+protobufjs@dcode.io>",
|
|
6
|
-
"repository": {
|
|
7
|
-
"type": "git",
|
|
8
|
-
"url": "https://github.com/dcodeIO/protobuf.js.git"
|
|
9
|
-
},
|
|
10
|
-
"license": "BSD-3-Clause",
|
|
11
|
-
"main": "index.js",
|
|
12
|
-
"types": "index.d.ts",
|
|
13
|
-
"devDependencies": {
|
|
14
|
-
"istanbul": "^0.4.5",
|
|
15
|
-
"tape": "^5.0.0"
|
|
16
|
-
},
|
|
17
|
-
"scripts": {
|
|
18
|
-
"test": "tape tests/*.js",
|
|
19
|
-
"coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js"
|
|
20
|
-
}
|
|
21
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = [1];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = [];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = { a: 1 };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
var tape = require("tape");
|
|
2
|
-
|
|
3
|
-
var inquire = require("..");
|
|
4
|
-
|
|
5
|
-
tape.test("inquire", function(test) {
|
|
6
|
-
|
|
7
|
-
test.equal(inquire("buffer").Buffer, Buffer, "should be able to require \"buffer\"");
|
|
8
|
-
|
|
9
|
-
test.equal(inquire("%invalid"), null, "should not be able to require \"%invalid\"");
|
|
10
|
-
|
|
11
|
-
test.equal(inquire("./tests/data/emptyObject"), null, "should return null when requiring a module exporting an empty object");
|
|
12
|
-
|
|
13
|
-
test.equal(inquire("./tests/data/emptyArray"), null, "should return null when requiring a module exporting an empty array");
|
|
14
|
-
|
|
15
|
-
test.same(inquire("./tests/data/object"), { a: 1 }, "should return the object if a non-empty object");
|
|
16
|
-
|
|
17
|
-
test.same(inquire("./tests/data/array"), [ 1 ], "should return the module if a non-empty array");
|
|
18
|
-
|
|
19
|
-
test.end();
|
|
20
|
-
});
|