Release automatic callback setup in SDK 0.2.0
Hop-State: A_06FPARPGMNVEAN3XBVH0QD8 Hop-Proposal: R_06FPARNXMP3DGP5VQGGX4Z8 Hop-Task: T_06FPAR9KH2V5ED7V65JEN00 Hop-Attempt: AT_06FPAR9KH3NZ1CV8RGPJDSG
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import type { CreateConnectionRequestInput } from "../src/index.js";
|
||||
|
||||
const fields = {
|
||||
callbackUrl: "https://app.example/stuffbox/callback",
|
||||
codeChallenge: "c".repeat(43),
|
||||
scopes: ["assets:read"] as const,
|
||||
state: "state-with-enough-entropy",
|
||||
};
|
||||
|
||||
const automatic: CreateConnectionRequestInput = fields;
|
||||
const returning: CreateConnectionRequestInput = { ...fields, clientId: "app_public" };
|
||||
const legacyAutomatic: CreateConnectionRequestInput = { ...fields, selfHosted: true };
|
||||
const legacyReturning: CreateConnectionRequestInput = {
|
||||
...fields,
|
||||
clientId: "app_public",
|
||||
selfHosted: false,
|
||||
};
|
||||
|
||||
// @ts-expect-error An automatic request cannot also send a client ID.
|
||||
const mixed: CreateConnectionRequestInput = { ...fields, clientId: "app_public", selfHosted: true };
|
||||
// @ts-expect-error The old false marker requires a client ID.
|
||||
const missingClient: CreateConnectionRequestInput = { ...fields, selfHosted: false };
|
||||
|
||||
void [automatic, returning, legacyAutomatic, legacyReturning, mixed, missingClient];
|
||||
Reference in New Issue
Block a user