@raytio/mcp-server 10.3.0 → 10.4.1
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/dist/authorization.d.ts.map +1 -1
- package/dist/authorization.js +2 -0
- package/dist/authorization.js.map +1 -1
- package/dist/contracts/tool-binding-manifest.d.ts +986 -0
- package/dist/contracts/tool-binding-manifest.d.ts.map +1 -0
- package/dist/contracts/tool-binding-manifest.js +242 -0
- package/dist/contracts/tool-binding-manifest.js.map +1 -0
- 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/domains.d.ts.map +1 -1
- package/dist/tools/domains.js +21 -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 +10 -87
- 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/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/ppm/template-slot-create.d.ts.map +1 -1
- package/dist/tools/ppm/template-slot-create.js +4 -2
- package/dist/tools/ppm/template-slot-create.js.map +1 -1
- package/dist/tools/ppm/work-item-create.d.ts.map +1 -1
- package/dist/tools/ppm/work-item-create.js +4 -2
- package/dist/tools/ppm/work-item-create.js.map +1 -1
- package/dist/tools/role-mapping.d.ts.map +1 -1
- package/dist/tools/role-mapping.js +7 -1
- 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":"gp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,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"}
|
|
@@ -43,41 +43,8 @@ export declare const leadRunSchema: z.ZodObject<{
|
|
|
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>;
|
|
@@ -91,87 +58,43 @@ export declare const runCreateSchema: z.ZodEffects<z.ZodObject<{
|
|
|
91
58
|
}>;
|
|
92
59
|
}, "strict", z.ZodTypeAny, {
|
|
93
60
|
idempotency_key: string;
|
|
94
|
-
context: {
|
|
95
|
-
structure_id: string;
|
|
96
|
-
upsert_mode: "CREATE_ONLY" | "REPLACE";
|
|
97
|
-
} | {
|
|
98
|
-
org_id: string;
|
|
99
|
-
} | {
|
|
100
|
-
upsert_mode: "CREATE_ONLY" | "REPLACE";
|
|
101
|
-
rate_type: string;
|
|
102
|
-
date_from: string;
|
|
103
|
-
date_to: string;
|
|
104
|
-
currencies: string[];
|
|
105
|
-
};
|
|
106
61
|
source_id: string;
|
|
107
62
|
destination_org_id: string;
|
|
108
63
|
definition_version: number;
|
|
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
70
|
idempotency_key: string;
|
|
115
|
-
context: {
|
|
116
|
-
structure_id: string;
|
|
117
|
-
upsert_mode: "CREATE_ONLY" | "REPLACE";
|
|
118
|
-
} | {
|
|
119
|
-
org_id: string;
|
|
120
|
-
} | {
|
|
121
|
-
upsert_mode: "CREATE_ONLY" | "REPLACE";
|
|
122
|
-
rate_type: string;
|
|
123
|
-
date_from: string;
|
|
124
|
-
date_to: string;
|
|
125
|
-
currencies: string[];
|
|
126
|
-
};
|
|
127
71
|
source_id: string;
|
|
128
72
|
destination_org_id: 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
80
|
idempotency_key: string;
|
|
136
|
-
context: {
|
|
137
|
-
structure_id: string;
|
|
138
|
-
upsert_mode: "CREATE_ONLY" | "REPLACE";
|
|
139
|
-
} | {
|
|
140
|
-
org_id: string;
|
|
141
|
-
} | {
|
|
142
|
-
upsert_mode: "CREATE_ONLY" | "REPLACE";
|
|
143
|
-
rate_type: string;
|
|
144
|
-
date_from: string;
|
|
145
|
-
date_to: string;
|
|
146
|
-
currencies: string[];
|
|
147
|
-
};
|
|
148
81
|
source_id: string;
|
|
149
82
|
destination_org_id: string;
|
|
150
83
|
definition_version: number;
|
|
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
90
|
idempotency_key: string;
|
|
157
|
-
context: {
|
|
158
|
-
structure_id: string;
|
|
159
|
-
upsert_mode: "CREATE_ONLY" | "REPLACE";
|
|
160
|
-
} | {
|
|
161
|
-
org_id: string;
|
|
162
|
-
} | {
|
|
163
|
-
upsert_mode: "CREATE_ONLY" | "REPLACE";
|
|
164
|
-
rate_type: string;
|
|
165
|
-
date_from: string;
|
|
166
|
-
date_to: string;
|
|
167
|
-
currencies: string[];
|
|
168
|
-
};
|
|
169
91
|
source_id: string;
|
|
170
92
|
destination_org_id: 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,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC;AAC7B,MAAM,GAAG,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACvC,MAAM,OAAO,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACxC,MAAM,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC,CAAC;AACxD,MAAM,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC,CAAC;AAClD,MAAM,MAAM,GAAG;IACb,SAAS,EAAE,EAAE,CAAC,QAAQ,CAAC,gFAAgF,CAAC;IACxG,kBAAkB,EAAE,EAAE;IACtB,kBAAkB,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;IACtC,eAAe,EAAE,GAAG;IACpB,iBAAiB,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,cAAc,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;CAClE,CAAC;AACF,MAAM,UAAU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,IAAI,CAAC,EAAE,CAAC,QAAQ,CAC1E,cAAc,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,GAAG,OAAO,EAAE,EAC3D,0BAA0B,IAAI,mIAAmI,EACjK,CAAC,CAAC,MAAM,CAAC,EAAE,GAAG,GAAG,EAAE,GAAG,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YAC3C,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,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 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"}
|