update openclaw secret
This commit is contained in:
@@ -162,12 +162,12 @@
|
||||
},
|
||||
"openslaw-secret.ts": {
|
||||
"script_name": "openslaw-secret.ts",
|
||||
"script_length": 4279,
|
||||
"script_sha256": "5494cd3be208919e5c36581161c26f1766b5f2a032a1a4099472da68f5e3a611",
|
||||
"script_length": 4521,
|
||||
"script_sha256": "2e886089efce46370c47d1c1ae5d05b2ecfa32fea4fd8ce301a21d42f8b951b2",
|
||||
"script_full_url": "https://git.hatter.ink/hatter/ts-scripts/raw/branch/main/single-scripts/openslaw-secret.ts",
|
||||
"single_script_file": true,
|
||||
"publish_time": 1772859193653,
|
||||
"update_time": 1772859193653
|
||||
"update_time": 1772860113096
|
||||
},
|
||||
"post-note.ts": {
|
||||
"script_name": "post-note.ts",
|
||||
|
||||
@@ -76,6 +76,7 @@ async function getSecretValueViaAlibabaCloudHttps(
|
||||
}
|
||||
const secretResponse = await httpSecretResponse
|
||||
.json() as GetSecretResponse;
|
||||
log.debug("secretResponse", secretResponse);
|
||||
if (secretResponse.status != 200) {
|
||||
throw new Error(`Get secret failed: ${secretResponse.status}`);
|
||||
}
|
||||
@@ -90,7 +91,7 @@ async function getSecretValueViaHatterCli(key: string): Promise<string> {
|
||||
key,
|
||||
]);
|
||||
const secretResponse = output.getStdoutAsJson() as GetSecretResponse;
|
||||
console.debug("secretResponse", secretResponse);
|
||||
log.debug("secretResponse", secretResponse);
|
||||
if (secretResponse.status != 200) {
|
||||
throw new Error(`Get secret failed: ${secretResponse.status}`);
|
||||
}
|
||||
@@ -110,6 +111,7 @@ async function getSecretValue(
|
||||
|
||||
const flags = parseArgs(args(), {
|
||||
boolean: ["help"],
|
||||
collect: ["id"],
|
||||
});
|
||||
|
||||
if (flags.help) {
|
||||
@@ -128,8 +130,17 @@ const isOnAlibabaCloud = runEnv == "ALIBABA_CLOUD";
|
||||
|
||||
log.debug("isOnAlibabaCloud", isOnAlibabaCloud);
|
||||
|
||||
const input = new TextDecoder().decode(await stdinToArrayBuffer());
|
||||
const openClawInput = JSON.parse(input) as OpenClawSecretInput;
|
||||
let openClawInput;
|
||||
if (flags.id) {
|
||||
openClawInput = {
|
||||
protocolVersion: 1,
|
||||
provider: "n/a",
|
||||
ids: flags.id,
|
||||
} as OpenClawSecretInput;
|
||||
} else {
|
||||
const input = new TextDecoder().decode(await stdinToArrayBuffer());
|
||||
openClawInput = JSON.parse(input) as OpenClawSecretInput;
|
||||
}
|
||||
|
||||
const values = {} as Record<string, string>;
|
||||
const errors = {} as Record<string, Record<string, string>>;
|
||||
|
||||
Reference in New Issue
Block a user