@lvce-editor/extension-management-worker 4.50.0 → 4.51.0
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.
|
@@ -3080,7 +3080,7 @@ const parseOutputChannelUri = uri => {
|
|
|
3080
3080
|
}
|
|
3081
3081
|
return [extensionId, outputChannelId];
|
|
3082
3082
|
};
|
|
3083
|
-
const
|
|
3083
|
+
const resolveOutputChannel = async (extensionsState, uri) => {
|
|
3084
3084
|
const [extensionId, outputChannelId] = parseOutputChannelUri(uri);
|
|
3085
3085
|
const {
|
|
3086
3086
|
assetDir,
|
|
@@ -3093,6 +3093,29 @@ const readOutputChannel = async (extensionsState, uri) => {
|
|
|
3093
3093
|
throw new Error(`Output channel ${outputChannelId} is not contributed by extension ${extensionId}`);
|
|
3094
3094
|
}
|
|
3095
3095
|
const rpc = await getRpc$1(extension, assetDir, platform);
|
|
3096
|
+
return {
|
|
3097
|
+
extensionId,
|
|
3098
|
+
outputChannelId,
|
|
3099
|
+
rpc
|
|
3100
|
+
};
|
|
3101
|
+
};
|
|
3102
|
+
const clearOutputChannel = async (extensionsState, uri) => {
|
|
3103
|
+
const {
|
|
3104
|
+
extensionId,
|
|
3105
|
+
outputChannelId,
|
|
3106
|
+
rpc
|
|
3107
|
+
} = await resolveOutputChannel(extensionsState, uri);
|
|
3108
|
+
const didClear = await rpc.invoke('ExtensionApi.clearOutputChannel', outputChannelId);
|
|
3109
|
+
if (didClear !== true) {
|
|
3110
|
+
throw new TypeError(`Output channel ${outputChannelId} is not registered by extension ${extensionId}`);
|
|
3111
|
+
}
|
|
3112
|
+
};
|
|
3113
|
+
const readOutputChannel = async (extensionsState, uri) => {
|
|
3114
|
+
const {
|
|
3115
|
+
extensionId,
|
|
3116
|
+
outputChannelId,
|
|
3117
|
+
rpc
|
|
3118
|
+
} = await resolveOutputChannel(extensionsState, uri);
|
|
3096
3119
|
const logs = await rpc.invoke('ExtensionApi.getOutputChannelLogs', outputChannelId);
|
|
3097
3120
|
if (typeof logs !== 'string') {
|
|
3098
3121
|
throw new TypeError(`Output channel ${outputChannelId} is not registered by extension ${extensionId}`);
|
|
@@ -4011,6 +4034,7 @@ const commandMap = {
|
|
|
4011
4034
|
'Extensions.activateByEvent': activateByEvent,
|
|
4012
4035
|
'Extensions.addExtension': addExtension,
|
|
4013
4036
|
'Extensions.addWebExtension': addWebExtension,
|
|
4037
|
+
'Extensions.clearOutputChannel': wrapCommand(clearOutputChannel),
|
|
4014
4038
|
'Extensions.createViewInstance': createViewInstance,
|
|
4015
4039
|
'Extensions.createWebViewWorkerRpc': createWebViewWorkerRpc,
|
|
4016
4040
|
'Extensions.createWebViewWorkerRpc2': createWebViewWorkerRpc2,
|