feat(core): initial implementation of syncing (#17814)

This commit is contained in:
James Long 2026-03-25 10:47:40 -04:00 committed by GitHub
parent 0c0c6f3bdb
commit b0017bf1b9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
32 changed files with 4403 additions and 1760 deletions

View file

@ -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