noxctl 0.3.0 → 0.4.1
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 +56 -6
- package/dist/auth.d.ts +6 -2
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +61 -21
- package/dist/auth.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +391 -6
- package/dist/cli.js.map +1 -1
- package/dist/credentials-store.d.ts +1 -1
- package/dist/credentials-store.d.ts.map +1 -1
- package/dist/credentials-store.js +12 -11
- package/dist/credentials-store.js.map +1 -1
- package/dist/fortnox-client.d.ts +6 -1
- package/dist/fortnox-client.d.ts.map +1 -1
- package/dist/fortnox-client.js +150 -62
- package/dist/fortnox-client.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/dist/operations/absencetransactions.d.ts +21 -0
- package/dist/operations/absencetransactions.d.ts.map +1 -0
- package/dist/operations/absencetransactions.js +36 -0
- package/dist/operations/absencetransactions.js.map +1 -0
- package/dist/operations/attendancetransactions.d.ts +21 -0
- package/dist/operations/attendancetransactions.d.ts.map +1 -0
- package/dist/operations/attendancetransactions.js +40 -0
- package/dist/operations/attendancetransactions.js.map +1 -0
- package/dist/operations/employees.d.ts +19 -0
- package/dist/operations/employees.d.ts.map +1 -0
- package/dist/operations/employees.js +34 -0
- package/dist/operations/employees.js.map +1 -0
- package/dist/operations/salarytransactions.d.ts +21 -0
- package/dist/operations/salarytransactions.d.ts.map +1 -0
- package/dist/operations/salarytransactions.js +35 -0
- package/dist/operations/salarytransactions.js.map +1 -0
- package/dist/operations/scheduletimes.d.ts +4 -0
- package/dist/operations/scheduletimes.d.ts.map +1 -0
- package/dist/operations/scheduletimes.js +24 -0
- package/dist/operations/scheduletimes.js.map +1 -0
- package/dist/tools/absencetransactions.d.ts +3 -0
- package/dist/tools/absencetransactions.d.ts.map +1 -0
- package/dist/tools/absencetransactions.js +66 -0
- package/dist/tools/absencetransactions.js.map +1 -0
- package/dist/tools/attendancetransactions.d.ts +3 -0
- package/dist/tools/attendancetransactions.d.ts.map +1 -0
- package/dist/tools/attendancetransactions.js +63 -0
- package/dist/tools/attendancetransactions.js.map +1 -0
- package/dist/tools/employees.d.ts +3 -0
- package/dist/tools/employees.d.ts.map +1 -0
- package/dist/tools/employees.js +119 -0
- package/dist/tools/employees.js.map +1 -0
- package/dist/tools/salarytransactions.d.ts +3 -0
- package/dist/tools/salarytransactions.d.ts.map +1 -0
- package/dist/tools/salarytransactions.js +70 -0
- package/dist/tools/salarytransactions.js.map +1 -0
- package/dist/tools/scheduletimes.d.ts +3 -0
- package/dist/tools/scheduletimes.d.ts.map +1 -0
- package/dist/tools/scheduletimes.js +62 -0
- package/dist/tools/scheduletimes.js.map +1 -0
- package/dist/tools/status.d.ts.map +1 -1
- package/dist/tools/status.js +4 -2
- package/dist/tools/status.js.map +1 -1
- package/dist/views.d.ts +9 -0
- package/dist/views.d.ts.map +1 -1
- package/dist/views.js +115 -0
- package/dist/views.js.map +1 -1
- package/package.json +6 -2
package/README.md
CHANGED
|
@@ -12,9 +12,9 @@ noxctl -o json invoices list | jq . # JSON output for scripting/AI
|
|
|
12
12
|
|
|
13
13
|
## Status
|
|
14
14
|
|
|
15
|
-
noxctl is an independent open-source project. It is not affiliated with, endorsed by, or certified by Fortnox AB
|
|
15
|
+
noxctl is an independent, **unofficial** open-source project. It is **not affiliated with, endorsed by, or certified by Fortnox AB.**
|
|
16
16
|
|
|
17
|
-
Use it with your own Fortnox account and developer credentials.
|
|
17
|
+
Use it with your own Fortnox account and developer credentials. **It is provided "as is", with no warranty and no liability — the author takes no responsibility for anything you do with it; you use it entirely at your own risk and are responsible for complying with Fortnox terms, Swedish bookkeeping/tax/payroll rules, and your own privacy obligations.** See the full [Disclaimer](#disclaimer).
|
|
18
18
|
|
|
19
19
|
## Prerequisites
|
|
20
20
|
|
|
@@ -27,6 +27,16 @@ Fortnox product plans, API activation requirements, and integration licensing ca
|
|
|
27
27
|
|
|
28
28
|
## Setup
|
|
29
29
|
|
|
30
|
+
### How it connects to Fortnox
|
|
31
|
+
|
|
32
|
+
noxctl is a thin client over the **Fortnox REST API (v3)** at `https://api.fortnox.se/3`. It uses a **bring-your-own-app** model — there is no shared backend and no middleman:
|
|
33
|
+
|
|
34
|
+
1. **You** create a Fortnox developer app (integration) and pick its permissions (scopes).
|
|
35
|
+
2. **You** authorize that app against your own Fortnox company over OAuth2 (`noxctl init`).
|
|
36
|
+
3. noxctl stores the resulting token in your OS keychain and calls the Fortnox API **directly from your machine** — nothing is proxied through any server operated by the author.
|
|
37
|
+
|
|
38
|
+
So you control the credentials, the scopes, and which company is connected end to end. The three steps below set this up.
|
|
39
|
+
|
|
30
40
|
### 1. Create a Fortnox app
|
|
31
41
|
|
|
32
42
|
> **Tip:** Run `npx noxctl init` (npx is a tool included with npm, the Node Package Manager) for an interactive setup wizard that guides you through all of these steps.
|
|
@@ -52,9 +62,12 @@ Fortnox product plans, API activation requirements, and integration licensing ca
|
|
|
52
62
|
| Projekt | Project | Projects |
|
|
53
63
|
| Kostnadsställe | Cost Center | Cost centers |
|
|
54
64
|
| Priser | Price | Price lists, prices |
|
|
65
|
+
| Lön | Salary | Payroll: employees, salary/attendance/absence transactions, schedule times — **opt-in**, see below |
|
|
55
66
|
|
|
56
67
|
Enable every scope for the resources you intend to use. Missing scopes surface as `403 Forbidden` with a hint pointing at the right one.
|
|
57
68
|
|
|
69
|
+
**Payroll (Lön) is opt-in.** The `salary` scope is *not* requested by default, because requesting a scope your app hasn't been granted breaks authorization. To use the payroll commands, enable the **Lön** permission above, then authorize with `noxctl init --with-salary` (or set `FORTNOX_WITH_SALARY=1` for non-interactive setups). The granted scope set is remembered per profile, so token refreshes keep working.
|
|
70
|
+
|
|
58
71
|
5. Save the integration
|
|
59
72
|
|
|
60
73
|
You are creating and authorizing your own Fortnox app here. noxctl does not ship shared Fortnox credentials and does not bypass Fortnox's authorization model.
|
|
@@ -382,6 +395,32 @@ Every operation is available both as a CLI command and as an MCP tool. The CLI i
|
|
|
382
395
|
| `noxctl financial-years get <id>` | `fortnox_get_financialyear` | Get a single financial year |
|
|
383
396
|
| `noxctl financial-years locked-period` | `fortnox_get_lockedperiod` | Show through which date bookkeeping is locked |
|
|
384
397
|
|
|
398
|
+
### Payroll (Lön)
|
|
399
|
+
|
|
400
|
+
> **Requires the `salary` scope**, which is **opt-in**. Enable the **Lön** permission on your Fortnox app, then run `noxctl init --with-salary` (or set `FORTNOX_WITH_SALARY=1` in non-interactive setups). Without it, these endpoints return `403 Forbidden`. See [Setup](#1-create-a-fortnox-app).
|
|
401
|
+
|
|
402
|
+
| CLI | MCP tool | Description |
|
|
403
|
+
|-----|----------|-------------|
|
|
404
|
+
| `noxctl employees list` | `fortnox_list_employees` | List employees |
|
|
405
|
+
| `noxctl employees get <employeeId>` | `fortnox_get_employee` | Get a single employee |
|
|
406
|
+
| `noxctl employees create --first-name <n> --last-name <n> --email <e> [--employment-form <f> --personel-type <t> --salary-form <f>]` | `fortnox_create_employee` | Create an employee (mutation). `--employment-form`/`--personel-type`/`--salary-form` are required *unless* the company has a default employment agreement — otherwise Fortnox rejects with a `ftgavtalid` error |
|
|
407
|
+
| `noxctl employees update <employeeId> --input <file>` | `fortnox_update_employee` | Update an employee (mutation) |
|
|
408
|
+
| `noxctl salary-transactions list [--employee <id>] [--date <date>]` | `fortnox_list_salarytransactions` | List salary transactions |
|
|
409
|
+
| `noxctl salary-transactions get <salaryRow>` | `fortnox_get_salarytransaction` | Get a single salary transaction |
|
|
410
|
+
| `noxctl salary-transactions create --employee <id> --salary-code <code> --date <date> [--amount <n>]` | `fortnox_create_salarytransaction` | Create a salary transaction (mutation) |
|
|
411
|
+
| `noxctl salary-transactions delete <salaryRow>` | `fortnox_delete_salarytransaction` | Delete a salary transaction (mutation) |
|
|
412
|
+
| `noxctl attendance-transactions list [--employee <id>] [--date <date>]` | `fortnox_list_attendancetransactions` | List attendance (närvaro) transactions |
|
|
413
|
+
| `noxctl attendance-transactions get <id>` | `fortnox_get_attendancetransaction` | Get a single attendance transaction |
|
|
414
|
+
| `noxctl attendance-transactions create --employee <id> --cause-code <code> --date <date> [--hours <n>]` | `fortnox_create_attendancetransaction` | Create an attendance transaction (mutation) |
|
|
415
|
+
| `noxctl attendance-transactions delete <id>` | `fortnox_delete_attendancetransaction` | Delete an attendance transaction (mutation) |
|
|
416
|
+
| `noxctl absence-transactions list [--employee <id>] [--date <date>]` | `fortnox_list_absencetransactions` | List absence (frånvaro) transactions |
|
|
417
|
+
| `noxctl absence-transactions get <id>` | `fortnox_get_absencetransaction` | Get a single absence transaction |
|
|
418
|
+
| `noxctl absence-transactions create --employee <id> --cause-code <code> --date <date> [--hours <n>] [--extent <n>]` | `fortnox_create_absencetransaction` | Create an absence transaction (mutation) |
|
|
419
|
+
| `noxctl absence-transactions delete <id>` | `fortnox_delete_absencetransaction` | Delete an absence transaction (mutation) |
|
|
420
|
+
| `noxctl schedule-times get <employeeId> <date>` | `fortnox_get_scheduletime` | Get the schedule for an employee on a date |
|
|
421
|
+
| `noxctl schedule-times update <employeeId> <date> --input <file>` | `fortnox_update_scheduletime` | Update a day's schedule (mutation) |
|
|
422
|
+
| `noxctl schedule-times reset-day <employeeId> <date> --input <file>` | `fortnox_reset_scheduletime_day` | Update a day's schedule and reset the day (mutation) |
|
|
423
|
+
|
|
385
424
|
### Analytics and dashboard
|
|
386
425
|
|
|
387
426
|
| CLI | MCP tool | Description |
|
|
@@ -561,15 +600,26 @@ See [ARCHITECTURE.md](ARCHITECTURE.md) for details.
|
|
|
561
600
|
|
|
562
601
|
## Disclaimer
|
|
563
602
|
|
|
564
|
-
noxctl is an independent open-source project — not affiliated with, endorsed by, or certified by Fortnox AB.
|
|
603
|
+
noxctl is an independent, **unofficial** open-source project — **not affiliated with, endorsed by, or certified by Fortnox AB.** "Fortnox" is a trademark of Fortnox AB, used here only to describe interoperability.
|
|
604
|
+
|
|
605
|
+
**No warranty, no liability.** noxctl is provided "as is", without warranty of any kind, express or implied. The author and contributors accept **no responsibility and no liability whatsoever** for anything arising from its use — including, without limitation: incorrect, incomplete, or lost bookkeeping; erroneous invoices, payments, payroll, or tax filings; exposure or loss of data; service downtime; financial loss; or any breach of Fortnox's terms. **You use it entirely at your own risk.** (See the MIT License below — the same limitation applies in full.)
|
|
565
606
|
|
|
566
|
-
**You are responsible for
|
|
607
|
+
**You are responsible for everything you do with it.** Under Swedish law (Bokföringslagen), the company owner or board bears full responsibility for the correctness of all accounting and payroll records, regardless of the tools used. noxctl only executes the instructions you give it — review entries before confirming, especially with `--yes` / `confirm: true`, and reconcile against Fortnox and your own records.
|
|
567
608
|
|
|
568
|
-
**Privacy
|
|
609
|
+
**Privacy / personal data.** noxctl can move accounting *and personal* data out of Fortnox — customer/supplier details and, via the payroll commands, employee personal data such as Swedish personal identity numbers (personnummer), salaries, and absence records. When using it with AI assistants or MCP hosts, that data may enter third-party systems. Keep `includeRaw: false` unless full payloads are necessary, and ensure your use complies with GDPR, processor/data-processing agreements, and any required transfer assessments. See `PRIVACY.md`.
|
|
569
610
|
|
|
570
611
|
**Tax note:** The VAT report is an informational summary only. Reconcile it against Fortnox and your accounting records before submitting anything to Skatteverket.
|
|
571
612
|
|
|
572
|
-
**Fortnox API access** requires your own developer
|
|
613
|
+
**Fortnox API access** requires your own Fortnox account, developer app, and credentials. You must comply with the applicable Fortnox developer terms. noxctl ships no shared credentials, redistributes no Fortnox-owned code or data (not even Fortnox's OpenAPI spec — only opaque drift-detection hashes), and routes nothing through any server operated by the author — it calls the Fortnox API directly from your machine.
|
|
614
|
+
|
|
615
|
+
### Your responsibilities under Fortnox's terms
|
|
616
|
+
|
|
617
|
+
When you register a Fortnox developer app to use noxctl, **you** (not the noxctl author) accept Fortnox's [Developer Agreement](https://www.fortnox.se/developer) and are the contracting party. In particular:
|
|
618
|
+
|
|
619
|
+
- **Eligibility:** registering a Fortnox developer app requires a company registered under Swedish law (Developer Agreement cl. 5.1).
|
|
620
|
+
- **Running it for someone else's Fortnox** (e.g. as a bookkeeper/accountant for a client) makes you a data processor — you must have a data-processing agreement (*personuppgiftsbiträdesavtal*) with that client (cl. 12.3). Using it for your own company does not trigger this.
|
|
621
|
+
- **Sending data to AI/LLMs:** Fortnox does not prohibit it, but you are responsible for the lawfulness of distributing personal data (cl. 13.5 + GDPR) — especially payroll (Lön) and ROT/RUT data, which contain personal identity numbers (personnummer). Ensure a lawful basis and, where required, a data-processing agreement with your AI provider and a valid transfer mechanism for non-EU/EES providers.
|
|
622
|
+
- noxctl is a **client for Fortnox's own API** — a complement, not a replacement — using only documented endpoints and your own credentials.
|
|
573
623
|
|
|
574
624
|
## License
|
|
575
625
|
|
package/dist/auth.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export declare const SCOPES = "article customer invoice payment supplier supplierinvoice bookkeeping companyinformation settings inbox connectfile";
|
|
2
|
+
export declare const SALARY_SCOPE = "salary";
|
|
3
|
+
/** Effective scope string for a profile: the granted set if recorded, else the base SCOPES. */
|
|
4
|
+
export declare function effectiveScopes(creds: Pick<FortnoxCredentials, 'scopes'> | null | undefined): string;
|
|
2
5
|
export declare const CREDENTIAL_SCHEMA_VERSION = 2;
|
|
3
6
|
export interface FortnoxCredentials {
|
|
4
7
|
client_id: string;
|
|
@@ -8,6 +11,7 @@ export interface FortnoxCredentials {
|
|
|
8
11
|
expires_at: number;
|
|
9
12
|
tenant_id?: string;
|
|
10
13
|
company_name?: string;
|
|
14
|
+
scopes?: string;
|
|
11
15
|
schema_version?: number;
|
|
12
16
|
last_write_epoch?: number;
|
|
13
17
|
}
|
|
@@ -32,6 +36,6 @@ export declare function getValidToken(profile?: string): Promise<string>;
|
|
|
32
36
|
export declare function fetchTenantId(accessToken: string): Promise<string | undefined>;
|
|
33
37
|
export declare function fetchCompanyNameSafe(accessToken: string): Promise<string | undefined>;
|
|
34
38
|
export declare function escapeHtml(value: string): string;
|
|
35
|
-
export declare function buildAuthorizationUrl(config: FortnoxAppConfig, redirectUri: string, state: string): string;
|
|
36
|
-
export declare function runOAuthSetup(config: FortnoxAppConfig, profile?: string): Promise<void>;
|
|
39
|
+
export declare function buildAuthorizationUrl(config: FortnoxAppConfig, redirectUri: string, state: string, scopes?: string): string;
|
|
40
|
+
export declare function runOAuthSetup(config: FortnoxAppConfig, profile?: string, scopes?: string): Promise<void>;
|
|
37
41
|
//# 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":"AAoBA,eAAO,MAAM,MAAM,wHACoG,CAAC;AAQxH,eAAO,MAAM,YAAY,WAAW,CAAC;AAErC,+FAA+F;AAC/F,wBAAgB,eAAe,CAC7B,KAAK,EAAE,IAAI,CAAC,kBAAkB,EAAE,QAAQ,CAAC,GAAG,IAAI,GAAG,SAAS,GAC3D,MAAM,CAER;AAED,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;IAMtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,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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AE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,MAAM,GAAE,MAAe,GACtB,MAAM,CAeR;AAED,wBAAsB,aAAa,CACjC,MAAM,EAAE,gBAAgB,EACxB,OAAO,GAAE,MAAwB,EACjC,MAAM,GAAE,MAAe,GACtB,OAAO,CAAC,IAAI,CAAC,CAiIf"}
|
package/dist/auth.js
CHANGED
|
@@ -8,7 +8,25 @@ import { migrateLegacyIfNeeded, readProfileIndex, upsertProfile } from './profil
|
|
|
8
8
|
const FORTNOX_AUTH_URL = 'https://apps.fortnox.se/oauth-v1/auth';
|
|
9
9
|
const FORTNOX_TOKEN_URL = 'https://apps.fortnox.se/oauth-v1/token';
|
|
10
10
|
const CALLBACK_HOST = '127.0.0.1';
|
|
11
|
+
const AUTH_REQUEST_TIMEOUT_MS = 30_000;
|
|
12
|
+
function authFetch(input, init = {}) {
|
|
13
|
+
return fetch(input, {
|
|
14
|
+
...init,
|
|
15
|
+
signal: init.signal ?? AbortSignal.timeout(AUTH_REQUEST_TIMEOUT_MS),
|
|
16
|
+
});
|
|
17
|
+
}
|
|
11
18
|
export const SCOPES = 'article customer invoice payment supplier supplierinvoice bookkeeping companyinformation settings inbox connectfile';
|
|
19
|
+
// The "Lön" (salary/payroll) scope. Opt-in only: requesting it at authorize
|
|
20
|
+
// time fails for users whose Fortnox app integration does not have the Lön
|
|
21
|
+
// permission enabled, so it is never part of the default SCOPES. `noxctl init
|
|
22
|
+
// --with-salary` (or FORTNOX_WITH_SALARY=1) appends it and the granted scope
|
|
23
|
+
// string is persisted per-profile (see FortnoxCredentials.scopes) so the
|
|
24
|
+
// client-credentials refresh re-requests the same set.
|
|
25
|
+
export const SALARY_SCOPE = 'salary';
|
|
26
|
+
/** Effective scope string for a profile: the granted set if recorded, else the base SCOPES. */
|
|
27
|
+
export function effectiveScopes(creds) {
|
|
28
|
+
return creds?.scopes ?? SCOPES;
|
|
29
|
+
}
|
|
12
30
|
export const CREDENTIAL_SCHEMA_VERSION = 2;
|
|
13
31
|
// Module-global resolved profile. This assumes a single-tenant process model
|
|
14
32
|
// (one CLI invocation or one MCP stdio connection per Node process). Hosting
|
|
@@ -16,6 +34,10 @@ export const CREDENTIAL_SCHEMA_VERSION = 2;
|
|
|
16
34
|
// instance would share this state. Revisit if the MCP SDK grows request-local
|
|
17
35
|
// context that handlers can read.
|
|
18
36
|
let resolvedProfile = DEFAULT_PROFILE;
|
|
37
|
+
// Token endpoints may rotate refresh tokens, so concurrent requests for the
|
|
38
|
+
// same profile must share one refresh and one credential-store write. Profile
|
|
39
|
+
// names are case-insensitive throughout the storage layer.
|
|
40
|
+
const tokenRefreshes = new Map();
|
|
19
41
|
// Whether the legacy (pre-0.2) credential slot was observed on the most recent
|
|
20
42
|
// successful load of the default profile. Set only by loadCredentials; read by
|
|
21
43
|
// saveCredentials to decide whether to dual-write during the 0.2.x window.
|
|
@@ -92,7 +114,7 @@ export async function exchangeCodeForTokens(code, redirectUri, config) {
|
|
|
92
114
|
code,
|
|
93
115
|
redirect_uri: redirectUri,
|
|
94
116
|
});
|
|
95
|
-
const response = await
|
|
117
|
+
const response = await authFetch(FORTNOX_TOKEN_URL, {
|
|
96
118
|
method: 'POST',
|
|
97
119
|
headers: {
|
|
98
120
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
@@ -113,9 +135,9 @@ export async function getTokenViaClientCredentials(creds, profile) {
|
|
|
113
135
|
}
|
|
114
136
|
const body = new URLSearchParams({
|
|
115
137
|
grant_type: 'client_credentials',
|
|
116
|
-
scope:
|
|
138
|
+
scope: effectiveScopes(creds),
|
|
117
139
|
});
|
|
118
|
-
const response = await
|
|
140
|
+
const response = await authFetch(FORTNOX_TOKEN_URL, {
|
|
119
141
|
method: 'POST',
|
|
120
142
|
headers: {
|
|
121
143
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
@@ -143,7 +165,7 @@ export async function refreshAccessToken(creds, profile) {
|
|
|
143
165
|
grant_type: 'refresh_token',
|
|
144
166
|
refresh_token: creds.refresh_token,
|
|
145
167
|
});
|
|
146
|
-
const response = await
|
|
168
|
+
const response = await authFetch(FORTNOX_TOKEN_URL, {
|
|
147
169
|
method: 'POST',
|
|
148
170
|
headers: {
|
|
149
171
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
@@ -178,22 +200,39 @@ export async function getValidToken(profile) {
|
|
|
178
200
|
if (Date.now() <= creds.expires_at - 5 * 60 * 1000) {
|
|
179
201
|
return creds.access_token;
|
|
180
202
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
203
|
+
const refreshKey = target.toLowerCase();
|
|
204
|
+
const existing = tokenRefreshes.get(refreshKey);
|
|
205
|
+
if (existing)
|
|
206
|
+
return existing;
|
|
207
|
+
const refresh = (async () => {
|
|
208
|
+
// Prefer client credentials when tenant_id is available (no refresh token
|
|
209
|
+
// rotation). Retain the refresh-token fallback for existing profiles whose
|
|
210
|
+
// service-account setup is unavailable or revoked.
|
|
211
|
+
if (creds.tenant_id) {
|
|
212
|
+
try {
|
|
213
|
+
const refreshed = await getTokenViaClientCredentials(creds, target);
|
|
214
|
+
return refreshed.access_token;
|
|
215
|
+
}
|
|
216
|
+
catch {
|
|
217
|
+
// Fall through to refresh_token flow
|
|
218
|
+
}
|
|
189
219
|
}
|
|
220
|
+
const refreshed = await refreshAccessToken(creds, target);
|
|
221
|
+
return refreshed.access_token;
|
|
222
|
+
})();
|
|
223
|
+
tokenRefreshes.set(refreshKey, refresh);
|
|
224
|
+
try {
|
|
225
|
+
return await refresh;
|
|
226
|
+
}
|
|
227
|
+
finally {
|
|
228
|
+
// Do not delete a newer refresh that could have been installed after this
|
|
229
|
+
// one settled (defensive; normal execution never overlaps them).
|
|
230
|
+
if (tokenRefreshes.get(refreshKey) === refresh)
|
|
231
|
+
tokenRefreshes.delete(refreshKey);
|
|
190
232
|
}
|
|
191
|
-
// Fallback: standard refresh token flow
|
|
192
|
-
const refreshed = await refreshAccessToken(creds, target);
|
|
193
|
-
return refreshed.access_token;
|
|
194
233
|
}
|
|
195
234
|
export async function fetchTenantId(accessToken) {
|
|
196
|
-
const response = await
|
|
235
|
+
const response = await authFetch('https://api.fortnox.se/3/companyinformation', {
|
|
197
236
|
headers: {
|
|
198
237
|
Authorization: `Bearer ${accessToken}`,
|
|
199
238
|
Accept: 'application/json',
|
|
@@ -206,7 +245,7 @@ export async function fetchTenantId(accessToken) {
|
|
|
206
245
|
}
|
|
207
246
|
export async function fetchCompanyNameSafe(accessToken) {
|
|
208
247
|
try {
|
|
209
|
-
const response = await
|
|
248
|
+
const response = await authFetch('https://api.fortnox.se/3/companyinformation', {
|
|
210
249
|
headers: {
|
|
211
250
|
Authorization: `Bearer ${accessToken}`,
|
|
212
251
|
Accept: 'application/json',
|
|
@@ -245,11 +284,11 @@ export function escapeHtml(value) {
|
|
|
245
284
|
.replace(/"/g, '"')
|
|
246
285
|
.replace(/'/g, ''');
|
|
247
286
|
}
|
|
248
|
-
export function buildAuthorizationUrl(config, redirectUri, state) {
|
|
287
|
+
export function buildAuthorizationUrl(config, redirectUri, state, scopes = SCOPES) {
|
|
249
288
|
const params = new URLSearchParams({
|
|
250
289
|
client_id: config.clientId,
|
|
251
290
|
redirect_uri: redirectUri,
|
|
252
|
-
scope:
|
|
291
|
+
scope: scopes,
|
|
253
292
|
state,
|
|
254
293
|
response_type: 'code',
|
|
255
294
|
access_type: 'offline',
|
|
@@ -259,7 +298,7 @@ export function buildAuthorizationUrl(config, redirectUri, state) {
|
|
|
259
298
|
}
|
|
260
299
|
return `${FORTNOX_AUTH_URL}?${params.toString()}`;
|
|
261
300
|
}
|
|
262
|
-
export async function runOAuthSetup(config, profile = DEFAULT_PROFILE) {
|
|
301
|
+
export async function runOAuthSetup(config, profile = DEFAULT_PROFILE, scopes = SCOPES) {
|
|
263
302
|
const validatedProfile = validateProfileName(profile);
|
|
264
303
|
const PORT = 9876;
|
|
265
304
|
const REDIRECT_URI = `http://localhost:${PORT}/callback`;
|
|
@@ -318,6 +357,7 @@ export async function runOAuthSetup(config, profile = DEFAULT_PROFILE) {
|
|
|
318
357
|
expires_at: Date.now() + tokens.expires_in * 1000,
|
|
319
358
|
tenant_id: tenantId,
|
|
320
359
|
company_name: companyName,
|
|
360
|
+
scopes,
|
|
321
361
|
};
|
|
322
362
|
// Preserve the original created_at when re-authenticating an existing
|
|
323
363
|
// profile so the index timestamp reflects first auth, not the most
|
|
@@ -360,7 +400,7 @@ export async function runOAuthSetup(config, profile = DEFAULT_PROFILE) {
|
|
|
360
400
|
}
|
|
361
401
|
});
|
|
362
402
|
server.listen(PORT, CALLBACK_HOST, () => {
|
|
363
|
-
const authUrl = buildAuthorizationUrl(config, REDIRECT_URI, oauthState);
|
|
403
|
+
const authUrl = buildAuthorizationUrl(config, REDIRECT_URI, oauthState, scopes);
|
|
364
404
|
console.log('Opening Fortnox login in your browser...');
|
|
365
405
|
openBrowser(authUrl);
|
|
366
406
|
console.log(`\nWaiting for authentication on http://${CALLBACK_HOST}:${PORT}...`);
|
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,EAAmB,MAAM,wBAAwB,CAAC;AACjG,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEvF,MAAM,gBAAgB,GAAG,uCAAuC,CAAC;AAC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GAAG,CAAC,0CAA0C,aAAa,IAAI,IAAI,KAAK,CAAC,CAAC;QACpF,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;YACzB,MAAM,CAAC,IAAI,KAAK,CAAC,oCAAoC,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QACvE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAcA,OAAO,EAOL,KAAK,eAAe,EACrB,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAcA,OAAO,EAOL,KAAK,eAAe,EACrB,MAAM,eAAe,CAAC;AAwHvB,wBAAgB,sBAAsB,IAAI,eAAe,CAExD"}
|