boondmanager-mcp-server 2.15.2 → 2.17.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/LICENSE +1 -1
- package/NOTICE +16 -2
- package/README.md +60 -15
- package/dist/config/access-policy.d.ts.map +1 -1
- package/dist/config/access-policy.js +6 -18
- package/dist/config/access-policy.js.map +1 -1
- package/dist/config/dictionary-overrides.d.ts.map +1 -1
- package/dist/config/dictionary-overrides.js +2 -12
- package/dist/config/dictionary-overrides.js.map +1 -1
- package/dist/config/env.d.ts +63 -0
- package/dist/config/env.d.ts.map +1 -0
- package/dist/config/env.js +116 -0
- package/dist/config/env.js.map +1 -0
- package/dist/config/profiles.d.ts +22 -8
- package/dist/config/profiles.d.ts.map +1 -1
- package/dist/config/profiles.js +48 -4
- package/dist/config/profiles.js.map +1 -1
- package/dist/constants.d.ts +13 -2
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +25 -1
- package/dist/constants.js.map +1 -1
- package/dist/icons.d.ts.map +1 -1
- package/dist/icons.js +6 -1
- package/dist/icons.js.map +1 -1
- package/dist/index.js +33 -15
- package/dist/index.js.map +1 -1
- package/dist/instructions.d.ts +1 -1
- package/dist/instructions.d.ts.map +1 -1
- package/dist/instructions.js +6 -6
- package/dist/instructions.js.map +1 -1
- package/dist/prompts/index.d.ts +19 -1
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +495 -25
- package/dist/prompts/index.js.map +1 -1
- package/dist/prompts/periods.d.ts +45 -0
- package/dist/prompts/periods.d.ts.map +1 -0
- package/dist/prompts/periods.js +154 -0
- package/dist/prompts/periods.js.map +1 -0
- package/dist/resources/index.d.ts +14 -0
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/index.js +285 -0
- package/dist/resources/index.js.map +1 -1
- package/dist/resources/templates.d.ts +1 -1
- package/dist/resources/templates.d.ts.map +1 -1
- package/dist/resources/templates.js +2 -0
- package/dist/resources/templates.js.map +1 -1
- package/dist/schema-dialect.js.map +1 -1
- package/dist/schemas/filter-aliases.d.ts +1 -1
- package/dist/schemas/filter-aliases.d.ts.map +1 -1
- package/dist/schemas/filter-aliases.js +101 -2
- package/dist/schemas/filter-aliases.js.map +1 -1
- package/dist/schemas/index.d.ts +987 -161
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +853 -323
- package/dist/schemas/index.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +10 -3
- package/dist/server.js.map +1 -1
- package/dist/services/boond-client.d.ts +29 -213
- package/dist/services/boond-client.d.ts.map +1 -1
- package/dist/services/boond-client.js +29 -1168
- package/dist/services/boond-client.js.map +1 -1
- package/dist/services/dictionary.d.ts +27 -3
- package/dist/services/dictionary.d.ts.map +1 -1
- package/dist/services/dictionary.js +60 -23
- package/dist/services/dictionary.js.map +1 -1
- package/dist/services/document-text.d.ts +32 -0
- package/dist/services/document-text.d.ts.map +1 -0
- package/dist/services/document-text.js +120 -0
- package/dist/services/document-text.js.map +1 -0
- package/dist/services/format/detail.d.ts +16 -0
- package/dist/services/format/detail.d.ts.map +1 -0
- package/dist/services/format/detail.js +36 -0
- package/dist/services/format/detail.js.map +1 -0
- package/dist/services/format/html.d.ts +19 -0
- package/dist/services/format/html.d.ts.map +1 -0
- package/dist/services/format/html.js +87 -0
- package/dist/services/format/html.js.map +1 -0
- package/dist/services/format/list.d.ts +3 -0
- package/dist/services/format/list.d.ts.map +1 -0
- package/dist/services/format/list.js +44 -0
- package/dist/services/format/list.js.map +1 -0
- package/dist/services/format/summary.d.ts +16 -0
- package/dist/services/format/summary.d.ts.map +1 -0
- package/dist/services/format/summary.js +172 -0
- package/dist/services/format/summary.js.map +1 -0
- package/dist/services/format/tab.d.ts +9 -0
- package/dist/services/format/tab.d.ts.map +1 -0
- package/dist/services/format/tab.js +32 -0
- package/dist/services/format/tab.js.map +1 -0
- package/dist/services/http/auth.d.ts +44 -0
- package/dist/services/http/auth.d.ts.map +1 -0
- package/dist/services/http/auth.js +146 -0
- package/dist/services/http/auth.js.map +1 -0
- package/dist/services/http/download.d.ts +60 -0
- package/dist/services/http/download.d.ts.map +1 -0
- package/dist/services/http/download.js +160 -0
- package/dist/services/http/download.js.map +1 -0
- package/dist/services/http/errors.d.ts +45 -0
- package/dist/services/http/errors.d.ts.map +1 -0
- package/dist/services/http/errors.js +188 -0
- package/dist/services/http/errors.js.map +1 -0
- package/dist/services/http/rate-limit.d.ts +40 -0
- package/dist/services/http/rate-limit.d.ts.map +1 -0
- package/dist/services/http/rate-limit.js +92 -0
- package/dist/services/http/rate-limit.js.map +1 -0
- package/dist/services/http/retry.d.ts +46 -0
- package/dist/services/http/retry.d.ts.map +1 -0
- package/dist/services/http/retry.js +101 -0
- package/dist/services/http/retry.js.map +1 -0
- package/dist/services/http/transport.d.ts +73 -0
- package/dist/services/http/transport.d.ts.map +1 -0
- package/dist/services/http/transport.js +272 -0
- package/dist/services/http/transport.js.map +1 -0
- package/dist/services/logger.d.ts +53 -2
- package/dist/services/logger.d.ts.map +1 -1
- package/dist/services/logger.js +82 -21
- package/dist/services/logger.js.map +1 -1
- package/dist/services/oauth.d.ts +12 -0
- package/dist/services/oauth.d.ts.map +1 -1
- package/dist/services/oauth.js +21 -8
- package/dist/services/oauth.js.map +1 -1
- package/dist/services/rate-limiter.d.ts +9 -2
- package/dist/services/rate-limiter.d.ts.map +1 -1
- package/dist/services/rate-limiter.js +18 -6
- package/dist/services/rate-limiter.js.map +1 -1
- package/dist/services/request-context.d.ts +47 -0
- package/dist/services/request-context.d.ts.map +1 -0
- package/dist/services/request-context.js +112 -0
- package/dist/services/request-context.js.map +1 -0
- package/dist/services/search.d.ts +26 -0
- package/dist/services/search.d.ts.map +1 -0
- package/dist/services/search.js +98 -0
- package/dist/services/search.js.map +1 -0
- package/dist/services/update-checker.d.ts.map +1 -1
- package/dist/services/update-checker.js +15 -8
- package/dist/services/update-checker.js.map +1 -1
- package/dist/tools/absences.d.ts +9 -0
- package/dist/tools/absences.d.ts.map +1 -1
- package/dist/tools/absences.js +65 -20
- package/dist/tools/absences.js.map +1 -1
- package/dist/tools/actions.d.ts.map +1 -1
- package/dist/tools/actions.js +11 -27
- package/dist/tools/actions.js.map +1 -1
- package/dist/tools/advantages.d.ts +2 -0
- package/dist/tools/advantages.d.ts.map +1 -1
- package/dist/tools/advantages.js +66 -13
- package/dist/tools/advantages.js.map +1 -1
- package/dist/tools/alerts.d.ts +18 -0
- package/dist/tools/alerts.d.ts.map +1 -0
- package/dist/tools/alerts.js +82 -0
- package/dist/tools/alerts.js.map +1 -0
- package/dist/tools/application.d.ts +2 -1
- package/dist/tools/application.d.ts.map +1 -1
- package/dist/tools/application.js +9 -3
- package/dist/tools/application.js.map +1 -1
- package/dist/tools/contacts.d.ts.map +1 -1
- package/dist/tools/contacts.js +3 -7
- package/dist/tools/contacts.js.map +1 -1
- package/dist/tools/contracts.d.ts +22 -0
- package/dist/tools/contracts.d.ts.map +1 -1
- package/dist/tools/contracts.js +185 -52
- package/dist/tools/contracts.js.map +1 -1
- package/dist/tools/crud-factory.d.ts +33 -2
- package/dist/tools/crud-factory.d.ts.map +1 -1
- package/dist/tools/crud-factory.js +42 -15
- package/dist/tools/crud-factory.js.map +1 -1
- package/dist/tools/deliveries.d.ts +3 -0
- package/dist/tools/deliveries.d.ts.map +1 -1
- package/dist/tools/deliveries.js +50 -94
- package/dist/tools/deliveries.js.map +1 -1
- package/dist/tools/description-builders.d.ts +0 -1
- package/dist/tools/description-builders.d.ts.map +1 -1
- package/dist/tools/description-builders.js +46 -3
- package/dist/tools/description-builders.js.map +1 -1
- package/dist/tools/documents.d.ts.map +1 -1
- package/dist/tools/documents.js +73 -21
- package/dist/tools/documents.js.map +1 -1
- package/dist/tools/expenses.d.ts.map +1 -1
- package/dist/tools/expenses.js +2 -11
- package/dist/tools/expenses.js.map +1 -1
- package/dist/tools/find.d.ts +61 -0
- package/dist/tools/find.d.ts.map +1 -0
- package/dist/tools/find.js +221 -0
- package/dist/tools/find.js.map +1 -0
- package/dist/tools/flags.d.ts +5 -0
- package/dist/tools/flags.d.ts.map +1 -1
- package/dist/tools/flags.js +116 -1
- package/dist/tools/flags.js.map +1 -1
- package/dist/tools/forms.d.ts +5 -0
- package/dist/tools/forms.d.ts.map +1 -0
- package/dist/tools/forms.js +64 -0
- package/dist/tools/forms.js.map +1 -0
- package/dist/tools/groupments.d.ts +5 -0
- package/dist/tools/groupments.d.ts.map +1 -0
- package/dist/tools/groupments.js +68 -0
- package/dist/tools/groupments.js.map +1 -0
- package/dist/tools/inactivities.d.ts +5 -0
- package/dist/tools/inactivities.d.ts.map +1 -0
- package/dist/tools/inactivities.js +59 -0
- package/dist/tools/inactivities.js.map +1 -0
- package/dist/tools/index.d.ts +4 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +4 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/invoices.d.ts.map +1 -1
- package/dist/tools/invoices.js +27 -2
- package/dist/tools/invoices.js.map +1 -1
- package/dist/tools/linked-entity-filters.d.ts +48 -0
- package/dist/tools/linked-entity-filters.d.ts.map +1 -0
- package/dist/tools/linked-entity-filters.js +64 -0
- package/dist/tools/linked-entity-filters.js.map +1 -0
- package/dist/tools/notifications.d.ts.map +1 -1
- package/dist/tools/notifications.js +0 -5
- package/dist/tools/notifications.js.map +1 -1
- package/dist/tools/orders.d.ts.map +1 -1
- package/dist/tools/orders.js +33 -4
- package/dist/tools/orders.js.map +1 -1
- package/dist/tools/parameter-disclosure.js.map +1 -1
- package/dist/tools/payments.d.ts +3 -0
- package/dist/tools/payments.d.ts.map +1 -1
- package/dist/tools/payments.js +43 -109
- package/dist/tools/payments.js.map +1 -1
- package/dist/tools/positionings.d.ts.map +1 -1
- package/dist/tools/positionings.js +9 -39
- package/dist/tools/positionings.js.map +1 -1
- package/dist/tools/projects.d.ts.map +1 -1
- package/dist/tools/projects.js +5 -12
- package/dist/tools/projects.js.map +1 -1
- package/dist/tools/provider-invoices.d.ts +2 -0
- package/dist/tools/provider-invoices.d.ts.map +1 -1
- package/dist/tools/provider-invoices.js +30 -111
- package/dist/tools/provider-invoices.js.map +1 -1
- package/dist/tools/purchases.d.ts +2 -0
- package/dist/tools/purchases.d.ts.map +1 -1
- package/dist/tools/purchases.js +50 -104
- package/dist/tools/purchases.js.map +1 -1
- package/dist/tools/registration-decorators.d.ts +28 -0
- package/dist/tools/registration-decorators.d.ts.map +1 -1
- package/dist/tools/registration-decorators.js +107 -0
- package/dist/tools/registration-decorators.js.map +1 -1
- package/dist/tools/resources.d.ts.map +1 -1
- package/dist/tools/resources.js +27 -5
- package/dist/tools/resources.js.map +1 -1
- package/dist/tools/rights.d.ts +101 -0
- package/dist/tools/rights.d.ts.map +1 -0
- package/dist/tools/rights.js +75 -0
- package/dist/tools/rights.js.map +1 -0
- package/dist/tools/tab-tools.js +3 -3
- package/dist/tools/tab-tools.js.map +1 -1
- package/dist/tools/timesheets.d.ts +29 -0
- package/dist/tools/timesheets.d.ts.map +1 -1
- package/dist/tools/timesheets.js +196 -126
- package/dist/tools/timesheets.js.map +1 -1
- package/dist/tools/todolists.d.ts +2 -0
- package/dist/tools/todolists.d.ts.map +1 -1
- package/dist/tools/todolists.js +64 -1
- package/dist/tools/todolists.js.map +1 -1
- package/dist/tools/validations.d.ts +9 -0
- package/dist/tools/validations.d.ts.map +1 -1
- package/dist/tools/validations.js +86 -9
- package/dist/tools/validations.js.map +1 -1
- package/dist/tools/workflows.js +1 -1
- package/dist/tools/workflows.js.map +1 -1
- package/dist/transports/http.d.ts +116 -0
- package/dist/transports/http.d.ts.map +1 -1
- package/dist/transports/http.js +422 -92
- package/dist/transports/http.js.map +1 -1
- package/dist/types.d.ts +3 -3
- package/dist/types.d.ts.map +1 -1
- package/manifest.json +7 -7
- package/package.json +14 -10
|
@@ -1,215 +1,31 @@
|
|
|
1
|
-
import type { BoondAuthProvider, JsonApiResource, JsonApiResponse, SearchParams } from "../types.js";
|
|
2
|
-
import type { ProgressReporter } from "./progress.js";
|
|
3
1
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
*
|
|
15
|
-
* `
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
export
|
|
26
|
-
export
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
export
|
|
33
|
-
/**
|
|
34
|
-
* Install a custom auth provider — used by the HTTP transport bootstrap to
|
|
35
|
-
* wire in an OAuth2 token source (where the access token is refreshed
|
|
36
|
-
* transparently per request rather than baked in at startup).
|
|
37
|
-
*/
|
|
38
|
-
export declare function initClientWithAuth(auth: BoondAuthProvider, baseUrl?: string): void;
|
|
39
|
-
/** Test helper — reset the cached config so the next call re-initialises. */
|
|
40
|
-
export declare function resetClientForTests(): void;
|
|
41
|
-
export type QueryValue = string | number | Array<string | number> | undefined;
|
|
42
|
-
/**
|
|
43
|
-
* Pull the human-readable bits out of a BoondManager error body.
|
|
44
|
-
*
|
|
45
|
-
* Boond returns JSON:API errors of the form:
|
|
46
|
-
* { "errors": [ { "status": "422", "code": "422", "detail": "...", "title": "..." } ] }
|
|
47
|
-
*
|
|
48
|
-
* Surfacing `detail` (and `title` when present) gives the model a focused
|
|
49
|
-
* message like `422 - password mismatch` instead of the full ~500-char body
|
|
50
|
-
* dump that previously made it hard for the LLM to reason about the failure.
|
|
51
|
-
*
|
|
52
|
-
* Exported for unit testing.
|
|
53
|
-
*/
|
|
54
|
-
export declare function parseBoondErrorBody(body: string): string | null;
|
|
55
|
-
/**
|
|
56
|
-
* Resolve the per-request HTTP timeout in milliseconds.
|
|
57
|
-
*
|
|
58
|
-
* Reads BOOND_HTTP_TIMEOUT_MS at call time so tests / runtime overrides take
|
|
59
|
-
* effect without restarting the process. Falls back to the default for
|
|
60
|
-
* unset, non-numeric, or non-positive values.
|
|
61
|
-
*
|
|
62
|
-
* Exported for unit testing.
|
|
63
|
-
*/
|
|
64
|
-
export declare function resolveTimeoutMs(): number;
|
|
65
|
-
export interface RetryConfig {
|
|
66
|
-
maxRetries: number;
|
|
67
|
-
baseDelayMs: number;
|
|
68
|
-
maxDelayMs: number;
|
|
69
|
-
}
|
|
70
|
-
/** Resolve retry configuration from env, with safe fallbacks. Exported for tests. */
|
|
71
|
-
export declare function resolveRetryConfig(): RetryConfig;
|
|
72
|
-
/**
|
|
73
|
-
* Decide whether a failed attempt is worth retrying.
|
|
74
|
-
*
|
|
75
|
-
* Retry policy is intentionally conservative for non-idempotent verbs to avoid
|
|
76
|
-
* silently duplicating writes when the server's response was lost or delayed:
|
|
77
|
-
* - 429 (Too Many Requests) is always retried — the server explicitly
|
|
78
|
-
* rejected the request before processing it, so it is safe regardless of
|
|
79
|
-
* verb.
|
|
80
|
-
* - For GET only, 5xx responses, network failures, and timeouts are retried
|
|
81
|
-
* because GET is idempotent.
|
|
82
|
-
* - 4xx responses (other than 429) are never retried — the client must change
|
|
83
|
-
* the request before another attempt makes sense.
|
|
84
|
-
*
|
|
85
|
-
* Exported for unit testing.
|
|
86
|
-
*/
|
|
87
|
-
export declare function isRetryable(method: string, status: number | undefined, isNetworkOrTimeout: boolean): boolean;
|
|
88
|
-
/**
|
|
89
|
-
* Parse a `Retry-After` header value into milliseconds.
|
|
90
|
-
*
|
|
91
|
-
* Accepts either a non-negative number of seconds or an HTTP-date. Returns
|
|
92
|
-
* null when the value is absent or unparseable. Negative computed delays are
|
|
93
|
-
* clamped to 0. Exported for unit testing.
|
|
94
|
-
*/
|
|
95
|
-
export declare function parseRetryAfter(value: string | null, now?: number): number | null;
|
|
96
|
-
/**
|
|
97
|
-
* Compute the next backoff delay using full jitter:
|
|
98
|
-
* delay = random(0, min(maxMs, baseMs * 2^attempt))
|
|
99
|
-
*
|
|
100
|
-
* Full jitter (vs. exponential-only) reduces thundering-herd risk when many
|
|
101
|
-
* clients retry in lockstep. Exported for unit testing.
|
|
102
|
-
*/
|
|
103
|
-
export declare function computeBackoffMs(attempt: number, baseMs: number, maxMs: number, random?: () => number): number;
|
|
104
|
-
export interface RateLimitConfig {
|
|
105
|
-
rps: number;
|
|
106
|
-
burst: number;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Read rate-limit env vars. `rps` of 0 (or non-numeric) disables rate
|
|
110
|
-
* limiting entirely. `burst` falls back to `rps * 2` when unset, mirroring
|
|
111
|
-
* the documented default behaviour. Exported for unit testing.
|
|
112
|
-
*/
|
|
113
|
-
export declare function resolveRateLimitConfig(): RateLimitConfig | null;
|
|
114
|
-
/**
|
|
115
|
-
* Reset the cached rate limiter so the next request re-reads env vars.
|
|
116
|
-
* Intended for tests that toggle `BOOND_HTTP_RATE_LIMIT_*` between cases.
|
|
117
|
-
*/
|
|
118
|
-
export declare function resetRateLimiterForTests(): void;
|
|
119
|
-
/** Build the Error message for a non-2xx HTTP response. Exported for testing. */
|
|
120
|
-
export declare function formatApiError(status: number, statusText: string, method: string, path: string, body: string): string;
|
|
121
|
-
/**
|
|
122
|
-
* Defense-in-depth against path traversal / query injection through entity
|
|
123
|
-
* ids interpolated into API paths at ~40 call sites. Even though the id
|
|
124
|
-
* schemas are now numeric-only, a future tool could forget to validate, so we
|
|
125
|
-
* assert here that the path is well-formed: it must start with `/`, carry no
|
|
126
|
-
* query (`?`) or fragment (`#`) — those arrive via `queryParams`, never the
|
|
127
|
-
* path — and contain no traversal (`..`) or percent/backslash escapes. Built
|
|
128
|
-
* paths only ever combine static segments with numeric ids and hyphenated tab
|
|
129
|
-
* names, so this rejects nothing legitimate. Exported for unit testing.
|
|
130
|
-
*/
|
|
131
|
-
export declare function assertSafeApiPath(path: string): void;
|
|
132
|
-
/**
|
|
133
|
-
* Validates `path` and resolves it against `baseUrl`, returning the
|
|
134
|
-
* constructed URL. Throws if the path is unsafe (see `assertSafeApiPath`) or
|
|
135
|
-
* if the resolved URL escapes the configured API base origin/path. Centralises
|
|
136
|
-
* the guard shared by apiRequest / apiDownload / apiUploadForm. Exported for
|
|
137
|
-
* unit testing.
|
|
138
|
-
*/
|
|
139
|
-
export declare function resolveApiUrl(baseUrl: string, path: string): URL;
|
|
140
|
-
export declare function apiRequest(path: string, method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", body?: unknown, queryParams?: Record<string, QueryValue>): Promise<JsonApiResponse>;
|
|
141
|
-
/**
|
|
142
|
-
* Parse the filename out of a `Content-Disposition` header. Handles the
|
|
143
|
-
* common `filename="…"`/`filename=…` forms and the RFC 5987
|
|
144
|
-
* `filename*=UTF-8''…` form. Returns undefined when absent. Exported for
|
|
145
|
-
* unit testing.
|
|
146
|
-
*/
|
|
147
|
-
export declare function parseContentDispositionFilename(header: string | null): string | undefined;
|
|
148
|
-
export interface DownloadedDocument {
|
|
149
|
-
data: Buffer;
|
|
150
|
-
contentType: string;
|
|
151
|
-
filename?: string;
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* Download a binary payload (documents, justificatifs…) from the BoondManager
|
|
155
|
-
* API. Same auth/safety/rate-limit plumbing as `apiRequest`, but the body is
|
|
156
|
-
* returned raw instead of being parsed as JSON:API. Single attempt: document
|
|
157
|
-
* downloads are interactive one-offs, not worth a retry loop.
|
|
158
|
-
*
|
|
159
|
-
* `onProgress` reports bytes received when the client asked for progress and
|
|
160
|
-
* the response carries a `Content-Length`; otherwise nothing is emitted.
|
|
161
|
-
*/
|
|
162
|
-
export declare function apiDownload(path: string, onProgress?: ProgressReporter): Promise<DownloadedDocument>;
|
|
163
|
-
/**
|
|
164
|
-
* POST a multipart/form-data payload to the BoondManager API (document
|
|
165
|
-
* upload). Form values are simple string fields — the file itself travels by
|
|
166
|
-
* reference via the `fileUrl` field (Boond downloads it server-side), so the
|
|
167
|
-
* MCP server never buffers file bytes.
|
|
168
|
-
*/
|
|
169
|
-
export declare function apiUploadForm(path: string, fields: Record<string, string>): Promise<JsonApiResponse>;
|
|
170
|
-
export declare function buildSearchQuery(params: SearchParams): Record<string, QueryValue>;
|
|
171
|
-
/**
|
|
172
|
-
* Search wrapper around `apiRequest` that enforces BoondManager's per-route
|
|
173
|
-
* `maxResults` ceiling (see `ROUTE_MAX_RESULTS`). When the caller requests more
|
|
174
|
-
* results than the route allows, the request is transparently split into
|
|
175
|
-
* chunks of `cap` records and the pages are merged into a single JSON:API
|
|
176
|
-
* response — the caller still receives the full page, but BoondManager never
|
|
177
|
-
* sees `maxResults` above the cap (which overflows memory on `/actions`).
|
|
178
|
-
*
|
|
179
|
-
* Routes whose ceiling already covers the requested page size take the fast
|
|
180
|
-
* path: a single `apiRequest`, byte-for-byte identical to calling it directly.
|
|
181
|
-
* The chunk count is bounded by `ceil((offset + requested) / cap)`, so there is
|
|
182
|
-
* no unbounded loop; the loop also stops early once a page comes back short
|
|
183
|
-
* (end of the result set on the server).
|
|
184
|
-
*
|
|
185
|
-
* `onProgress` (optional, last position — no existing caller had to change) is
|
|
186
|
-
* invoked **only on the chunked path**: one step per BoondManager page. The
|
|
187
|
-
* fast path stays silent on purpose — a single API call has nothing to report
|
|
188
|
-
* and a "1/1" notification would be pure noise. The reporter is a no-op unless
|
|
189
|
-
* the client sent a `progressToken` (see `services/progress.ts`).
|
|
190
|
-
*/
|
|
191
|
-
export declare function apiSearch(path: string, query: Record<string, QueryValue>, onProgress?: ProgressReporter): Promise<JsonApiResponse>;
|
|
192
|
-
export declare function formatEntitySummary(entity: unknown): string;
|
|
193
|
-
export declare function formatListResponse(response: JsonApiResponse, entityType: string, fields?: string[]): string;
|
|
194
|
-
/**
|
|
195
|
-
* Formate la réponse d'un endpoint d'onglet (ex: /resources/{id}/positionings).
|
|
196
|
-
* Contrairement à formatDetailResponse, un tableau est restitué en entier :
|
|
197
|
-
* certains onglets renvoient plusieurs entités (positionnements, contacts...)
|
|
198
|
-
* et n'afficher que la première masquait les autres.
|
|
199
|
-
*/
|
|
200
|
-
export declare function formatTabResponse(response: JsonApiResponse): string;
|
|
201
|
-
/**
|
|
202
|
-
* The canonical shape of a single entity as this server hands it to the model:
|
|
203
|
-
* the JSON:API resource minus the envelope noise (`links`, `meta`).
|
|
204
|
-
*
|
|
205
|
-
* Extracted from `formatDetailResponse` so the entity resource templates
|
|
206
|
-
* (`boond://candidate/{id}`) aggregate the *same* projection instead of
|
|
207
|
-
* defining a second, drifting idea of what an entity looks like. They cannot
|
|
208
|
-
* reuse `formatDetailResponse` itself: it renders one entity and truncates
|
|
209
|
-
* mid-string at `CHARACTER_LIMIT`, which on pretty-printed JSON yields an
|
|
210
|
-
* unparseable body — acceptable for a tool's text content, not for a resource
|
|
211
|
-
* whose whole point is to be read as JSON.
|
|
212
|
-
*/
|
|
213
|
-
export declare function projectEntity(entity: JsonApiResource): Pick<JsonApiResource, "id" | "type" | "attributes" | "relationships">;
|
|
214
|
-
export declare function formatDetailResponse(response: JsonApiResponse): string;
|
|
2
|
+
* BoondManager client — public surface.
|
|
3
|
+
*
|
|
4
|
+
* This module is a barrel: the 38 tool files, the transports and the
|
|
5
|
+
* resources import from here, and the tests mock this path
|
|
6
|
+
* (`vi.mock("../services/boond-client.js", …)`). The implementation lives in
|
|
7
|
+
* one module per responsibility (issue #239):
|
|
8
|
+
*
|
|
9
|
+
* http/auth.ts who the request is sent as (JWT / static / OAuth), config
|
|
10
|
+
* http/errors.ts error envelope parsing, Cloudflare detection, hints, BoondApiError
|
|
11
|
+
* http/retry.ts retry policy: config, retryability, Retry-After, backoff
|
|
12
|
+
* http/rate-limit.ts per-identity token buckets
|
|
13
|
+
* http/transport.ts the single `send()` path + apiRequest / apiUploadForm
|
|
14
|
+
* http/download.ts apiDownload: streaming under a byte cap, progress, guards
|
|
15
|
+
* search.ts buildSearchQuery + apiSearch (per-route chunking)
|
|
16
|
+
* format/*.ts list / detail / tab rendering, summaries, HTML excerpts
|
|
17
|
+
*
|
|
18
|
+
* Add a new export here when a tool needs it; do not add implementation.
|
|
19
|
+
*/
|
|
20
|
+
export { oauthContextAuth, buildJwt, JWT_HEADER_NAME, initClient, hasEnvCredentials, initClientWithAuth, resetClientForTests, } from "./http/auth.js";
|
|
21
|
+
export { parseBoondErrorBody, hintForUnauthorized, BoondApiError, formatApiError } from "./http/errors.js";
|
|
22
|
+
export { type RetryConfig, resolveRetryConfig, isRetryable, parseRetryAfter, computeBackoffMs } from "./http/retry.js";
|
|
23
|
+
export { type RateLimitConfig, resolveRateLimitConfig, MAX_RATE_LIMIT_BUCKETS, getRateLimiter, rateLimiterBucketCountForTests, resetRateLimiterForTests, } from "./http/rate-limit.js";
|
|
24
|
+
export { type QueryValue, type HttpMethod, resolveTimeoutMs, assertSafeApiPath, resolveApiUrl, apiRequest, apiUploadForm, } from "./http/transport.js";
|
|
25
|
+
export { parseContentDispositionFilename, type DownloadedDocument, DownloadTooLargeError, type DownloadOptions, apiDownload, } from "./http/download.js";
|
|
26
|
+
export { buildSearchQuery, apiSearch } from "./search.js";
|
|
27
|
+
export { formatEntitySummary } from "./format/summary.js";
|
|
28
|
+
export { formatListResponse } from "./format/list.js";
|
|
29
|
+
export { projectEntity, formatDetailResponse } from "./format/detail.js";
|
|
30
|
+
export { formatTabResponse } from "./format/tab.js";
|
|
215
31
|
//# sourceMappingURL=boond-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boond-client.d.ts","sourceRoot":"","sources":["../../src/services/boond-client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"boond-client.d.ts","sourceRoot":"","sources":["../../src/services/boond-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EACL,gBAAgB,EAChB,QAAQ,EACR,eAAe,EACf,UAAU,EACV,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC3G,OAAO,EAAE,KAAK,WAAW,EAAE,kBAAkB,EAAE,WAAW,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACvH,OAAO,EACL,KAAK,eAAe,EACpB,sBAAsB,EACtB,sBAAsB,EACtB,cAAc,EACd,8BAA8B,EAC9B,wBAAwB,GACzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,KAAK,UAAU,EACf,KAAK,UAAU,EACf,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,UAAU,EACV,aAAa,GACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,+BAA+B,EAC/B,KAAK,kBAAkB,EACvB,qBAAqB,EACrB,KAAK,eAAe,EACpB,WAAW,GACZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC"}
|