pleaxy-mcp 0.1.1 → 0.2.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 +79 -17
- package/dist/api.js +46 -4
- package/dist/auth/credentials.js +7 -0
- package/dist/auth/oauth.js +56 -48
- package/dist/auth/session.js +20 -6
- package/dist/cli.js +20 -12
- package/dist/purchase-order-shape.js +17 -2
- package/dist/purchase-request-shape.js +19 -0
- package/dist/server.js +500 -18
- package/package.json +9 -2
- package/server.json +8 -2
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export const purchaseRequestLineShape = {
|
|
3
3
|
name: z.string().min(1).max(200).describe("What is needed, e.g. 27-inch monitor."),
|
|
4
|
+
lineType: z
|
|
5
|
+
.enum(["goods", "service"])
|
|
6
|
+
.optional()
|
|
7
|
+
.describe("goods (shipped and received) or service (work, hours, milestones). Only if the user said or it is plain from the line."),
|
|
4
8
|
qty: z.number().positive().describe("How many."),
|
|
5
9
|
unit: z.string().max(20).optional().describe("e.g. each, hour, month."),
|
|
6
10
|
unitPrice: z.number().min(0).describe("Roughly what one costs, in the request's currency. Ask the user; never guess a price."),
|
|
@@ -10,6 +14,11 @@ export const purchaseRequestSupplierShape = {
|
|
|
10
14
|
supplierConnectionId: z.string().max(64).optional().describe("Only if the supplier is on the workspace's supplier list and you know its connection id."),
|
|
11
15
|
supplierRegionId: z.string().max(64).optional(),
|
|
12
16
|
};
|
|
17
|
+
export const purchaseRequestAnswerShape = {
|
|
18
|
+
fieldId: z.string().min(1).max(100).describe("The question's id, from list_request_types."),
|
|
19
|
+
textAnswer: z.string().max(5000).optional().describe("text, long_text, number (e.g. 1250.5) and date (YYYY-MM-DD) questions."),
|
|
20
|
+
selectedOptionIds: z.array(z.string()).optional().describe('Choice questions: option ids ("yes"/"no" for yes/no questions).'),
|
|
21
|
+
};
|
|
13
22
|
export const createPurchaseRequestShape = {
|
|
14
23
|
title: z.string().min(1).max(200).describe("What is needed, in a few words."),
|
|
15
24
|
description: z.string().max(4000).optional().describe("Why it is needed: the business reason, in the user's words. Required to submit."),
|
|
@@ -28,6 +37,16 @@ export const createPurchaseRequestShape = {
|
|
|
28
37
|
.optional()
|
|
29
38
|
.describe("When it's needed, YYYY-MM-DD."),
|
|
30
39
|
notes: z.string().max(2000).optional().describe("Anything procurement should know."),
|
|
40
|
+
requestTypeId: z
|
|
41
|
+
.string()
|
|
42
|
+
.max(16)
|
|
43
|
+
.optional()
|
|
44
|
+
.describe("The request type (rt_...) from list_request_types that fits what is needed. Required when the workspace has request types."),
|
|
45
|
+
answers: z
|
|
46
|
+
.array(z.object(purchaseRequestAnswerShape))
|
|
47
|
+
.max(100)
|
|
48
|
+
.optional()
|
|
49
|
+
.describe("Answers to the type's questions. Ask a follow-up (showIf) only after the answer it depends on. Submitting needs every required question that is asked."),
|
|
31
50
|
submit: z.boolean().optional().describe("true sends it for approval at once; otherwise it's saved as a draft the user can submit."),
|
|
32
51
|
};
|
|
33
52
|
export const convertPurchaseRequestShape = {
|