noxctl 0.1.0 → 0.2.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/README.md +186 -29
- package/dist/auth.d.ts +15 -7
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +123 -22
- package/dist/auth.js.map +1 -1
- package/dist/cli.d.ts +2 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +948 -16
- package/dist/cli.js.map +1 -1
- package/dist/config-paths.d.ts +2 -0
- package/dist/config-paths.d.ts.map +1 -0
- package/dist/config-paths.js +7 -0
- package/dist/config-paths.js.map +1 -0
- package/dist/credentials-store.d.ts +13 -3
- package/dist/credentials-store.d.ts.map +1 -1
- package/dist/credentials-store.js +154 -48
- package/dist/credentials-store.js.map +1 -1
- package/dist/fortnox-client.d.ts.map +1 -1
- package/dist/fortnox-client.js +14 -2
- package/dist/fortnox-client.js.map +1 -1
- package/dist/index.d.ts +15 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +86 -2
- package/dist/index.js.map +1 -1
- package/dist/operations/costcenters.d.ts +20 -0
- package/dist/operations/costcenters.d.ts.map +1 -0
- package/dist/operations/costcenters.js +38 -0
- package/dist/operations/costcenters.js.map +1 -0
- package/dist/operations/invoice-payments.d.ts +21 -0
- package/dist/operations/invoice-payments.d.ts.map +1 -0
- package/dist/operations/invoice-payments.js +40 -0
- package/dist/operations/invoice-payments.js.map +1 -0
- package/dist/operations/offers.d.ts +25 -0
- package/dist/operations/offers.d.ts.map +1 -0
- package/dist/operations/offers.js +48 -0
- package/dist/operations/offers.js.map +1 -0
- package/dist/operations/orders.d.ts +24 -0
- package/dist/operations/orders.d.ts.map +1 -0
- package/dist/operations/orders.js +44 -0
- package/dist/operations/orders.js.map +1 -0
- package/dist/operations/pricelists.d.ts +36 -0
- package/dist/operations/pricelists.d.ts.map +1 -0
- package/dist/operations/pricelists.js +52 -0
- package/dist/operations/pricelists.js.map +1 -0
- package/dist/operations/projects.d.ts +19 -0
- package/dist/operations/projects.d.ts.map +1 -0
- package/dist/operations/projects.js +33 -0
- package/dist/operations/projects.js.map +1 -0
- package/dist/operations/supplier-invoice-payments.d.ts +20 -0
- package/dist/operations/supplier-invoice-payments.d.ts.map +1 -0
- package/dist/operations/supplier-invoice-payments.js +34 -0
- package/dist/operations/supplier-invoice-payments.js.map +1 -0
- package/dist/operations/taxreductions.d.ts +19 -0
- package/dist/operations/taxreductions.d.ts.map +1 -0
- package/dist/operations/taxreductions.js +28 -0
- package/dist/operations/taxreductions.js.map +1 -0
- package/dist/profile-name.d.ts +9 -0
- package/dist/profile-name.d.ts.map +1 -0
- package/dist/profile-name.js +58 -0
- package/dist/profile-name.js.map +1 -0
- package/dist/profiles.d.ts +55 -0
- package/dist/profiles.d.ts.map +1 -0
- package/dist/profiles.js +210 -0
- package/dist/profiles.js.map +1 -0
- package/dist/tools/costcenters.d.ts +3 -0
- package/dist/tools/costcenters.d.ts.map +1 -0
- package/dist/tools/costcenters.js +79 -0
- package/dist/tools/costcenters.js.map +1 -0
- package/dist/tools/invoice-payments.d.ts +3 -0
- package/dist/tools/invoice-payments.d.ts.map +1 -0
- package/dist/tools/invoice-payments.js +60 -0
- package/dist/tools/invoice-payments.js.map +1 -0
- package/dist/tools/offers.d.ts +3 -0
- package/dist/tools/offers.d.ts.map +1 -0
- package/dist/tools/offers.js +130 -0
- package/dist/tools/offers.js.map +1 -0
- package/dist/tools/orders.d.ts +3 -0
- package/dist/tools/orders.d.ts.map +1 -0
- package/dist/tools/orders.js +114 -0
- package/dist/tools/orders.js.map +1 -0
- package/dist/tools/pricelists.d.ts +3 -0
- package/dist/tools/pricelists.d.ts.map +1 -0
- package/dist/tools/pricelists.js +104 -0
- package/dist/tools/pricelists.js.map +1 -0
- package/dist/tools/projects.d.ts +3 -0
- package/dist/tools/projects.d.ts.map +1 -0
- package/dist/tools/projects.js +80 -0
- package/dist/tools/projects.js.map +1 -0
- package/dist/tools/supplier-invoice-payments.d.ts +3 -0
- package/dist/tools/supplier-invoice-payments.d.ts.map +1 -0
- package/dist/tools/supplier-invoice-payments.js +60 -0
- package/dist/tools/supplier-invoice-payments.js.map +1 -0
- package/dist/tools/taxreductions.d.ts +3 -0
- package/dist/tools/taxreductions.d.ts.map +1 -0
- package/dist/tools/taxreductions.js +51 -0
- package/dist/tools/taxreductions.js.map +1 -0
- package/dist/views.d.ts +20 -0
- package/dist/views.d.ts.map +1 -1
- package/dist/views.js +177 -0
- package/dist/views.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -39,14 +39,21 @@ Fortnox product plans, API activation requirements, and integration licensing ca
|
|
|
39
39
|
- Copy your **Client ID** and **Client Secret**
|
|
40
40
|
4. On the **Integration** tab, enable these scopes under **Behörigheter** / **Permissions**:
|
|
41
41
|
|
|
42
|
-
| Swedish (SV) | English (EN) |
|
|
43
|
-
|
|
44
|
-
| Artikel | Article |
|
|
45
|
-
| Bokföring | Bookkeeping |
|
|
46
|
-
| Faktura | Invoice |
|
|
47
|
-
| Företagsinformation | Company Information |
|
|
48
|
-
| Inställningar | Settings |
|
|
49
|
-
| Kund | Customer |
|
|
42
|
+
| Swedish (SV) | English (EN) | Needed for |
|
|
43
|
+
|----------------------|---------------------|------------------------------------------------|
|
|
44
|
+
| Artikel | Article | Articles, prices, price lists |
|
|
45
|
+
| Bokföring | Bookkeeping | Vouchers, accounts, financial reports |
|
|
46
|
+
| Faktura | Invoice | Invoices, invoice payments, offers, orders, tax reductions |
|
|
47
|
+
| Företagsinformation | Company Information | Company info |
|
|
48
|
+
| Inställningar | Settings | Financial year, locked period |
|
|
49
|
+
| Kund | Customer | Customers |
|
|
50
|
+
| Leverantör | Supplier | Suppliers |
|
|
51
|
+
| Leverantörsfaktura | Supplier Invoice | Supplier invoices, supplier invoice payments |
|
|
52
|
+
| Projekt | Project | Projects |
|
|
53
|
+
| Kostnadsställe | Cost Center | Cost centers |
|
|
54
|
+
| Priser | Price | Price lists, prices |
|
|
55
|
+
|
|
56
|
+
Enable every scope for the resources you intend to use. Missing scopes surface as `403 Forbidden` with a hint pointing at the right one.
|
|
50
57
|
|
|
51
58
|
5. Save the integration
|
|
52
59
|
|
|
@@ -108,45 +115,199 @@ node dist/cli.js company info
|
|
|
108
115
|
|
|
109
116
|
You should see your company name, organisation number, and address. If this works, you're all set.
|
|
110
117
|
|
|
118
|
+
## Profiles (multi-tenant)
|
|
119
|
+
|
|
120
|
+
noxctl supports multiple Fortnox tenants from a single installation — useful if you bookkeep for several companies, or want to keep a sandbox tenant separate from production. Each profile has its own OAuth credentials in the OS secure store (macOS Keychain / Linux Secret Service / Windows DPAPI), keyed by profile name.
|
|
121
|
+
|
|
122
|
+
### Running against a specific profile
|
|
123
|
+
|
|
124
|
+
Three ways to pick the profile, in precedence order (highest wins):
|
|
125
|
+
|
|
126
|
+
1. **`--profile <name>` flag** — explicit, per-command
|
|
127
|
+
2. **`NOXCTL_PROFILE` environment variable** — scoped to a shell session
|
|
128
|
+
3. **Active pointer** — `~/.fortnox-mcp/active-profile`, set by `noxctl profile use`
|
|
129
|
+
|
|
130
|
+
If none of these is set, noxctl uses the `default` profile (what existing users have been using all along — no opt-in required).
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
noxctl init --profile staging # authorize a second tenant
|
|
134
|
+
noxctl --profile staging invoices list # one-off against staging
|
|
135
|
+
NOXCTL_PROFILE=staging noxctl company info # shell-scoped
|
|
136
|
+
noxctl profile use staging # sticky — persists to the pointer
|
|
137
|
+
noxctl profile current # show resolved profile + source
|
|
138
|
+
noxctl profile list # list known profiles
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### MCP server
|
|
142
|
+
|
|
143
|
+
When launched by Claude Desktop / claude.ai, the MCP server resolves the profile from `NOXCTL_PROFILE` and the active pointer at startup, and binds for the session. When launched via `noxctl --profile <name> serve`, the CLI forwards the flag.
|
|
144
|
+
|
|
145
|
+
To run multiple MCP servers (one per tenant) in parallel, register them with distinct names and scoped environments:
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
claude mcp add fortnox-prod -- npx noxctl serve
|
|
149
|
+
claude mcp add fortnox-staging -e NOXCTL_PROFILE=staging -- npx noxctl serve
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Non-default sessions print a `[profile: <name>]` stderr banner on startup and prefix every Fortnox API error and token-refresh failure with the same tag so mis-bound sessions are diagnosable from a single error line.
|
|
153
|
+
|
|
154
|
+
### Fail-closed pointer semantics
|
|
155
|
+
|
|
156
|
+
If the active pointer becomes unreadable or corrupt and no explicit `--profile` flag or `NOXCTL_PROFILE` is set, `noxctl serve` **refuses to start** rather than silently falling back to `default`. This prevents a corrupted pointer from routing production MCP sessions to the wrong tenant. The CLI's `doctor` and `profile use` commands are exempt — they can still run against a broken pointer so you can repair it.
|
|
157
|
+
|
|
111
158
|
## Tools
|
|
112
159
|
|
|
113
|
-
Every operation is available both as a CLI command and as an MCP tool. The CLI is the primary interface; the MCP server exposes the same operations to AI agents.
|
|
160
|
+
Every operation is available both as a CLI command and as an MCP tool. The CLI is the primary interface; the MCP server exposes the same operations to AI agents. All mutations — every row labeled `(mutation)` — prompt for confirmation on a TTY and require `--yes` (CLI) or `confirm: true` (MCP) when piped. See [Mutation safety](#mutation-safety).
|
|
114
161
|
|
|
115
162
|
### Customers
|
|
116
163
|
|
|
117
164
|
| CLI | MCP tool | Description |
|
|
118
165
|
|-----|----------|-------------|
|
|
119
166
|
| `noxctl customers list [--search <term>]` | `fortnox_list_customers` | List/search customers |
|
|
120
|
-
| `noxctl customers get <number>` | `fortnox_get_customer` | Get a single customer
|
|
121
|
-
| `noxctl customers create --name <name>` | `fortnox_create_customer` | Create a
|
|
122
|
-
| `noxctl customers update <number> --input <file>` | `fortnox_update_customer` | Update
|
|
167
|
+
| `noxctl customers get <number>` | `fortnox_get_customer` | Get a single customer |
|
|
168
|
+
| `noxctl customers create --name <name>` | `fortnox_create_customer` | Create a customer (mutation) |
|
|
169
|
+
| `noxctl customers update <number> --input <file>` | `fortnox_update_customer` | Update a customer (mutation) |
|
|
170
|
+
|
|
171
|
+
### Suppliers
|
|
172
|
+
|
|
173
|
+
| CLI | MCP tool | Description |
|
|
174
|
+
|-----|----------|-------------|
|
|
175
|
+
| `noxctl suppliers list [--search <term>]` | `fortnox_list_suppliers` | List/search suppliers |
|
|
176
|
+
| `noxctl suppliers get <number>` | `fortnox_get_supplier` | Get a single supplier |
|
|
177
|
+
| `noxctl suppliers create --name <name>` | `fortnox_create_supplier` | Create a supplier (mutation) |
|
|
178
|
+
| `noxctl suppliers update <number> --input <file>` | `fortnox_update_supplier` | Update a supplier (mutation) |
|
|
179
|
+
|
|
180
|
+
### Articles
|
|
181
|
+
|
|
182
|
+
| CLI | MCP tool | Description |
|
|
183
|
+
|-----|----------|-------------|
|
|
184
|
+
| `noxctl articles list [--search <term>]` | `fortnox_list_articles` | List/search articles |
|
|
185
|
+
| `noxctl articles get <number>` | `fortnox_get_article` | Get a single article |
|
|
186
|
+
| `noxctl articles create --description <text>` | `fortnox_create_article` | Create an article (mutation) |
|
|
187
|
+
| `noxctl articles update <number> --input <file>` | `fortnox_update_article` | Update an article (mutation) |
|
|
123
188
|
|
|
124
189
|
### Invoices
|
|
125
190
|
|
|
126
191
|
| CLI | MCP tool | Description |
|
|
127
192
|
|-----|----------|-------------|
|
|
128
193
|
| `noxctl invoices list [--filter <status>] [--customer <number>]` | `fortnox_list_invoices` | List/filter invoices. Filters: `cancelled`, `fullypaid`, `unpaid`, `unpaidoverdue`, `unbooked` |
|
|
129
|
-
| `noxctl invoices get <docNumber>` | `fortnox_get_invoice` | Get a single invoice
|
|
130
|
-
| `noxctl invoices create --customer <number> --input <file>` | `fortnox_create_invoice` | Create an invoice
|
|
194
|
+
| `noxctl invoices get <docNumber>` | `fortnox_get_invoice` | Get a single invoice |
|
|
195
|
+
| `noxctl invoices create --customer <number> --input <file>` | `fortnox_create_invoice` | Create an invoice (mutation) |
|
|
131
196
|
| `noxctl invoices update <docNumber> --input <file>` | `fortnox_update_invoice` | Update an invoice that has not been bookkeept (mutation) |
|
|
132
|
-
| `noxctl invoices send <docNumber> [--method email\|print\|einvoice] [--subject <s>] [--body <s>] [--bcc <email>]` | `fortnox_send_invoice` | Send
|
|
133
|
-
| `noxctl invoices bookkeep <docNumber>` | `fortnox_bookkeep_invoice` |
|
|
197
|
+
| `noxctl invoices send <docNumber> [--method email\|print\|einvoice] [--subject <s>] [--body <s>] [--bcc <email>]` | `fortnox_send_invoice` | Send via email (default), print, or e-invoice (mutation) |
|
|
198
|
+
| `noxctl invoices bookkeep <docNumber>` | `fortnox_bookkeep_invoice` | Bookkeep an invoice (mutation) |
|
|
134
199
|
| `noxctl invoices credit <docNumber>` | `fortnox_credit_invoice` | Credit an invoice (mutation) |
|
|
135
200
|
|
|
201
|
+
### Invoice payments (inbetalningar)
|
|
202
|
+
|
|
203
|
+
| CLI | MCP tool | Description |
|
|
204
|
+
|-----|----------|-------------|
|
|
205
|
+
| `noxctl invoice-payments list [--invoice <number>]` / alias `noxctl ip list` | `fortnox_list_invoice_payments` | List invoice payments |
|
|
206
|
+
| `noxctl invoice-payments get <number>` | `fortnox_get_invoice_payment` | Get a single invoice payment |
|
|
207
|
+
| `noxctl invoice-payments create --invoice <n> --amount <a> --date <date>` | `fortnox_create_invoice_payment` | Register a payment against an invoice (mutation) |
|
|
208
|
+
| `noxctl invoice-payments bookkeep <number>` | — | Bookkeep an invoice payment (mutation) |
|
|
209
|
+
| `noxctl invoice-payments delete <number>` | `fortnox_delete_invoice_payment` | Delete an invoice payment (mutation) |
|
|
210
|
+
|
|
211
|
+
### Supplier invoices (leverantörsfakturor)
|
|
212
|
+
|
|
213
|
+
| CLI | MCP tool | Description |
|
|
214
|
+
|-----|----------|-------------|
|
|
215
|
+
| `noxctl supplier-invoices list [--filter <status>] [--supplier <number>]` / alias `si list` | `fortnox_list_supplier_invoices` | List/filter supplier invoices |
|
|
216
|
+
| `noxctl supplier-invoices get <givenNumber>` | `fortnox_get_supplier_invoice` | Get a single supplier invoice |
|
|
217
|
+
| `noxctl supplier-invoices create --supplier <n> --input <file>` | `fortnox_create_supplier_invoice` | Create a supplier invoice (mutation) |
|
|
218
|
+
| `noxctl supplier-invoices bookkeep <givenNumber>` | `fortnox_bookkeep_supplier_invoice` | Bookkeep a supplier invoice (mutation) |
|
|
219
|
+
|
|
220
|
+
### Supplier invoice payments (utbetalningar)
|
|
221
|
+
|
|
222
|
+
| CLI | MCP tool | Description |
|
|
223
|
+
|-----|----------|-------------|
|
|
224
|
+
| `noxctl supplier-invoice-payments list [--invoice <number>]` / alias `sip list` | `fortnox_list_supplier_invoice_payments` | List supplier invoice payments |
|
|
225
|
+
| `noxctl supplier-invoice-payments get <number>` | `fortnox_get_supplier_invoice_payment` | Get a single supplier invoice payment |
|
|
226
|
+
| `noxctl supplier-invoice-payments create --invoice <n> --amount <a> --date <date>` | `fortnox_create_supplier_invoice_payment` | Register a payment against a supplier invoice (mutation) |
|
|
227
|
+
| `noxctl supplier-invoice-payments delete <number>` | `fortnox_delete_supplier_invoice_payment` | Delete a supplier invoice payment (mutation) |
|
|
228
|
+
|
|
229
|
+
### Offers (offerter)
|
|
230
|
+
|
|
231
|
+
| CLI | MCP tool | Description |
|
|
232
|
+
|-----|----------|-------------|
|
|
233
|
+
| `noxctl offers list [--filter <status>] [--customer <number>]` | `fortnox_list_offers` | List/filter offers. Filters: `cancelled`, `expired`, `ordercreated`, `invoicecreated` |
|
|
234
|
+
| `noxctl offers get <docNumber>` | `fortnox_get_offer` | Get a single offer |
|
|
235
|
+
| `noxctl offers create --customer <number> --input <file>` | `fortnox_create_offer` | Create an offer (mutation) |
|
|
236
|
+
| `noxctl offers update <docNumber> --input <file>` | `fortnox_update_offer` | Update an offer (mutation) |
|
|
237
|
+
| `noxctl offers create-invoice <docNumber>` | `fortnox_create_invoice_from_offer` | Convert offer → invoice (mutation) |
|
|
238
|
+
| `noxctl offers create-order <docNumber>` | `fortnox_create_order_from_offer` | Convert offer → order (mutation) |
|
|
239
|
+
|
|
240
|
+
### Orders (ordrar)
|
|
241
|
+
|
|
242
|
+
| CLI | MCP tool | Description |
|
|
243
|
+
|-----|----------|-------------|
|
|
244
|
+
| `noxctl orders list [--filter <status>] [--customer <number>]` | `fortnox_list_orders` | List/filter orders. Filters: `cancelled`, `invoicecreated`, `invoicenotcreated` |
|
|
245
|
+
| `noxctl orders get <docNumber>` | `fortnox_get_order` | Get a single order |
|
|
246
|
+
| `noxctl orders create --customer <number> --input <file>` | `fortnox_create_order` | Create an order (mutation) |
|
|
247
|
+
| `noxctl orders update <docNumber> --input <file>` | `fortnox_update_order` | Update an order (mutation) |
|
|
248
|
+
| `noxctl orders create-invoice <docNumber>` | `fortnox_create_invoice_from_order` | Convert order → invoice (mutation) |
|
|
249
|
+
|
|
136
250
|
### Bookkeeping
|
|
137
251
|
|
|
138
252
|
| CLI | MCP tool | Description |
|
|
139
253
|
|-----|----------|-------------|
|
|
140
254
|
| `noxctl vouchers list [--series <s>] [--from <date>] [--to <date>]` | `fortnox_list_vouchers` | List vouchers, optionally filtered by series and date range |
|
|
255
|
+
| `noxctl vouchers get <series> <number>` | `fortnox_get_voucher` | Get a single voucher with rows |
|
|
141
256
|
| `noxctl vouchers create --input <file>` | `fortnox_create_voucher` | Create a voucher with debit/credit rows (mutation) |
|
|
142
257
|
| `noxctl accounts list [--search <term>]` | `fortnox_list_accounts` | View chart of accounts, search by name or number |
|
|
143
258
|
|
|
259
|
+
### Financial reports
|
|
260
|
+
|
|
261
|
+
| CLI | MCP tool | Description |
|
|
262
|
+
|-----|----------|-------------|
|
|
263
|
+
| `noxctl reports income [--year <n>] [--from <date>] [--to <date>]` / alias `reports resultat` | `fortnox_income_statement` | Income statement (resultaträkning) |
|
|
264
|
+
| `noxctl reports balance [--year <n>] [--to <date>]` / alias `reports balans` | `fortnox_balance_sheet` | Balance sheet (balansräkning) |
|
|
265
|
+
|
|
144
266
|
### Tax
|
|
145
267
|
|
|
146
268
|
| CLI | MCP tool | Description |
|
|
147
269
|
|-----|----------|-------------|
|
|
148
270
|
| `noxctl tax report --from <date> --to <date>` | `fortnox_tax_report` | Informational VAT summary for a period. Reconcile against Fortnox before filing. Dates in `YYYY-MM-DD` format |
|
|
149
271
|
|
|
272
|
+
### Tax reductions (ROT/RUT)
|
|
273
|
+
|
|
274
|
+
| CLI | MCP tool | Description |
|
|
275
|
+
|-----|----------|-------------|
|
|
276
|
+
| `noxctl tax-reductions list [--filter <type>]` | `fortnox_list_taxreductions` | List tax reductions (ROT/RUT) |
|
|
277
|
+
| `noxctl tax-reductions get <id>` | `fortnox_get_taxreduction` | Get a single tax reduction |
|
|
278
|
+
| `noxctl tax-reductions create --reference <n> --type <rot\|rut> --document-type <type> --customer-name <name> --amount <öre>` | `fortnox_create_taxreduction` | Create a ROT/RUT tax reduction (mutation) |
|
|
279
|
+
|
|
280
|
+
### Projects
|
|
281
|
+
|
|
282
|
+
| CLI | MCP tool | Description |
|
|
283
|
+
|-----|----------|-------------|
|
|
284
|
+
| `noxctl projects list` | `fortnox_list_projects` | List projects |
|
|
285
|
+
| `noxctl projects get <number>` | `fortnox_get_project` | Get a single project |
|
|
286
|
+
| `noxctl projects create --description <text>` | `fortnox_create_project` | Create a project (mutation) |
|
|
287
|
+
| `noxctl projects update <number> --input <file>` | `fortnox_update_project` | Update a project (mutation) |
|
|
288
|
+
|
|
289
|
+
### Cost centers (kostnadsställen)
|
|
290
|
+
|
|
291
|
+
| CLI | MCP tool | Description |
|
|
292
|
+
|-----|----------|-------------|
|
|
293
|
+
| `noxctl costcenters list` | `fortnox_list_costcenters` | List cost centers |
|
|
294
|
+
| `noxctl costcenters get <code>` | `fortnox_get_costcenter` | Get a single cost center |
|
|
295
|
+
| `noxctl costcenters create --code <code> --description <text>` | `fortnox_create_costcenter` | Create a cost center (mutation) |
|
|
296
|
+
| `noxctl costcenters update <code> --input <file>` | `fortnox_update_costcenter` | Update a cost center (mutation) |
|
|
297
|
+
| `noxctl costcenters delete <code>` | `fortnox_delete_costcenter` | Delete a cost center (mutation) |
|
|
298
|
+
|
|
299
|
+
### Price lists and prices
|
|
300
|
+
|
|
301
|
+
| CLI | MCP tool | Description |
|
|
302
|
+
|-----|----------|-------------|
|
|
303
|
+
| `noxctl pricelists list` | `fortnox_list_pricelists` | List price lists |
|
|
304
|
+
| `noxctl pricelists get <code>` | `fortnox_get_pricelist` | Get a single price list |
|
|
305
|
+
| `noxctl pricelists create --code <code> --description <text>` | `fortnox_create_pricelist` | Create a price list (mutation) |
|
|
306
|
+
| `noxctl pricelists update <code> --input <file>` | `fortnox_update_pricelist` | Update a price list (mutation) |
|
|
307
|
+
| `noxctl prices list --pricelist <code> [--article <number>]` | `fortnox_list_prices` | List prices within a price list |
|
|
308
|
+
| `noxctl prices get --pricelist <code> --article <number>` | `fortnox_get_price` | Get a specific price |
|
|
309
|
+
| `noxctl prices update --pricelist <code> --article <number> --input <file>` | `fortnox_update_price` | Update a price (mutation) |
|
|
310
|
+
|
|
150
311
|
### Company
|
|
151
312
|
|
|
152
313
|
| CLI | MCP tool | Description |
|
|
@@ -160,6 +321,9 @@ Every operation is available both as a CLI command and as an MCP tool. The CLI i
|
|
|
160
321
|
| `noxctl init` | — | Interactive setup wizard — connects to Fortnox, stores credentials, optionally registers MCP server |
|
|
161
322
|
| `noxctl doctor` | `fortnox_status` | Validate setup: Node version, credentials, token status, API connectivity, and scopes |
|
|
162
323
|
| `noxctl logout` | — | Remove stored credentials from the OS keychain |
|
|
324
|
+
| `noxctl profile use <name>` | — | Set the active profile (writes `~/.fortnox-mcp/active-profile`) |
|
|
325
|
+
| `noxctl profile current` | — | Show the currently resolved profile and where it came from |
|
|
326
|
+
| `noxctl profile list` | — | List known profiles from the index |
|
|
163
327
|
|
|
164
328
|
## CLI output
|
|
165
329
|
|
|
@@ -228,16 +392,18 @@ Ask Claude naturally — works in both Swedish and English:
|
|
|
228
392
|
|
|
229
393
|
## Troubleshooting
|
|
230
394
|
|
|
231
|
-
**"FORTNOX_CLIENT_ID and FORTNOX_CLIENT_SECRET
|
|
395
|
+
**"stdin is not a TTY. Set FORTNOX_CLIENT_ID and FORTNOX_CLIENT_SECRET env vars to run non-interactively"**
|
|
232
396
|
|
|
233
|
-
|
|
397
|
+
`noxctl init` is normally interactive — it prompts for the Client ID and Secret. In CI or other non-TTY contexts it falls back to reading them from environment variables:
|
|
234
398
|
|
|
235
399
|
```bash
|
|
236
400
|
export FORTNOX_CLIENT_ID=<your-id>
|
|
237
401
|
export FORTNOX_CLIENT_SECRET=<your-secret>
|
|
402
|
+
export FORTNOX_SERVICE_ACCOUNT=1 # optional, enables service account mode
|
|
403
|
+
noxctl init
|
|
238
404
|
```
|
|
239
405
|
|
|
240
|
-
|
|
406
|
+
Once authorized, the tokens are stored in the OS keychain. No env vars are needed afterwards — only for re-running `init` non-interactively.
|
|
241
407
|
|
|
242
408
|
**"Not authenticated. Run `noxctl init`"**
|
|
243
409
|
|
|
@@ -245,16 +411,7 @@ Credentials are missing or were not saved. Re-run the setup step. On macOS, chec
|
|
|
245
411
|
|
|
246
412
|
**403 Forbidden from Fortnox API**
|
|
247
413
|
|
|
248
|
-
Your app is missing
|
|
249
|
-
|
|
250
|
-
| Swedish (SV) | English (EN) |
|
|
251
|
-
|----------------------|---------------------|
|
|
252
|
-
| Artikel | Article |
|
|
253
|
-
| Bokföring | Bookkeeping |
|
|
254
|
-
| Faktura | Invoice |
|
|
255
|
-
| Företagsinformation | Company Information |
|
|
256
|
-
| Inställningar | Settings |
|
|
257
|
-
| Kund | Customer |
|
|
414
|
+
Your app is missing one or more scopes. The error message names the specific scope needed (e.g. `Missing "supplier" scope`). Go to [developer.fortnox.se](https://developer.fortnox.se/), open your app, and enable the matching permission under **Behörigheter** / **Permissions** — see the full table in [Setup → Create a Fortnox app](#1-create-a-fortnox-app). Then re-run `noxctl init`.
|
|
258
415
|
|
|
259
416
|
**"Token refresh failed"**
|
|
260
417
|
|
package/dist/auth.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export declare const SCOPES = "article customer invoice supplier supplierinvoice bookkeeping companyinformation settings";
|
|
1
|
+
export declare const SCOPES = "article customer invoice payment supplier supplierinvoice bookkeeping companyinformation settings";
|
|
2
|
+
export declare const CREDENTIAL_SCHEMA_VERSION = 2;
|
|
2
3
|
export interface FortnoxCredentials {
|
|
3
4
|
client_id: string;
|
|
4
5
|
client_secret: string;
|
|
@@ -6,24 +7,31 @@ export interface FortnoxCredentials {
|
|
|
6
7
|
refresh_token: string;
|
|
7
8
|
expires_at: number;
|
|
8
9
|
tenant_id?: string;
|
|
10
|
+
company_name?: string;
|
|
11
|
+
schema_version?: number;
|
|
12
|
+
last_write_epoch?: number;
|
|
9
13
|
}
|
|
10
14
|
export interface FortnoxAppConfig {
|
|
11
15
|
clientId: string;
|
|
12
16
|
clientSecret: string;
|
|
13
17
|
serviceAccount?: boolean;
|
|
14
18
|
}
|
|
15
|
-
export declare function
|
|
16
|
-
export declare function
|
|
19
|
+
export declare function setResolvedProfile(name: string): void;
|
|
20
|
+
export declare function getResolvedProfile(): string;
|
|
21
|
+
export declare function __resetLegacyObservedForDefault(): void;
|
|
22
|
+
export declare function loadCredentials(profile?: string): Promise<FortnoxCredentials | null>;
|
|
23
|
+
export declare function saveCredentials(creds: FortnoxCredentials, profile?: string): Promise<void>;
|
|
17
24
|
export declare function exchangeCodeForTokens(code: string, redirectUri: string, config: FortnoxAppConfig): Promise<{
|
|
18
25
|
access_token: string;
|
|
19
26
|
refresh_token: string;
|
|
20
27
|
expires_in: number;
|
|
21
28
|
}>;
|
|
22
|
-
export declare function getTokenViaClientCredentials(creds: FortnoxCredentials): Promise<FortnoxCredentials>;
|
|
23
|
-
export declare function refreshAccessToken(creds: FortnoxCredentials): Promise<FortnoxCredentials>;
|
|
24
|
-
export declare function getValidToken(): Promise<string>;
|
|
29
|
+
export declare function getTokenViaClientCredentials(creds: FortnoxCredentials, profile?: string): Promise<FortnoxCredentials>;
|
|
30
|
+
export declare function refreshAccessToken(creds: FortnoxCredentials, profile?: string): Promise<FortnoxCredentials>;
|
|
31
|
+
export declare function getValidToken(profile?: string): Promise<string>;
|
|
25
32
|
export declare function fetchTenantId(accessToken: string): Promise<string | undefined>;
|
|
33
|
+
export declare function fetchCompanyNameSafe(accessToken: string): Promise<string | undefined>;
|
|
26
34
|
export declare function escapeHtml(value: string): string;
|
|
27
35
|
export declare function buildAuthorizationUrl(config: FortnoxAppConfig, redirectUri: string, state: string): string;
|
|
28
|
-
export declare function runOAuthSetup(config: FortnoxAppConfig): Promise<void>;
|
|
36
|
+
export declare function runOAuthSetup(config: FortnoxAppConfig, profile?: string): Promise<void>;
|
|
29
37
|
//# sourceMappingURL=auth.d.ts.map
|
package/dist/auth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,MAAM,sGACkF,CAAC;AAEtG,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAE3C,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAcD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,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sB,aAAa,CACjC,MAAM,EAAE,gBAAgB,EACxB,OAAO,GAAE,MAAwB,GAChC,OAAO,CAAC,IAAI,CAAC,CAgIf"}
|
package/dist/auth.js
CHANGED
|
@@ -2,23 +2,84 @@ import { createServer } from 'node:http';
|
|
|
2
2
|
import { randomBytes } from 'node:crypto';
|
|
3
3
|
import { execFileSync } from 'node:child_process';
|
|
4
4
|
import { loadCredentialBlob, saveCredentialBlob } from './credentials-store.js';
|
|
5
|
+
import { DEFAULT_PROFILE, validateProfileName } from './profile-name.js';
|
|
6
|
+
import { migrateLegacyIfNeeded, readProfileIndex, upsertProfile } from './profiles.js';
|
|
5
7
|
const FORTNOX_AUTH_URL = 'https://apps.fortnox.se/oauth-v1/auth';
|
|
6
8
|
const FORTNOX_TOKEN_URL = 'https://apps.fortnox.se/oauth-v1/token';
|
|
7
9
|
const CALLBACK_HOST = '127.0.0.1';
|
|
8
|
-
export const SCOPES = 'article customer invoice supplier supplierinvoice bookkeeping companyinformation settings';
|
|
9
|
-
export
|
|
10
|
+
export const SCOPES = 'article customer invoice payment supplier supplierinvoice bookkeeping companyinformation settings';
|
|
11
|
+
export const CREDENTIAL_SCHEMA_VERSION = 2;
|
|
12
|
+
// Module-global resolved profile. This assumes a single-tenant process model
|
|
13
|
+
// (one CLI invocation or one MCP stdio connection per Node process). Hosting
|
|
14
|
+
// multiple Fortnox MCP servers in the same process is not supported — every
|
|
15
|
+
// instance would share this state. Revisit if the MCP SDK grows request-local
|
|
16
|
+
// context that handlers can read.
|
|
17
|
+
let resolvedProfile = DEFAULT_PROFILE;
|
|
18
|
+
// Whether the legacy (pre-0.2) credential slot was observed on the most recent
|
|
19
|
+
// successful load of the default profile. Set only by loadCredentials; read by
|
|
20
|
+
// saveCredentials to decide whether to dual-write during the 0.2.x window.
|
|
21
|
+
let legacyObservedForDefault = false;
|
|
22
|
+
export function setResolvedProfile(name) {
|
|
23
|
+
resolvedProfile = validateProfileName(name);
|
|
24
|
+
}
|
|
25
|
+
export function getResolvedProfile() {
|
|
26
|
+
return resolvedProfile;
|
|
27
|
+
}
|
|
28
|
+
// Test-only: reset module-level observation state between cases.
|
|
29
|
+
export function __resetLegacyObservedForDefault() {
|
|
30
|
+
legacyObservedForDefault = false;
|
|
31
|
+
}
|
|
32
|
+
function profileOrResolved(profile) {
|
|
33
|
+
return profile ?? resolvedProfile;
|
|
34
|
+
}
|
|
35
|
+
function isDefaultProfile(name) {
|
|
36
|
+
return name.toLowerCase() === DEFAULT_PROFILE;
|
|
37
|
+
}
|
|
38
|
+
function profileTag(name) {
|
|
39
|
+
return isDefaultProfile(name) ? '' : `[profile: ${name}] `;
|
|
40
|
+
}
|
|
41
|
+
function legacySlotExists(source) {
|
|
42
|
+
return (source === 'legacy' ||
|
|
43
|
+
source === 'both-new-preferred' ||
|
|
44
|
+
source === 'both-legacy-preferred' ||
|
|
45
|
+
source === 'legacy-plaintext');
|
|
46
|
+
}
|
|
47
|
+
export async function loadCredentials(profile) {
|
|
48
|
+
const target = profileOrResolved(profile);
|
|
49
|
+
let result;
|
|
10
50
|
try {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return
|
|
51
|
+
result = await loadCredentialBlob(target);
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
if (isDefaultProfile(target) && legacySlotExists(result.source)) {
|
|
57
|
+
legacyObservedForDefault = true;
|
|
58
|
+
// Best-effort seeding of the profile index for pre-0.2 installs. Seed from
|
|
59
|
+
// the raw legacy blob — not result.blob, which may be the new slot if
|
|
60
|
+
// pickHigher preferred it and would lose legacy-only metadata on drift.
|
|
61
|
+
// A failure here must not break auth — Chunk D's `doctor` will surface it.
|
|
62
|
+
await migrateLegacyIfNeeded(result.legacyBlob);
|
|
63
|
+
}
|
|
64
|
+
if (!result.blob)
|
|
65
|
+
return null;
|
|
66
|
+
try {
|
|
67
|
+
return JSON.parse(result.blob);
|
|
15
68
|
}
|
|
16
69
|
catch {
|
|
17
70
|
return null;
|
|
18
71
|
}
|
|
19
72
|
}
|
|
20
|
-
export async function saveCredentials(creds) {
|
|
21
|
-
|
|
73
|
+
export async function saveCredentials(creds, profile) {
|
|
74
|
+
const target = profileOrResolved(profile);
|
|
75
|
+
const stamped = {
|
|
76
|
+
...creds,
|
|
77
|
+
schema_version: CREDENTIAL_SCHEMA_VERSION,
|
|
78
|
+
last_write_epoch: Date.now(),
|
|
79
|
+
};
|
|
80
|
+
await saveCredentialBlob(JSON.stringify(stamped), target, {
|
|
81
|
+
alsoWriteLegacy: isDefaultProfile(target) && legacyObservedForDefault,
|
|
82
|
+
});
|
|
22
83
|
}
|
|
23
84
|
export async function exchangeCodeForTokens(code, redirectUri, config) {
|
|
24
85
|
const body = new URLSearchParams({
|
|
@@ -40,9 +101,10 @@ export async function exchangeCodeForTokens(code, redirectUri, config) {
|
|
|
40
101
|
}
|
|
41
102
|
return (await response.json());
|
|
42
103
|
}
|
|
43
|
-
export async function getTokenViaClientCredentials(creds) {
|
|
104
|
+
export async function getTokenViaClientCredentials(creds, profile) {
|
|
105
|
+
const tag = profileTag(profileOrResolved(profile));
|
|
44
106
|
if (!creds.tenant_id) {
|
|
45
|
-
throw new Error(
|
|
107
|
+
throw new Error(`${tag}No tenant_id available — cannot use client credentials flow`);
|
|
46
108
|
}
|
|
47
109
|
const body = new URLSearchParams({
|
|
48
110
|
grant_type: 'client_credentials',
|
|
@@ -59,7 +121,7 @@ export async function getTokenViaClientCredentials(creds) {
|
|
|
59
121
|
});
|
|
60
122
|
if (!response.ok) {
|
|
61
123
|
const text = await response.text();
|
|
62
|
-
throw new Error(
|
|
124
|
+
throw new Error(`${tag}Client credentials token request failed (${response.status}): ${text}`);
|
|
63
125
|
}
|
|
64
126
|
const data = (await response.json());
|
|
65
127
|
const updated = {
|
|
@@ -67,10 +129,11 @@ export async function getTokenViaClientCredentials(creds) {
|
|
|
67
129
|
access_token: data.access_token,
|
|
68
130
|
expires_at: Date.now() + data.expires_in * 1000,
|
|
69
131
|
};
|
|
70
|
-
await saveCredentials(updated);
|
|
132
|
+
await saveCredentials(updated, profile);
|
|
71
133
|
return updated;
|
|
72
134
|
}
|
|
73
|
-
export async function refreshAccessToken(creds) {
|
|
135
|
+
export async function refreshAccessToken(creds, profile) {
|
|
136
|
+
const tag = profileTag(profileOrResolved(profile));
|
|
74
137
|
const body = new URLSearchParams({
|
|
75
138
|
grant_type: 'refresh_token',
|
|
76
139
|
refresh_token: creds.refresh_token,
|
|
@@ -85,7 +148,7 @@ export async function refreshAccessToken(creds) {
|
|
|
85
148
|
});
|
|
86
149
|
if (!response.ok) {
|
|
87
150
|
const text = await response.text();
|
|
88
|
-
throw new Error(
|
|
151
|
+
throw new Error(`${tag}Token refresh failed (${response.status}): ${text}`);
|
|
89
152
|
}
|
|
90
153
|
const data = (await response.json());
|
|
91
154
|
const updated = {
|
|
@@ -94,13 +157,17 @@ export async function refreshAccessToken(creds) {
|
|
|
94
157
|
refresh_token: data.refresh_token,
|
|
95
158
|
expires_at: Date.now() + data.expires_in * 1000,
|
|
96
159
|
};
|
|
97
|
-
await saveCredentials(updated);
|
|
160
|
+
await saveCredentials(updated, profile);
|
|
98
161
|
return updated;
|
|
99
162
|
}
|
|
100
|
-
export async function getValidToken() {
|
|
101
|
-
const
|
|
163
|
+
export async function getValidToken(profile) {
|
|
164
|
+
const target = profileOrResolved(profile);
|
|
165
|
+
const creds = await loadCredentials(target);
|
|
102
166
|
if (!creds) {
|
|
103
|
-
|
|
167
|
+
const initCmd = isDefaultProfile(target)
|
|
168
|
+
? '`noxctl init`'
|
|
169
|
+
: `\`noxctl init --profile ${target}\``;
|
|
170
|
+
throw new Error(`${profileTag(target)}Not authenticated. Run ${initCmd} to connect your Fortnox account.`);
|
|
104
171
|
}
|
|
105
172
|
// Token still valid — use it
|
|
106
173
|
if (Date.now() <= creds.expires_at - 5 * 60 * 1000) {
|
|
@@ -109,7 +176,7 @@ export async function getValidToken() {
|
|
|
109
176
|
// Prefer client credentials when tenant_id is available (no refresh token management needed)
|
|
110
177
|
if (creds.tenant_id) {
|
|
111
178
|
try {
|
|
112
|
-
const refreshed = await getTokenViaClientCredentials(creds);
|
|
179
|
+
const refreshed = await getTokenViaClientCredentials(creds, target);
|
|
113
180
|
return refreshed.access_token;
|
|
114
181
|
}
|
|
115
182
|
catch {
|
|
@@ -117,7 +184,7 @@ export async function getValidToken() {
|
|
|
117
184
|
}
|
|
118
185
|
}
|
|
119
186
|
// Fallback: standard refresh token flow
|
|
120
|
-
const refreshed = await refreshAccessToken(creds);
|
|
187
|
+
const refreshed = await refreshAccessToken(creds, target);
|
|
121
188
|
return refreshed.access_token;
|
|
122
189
|
}
|
|
123
190
|
export async function fetchTenantId(accessToken) {
|
|
@@ -132,6 +199,23 @@ export async function fetchTenantId(accessToken) {
|
|
|
132
199
|
const data = (await response.json());
|
|
133
200
|
return data.CompanyInformation?.DatabaseNumber;
|
|
134
201
|
}
|
|
202
|
+
export async function fetchCompanyNameSafe(accessToken) {
|
|
203
|
+
try {
|
|
204
|
+
const response = await fetch('https://api.fortnox.se/3/companyinformation', {
|
|
205
|
+
headers: {
|
|
206
|
+
Authorization: `Bearer ${accessToken}`,
|
|
207
|
+
Accept: 'application/json',
|
|
208
|
+
},
|
|
209
|
+
});
|
|
210
|
+
if (!response.ok)
|
|
211
|
+
return undefined;
|
|
212
|
+
const data = (await response.json());
|
|
213
|
+
return data.CompanyInformation?.CompanyName;
|
|
214
|
+
}
|
|
215
|
+
catch {
|
|
216
|
+
return undefined;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
135
219
|
function openBrowser(url) {
|
|
136
220
|
try {
|
|
137
221
|
if (process.platform === 'darwin') {
|
|
@@ -170,7 +254,8 @@ export function buildAuthorizationUrl(config, redirectUri, state) {
|
|
|
170
254
|
}
|
|
171
255
|
return `${FORTNOX_AUTH_URL}?${params.toString()}`;
|
|
172
256
|
}
|
|
173
|
-
export async function runOAuthSetup(config) {
|
|
257
|
+
export async function runOAuthSetup(config, profile = DEFAULT_PROFILE) {
|
|
258
|
+
const validatedProfile = validateProfileName(profile);
|
|
174
259
|
const PORT = 9876;
|
|
175
260
|
const REDIRECT_URI = `http://localhost:${PORT}/callback`;
|
|
176
261
|
const oauthState = randomBytes(24).toString('hex');
|
|
@@ -219,6 +304,7 @@ export async function runOAuthSetup(config) {
|
|
|
219
304
|
// Fetch tenant_id for client credentials flow
|
|
220
305
|
console.log('Fetching tenant ID...');
|
|
221
306
|
const tenantId = await fetchTenantId(tokens.access_token);
|
|
307
|
+
const companyName = await fetchCompanyNameSafe(tokens.access_token);
|
|
222
308
|
const creds = {
|
|
223
309
|
client_id: config.clientId,
|
|
224
310
|
client_secret: config.clientSecret,
|
|
@@ -226,8 +312,23 @@ export async function runOAuthSetup(config) {
|
|
|
226
312
|
refresh_token: tokens.refresh_token,
|
|
227
313
|
expires_at: Date.now() + tokens.expires_in * 1000,
|
|
228
314
|
tenant_id: tenantId,
|
|
315
|
+
company_name: companyName,
|
|
229
316
|
};
|
|
230
|
-
|
|
317
|
+
// Preserve the original created_at when re-authenticating an existing
|
|
318
|
+
// profile so the index timestamp reflects first auth, not the most
|
|
319
|
+
// recent one. Upsert BEFORE saveCredentials so a filesystem failure
|
|
320
|
+
// here can't leave a credential blob without a matching index entry —
|
|
321
|
+
// `logout --all` enumerates via the index, so a silent orphan would
|
|
322
|
+
// mean creds in the keychain that bulk-logout can't see.
|
|
323
|
+
const existing = (await readProfileIndex()).profiles.find((p) => p.name.toLowerCase() === validatedProfile.toLowerCase());
|
|
324
|
+
await upsertProfile({
|
|
325
|
+
name: validatedProfile,
|
|
326
|
+
tenant_id: tenantId,
|
|
327
|
+
company_name: companyName,
|
|
328
|
+
created_at: existing?.created_at ?? new Date().toISOString(),
|
|
329
|
+
schema_version: 2,
|
|
330
|
+
});
|
|
331
|
+
await saveCredentials(creds, validatedProfile);
|
|
231
332
|
const tenantMsg = tenantId
|
|
232
333
|
? ' Client credentials flow enabled.'
|
|
233
334
|
: ' (Tenant ID not found — using refresh token flow.)';
|
package/dist/auth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA6C,MAAM,WAAW,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAEhF,MAAM,gBAAgB,GAAG,uCAAuC,CAAC;AACjE,MAAM,iBAAiB,GAAG,wCAAwC,CAAC;AACnE,MAAM,aAAa,GAAG,WAAW,CAAC;AAElC,MAAM,CAAC,MAAM,MAAM,GACjB,2FAA2F,CAAC;AAiB9F,MAAM,CAAC,KAAK,UAAU,eAAe;IACnC,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,kBAAkB,EAAE,CAAC;QACxC,IAAI,CAAC,IAAI;YAAE,OAAO,IAAI,CAAC;QACvB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAuB,CAAC;IAChD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,KAAyB;IAC7D,MAAM,kBAAkB,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;AAClD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,IAAY,EACZ,WAAmB,EACnB,MAAwB;IAExB,MAAM,IAAI,GAAG,IAAI,eAAe,CAAC;QAC/B,UAAU,EAAE,oBAAoB;QAChC,IAAI;QACJ,YAAY,EAAE,WAAW;KAC1B,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,iBAAiB,EAAE;QAC9C,MAAM,EAAE,MAAM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