@substrat-run/connector-fortnox 0.11.1 → 0.12.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 CHANGED
@@ -2,7 +2,10 @@
2
2
 
3
3
  Fortnox accounting for Substrat: reads a company's bookkeeping out of Fortnox as **SIE4**, parses
4
4
  and sums it, and lands the result into a scope through the consuming vertical's own operation. A
5
- **connector** is host code — you sweep it on a scope host; it is never module code.
5
+ **connector** is host code, never module code, and never handed the host (#3377): each call is
6
+ handed one connection (its credential, a `fetch` the platform records against it, its own state,
7
+ doors into its scopes as the connection), and its probes are calls of the one connector call contract
8
+ (`runFortnoxCall`).
6
9
 
7
10
  **Full documentation: https://substrat.net/connectors/fortnox**
8
11
 
@@ -13,9 +16,8 @@ One half, not two. `connector-scrive` has a dispatch handler *and* a poll; this
13
16
  initiates this work: a vertical does not *ask* for last month's bookkeeping the way it asks for a
14
17
  signature — the books simply change at Fortnox, and the platform finds out by looking.
15
18
 
16
- So there is no `registerFortnoxConnector`. `sweepFortnoxLedger` is a `ConnectorSweeper`, the
17
- deployment binds it into the platform sweeper exactly as it binds Scrive's, and that is the whole
18
- trigger surface.
19
+ So there is no `registerFortnoxConnector`. `sweepFortnoxLedger` is what the platform's sweeper
20
+ calls for each connection, handed that connection's door, and that is the whole trigger surface.
19
21
 
20
22
  Each pass, per bound scope: mint a token → list financial years → pick the one that **overlaps**
21
23
  the period → download SIE4 → hash it → parse, sum per (account, cost centre, month) → land it in
@@ -107,6 +109,7 @@ import {
107
109
  sweepFortnoxLedger,
108
110
  probeFortnoxSecret,
109
111
  } from '@substrat-run/connector-fortnox';
112
+ import { connectionBindingDoor, firstPartyConnectionDoor } from '@substrat-run/control-plane-api';
110
113
 
111
114
  // 1. Check the credential BEFORE storing it (#605) — connecting should not mean
112
115
  // "write the row and find out on the next sweep".
@@ -125,14 +128,15 @@ await host.admin.createConnection(actor, {
125
128
  await host.admin.grantToConnection(actor, {
126
129
  connectionId: id, permission: 'ledger:record', node, grantedBy: actor,
127
130
  });
128
- await bindFortnoxScope(host, {
131
+ await bindFortnoxScope(connectionBindingDoor(host, id), {
129
132
  connectionId: id, tenantId, scopeId, vertical,
130
133
  operation: 'ledger/record-period', // yours
131
134
  permission: 'ledger:record', // what it checks
132
135
  });
133
136
 
134
- // 4. Schedule the poll — YOUR deployment calls the sweep on a timer, as with Scrive.
135
- const sweeper = (h, id, o) => sweepFortnoxLedger(h, id, { ...o });
137
+ // 4. Schedule the poll — YOUR deployment calls the sweep on a timer, handing it one connection's
138
+ // door: its state, and an opener held to that connection, which each binding opens where it says.
139
+ const sweeper = (h, id, o) => sweepFortnoxLedger(firstPartyConnectionDoor(h, id, 'fortnox', { fetch: o.fetch }), {});
136
140
  // Node: startPlatformSweeper(host, { sweepers: { fortnox: sweeper }, intervalMs })
137
141
  // Cloudflare: definePlatformSweeperDO (@substrat-run/adapter-cloudflare)
138
142
  ```
package/dist/call.d.ts ADDED
@@ -0,0 +1,46 @@
1
+ import { type ConnectorCallResponse } from '@substrat-run/contracts';
2
+ import { type FetchLike } from '@substrat-run/kernel';
3
+ import { type FortnoxPassOptions } from './index.js';
4
+ /**
5
+ * Fortnox over the one call contract (D-73: `connectorScriptCallRequest` → `connectorCallResponse`,
6
+ * #3377), for the roles the control plane calls it through: `probe-candidate` and `probe`. A probe
7
+ * is handed the credential and a `fetch`; for a stored connection the platform opens the company the
8
+ * row is keyed on (#2316) and the scope that owns it (#3410), and records each call made through
9
+ * that `fetch` as a use of the connection.
10
+ *
11
+ * A stored connection's probe answers one write of the connection's state when Fortnox named the
12
+ * consent's scopes: what the consent covers, which a console reads back as "needs re-consent"
13
+ * (#2422). The platform writes it once the probe answered.
14
+ *
15
+ * Fortnox has no dispatch: nothing in a scope asks it for anything. Its bindings, its sweep and a
16
+ * poll of one scope are no role of the contract — a sweep lands page by page, reads what each
17
+ * landing asks for, writes back through the vertical's operations and uploads invoice files, none
18
+ * of which a hop carries — so each is handed one connection's door in process instead.
19
+ *
20
+ * The server is this package's own rather than the kernel's, because a connector compiles against
21
+ * the oldest kernel its peer range admits (`lint:peer-floor`), and that kernel has none.
22
+ */
23
+ /** Each provider call of a probe is bounded by this: a person is waiting on the form. */
24
+ export declare const FORTNOX_PROBE_TIMEOUT_MS = 15000;
25
+ /** Each provider call of a sweep or a poll is bounded by this, the drain's. */
26
+ export declare const FORTNOX_SWEEP_TIMEOUT_MS = 30000;
27
+ export interface FortnoxCallDeps {
28
+ /** The fetch Fortnox is called through; for a stored connection, the platform records each call made through it. */
29
+ fetch: FetchLike;
30
+ /** The configuration for a call that carries none: host overrides and the consent the deployment asks for. */
31
+ options?: Omit<FortnoxPassOptions, 'sleep' | 'rateWindow'>;
32
+ /** Throw what the connector threw instead of answering `ok: false`. */
33
+ rethrow?: boolean;
34
+ }
35
+ /**
36
+ * A call's `config`, read: `apiBase` and `oauthBase` override the provider hosts, and `consentScopes`
37
+ * (comma or space separated) is the set a consent is held to. Anything else is refused.
38
+ */
39
+ export declare function fortnoxCallOptionsOf(config: Record<string, string> | undefined): NonNullable<FortnoxCallDeps['options']>;
40
+ /**
41
+ * Serve one call. A call the contract does not admit (malformed, another provider, a role this
42
+ * connector does not serve) throws: the platform reports it as its own failure, never as the
43
+ * tenant's credential being refused. A probe that ran answers its verdict.
44
+ */
45
+ export declare function runFortnoxCall(body: unknown, deps: FortnoxCallDeps): Promise<ConnectorCallResponse>;
46
+ //# sourceMappingURL=call.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"call.d.ts","sourceRoot":"","sources":["../src/call.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,KAAK,qBAAqB,EAAmC,MAAM,yBAAyB,CAAC;AAClI,OAAO,EAAwC,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAE5F,OAAO,EAA8C,KAAK,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEjG;;;;;;;;;;;;;;;;;;GAkBG;AAEH,yFAAyF;AACzF,eAAO,MAAM,wBAAwB,QAAS,CAAC;AAC/C,+EAA+E;AAC/E,eAAO,MAAM,wBAAwB,QAAS,CAAC;AAE/C,MAAM,WAAW,eAAe;IAC9B,oHAAoH;IACpH,KAAK,EAAE,SAAS,CAAC;IACjB,8GAA8G;IAC9G,OAAO,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,OAAO,GAAG,YAAY,CAAC,CAAC;IAC3D,uEAAuE;IACvE,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAKD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,GAAG,WAAW,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,CAUxH;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAmBzG"}
package/dist/call.js ADDED
@@ -0,0 +1,88 @@
1
+ import { connectorScriptCallRequest } from '@substrat-run/contracts';
2
+ import { ConnectorRefusal, isConnectorRefusal } from '@substrat-run/kernel';
3
+ import { fortnoxConsentWrite } from './consent.js';
4
+ import { probeFortnoxConnection, probeFortnoxSecret } from './index.js';
5
+ /**
6
+ * Fortnox over the one call contract (D-73: `connectorScriptCallRequest` → `connectorCallResponse`,
7
+ * #3377), for the roles the control plane calls it through: `probe-candidate` and `probe`. A probe
8
+ * is handed the credential and a `fetch`; for a stored connection the platform opens the company the
9
+ * row is keyed on (#2316) and the scope that owns it (#3410), and records each call made through
10
+ * that `fetch` as a use of the connection.
11
+ *
12
+ * A stored connection's probe answers one write of the connection's state when Fortnox named the
13
+ * consent's scopes: what the consent covers, which a console reads back as "needs re-consent"
14
+ * (#2422). The platform writes it once the probe answered.
15
+ *
16
+ * Fortnox has no dispatch: nothing in a scope asks it for anything. Its bindings, its sweep and a
17
+ * poll of one scope are no role of the contract — a sweep lands page by page, reads what each
18
+ * landing asks for, writes back through the vertical's operations and uploads invoice files, none
19
+ * of which a hop carries — so each is handed one connection's door in process instead.
20
+ *
21
+ * The server is this package's own rather than the kernel's, because a connector compiles against
22
+ * the oldest kernel its peer range admits (`lint:peer-floor`), and that kernel has none.
23
+ */
24
+ /** Each provider call of a probe is bounded by this: a person is waiting on the form. */
25
+ export const FORTNOX_PROBE_TIMEOUT_MS = 15_000;
26
+ /** Each provider call of a sweep or a poll is bounded by this, the drain's. */
27
+ export const FORTNOX_SWEEP_TIMEOUT_MS = 30_000;
28
+ const ERROR_MAX = 600;
29
+ const message = (e) => (e instanceof Error ? e.message : String(e)).slice(0, ERROR_MAX) || 'the connector call failed';
30
+ /**
31
+ * A call's `config`, read: `apiBase` and `oauthBase` override the provider hosts, and `consentScopes`
32
+ * (comma or space separated) is the set a consent is held to. Anything else is refused.
33
+ */
34
+ export function fortnoxCallOptionsOf(config) {
35
+ const { apiBase, oauthBase, consentScopes, ...rest } = config ?? {};
36
+ const unknown = Object.keys(rest);
37
+ if (unknown.length > 0)
38
+ throw new Error(`unknown Fortnox configuration: ${unknown.join(', ')}`);
39
+ const scopes = (consentScopes ?? '').split(/[\s,]+/).filter(Boolean);
40
+ return {
41
+ ...(apiBase ? { apiBase } : {}),
42
+ ...(oauthBase ? { oauthBase } : {}),
43
+ ...(scopes.length > 0 ? { consentScopes: scopes } : {}),
44
+ };
45
+ }
46
+ /**
47
+ * Serve one call. A call the contract does not admit (malformed, another provider, a role this
48
+ * connector does not serve) throws: the platform reports it as its own failure, never as the
49
+ * tenant's credential being refused. A probe that ran answers its verdict.
50
+ */
51
+ export async function runFortnoxCall(body, deps) {
52
+ const parsed = connectorScriptCallRequest.safeParse(body);
53
+ if (!parsed.success) {
54
+ const issue = parsed.error.issues[0];
55
+ // Where, never the values: a call carries a credential.
56
+ throw new Error(`not a connector call: ${issue?.path.join('.') || '(root)'} ${issue?.message ?? ''}`.trim());
57
+ }
58
+ const req = parsed.data;
59
+ if (req.provider !== 'fortnox')
60
+ throw new Error(`this connector serves fortnox, not ${req.provider}`);
61
+ const served = ['probe-candidate', 'probe'];
62
+ if (!served.includes(req.role))
63
+ throw new Error(`${req.role} is not served by this connector; it serves ${served.join(', ')}`);
64
+ const options = 'config' in req && req.config !== undefined ? { ...deps.options, ...fortnoxCallOptionsOf(req.config) } : (deps.options ?? {});
65
+ try {
66
+ return await runRole(req, options, deps);
67
+ }
68
+ catch (e) {
69
+ if (deps.rethrow)
70
+ throw e;
71
+ return { ok: false, refused: isConnectorRefusal(e), error: message(e), uses: [] };
72
+ }
73
+ }
74
+ async function runRole(req, options, deps) {
75
+ // Every call a probe makes goes through the platform's `fetch`, which records it, so none is answered again.
76
+ if (req.role === 'probe-candidate') {
77
+ const result = await probeFortnoxSecret(req.secret, { ...options, fetch: deps.fetch, timeoutMs: FORTNOX_PROBE_TIMEOUT_MS });
78
+ // No connection exists yet, so there is nothing to record the consent against.
79
+ return { ok: true, result, state: [], uses: [] };
80
+ }
81
+ if (req.role === 'probe') {
82
+ const result = await probeFortnoxConnection({ secret: req.connection.secret, fetch: deps.fetch }, options);
83
+ // A probe a person asked for is a fresh check, so it always rewrites what the console reads.
84
+ return { ok: true, result, state: result.consent ? [fortnoxConsentWrite(result.consent)] : [], uses: [] };
85
+ }
86
+ throw new ConnectorRefusal(`${req.role} is not served by the Fortnox connector`);
87
+ }
88
+ //# sourceMappingURL=call.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"call.js","sourceRoot":"","sources":["../src/call.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAA+D,MAAM,yBAAyB,CAAC;AAClI,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAkB,MAAM,sBAAsB,CAAC;AAC5F,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAA2B,MAAM,YAAY,CAAC;AAEjG;;;;;;;;;;;;;;;;;;GAkBG;AAEH,yFAAyF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 -0,0 +1,56 @@
1
+ import type { AttachmentRecord } from '@substrat-run/contracts';
2
+ import type { ConnectionContext, ConnectorUploadInput } from '@substrat-run/kernel';
3
+ /**
4
+ * What the Fortnox connector is handed: one connection's worth of the platform per call, and
5
+ * nothing that reaches past it (#3377). No `ScopeHost`, no `HostAdmin`, no tenant to choose. The
6
+ * platform builds these (`@substrat-run/control-plane-api`'s first-party connection doors); the
7
+ * connector only names their shape, from types that exist at its peer floor.
8
+ */
9
+ /** A connection's own state rows: the connector names keys, never the connection. */
10
+ export type FortnoxConnectionState = ConnectionContext['state'];
11
+ /**
12
+ * An opened connection (a sweep's binding, a poll on request): the credential, a `fetch` bounded and
13
+ * recorded as this connection's uses as it is made, this connection's state, and doors into its
14
+ * scopes that act as the connection. The platform opens only the connection the door is held to, so
15
+ * the credential that reads and the identity that lands are one connection.
16
+ */
17
+ export interface FortnoxOpened extends ConnectionContext {
18
+ /** A scope of this connection's tenant and vertical, as the connection: the landing invoke. */
19
+ scope(scopeId: string): Promise<{
20
+ invoke(operation: string, input?: unknown): Promise<unknown>;
21
+ }>;
22
+ /** That scope's attachment surface, as the connection: an invoice's files. */
23
+ attachments(scopeId: string): Promise<{
24
+ upload(input: ConnectorUploadInput): Promise<AttachmentRecord>;
25
+ }>;
26
+ }
27
+ /**
28
+ * A call that starts from a connection id (a sweep, a poll of one scope): its state, which reads
29
+ * without opening anything, and an opener that takes where a binding says the connection lives —
30
+ * the company it is keyed on (#2316) and the scope that owns it (#3410). The platform opens it there
31
+ * only if it IS `connectionId`, so a binding written against another connection is refused.
32
+ */
33
+ export interface FortnoxConnectionDoor {
34
+ readonly connectionId: string;
35
+ readonly state: FortnoxConnectionState;
36
+ open(at: {
37
+ tenantId: string;
38
+ vertical: string;
39
+ externalAccountRef?: string | null;
40
+ ownerScopeId?: string | null;
41
+ }): Promise<FortnoxOpened>;
42
+ }
43
+ /** The binding verbs: this connection's state, and whether it holds a key in one of its scopes. */
44
+ export interface FortnoxBindingDoor {
45
+ readonly state: FortnoxConnectionState;
46
+ /**
47
+ * Whether THIS connection holds `permission` on the scope, read off the tuples the landing invoke is
48
+ * gated on (`connectionGrantsInScope`), not off a directory row that may not have reached it.
49
+ */
50
+ holds(target: {
51
+ tenantId: string;
52
+ scopeId: string;
53
+ permission: string;
54
+ }): Promise<boolean>;
55
+ }
56
+ //# sourceMappingURL=connection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEpF;;;;;GAKG;AAEH,qFAAqF;AACrF,MAAM,MAAM,sBAAsB,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;AAEhE;;;;;GAKG;AACH,MAAM,WAAW,aAAc,SAAQ,iBAAiB;IACtD,+FAA+F;IAC/F,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;KAAE,CAAC,CAAC;IAClG,8EAA8E;IAC9E,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,MAAM,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAA;KAAE,CAAC,CAAC;CAC3G;AAED;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,sBAAsB,CAAC;IACvC,IAAI,CAAC,EAAE,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;CAC5I;AAED,mGAAmG;AACnG,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,KAAK,EAAE,sBAAsB,CAAC;IACvC;;;OAGG;IACH,KAAK,CAAC,MAAM,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC5F"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=connection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection.js","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":""}
package/dist/consent.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { type ConnectionConsent, type ConnectionId } from '@substrat-run/contracts';
2
- import type { HostAdmin } from '@substrat-run/kernel';
1
+ import { type ConnectionConsent } from '@substrat-run/contracts';
3
2
  import type { FortnoxApi } from './api.js';
3
+ import type { FortnoxConnectionState } from './connection.js';
4
4
  /**
5
5
  * What the company's consent covers, apart from whether the credential works (#2422).
6
6
  *
@@ -44,7 +44,18 @@ export declare function fortnoxConsentOf(api: FortnoxApi, consentScopes: readonl
44
44
  * the same grant writes nothing; `checkedAt` is then when the grant was last seen to change.
45
45
  * `always` rewrites it anyway: a probe a person asked for is a fresh check.
46
46
  */
47
- export declare function recordFortnoxConsent(admin: HostAdmin, connectionId: ConnectionId, consent: ConnectionConsent, always?: boolean): Promise<void>;
47
+ export declare function recordFortnoxConsent(state: Pick<FortnoxConnectionState, 'get' | 'put'>, consent: ConnectionConsent, always?: boolean): Promise<void>;
48
+ /**
49
+ * The consent as one write of the connection's state, for a probe over the call contract (#3377):
50
+ * the probe answers it as its `state`, and the platform writes it, as `recordFortnoxConsent(…, true)`
51
+ * did when the probe held the connection's state itself.
52
+ */
53
+ export declare function fortnoxConsentWrite(consent: ConnectionConsent): {
54
+ key: string;
55
+ value: ConnectionConsent;
56
+ };
57
+ /** The prefix every key a probe of this connector writes is under. */
58
+ export declare const FORTNOX_PROBE_WRITES = "fortnox:consent";
48
59
  /** The consent last recorded for a connection, or `null` when none was (or it does not parse). */
49
- export declare function readFortnoxConsent(admin: HostAdmin, connectionId: ConnectionId): Promise<ConnectionConsent | null>;
60
+ export declare function readFortnoxConsent(state: Pick<FortnoxConnectionState, 'get'>): Promise<ConnectionConsent | null>;
50
61
  //# sourceMappingURL=consent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"consent.d.ts","sourceRoot":"","sources":["../src/consent.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,KAAK,iBAAiB,EAAE,KAAK,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAChH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C;;;;;;;;;GASG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,EAAE,SAAS,MAAM,EAMnD,CAAC;AAEF,uEAAuE;AACvE,eAAO,MAAM,qBAAqB,EAAE,SAAS,MAAM,EAAoB,CAAC;AACxE,gHAAgH;AAChH,eAAO,MAAM,sBAAsB,EAAE,SAAS,MAAM,EAA8C,CAAC;AACnG,8FAA8F;AAC9F,eAAO,MAAM,2BAA2B,EAAE,SAAS,MAAM,EAA+B,CAAC;AAEzF;;;GAGG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;IAChD,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,YAAY,OAAO,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAInD;CACF;AAED,kGAAkG;AAClG,wBAAgB,cAAc,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,MAA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qBAAa,uBAAwB,SAAQ,KAAK;IAChD,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,YAAY,OAAO,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAInD;CACF;AAED,kGAAkG;AAClG,wBAAgB,cAAc,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAM/E;AAED,2GAA2G;AAC3G,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAGlH;AAID,iHAAiH;AACjH,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,UAAU,EACf,aAAa,EAAE,SAAS,MAAM,EAAE,EAChC,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAInC;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,IAAI,CAAC,sBAAsB,EAAE,KAAK,GAAG,KAAK,CAAC,EAClD,OAAO,EAAE,iBAAiB,EAC1B,MAAM,UAAQ,GACb,OAAO,CAAC,IAAI,CAAC,CAOf;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,iBAAiB,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,iBAAiB,CAAA;CAAE,CAEzG;AAED,sEAAsE;AACtE,eAAO,MAAM,oBAAoB,oBAAc,CAAC;AAEhD,kGAAkG;AAClG,wBAAsB,kBAAkB,CAAC,KAAK,EAAE,IAAI,CAAC,sBAAsB,EAAE,KAAK,CAAC,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAGtH"}
package/dist/consent.js CHANGED
@@ -66,17 +66,28 @@ export async function fortnoxConsentOf(api, consentScopes, at) {
66
66
  * the same grant writes nothing; `checkedAt` is then when the grant was last seen to change.
67
67
  * `always` rewrites it anyway: a probe a person asked for is a fresh check.
68
68
  */
69
- export async function recordFortnoxConsent(admin, connectionId, consent, always = false) {
69
+ export async function recordFortnoxConsent(state, consent, always = false) {
70
70
  if (!always) {
71
- const held = await readFortnoxConsent(admin, connectionId);
71
+ const held = await readFortnoxConsent(state);
72
72
  if (held && same(held.granted, consent.granted) && same(held.missing, consent.missing))
73
73
  return;
74
74
  }
75
- await admin.putConnectorState(connectionId, CONSENT_KEY, consent);
75
+ const write = fortnoxConsentWrite(consent);
76
+ await state.put(write.key, write.value);
76
77
  }
78
+ /**
79
+ * The consent as one write of the connection's state, for a probe over the call contract (#3377):
80
+ * the probe answers it as its `state`, and the platform writes it, as `recordFortnoxConsent(…, true)`
81
+ * did when the probe held the connection's state itself.
82
+ */
83
+ export function fortnoxConsentWrite(consent) {
84
+ return { key: CONSENT_KEY, value: consent };
85
+ }
86
+ /** The prefix every key a probe of this connector writes is under. */
87
+ export const FORTNOX_PROBE_WRITES = CONSENT_KEY;
77
88
  /** The consent last recorded for a connection, or `null` when none was (or it does not parse). */
78
- export async function readFortnoxConsent(admin, connectionId) {
79
- const parsed = connectionConsent.safeParse(await admin.getConnectorState(connectionId, CONSENT_KEY));
89
+ export async function readFortnoxConsent(state) {
90
+ const parsed = connectionConsent.safeParse(await state.get(CONSENT_KEY));
80
91
  return parsed.success ? parsed.data : null;
81
92
  }
82
93
  const same = (a, b) => a.length === b.length && [...a].sort().every((v, i) => v === [...b].sort()[i]);
@@ -1 +1 @@
1
- {"version":3,"file":"consent.js","sourceRoot":"","sources":["../src/consent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAA6C,MAAM,yBAAyB,CAAC;AAIhH;;;;;;;;;GASG;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAsB;IACvD,aAAa;IACb,oBAAoB;IACpB,iBAAiB;IACjB,SAAS;IACT,aAAa;CACd,CAAC;A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AAO;IACjG,CAAC;IACD,MAAM,KAAK,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC;IAC3C,MAAM,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;AAC1C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAA0B;IAC5D,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAC9C,CAAC;AAED,sEAAsE;AACtE,MAAM,CAAC,MAAM,oBAAoB,GAAG,WAAW,CAAC;AAEhD,kGAAkG;AAClG,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,KAA0C;IACjF,MAAM,MAAM,GAAG,iBAAiB,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC;IACzE,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AAC7C,CAAC;AAED,MAAM,IAAI,GAAG,CAAC,CAAoB,EAAE,CAAoB,EAAW,EAAE,CACnE,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,12 +1,15 @@
1
1
  import { z } from 'zod';
2
2
  import { type ConnectionActivity, type ConnectionCredential, type ConnectionProbe, type ConnectionId } from '@substrat-run/contracts';
3
- import type { FetchLike, ScopeHost } from '@substrat-run/kernel';
3
+ import type { FetchLike } from '@substrat-run/kernel';
4
+ import type { FortnoxBindingDoor, FortnoxConnectionDoor, FortnoxConnectionState, FortnoxOpened } from './connection.js';
4
5
  export { FortnoxApi, FortnoxApiError, fortnoxErrorCode, FORTNOX_API_BASE, FORTNOX_OAUTH_BASE, fortnoxConsentUrl, fortnoxSecret, type FortnoxCompany, type FortnoxFinancialYear, type FortnoxSecret, type FortnoxApiOptions, type FortnoxSupplierInvoice, type FortnoxSupplierInvoiceFile, } from './api.js';
5
6
  export { parseSie4, splitSieLine, sieAmount, sieDate, type SieAccount, type SieDimension, type SieLedger, type SieObject, type SieTransaction, type SieVoucher, } from './sie4.js';
6
7
  export { COST_CENTRE_DIMENSION, financialYearFor, summarizeLedger, type LedgerBalance, type LedgerSummary, } from './aggregate.js';
7
8
  export { FortnoxMock, type FortnoxMockOptions, type FortnoxMockSupplierInvoice } from './mock.js';
8
9
  export { completeFortnoxConsent, type FortnoxConsentCompletion } from './connect.js';
9
- export { FORTNOX_CONSENT_SCOPES, FORTNOX_INVOICE_FILE_SCOPES, FORTNOX_INVOICE_SCOPES, FORTNOX_LEDGER_SCOPES, FortnoxConsentShortfall, readFortnoxConsent, } from './consent.js';
10
+ export { FORTNOX_CONSENT_SCOPES, FORTNOX_INVOICE_FILE_SCOPES, FORTNOX_INVOICE_SCOPES, FORTNOX_LEDGER_SCOPES, FortnoxConsentShortfall, FORTNOX_PROBE_WRITES, fortnoxConsentWrite, readFortnoxConsent, } from './consent.js';
11
+ export type { FortnoxBindingDoor, FortnoxConnectionDoor, FortnoxConnectionState, FortnoxOpened } from './connection.js';
12
+ export { FORTNOX_PROBE_TIMEOUT_MS, FORTNOX_SWEEP_TIMEOUT_MS, fortnoxCallOptionsOf, runFortnoxCall, type FortnoxCallDeps, } from './call.js';
10
13
  /**
11
14
  * The Fortnox connector — the INBOUND half of accounting integration.
12
15
  *
@@ -18,9 +21,17 @@ export { FORTNOX_CONSENT_SCOPES, FORTNOX_INVOICE_FILE_SCOPES, FORTNOX_INVOICE_SC
18
21
  * vertical does not *ask* for last month's bookkeeping the way it asks for a signature;
19
22
  * the bookkeeping simply changes at Fortnox, and the platform finds out by looking.
20
23
  *
21
- * So there is no `registerFortnoxConnector`. `sweepFortnoxLedger` is a
22
- * {@link ConnectorSweeper}, the deployment binds it into the platform sweeper exactly
23
- * as it binds Scrive's, and that is the whole trigger surface.
24
+ * So there is no `registerFortnoxConnector`. `sweepFortnoxLedger` is what the platform's
25
+ * sweeper calls for each connection, handed that one connection's door (#3377), and that is
26
+ * the whole trigger surface.
27
+ *
28
+ * ## One connection per call, and nothing past it (#3377)
29
+ *
30
+ * Every function here is handed one connection's worth of the platform ({@link FortnoxOpened},
31
+ * {@link FortnoxConnectionDoor}, {@link FortnoxBindingDoor}, or its state), never a `ScopeHost`
32
+ * or a `HostAdmin`. The probes are calls of the one connector call contract
33
+ * ({@link runFortnoxCall}); the bindings, the sweep and a poll on request are no role of it and
34
+ * are handed the connection's door, which the platform builds.
24
35
  *
25
36
  * ## Where the data lands, and why the connector does not decide
26
37
  *
@@ -386,6 +397,11 @@ export declare const fortnoxInvoiceWritebackReceipt: z.ZodObject<{
386
397
  export type FortnoxInvoiceWritebackReceipt = z.infer<typeof fortnoxInvoiceWritebackReceipt>;
387
398
  /** How far back a binding's first pass reads when its declaration does not say. */
388
399
  export declare const INVOICE_FIRST_LOOKBACK_DAYS = 90;
400
+ /**
401
+ * The options of a call handed an opened connection or its door: the connection brings its own
402
+ * `fetch`, bounded and recorded by the platform, so none is passed here.
403
+ */
404
+ export type FortnoxPassOptions = Omit<FortnoxConnectorOptions, 'fetch' | 'timeoutMs'>;
389
405
  export interface FortnoxConnectorOptions {
390
406
  fetch: FetchLike;
391
407
  apiBase?: string;
@@ -414,7 +430,7 @@ export interface FortnoxConnectorOptions {
414
430
  * nobody is watching, with a provider round trip already spent. Here it fails in the
415
431
  * operator's hands, naming the permission to grant.
416
432
  */
417
- export declare function bindFortnoxScope(host: ScopeHost, input: {
433
+ export declare function bindFortnoxScope(door: FortnoxBindingDoor, input: {
418
434
  connectionId: ConnectionId;
419
435
  tenantId: string;
420
436
  scopeId: string;
@@ -439,14 +455,14 @@ export declare function bindFortnoxScope(host: ScopeHost, input: {
439
455
  now?: () => number;
440
456
  }): Promise<FortnoxBinding>;
441
457
  /** Every scope this connection syncs into. */
442
- export declare function listFortnoxBindings(host: ScopeHost, connectionId: ConnectionId): Promise<FortnoxBinding[]>;
458
+ export declare function listFortnoxBindings(state: Pick<FortnoxConnectionState, 'list'>): Promise<FortnoxBinding[]>;
443
459
  /**
444
460
  * Stop syncing one scope. The binding row is replaced with a tombstone rather than
445
461
  * removed, because `putConnectorState` is the only verb this surface has — and an
446
462
  * unbound scope that a later sweep silently re-adopts would be worse than a visible
447
463
  * dead row.
448
464
  */
449
- export declare function unbindFortnoxScope(host: ScopeHost, connectionId: ConnectionId, scopeId: string): Promise<void>;
465
+ export declare function unbindFortnoxScope(state: Pick<FortnoxConnectionState, 'put'>, scopeId: string): Promise<void>;
450
466
  /** What one scope's sync did. */
451
467
  export interface FortnoxSyncResult {
452
468
  scopeId: string;
@@ -467,7 +483,7 @@ export interface FortnoxSyncResult {
467
483
  * and an unchanged hash returns `changed: false` without a single `invoke` — which
468
484
  * matters because a sweep runs on a timer and most passes find books nobody has touched.
469
485
  */
470
- export declare function syncFortnoxScope(host: ScopeHost, connectionId: ConnectionId, binding: FortnoxBinding, options: FortnoxConnectorOptions & {
486
+ export declare function syncFortnoxScope(conn: FortnoxOpened, binding: FortnoxBinding, options: FortnoxPassOptions & {
471
487
  period?: {
472
488
  from: string;
473
489
  to: string;
@@ -485,7 +501,7 @@ export declare function syncFortnoxScope(host: ScopeHost, connectionId: Connecti
485
501
  * Each year is written to the binding right after it lands, so a failure on one costs only that one,
486
502
  * and the years that did land are answered beside the ones that failed.
487
503
  */
488
- export declare function syncFortnoxSieFiles(host: ScopeHost, connectionId: ConnectionId, binding: FortnoxBinding, options: FortnoxConnectorOptions & {
504
+ export declare function syncFortnoxSieFiles(conn: FortnoxOpened, binding: FortnoxBinding, options: FortnoxPassOptions & {
489
505
  period?: {
490
506
  from: string;
491
507
  to: string;
@@ -530,7 +546,7 @@ export interface FortnoxInvoiceSyncResult {
530
546
  * Files come after the cursor, because a file that cannot be read says nothing about the invoice:
531
547
  * the invoices keep landing, and the file stays queued and fails the scope's row by its number.
532
548
  */
533
- export declare function syncFortnoxSupplierInvoices(host: ScopeHost, connectionId: ConnectionId, binding: FortnoxBinding, options: FortnoxConnectorOptions & {
549
+ export declare function syncFortnoxSupplierInvoices(conn: FortnoxOpened, binding: FortnoxBinding, options: FortnoxPassOptions & {
534
550
  budget?: {
535
551
  details: number;
536
552
  };
@@ -553,8 +569,8 @@ export interface FortnoxSweepResult {
553
569
  busy: string[];
554
570
  }
555
571
  /**
556
- * Poll Fortnox for every scope this connection is bound to — the {@link ConnectorSweeper}
557
- * a deployment schedules. A ledger binding syncs its year of books
572
+ * Poll Fortnox for every scope this connection is bound to — what the platform's sweeper runs
573
+ * for each connection, handed its door (#3377). A ledger binding syncs its year of books
558
574
  * ({@link syncFortnoxScope}); an invoice binding lands the supplier invoices changed since its
559
575
  * cursor ({@link syncFortnoxSupplierInvoices}). The name predates invoices and is kept.
560
576
  *
@@ -566,7 +582,7 @@ export interface FortnoxSweepResult {
566
582
  * anything, and a failure on one scope is recorded and stepped over rather than sinking
567
583
  * the pass — one vertical's missing grant must not stop another tenant's books syncing.
568
584
  */
569
- export declare function sweepFortnoxLedger(host: ScopeHost, connectionId: ConnectionId, options: FortnoxConnectorOptions & {
585
+ export declare function sweepFortnoxLedger(door: FortnoxConnectionDoor, options: FortnoxPassOptions & {
570
586
  period?: {
571
587
  from: string;
572
588
  to: string;
@@ -589,7 +605,7 @@ export interface FortnoxScopePoll {
589
605
  * Poll ONE scope's bindings now — {@link sweepFortnoxLedger} narrowed to the scope, so the same
590
606
  * budget, deadline and rate window bound it as bound a pass.
591
607
  */
592
- export declare function pollFortnoxScope(host: ScopeHost, connectionId: ConnectionId, scopeId: string, options: FortnoxConnectorOptions): Promise<FortnoxScopePoll>;
608
+ export declare function pollFortnoxScope(door: FortnoxConnectionDoor, scopeId: string, options: FortnoxPassOptions): Promise<FortnoxScopePoll>;
593
609
  /**
594
610
  * Probe a credential that is not stored yet — the connect-time check (#605).
595
611
  *
@@ -603,13 +619,18 @@ export declare function pollFortnoxScope(host: ScopeHost, connectionId: Connecti
603
619
  * an operator is most likely to paste wrong.
604
620
  */
605
621
  export declare function probeFortnoxSecret(secret: Record<string, string>, options: FortnoxConnectorOptions): Promise<ConnectionProbe>;
606
- /** Probe the credential a live connection already holds. Verifying is itself a use. */
607
- export declare function probeFortnoxConnection(host: ScopeHost, connection: {
608
- tenantId: string;
609
- vertical: string;
610
- externalAccountRef?: string | null;
611
- ownerScopeId?: string | null;
612
- }, options: FortnoxConnectorOptions): Promise<ConnectionProbe>;
622
+ /**
623
+ * Probe the credential a live connection already holds. Verifying is itself a use: `conn.fetch` is
624
+ * the platform's, bounded and recorded against the connection.
625
+ *
626
+ * The answer names what the consent covers (`consent`). A probe a person asked for is a fresh check,
627
+ * so the platform records it whenever there is one, rewriting what the console reads: over the call
628
+ * contract the probe answers it as a write of the connection's state ({@link runFortnoxCall}).
629
+ */
630
+ export declare function probeFortnoxConnection(conn: {
631
+ secret: Readonly<Record<string, string>>;
632
+ fetch: FetchLike;
633
+ }, options: FortnoxPassOptions): Promise<ConnectionProbe>;
613
634
  /**
614
635
  * What this connection has been doing, for a console — one entry per bound scope.
615
636
  *
@@ -617,7 +638,7 @@ export declare function probeFortnoxConnection(host: ScopeHost, connection: {
617
638
  * synced", which is the question an operator asks when a figure looks stale, and it
618
639
  * answers it without spending a provider round trip.
619
640
  */
620
- export declare function fortnoxConnectionActivity(host: ScopeHost, connectionId: ConnectionId): Promise<ConnectionActivity>;
641
+ export declare function fortnoxConnectionActivity(state: Pick<FortnoxConnectionState, 'get' | 'list'>): Promise<ConnectionActivity>;
621
642
  /**
622
643
  * The stored credential, REDUCED (#605) — identifiers whole, secrets masked.
623
644
  *
@@ -625,10 +646,5 @@ export declare function fortnoxConnectionActivity(host: ScopeHost, connectionId:
625
646
  * identifier, not a secret — and it is the field an operator most needs to read when a
626
647
  * connection syncs the wrong company's books.
627
648
  */
628
- export declare function fortnoxCredentialSummary(host: ScopeHost, connection: {
629
- tenantId: string;
630
- vertical: string;
631
- externalAccountRef?: string | null;
632
- ownerScopeId?: string | null;
633
- }): Promise<ConnectionCredential>;
649
+ export declare function fortnoxCredentialSummary(storedSecret: Readonly<Record<string, unknown>>): ConnectionCredential;
634
650
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAWL,KAAK,kBAAkB,EAEvB,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,YAAY,EAElB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAEV,SAAS,EAET,SAAS,EACV,MAAM,sBAAsB,CAAC;AAmC9B,OAAO,EACL,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,aAAa,EACb,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,GAChC,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,SAAS,EACT,YAAY,EACZ,SAAS,EACT,OAAO,EACP,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,UAAU,GAChB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,eAAe,EACf,KAAK,aAAa,EAClB,KAAK,aAAa,GACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,KAAK,kBAAkB,EAAE,KAAK,0BAA0B,EAAE,MAAM,WAA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