File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- e54bcec7d07d05d00010ca038776c16d33346b2b69c5c920f331b805584553a0 plugin-sdk-api-baseline.json
2- af38688ddabaeeef60aa19917c2d96ab507afc2f05df49dc3a009f8f75bddb12 plugin-sdk-api-baseline.jsonl
1+ 0597218863ded2b9e86ab56773c5d92b9bd6dcb5e5d537e8e83397fcbb56a5d5 plugin-sdk-api-baseline.json
2+ 6d7406435ac48216be84c10d216703c0459577762899d20c5921993e9f1e3478 plugin-sdk-api-baseline.jsonl
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/routing";
66import { info , success } from "openclaw/plugin-sdk/runtime-env" ;
77import { getChildLogger } from "openclaw/plugin-sdk/runtime-env" ;
88import { defaultRuntime , type RuntimeEnv } from "openclaw/plugin-sdk/runtime-env" ;
9+ import { safeParseJson } from "openclaw/plugin-sdk/text-utility-runtime" ;
910import { resolveOAuthDir } from "./auth-store.runtime.js" ;
1011import {
1112 assertWebCredsPathRegularFileOrMissing ,
@@ -94,12 +95,8 @@ export type WhatsAppWebCredsPayload = {
9495} ;
9596
9697function parseWebCredsPayload ( raw : string ) : WhatsAppWebCredsPayload | null {
97- try {
98- const parsed = JSON . parse ( raw ) as unknown ;
99- return parsed && typeof parsed === "object" ? ( parsed as WhatsAppWebCredsPayload ) : null ;
100- } catch {
101- return null ;
102- }
98+ const parsed = safeParseJson < unknown > ( raw ) ;
99+ return parsed !== null && typeof parsed === "object" ? ( parsed as WhatsAppWebCredsPayload ) : null ;
103100}
104101
105102function hasUsableWebIdentity ( payload : WhatsAppWebCredsPayload ) : boolean {
You can’t perform that action at this time.
0 commit comments