boondmanager-mcp-server 2.16.0 → 2.18.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 +57 -4
- 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/config/transport-kind.d.ts +8 -0
- package/dist/config/transport-kind.d.ts.map +1 -0
- package/dist/config/transport-kind.js +13 -0
- package/dist/config/transport-kind.js.map +1 -0
- package/dist/constants.d.ts +20 -2
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +32 -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 +32 -20
- 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 +1045 -163
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +979 -330
- 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 +23 -0
- package/dist/services/format/summary.d.ts.map +1 -0
- package/dist/services/format/summary.js +194 -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 +85 -0
- package/dist/services/http/transport.d.ts.map +1 -0
- package/dist/services/http/transport.js +283 -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/services/upload-source.d.ts +31 -0
- package/dist/services/upload-source.d.ts.map +1 -0
- package/dist/services/upload-source.js +180 -0
- package/dist/services/upload-source.js.map +1 -0
- 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/candidates.d.ts +7 -0
- package/dist/tools/candidates.d.ts.map +1 -1
- package/dist/tools/candidates.js +96 -1
- package/dist/tools/candidates.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 +45 -17
- 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 +47 -4
- package/dist/tools/description-builders.js.map +1 -1
- package/dist/tools/documents.d.ts.map +1 -1
- package/dist/tools/documents.js +113 -27
- 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/usage-guidance.d.ts.map +1 -1
- package/dist/tools/usage-guidance.js +12 -3
- package/dist/tools/usage-guidance.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 +2 -2
- package/package.json +6 -5
package/dist/tools/payments.js
CHANGED
|
@@ -1,28 +1,32 @@
|
|
|
1
|
-
import { PaymentSearchSchema,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
1
|
+
import { PaymentCreateSchema, PaymentSearchSchema, PaymentUpdateSchema } from "../schemas/index.js";
|
|
2
|
+
import { buildJsonApiBody, registerCreateTool, registerDeleteTool, registerGetTool, registerSearchTool, registerUpdateTool, } from "./crud-factory.js";
|
|
3
|
+
import { composeDescription } from "./description-builders.js";
|
|
4
|
+
const OPTS = { entityName: "paiement", entityNamePlural: "paiements", apiPath: "/payments", prefix: "boond_payments" };
|
|
5
|
+
/** `/payments` payload: convenience names → API attributes, `purchaseId` → the mandatory `purchase` relationship. */
|
|
6
|
+
function paymentAttributes(params) {
|
|
7
|
+
const { paymentDate, amount, reference, note, ...attrs } = params;
|
|
8
|
+
return {
|
|
9
|
+
...attrs,
|
|
10
|
+
...(paymentDate ? { date: paymentDate } : {}),
|
|
11
|
+
...(amount !== undefined && attrs.amountExcludingTax === undefined ? { amountExcludingTax: amount } : {}),
|
|
12
|
+
...(reference ? { number: reference } : {}),
|
|
13
|
+
...(note ? { informationComments: note } : {}),
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export function buildPaymentBody(params) {
|
|
17
|
+
const { purchaseId, ...rest } = params;
|
|
18
|
+
return buildJsonApiBody("payment", paymentAttributes(rest), undefined, {
|
|
19
|
+
purchase: { id: String(purchaseId), type: "purchase" },
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
/** PUT /payments/{id}: attributes only — the purchase attachment is never moved by an update (issue #252). */
|
|
23
|
+
export function buildPaymentUpdateBody(params) {
|
|
24
|
+
const { id, ...rest } = params;
|
|
25
|
+
return buildJsonApiBody("payment", paymentAttributes(rest), String(id));
|
|
26
|
+
}
|
|
23
27
|
export function registerPaymentTools(server) {
|
|
24
|
-
server
|
|
25
|
-
title: "
|
|
28
|
+
registerCreateTool(server, OPTS, PaymentCreateSchema, buildPaymentBody, {
|
|
29
|
+
title: "Créer un paiement",
|
|
26
30
|
description: composeDescription({
|
|
27
31
|
purpose: "Enregistre un paiement / règlement fournisseur adossé à un achat.",
|
|
28
32
|
when: "pour solder tout ou partie d'un achat existant.",
|
|
@@ -31,94 +35,24 @@ export function registerPaymentTools(server) {
|
|
|
31
35
|
"L'API `/payments` **exige** une relation `purchase` : sans ID d'achat valide, l'appel est refusé.",
|
|
32
36
|
"Écriture non idempotente : deux appels identiques enregistrent deux règlements.",
|
|
33
37
|
],
|
|
34
|
-
returns: "confirmation et fiche du paiement cr
|
|
38
|
+
returns: "confirmation et fiche du paiement créé, avec son ID dans `structuredContent.id`.",
|
|
35
39
|
}),
|
|
36
|
-
inputSchema: PaymentCreateSchema,
|
|
37
|
-
annotations: {
|
|
38
|
-
readOnlyHint: false,
|
|
39
|
-
destructiveHint: false,
|
|
40
|
-
idempotentHint: false,
|
|
41
|
-
openWorldHint: false,
|
|
42
|
-
},
|
|
43
|
-
}, async (params) => {
|
|
44
|
-
const { purchaseId, paymentDate, amount, reference, note, ...attrs } = params;
|
|
45
|
-
const apiAttrs = {
|
|
46
|
-
...attrs,
|
|
47
|
-
...(paymentDate ? { date: paymentDate } : {}),
|
|
48
|
-
...(amount !== undefined && attrs.amountExcludingTax === undefined ? { amountExcludingTax: amount } : {}),
|
|
49
|
-
...(reference ? { number: reference } : {}),
|
|
50
|
-
...(note ? { informationComments: note } : {}),
|
|
51
|
-
};
|
|
52
|
-
const body = buildJsonApiBody("payment", apiAttrs);
|
|
53
|
-
body.data.relationships = {
|
|
54
|
-
purchase: { data: { id: purchaseId, type: "purchase" } },
|
|
55
|
-
};
|
|
56
|
-
const response = await apiRequest("/payments", "POST", body);
|
|
57
|
-
const entity = Array.isArray(response.data) ? response.data[0] : response.data;
|
|
58
|
-
return {
|
|
59
|
-
content: [
|
|
60
|
-
{
|
|
61
|
-
type: "text",
|
|
62
|
-
text: `Paiement cree avec succes.\nID: ${entity?.id}\n\n${formatDetailResponse(response)}`,
|
|
63
|
-
},
|
|
64
|
-
],
|
|
65
|
-
};
|
|
66
40
|
});
|
|
67
|
-
server
|
|
68
|
-
|
|
69
|
-
description:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
Returns: Liste des paiements correspondants.`,
|
|
78
|
-
inputSchema: PaymentSearchSchema,
|
|
79
|
-
annotations: {
|
|
80
|
-
readOnlyHint: true,
|
|
81
|
-
destructiveHint: false,
|
|
82
|
-
idempotentHint: true,
|
|
83
|
-
openWorldHint: true,
|
|
84
|
-
},
|
|
85
|
-
}, async (params) => {
|
|
86
|
-
const { purchaseId, companyId, projectId, resourceId, keywords, ...rest } = params;
|
|
87
|
-
const tokens = [];
|
|
88
|
-
if (keywords)
|
|
89
|
-
tokens.push(keywords);
|
|
90
|
-
if (purchaseId)
|
|
91
|
-
tokens.push(`ACH${purchaseId}`);
|
|
92
|
-
if (companyId)
|
|
93
|
-
tokens.push(`CSOC${companyId}`);
|
|
94
|
-
if (projectId)
|
|
95
|
-
tokens.push(`PRJ${projectId}`);
|
|
96
|
-
if (resourceId)
|
|
97
|
-
tokens.push(`COMP${resourceId}`);
|
|
98
|
-
const query = buildSearchQuery(tokens.length > 0 ? { ...rest, keywords: tokens.join(" ") } : rest);
|
|
99
|
-
const response = await apiRequest("/payments", "GET", undefined, query);
|
|
100
|
-
return {
|
|
101
|
-
content: [{ type: "text", text: formatListResponse(response, "paiement", params.fields) }],
|
|
102
|
-
};
|
|
103
|
-
});
|
|
104
|
-
server.registerTool("boond_payments_get", {
|
|
105
|
-
title: "Details d'un paiement",
|
|
106
|
-
description: defaultGetDescription({
|
|
107
|
-
...{ entityName: "paiement", entityNamePlural: "paiements", prefix: "boond_payments" },
|
|
108
|
-
withTab: false,
|
|
41
|
+
registerSearchTool(server, OPTS, {
|
|
42
|
+
schema: PaymentSearchSchema,
|
|
43
|
+
description: composeDescription({
|
|
44
|
+
purpose: "Recherche des paiements / règlements fournisseur dans BoondManager.",
|
|
45
|
+
when: "pour retrouver les règlements adossés à un achat, une société, un projet ou une ressource, ceux d'un état (`paymentStates`), d'une période (`period: \"expected\"` + dates) ou d'un périmètre (`perimeter*`).",
|
|
46
|
+
instead: "`boond_purchases_search` pour les achats eux-mêmes, `boond_provider_invoices_search` pour les factures fournisseur.",
|
|
47
|
+
behaviour: [
|
|
48
|
+
"`purchaseId`, `companyId`, `projectId` et `resourceId` sont convertis en préfixes `keywords` (`ACH<id>`, `CSOC<id>`, `PRJ<id>`, `COMP<id>`) et concaténés aux `keywords` fournis — l'API n'a pas de paramètre dédié. Pas de filtre par facture : `/payments` ne connaît pas de référence `FACT<id>`.",
|
|
49
|
+
],
|
|
50
|
+
returns: "page de résumés des paiements (ID + libellé principal). Lecture seule.",
|
|
109
51
|
}),
|
|
110
|
-
inputSchema: IdSchema,
|
|
111
|
-
annotations: {
|
|
112
|
-
readOnlyHint: true,
|
|
113
|
-
destructiveHint: false,
|
|
114
|
-
idempotentHint: true,
|
|
115
|
-
openWorldHint: false,
|
|
116
|
-
},
|
|
117
|
-
}, async (params) => {
|
|
118
|
-
const response = await apiRequest(`/payments/${params.id}`);
|
|
119
|
-
return {
|
|
120
|
-
content: [{ type: "text", text: formatDetailResponse(response) }],
|
|
121
|
-
};
|
|
122
52
|
});
|
|
53
|
+
registerGetTool(server, OPTS, { withTab: false });
|
|
54
|
+
// Issue #252: regularise a payment (performed date, amount, state).
|
|
55
|
+
registerUpdateTool(server, OPTS, PaymentUpdateSchema, buildPaymentUpdateBody, { method: "PUT" });
|
|
56
|
+
registerDeleteTool(server, OPTS);
|
|
123
57
|
}
|
|
124
58
|
//# sourceMappingURL=payments.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payments.js","sourceRoot":"","sources":["../../src/tools/payments.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,
|
|
1
|
+
{"version":3,"file":"payments.js","sourceRoot":"","sources":["../../src/tools/payments.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACpG,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,IAAI,GAAG,EAAE,UAAU,EAAE,UAAU,EAAE,gBAAgB,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC;AAEvH,qHAAqH;AACrH,SAAS,iBAAiB,CAAC,MAA+B;IACxD,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;IAClE,OAAO;QACL,GAAG,KAAK;QACR,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7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AAiF;aAClF;YACD,OAAO,EAAE,kFAAkF;SAC5F,CAAC;KACH,CAAC,CAAC;IAEH,kBAAkB,CAAC,MAAM,EAAE,IAAI,EAAE;QAC/B,MAAM,EAAE,mBAAmB;QAC3B,WAAW,EAAE,kBAAkB,CAAC;YAC9B,OAAO,EAAE,qEAAqE;YAC9E,IAAI,EAAE,+MAA+M;YACrN,OAAO,EACL,qHAAqH;YACvH,SAAS,EAAE;gBACT,sSAAsS;aACvS;YACD,OAAO,EAAE,wEAAwE;SAClF,CAAC;KACH,CAAC,CAAC;IAEH,eAAe,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;IAElD,oEAAoE;IACpE,kBAAkB,CAAC,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;IACjG,kBAAkB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"positionings.d.ts","sourceRoot":"","sources":["../../src/tools/positionings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"positionings.d.ts","sourceRoot":"","sources":["../../src/tools/positionings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAYzE,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAqKhE"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { toKeywordReferences } from "./linked-entity-filters.js";
|
|
1
2
|
import { PositioningSearchSchema, PositioningCreateSchema, PositioningUpdateSchema, IdSchema, } from "../schemas/index.js";
|
|
2
3
|
import { apiRequest, buildSearchQuery, formatListResponse, formatDetailResponse } from "../services/boond-client.js";
|
|
3
4
|
import { buildJsonApiBody, registerDeleteTool, MutationOutputSchema } from "./crud-factory.js";
|
|
@@ -8,12 +9,7 @@ export function registerPositioningTools(server) {
|
|
|
8
9
|
title: "Rechercher des positionnements",
|
|
9
10
|
description: `Recherche des positionnements (placement de candidats/ressources sur des projets/opportunités) dans BoondManager.
|
|
10
11
|
|
|
11
|
-
L'API ne propose pas de paramètres de filtre dédiés : le filtrage par entité liée passe par des références dans \`keywords\` (AO<id>=opportunité, CAND<id>=candidat, COMP<id>=ressource, CSOC<id>=société, CCON<id>=contact, PROD<id>=produit). Les filtres *Id
|
|
12
|
-
|
|
13
|
-
Args:
|
|
14
|
-
- keywords (string, optional): Termes de recherche (références d'entités acceptées)
|
|
15
|
-
- candidateId, resourceId, opportunityId, companyId, contactId, productId (string, optional): Filtrer par entité liée (convertis en références keywords)
|
|
16
|
-
- page, pageSize: Pagination
|
|
12
|
+
L'API ne propose pas de paramètres de filtre dédiés : le filtrage par entité liée passe par des références dans \`keywords\` (AO<id>=opportunité, CAND<id>=candidat, COMP<id>=ressource, CSOC<id>=société, CCON<id>=contact, PROD<id>=produit). Les filtres *Id du schéma sont convertis automatiquement en ces références.
|
|
17
13
|
|
|
18
14
|
Returns: Liste des positionnements correspondants.`,
|
|
19
15
|
inputSchema: PositioningSearchSchema,
|
|
@@ -27,23 +23,7 @@ Returns: Liste des positionnements correspondants.`,
|
|
|
27
23
|
// L'API GET /positionings n'a pas de paramètres candidateId/resourceId/... :
|
|
28
24
|
// le filtrage par entité passe par des références dans `keywords`
|
|
29
25
|
// (cf. RAML officiel). Les paramètres bruts seraient silencieusement ignorés.
|
|
30
|
-
const
|
|
31
|
-
const tokens = [];
|
|
32
|
-
if (keywords)
|
|
33
|
-
tokens.push(keywords);
|
|
34
|
-
if (opportunityId)
|
|
35
|
-
tokens.push(`AO${opportunityId}`);
|
|
36
|
-
if (candidateId)
|
|
37
|
-
tokens.push(`CAND${candidateId}`);
|
|
38
|
-
if (resourceId)
|
|
39
|
-
tokens.push(`COMP${resourceId}`);
|
|
40
|
-
if (companyId)
|
|
41
|
-
tokens.push(`CSOC${companyId}`);
|
|
42
|
-
if (contactId)
|
|
43
|
-
tokens.push(`CCON${contactId}`);
|
|
44
|
-
if (productId)
|
|
45
|
-
tokens.push(`PROD${productId}`);
|
|
46
|
-
const query = buildSearchQuery(tokens.length > 0 ? { ...rest, keywords: tokens.join(" ") } : rest);
|
|
26
|
+
const query = buildSearchQuery(toKeywordReferences(params));
|
|
47
27
|
const response = await apiRequest("/positionings", "GET", undefined, query);
|
|
48
28
|
return {
|
|
49
29
|
content: [{ type: "text", text: formatListResponse(response, "positionnement", params.fields) }],
|
|
@@ -91,19 +71,16 @@ Returns: Liste des positionnements correspondants.`,
|
|
|
91
71
|
},
|
|
92
72
|
}, async (params) => {
|
|
93
73
|
const { candidateId, resourceId, projectId, opportunityId, ...attrs } = params;
|
|
94
|
-
const body = buildJsonApiBody("positioning", attrs);
|
|
95
74
|
const relationships = {};
|
|
96
75
|
if (candidateId)
|
|
97
|
-
relationships.dependsOn = {
|
|
76
|
+
relationships.dependsOn = { id: candidateId, type: "candidate" };
|
|
98
77
|
if (resourceId)
|
|
99
|
-
relationships.dependsOn = {
|
|
78
|
+
relationships.dependsOn = { id: resourceId, type: "resource" };
|
|
100
79
|
if (projectId)
|
|
101
|
-
relationships.project = {
|
|
80
|
+
relationships.project = { id: projectId, type: "project" };
|
|
102
81
|
if (opportunityId)
|
|
103
|
-
relationships.opportunity = {
|
|
104
|
-
|
|
105
|
-
body.data.relationships = relationships;
|
|
106
|
-
}
|
|
82
|
+
relationships.opportunity = { id: opportunityId, type: "opportunity" };
|
|
83
|
+
const body = buildJsonApiBody("positioning", attrs, undefined, relationships);
|
|
107
84
|
const response = await apiRequest("/positionings", "POST", body);
|
|
108
85
|
const entity = Array.isArray(response.data) ? response.data[0] : response.data;
|
|
109
86
|
return {
|
|
@@ -121,14 +98,7 @@ Returns: Liste des positionnements correspondants.`,
|
|
|
121
98
|
// MutationOutputSchema, structuredContent) reproduit celui de la factory.
|
|
122
99
|
server.registerTool("boond_positionings_update", {
|
|
123
100
|
title: "Modifier un positionnement",
|
|
124
|
-
description: `Met à jour un positionnement existant dans BoondManager (PUT /positionings/{id}). Seuls les champs fournis sont modifiés
|
|
125
|
-
|
|
126
|
-
Args:
|
|
127
|
-
- id (string): ID du positionnement
|
|
128
|
-
- state (number, optional): État du positionnement (ID du dictionnaire setting.state.positioning)
|
|
129
|
-
- stateReasonTypeOf, stateReasonDetail (optional): Motif d'état (repliés en stateReason {typeOf, detail})
|
|
130
|
-
- startDate, endDate (string, optional): Dates au format YYYY-MM-DD (chaîne vide pour effacer)
|
|
131
|
-
- informationComments (string, optional): Commentaires (max 250 caractères)
|
|
101
|
+
description: `Met à jour un positionnement existant dans BoondManager (PUT /positionings/{id}). Seuls les champs fournis sont modifiés ; \`stateReasonTypeOf\` / \`stateReasonDetail\` sont repliés en \`stateReason: { typeOf, detail }\`.
|
|
132
102
|
|
|
133
103
|
Returns: Données mises à jour du positionnement.`,
|
|
134
104
|
inputSchema: PositioningUpdateSchema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"positionings.js","sourceRoot":"","sources":["../../src/tools/positionings.ts"],"names":[],"mappings":"AACA,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,QAAQ,GACT,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACrH,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC/F,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEhH,MAAM,UAAU,wBAAwB,CAAC,MAAiB;IACxD,sBAAsB;IACtB,MAAM,CAAC,YAAY,CACjB,2BAA2B,EAC3B;QACE,KAAK,EAAE,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AAC,CAAC;QAC/D,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,qBAAqB,EAAE,mBAAmB,oBAAoB,CAAC,QAAQ,CAAC,EAAE;iBACjF;aACF;YACD,iBAAiB,EAAE,GAAG;SACvB,CAAC;IACJ,CAAC,CACF,CAAC;IAEF,6FAA6F;IAC7F,kBAAkB,CAChB,MAAM,EACN;QACE,UAAU,EAAE,gBAAgB;QAC5B,gBAAgB,EAAE,iBAAiB;QACnC,OAAO,EAAE,eAAe;QACxB,MAAM,EAAE,oBAAoB;KAC7B,EACD;QACE,KAAK,EAAE,6BAA6B;QACpC,WAAW,EAAE,wBAAwB,CAAC;YACpC,UAAU,EAAE,gBAAgB;YAC5B,gBAAgB,EAAE,iBAAiB;YACnC,MAAM,EAAE,oBAAoB;SAC7B,CAAC;KACH,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/tools/projects.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AA4FzE,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/tools/projects.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AA4FzE,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAmC5D"}
|
package/dist/tools/projects.js
CHANGED
|
@@ -85,18 +85,11 @@ export function registerProjectTools(server) {
|
|
|
85
85
|
registerCreateTool(server, OPTS, ProjectCreateSchema, (params) => {
|
|
86
86
|
const { companyId, contactId, opportunityId, name, ...attrs } = params;
|
|
87
87
|
const apiAttrs = { ...attrs, ...(name ? { title: name } : {}) };
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
relationships.contact = { data: { id: contactId, type: "contact" } };
|
|
94
|
-
if (opportunityId)
|
|
95
|
-
relationships.opportunity = { data: { id: opportunityId, type: "opportunity" } };
|
|
96
|
-
if (Object.keys(relationships).length > 0) {
|
|
97
|
-
body.data.relationships = relationships;
|
|
98
|
-
}
|
|
99
|
-
return body;
|
|
88
|
+
return buildJsonApiBody("project", apiAttrs, undefined, {
|
|
89
|
+
company: typeof companyId === "string" ? { id: companyId, type: "company" } : undefined,
|
|
90
|
+
contact: typeof contactId === "string" ? { id: contactId, type: "contact" } : undefined,
|
|
91
|
+
opportunity: typeof opportunityId === "string" ? { id: opportunityId, type: "opportunity" } : undefined,
|
|
92
|
+
});
|
|
100
93
|
});
|
|
101
94
|
// Updates go through PUT /projects/{id}/information — the base resource
|
|
102
95
|
// returns 405 on PATCH (issue #134, same root cause as #124). buildJsonApiBody
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projects.js","sourceRoot":"","sources":["../../src/tools/projects.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACpG,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGlD,MAAM,IAAI,GAAG;IACX,UAAU,EAAE,QAAQ;IACpB,gBAAgB,EAAE,SAAS;IAC3B,OAAO,EAAE,WAAW;IACpB,MAAM,EAAE,gBAAgB;CACzB,CAAC;AAEF,MAAM,YAAY,GAAoB;IACpC;QACE,IAAI,EAAE,aAAa;QACnB,GAAG,EAAE,aAAa;QAClB,KAAK,EAAE,oCAAoC;QAC3C,OAAO,EAAE,4BAA4B;QACrC,OAAO,EAAE,+CAA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MAAM,EAAE,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,YAAY,CAAC,CAAC;AAC3E,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
/** `/provider-invoices` payload: `resource` is mandatory, `providerCompany` / `providerContact` optional. */
|
|
3
|
+
export declare function buildProviderInvoiceBody(params: Record<string, unknown>): unknown;
|
|
2
4
|
export declare function registerProviderInvoiceTools(server: McpServer): void;
|
|
3
5
|
//# sourceMappingURL=provider-invoices.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-invoices.d.ts","sourceRoot":"","sources":["../../src/tools/provider-invoices.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"provider-invoices.d.ts","sourceRoot":"","sources":["../../src/tools/provider-invoices.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAuBzE,6GAA6G;AAC7G,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAOjF;AAED,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAyCpE"}
|
|
@@ -1,40 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
reference: z.string().min(1).describe("Reference de la facture fournisseur"),
|
|
20
|
-
resourceId: z.string().min(1).describe("ID de la ressource portee par la facture fournisseur"),
|
|
21
|
-
companyId: z.string().optional().describe("ID de la societe fournisseur, mappe vers providerCompany"),
|
|
22
|
-
contactId: z.string().optional().describe("ID du contact fournisseur, mappe vers providerContact"),
|
|
23
|
-
invoiceDate: z.string().optional().describe("Date de facture (YYYY-MM-DD)"),
|
|
24
|
-
startDate: z.string().min(1).describe("Date de debut de periode (YYYY-MM-DD)"),
|
|
25
|
-
endDate: z.string().min(1).describe("Date de fin de periode (YYYY-MM-DD)"),
|
|
26
|
-
amountExcludingTax: z.number().optional().describe("Montant HT"),
|
|
27
|
-
amountIncludingTax: z.number().optional().describe("Montant TTC"),
|
|
28
|
-
currency: z.number().optional().describe("Devise Boond"),
|
|
29
|
-
exchangeRate: z.number().optional().describe("Taux de change"),
|
|
30
|
-
currencyAgency: z.number().optional().describe("Devise agence"),
|
|
31
|
-
exchangeRateAgency: z.number().optional().describe("Taux de change agence"),
|
|
32
|
-
state: z.number().int().optional().describe("Etat de la facture fournisseur"),
|
|
33
|
-
})
|
|
34
|
-
.strict();
|
|
1
|
+
import { ProviderInvoiceCreateSchema, ProviderInvoiceSearchSchema, ProviderInvoiceUpdateSchema, } from "../schemas/index.js";
|
|
2
|
+
import { buildJsonApiBody, registerCreateTool, registerDeleteTool, registerGetTool, registerSearchTool, registerUpdateTool, } from "./crud-factory.js";
|
|
3
|
+
import { composeDescription } from "./description-builders.js";
|
|
4
|
+
const OPTS = {
|
|
5
|
+
entityName: "facture fournisseur",
|
|
6
|
+
entityNamePlural: "factures fournisseur",
|
|
7
|
+
apiPath: "/provider-invoices",
|
|
8
|
+
prefix: "boond_provider_invoices",
|
|
9
|
+
};
|
|
10
|
+
/** `/provider-invoices` payload: `resource` is mandatory, `providerCompany` / `providerContact` optional. */
|
|
11
|
+
export function buildProviderInvoiceBody(params) {
|
|
12
|
+
const { companyId, contactId, resourceId, ...attrs } = params;
|
|
13
|
+
return buildJsonApiBody("providerinvoice", attrs, undefined, {
|
|
14
|
+
resource: { id: String(resourceId), type: "resource" },
|
|
15
|
+
providerCompany: companyId ? { id: String(companyId), type: "company" } : undefined,
|
|
16
|
+
providerContact: contactId ? { id: String(contactId), type: "contact" } : undefined,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
35
19
|
export function registerProviderInvoiceTools(server) {
|
|
36
|
-
server
|
|
37
|
-
title: "
|
|
20
|
+
registerCreateTool(server, OPTS, ProviderInvoiceCreateSchema, buildProviderInvoiceBody, {
|
|
21
|
+
title: "Créer une facture fournisseur",
|
|
38
22
|
description: composeDescription({
|
|
39
23
|
purpose: "Crée une facture fournisseur (facture reçue d'un prestataire).",
|
|
40
24
|
when: "pour enregistrer la facture émise par un sous-traitant.",
|
|
@@ -43,89 +27,24 @@ export function registerProviderInvoiceTools(server) {
|
|
|
43
27
|
"`resource`, `providerCompany` et `providerContact` sont attendus sous forme d'ID numériques.",
|
|
44
28
|
"Écriture non idempotente.",
|
|
45
29
|
],
|
|
46
|
-
returns: "confirmation et fiche de la facture fournisseur créée.",
|
|
30
|
+
returns: "confirmation et fiche de la facture fournisseur créée, avec son ID dans `structuredContent.id`.",
|
|
47
31
|
}),
|
|
48
|
-
inputSchema: ProviderInvoiceCreateSchema,
|
|
49
|
-
annotations: {
|
|
50
|
-
readOnlyHint: false,
|
|
51
|
-
destructiveHint: false,
|
|
52
|
-
idempotentHint: false,
|
|
53
|
-
openWorldHint: false,
|
|
54
|
-
},
|
|
55
|
-
}, async (params) => {
|
|
56
|
-
const { companyId, contactId, resourceId, ...attrs } = params;
|
|
57
|
-
const body = buildJsonApiBody("providerinvoice", attrs);
|
|
58
|
-
const relationships = {
|
|
59
|
-
resource: { data: { id: resourceId, type: "resource" } },
|
|
60
|
-
};
|
|
61
|
-
if (companyId)
|
|
62
|
-
relationships.providerCompany = { data: { id: companyId, type: "company" } };
|
|
63
|
-
if (contactId)
|
|
64
|
-
relationships.providerContact = { data: { id: contactId, type: "contact" } };
|
|
65
|
-
body.data.relationships = relationships;
|
|
66
|
-
const response = await apiRequest("/provider-invoices", "POST", body);
|
|
67
|
-
const entity = Array.isArray(response.data) ? response.data[0] : response.data;
|
|
68
|
-
return {
|
|
69
|
-
content: [
|
|
70
|
-
{
|
|
71
|
-
type: "text",
|
|
72
|
-
text: `Facture fournisseur creee avec succes.\nID: ${entity?.id}\n\n${formatDetailResponse(response)}`,
|
|
73
|
-
},
|
|
74
|
-
],
|
|
75
|
-
};
|
|
76
32
|
});
|
|
77
|
-
server
|
|
78
|
-
|
|
33
|
+
registerSearchTool(server, OPTS, {
|
|
34
|
+
schema: ProviderInvoiceSearchSchema,
|
|
79
35
|
description: composeDescription({
|
|
80
36
|
purpose: "Liste et recherche les factures fournisseur (factures reçues des prestataires).",
|
|
81
37
|
when: "pour suivre les factures d'achat, par fournisseur, état ou période.",
|
|
82
38
|
instead: "`boond_invoices_search` pour les factures de vente adressées aux clients — sens opposé, endpoint distinct.",
|
|
83
39
|
returns: "page de résumés de factures fournisseur (référence, date, montants). Lecture seule.",
|
|
84
40
|
}),
|
|
85
|
-
inputSchema: ProviderInvoiceSearchSchema,
|
|
86
|
-
annotations: {
|
|
87
|
-
readOnlyHint: true,
|
|
88
|
-
destructiveHint: false,
|
|
89
|
-
idempotentHint: true,
|
|
90
|
-
openWorldHint: true,
|
|
91
|
-
},
|
|
92
|
-
}, async (params) => {
|
|
93
|
-
const { resourceId, companyId, keywords, ...rest } = params;
|
|
94
|
-
const tokens = [];
|
|
95
|
-
if (keywords)
|
|
96
|
-
tokens.push(keywords);
|
|
97
|
-
if (resourceId)
|
|
98
|
-
tokens.push(`COMP${resourceId}`);
|
|
99
|
-
if (companyId)
|
|
100
|
-
tokens.push(`CSOC${companyId}`);
|
|
101
|
-
const query = buildSearchQuery(tokens.length > 0 ? { ...rest, keywords: tokens.join(" ") } : rest);
|
|
102
|
-
const response = await apiRequest("/provider-invoices", "GET", undefined, query);
|
|
103
|
-
return {
|
|
104
|
-
content: [{ type: "text", text: formatListResponse(response, "facture fournisseur", params.fields) }],
|
|
105
|
-
};
|
|
106
|
-
});
|
|
107
|
-
server.registerTool("boond_provider_invoices_get", {
|
|
108
|
-
title: "Details d'une facture fournisseur",
|
|
109
|
-
description: defaultGetDescription({
|
|
110
|
-
...{
|
|
111
|
-
entityName: "facture fournisseur",
|
|
112
|
-
entityNamePlural: "factures fournisseur",
|
|
113
|
-
prefix: "boond_provider_invoices",
|
|
114
|
-
},
|
|
115
|
-
withTab: false,
|
|
116
|
-
}),
|
|
117
|
-
inputSchema: IdSchema,
|
|
118
|
-
annotations: {
|
|
119
|
-
readOnlyHint: true,
|
|
120
|
-
destructiveHint: false,
|
|
121
|
-
idempotentHint: true,
|
|
122
|
-
openWorldHint: false,
|
|
123
|
-
},
|
|
124
|
-
}, async (params) => {
|
|
125
|
-
const response = await apiRequest(`/provider-invoices/${params.id}`);
|
|
126
|
-
return {
|
|
127
|
-
content: [{ type: "text", text: formatDetailResponse(response) }],
|
|
128
|
-
};
|
|
129
41
|
});
|
|
42
|
+
registerGetTool(server, OPTS, { withTab: false, title: "Détails d'une facture fournisseur" });
|
|
43
|
+
// Issue #252: mark a provider invoice paid (paidDate / state), fix a period or an amount.
|
|
44
|
+
registerUpdateTool(server, OPTS, ProviderInvoiceUpdateSchema, (params) => {
|
|
45
|
+
const { id, ...attrs } = params;
|
|
46
|
+
return buildJsonApiBody("providerinvoice", attrs, String(id));
|
|
47
|
+
}, { method: "PUT", title: "Modifier une facture fournisseur" });
|
|
48
|
+
registerDeleteTool(server, OPTS, { title: "Supprimer une facture fournisseur" });
|
|
130
49
|
}
|
|
131
50
|
//# sourceMappingURL=provider-invoices.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-invoices.js","sourceRoot":"","sources":["../../src/tools/provider-invoices.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"provider-invoices.js","sourceRoot":"","sources":["../../src/tools/provider-invoices.ts"],"names":[],"mappings":"AACA,OAAO,EACL,2BAA2B,EAC3B,2BA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YACvH,SAAS,EAAE;gBACT,8FAA8F;gBAC9F,2BAA2B;aAC5B;YACD,OAAO,EAAE,iGAAiG;SAC3G,CAAC;KACH,CAAC,CAAC;IAEH,kBAAkB,CAAC,MAAM,EAAE,IAAI,EAAE;QAC/B,MAAM,EAAE,2BAA2B;QACnC,WAAW,EAAE,kBAAkB,CAAC;YAC9B,OAAO,EAAE,iFAAiF;YAC1F,IAAI,EAAE,qEAAqE;YAC3E,OAAO,EACL,4GAA4G;YAC9G,OAAO,EAAE,qFAAqF;SAC/F,CAAC;KACH,CAAC,CAAC;IAEH,eAAe,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,mCAAmC,EAAE,CAAC,CAAC;IAE9F,0FAA0F;IAC1F,kBAAkB,CAChB,MAAM,EACN,IAAI,EACJ,2BAA2B,EAC3B,CAAC,MAAM,EAAE,EAAE;QACT,MAAM,EAAE,EAAE,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QAChC,OAAO,gBAAgB,CAAC,iBAAiB,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;IAChE,CAAC,EACD,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,kCAAkC,EAAE,CAC7D,CAAC;IACF,kBAAkB,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,mCAAmC,EAAE,CAAC,CAAC;AACnF,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
/** `/purchases` payload: the three optional ids become relationships; `id` (update) lands on `data.id`. */
|
|
3
|
+
export declare function buildPurchaseBody(params: Record<string, unknown>): unknown;
|
|
2
4
|
export declare function registerPurchaseTools(server: McpServer): void;
|
|
3
5
|
//# sourceMappingURL=purchases.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"purchases.d.ts","sourceRoot":"","sources":["../../src/tools/purchases.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"purchases.d.ts","sourceRoot":"","sources":["../../src/tools/purchases.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AA8BzE,2GAA2G;AAC3G,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAY1E;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAmD7D"}
|