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

@@ -2,6 +2,7 @@ import { createLogger, createPool, itNotify, loadServiceSettings, withTx } from
import { parseKey } from "./crypto.js";
import { buildApi } from "./http-api.js";
import { SyncTrigger } from "./webhook.js";
import { discoveryEndpoints } from "./discovery.js";
import { QboAuth } from "./service.js";
import { qboAuthSchema } from "./settings.js";
import { PgStore } from "./store.js";
@@ -19,6 +20,7 @@ const auth = new QboAuth({
redirectUri: s.redirectUri,
scope: s.scope,
keepAliveHours: s.keepAliveHours,
endpoints: discoveryEndpoints(s.environment, async (url) => (await fetch(url, { headers: { Accept: "application/json" } })).json(), Date.now, (msg, extra) => log.warn(extra ?? {}, msg)),
notify: async (text) => {
await itNotify(common, text).catch(() => false);
},