mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-01 22:10:23 +00:00
feat(core): initial implementation of syncing (#17814)
This commit is contained in:
parent
0c0c6f3bdb
commit
b0017bf1b9
32 changed files with 4403 additions and 1760 deletions
|
|
@ -46,6 +46,7 @@ import type {
|
|||
GlobalDisposeResponses,
|
||||
GlobalEventResponses,
|
||||
GlobalHealthResponses,
|
||||
GlobalSyncEventSubscribeResponses,
|
||||
GlobalUpgradeErrors,
|
||||
GlobalUpgradeResponses,
|
||||
InstanceDisposeResponses,
|
||||
|
|
@ -230,6 +231,20 @@ class HeyApiRegistry<T> {
|
|||
}
|
||||
}
|
||||
|
||||
export class SyncEvent extends HeyApiClient {
|
||||
/**
|
||||
* Subscribe to global sync events
|
||||
*
|
||||
* Get global sync events
|
||||
*/
|
||||
public subscribe<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).sse.get<GlobalSyncEventSubscribeResponses, unknown, ThrowOnError>({
|
||||
url: "/global/sync-event",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class Config extends HeyApiClient {
|
||||
/**
|
||||
* Get global configuration
|
||||
|
|
@ -329,6 +344,11 @@ export class Global extends HeyApiClient {
|
|||
})
|
||||
}
|
||||
|
||||
private _syncEvent?: SyncEvent
|
||||
get syncEvent(): SyncEvent {
|
||||
return (this._syncEvent ??= new SyncEvent({ client: this.client }))
|
||||
}
|
||||
|
||||
private _config?: Config
|
||||
get config(): Config {
|
||||
return (this._config ??= new Config({ client: this.client }))
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue