HarborForge.OpenclawPlugin: dev-2026-03-29 -> main #4
@@ -107,7 +107,7 @@ export class CalendarBridgeClient {
|
||||
*/
|
||||
async updateSlot(slotId: number, update: SlotAgentUpdate): Promise<boolean> {
|
||||
const url = `${this.baseUrl}/calendar/slots/${slotId}/agent-update`;
|
||||
return this.postBoolean(url, update);
|
||||
return this.sendBoolean('PATCH', url, update);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -166,7 +166,7 @@ export class CalendarBridgeClient {
|
||||
claw_identifier: this.config.clawIdentifier,
|
||||
...params,
|
||||
};
|
||||
return this.postBoolean(url, body);
|
||||
return this.sendBoolean('POST', url, body);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
@@ -195,13 +195,13 @@ export class CalendarBridgeClient {
|
||||
}
|
||||
}
|
||||
|
||||
private async postBoolean(url: string, body: unknown): Promise<boolean> {
|
||||
private async sendBoolean(method: 'POST' | 'PATCH', url: string, body: unknown): Promise<boolean> {
|
||||
const controller = new AbortController();
|
||||
const timeout = setTimeout(() => controller.abort(), this.timeoutMs);
|
||||
|
||||
try {
|
||||
const response = await fetch(url, {
|
||||
method: 'POST',
|
||||
method,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-Agent-ID': this.config.agentId,
|
||||
|
||||
Reference in New Issue
Block a user