qbo_auth: discovery-документ, клиент API с разбором Fault, отключение с отзывом токена; анкета и требования Intuit
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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);
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user