@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,149 @@
|
|
|
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
|
+
import { END_AFTER_START_MESSAGE, endsAfterStart, isoDateTimeSchema, } from '../_shared/date-range.js';
|
|
6
|
+
/** Values of the Persist GPM_ITEM_TYPES lookup, checked by `validate_item_type_trigger`. */
|
|
7
|
+
export const GPM_ITEM_TYPES = [
|
|
8
|
+
'CATEGORY',
|
|
9
|
+
'SERVICE',
|
|
10
|
+
'INSURANCE_PRODUCT',
|
|
11
|
+
'MERCHANT_CATEGORY',
|
|
12
|
+
'VERIFICATION',
|
|
13
|
+
'PRODUCT',
|
|
14
|
+
];
|
|
15
|
+
const ALT_KEY_FIELDS = ['item_key_01', 'item_key_02', 'item_key_03'];
|
|
16
|
+
const uom = (label) => z
|
|
17
|
+
.string()
|
|
18
|
+
.min(1)
|
|
19
|
+
.max(3)
|
|
20
|
+
.optional()
|
|
21
|
+
.describe(`${label}: an fnd_uoms uom_code, case-sensitive (the seeded code is "ea")`);
|
|
22
|
+
/**
|
|
23
|
+
* Register a catalogue item (`gpm_items`).
|
|
24
|
+
*
|
|
25
|
+
* Persist identifies an item by (org_id, item_key, item_key_01..03),
|
|
26
|
+
* compared NULL-safe. Its unique constraint
|
|
27
|
+
* `t_gpm_items_item_code_org_id_uq` treats NULL alternate keys as
|
|
28
|
+
* distinct, so it only stops duplicates when every alternate key is set.
|
|
29
|
+
* PRODUCT items are also unique on (org_id, item_key) alone
|
|
30
|
+
* (`t_gpm_items_product_key_org_tenant_uq`). The tool therefore reads the
|
|
31
|
+
* organisation's items with the same item_key first and refuses one that
|
|
32
|
+
* matches either rule. That check is not atomic and only sees rows the
|
|
33
|
+
* caller can read (WI-0009456 asks Persist to enforce it).
|
|
34
|
+
*
|
|
35
|
+
* `org_id` is required so the check is scoped to the organisation the
|
|
36
|
+
* item is created in; Persist routes `gpm_items` by the body `org_id`.
|
|
37
|
+
*/
|
|
38
|
+
export const gpmItemRegisterTool = {
|
|
39
|
+
name: 'gpm_item_register',
|
|
40
|
+
description: 'Register a catalogue item (gpm_items) in org_id. Requires confirm=true. An item is ' +
|
|
41
|
+
'identified by org_id, item_key and item_key_01..03, and a PRODUCT by org_id and item_key ' +
|
|
42
|
+
'alone: a matching item you can see is refused, naming the existing id. Not otherwise ' +
|
|
43
|
+
'deduplicated, so check gpm_items_list before retrying after an unclear result. ' +
|
|
44
|
+
'item_type must be a GPM_ITEM_TYPES value. UoM fields are ' +
|
|
45
|
+
'fnd_uoms codes, which are case-sensitive (default primary_uom is "ea").',
|
|
46
|
+
inputSchema: z
|
|
47
|
+
.object({
|
|
48
|
+
item_key: z
|
|
49
|
+
.string()
|
|
50
|
+
.min(1)
|
|
51
|
+
.max(256)
|
|
52
|
+
.describe('Catalogue key. Downstream flows resolve items by org_id + item_key (+ alternate keys).'),
|
|
53
|
+
item_key_01: z.string().min(1).max(256).optional(),
|
|
54
|
+
item_key_02: z.string().min(1).max(256).optional(),
|
|
55
|
+
item_key_03: z.string().min(1).max(256).optional(),
|
|
56
|
+
item_name: z.string().min(1).max(256).describe('Human-readable item name'),
|
|
57
|
+
item_description: z.string().max(4096).optional(),
|
|
58
|
+
item_type: z
|
|
59
|
+
.enum(GPM_ITEM_TYPES)
|
|
60
|
+
.optional()
|
|
61
|
+
.describe('GPM_ITEM_TYPES value. PRODUCT is a retailer product or variant.'),
|
|
62
|
+
inventory_organization_id: z
|
|
63
|
+
.string()
|
|
64
|
+
.uuid()
|
|
65
|
+
.optional()
|
|
66
|
+
.describe('UUID of the inventory organisation the item belongs to'),
|
|
67
|
+
org_id: z.string().uuid().describe('UUID of the organisation that owns the item'),
|
|
68
|
+
primary_uom: uom('Primary unit of measure (defaults to "ea")'),
|
|
69
|
+
secondary_uom: uom('Secondary unit of measure'),
|
|
70
|
+
item_dimension_uom: uom('Dimension unit'),
|
|
71
|
+
item_mass_uom: uom('Mass unit'),
|
|
72
|
+
item_volume_uom: uom('Volume unit'),
|
|
73
|
+
item_dimension_length: z.number().nonnegative().optional(),
|
|
74
|
+
item_dimension_width: z.number().nonnegative().optional(),
|
|
75
|
+
item_dimension_height: z.number().nonnegative().optional(),
|
|
76
|
+
item_mass: z.number().nonnegative().optional(),
|
|
77
|
+
item_volume: z.number().nonnegative().optional(),
|
|
78
|
+
asset: z.boolean().optional(),
|
|
79
|
+
purchased: z.boolean().optional(),
|
|
80
|
+
stocked: z.boolean().optional(),
|
|
81
|
+
shipped: z.boolean().optional(),
|
|
82
|
+
returnable: z.boolean().optional(),
|
|
83
|
+
transacted: z.boolean().optional(),
|
|
84
|
+
display_order: z.number().int().optional(),
|
|
85
|
+
start_date: isoDateTimeSchema('ISO 8601 effective start (defaults to now)').optional(),
|
|
86
|
+
end_date: isoDateTimeSchema('ISO 8601 end, after start_date').optional(),
|
|
87
|
+
confirm: confirmFlagSchema,
|
|
88
|
+
idempotency_key: unenforcedIdempotencyKeySchema,
|
|
89
|
+
})
|
|
90
|
+
.refine((v) => endsAfterStart(v.start_date, v.end_date), { message: END_AFTER_START_MESSAGE }),
|
|
91
|
+
capabilities: [cap('gpm_items', 'INSERT'), cap('gpm_items', 'SELECT')],
|
|
92
|
+
sideEffect: 'provisioning',
|
|
93
|
+
confirmation: 'caller_confirms',
|
|
94
|
+
idempotency: 'not_idempotent',
|
|
95
|
+
handler: async (args, ctx) => {
|
|
96
|
+
const input = args;
|
|
97
|
+
const body = {
|
|
98
|
+
item_key: input.item_key,
|
|
99
|
+
item_name: input.item_name,
|
|
100
|
+
};
|
|
101
|
+
for (const field of [
|
|
102
|
+
'item_key_01',
|
|
103
|
+
'item_key_02',
|
|
104
|
+
'item_key_03',
|
|
105
|
+
'item_description',
|
|
106
|
+
'item_type',
|
|
107
|
+
'inventory_organization_id',
|
|
108
|
+
'org_id',
|
|
109
|
+
'primary_uom',
|
|
110
|
+
'secondary_uom',
|
|
111
|
+
'item_dimension_uom',
|
|
112
|
+
'item_mass_uom',
|
|
113
|
+
'item_volume_uom',
|
|
114
|
+
'item_dimension_length',
|
|
115
|
+
'item_dimension_width',
|
|
116
|
+
'item_dimension_height',
|
|
117
|
+
'item_mass',
|
|
118
|
+
'item_volume',
|
|
119
|
+
'asset',
|
|
120
|
+
'purchased',
|
|
121
|
+
'stocked',
|
|
122
|
+
'shipped',
|
|
123
|
+
'returnable',
|
|
124
|
+
'transacted',
|
|
125
|
+
'display_order',
|
|
126
|
+
'start_date',
|
|
127
|
+
'end_date',
|
|
128
|
+
]) {
|
|
129
|
+
if (input[field] !== undefined)
|
|
130
|
+
body[field] = input[field];
|
|
131
|
+
}
|
|
132
|
+
try {
|
|
133
|
+
const sameKey = await ctx.apiClient.get(`${ctx.apiClient.dbBasePath}/gpm_items?item_key=eq.${encodeURIComponent(input.item_key)}` +
|
|
134
|
+
`&org_id=eq.${input.org_id}&select=id,item_type,item_key_01,item_key_02,item_key_03&limit=200`);
|
|
135
|
+
const clash = (sameKey ?? []).find((row) => (input.item_type === 'PRODUCT' && row.item_type === 'PRODUCT') ||
|
|
136
|
+
ALT_KEY_FIELDS.every((field) => (row[field] ?? null) === (input[field] ?? null)));
|
|
137
|
+
if (clash) {
|
|
138
|
+
return errorResponse(API_ERROR, `GPM item ${input.item_key} already exists in organisation ${input.org_id} ` +
|
|
139
|
+
`(id ${clash.id}): use that item or change its keys`);
|
|
140
|
+
}
|
|
141
|
+
const rows = await ctx.apiClient.post(`${ctx.apiClient.dbBasePath}/gpm_items?select=*`, body, { headers: writeHeadersWithIdempotency(input.idempotency_key) });
|
|
142
|
+
return successResponse(rows[0]);
|
|
143
|
+
}
|
|
144
|
+
catch (error) {
|
|
145
|
+
return errorResponse(API_ERROR, `Failed to register GPM item: ${error.message}`);
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
};
|
|
149
|
+
//# sourceMappingURL=gpm-item-register.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gpm-item-register.js","sourceRoot":"","sources":["../../../src/tools/gpm/gpm-item-register.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;AACnC,OAAO,EACL,uBAAuB,EACvB,cAAc,EACd,iBAAiB,GAClB,MAAM,0BAA0B,CAAC;AAElC,4FAA4F;AAC5F,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,UAAU;IACV,SAAS;IACT,mBAAmB;IACnB,mBAAmB;IACnB,cAAc;IACd,SAAS;CACD,CAAC;AAEX,MAAM,cAAc,GAAG,CAAC,aAAa,EAAE,aAAa,EAAE,aAAa,CAAU,CAAC;AAE9E,MAAM,GAAG,GAAG,CAAC,KAAa,EAAE,EAAE,CAC5B,CAAC;KACE,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,CAAC,CAAC;KACN,QAAQ,EAAE;KACV,QAAQ,CAAC,GAAG,KAAK,kEAAkE,CAAC,CAAC;AAE1F;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAS;IACvC,IAAI,EAAE,mBAAmB;IACzB,WAAW,EACT,qFAAqF;QACrF,2FAA2F;QAC3F,uFAAuF;QACvF,iFAAiF;QACjF,2DAA2D;QAC3D,yEAAyE;IAC3E,WAAW,EAAE,CAAC;SACX,MAAM,CAAC;QACN,QAAQ,EAAE,CAAC;aACR,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,GAAG,CAAC,GAAG,CAAC;aACR,QAAQ,CAAC,wFAAwF,CAAC;QACrG,W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C,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC,CACnF,CAAC;YACF,IAAI,KAAK,EAAE,CAAC;gBACV,OAAO,aAAa,CAClB,SAAS,EACT,YAAY,KAAK,CAAC,QAAQ,mCAAmC,KAAK,CAAC,MAAM,GAAG;oBAC1E,OAAO,KAAK,CAAC,EAAE,qCAAqC,CACvD,CAAC;YACJ,CAAC;YACD,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,SAAS,CAAC,IAAI,CACnC,GAAG,GAAG,CAAC,SAAS,CAAC,UAAU,qBAAqB,EAChD,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,CAAC,SAAS,EAAE,gCAAgC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QACnF,CAAC;IACH,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/gpm/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAStC,eAAO,MAAM,QAAQ,EAAE,IAAI,EAAiD,CAAC;AAE7E,wEAAwE;AACxE,eAAO,MAAM,gBAAgB,EAAE,IAAI,EAA0B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { gpmGeneratedReadTools } from './generated-reads.js';
|
|
2
|
+
import { gpmItemRegisterTool } from './gpm-item-register.js';
|
|
3
|
+
import { gpmItemDeactivateTool } from './gpm-item-deactivate.js';
|
|
4
|
+
// Bulk item loads belong to the shared import tools (definition_code GPM_ITEMS),
|
|
5
|
+
// which need moving to the PostgREST import API first (WI-0009453).
|
|
6
|
+
const gpmWriteTools = [gpmItemRegisterTool, gpmItemDeactivateTool];
|
|
7
|
+
export const gpmTools = [...gpmGeneratedReadTools, ...gpmWriteTools];
|
|
8
|
+
/** Read-only slice used by the `gpm-readonly` selectable sub-domain. */
|
|
9
|
+
export const gpmReadOnlyTools = gpmGeneratedReadTools;
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/gpm/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,iFAAiF;AACjF,oEAAoE;AACpE,MAAM,aAAa,GAAW,CAAC,mBAAmB,EAAE,qBAAqB,CAAC,CAAC;AAE3E,MAAM,CAAC,MAAM,QAAQ,GAAW,CAAC,GAAG,qBAAqB,EAAE,GAAG,aAAa,CAAC,CAAC;AAE7E,wEAAwE;AACxE,MAAM,CAAC,MAAM,gBAAgB,GAAW,qBAAqB,CAAC"}
|
|
@@ -20,64 +20,31 @@ export declare const leadRunSchema: z.ZodObject<{
|
|
|
20
20
|
partial_policy: "NONE" | "INDEPENDENT_OBJECTS";
|
|
21
21
|
}>;
|
|
22
22
|
}, "strict", z.ZodTypeAny, {
|
|
23
|
+
idempotency_key: string;
|
|
23
24
|
context: {
|
|
24
25
|
org_id: string;
|
|
25
26
|
};
|
|
26
27
|
source_id: string;
|
|
27
28
|
destination_org_id: string;
|
|
28
29
|
definition_version: number;
|
|
29
|
-
idempotency_key: string;
|
|
30
30
|
processing_policy: {
|
|
31
31
|
partial_policy: "NONE" | "INDEPENDENT_OBJECTS";
|
|
32
32
|
};
|
|
33
33
|
}, {
|
|
34
|
+
idempotency_key: string;
|
|
34
35
|
context: {
|
|
35
36
|
org_id: string;
|
|
36
37
|
};
|
|
37
38
|
source_id: string;
|
|
38
39
|
destination_org_id: string;
|
|
39
|
-
idempotency_key: string;
|
|
40
40
|
processing_policy: {
|
|
41
41
|
partial_policy: "NONE" | "INDEPENDENT_OBJECTS";
|
|
42
42
|
};
|
|
43
43
|
definition_version?: number | undefined;
|
|
44
44
|
}>;
|
|
45
45
|
export declare const runCreateSchema: z.ZodEffects<z.ZodObject<{
|
|
46
|
-
definition_code: z.ZodEnum<["FGL_COA_VALUES", "FGL_COA_COMBINATIONS", "SFA_LEADS", "FND_DAILY_RATES"]>;
|
|
47
|
-
context: z.ZodUnion<[z.
|
|
48
|
-
structure_id: z.ZodString;
|
|
49
|
-
upsert_mode: z.ZodEnum<["CREATE_ONLY", "REPLACE"]>;
|
|
50
|
-
}, "strict", z.ZodTypeAny, {
|
|
51
|
-
structure_id: string;
|
|
52
|
-
upsert_mode: "CREATE_ONLY" | "REPLACE";
|
|
53
|
-
}, {
|
|
54
|
-
structure_id: string;
|
|
55
|
-
upsert_mode: "CREATE_ONLY" | "REPLACE";
|
|
56
|
-
}>, z.ZodObject<{
|
|
57
|
-
org_id: z.ZodString;
|
|
58
|
-
}, "strict", z.ZodTypeAny, {
|
|
59
|
-
org_id: string;
|
|
60
|
-
}, {
|
|
61
|
-
org_id: string;
|
|
62
|
-
}>, z.ZodObject<{
|
|
63
|
-
rate_type: z.ZodString;
|
|
64
|
-
date_from: z.ZodString;
|
|
65
|
-
date_to: z.ZodString;
|
|
66
|
-
currencies: z.ZodArray<z.ZodString, "many">;
|
|
67
|
-
upsert_mode: z.ZodEnum<["CREATE_ONLY", "REPLACE"]>;
|
|
68
|
-
}, "strict", z.ZodTypeAny, {
|
|
69
|
-
upsert_mode: "CREATE_ONLY" | "REPLACE";
|
|
70
|
-
rate_type: string;
|
|
71
|
-
date_from: string;
|
|
72
|
-
date_to: string;
|
|
73
|
-
currencies: string[];
|
|
74
|
-
}, {
|
|
75
|
-
upsert_mode: "CREATE_ONLY" | "REPLACE";
|
|
76
|
-
rate_type: string;
|
|
77
|
-
date_from: string;
|
|
78
|
-
date_to: string;
|
|
79
|
-
currencies: string[];
|
|
80
|
-
}>]>;
|
|
46
|
+
definition_code: z.ZodEnum<["FGL_COA_VALUES", "FGL_COA_COMBINATIONS", "SFA_LEADS", "FND_DAILY_RATES", "GPM_ITEMS", "PCM_PRICE_LIST_LINES"]>;
|
|
47
|
+
context: z.ZodUnion<[z.ZodTypeAny, z.ZodTypeAny, ...z.ZodTypeAny[]]>;
|
|
81
48
|
source_id: z.ZodString;
|
|
82
49
|
destination_org_id: z.ZodString;
|
|
83
50
|
definition_version: z.ZodDefault<z.ZodNumber>;
|
|
@@ -90,88 +57,44 @@ export declare const runCreateSchema: z.ZodEffects<z.ZodObject<{
|
|
|
90
57
|
partial_policy: "NONE" | "INDEPENDENT_OBJECTS";
|
|
91
58
|
}>;
|
|
92
59
|
}, "strict", z.ZodTypeAny, {
|
|
93
|
-
|
|
94
|
-
structure_id: string;
|
|
95
|
-
upsert_mode: "CREATE_ONLY" | "REPLACE";
|
|
96
|
-
} | {
|
|
97
|
-
org_id: string;
|
|
98
|
-
} | {
|
|
99
|
-
upsert_mode: "CREATE_ONLY" | "REPLACE";
|
|
100
|
-
rate_type: string;
|
|
101
|
-
date_from: string;
|
|
102
|
-
date_to: string;
|
|
103
|
-
currencies: string[];
|
|
104
|
-
};
|
|
60
|
+
idempotency_key: string;
|
|
105
61
|
source_id: string;
|
|
106
62
|
destination_org_id: string;
|
|
107
63
|
definition_version: number;
|
|
108
|
-
idempotency_key: string;
|
|
109
64
|
processing_policy: {
|
|
110
65
|
partial_policy: "NONE" | "INDEPENDENT_OBJECTS";
|
|
111
66
|
};
|
|
112
|
-
definition_code: "FGL_COA_VALUES" | "FGL_COA_COMBINATIONS" | "SFA_LEADS" | "FND_DAILY_RATES";
|
|
67
|
+
definition_code: "FGL_COA_VALUES" | "FGL_COA_COMBINATIONS" | "SFA_LEADS" | "FND_DAILY_RATES" | "GPM_ITEMS" | "PCM_PRICE_LIST_LINES";
|
|
68
|
+
context?: any;
|
|
113
69
|
}, {
|
|
114
|
-
|
|
115
|
-
structure_id: string;
|
|
116
|
-
upsert_mode: "CREATE_ONLY" | "REPLACE";
|
|
117
|
-
} | {
|
|
118
|
-
org_id: string;
|
|
119
|
-
} | {
|
|
120
|
-
upsert_mode: "CREATE_ONLY" | "REPLACE";
|
|
121
|
-
rate_type: string;
|
|
122
|
-
date_from: string;
|
|
123
|
-
date_to: string;
|
|
124
|
-
currencies: string[];
|
|
125
|
-
};
|
|
70
|
+
idempotency_key: string;
|
|
126
71
|
source_id: string;
|
|
127
72
|
destination_org_id: string;
|
|
128
|
-
idempotency_key: string;
|
|
129
73
|
processing_policy: {
|
|
130
74
|
partial_policy: "NONE" | "INDEPENDENT_OBJECTS";
|
|
131
75
|
};
|
|
132
|
-
definition_code: "FGL_COA_VALUES" | "FGL_COA_COMBINATIONS" | "SFA_LEADS" | "FND_DAILY_RATES";
|
|
76
|
+
definition_code: "FGL_COA_VALUES" | "FGL_COA_COMBINATIONS" | "SFA_LEADS" | "FND_DAILY_RATES" | "GPM_ITEMS" | "PCM_PRICE_LIST_LINES";
|
|
77
|
+
context?: any;
|
|
133
78
|
definition_version?: number | undefined;
|
|
134
79
|
}>, {
|
|
135
|
-
|
|
136
|
-
structure_id: string;
|
|
137
|
-
upsert_mode: "CREATE_ONLY" | "REPLACE";
|
|
138
|
-
} | {
|
|
139
|
-
org_id: string;
|
|
140
|
-
} | {
|
|
141
|
-
upsert_mode: "CREATE_ONLY" | "REPLACE";
|
|
142
|
-
rate_type: string;
|
|
143
|
-
date_from: string;
|
|
144
|
-
date_to: string;
|
|
145
|
-
currencies: string[];
|
|
146
|
-
};
|
|
80
|
+
idempotency_key: string;
|
|
147
81
|
source_id: string;
|
|
148
82
|
destination_org_id: string;
|
|
149
83
|
definition_version: number;
|
|
150
|
-
idempotency_key: string;
|
|
151
84
|
processing_policy: {
|
|
152
85
|
partial_policy: "NONE" | "INDEPENDENT_OBJECTS";
|
|
153
86
|
};
|
|
154
|
-
definition_code: "FGL_COA_VALUES" | "FGL_COA_COMBINATIONS" | "SFA_LEADS" | "FND_DAILY_RATES";
|
|
87
|
+
definition_code: "FGL_COA_VALUES" | "FGL_COA_COMBINATIONS" | "SFA_LEADS" | "FND_DAILY_RATES" | "GPM_ITEMS" | "PCM_PRICE_LIST_LINES";
|
|
88
|
+
context?: any;
|
|
155
89
|
}, {
|
|
156
|
-
|
|
157
|
-
structure_id: string;
|
|
158
|
-
upsert_mode: "CREATE_ONLY" | "REPLACE";
|
|
159
|
-
} | {
|
|
160
|
-
org_id: string;
|
|
161
|
-
} | {
|
|
162
|
-
upsert_mode: "CREATE_ONLY" | "REPLACE";
|
|
163
|
-
rate_type: string;
|
|
164
|
-
date_from: string;
|
|
165
|
-
date_to: string;
|
|
166
|
-
currencies: string[];
|
|
167
|
-
};
|
|
90
|
+
idempotency_key: string;
|
|
168
91
|
source_id: string;
|
|
169
92
|
destination_org_id: string;
|
|
170
|
-
idempotency_key: string;
|
|
171
93
|
processing_policy: {
|
|
172
94
|
partial_policy: "NONE" | "INDEPENDENT_OBJECTS";
|
|
173
95
|
};
|
|
174
|
-
definition_code: "FGL_COA_VALUES" | "FGL_COA_COMBINATIONS" | "SFA_LEADS" | "FND_DAILY_RATES";
|
|
96
|
+
definition_code: "FGL_COA_VALUES" | "FGL_COA_COMBINATIONS" | "SFA_LEADS" | "FND_DAILY_RATES" | "GPM_ITEMS" | "PCM_PRICE_LIST_LINES";
|
|
97
|
+
context?: any;
|
|
175
98
|
definition_version?: number | undefined;
|
|
176
99
|
}>;
|
|
177
100
|
export declare const importRunCreateTool: Tool;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/imports/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAgBtC,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA+E,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/imports/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAgBtC,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA+E,CAAC;AAY1G,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAY1B,CAAC;AA0CH,eAAO,MAAM,mBAAmB,MAIS,CAAC;AAE1C,eAAO,MAAM,WAAW,EAAE,IAAI,EAsC7B,CAAC"}
|
|
@@ -18,6 +18,8 @@ const contexts = {
|
|
|
18
18
|
FGL_COA_VALUES: coaContext,
|
|
19
19
|
FGL_COA_COMBINATIONS: coaContext,
|
|
20
20
|
SFA_LEADS: z.object({ org_id: id }).strict(),
|
|
21
|
+
GPM_ITEMS: z.object({ org_id: id }).strict(),
|
|
22
|
+
PCM_PRICE_LIST_LINES: z.object({ org_id: id, price_list_version_id: id }).strict(),
|
|
21
23
|
FND_DAILY_RATES: z.object({
|
|
22
24
|
rate_type: z.string().min(1).max(30), date_from: z.string().date(), date_to: z.string().date(),
|
|
23
25
|
currencies: z.array(z.string().regex(/^[A-Z]{3}$/)).min(2).max(200), upsert_mode: upsert,
|
|
@@ -25,8 +27,12 @@ const contexts = {
|
|
|
25
27
|
};
|
|
26
28
|
export const runCreateSchema = z.object({
|
|
27
29
|
...common,
|
|
28
|
-
definition_code: z.enum([
|
|
29
|
-
|
|
30
|
+
definition_code: z.enum([
|
|
31
|
+
'FGL_COA_VALUES', 'FGL_COA_COMBINATIONS', 'SFA_LEADS', 'FND_DAILY_RATES',
|
|
32
|
+
'GPM_ITEMS', 'PCM_PRICE_LIST_LINES',
|
|
33
|
+
]),
|
|
34
|
+
// Any registered context shape; superRefine checks it matches definition_code.
|
|
35
|
+
context: z.union(Object.values(contexts)),
|
|
30
36
|
}).strict().superRefine((input, ctx) => {
|
|
31
37
|
if (!contexts[input.definition_code].safeParse(input.context).success) {
|
|
32
38
|
ctx.addIssue({ code: z.ZodIssueCode.custom, path: ['context'], message: 'Context must match the registered definition' });
|
|
@@ -73,7 +79,9 @@ function endpoint(name, description, schema, route, read = false) {
|
|
|
73
79
|
}
|
|
74
80
|
const runPath = (input) => `/imports/runs/${input.run_id}`;
|
|
75
81
|
const accepted = ' Returns the server receipt and durable identifiers; acceptance is not import completion. Retry identical input with the same idempotency_key; changed input requires a new key.';
|
|
76
|
-
export const importRunCreateTool = endpoint('fnd_import_run_create', 'Create a shared COA (no ledger), lead,
|
|
82
|
+
export const importRunCreateTool = endpoint('fnd_import_run_create', 'Create a shared COA (no ledger), lead, daily-rate, catalogue item (GPM_ITEMS, context {org_id}) or price list line ' +
|
|
83
|
+
'(PCM_PRICE_LIST_LINES, context {org_id, price_list_version_id}) import using an existing authorised source and explicit domain context. ' +
|
|
84
|
+
'Item rows use items_interface_action I (insert), U (update), P (upsert, default) or D (deactivate).' + accepted, runCreateSchema, () => '/imports/runs');
|
|
77
85
|
export const importTools = [
|
|
78
86
|
endpoint('fnd_import_definitions', 'Discover authoritative registered import definitions, fields, context and availability.', z.object({}).strict(), () => '/imports/definitions', true),
|
|
79
87
|
importRunCreateTool,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/imports/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExE,MAAM,EAAE,GAAG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MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;SAC5G,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,EAAE,EAAE,IAAI,CAAC,CAAC;CAClF,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Tool } from '../registry.js';
|
|
2
|
+
import { CatalogueReport } from '../../generated-reads/index.js';
|
|
3
|
+
export declare const pbmGeneratedReadReport: CatalogueReport;
|
|
4
|
+
export declare const pbmGeneratedReadTools: Tool[];
|
|
5
|
+
//# sourceMappingURL=generated-reads.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-reads.d.ts","sourceRoot":"","sources":["../../../src/tools/pbm/generated-reads.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAGL,eAAe,EAChB,MAAM,gCAAgC,CAAC;AA6BxC,eAAO,MAAM,sBAAsB,EAAE,eAIjC,CAAC;AAEL,eAAO,MAAM,qBAAqB,EAAE,IAAI,EAGvC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
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 PBM module (WI-0003507).
|
|
5
|
+
*
|
|
6
|
+
* The schema-driven catalogue (WI-0003500) emits describe/list/get for
|
|
7
|
+
* every PBM resource that declares a read operation and has no side
|
|
8
|
+
* effects. The billing profile / subscription resources are classified
|
|
9
|
+
* `sensitive`; they carry customer billing state (billing cycle,
|
|
10
|
+
* cancellation dates, subscribed price lines) that operators
|
|
11
|
+
* legitimately need to see to answer subscription/billing questions,
|
|
12
|
+
* so we opt them in via `includeSensitive: true`. The credential /
|
|
13
|
+
* secrets guardrail still applies — the redactor drops any column
|
|
14
|
+
* matching credential-shaped patterns — but the sensitive-flag opt-in
|
|
15
|
+
* is what makes the billing surface visible on reads at all.
|
|
16
|
+
*
|
|
17
|
+
* Provider credentials for billing gateways (fxm_payment_processor_*
|
|
18
|
+
* tables) live in a separate FXM module and are excluded from the
|
|
19
|
+
* pinned contract entirely; no read from this module can reach them.
|
|
20
|
+
*
|
|
21
|
+
* Every write on a billing / subscription / entitlement row lives in
|
|
22
|
+
* a dedicated hand-written tool with explicit confirmation and
|
|
23
|
+
* idempotency semantics (see `pbm-subscription-*`,
|
|
24
|
+
* `pbm-*-entitlement-override-*`).
|
|
25
|
+
*/
|
|
26
|
+
const contract = loadPersistResourceContract();
|
|
27
|
+
export const pbmGeneratedReadReport = buildGeneratedReadCatalogueReport(contract, {
|
|
28
|
+
modules: ['pbm'],
|
|
29
|
+
includeSensitive: true,
|
|
30
|
+
});
|
|
31
|
+
export const pbmGeneratedReadTools = buildGeneratedReadCatalogue(contract, { modules: ['pbm'], includeSensitive: true });
|
|
32
|
+
//# sourceMappingURL=generated-reads.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-reads.js","sourceRoot":"","sources":["../../../src/tools/pbm/generated-reads.ts"],"names":[],"mappings":"AACA,OAAO,EACL,2BAA2B,EAC3B,iCAAiC,GAElC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAE3F;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,MAAM,QAAQ,GAAG,2BAA2B,EAAE,CAAC;AAE/C,MAAM,CAAC,MAAM,sBAAsB,GACjC,iCAAiC,CAAC,QAAQ,EAAE;IAC1C,OAAO,EAAE,CAAC,KAAK,CAAC;IAChB,gBAAgB,EAAE,IAAI;CACvB,CAAC,CAAC;AAEL,MAAM,CAAC,MAAM,qBAAqB,GAAW,2BAA2B,CACtE,QAAQ,EACR,EAAE,OAAO,EAAE,CAAC,KAAK,CAAC,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAC7C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/pbm/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAgBtC,eAAO,MAAM,QAAQ,EAAE,IAAI,EAAiD,CAAC;AAE7E,wEAAwE;AACxE,eAAO,MAAM,gBAAgB,EAAE,IAAI,EAA0B,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { pbmGeneratedReadTools } from './generated-reads.js';
|
|
2
|
+
import { pbmSubscriptionCreateTool } from './pbm-subscription-create.js';
|
|
3
|
+
import { pbmSubscriptionCancelTool } from './pbm-subscription-cancel.js';
|
|
4
|
+
import { pbmSubscriptionLineAddTool } from './pbm-subscription-line-add.js';
|
|
5
|
+
import { pbmSubscriptionLineEndTool } from './pbm-subscription-line-end.js';
|
|
6
|
+
import { pbmCustomerEntitlementOverrideSetTool } from './pbm-customer-entitlement-override-set.js';
|
|
7
|
+
const pbmWriteTools = [
|
|
8
|
+
pbmSubscriptionCreateTool,
|
|
9
|
+
pbmSubscriptionCancelTool,
|
|
10
|
+
pbmSubscriptionLineAddTool,
|
|
11
|
+
pbmSubscriptionLineEndTool,
|
|
12
|
+
pbmCustomerEntitlementOverrideSetTool,
|
|
13
|
+
];
|
|
14
|
+
export const pbmTools = [...pbmGeneratedReadTools, ...pbmWriteTools];
|
|
15
|
+
/** Read-only slice used by the `pbm-readonly` selectable sub-domain. */
|
|
16
|
+
export const pbmReadOnlyTools = pbmGeneratedReadTools;
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/pbm/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,qCAAqC,EAAE,MAAM,4CAA4C,CAAC;AAEnG,MAAM,aAAa,GAAW;IAC5B,yBAAyB;IACzB,yBAAyB;IACzB,0BAA0B;IAC1B,0BAA0B;IAC1B,qCAAqC;CACtC,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,26 @@
|
|
|
1
|
+
import { Tool } from '../registry.js';
|
|
2
|
+
/**
|
|
3
|
+
* Entitlement-management semantic tool: create a customer-scoped
|
|
4
|
+
* entitlement override (`pbm_customer_entitlement_overrides`).
|
|
5
|
+
*
|
|
6
|
+
* Overrides bypass the tenant / platform entitlement defaults for a
|
|
7
|
+
* specific customer, so they can quietly expand or contract what the
|
|
8
|
+
* customer sees or can consume — cutting a customer off from a
|
|
9
|
+
* feature, or granting a promo tier ahead of billing. The tool
|
|
10
|
+
* therefore requires:
|
|
11
|
+
*
|
|
12
|
+
* - `confirm: true` to prevent accidental invocation;
|
|
13
|
+
* - a caller-supplied `reason` (this maps to the `reason` column on
|
|
14
|
+
* the row, which the pinned contract marks as REQUIRED).
|
|
15
|
+
*
|
|
16
|
+
* `granted_by` is read-only in the pinned contract — persist assigns
|
|
17
|
+
* it from the authenticated caller. `value` is a JSON object per PBM
|
|
18
|
+
* schema (typically `{ "enabled": true }` or a quota override).
|
|
19
|
+
*
|
|
20
|
+
* Create only, despite the name. The primary key
|
|
21
|
+
* (customer_id, feature_id, tenant_id) allows one override per customer
|
|
22
|
+
* and feature, so a retry, or a call with a new value, fails with a
|
|
23
|
+
* duplicate-key error.
|
|
24
|
+
*/
|
|
25
|
+
export declare const pbmCustomerEntitlementOverrideSetTool: Tool;
|
|
26
|
+
//# sourceMappingURL=pbm-customer-entitlement-override-set.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pbm-customer-entitlement-override-set.d.ts","sourceRoot":"","sources":["../../../src/tools/pbm/pbm-customer-entitlement-override-set.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAUtC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,qCAAqC,EAAE,IA2DnD,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
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
|
+
* Entitlement-management semantic tool: create a customer-scoped
|
|
7
|
+
* entitlement override (`pbm_customer_entitlement_overrides`).
|
|
8
|
+
*
|
|
9
|
+
* Overrides bypass the tenant / platform entitlement defaults for a
|
|
10
|
+
* specific customer, so they can quietly expand or contract what the
|
|
11
|
+
* customer sees or can consume — cutting a customer off from a
|
|
12
|
+
* feature, or granting a promo tier ahead of billing. The tool
|
|
13
|
+
* therefore requires:
|
|
14
|
+
*
|
|
15
|
+
* - `confirm: true` to prevent accidental invocation;
|
|
16
|
+
* - a caller-supplied `reason` (this maps to the `reason` column on
|
|
17
|
+
* the row, which the pinned contract marks as REQUIRED).
|
|
18
|
+
*
|
|
19
|
+
* `granted_by` is read-only in the pinned contract — persist assigns
|
|
20
|
+
* it from the authenticated caller. `value` is a JSON object per PBM
|
|
21
|
+
* schema (typically `{ "enabled": true }` or a quota override).
|
|
22
|
+
*
|
|
23
|
+
* Create only, despite the name. The primary key
|
|
24
|
+
* (customer_id, feature_id, tenant_id) allows one override per customer
|
|
25
|
+
* and feature, so a retry, or a call with a new value, fails with a
|
|
26
|
+
* duplicate-key error.
|
|
27
|
+
*/
|
|
28
|
+
export const pbmCustomerEntitlementOverrideSetTool = {
|
|
29
|
+
name: 'pbm_customer_entitlement_override_set',
|
|
30
|
+
description: 'Create a customer-scoped entitlement override (pbm_customer_entitlement_overrides) ' +
|
|
31
|
+
'that bypasses tenant / platform defaults. Requires confirm=true and a reason ' +
|
|
32
|
+
'(recorded in the row). granted_by is server-assigned. One override per customer and ' +
|
|
33
|
+
'feature: a retry, or a call with a new value, fails with a duplicate-key error.',
|
|
34
|
+
inputSchema: z.object({
|
|
35
|
+
customer_id: z
|
|
36
|
+
.string()
|
|
37
|
+
.min(1)
|
|
38
|
+
.describe('UUID of the far_customers row this override applies to (required)'),
|
|
39
|
+
feature_id: z
|
|
40
|
+
.string()
|
|
41
|
+
.min(1)
|
|
42
|
+
.describe('UUID of the pbm_features row being overridden (required)'),
|
|
43
|
+
value: z
|
|
44
|
+
.record(z.unknown())
|
|
45
|
+
.describe('JSON object describing the override (e.g. {"enabled": true} or a quota override)'),
|
|
46
|
+
reason: reasonSchema.describe('Human-readable justification recorded on the row and audit trail'),
|
|
47
|
+
start_date: z.string().min(1).optional().describe('ISO 8601 override start'),
|
|
48
|
+
end_date: z.string().min(1).optional().describe('ISO 8601 override end'),
|
|
49
|
+
metadata: z.record(z.unknown()).optional(),
|
|
50
|
+
confirm: confirmFlagSchema,
|
|
51
|
+
idempotency_key: unenforcedIdempotencyKeySchema,
|
|
52
|
+
}),
|
|
53
|
+
capabilities: [cap('pbm_customer_entitlement_overrides', 'INSERT')],
|
|
54
|
+
sideEffect: 'state_change',
|
|
55
|
+
confirmation: 'caller_confirms',
|
|
56
|
+
idempotency: 'natural_key',
|
|
57
|
+
handler: async (args, ctx) => {
|
|
58
|
+
const input = args;
|
|
59
|
+
const body = {
|
|
60
|
+
customer_id: input.customer_id,
|
|
61
|
+
feature_id: input.feature_id,
|
|
62
|
+
value: input.value,
|
|
63
|
+
reason: input.reason,
|
|
64
|
+
};
|
|
65
|
+
for (const field of ['start_date', 'end_date', 'metadata']) {
|
|
66
|
+
if (input[field] !== undefined)
|
|
67
|
+
body[field] = input[field];
|
|
68
|
+
}
|
|
69
|
+
try {
|
|
70
|
+
const rows = await ctx.apiClient.post(`${ctx.apiClient.dbBasePath}/pbm_customer_entitlement_overrides?select=*`, body, { headers: writeHeadersWithIdempotency(input.idempotency_key) });
|
|
71
|
+
return successResponse(rows[0]);
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
return errorResponse(API_ERROR, `Failed to set PBM customer entitlement override: ${error.message}`);
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=pbm-customer-entitlement-override-set.js.map
|