@ganglion/xacpx 0.12.0 → 0.12.1
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/bridge/bridge-main.js +6 -0
- package/dist/cli.js +22 -1
- package/dist/i18n/types.d.ts +3 -0
- package/dist/plugin-api.js +6 -0
- package/package.json +1 -1
|
@@ -1697,6 +1697,9 @@ var init_channel_cli = __esm(() => {
|
|
|
1697
1697
|
channelAdded: (type) => `Channel ${type} added`,
|
|
1698
1698
|
cannotRemoveLastEnabled: "Cannot remove the last enabled channel.",
|
|
1699
1699
|
channelRemoved: (id) => `Channel ${id} removed`,
|
|
1700
|
+
channelCredentialsCleared: (id) => `Removed stored credentials for channel ${id}`,
|
|
1701
|
+
channelCredentialsClearFailed: (id, error) => `Channel ${id} removed, but clearing its stored credentials failed: ${error}`,
|
|
1702
|
+
channelCredentialsKept: (id) => `Kept stored credentials for channel ${id} (--keep-credentials)`,
|
|
1700
1703
|
cannotDisableLastEnabled: "Cannot disable the last enabled channel.",
|
|
1701
1704
|
channelEnabledToggled: (id, enabled) => `Channel ${id} ${enabled ? "enabled" : "disabled"}`,
|
|
1702
1705
|
channelReplyModeSet: (id, mode) => `Channel ${id} default reply mode set to: ${mode}`,
|
|
@@ -2789,6 +2792,9 @@ var init_channel_cli2 = __esm(() => {
|
|
|
2789
2792
|
channelAdded: (type) => `频道 ${type} 已添加`,
|
|
2790
2793
|
cannotRemoveLastEnabled: "不能删除最后一个启用的频道。",
|
|
2791
2794
|
channelRemoved: (id) => `频道 ${id} 已删除`,
|
|
2795
|
+
channelCredentialsCleared: (id) => `已移除频道 ${id} 的存储凭证`,
|
|
2796
|
+
channelCredentialsClearFailed: (id, error) => `频道 ${id} 已删除,但清除其存储凭证失败:${error}`,
|
|
2797
|
+
channelCredentialsKept: (id) => `已保留频道 ${id} 的存储凭证(--keep-credentials)`,
|
|
2792
2798
|
cannotDisableLastEnabled: "不能禁用最后一个启用的频道。",
|
|
2793
2799
|
channelEnabledToggled: (id, enabled) => `频道 ${id} 已${enabled ? "启用" : "禁用"}`,
|
|
2794
2800
|
channelReplyModeSet: (id, mode) => `频道 ${id} 的默认 reply mode 已设置为:${mode}`,
|
package/dist/cli.js
CHANGED
|
@@ -898,6 +898,9 @@ var init_channel_cli = __esm(() => {
|
|
|
898
898
|
channelAdded: (type) => `Channel ${type} added`,
|
|
899
899
|
cannotRemoveLastEnabled: "Cannot remove the last enabled channel.",
|
|
900
900
|
channelRemoved: (id) => `Channel ${id} removed`,
|
|
901
|
+
channelCredentialsCleared: (id) => `Removed stored credentials for channel ${id}`,
|
|
902
|
+
channelCredentialsClearFailed: (id, error) => `Channel ${id} removed, but clearing its stored credentials failed: ${error}`,
|
|
903
|
+
channelCredentialsKept: (id) => `Kept stored credentials for channel ${id} (--keep-credentials)`,
|
|
901
904
|
cannotDisableLastEnabled: "Cannot disable the last enabled channel.",
|
|
902
905
|
channelEnabledToggled: (id, enabled) => `Channel ${id} ${enabled ? "enabled" : "disabled"}`,
|
|
903
906
|
channelReplyModeSet: (id, mode) => `Channel ${id} default reply mode set to: ${mode}`,
|
|
@@ -1990,6 +1993,9 @@ var init_channel_cli2 = __esm(() => {
|
|
|
1990
1993
|
channelAdded: (type) => `频道 ${type} 已添加`,
|
|
1991
1994
|
cannotRemoveLastEnabled: "不能删除最后一个启用的频道。",
|
|
1992
1995
|
channelRemoved: (id) => `频道 ${id} 已删除`,
|
|
1996
|
+
channelCredentialsCleared: (id) => `已移除频道 ${id} 的存储凭证`,
|
|
1997
|
+
channelCredentialsClearFailed: (id, error) => `频道 ${id} 已删除,但清除其存储凭证失败:${error}`,
|
|
1998
|
+
channelCredentialsKept: (id) => `已保留频道 ${id} 的存储凭证(--keep-credentials)`,
|
|
1993
1999
|
cannotDisableLastEnabled: "不能禁用最后一个启用的频道。",
|
|
1994
2000
|
channelEnabledToggled: (id, enabled) => `频道 ${id} 已${enabled ? "启用" : "禁用"}`,
|
|
1995
2001
|
channelReplyModeSet: (id, mode) => `频道 ${id} 的默认 reply mode 已设置为:${mode}`,
|
|
@@ -50901,6 +50907,7 @@ async function removeChannel(type, rawArgs, deps) {
|
|
|
50901
50907
|
deps.print(restartFlags.message);
|
|
50902
50908
|
return 1;
|
|
50903
50909
|
}
|
|
50910
|
+
const keepCredentials = restartFlags.rest.includes("--keep-credentials");
|
|
50904
50911
|
const config4 = await deps.loadConfig();
|
|
50905
50912
|
ensureChannelsArray(config4);
|
|
50906
50913
|
const channel = findChannel(config4.channels, type);
|
|
@@ -50915,6 +50922,16 @@ async function removeChannel(type, rawArgs, deps) {
|
|
|
50915
50922
|
config4.channels = config4.channels.filter((entry) => entry.id !== channel.id);
|
|
50916
50923
|
await deps.saveChannels(config4.channels);
|
|
50917
50924
|
deps.print(t().channelCli.channelRemoved(channel.id));
|
|
50925
|
+
if (keepCredentials) {
|
|
50926
|
+
deps.print(t().channelCli.channelCredentialsKept(channel.id));
|
|
50927
|
+
} else if (deps.clearChannelCredentials) {
|
|
50928
|
+
try {
|
|
50929
|
+
await deps.clearChannelCredentials(channel);
|
|
50930
|
+
deps.print(t().channelCli.channelCredentialsCleared(channel.id));
|
|
50931
|
+
} catch (error2) {
|
|
50932
|
+
deps.print(t().channelCli.channelCredentialsClearFailed(channel.id, error2 instanceof Error ? error2.message : String(error2)));
|
|
50933
|
+
}
|
|
50934
|
+
}
|
|
50918
50935
|
return await maybeRestartAfterMutation(restartFlags.restart, deps);
|
|
50919
50936
|
}
|
|
50920
50937
|
async function setChannelEnabled(type, enabled, rawArgs, deps) {
|
|
@@ -52640,7 +52657,11 @@ async function createChannelCliDeps(input) {
|
|
|
52640
52657
|
return { state: "indeterminate", pid: status.pid, reason: status.reason };
|
|
52641
52658
|
return { state: "stopped" };
|
|
52642
52659
|
},
|
|
52643
|
-
restartDaemon: async () => await restartDaemonCli(controller, input.print)
|
|
52660
|
+
restartDaemon: async () => await restartDaemonCli(controller, input.print),
|
|
52661
|
+
clearChannelCredentials: async (channel) => {
|
|
52662
|
+
const { createMessageChannel: createMessageChannel2 } = await Promise.resolve().then(() => (init_create_channel(), exports_create_channel));
|
|
52663
|
+
createMessageChannel2(channel.type, channel).logout();
|
|
52664
|
+
}
|
|
52644
52665
|
};
|
|
52645
52666
|
return { ...base, ...input.overrides };
|
|
52646
52667
|
}
|
package/dist/i18n/types.d.ts
CHANGED
|
@@ -672,6 +672,9 @@ export interface ChannelCliMessages {
|
|
|
672
672
|
channelAdded: (type: string) => string;
|
|
673
673
|
cannotRemoveLastEnabled: string;
|
|
674
674
|
channelRemoved: (id: string) => string;
|
|
675
|
+
channelCredentialsCleared: (id: string) => string;
|
|
676
|
+
channelCredentialsClearFailed: (id: string, error: string) => string;
|
|
677
|
+
channelCredentialsKept: (id: string) => string;
|
|
675
678
|
cannotDisableLastEnabled: string;
|
|
676
679
|
channelEnabledToggled: (id: string, enabled: boolean) => string;
|
|
677
680
|
channelReplyModeSet: (id: string, mode: string) => string;
|
package/dist/plugin-api.js
CHANGED
|
@@ -873,6 +873,9 @@ var init_channel_cli = __esm(() => {
|
|
|
873
873
|
channelAdded: (type) => `Channel ${type} added`,
|
|
874
874
|
cannotRemoveLastEnabled: "Cannot remove the last enabled channel.",
|
|
875
875
|
channelRemoved: (id) => `Channel ${id} removed`,
|
|
876
|
+
channelCredentialsCleared: (id) => `Removed stored credentials for channel ${id}`,
|
|
877
|
+
channelCredentialsClearFailed: (id, error) => `Channel ${id} removed, but clearing its stored credentials failed: ${error}`,
|
|
878
|
+
channelCredentialsKept: (id) => `Kept stored credentials for channel ${id} (--keep-credentials)`,
|
|
876
879
|
cannotDisableLastEnabled: "Cannot disable the last enabled channel.",
|
|
877
880
|
channelEnabledToggled: (id, enabled) => `Channel ${id} ${enabled ? "enabled" : "disabled"}`,
|
|
878
881
|
channelReplyModeSet: (id, mode) => `Channel ${id} default reply mode set to: ${mode}`,
|
|
@@ -1965,6 +1968,9 @@ var init_channel_cli2 = __esm(() => {
|
|
|
1965
1968
|
channelAdded: (type) => `频道 ${type} 已添加`,
|
|
1966
1969
|
cannotRemoveLastEnabled: "不能删除最后一个启用的频道。",
|
|
1967
1970
|
channelRemoved: (id) => `频道 ${id} 已删除`,
|
|
1971
|
+
channelCredentialsCleared: (id) => `已移除频道 ${id} 的存储凭证`,
|
|
1972
|
+
channelCredentialsClearFailed: (id, error) => `频道 ${id} 已删除,但清除其存储凭证失败:${error}`,
|
|
1973
|
+
channelCredentialsKept: (id) => `已保留频道 ${id} 的存储凭证(--keep-credentials)`,
|
|
1968
1974
|
cannotDisableLastEnabled: "不能禁用最后一个启用的频道。",
|
|
1969
1975
|
channelEnabledToggled: (id, enabled) => `频道 ${id} 已${enabled ? "启用" : "禁用"}`,
|
|
1970
1976
|
channelReplyModeSet: (id, mode) => `频道 ${id} 的默认 reply mode 已设置为:${mode}`,
|