mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 05:51:15 +08:00
fix(hooks): satisfy gmail delivery type checks
This commit is contained in:
@@ -6,6 +6,8 @@ import {
|
|||||||
buildGogWatchPullLogArgs,
|
buildGogWatchPullLogArgs,
|
||||||
buildGogWatchServeLogArgs,
|
buildGogWatchServeLogArgs,
|
||||||
buildTopicPath,
|
buildTopicPath,
|
||||||
|
isGmailHookPullRuntimeConfig,
|
||||||
|
isGmailHookPushRuntimeConfig,
|
||||||
parseSubscriptionPath,
|
parseSubscriptionPath,
|
||||||
parseTopicPath,
|
parseTopicPath,
|
||||||
resolveGmailHookRuntimeConfig,
|
resolveGmailHookRuntimeConfig,
|
||||||
@@ -51,7 +53,7 @@ describe("gmail hook config", () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
expect(result.value.delivery.mode).toBe("push");
|
expect(result.value.delivery.mode).toBe("push");
|
||||||
if (result.value.delivery.mode !== "push") {
|
if (!isGmailHookPushRuntimeConfig(result.value)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
expect(result.value.serve.path).toBe(expected.servePath);
|
expect(result.value.serve.path).toBe(expected.servePath);
|
||||||
@@ -91,7 +93,7 @@ describe("gmail hook config", () => {
|
|||||||
expect(result.value.delivery.mode).toBe("push");
|
expect(result.value.delivery.mode).toBe("push");
|
||||||
expect(result.value.label).toBe("INBOX");
|
expect(result.value.label).toBe("INBOX");
|
||||||
expect(result.value.includeBody).toBe(true);
|
expect(result.value.includeBody).toBe(true);
|
||||||
if (result.value.delivery.mode !== "push") {
|
if (!isGmailHookPushRuntimeConfig(result.value)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
expect(result.value.serve.port).toBe(8788);
|
expect(result.value.serve.port).toBe(8788);
|
||||||
@@ -159,7 +161,7 @@ describe("gmail hook config", () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
expect(result.value.delivery.mode).toBe("push");
|
expect(result.value.delivery.mode).toBe("push");
|
||||||
if (result.value.delivery.mode !== "push") {
|
if (!isGmailHookPushRuntimeConfig(result.value)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -209,7 +211,7 @@ describe("gmail hook config", () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
expect(result.value.delivery.mode).toBe("pull");
|
expect(result.value.delivery.mode).toBe("pull");
|
||||||
if (result.value.delivery.mode !== "pull") {
|
if (!isGmailHookPullRuntimeConfig(result.value)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -356,9 +356,9 @@ export function buildGogWatchPullHelpArgs(): string[] {
|
|||||||
|
|
||||||
function removeGogWatchSensitiveArgs(args: string[]): string[] {
|
function removeGogWatchSensitiveArgs(args: string[]): string[] {
|
||||||
return args.filter(
|
return args.filter(
|
||||||
(arg, index, args) =>
|
(arg, index, allArgs) =>
|
||||||
!GMAIL_WATCH_SENSITIVE_FLAGS.has(arg) &&
|
!GMAIL_WATCH_SENSITIVE_FLAGS.has(arg) &&
|
||||||
!GMAIL_WATCH_SENSITIVE_FLAGS.has(args[index - 1] ?? ""),
|
!GMAIL_WATCH_SENSITIVE_FLAGS.has(allArgs[index - 1] ?? ""),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user