mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 20:40:20 +00:00
refactor: rename channel setup flow seam
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import type { OpenClawConfig } from "openclaw/plugin-sdk/line";
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { buildChannelOnboardingAdapterFromSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import { buildChannelSetupFlowAdapterFromSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import {
|
||||
listLineAccountIds,
|
||||
resolveDefaultLineAccountId,
|
||||
@@ -30,7 +30,7 @@ function createPrompter(overrides: Partial<WizardPrompter> = {}): WizardPrompter
|
||||
};
|
||||
}
|
||||
|
||||
const lineConfigureAdapter = buildChannelOnboardingAdapterFromSetupWizard({
|
||||
const lineConfigureAdapter = buildChannelSetupFlowAdapterFromSetupWizard({
|
||||
plugin: {
|
||||
id: "line",
|
||||
meta: { label: "LINE" },
|
||||
@@ -41,7 +41,7 @@ const lineConfigureAdapter = buildChannelOnboardingAdapterFromSetupWizard({
|
||||
resolveLineAccount({ cfg, accountId: accountId ?? undefined }).config.allowFrom,
|
||||
},
|
||||
setup: lineSetupAdapter,
|
||||
} as Parameters<typeof buildChannelOnboardingAdapterFromSetupWizard>[0]["plugin"],
|
||||
} as Parameters<typeof buildChannelSetupFlowAdapterFromSetupWizard>[0]["plugin"],
|
||||
wizard: lineSetupWizard,
|
||||
});
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import type { ChannelOnboardingDmPolicy } from "../../../src/channels/plugins/onboarding-types.js";
|
||||
import {
|
||||
setOnboardingChannelEnabled,
|
||||
setSetupChannelEnabled,
|
||||
setTopLevelChannelDmPolicyWithAllowFrom,
|
||||
splitOnboardingEntries,
|
||||
} from "../../../src/channels/plugins/onboarding/helpers.js";
|
||||
splitSetupEntries,
|
||||
} from "../../../src/channels/plugins/setup-flow-helpers.js";
|
||||
import type { ChannelSetupDmPolicy } from "../../../src/channels/plugins/setup-flow-types.js";
|
||||
import type { ChannelSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import { resolveLineAccount } from "../../../src/line/accounts.js";
|
||||
import { DEFAULT_ACCOUNT_ID } from "../../../src/routing/session-key.js";
|
||||
@@ -35,7 +35,7 @@ const LINE_ALLOW_FROM_HELP_LINES = [
|
||||
`Docs: ${formatDocsLink("/channels/line", "channels/line")}`,
|
||||
];
|
||||
|
||||
const lineDmPolicy: ChannelOnboardingDmPolicy = {
|
||||
const lineDmPolicy: ChannelSetupDmPolicy = {
|
||||
label: "LINE",
|
||||
channel,
|
||||
policyKey: "channels.line.dmPolicy",
|
||||
@@ -169,7 +169,7 @@ export const lineSetupWizard: ChannelSetupWizard = {
|
||||
placeholder: "U1234567890abcdef1234567890abcdef",
|
||||
invalidWithoutCredentialNote:
|
||||
"LINE allowFrom requires raw user ids like U1234567890abcdef1234567890abcdef.",
|
||||
parseInputs: splitOnboardingEntries,
|
||||
parseInputs: splitSetupEntries,
|
||||
parseId: parseLineAllowFromId,
|
||||
resolveEntries: async ({ entries }) =>
|
||||
entries.map((entry) => {
|
||||
@@ -198,5 +198,5 @@ export const lineSetupWizard: ChannelSetupWizard = {
|
||||
`Docs: ${formatDocsLink("/channels/line", "channels/line")}`,
|
||||
],
|
||||
},
|
||||
disable: (cfg) => setOnboardingChannelEnabled(cfg, channel, false),
|
||||
disable: (cfg) => setSetupChannelEnabled(cfg, channel, false),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user