qbo_auth: discovery-документ, клиент API с разбором Fault, отключение с отзывом токена; анкета и требования Intuit
All checks were successful
ci / test (push) Successful in 39s
ci / deploy (push) Successful in 2m41s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-19 20:18:06 +03:00
parent 98930c5b40
commit 46d0fbab6d
12 changed files with 482 additions and 53 deletions

View File

@@ -20,6 +20,8 @@ export interface Connection {
export interface LockedConn {
get(): Connection | null;
save(c: Connection): Promise<void>;
/** Удалить соединение (токены) совсем. */
remove(): Promise<void>;
}
export interface Store {
@@ -87,6 +89,9 @@ export class PgStore implements Store {
[c.environment, c.realmId, encrypt(c.accessToken, this.key), encrypt(c.refreshToken, this.key), c.accessExpiresAt, c.refreshExpiresAt, c.authorizedAt, c.refreshedAt, c.status],
);
},
remove: async () => {
await client.query("delete from qbo_connection where environment = $1", [env]);
},
});
});
}
@@ -114,6 +119,9 @@ export class MemoryStore implements Store {
save: async (c) => {
this.conns.set(env, c);
},
remove: async () => {
this.conns.delete(env);
},
});
}
}