feat(core): initial implementation of syncing (#17814)
This commit is contained in:
@@ -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
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user