chore(fmt): format changes and broken types
This commit is contained in:
parent
438991b6a4
commit
c9a8b6f82f
File diff suppressed because it is too large
Load Diff
@ -63,11 +63,11 @@ async function issuePairingScopedOperator(name: string): Promise<{
|
||||
role: "operator",
|
||||
scopes: ["operator.pairing"],
|
||||
});
|
||||
expect(rotated?.token).toBeTruthy();
|
||||
expect(rotated.ok ? rotated.entry.token : "").toBeTruthy();
|
||||
return {
|
||||
identityPath: loaded.identityPath,
|
||||
deviceId: loaded.identity.deviceId,
|
||||
token: String(rotated?.token ?? ""),
|
||||
token: rotated.ok ? rotated.entry.token : "",
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -85,6 +85,11 @@ export type ApproveDevicePairingResult =
|
||||
| { status: "forbidden"; missingScope: string }
|
||||
| null;
|
||||
|
||||
type ApprovedDevicePairingResult = Extract<
|
||||
NonNullable<ApproveDevicePairingResult>,
|
||||
{ status: "approved" }
|
||||
>;
|
||||
|
||||
type DevicePairingStateFile = {
|
||||
pendingById: Record<string, DevicePairingPendingRequest>;
|
||||
pairedByDeviceId: Record<string, PairedDevice>;
|
||||
@ -343,6 +348,15 @@ export async function requestDevicePairing(
|
||||
});
|
||||
}
|
||||
|
||||
export async function approveDevicePairing(
|
||||
requestId: string,
|
||||
baseDir?: string,
|
||||
): Promise<ApprovedDevicePairingResult | null>;
|
||||
export async function approveDevicePairing(
|
||||
requestId: string,
|
||||
options: { callerScopes?: readonly string[] },
|
||||
baseDir?: string,
|
||||
): Promise<ApproveDevicePairingResult>;
|
||||
export async function approveDevicePairing(
|
||||
requestId: string,
|
||||
optionsOrBaseDir?: { callerScopes?: readonly string[] } | string,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user