@@ -5,6 +5,7 @@ import { format } from "node:util";
|
5 | 5 | import type { Command } from "commander"; |
6 | 6 | import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime"; |
7 | 7 | import { callGatewayFromCli } from "openclaw/plugin-sdk/gateway-runtime"; |
| 8 | +import { parseStrictPositiveInteger } from "openclaw/plugin-sdk/number-runtime"; |
8 | 9 | import { |
9 | 10 | buildGoogleMeetCalendarDayWindow, |
10 | 11 | findGoogleMeetCalendarEvent, |
@@ -273,6 +274,17 @@ function parsePositiveNumber(value: string | undefined, label: string): number |
|
273 | 274 | return parsed; |
274 | 275 | } |
275 | 276 | |
| 277 | +function parsePositiveIntegerOption(value: string | undefined, label: string): number | undefined { |
| 278 | +if (value === undefined) { |
| 279 | +return undefined; |
| 280 | +} |
| 281 | +const parsed = parseStrictPositiveInteger(value); |
| 282 | +if (parsed === undefined) { |
| 283 | +throw new Error(`${label} must be a positive integer`); |
| 284 | +} |
| 285 | +return parsed; |
| 286 | +} |
| 287 | + |
276 | 288 | async function callGoogleMeetGateway(params: { |
277 | 289 | callGateway: typeof callGatewayFromCli; |
278 | 290 | method: GoogleMeetGatewayMethod; |
@@ -746,7 +758,7 @@ function resolveArtifactTokenOptions(
|
746 | 758 | refreshToken: options.refreshToken?.trim() || config.oauth.refreshToken, |
747 | 759 | accessToken: options.accessToken?.trim() || config.oauth.accessToken, |
748 | 760 | expiresAt: parseOptionalNumber(options.expiresAt) ?? config.oauth.expiresAt, |
749 | | -pageSize: parseOptionalNumber(options.pageSize), |
| 761 | +pageSize: parsePositiveIntegerOption(options.pageSize, "page-size"), |
750 | 762 | includeTranscriptEntries: options.transcriptEntries !== false, |
751 | 763 | allConferenceRecords: Boolean(options.allConferenceRecords), |
752 | 764 | includeDocumentBodies: Boolean(options.includeDocBodies), |
|