@tenkeybridge/mcp 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -33,12 +33,14 @@ type McpAuth = {
33
33
  refreshToken: string;
34
34
  };
35
35
  interface McpConfig {
36
- realmId: string;
36
+ companyId: string;
37
37
  baseUrl?: string;
38
38
  auth: McpAuth;
39
39
  tokenFile?: string;
40
+ /** Human-readable notes the CLI prints to stderr (deprecated env vars). */
41
+ deprecations: string[];
40
42
  }
41
- declare function defaultTokenFile(realmId: string): string;
43
+ declare function defaultTokenFile(companyId: string): string;
42
44
  declare function loadConfig(env: Record<string, string | undefined>): McpConfig;
43
45
  declare function readStoredRefreshToken(file: string): string | undefined;
44
46
  declare function persistRefreshToken(file: string, refreshToken: string): void;
@@ -73,6 +75,6 @@ declare function resolveEntityName(name: string): EntityName | undefined;
73
75
  type CatalogSummaryRow = Pick<CatalogEntry, "entity" | "verdict" | "group" | "read" | "write" | "headline" | "usage">;
74
76
  declare function catalogSummary(): CatalogSummaryRow[];
75
77
 
76
- declare const PKG_VERSION = "0.3.0";
78
+ declare const PKG_VERSION = "0.4.0";
77
79
 
78
80
  export { CATALOG, type CatalogEntry, type CatalogField, type CatalogSummaryRow, type CatalogUnsupported, type EntityAccessorLike, type GatewayClient, type McpAuth, type McpConfig, PKG_VERSION, SERVER_NAME, buildServer, catalogSummary, defaultTokenFile, loadConfig, persistRefreshToken, readStoredRefreshToken, registerResources, registerTools, resolveCatalog, resolveEntityName };
package/dist/index.d.ts CHANGED
@@ -33,12 +33,14 @@ type McpAuth = {
33
33
  refreshToken: string;
34
34
  };
35
35
  interface McpConfig {
36
- realmId: string;
36
+ companyId: string;
37
37
  baseUrl?: string;
38
38
  auth: McpAuth;
39
39
  tokenFile?: string;
40
+ /** Human-readable notes the CLI prints to stderr (deprecated env vars). */
41
+ deprecations: string[];
40
42
  }
41
- declare function defaultTokenFile(realmId: string): string;
43
+ declare function defaultTokenFile(companyId: string): string;
42
44
  declare function loadConfig(env: Record<string, string | undefined>): McpConfig;
43
45
  declare function readStoredRefreshToken(file: string): string | undefined;
44
46
  declare function persistRefreshToken(file: string, refreshToken: string): void;
@@ -73,6 +75,6 @@ declare function resolveEntityName(name: string): EntityName | undefined;
73
75
  type CatalogSummaryRow = Pick<CatalogEntry, "entity" | "verdict" | "group" | "read" | "write" | "headline" | "usage">;
74
76
  declare function catalogSummary(): CatalogSummaryRow[];
75
77
 
76
- declare const PKG_VERSION = "0.3.0";
78
+ declare const PKG_VERSION = "0.4.0";
77
79
 
78
80
  export { CATALOG, type CatalogEntry, type CatalogField, type CatalogSummaryRow, type CatalogUnsupported, type EntityAccessorLike, type GatewayClient, type McpAuth, type McpConfig, PKG_VERSION, SERVER_NAME, buildServer, catalogSummary, defaultTokenFile, loadConfig, persistRefreshToken, readStoredRefreshToken, registerResources, registerTools, resolveCatalog, resolveEntityName };
package/dist/index.js CHANGED
@@ -106,14 +106,14 @@ var CATALOG = {
106
106
  "group": "gaps",
107
107
  "read": "none",
108
108
  "write": "none",
109
- "headline": "QuickBooks Desktop's qbXML API has no attachments interface \u2014 the word 'Attachment' does not occur anywhere in the qbxmlops130 message set.",
109
+ "headline": "Unsupported on QuickBooks Desktop, with no opt-in and no workaround inside TenkeyBridge. qbXML has no attachments interface (the word 'Attachment' does not occur anywhere in the qbxmlops130 message set), and TenkeyBridge does not store files itself.",
110
110
  "fields": [],
111
111
  "unsupported": [
112
112
  {
113
113
  "case": "read",
114
114
  "error": "UNSUPPORTED_BY_DESKTOP",
115
115
  "note": "Re-audited 2026-07-29: zero occurrences of any attachment message (no AttachmentAdd/Query/Ref of any kind) across the full qbxmlops130 schema. Desktop's Attached Documents feature is UI-only; files attached in Desktop cannot be listed or fetched through TenkeyBridge.",
116
- "workaround": "Store documents in your own system keyed by the TenkeyBridge entity Id \u2014 that is what QBD integrations have always had to do."
116
+ "workaround": "Store documents in your own system keyed by the TenkeyBridge entity Id, which is what QuickBooks Desktop integrations have always had to do. Branch on UNSUPPORTED_BY_DESKTOP and skip the Attachable call for Desktop-backed companies."
117
117
  },
118
118
  {
119
119
  "case": "query",
@@ -144,7 +144,7 @@ var CATALOG = {
144
144
  "read": "full",
145
145
  "write": "full",
146
146
  "headline": "Batch envelope \u2014 up to 30 create/update/delete/query operations in one request, executed sequentially with per-item faults.",
147
- "usage": "POST /v3/company/{realmId}/batch",
147
+ "usage": "POST /v3/company/{companyId}/batch",
148
148
  "fields": [
149
149
  {
150
150
  "qbo": "bId",
@@ -191,7 +191,7 @@ var CATALOG = {
191
191
  {
192
192
  "case": "entity CRUD or /query on Batch itself",
193
193
  "error": "UNSUPPORTED_BY_DESKTOP",
194
- "note": "Batch is a platform endpoint, not an entity \u2014 POST /v3/company/{realmId}/batch."
194
+ "note": "Batch is a platform endpoint, not an entity \u2014 POST /v3/company/{companyId}/batch."
195
195
  }
196
196
  ]
197
197
  },
@@ -404,7 +404,7 @@ var CATALOG = {
404
404
  "case": "query \u2014 SELECT * cannot enumerate every budget",
405
405
  "error": "UNSUPPORTED_QUERY",
406
406
  "note": "qbXML cannot list budgets: BudgetSummaryReportQueryRq requires a FiscalYear. SELECT * FROM Budget probes a fixed window \u2014 the current calendar year, the one before it, and the one after it \u2014 against both statement types (six report requests in one round-trip) and returns the ones that come back with budgeted amounts. A budget outside that window is invisible to SELECT *. Because the probe is speculative, the query never faults on an individual report's status: a company with no budgets gets an empty list, exactly as QBO answers. GET by id has one report and does surface its status.",
407
- "workaround": "Fetch it by id: GET /v3/company/{realmId}/budget/{fiscalYear}-{BudgetType}, e.g. 2023-ProfitAndLoss, which issues exactly one report request for that year."
407
+ "workaround": "Fetch it by id: GET /v3/company/{companyId}/budget/{fiscalYear}-{BudgetType}, e.g. 2023-ProfitAndLoss, which issues exactly one report request for that year."
408
408
  },
409
409
  {
410
410
  "case": "query \u2014 WHERE on anything but Id, ORDERBY, COUNT(*), column lists",
@@ -453,7 +453,7 @@ var CATALOG = {
453
453
  "read": "full",
454
454
  "write": "none",
455
455
  "headline": "Change Data Capture \u2014 one poll returns changed + deleted records across entities.",
456
- "usage": "GET /v3/company/{realmId}/cdc?entities=Invoice,Customer&changedSince=2026-07-01",
456
+ "usage": "GET /v3/company/{companyId}/cdc?entities=Invoice,Customer&changedSince=2026-07-01",
457
457
  "fields": [
458
458
  {
459
459
  "qbo": "entities",
@@ -570,7 +570,7 @@ var CATALOG = {
570
570
  "group": "company",
571
571
  "read": "full",
572
572
  "write": "none",
573
- "headline": "Read-only; Id equals the realm ID, no Desktop write path",
573
+ "headline": "Read-only; Id equals the Company ID, no Desktop write path",
574
574
  "fields": [
575
575
  {
576
576
  "qbo": "CompanyName",
@@ -710,6 +710,17 @@ var CATALOG = {
710
710
  "qbo": "CustomerRef",
711
711
  "support": "full"
712
712
  },
713
+ {
714
+ "qbo": "ClassRef",
715
+ "support": "full",
716
+ "note": "Header-level class (Desktop ClassRef, read and write). Line-level ClassRef is separate."
717
+ },
718
+ {
719
+ "qbo": "DepartmentRef",
720
+ "support": "none",
721
+ "note": "UNMAPPED_FIELD by default. With Departments from classes turned on for the company file, the gateway maps it to the header ClassRef (written to it, read from it); sending a different ClassRef as well is a 400.",
722
+ "error": "UNMAPPED_FIELD"
723
+ },
713
724
  {
714
725
  "qbo": "TxnDate",
715
726
  "support": "full"
@@ -1001,35 +1012,84 @@ var CATALOG = {
1001
1012
  "group": "gaps",
1002
1013
  "read": "none",
1003
1014
  "write": "none",
1004
- "headline": "QBO Departments (locations) have no Desktop equivalent \u2014 the only 'Department'/'Location' strings in qbXML are free-text fields on Employee, FixedAsset, and Lead, and Desktop's one real dimensional list (Class) is already exposed faithfully as Class.",
1005
- "fields": [],
1015
+ "headline": "QuickBooks Desktop has no Department (location) list, so Department is unsupported by default. Opt in per company file with Departments from classes and Department becomes an alias of Class (DepartmentRef on a transaction becomes its header ClassRef).",
1016
+ "fields": [
1017
+ {
1018
+ "qbo": "Id",
1019
+ "support": "partial",
1020
+ "note": "Only with Departments from classes on: the Class ListID."
1021
+ },
1022
+ {
1023
+ "qbo": "Name",
1024
+ "support": "partial",
1025
+ "note": "Only with Departments from classes on: the Class Name (31 characters max)."
1026
+ },
1027
+ {
1028
+ "qbo": "SubDepartment",
1029
+ "support": "partial",
1030
+ "note": "Only with Departments from classes on: read-only, true when the class has a parent."
1031
+ },
1032
+ {
1033
+ "qbo": "ParentRef",
1034
+ "support": "partial",
1035
+ "note": "Only with Departments from classes on: the parent class."
1036
+ },
1037
+ {
1038
+ "qbo": "FullyQualifiedName",
1039
+ "support": "partial",
1040
+ "note": "Only with Departments from classes on: the class full name (Parent:Child). Read-only."
1041
+ },
1042
+ {
1043
+ "qbo": "Active",
1044
+ "support": "partial",
1045
+ "note": "Only with Departments from classes on: class IsActive. Deactivate with Active:false."
1046
+ },
1047
+ {
1048
+ "qbo": "SyncToken",
1049
+ "support": "partial",
1050
+ "note": "Only with Departments from classes on: the class EditSequence."
1051
+ },
1052
+ {
1053
+ "qbo": "MetaData",
1054
+ "support": "partial",
1055
+ "note": "Only with Departments from classes on: class TimeCreated / TimeModified."
1056
+ }
1057
+ ],
1006
1058
  "unsupported": [
1007
1059
  {
1008
1060
  "case": "read",
1009
1061
  "error": "UNSUPPORTED_BY_DESKTOP",
1010
- "note": "Re-audited 2026-07-29 against the qbxmlops130 message set: qbXML has no Department or Location list \u2014 no Add/Mod/Query message pair exists. The tokens only appear as plain STRTYPE fields (Employee.Department, FixedAsset.Location, Lead.Location), which are annotations, not a queryable list.",
1011
- "workaround": "If your integration treats QBO locations as just another dimension, remap DepartmentRef onto Class in your own code \u2014 Class is live in TenkeyBridge. We decided against a built-in Department\u2192Class alias, even opt-in: ClassRef already maps to Class, so aliasing would make two QBO fields silently write one Desktop list and collide when a client sends both."
1062
+ "note": "Off by default. Re-audited 2026-07-29 against the qbxmlops130 message set: qbXML has no Department or Location list (no Add/Mod/Query message pair). The tokens only appear as plain STRTYPE fields (Employee.Department, FixedAsset.Location, Lead.Location), which are annotations, not a queryable list.",
1063
+ "workaround": "Turn on Departments from classes for the company file (portal: company file page, Departments card; or PATCH /admin/v1/companies/{companyId}/settings with departmentsFromClasses: true). Department then reads your QuickBooks classes. See the Departments guide."
1012
1064
  },
1013
1065
  {
1014
1066
  "case": "query",
1015
1067
  "error": "UNSUPPORTED_BY_DESKTOP",
1016
- "note": "qbXML has no Department/Location list to query \u2014 confirmed absent from the qbxmlops130 message set.",
1017
- "workaround": "Query Class instead if you remap locations client-side; that remapping is your call, TenkeyBridge never reinterprets DepartmentRef silently."
1068
+ "note": "Off by default: no Department list to query. With Departments from classes on, SELECT ... FROM Department is run against Class and answered as Department; DepartmentRef in a transaction query means its ClassRef.",
1069
+ "workaround": "Turn on Departments from classes, or query Class directly."
1018
1070
  },
1019
1071
  {
1020
1072
  "case": "create",
1021
1073
  "error": "UNSUPPORTED_BY_DESKTOP",
1022
- "note": "Desktop has no Department create. Use Class if you need a dimensional axis on Desktop."
1074
+ "note": "Off by default. With Departments from classes on, creating a Department creates a Class (ParentRef makes it a sub-class).",
1075
+ "workaround": "Turn on Departments from classes, or create a Class."
1023
1076
  },
1024
1077
  {
1025
1078
  "case": "update",
1026
1079
  "error": "UNSUPPORTED_BY_DESKTOP",
1027
- "note": "Desktop has no Department update."
1080
+ "note": "Off by default. With Departments from classes on, an update edits the Class (sparse; Name, Active, ParentRef).",
1081
+ "workaround": "Turn on Departments from classes, or update the Class."
1028
1082
  },
1029
1083
  {
1030
1084
  "case": "delete",
1031
1085
  "error": "UNSUPPORTED_BY_DESKTOP",
1032
- "note": "Desktop has no Department delete."
1086
+ "note": "Always unsupported: a Desktop class cannot be deleted through qbXML. Deactivate with Active:false."
1087
+ },
1088
+ {
1089
+ "case": "DepartmentRef on a transaction",
1090
+ "error": "UNSUPPORTED_BY_DESKTOP",
1091
+ "note": "With Departments from classes on it maps to the header ClassRef on Invoice, SalesReceipt, Estimate, CreditMemo, PurchaseOrder and TimeActivity. Sending a different ClassRef as well is a 400. Bill, Purchase, VendorCredit, JournalEntry, Deposit, RefundReceipt and Transfer have no header class in QuickBooks Desktop (class lives on the lines), so DepartmentRef there is a 422 that says to set ClassRef per line. Off: UNMAPPED_FIELD.",
1092
+ "workaround": "Set ClassRef on each line for those transactions."
1033
1093
  }
1034
1094
  ]
1035
1095
  },
@@ -1204,8 +1264,8 @@ var CATALOG = {
1204
1264
  "group": "platform",
1205
1265
  "read": "partial",
1206
1266
  "write": "none",
1207
- "headline": "GET /v3/company/{realmId}/entitlements \u2014 a static, honest capability document for a QuickBooks Desktop company (no per-file subscription data).",
1208
- "usage": "GET /v3/company/{realmId}/entitlements",
1267
+ "headline": "GET /v3/company/{companyId}/entitlements \u2014 a static, honest capability document for a QuickBooks Desktop company (no per-file subscription data).",
1268
+ "usage": "GET /v3/company/{companyId}/entitlements",
1209
1269
  "fields": [
1210
1270
  {
1211
1271
  "qbo": "Entitlements.platform",
@@ -1238,6 +1298,17 @@ var CATALOG = {
1238
1298
  "qbo": "CustomerRef",
1239
1299
  "support": "full"
1240
1300
  },
1301
+ {
1302
+ "qbo": "ClassRef",
1303
+ "support": "full",
1304
+ "note": "Header-level class (Desktop ClassRef, read and write). Line-level ClassRef is separate."
1305
+ },
1306
+ {
1307
+ "qbo": "DepartmentRef",
1308
+ "support": "none",
1309
+ "note": "UNMAPPED_FIELD by default. With Departments from classes turned on for the company file, the gateway maps it to the header ClassRef (written to it, read from it); sending a different ClassRef as well is a 400.",
1310
+ "error": "UNMAPPED_FIELD"
1311
+ },
1241
1312
  {
1242
1313
  "qbo": "TxnDate",
1243
1314
  "support": "full"
@@ -1467,6 +1538,17 @@ var CATALOG = {
1467
1538
  "qbo": "CustomerRef",
1468
1539
  "support": "full"
1469
1540
  },
1541
+ {
1542
+ "qbo": "ClassRef",
1543
+ "support": "full",
1544
+ "note": "Header-level class (Desktop ClassRef, read and write). Line-level ClassRef is separate."
1545
+ },
1546
+ {
1547
+ "qbo": "DepartmentRef",
1548
+ "support": "none",
1549
+ "note": "UNMAPPED_FIELD by default. With Departments from classes turned on for the company file, the gateway maps it to the header ClassRef (written to it, read from it); sending a different ClassRef as well is a 400.",
1550
+ "error": "UNMAPPED_FIELD"
1551
+ },
1470
1552
  {
1471
1553
  "qbo": "TxnDate",
1472
1554
  "support": "full"
@@ -1947,7 +2029,7 @@ var CATALOG = {
1947
2029
  {
1948
2030
  "qbo": "AccountingInfoPrefs",
1949
2031
  "support": "partial",
1950
- "note": "ClassTrackingPerTxn/ClassTrackingPerTxnLine \u2190 IsUsingClassTracking (same bool projected to both); TrackDepartments always false (no Desktop Locations)."
2032
+ "note": "ClassTrackingPerTxn/ClassTrackingPerTxnLine \u2190 IsUsingClassTracking (same bool projected to both); TrackDepartments is false, or true when the company file has Departments from classes turned on (Department is then an alias of Class)."
1951
2033
  },
1952
2034
  {
1953
2035
  "qbo": "CurrencyPrefs",
@@ -2110,6 +2192,17 @@ var CATALOG = {
2110
2192
  "qbo": "VendorRef",
2111
2193
  "support": "full"
2112
2194
  },
2195
+ {
2196
+ "qbo": "ClassRef",
2197
+ "support": "full",
2198
+ "note": "Header-level class (Desktop ClassRef, read and write). Line-level ClassRef is separate."
2199
+ },
2200
+ {
2201
+ "qbo": "DepartmentRef",
2202
+ "support": "none",
2203
+ "note": "UNMAPPED_FIELD by default. With Departments from classes turned on for the company file, the gateway maps it to the header ClassRef (written to it, read from it); sending a different ClassRef as well is a 400.",
2204
+ "error": "UNMAPPED_FIELD"
2205
+ },
2113
2206
  {
2114
2207
  "qbo": "TxnDate",
2115
2208
  "support": "full"
@@ -2347,7 +2440,7 @@ var CATALOG = {
2347
2440
  "read": "partial",
2348
2441
  "write": "none",
2349
2442
  "headline": "Twenty QBO-compatible reports translated live from Desktop's report engine: summary, detail, aging, balance and sales reports, all run against QuickBooks Enterprise 24. There is no CashFlow \u2014 Desktop's SDK has no cash-flow report.",
2350
- "usage": "GET /v3/company/{realmId}/reports/ProfitAndLoss?start_date=2026-01-01&end_date=2026-12-31&summarize_column_by=Month",
2443
+ "usage": "GET /v3/company/{companyId}/reports/ProfitAndLoss?start_date=2026-01-01&end_date=2026-12-31&summarize_column_by=Month",
2351
2444
  "fields": [
2352
2445
  {
2353
2446
  "qbo": "ProfitAndLoss / BalanceSheet / TrialBalance",
@@ -2473,6 +2566,17 @@ var CATALOG = {
2473
2566
  "qbo": "CustomerRef",
2474
2567
  "support": "full"
2475
2568
  },
2569
+ {
2570
+ "qbo": "ClassRef",
2571
+ "support": "full",
2572
+ "note": "Header-level class (Desktop ClassRef, read and write). Line-level ClassRef is separate."
2573
+ },
2574
+ {
2575
+ "qbo": "DepartmentRef",
2576
+ "support": "none",
2577
+ "note": "UNMAPPED_FIELD by default. With Departments from classes turned on for the company file, the gateway maps it to the header ClassRef (written to it, read from it); sending a different ClassRef as well is a 400.",
2578
+ "error": "UNMAPPED_FIELD"
2579
+ },
2476
2580
  {
2477
2581
  "qbo": "TxnDate",
2478
2582
  "support": "full"
@@ -2921,6 +3025,12 @@ var CATALOG = {
2921
3025
  "qbo": "ClassRef",
2922
3026
  "support": "full"
2923
3027
  },
3028
+ {
3029
+ "qbo": "DepartmentRef",
3030
+ "support": "none",
3031
+ "note": "UNMAPPED_FIELD by default. With Departments from classes turned on for the company file, the gateway maps it to the header ClassRef (written to it, read from it); sending a different ClassRef as well is a 400.",
3032
+ "error": "UNMAPPED_FIELD"
3033
+ },
2924
3034
  {
2925
3035
  "qbo": "Description",
2926
3036
  "support": "full",
@@ -3520,7 +3630,7 @@ function registerTools(server, client) {
3520
3630
  }
3521
3631
 
3522
3632
  // src/version.ts
3523
- var PKG_VERSION = "0.3.0";
3633
+ var PKG_VERSION = "0.4.0";
3524
3634
 
3525
3635
  // src/server.ts
3526
3636
  var SERVER_NAME = "tenkeybridge";
@@ -3536,19 +3646,25 @@ import { mkdirSync, readFileSync, writeFileSync } from "fs";
3536
3646
  import { homedir } from "os";
3537
3647
  import { dirname, join } from "path";
3538
3648
  var PORTAL_URL = "https://api.tenkeybridge.com/portal";
3539
- function defaultTokenFile(realmId) {
3540
- return join(homedir(), ".tenkeybridge", `mcp-tokens-${realmId}.json`);
3649
+ function defaultTokenFile(companyId) {
3650
+ return join(homedir(), ".tenkeybridge", `mcp-tokens-${companyId}.json`);
3541
3651
  }
3542
3652
  function loadConfig(env) {
3543
- const realmId = env.TKB_REALM_ID;
3544
- if (!realmId) {
3653
+ const fromNew = env.TKB_COMPANY_ID;
3654
+ const fromOld = env.TKB_REALM_ID;
3655
+ if (fromNew && fromOld && fromNew !== fromOld) {
3656
+ throw new Error("TKB_COMPANY_ID and TKB_REALM_ID (deprecated) disagree \u2014 set TKB_COMPANY_ID only.");
3657
+ }
3658
+ const companyId = fromNew || fromOld;
3659
+ if (!companyId) {
3545
3660
  throw new Error(
3546
- `TKB_REALM_ID is required \u2014 the realm id of the connected company file (shown in the portal: ${PORTAL_URL}).`
3661
+ `TKB_COMPANY_ID is required \u2014 the Company ID of the connected QuickBooks company file (shown in the portal: ${PORTAL_URL}).`
3547
3662
  );
3548
3663
  }
3664
+ const deprecations = !fromNew && fromOld ? ["TKB_REALM_ID is deprecated; set TKB_COMPANY_ID instead."] : [];
3549
3665
  const baseUrl = env.TKB_BASE_URL;
3550
3666
  if (env.TKB_ACCESS_TOKEN) {
3551
- return { realmId, ...baseUrl ? { baseUrl } : {}, auth: { accessToken: env.TKB_ACCESS_TOKEN } };
3667
+ return { companyId, deprecations, ...baseUrl ? { baseUrl } : {}, auth: { accessToken: env.TKB_ACCESS_TOKEN } };
3552
3668
  }
3553
3669
  const clientId = env.TKB_CLIENT_ID;
3554
3670
  const clientSecret = env.TKB_CLIENT_SECRET;
@@ -3560,13 +3676,14 @@ function loadConfig(env) {
3560
3676
  !refreshToken && "TKB_REFRESH_TOKEN"
3561
3677
  ].filter(Boolean).join(", ");
3562
3678
  throw new Error(
3563
- `Missing ${missing}. Set either TKB_ACCESS_TOKEN, or all of TKB_CLIENT_ID + TKB_CLIENT_SECRET + TKB_REFRESH_TOKEN (create an OAuth client in the portal: ${PORTAL_URL}).`
3679
+ `Missing ${missing}. Set either TKB_ACCESS_TOKEN, or all of TKB_CLIENT_ID + TKB_CLIENT_SECRET + TKB_REFRESH_TOKEN (create an OAuth app in the portal: ${PORTAL_URL}).`
3564
3680
  );
3565
3681
  }
3566
- const tokenFile = env.TKB_TOKEN_FILE ?? defaultTokenFile(realmId);
3682
+ const tokenFile = env.TKB_TOKEN_FILE ?? defaultTokenFile(companyId);
3567
3683
  const stored = readStoredRefreshToken(tokenFile);
3568
3684
  return {
3569
- realmId,
3685
+ companyId,
3686
+ deprecations,
3570
3687
  ...baseUrl ? { baseUrl } : {},
3571
3688
  tokenFile,
3572
3689
  auth: { clientId, clientSecret, refreshToken: stored ?? refreshToken }