mirror of
https://github.com/wkulhanek/bonob.git
synced 2025-12-22 01:43:29 +01:00
SmapiAuthTokens that expire, with sonos refreshAuthToken functionality (#81)
Bearer token to Authorization header for stream requests Versioned SMAPI Tokens
This commit is contained in:
12
src/clock.ts
12
src/clock.ts
@@ -14,3 +14,15 @@ export interface Clock {
|
||||
}
|
||||
|
||||
export const SystemClock = { now: () => dayjs() };
|
||||
|
||||
export class FixedClock implements Clock {
|
||||
time: Dayjs;
|
||||
|
||||
constructor(time: Dayjs = dayjs()) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
add = (t: number, unit: dayjs.UnitTypeShort) => this.time = this.time.add(t, unit)
|
||||
|
||||
now = () => this.time;
|
||||
}
|
||||
Reference in New Issue
Block a user