@raytio/mcp-server 10.2.0 → 10.4.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 +2 -0
- package/contracts/persist/mcp_resource_contract.json +4 -4
- package/dist/authorization.d.ts.map +1 -1
- package/dist/authorization.js +4 -0
- package/dist/authorization.js.map +1 -1
- package/dist/generated-reads/guardrails.js +1 -1
- package/dist/generated-reads/guardrails.js.map +1 -1
- package/dist/generated-reads/resource-tools.d.ts.map +1 -1
- package/dist/generated-reads/resource-tools.js +8 -5
- package/dist/generated-reads/resource-tools.js.map +1 -1
- package/dist/tools/_shared/date-range.d.ts +16 -0
- package/dist/tools/_shared/date-range.d.ts.map +1 -0
- package/dist/tools/_shared/date-range.js +28 -0
- package/dist/tools/_shared/date-range.js.map +1 -0
- package/dist/tools/_shared/side-effect.d.ts.map +1 -1
- package/dist/tools/_shared/side-effect.js +3 -1
- package/dist/tools/_shared/side-effect.js.map +1 -1
- package/dist/tools/_shared/soft-deactivate.d.ts +2 -0
- package/dist/tools/_shared/soft-deactivate.d.ts.map +1 -1
- package/dist/tools/_shared/soft-deactivate.js +3 -0
- package/dist/tools/_shared/soft-deactivate.js.map +1 -1
- package/dist/tools/domains.d.ts.map +1 -1
- package/dist/tools/domains.js +39 -1
- package/dist/tools/domains.js.map +1 -1
- package/dist/tools/gpm/generated-reads.d.ts +5 -0
- package/dist/tools/gpm/generated-reads.d.ts.map +1 -0
- package/dist/tools/gpm/generated-reads.js +28 -0
- package/dist/tools/gpm/generated-reads.js.map +1 -0
- package/dist/tools/gpm/gpm-item-deactivate.d.ts +11 -0
- package/dist/tools/gpm/gpm-item-deactivate.d.ts.map +1 -0
- package/dist/tools/gpm/gpm-item-deactivate.js +45 -0
- package/dist/tools/gpm/gpm-item-deactivate.js.map +1 -0
- package/dist/tools/gpm/gpm-item-register.d.ts +21 -0
- package/dist/tools/gpm/gpm-item-register.d.ts.map +1 -0
- package/dist/tools/gpm/gpm-item-register.js +149 -0
- package/dist/tools/gpm/gpm-item-register.js.map +1 -0
- package/dist/tools/gpm/index.d.ts +5 -0
- package/dist/tools/gpm/index.d.ts.map +1 -0
- package/dist/tools/gpm/index.js +10 -0
- package/dist/tools/gpm/index.js.map +1 -0
- package/dist/tools/imports/index.d.ts +16 -93
- package/dist/tools/imports/index.d.ts.map +1 -1
- package/dist/tools/imports/index.js +11 -3
- package/dist/tools/imports/index.js.map +1 -1
- package/dist/tools/pbm/generated-reads.d.ts +5 -0
- package/dist/tools/pbm/generated-reads.d.ts.map +1 -0
- package/dist/tools/pbm/generated-reads.js +32 -0
- package/dist/tools/pbm/generated-reads.js.map +1 -0
- package/dist/tools/pbm/index.d.ts +5 -0
- package/dist/tools/pbm/index.d.ts.map +1 -0
- package/dist/tools/pbm/index.js +17 -0
- package/dist/tools/pbm/index.js.map +1 -0
- package/dist/tools/pbm/pbm-customer-entitlement-override-set.d.ts +26 -0
- package/dist/tools/pbm/pbm-customer-entitlement-override-set.d.ts.map +1 -0
- package/dist/tools/pbm/pbm-customer-entitlement-override-set.js +78 -0
- package/dist/tools/pbm/pbm-customer-entitlement-override-set.js.map +1 -0
- package/dist/tools/pbm/pbm-subscription-cancel.d.ts +21 -0
- package/dist/tools/pbm/pbm-subscription-cancel.d.ts.map +1 -0
- package/dist/tools/pbm/pbm-subscription-cancel.js +86 -0
- package/dist/tools/pbm/pbm-subscription-cancel.js.map +1 -0
- package/dist/tools/pbm/pbm-subscription-create.d.ts +20 -0
- package/dist/tools/pbm/pbm-subscription-create.d.ts.map +1 -0
- package/dist/tools/pbm/pbm-subscription-create.js +90 -0
- package/dist/tools/pbm/pbm-subscription-create.js.map +1 -0
- package/dist/tools/pbm/pbm-subscription-line-add.d.ts +13 -0
- package/dist/tools/pbm/pbm-subscription-line-add.d.ts.map +1 -0
- package/dist/tools/pbm/pbm-subscription-line-add.js +65 -0
- package/dist/tools/pbm/pbm-subscription-line-add.js.map +1 -0
- package/dist/tools/pbm/pbm-subscription-line-end.d.ts +12 -0
- package/dist/tools/pbm/pbm-subscription-line-end.d.ts.map +1 -0
- package/dist/tools/pbm/pbm-subscription-line-end.js +49 -0
- package/dist/tools/pbm/pbm-subscription-line-end.js.map +1 -0
- package/dist/tools/pcm/generated-reads.d.ts +5 -0
- package/dist/tools/pcm/generated-reads.d.ts.map +1 -0
- package/dist/tools/pcm/generated-reads.js +26 -0
- package/dist/tools/pcm/generated-reads.js.map +1 -0
- package/dist/tools/pcm/index.d.ts +5 -0
- package/dist/tools/pcm/index.d.ts.map +1 -0
- package/dist/tools/pcm/index.js +16 -0
- package/dist/tools/pcm/index.js.map +1 -0
- package/dist/tools/pcm/pcm-price-list-deactivate.d.ts +11 -0
- package/dist/tools/pcm/pcm-price-list-deactivate.d.ts.map +1 -0
- package/dist/tools/pcm/pcm-price-list-deactivate.js +46 -0
- package/dist/tools/pcm/pcm-price-list-deactivate.js.map +1 -0
- package/dist/tools/pcm/pcm-price-list-register.d.ts +21 -0
- package/dist/tools/pcm/pcm-price-list-register.d.ts.map +1 -0
- package/dist/tools/pcm/pcm-price-list-register.js +96 -0
- package/dist/tools/pcm/pcm-price-list-register.js.map +1 -0
- package/dist/tools/pcm/pcm-price-list-version-create.d.ts +19 -0
- package/dist/tools/pcm/pcm-price-list-version-create.d.ts.map +1 -0
- package/dist/tools/pcm/pcm-price-list-version-create.js +85 -0
- package/dist/tools/pcm/pcm-price-list-version-create.js.map +1 -0
- package/dist/tools/qom/generated-reads.d.ts +5 -0
- package/dist/tools/qom/generated-reads.d.ts.map +1 -0
- package/dist/tools/qom/generated-reads.js +22 -0
- package/dist/tools/qom/generated-reads.js.map +1 -0
- package/dist/tools/qom/index.d.ts +5 -0
- package/dist/tools/qom/index.d.ts.map +1 -0
- package/dist/tools/qom/index.js +23 -0
- package/dist/tools/qom/index.js.map +1 -0
- package/dist/tools/qom/qom-order-cancel.d.ts +16 -0
- package/dist/tools/qom/qom-order-cancel.d.ts.map +1 -0
- package/dist/tools/qom/qom-order-cancel.js +56 -0
- package/dist/tools/qom/qom-order-cancel.js.map +1 -0
- package/dist/tools/qom/qom-order-create.d.ts +24 -0
- package/dist/tools/qom/qom-order-create.d.ts.map +1 -0
- package/dist/tools/qom/qom-order-create.js +133 -0
- package/dist/tools/qom/qom-order-create.js.map +1 -0
- package/dist/tools/qom/qom-order-hold-place.d.ts +11 -0
- package/dist/tools/qom/qom-order-hold-place.d.ts.map +1 -0
- package/dist/tools/qom/qom-order-hold-place.js +50 -0
- package/dist/tools/qom/qom-order-hold-place.js.map +1 -0
- package/dist/tools/qom/qom-order-hold-release.d.ts +8 -0
- package/dist/tools/qom/qom-order-hold-release.d.ts.map +1 -0
- package/dist/tools/qom/qom-order-hold-release.js +42 -0
- package/dist/tools/qom/qom-order-hold-release.js.map +1 -0
- package/dist/tools/qom/qom-order-line-add.d.ts +18 -0
- package/dist/tools/qom/qom-order-line-add.d.ts.map +1 -0
- package/dist/tools/qom/qom-order-line-add.js +101 -0
- package/dist/tools/qom/qom-order-line-add.js.map +1 -0
- package/dist/tools/qom/qom-quote-create.d.ts +20 -0
- package/dist/tools/qom/qom-quote-create.d.ts.map +1 -0
- package/dist/tools/qom/qom-quote-create.js +142 -0
- package/dist/tools/qom/qom-quote-create.js.map +1 -0
- package/dist/tools/qom/qom-quote-line-add.d.ts +13 -0
- package/dist/tools/qom/qom-quote-line-add.d.ts.map +1 -0
- package/dist/tools/qom/qom-quote-line-add.js +92 -0
- package/dist/tools/qom/qom-quote-line-add.js.map +1 -0
- package/dist/tools/qom/qom-quote-version-create.d.ts +10 -0
- package/dist/tools/qom/qom-quote-version-create.d.ts.map +1 -0
- package/dist/tools/qom/qom-quote-version-create.js +69 -0
- package/dist/tools/qom/qom-quote-version-create.js.map +1 -0
- package/dist/tools/role-mapping.d.ts.map +1 -1
- package/dist/tools/role-mapping.js +15 -8
- package/dist/tools/role-mapping.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pbm-customer-entitlement-override-set.js","sourceRoot":"","sources":["../../../src/tools/pbm/pbm-customer-entitlement-override-set.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,GAAG,EAAE,MAAM,uCAAuC,CAAC;AAC5D,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,8BAA8B,EAC9B,2BAA2B,GAC5B,MAAM,2BAA2B,CAAC;AAEnC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAS;IACzD,IAAI,EAAE,uCAAuC;IAC7C,WAAW,EACT,qFAAqF;QACrF,+EAA+E;QAC/E,sFAAsF;QACtF,iFAAiF;IACnF,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,WAAW,EAAE,CAAC;aACX,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CAAC,mEAAmE,CAAC;QAChF,UAAU,EAAE,CAAC;aACV,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CAAC,0DAA0D,CAAC;QACvE,KAAK,EAAE,CAAC;aACL,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;aACnB,QAAQ,CACP,kFAAkF,CACnF;QACH,MAAM,EAAE,YAAY,CAAC,QAAQ,CAC3B,kEAAkE,CACnE;QACD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;QAC5E,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;QACxE,QAAQ,EAAE,CAAC,CAAC,MAAM,CA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
|
+
import { Tool } from '../registry.js';
|
|
2
|
+
/**
|
|
3
|
+
* Cancellation semantic tool for a PBM billing subscription.
|
|
4
|
+
*
|
|
5
|
+
* Writes the cancellation columns through the
|
|
6
|
+
* `pbm_billing_subscriptions_u` update view. Persist's
|
|
7
|
+
* `call_generate_billing_invoices_cancellation_update` trigger then
|
|
8
|
+
* schedules the final invoice job, but only for an active BILLABLE
|
|
9
|
+
* subscription: on any other status the columns would be stored and
|
|
10
|
+
* nothing would happen. The tool reads the row first and refuses those.
|
|
11
|
+
*
|
|
12
|
+
* It also returns a subscription that already has a cancellation date
|
|
13
|
+
* unchanged. Persist resets `cancellation_request_date` to now on every
|
|
14
|
+
* update of such a row, and a changed reason or action could schedule
|
|
15
|
+
* another job, so a retry must not write.
|
|
16
|
+
*
|
|
17
|
+
* `cancellation_request_date` is not an input because that trigger
|
|
18
|
+
* overwrites whatever is supplied.
|
|
19
|
+
*/
|
|
20
|
+
export declare const pbmSubscriptionCancelTool: Tool;
|
|
21
|
+
//# sourceMappingURL=pbm-subscription-cancel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pbm-subscription-cancel.d.ts","sourceRoot":"","sources":["../../../src/tools/pbm/pbm-subscription-cancel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAUtC;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,yBAAyB,EAAE,IAmFvC,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { API_ERROR, errorResponse, successResponse } from '../types.js';
|
|
3
|
+
import { cap } from '../../capabilities/tool-capability.js';
|
|
4
|
+
import { confirmFlagSchema, reasonSchema, unenforcedIdempotencyKeySchema, writeHeadersWithIdempotency, } from '../_shared/side-effect.js';
|
|
5
|
+
/**
|
|
6
|
+
* Cancellation semantic tool for a PBM billing subscription.
|
|
7
|
+
*
|
|
8
|
+
* Writes the cancellation columns through the
|
|
9
|
+
* `pbm_billing_subscriptions_u` update view. Persist's
|
|
10
|
+
* `call_generate_billing_invoices_cancellation_update` trigger then
|
|
11
|
+
* schedules the final invoice job, but only for an active BILLABLE
|
|
12
|
+
* subscription: on any other status the columns would be stored and
|
|
13
|
+
* nothing would happen. The tool reads the row first and refuses those.
|
|
14
|
+
*
|
|
15
|
+
* It also returns a subscription that already has a cancellation date
|
|
16
|
+
* unchanged. Persist resets `cancellation_request_date` to now on every
|
|
17
|
+
* update of such a row, and a changed reason or action could schedule
|
|
18
|
+
* another job, so a retry must not write.
|
|
19
|
+
*
|
|
20
|
+
* `cancellation_request_date` is not an input because that trigger
|
|
21
|
+
* overwrites whatever is supplied.
|
|
22
|
+
*/
|
|
23
|
+
export const pbmSubscriptionCancelTool = {
|
|
24
|
+
name: 'pbm_subscription_cancel',
|
|
25
|
+
description: 'Cancel a BILLABLE PBM billing subscription: records the cancellation and Persist schedules ' +
|
|
26
|
+
'the final invoice job. The subscription closes when that job runs, so subscription_status ' +
|
|
27
|
+
'stays BILLABLE until then. Any other status is refused, because no job would be scheduled. ' +
|
|
28
|
+
'Requires confirm=true and a reason. A subscription already cancelled is returned unchanged, ' +
|
|
29
|
+
'so retries are safe.',
|
|
30
|
+
inputSchema: z.object({
|
|
31
|
+
id: z
|
|
32
|
+
.string()
|
|
33
|
+
.min(1)
|
|
34
|
+
.describe('UUID of the pbm_billing_subscriptions row to cancel'),
|
|
35
|
+
cancellation_effective_date: z
|
|
36
|
+
.string()
|
|
37
|
+
.min(1)
|
|
38
|
+
.describe('ISO 8601 date cancellation takes effect (required). Persist rejects a date before ' +
|
|
39
|
+
'the current billing period start.'),
|
|
40
|
+
cancellation_final_invoice_action: z
|
|
41
|
+
.enum(['CYCLE_END', 'PRORATE_CYCLE_END', 'IMMEDIATE', 'PRORATE_IMMEDIATE'])
|
|
42
|
+
.optional()
|
|
43
|
+
.describe('Final invoice policy. Defaults to the value on the subscription, normally CYCLE_END.'),
|
|
44
|
+
reason: reasonSchema.describe('Human-readable reason, stored in cancellation_request_reason'),
|
|
45
|
+
confirm: confirmFlagSchema,
|
|
46
|
+
idempotency_key: unenforcedIdempotencyKeySchema,
|
|
47
|
+
}),
|
|
48
|
+
capabilities: [
|
|
49
|
+
cap('pbm_billing_subscriptions', 'SELECT'),
|
|
50
|
+
cap('pbm_billing_subscriptions_u', 'UPDATE'),
|
|
51
|
+
],
|
|
52
|
+
sideEffect: 'state_change',
|
|
53
|
+
confirmation: 'caller_confirms',
|
|
54
|
+
idempotency: 'natural_key',
|
|
55
|
+
handler: async (args, ctx) => {
|
|
56
|
+
const input = args;
|
|
57
|
+
const notFound = () => errorResponse(API_ERROR, `PBM billing subscription ${input.id} not found or not accessible`);
|
|
58
|
+
const body = {
|
|
59
|
+
cancellation_effective_date: input.cancellation_effective_date,
|
|
60
|
+
cancellation_request_reason: input.reason,
|
|
61
|
+
};
|
|
62
|
+
if (input.cancellation_final_invoice_action !== undefined) {
|
|
63
|
+
body.cancellation_final_invoice_action = input.cancellation_final_invoice_action;
|
|
64
|
+
}
|
|
65
|
+
try {
|
|
66
|
+
const current = await ctx.apiClient.get(`${ctx.apiClient.dbBasePath}/pbm_billing_subscriptions?id=eq.${input.id}&select=*`);
|
|
67
|
+
if (!current || current.length === 0)
|
|
68
|
+
return notFound();
|
|
69
|
+
const row = current[0];
|
|
70
|
+
if (row.cancellation_effective_date)
|
|
71
|
+
return successResponse(row);
|
|
72
|
+
if (row.subscription_status !== 'BILLABLE' || row.active === false) {
|
|
73
|
+
return errorResponse(API_ERROR, `PBM billing subscription ${input.id} is ${row.subscription_status}: ` +
|
|
74
|
+
'only an active BILLABLE subscription can be cancelled');
|
|
75
|
+
}
|
|
76
|
+
const rows = await ctx.apiClient.patch(`${ctx.apiClient.dbBasePath}/pbm_billing_subscriptions_u?id=eq.${input.id}&select=*`, body, { headers: writeHeadersWithIdempotency(input.idempotency_key) });
|
|
77
|
+
if (!rows || rows.length === 0)
|
|
78
|
+
return notFound();
|
|
79
|
+
return successResponse(rows[0]);
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
return errorResponse(API_ERROR, `Failed to cancel PBM billing subscription: ${error.message}`);
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
//# sourceMappingURL=pbm-subscription-cancel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pbm-subscription-cancel.js","sourceRoot":"","sources":["../../../src/tools/pbm/pbm-subscription-cancel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,GAAG,EAAE,MAAM,uCAAuC,CAAC;AAC5D,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,8BAA8B,EAC9B,2BAA2B,GAC5B,MAAM,2BAA2B,CAAC;AAEnC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAS;IAC7C,IAAI,EAAE,yBAAyB;IAC/B,WAAW,EACT,6FAA6F;QAC7F,4FAA4F;QAC5F,6FAA6F;QAC7F,8FAA8F;QAC9F,sBAAsB;IACxB,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,EAAE,EAAE,CAAC;aACF,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CAAC,qDAAqD,CAAC;QAClE,2BAA2B,EAAE,CAAC;aAC3B,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CACP,oFAAoF;YAClF,mCAAmC,CACtC;QACH,iCAAiC,EAAE,CAAC;aACjC,IAAI,CAAC,CAAC,WAAW,EAAE,mBAAmB,EAAE,WAAW,EAAE,mBAAmB,CAAC,CAAC;aAC1E,QAAQ,EAAE;aACV,QAAQ,CAAC,sFAAsF,CA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AK,KAAK,EAAE,CAAC;gBACnE,OAAO,aAAa,CAClB,SAAS,EACT,4BAA4B,KAAK,CAAC,EAAE,OAAO,GAAG,CAAC,mBAAmB,IAAI;oBACpE,uDAAuD,CAC1D,CAAC;YACJ,CAAC;YACD,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,SAAS,CAAC,KAAK,CACpC,GAAG,GAAG,CAAC,SAAS,CAAC,UAAU,sCAAsC,KAAK,CAAC,EAAE,WAAW,EACpF,IAAI,EACJ,EAAE,OAAO,EAAE,2BAA2B,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE,CAChE,CAAC;YACF,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;gBAAE,OAAO,QAAQ,EAAE,CAAC;YAClD,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAClC,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,OAAO,aAAa,CAClB,SAAS,EACT,8CAA8C,KAAK,CAAC,OAAO,EAAE,CAC9D,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Tool } from '../registry.js';
|
|
2
|
+
/**
|
|
3
|
+
* Provisioning semantic tool: create a PBM billing subscription
|
|
4
|
+
* (`pbm_billing_subscriptions`). Requires `confirm: true`.
|
|
5
|
+
*
|
|
6
|
+
* The subscription starts PENDING, and billing starts when it becomes
|
|
7
|
+
* BILLABLE. MCP has no tool for that step. Persist has no unique key
|
|
8
|
+
* here, so a retry creates a second subscription.
|
|
9
|
+
*
|
|
10
|
+
* Cancellation columns (`cancellation_effective_date`,
|
|
11
|
+
* `cancellation_request_date`, `cancellation_request_reason`,
|
|
12
|
+
* `cancellation_final_invoice_action`) are intentionally NOT writable
|
|
13
|
+
* through this tool — cancellation is a lifecycle event handled by
|
|
14
|
+
* `pbm_subscription_cancel`. `subscription_status` is not an input.
|
|
15
|
+
*
|
|
16
|
+
* Payment method / gateway credentials live in an excluded FXM table
|
|
17
|
+
* (fxm_payment_processor_credentials) and cannot be set through MCP.
|
|
18
|
+
*/
|
|
19
|
+
export declare const pbmSubscriptionCreateTool: Tool;
|
|
20
|
+
//# sourceMappingURL=pbm-subscription-create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pbm-subscription-create.d.ts","sourceRoot":"","sources":["../../../src/tools/pbm/pbm-subscription-create.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAStC;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,yBAAyB,EAAE,IA0EvC,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { API_ERROR, errorResponse, successResponse } from '../types.js';
|
|
3
|
+
import { cap } from '../../capabilities/tool-capability.js';
|
|
4
|
+
import { confirmFlagSchema, unenforcedIdempotencyKeySchema, writeHeadersWithIdempotency, } from '../_shared/side-effect.js';
|
|
5
|
+
/**
|
|
6
|
+
* Provisioning semantic tool: create a PBM billing subscription
|
|
7
|
+
* (`pbm_billing_subscriptions`). Requires `confirm: true`.
|
|
8
|
+
*
|
|
9
|
+
* The subscription starts PENDING, and billing starts when it becomes
|
|
10
|
+
* BILLABLE. MCP has no tool for that step. Persist has no unique key
|
|
11
|
+
* here, so a retry creates a second subscription.
|
|
12
|
+
*
|
|
13
|
+
* Cancellation columns (`cancellation_effective_date`,
|
|
14
|
+
* `cancellation_request_date`, `cancellation_request_reason`,
|
|
15
|
+
* `cancellation_final_invoice_action`) are intentionally NOT writable
|
|
16
|
+
* through this tool — cancellation is a lifecycle event handled by
|
|
17
|
+
* `pbm_subscription_cancel`. `subscription_status` is not an input.
|
|
18
|
+
*
|
|
19
|
+
* Payment method / gateway credentials live in an excluded FXM table
|
|
20
|
+
* (fxm_payment_processor_credentials) and cannot be set through MCP.
|
|
21
|
+
*/
|
|
22
|
+
export const pbmSubscriptionCreateTool = {
|
|
23
|
+
name: 'pbm_subscription_create',
|
|
24
|
+
description: 'Create a PBM billing subscription (pbm_billing_subscriptions). It starts PENDING and is ' +
|
|
25
|
+
'not billed until it becomes BILLABLE, which MCP cannot do. Requires confirm=true. ' +
|
|
26
|
+
'Not deduplicated: calling it again creates another subscription, so check ' +
|
|
27
|
+
'pbm_billing_subscriptions_list filtered on subscribed_to_customer_id before retrying.',
|
|
28
|
+
inputSchema: z.object({
|
|
29
|
+
subscribed_to_customer_id: z
|
|
30
|
+
.string()
|
|
31
|
+
.min(1)
|
|
32
|
+
.describe('UUID of the far_customers row this subscription bills'),
|
|
33
|
+
subscribed_to_party_contact_point_id: z
|
|
34
|
+
.string()
|
|
35
|
+
.min(1)
|
|
36
|
+
.describe('UUID of the party contact point (billing contact) — required'),
|
|
37
|
+
subscribed_to_customer_site_id: z.string().min(1).optional(),
|
|
38
|
+
subscription_name: z.string().max(256).optional(),
|
|
39
|
+
subscription_name_i18n: z.record(z.string()).optional(),
|
|
40
|
+
billing_cycle_month: z.number().int().min(1).max(12).optional(),
|
|
41
|
+
billing_cycle_day_of_month: z.number().int().min(1).max(31).optional(),
|
|
42
|
+
billing_cycle_day_of_week: z.number().int().min(0).max(6).optional(),
|
|
43
|
+
billing_cycle_hour: z.number().int().min(0).max(23).optional(),
|
|
44
|
+
billing_cycle_minute: z.number().int().min(0).max(59).optional(),
|
|
45
|
+
billing_cycle_second: z.number().int().min(0).max(59).optional(),
|
|
46
|
+
subscription_timezone_offset_minutes: z.number().int().optional(),
|
|
47
|
+
start_date: z.string().min(1).optional().describe('ISO 8601 subscription start'),
|
|
48
|
+
end_date: z.string().min(1).optional().describe('ISO 8601 subscription end (rare on create)'),
|
|
49
|
+
metadata: z.record(z.unknown()).optional(),
|
|
50
|
+
confirm: confirmFlagSchema,
|
|
51
|
+
idempotency_key: unenforcedIdempotencyKeySchema,
|
|
52
|
+
}),
|
|
53
|
+
capabilities: [cap('pbm_billing_subscriptions', 'INSERT')],
|
|
54
|
+
sideEffect: 'provisioning',
|
|
55
|
+
confirmation: 'caller_confirms',
|
|
56
|
+
idempotency: 'not_idempotent',
|
|
57
|
+
handler: async (args, ctx) => {
|
|
58
|
+
const input = args;
|
|
59
|
+
const body = {
|
|
60
|
+
subscribed_to_customer_id: input.subscribed_to_customer_id,
|
|
61
|
+
subscribed_to_party_contact_point_id: input.subscribed_to_party_contact_point_id,
|
|
62
|
+
};
|
|
63
|
+
for (const field of [
|
|
64
|
+
'subscribed_to_customer_site_id',
|
|
65
|
+
'subscription_name',
|
|
66
|
+
'subscription_name_i18n',
|
|
67
|
+
'billing_cycle_month',
|
|
68
|
+
'billing_cycle_day_of_month',
|
|
69
|
+
'billing_cycle_day_of_week',
|
|
70
|
+
'billing_cycle_hour',
|
|
71
|
+
'billing_cycle_minute',
|
|
72
|
+
'billing_cycle_second',
|
|
73
|
+
'subscription_timezone_offset_minutes',
|
|
74
|
+
'start_date',
|
|
75
|
+
'end_date',
|
|
76
|
+
'metadata',
|
|
77
|
+
]) {
|
|
78
|
+
if (input[field] !== undefined)
|
|
79
|
+
body[field] = input[field];
|
|
80
|
+
}
|
|
81
|
+
try {
|
|
82
|
+
const rows = await ctx.apiClient.post(`${ctx.apiClient.dbBasePath}/pbm_billing_subscriptions?select=*`, body, { headers: writeHeadersWithIdempotency(input.idempotency_key) });
|
|
83
|
+
return successResponse(rows[0]);
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
return errorResponse(API_ERROR, `Failed to create PBM billing subscription: ${error.message}`);
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
//# sourceMappingURL=pbm-subscription-create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pbm-subscription-create.js","sourceRoot":"","sources":["../../../src/tools/pbm/pbm-subscription-create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA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,EAAE;QAC3B,MAAM,KAAK,GAAG,IAA2B,CAAC;QAC1C,MAAM,IAAI,GAAwB;YAChC,yBAAyB,EAAE,KAAK,CAAC,yBAAyB;YAC1D,oCAAoC,EAClC,KAAK,CAAC,oCAAoC;SAC7C,CAAC;QACF,KAAK,MAAM,KAAK,IAAI;YAClB,gCAAgC;YAChC,mBAAmB;YACnB,wBAAwB;YACxB,qBAAqB;YACrB,4BAA4B;YAC5B,2BAA2B;YAC3B,oBAAoB;YACpB,sBAAsB;YACtB,sBAAsB;YACtB,sCAAsC;YACtC,YAAY;YACZ,UAAU;YACV,UAAU;SACX,EAAE,CAAC;YACF,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,SAAS;gBAAE,IAAI,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;QAC7D,CAAC;QACD,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,SAAS,CAAC,IAAI,CACnC,GAAG,GAAG,CAAC,SAAS,CAAC,UAAU,qCAAqC,EAChE,IAAI,EACJ,EAAE,OAAO,EAAE,2BAA2B,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE,CAChE,CAAC;YACF,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAClC,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,OAAO,aAAa,CAClB,SAAS,EACT,8CAA8C,KAAK,CAAC,OAAO,EAAE,CAC9D,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Tool } from '../registry.js';
|
|
2
|
+
/**
|
|
3
|
+
* Provisioning semantic tool: add a line (priced item) to a PBM billing
|
|
4
|
+
* subscription (`pbm_billing_subscription_lines`).
|
|
5
|
+
*
|
|
6
|
+
* Persist refuses the insert unless the parent is PENDING, and requires
|
|
7
|
+
* every line on a subscription to share a currency and billing interval.
|
|
8
|
+
* `subscribed_to_customer_id` is set from the parent by a trigger, so it
|
|
9
|
+
* is not an input. There is no unique key on these lines, so a retry
|
|
10
|
+
* adds a second line and the customer would be billed for both.
|
|
11
|
+
*/
|
|
12
|
+
export declare const pbmSubscriptionLineAddTool: Tool;
|
|
13
|
+
//# sourceMappingURL=pbm-subscription-line-add.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pbm-subscription-line-add.d.ts","sourceRoot":"","sources":["../../../src/tools/pbm/pbm-subscription-line-add.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAStC;;;;;;;;;GASG;AACH,eAAO,MAAM,0BAA0B,EAAE,IAuDxC,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { API_ERROR, errorResponse, successResponse } from '../types.js';
|
|
3
|
+
import { cap } from '../../capabilities/tool-capability.js';
|
|
4
|
+
import { confirmFlagSchema, unenforcedIdempotencyKeySchema, writeHeadersWithIdempotency, } from '../_shared/side-effect.js';
|
|
5
|
+
/**
|
|
6
|
+
* Provisioning semantic tool: add a line (priced item) to a PBM billing
|
|
7
|
+
* subscription (`pbm_billing_subscription_lines`).
|
|
8
|
+
*
|
|
9
|
+
* Persist refuses the insert unless the parent is PENDING, and requires
|
|
10
|
+
* every line on a subscription to share a currency and billing interval.
|
|
11
|
+
* `subscribed_to_customer_id` is set from the parent by a trigger, so it
|
|
12
|
+
* is not an input. There is no unique key on these lines, so a retry
|
|
13
|
+
* adds a second line and the customer would be billed for both.
|
|
14
|
+
*/
|
|
15
|
+
export const pbmSubscriptionLineAddTool = {
|
|
16
|
+
name: 'pbm_subscription_line_add',
|
|
17
|
+
description: 'Add a priced line to a PENDING PBM billing subscription (pbm_billing_subscription_lines). ' +
|
|
18
|
+
'Persist refuses any other status, and every line must share a currency and billing ' +
|
|
19
|
+
'interval. Requires confirm=true. Not deduplicated: calling it again adds another line that ' +
|
|
20
|
+
'would also be billed, so check pbm_billing_subscription_lines_list before retrying.',
|
|
21
|
+
inputSchema: z.object({
|
|
22
|
+
billing_subscription_id: z
|
|
23
|
+
.string()
|
|
24
|
+
.min(1)
|
|
25
|
+
.describe('UUID of the parent pbm_billing_subscriptions row (required)'),
|
|
26
|
+
price_id: z
|
|
27
|
+
.string()
|
|
28
|
+
.min(1)
|
|
29
|
+
.describe('UUID of the pcm_prices row this line bills against (required)'),
|
|
30
|
+
subscribed_qty: z.number().optional().describe('Quantity of the priced item'),
|
|
31
|
+
start_date: z.string().min(1).optional().describe('ISO 8601 line start (defaults to today)'),
|
|
32
|
+
end_date: z.string().min(1).optional().describe('ISO 8601 line end (rarely on create)'),
|
|
33
|
+
metadata: z.record(z.unknown()).optional(),
|
|
34
|
+
confirm: confirmFlagSchema,
|
|
35
|
+
idempotency_key: unenforcedIdempotencyKeySchema,
|
|
36
|
+
}),
|
|
37
|
+
capabilities: [cap('pbm_billing_subscription_lines', 'INSERT')],
|
|
38
|
+
sideEffect: 'provisioning',
|
|
39
|
+
confirmation: 'caller_confirms',
|
|
40
|
+
idempotency: 'not_idempotent',
|
|
41
|
+
handler: async (args, ctx) => {
|
|
42
|
+
const input = args;
|
|
43
|
+
const body = {
|
|
44
|
+
billing_subscription_id: input.billing_subscription_id,
|
|
45
|
+
price_id: input.price_id,
|
|
46
|
+
};
|
|
47
|
+
for (const field of [
|
|
48
|
+
'subscribed_qty',
|
|
49
|
+
'start_date',
|
|
50
|
+
'end_date',
|
|
51
|
+
'metadata',
|
|
52
|
+
]) {
|
|
53
|
+
if (input[field] !== undefined)
|
|
54
|
+
body[field] = input[field];
|
|
55
|
+
}
|
|
56
|
+
try {
|
|
57
|
+
const rows = await ctx.apiClient.post(`${ctx.apiClient.dbBasePath}/pbm_billing_subscription_lines?select=*`, body, { headers: writeHeadersWithIdempotency(input.idempotency_key) });
|
|
58
|
+
return successResponse(rows[0]);
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
return errorResponse(API_ERROR, `Failed to add PBM subscription line: ${error.message}`);
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=pbm-subscription-line-add.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pbm-subscription-line-add.js","sourceRoot":"","sources":["../../../src/tools/pbm/pbm-subscription-line-add.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,GAAG,EAAE,MAAM,uCAAuC,CAAC;AAC5D,OAAO,EACL,iBAAiB,EACjB,8BAA8B,EAC9B,2BAA2B,GAC5B,MAAM,2BAA2B,CAAC;AAEnC;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAS;IAC9C,IAAI,EAAE,2BAA2B;IACjC,WAAW,EACT,4FAA4F;QAC5F,qFAAqF;QACrF,6FAA6F;QAC7F,qFAAqF;IACvF,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,uBAAuB,EAAE,CAAC;aACvB,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CAAC,6DAA6D,CAAC;QAC1E,QAAQ,EAAE,CAAC;aACR,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CAAC,+DAA+D,CAAC;QAC5E,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;QAC7E,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yCAAyC,CAAC;QAC5F,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC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
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Tool } from '../registry.js';
|
|
2
|
+
/**
|
|
3
|
+
* State-change semantic tool: close a subscription line by setting its
|
|
4
|
+
* `end_date` (`pbm_billing_subscription_lines`). The reason is merged
|
|
5
|
+
* into `metadata.line_end_reason`.
|
|
6
|
+
*
|
|
7
|
+
* Persist's `prevent_subscription_line_for_parent_status` trigger
|
|
8
|
+
* refuses every insert and update unless the parent subscription is
|
|
9
|
+
* PENDING, so this cannot change a subscription that is already billing.
|
|
10
|
+
*/
|
|
11
|
+
export declare const pbmSubscriptionLineEndTool: Tool;
|
|
12
|
+
//# sourceMappingURL=pbm-subscription-line-end.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pbm-subscription-line-end.d.ts","sourceRoot":"","sources":["../../../src/tools/pbm/pbm-subscription-line-end.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAStC;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B,EAAE,IAwCxC,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { cap } from '../../capabilities/tool-capability.js';
|
|
3
|
+
import { confirmFlagSchema, reasonSchema, unenforcedIdempotencyKeySchema, } from '../_shared/side-effect.js';
|
|
4
|
+
import { softDeactivate } from '../_shared/soft-deactivate.js';
|
|
5
|
+
/**
|
|
6
|
+
* State-change semantic tool: close a subscription line by setting its
|
|
7
|
+
* `end_date` (`pbm_billing_subscription_lines`). The reason is merged
|
|
8
|
+
* into `metadata.line_end_reason`.
|
|
9
|
+
*
|
|
10
|
+
* Persist's `prevent_subscription_line_for_parent_status` trigger
|
|
11
|
+
* refuses every insert and update unless the parent subscription is
|
|
12
|
+
* PENDING, so this cannot change a subscription that is already billing.
|
|
13
|
+
*/
|
|
14
|
+
export const pbmSubscriptionLineEndTool = {
|
|
15
|
+
name: 'pbm_subscription_line_end',
|
|
16
|
+
description: 'Close a PBM subscription line by setting end_date and merge the reason into metadata. ' +
|
|
17
|
+
'Persist only allows this while the parent subscription is PENDING, so it cannot change what ' +
|
|
18
|
+
'a billing subscription charges. Requires confirm=true and a reason. A line already ending ' +
|
|
19
|
+
'on that date is returned unchanged, so retries are safe.',
|
|
20
|
+
inputSchema: z.object({
|
|
21
|
+
id: z.string().min(1).describe('UUID of the pbm_billing_subscription_lines row to close'),
|
|
22
|
+
end_date: z
|
|
23
|
+
.string()
|
|
24
|
+
.min(1)
|
|
25
|
+
.describe('ISO 8601 date the line ends (required)'),
|
|
26
|
+
reason: reasonSchema.describe('Human-readable reason, merged into metadata'),
|
|
27
|
+
confirm: confirmFlagSchema,
|
|
28
|
+
idempotency_key: unenforcedIdempotencyKeySchema,
|
|
29
|
+
}),
|
|
30
|
+
capabilities: [cap('pbm_billing_subscription_lines', 'UPDATE')],
|
|
31
|
+
sideEffect: 'state_change',
|
|
32
|
+
confirmation: 'caller_confirms',
|
|
33
|
+
idempotency: 'natural_key',
|
|
34
|
+
handler: async (args, ctx) => {
|
|
35
|
+
const input = args;
|
|
36
|
+
return softDeactivate(ctx, {
|
|
37
|
+
table: 'pbm_billing_subscription_lines',
|
|
38
|
+
id: input.id,
|
|
39
|
+
label: 'PBM subscription line',
|
|
40
|
+
verb: 'end',
|
|
41
|
+
isDone: (row) => new Date(row.end_date).getTime() === new Date(input.end_date).getTime(),
|
|
42
|
+
changes: () => ({ end_date: input.end_date }),
|
|
43
|
+
reasonKey: 'line_end_reason',
|
|
44
|
+
reason: input.reason,
|
|
45
|
+
idempotencyKey: input.idempotency_key,
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=pbm-subscription-line-end.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pbm-subscription-line-end.js","sourceRoot":"","sources":["../../../src/tools/pbm/pbm-subscription-line-end.ts"],"names":[],"mappings":"AAA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,QAAQ,CAAC,CAAC,OAAO,EAAE,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE;YACxF,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC;YAC7C,SAAS,EAAE,iBAAiB;YAC5B,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,cAAc,EAAE,KAAK,CAAC,eAAe;SACtC,CAAC,CAAC;IACL,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Tool } from '../registry.js';
|
|
2
|
+
import { CatalogueReport } from '../../generated-reads/index.js';
|
|
3
|
+
export declare const pcmGeneratedReadReport: CatalogueReport;
|
|
4
|
+
export declare const pcmGeneratedReadTools: Tool[];
|
|
5
|
+
//# sourceMappingURL=generated-reads.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-reads.d.ts","sourceRoot":"","sources":["../../../src/tools/pcm/generated-reads.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAGL,eAAe,EAChB,MAAM,gCAAgC,CAAC;AAwBxC,eAAO,MAAM,sBAAsB,EAAE,eAGjC,CAAC;AAEL,eAAO,MAAM,qBAAqB,EAAE,IAAI,EAGvC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { buildGeneratedReadCatalogue, buildGeneratedReadCatalogueReport, } from '../../generated-reads/index.js';
|
|
2
|
+
import { loadPersistResourceContract } from '../../contracts/persist-resource-contract.js';
|
|
3
|
+
/**
|
|
4
|
+
* Bounded read tools for the PCM (Price / Cost Management) module
|
|
5
|
+
* (WI-0003506).
|
|
6
|
+
*
|
|
7
|
+
* Every PCM resource is classified `normal` (no credentials), so no
|
|
8
|
+
* field-level redaction is required — but the framework still refuses
|
|
9
|
+
* to emit generic `create` / `update` / `delete` tools for tables that
|
|
10
|
+
* carry pricing state. Writes (register or deactivate a price list,
|
|
11
|
+
* create a version) are dedicated tools that require confirm=true.
|
|
12
|
+
*
|
|
13
|
+
* Resources surfaced (all `list`+`read`):
|
|
14
|
+
* - pcm_price_lists, pcm_price_list_versions
|
|
15
|
+
* - pcm_price_list_lines, pcm_price_list_lines_interface,
|
|
16
|
+
* pcm_price_list_lines_interface_batch
|
|
17
|
+
* - pcm_price_list_rules, pcm_price_list_rule_lines
|
|
18
|
+
* - pcm_price_list_parties, pcm_price_list_price_list_type_lookup
|
|
19
|
+
* - pcm_prices, pcm_price_tiers
|
|
20
|
+
*/
|
|
21
|
+
const contract = loadPersistResourceContract();
|
|
22
|
+
export const pcmGeneratedReadReport = buildGeneratedReadCatalogueReport(contract, {
|
|
23
|
+
modules: ['pcm'],
|
|
24
|
+
});
|
|
25
|
+
export const pcmGeneratedReadTools = buildGeneratedReadCatalogue(contract, { modules: ['pcm'] });
|
|
26
|
+
//# sourceMappingURL=generated-reads.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-reads.js","sourceRoot":"","sources":["../../../src/tools/pcm/generated-reads.ts"],"names":[],"mappings":"AACA,OAAO,EACL,2BAA2B,EAC3B,iCAAiC,GAElC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAE3F;;;;;;;;;;;;;;;;;GAiBG;AAEH,MAAM,QAAQ,GAAG,2BAA2B,EAAE,CAAC;AAE/C,MAAM,CAAC,MAAM,sBAAsB,GACjC,iCAAiC,CAAC,QAAQ,EAAE;IAC1C,OAAO,EAAE,CAAC,KAAK,CAAC;CACjB,CAAC,CAAC;AAEL,MAAM,CAAC,MAAM,qBAAqB,GAAW,2BAA2B,CACtE,QAAQ,EACR,EAAE,OAAO,EAAE,CAAC,KAAK,CAAC,EAAE,CACrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/pcm/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAetC,eAAO,MAAM,QAAQ,EAAE,IAAI,EAAiD,CAAC;AAE7E,wEAAwE;AACxE,eAAO,MAAM,gBAAgB,EAAE,IAAI,EAA0B,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { pcmGeneratedReadTools } from './generated-reads.js';
|
|
2
|
+
import { pcmPriceListRegisterTool } from './pcm-price-list-register.js';
|
|
3
|
+
import { pcmPriceListDeactivateTool } from './pcm-price-list-deactivate.js';
|
|
4
|
+
import { pcmPriceListVersionCreateTool } from './pcm-price-list-version-create.js';
|
|
5
|
+
// Price list lines belong to the shared import tools (definition_code
|
|
6
|
+
// PCM_PRICE_LIST_LINES), which need moving to the PostgREST import API first (WI-0009453).
|
|
7
|
+
// Pricing rules have no write tool: see the 10.4.0 changelog.
|
|
8
|
+
const pcmWriteTools = [
|
|
9
|
+
pcmPriceListRegisterTool,
|
|
10
|
+
pcmPriceListDeactivateTool,
|
|
11
|
+
pcmPriceListVersionCreateTool,
|
|
12
|
+
];
|
|
13
|
+
export const pcmTools = [...pcmGeneratedReadTools, ...pcmWriteTools];
|
|
14
|
+
/** Read-only slice used by the `pcm-readonly` selectable sub-domain. */
|
|
15
|
+
export const pcmReadOnlyTools = pcmGeneratedReadTools;
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/pcm/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AAEnF,sEAAsE;AACtE,2FAA2F;AAC3F,8DAA8D;AAC9D,MAAM,aAAa,GAAW;IAC5B,wBAAwB;IACxB,0BAA0B;IAC1B,6BAA6B;CAC9B,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAW,CAAC,GAAG,qBAAqB,EAAE,GAAG,aAAa,CAAC,CAAC;AAE7E,wEAAwE;AACxE,MAAM,CAAC,MAAM,gBAAgB,GAAW,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Tool } from '../registry.js';
|
|
2
|
+
/**
|
|
3
|
+
* Deactivate a price list (`pcm_price_lists`) by setting `active=false`.
|
|
4
|
+
* Its versions and lines are kept. The unique key on name and type only
|
|
5
|
+
* covers active lists, so deactivating frees the name for a new list.
|
|
6
|
+
*
|
|
7
|
+
* The tool reads the list first: the reason is merged into `metadata`,
|
|
8
|
+
* and a list already inactive is returned unchanged.
|
|
9
|
+
*/
|
|
10
|
+
export declare const pcmPriceListDeactivateTool: Tool;
|
|
11
|
+
//# sourceMappingURL=pcm-price-list-deactivate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pcm-price-list-deactivate.d.ts","sourceRoot":"","sources":["../../../src/tools/pcm/pcm-price-list-deactivate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAStC;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B,EAAE,IAsCxC,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { cap } from '../../capabilities/tool-capability.js';
|
|
3
|
+
import { confirmFlagSchema, reasonSchema, unenforcedIdempotencyKeySchema, } from '../_shared/side-effect.js';
|
|
4
|
+
import { softDeactivate, softDeactivateEndDateSchema } from '../_shared/soft-deactivate.js';
|
|
5
|
+
/**
|
|
6
|
+
* Deactivate a price list (`pcm_price_lists`) by setting `active=false`.
|
|
7
|
+
* Its versions and lines are kept. The unique key on name and type only
|
|
8
|
+
* covers active lists, so deactivating frees the name for a new list.
|
|
9
|
+
*
|
|
10
|
+
* The tool reads the list first: the reason is merged into `metadata`,
|
|
11
|
+
* and a list already inactive is returned unchanged.
|
|
12
|
+
*/
|
|
13
|
+
export const pcmPriceListDeactivateTool = {
|
|
14
|
+
name: 'pcm_price_list_deactivate',
|
|
15
|
+
description: 'Deactivate a price list (pcm_price_lists) by setting active=false and merging the reason ' +
|
|
16
|
+
'into metadata. Requires confirm=true and a reason. Versions and lines are kept, and the ' +
|
|
17
|
+
'name and type become free for a new active list. A list already inactive is returned ' +
|
|
18
|
+
'unchanged, so retries are safe. end_date is left alone unless supplied.',
|
|
19
|
+
inputSchema: z.object({
|
|
20
|
+
id: z.string().uuid().describe('UUID of the pcm_price_lists row to deactivate'),
|
|
21
|
+
reason: reasonSchema.describe('Human-readable reason, merged into metadata'),
|
|
22
|
+
end_date: softDeactivateEndDateSchema,
|
|
23
|
+
confirm: confirmFlagSchema,
|
|
24
|
+
idempotency_key: unenforcedIdempotencyKeySchema,
|
|
25
|
+
}),
|
|
26
|
+
capabilities: [cap('pcm_price_lists', 'UPDATE'), cap('pcm_price_lists', 'SELECT')],
|
|
27
|
+
sideEffect: 'state_change',
|
|
28
|
+
confirmation: 'caller_confirms',
|
|
29
|
+
idempotency: 'natural_key',
|
|
30
|
+
handler: async (args, ctx) => {
|
|
31
|
+
const input = args;
|
|
32
|
+
return softDeactivate(ctx, {
|
|
33
|
+
table: 'pcm_price_lists',
|
|
34
|
+
id: input.id,
|
|
35
|
+
label: 'PCM price list',
|
|
36
|
+
verb: 'deactivate',
|
|
37
|
+
isDone: (row) => row.active === false,
|
|
38
|
+
changes: () => ({ active: false }),
|
|
39
|
+
reasonKey: 'deactivation_reason',
|
|
40
|
+
reason: input.reason,
|
|
41
|
+
endDate: input.end_date,
|
|
42
|
+
idempotencyKey: input.idempotency_key,
|
|
43
|
+
});
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=pcm-price-list-deactivate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pcm-price-list-deactivate.js","sourceRoot":"","sources":["../../../src/tools/pcm/pcm-price-list-deactivate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,GAAG,EAAE,MAAM,uCAAuC,CAAC;AAC5D,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,8BAA8B,GAC/B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAE5F;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAS;IAC9C,IAAI,EAAE,2BAA2B;IACjC,WAAW,EACT,2FAA2F;QAC3F,0FAA0F;QAC1F,uFAAuF;QACvF,yEAAyE;IAC3E,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,+CAA+C,CAAC;QAC/E,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,6CAA6C,CAAC;QAC5E,QAAQ,EAAE,2BAA2B;QACrC,OAAO,EAAE,iBAAiB;QAC1B,eAAe,EAAE,8BAA8B;KAChD,CAAC;IACF,YAAY,EAAE,CAAC,GAAG,CAAC,iBAAiB,EAAE,QAAQ,CAAC,EAAE,GAAG,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAC;IAClF,UAAU,EAAE,cAAc;IAC1B,YAAY,EAAE,iBAAiB;IAC/B,WAAW,EAAE,aAAa;IAC1B,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE;QAC3B,MAAM,KAAK,GAAG,IAKb,CAAC;QACF,OAAO,cAAc,CAAC,GAAG,EAAE;YACzB,KAAK,EAAE,iBAAiB;YACxB,EAAE,EAAE,KAAK,CAAC,EAAE;YACZ,KAAK,EAAE,gBAAgB;YACvB,IAAI,EAAE,YAAY;YAClB,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,KAAK,KAAK;YACrC,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;YAClC,SAAS,EAAE,qBAAqB;YAChC,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,OAAO,EAAE,KAAK,CAAC,QAAQ;YACvB,cAAc,EAAE,KAAK,CAAC,eAAe;SACtC,CAAC,CAAC;IACL,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Tool } from '../registry.js';
|
|
2
|
+
/** Values of the Persist PCM_PRICE_LISTS_VISIBILITY lookup. */
|
|
3
|
+
export declare const PCM_PRICE_LIST_VISIBILITIES: readonly ["PARTY", "AUTHENTICATED", "PUBLIC"];
|
|
4
|
+
/**
|
|
5
|
+
* Register a price list (`pcm_price_lists`), the container that price
|
|
6
|
+
* list versions and lines attach to.
|
|
7
|
+
*
|
|
8
|
+
* Unique key: `t_pcm_price_lists_ui` on (price_list_name,
|
|
9
|
+
* price_list_type) among active price lists in the tenant, so a retry
|
|
10
|
+
* fails with a duplicate-key error instead of creating a second list.
|
|
11
|
+
*
|
|
12
|
+
* `pcm_price_lists` is not routed by organisation: Persist fills a
|
|
13
|
+
* missing `org_id` with the tenant's lowest organisation id, so the tool
|
|
14
|
+
* requires it.
|
|
15
|
+
*
|
|
16
|
+
* `visibility=PUBLIC` makes Persist write a wildcard viewer tuple, so
|
|
17
|
+
* anyone, including unauthenticated callers, can read the list. The
|
|
18
|
+
* tool needs `allow_public=true` as well as `confirm=true` for that.
|
|
19
|
+
*/
|
|
20
|
+
export declare const pcmPriceListRegisterTool: Tool;
|
|
21
|
+
//# sourceMappingURL=pcm-price-list-register.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pcm-price-list-register.d.ts","sourceRoot":"","sources":["../../../src/tools/pcm/pcm-price-list-register.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAgBtC,+DAA+D;AAC/D,eAAO,MAAM,2BAA2B,+CAAgD,CAAC;AAEzF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,wBAAwB,EAAE,IAyEtC,CAAC"}
|