@greensecurity/javascript-sdk 0.18.0 → 0.19.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 +6 -0
- package/bin/mcp-server.js +522 -58
- package/bin/mcp-server.js.map +38 -30
- package/funcs/supportArticlesListOrSearchSupportArticles.js +2 -0
- package/funcs/supportArticlesListOrSearchSupportArticles.js.map +1 -1
- package/funcs/vendorsGetVendorInvoiceDetails.d.ts +23 -0
- package/funcs/vendorsGetVendorInvoiceDetails.d.ts.map +1 -0
- package/funcs/vendorsGetVendorInvoiceDetails.js +130 -0
- package/funcs/vendorsGetVendorInvoiceDetails.js.map +1 -0
- package/funcs/vendorsListVendorFacilityStatuses.d.ts +20 -0
- package/funcs/vendorsListVendorFacilityStatuses.d.ts.map +1 -0
- package/funcs/vendorsListVendorFacilityStatuses.js +154 -0
- package/funcs/vendorsListVendorFacilityStatuses.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/lib/sdks.d.ts.map +1 -1
- package/lib/sdks.js +2 -8
- package/lib/sdks.js.map +1 -1
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.d.ts.map +1 -1
- package/mcp-server/server.js +5 -1
- package/mcp-server/server.js.map +1 -1
- package/mcp-server/tools/organizationsGetFacility.js +1 -1
- package/mcp-server/tools/organizationsListOrSearchFacilities.js +1 -1
- package/mcp-server/tools/supportArticlesGetSupportArticle.js +1 -1
- package/mcp-server/tools/supportArticlesListOrSearchSupportArticles.js +1 -1
- package/mcp-server/tools/usersGetCurrentUser.js +1 -1
- package/mcp-server/tools/usersGetUserById.js +1 -1
- package/mcp-server/tools/usersLogsUserIntoTheSystem.js +1 -1
- package/mcp-server/tools/usersMagiclink.js +1 -1
- package/mcp-server/tools/usersPassword.js +1 -1
- package/mcp-server/tools/usersPasswordResetRequest.js +1 -1
- package/mcp-server/tools/vendorsCreateVendorRegistration.js +1 -1
- package/mcp-server/tools/vendorsExpediteTimeRemaining.js +1 -1
- package/mcp-server/tools/vendorsGetVendorInvoiceDetails.d.ts +8 -0
- package/mcp-server/tools/vendorsGetVendorInvoiceDetails.d.ts.map +1 -0
- package/mcp-server/tools/vendorsGetVendorInvoiceDetails.js +69 -0
- package/mcp-server/tools/vendorsGetVendorInvoiceDetails.js.map +1 -0
- package/mcp-server/tools/vendorsListVendorCredentials.js +1 -1
- package/mcp-server/tools/vendorsListVendorFacilityStatuses.d.ts +8 -0
- package/mcp-server/tools/vendorsListVendorFacilityStatuses.d.ts.map +1 -0
- package/mcp-server/tools/vendorsListVendorFacilityStatuses.js +64 -0
- package/mcp-server/tools/vendorsListVendorFacilityStatuses.js.map +1 -0
- package/mcp-server/tools/vendorsListVendorInvoices.js +1 -1
- package/mcp-server/tools/vendorsListVendorJobTitles.js +1 -1
- package/mcp-server/tools.d.ts.map +1 -1
- package/mcp-server/tools.js +3 -0
- package/mcp-server/tools.js.map +1 -1
- package/models/components/expand.d.ts +3 -0
- package/models/components/expand.d.ts.map +1 -1
- package/models/components/expand.js +1 -0
- package/models/components/expand.js.map +1 -1
- package/models/components/index.d.ts +2 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +2 -0
- package/models/components/index.js.map +1 -1
- package/models/components/invoice.d.ts +13 -2
- package/models/components/invoice.d.ts.map +1 -1
- package/models/components/invoice.js +19 -2
- package/models/components/invoice.js.map +1 -1
- package/models/components/invoiceitem.d.ts +8 -0
- package/models/components/invoiceitem.d.ts.map +1 -1
- package/models/components/invoiceitem.js +12 -0
- package/models/components/invoiceitem.js.map +1 -1
- package/models/components/invoicetransaction.d.ts +44 -0
- package/models/components/invoicetransaction.d.ts.map +1 -0
- package/models/components/invoicetransaction.js +96 -0
- package/models/components/invoicetransaction.js.map +1 -0
- package/models/components/vendorfacilitystatusview.d.ts +42 -0
- package/models/components/vendorfacilitystatusview.d.ts.map +1 -0
- package/models/components/vendorfacilitystatusview.js +98 -0
- package/models/components/vendorfacilitystatusview.js.map +1 -0
- package/models/operations/getvendorinvoicedetails.d.ts +38 -0
- package/models/operations/getvendorinvoicedetails.d.ts.map +1 -0
- package/models/operations/getvendorinvoicedetails.js +72 -0
- package/models/operations/getvendorinvoicedetails.js.map +1 -0
- package/models/operations/index.d.ts +2 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +2 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/listorsearchsupportarticles.d.ts +10 -0
- package/models/operations/listorsearchsupportarticles.d.ts.map +1 -1
- package/models/operations/listorsearchsupportarticles.js +4 -0
- package/models/operations/listorsearchsupportarticles.js.map +1 -1
- package/models/operations/listvendorfacilitystatuses.d.ts +106 -0
- package/models/operations/listvendorfacilitystatuses.d.ts.map +1 -0
- package/models/operations/listvendorfacilitystatuses.js +149 -0
- package/models/operations/listvendorfacilitystatuses.js.map +1 -0
- package/package.json +1 -1
- package/react-query/index.d.ts +2 -0
- package/react-query/index.d.ts.map +1 -1
- package/react-query/index.js +2 -0
- package/react-query/index.js.map +1 -1
- package/react-query/supportArticlesListOrSearchSupportArticles.d.ts +6 -0
- package/react-query/supportArticlesListOrSearchSupportArticles.d.ts.map +1 -1
- package/react-query/supportArticlesListOrSearchSupportArticles.js +4 -0
- package/react-query/supportArticlesListOrSearchSupportArticles.js.map +1 -1
- package/react-query/vendorsGetVendorInvoiceDetails.d.ts +53 -0
- package/react-query/vendorsGetVendorInvoiceDetails.d.ts.map +1 -0
- package/react-query/vendorsGetVendorInvoiceDetails.js +109 -0
- package/react-query/vendorsGetVendorInvoiceDetails.js.map +1 -0
- package/react-query/vendorsListVendorFacilityStatuses.d.ts +75 -0
- package/react-query/vendorsListVendorFacilityStatuses.d.ts.map +1 -0
- package/react-query/vendorsListVendorFacilityStatuses.js +159 -0
- package/react-query/vendorsListVendorFacilityStatuses.js.map +1 -0
- package/sdk/vendors.d.ts +22 -0
- package/sdk/vendors.d.ts.map +1 -1
- package/sdk/vendors.js +25 -0
- package/sdk/vendors.js.map +1 -1
- package/src/__tests__/vendors.test.ts +58 -0
- package/src/funcs/supportArticlesListOrSearchSupportArticles.ts +2 -0
- package/src/funcs/vendorsGetVendorInvoiceDetails.ts +180 -0
- package/src/funcs/vendorsListVendorFacilityStatuses.ts +240 -0
- package/src/lib/config.ts +3 -3
- package/src/lib/sdks.ts +2 -7
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +5 -1
- package/src/mcp-server/tools/organizationsGetFacility.ts +1 -1
- package/src/mcp-server/tools/organizationsListOrSearchFacilities.ts +1 -1
- package/src/mcp-server/tools/supportArticlesGetSupportArticle.ts +1 -1
- package/src/mcp-server/tools/supportArticlesListOrSearchSupportArticles.ts +1 -1
- package/src/mcp-server/tools/usersGetCurrentUser.ts +1 -1
- package/src/mcp-server/tools/usersGetUserById.ts +1 -1
- package/src/mcp-server/tools/usersLogsUserIntoTheSystem.ts +1 -1
- package/src/mcp-server/tools/usersMagiclink.ts +1 -1
- package/src/mcp-server/tools/usersPassword.ts +1 -1
- package/src/mcp-server/tools/usersPasswordResetRequest.ts +1 -1
- package/src/mcp-server/tools/vendorsCreateVendorRegistration.ts +1 -1
- package/src/mcp-server/tools/vendorsExpediteTimeRemaining.ts +1 -1
- package/src/mcp-server/tools/vendorsGetVendorInvoiceDetails.ts +43 -0
- package/src/mcp-server/tools/vendorsListVendorCredentials.ts +1 -1
- package/src/mcp-server/tools/vendorsListVendorFacilityStatuses.ts +39 -0
- package/src/mcp-server/tools/vendorsListVendorInvoices.ts +1 -1
- package/src/mcp-server/tools/vendorsListVendorJobTitles.ts +1 -1
- package/src/mcp-server/tools.ts +4 -0
- package/src/models/components/expand.ts +1 -0
- package/src/models/components/index.ts +2 -0
- package/src/models/components/invoice.ts +36 -4
- package/src/models/components/invoiceitem.ts +20 -0
- package/src/models/components/invoicetransaction.ts +108 -0
- package/src/models/components/vendorfacilitystatusview.ts +108 -0
- package/src/models/operations/getvendorinvoicedetails.ts +79 -0
- package/src/models/operations/index.ts +2 -0
- package/src/models/operations/listorsearchsupportarticles.ts +14 -0
- package/src/models/operations/listvendorfacilitystatuses.ts +247 -0
- package/src/react-query/index.ts +2 -0
- package/src/react-query/supportArticlesListOrSearchSupportArticles.ts +10 -0
- package/src/react-query/vendorsGetVendorInvoiceDetails.ts +187 -0
- package/src/react-query/vendorsListVendorFacilityStatuses.ts +342 -0
- package/src/sdk/vendors.ts +47 -0
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { GreenSecurityCore } from "../core.js";
|
|
6
|
+
import { dlv } from "../lib/dlv.js";
|
|
7
|
+
import { encodeFormQuery } from "../lib/encodings.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import { APIError } from "../models/errors/apierror.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../models/errors/httpclienterrors.js";
|
|
22
|
+
import * as errors from "../models/errors/index.js";
|
|
23
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
|
+
import * as operations from "../models/operations/index.js";
|
|
25
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
26
|
+
import { Result } from "../types/fp.js";
|
|
27
|
+
import {
|
|
28
|
+
createPageIterator,
|
|
29
|
+
haltIterator,
|
|
30
|
+
PageIterator,
|
|
31
|
+
Paginator,
|
|
32
|
+
} from "../types/operations.js";
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* List vendor facility statuses
|
|
36
|
+
*
|
|
37
|
+
* @remarks
|
|
38
|
+
* List the facilities for the vendor
|
|
39
|
+
*/
|
|
40
|
+
export function vendorsListVendorFacilityStatuses(
|
|
41
|
+
client: GreenSecurityCore,
|
|
42
|
+
request: operations.ListVendorFacilityStatusesRequest,
|
|
43
|
+
options?: RequestOptions,
|
|
44
|
+
): APIPromise<
|
|
45
|
+
PageIterator<
|
|
46
|
+
Result<
|
|
47
|
+
operations.ListVendorFacilityStatusesResponse,
|
|
48
|
+
| errors.ApiErrorResponse
|
|
49
|
+
| APIError
|
|
50
|
+
| SDKValidationError
|
|
51
|
+
| UnexpectedClientError
|
|
52
|
+
| InvalidRequestError
|
|
53
|
+
| RequestAbortedError
|
|
54
|
+
| RequestTimeoutError
|
|
55
|
+
| ConnectionError
|
|
56
|
+
>,
|
|
57
|
+
{ page: number }
|
|
58
|
+
>
|
|
59
|
+
> {
|
|
60
|
+
return new APIPromise($do(
|
|
61
|
+
client,
|
|
62
|
+
request,
|
|
63
|
+
options,
|
|
64
|
+
));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
async function $do(
|
|
68
|
+
client: GreenSecurityCore,
|
|
69
|
+
request: operations.ListVendorFacilityStatusesRequest,
|
|
70
|
+
options?: RequestOptions,
|
|
71
|
+
): Promise<
|
|
72
|
+
[
|
|
73
|
+
PageIterator<
|
|
74
|
+
Result<
|
|
75
|
+
operations.ListVendorFacilityStatusesResponse,
|
|
76
|
+
| errors.ApiErrorResponse
|
|
77
|
+
| APIError
|
|
78
|
+
| SDKValidationError
|
|
79
|
+
| UnexpectedClientError
|
|
80
|
+
| InvalidRequestError
|
|
81
|
+
| RequestAbortedError
|
|
82
|
+
| RequestTimeoutError
|
|
83
|
+
| ConnectionError
|
|
84
|
+
>,
|
|
85
|
+
{ page: number }
|
|
86
|
+
>,
|
|
87
|
+
APICall,
|
|
88
|
+
]
|
|
89
|
+
> {
|
|
90
|
+
const parsed = safeParse(
|
|
91
|
+
request,
|
|
92
|
+
(value) =>
|
|
93
|
+
operations.ListVendorFacilityStatusesRequest$outboundSchema.parse(value),
|
|
94
|
+
"Input validation failed",
|
|
95
|
+
);
|
|
96
|
+
if (!parsed.ok) {
|
|
97
|
+
return [haltIterator(parsed), { status: "invalid" }];
|
|
98
|
+
}
|
|
99
|
+
const payload = parsed.value;
|
|
100
|
+
const body = null;
|
|
101
|
+
|
|
102
|
+
const path = pathToFunc("/vendors/facility_statuses")();
|
|
103
|
+
|
|
104
|
+
const query = encodeFormQuery({
|
|
105
|
+
"desc": payload.desc,
|
|
106
|
+
"items_per_page": payload.items_per_page,
|
|
107
|
+
"page": payload.page,
|
|
108
|
+
"sort": payload.sort,
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
const headers = new Headers(compactMap({
|
|
112
|
+
Accept: "application/json",
|
|
113
|
+
}));
|
|
114
|
+
|
|
115
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
116
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
117
|
+
|
|
118
|
+
const context = {
|
|
119
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
120
|
+
operationID: "listVendorFacilityStatuses",
|
|
121
|
+
oAuth2Scopes: [],
|
|
122
|
+
|
|
123
|
+
resolvedSecurity: requestSecurity,
|
|
124
|
+
|
|
125
|
+
securitySource: client._options.security,
|
|
126
|
+
retryConfig: options?.retries
|
|
127
|
+
|| client._options.retryConfig
|
|
128
|
+
|| { strategy: "none" },
|
|
129
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
const requestRes = client._createRequest(context, {
|
|
133
|
+
security: requestSecurity,
|
|
134
|
+
method: "GET",
|
|
135
|
+
baseURL: options?.serverURL,
|
|
136
|
+
path: path,
|
|
137
|
+
headers: headers,
|
|
138
|
+
query: query,
|
|
139
|
+
body: body,
|
|
140
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
141
|
+
}, options);
|
|
142
|
+
if (!requestRes.ok) {
|
|
143
|
+
return [haltIterator(requestRes), { status: "invalid" }];
|
|
144
|
+
}
|
|
145
|
+
const req = requestRes.value;
|
|
146
|
+
|
|
147
|
+
const doResult = await client._do(req, {
|
|
148
|
+
context,
|
|
149
|
+
errorCodes: ["401", "4XX", "5XX"],
|
|
150
|
+
retryConfig: context.retryConfig,
|
|
151
|
+
retryCodes: context.retryCodes,
|
|
152
|
+
});
|
|
153
|
+
if (!doResult.ok) {
|
|
154
|
+
return [haltIterator(doResult), { status: "request-error", request: req }];
|
|
155
|
+
}
|
|
156
|
+
const response = doResult.value;
|
|
157
|
+
|
|
158
|
+
const responseFields = {
|
|
159
|
+
HttpMeta: { Response: response, Request: req },
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
const [result, raw] = await M.match<
|
|
163
|
+
operations.ListVendorFacilityStatusesResponse,
|
|
164
|
+
| errors.ApiErrorResponse
|
|
165
|
+
| APIError
|
|
166
|
+
| SDKValidationError
|
|
167
|
+
| UnexpectedClientError
|
|
168
|
+
| InvalidRequestError
|
|
169
|
+
| RequestAbortedError
|
|
170
|
+
| RequestTimeoutError
|
|
171
|
+
| ConnectionError
|
|
172
|
+
>(
|
|
173
|
+
M.json(200, operations.ListVendorFacilityStatusesResponse$inboundSchema, {
|
|
174
|
+
key: "Result",
|
|
175
|
+
}),
|
|
176
|
+
M.jsonErr(401, errors.ApiErrorResponse$inboundSchema),
|
|
177
|
+
M.fail("4XX"),
|
|
178
|
+
M.fail("5XX"),
|
|
179
|
+
)(response, { extraFields: responseFields });
|
|
180
|
+
if (!result.ok) {
|
|
181
|
+
return [haltIterator(result), {
|
|
182
|
+
status: "complete",
|
|
183
|
+
request: req,
|
|
184
|
+
response,
|
|
185
|
+
}];
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
const nextFunc = (
|
|
189
|
+
responseData: unknown,
|
|
190
|
+
): {
|
|
191
|
+
next: Paginator<
|
|
192
|
+
Result<
|
|
193
|
+
operations.ListVendorFacilityStatusesResponse,
|
|
194
|
+
| errors.ApiErrorResponse
|
|
195
|
+
| APIError
|
|
196
|
+
| SDKValidationError
|
|
197
|
+
| UnexpectedClientError
|
|
198
|
+
| InvalidRequestError
|
|
199
|
+
| RequestAbortedError
|
|
200
|
+
| RequestTimeoutError
|
|
201
|
+
| ConnectionError
|
|
202
|
+
>
|
|
203
|
+
>;
|
|
204
|
+
"~next"?: { page: number };
|
|
205
|
+
} => {
|
|
206
|
+
const page = request?.page ?? 1;
|
|
207
|
+
const nextPage = page + 1;
|
|
208
|
+
|
|
209
|
+
if (!responseData) {
|
|
210
|
+
return { next: () => null };
|
|
211
|
+
}
|
|
212
|
+
const results = dlv(responseData, "items");
|
|
213
|
+
if (!Array.isArray(results) || !results.length) {
|
|
214
|
+
return { next: () => null };
|
|
215
|
+
}
|
|
216
|
+
const limit = request?.itemsPerPage ?? 0;
|
|
217
|
+
if (results.length < limit) {
|
|
218
|
+
return { next: () => null };
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
const nextVal = () =>
|
|
222
|
+
vendorsListVendorFacilityStatuses(
|
|
223
|
+
client,
|
|
224
|
+
{
|
|
225
|
+
...request,
|
|
226
|
+
page: nextPage,
|
|
227
|
+
},
|
|
228
|
+
options,
|
|
229
|
+
);
|
|
230
|
+
|
|
231
|
+
return { next: nextVal, "~next": { page: nextPage } };
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
const page = { ...result, ...nextFunc(raw) };
|
|
235
|
+
return [{ ...page, ...createPageIterator(page, (v) => !v.ok) }, {
|
|
236
|
+
status: "complete",
|
|
237
|
+
request: req,
|
|
238
|
+
response,
|
|
239
|
+
}];
|
|
240
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -72,8 +72,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
72
72
|
export const SDK_METADATA = {
|
|
73
73
|
language: "typescript",
|
|
74
74
|
openapiDocVersion: "0.0.3",
|
|
75
|
-
sdkVersion: "0.
|
|
76
|
-
genVersion: "2.
|
|
75
|
+
sdkVersion: "0.19.0",
|
|
76
|
+
genVersion: "2.548.5",
|
|
77
77
|
userAgent:
|
|
78
|
-
"speakeasy-sdk/typescript 0.
|
|
78
|
+
"speakeasy-sdk/typescript 0.19.0 2.548.5 0.0.3 @greensecurity/javascript-sdk",
|
|
79
79
|
} as const;
|
package/src/lib/sdks.ts
CHANGED
|
@@ -195,14 +195,9 @@ export class ClientSDK {
|
|
|
195
195
|
|
|
196
196
|
if (conf.body instanceof ReadableStream) {
|
|
197
197
|
if (!fetchOptions) {
|
|
198
|
-
fetchOptions = {
|
|
199
|
-
// @ts-expect-error see https://github.com/node-fetch/node-fetch/issues/1769
|
|
200
|
-
duplex: "half",
|
|
201
|
-
};
|
|
202
|
-
} else {
|
|
203
|
-
// @ts-expect-error see https://github.com/node-fetch/node-fetch/issues/1769
|
|
204
|
-
fetchOptions.duplex = "half";
|
|
198
|
+
fetchOptions = {};
|
|
205
199
|
}
|
|
200
|
+
Object.assign(fetchOptions, { duplex: "half" });
|
|
206
201
|
}
|
|
207
202
|
|
|
208
203
|
let input;
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -24,7 +24,9 @@ import { tool$usersPassword } from "./tools/usersPassword.js";
|
|
|
24
24
|
import { tool$usersPasswordResetRequest } from "./tools/usersPasswordResetRequest.js";
|
|
25
25
|
import { tool$vendorsCreateVendorRegistration } from "./tools/vendorsCreateVendorRegistration.js";
|
|
26
26
|
import { tool$vendorsExpediteTimeRemaining } from "./tools/vendorsExpediteTimeRemaining.js";
|
|
27
|
+
import { tool$vendorsGetVendorInvoiceDetails } from "./tools/vendorsGetVendorInvoiceDetails.js";
|
|
27
28
|
import { tool$vendorsListVendorCredentials } from "./tools/vendorsListVendorCredentials.js";
|
|
29
|
+
import { tool$vendorsListVendorFacilityStatuses } from "./tools/vendorsListVendorFacilityStatuses.js";
|
|
28
30
|
import { tool$vendorsListVendorInvoices } from "./tools/vendorsListVendorInvoices.js";
|
|
29
31
|
import { tool$vendorsListVendorJobTitles } from "./tools/vendorsListVendorJobTitles.js";
|
|
30
32
|
|
|
@@ -38,7 +40,7 @@ export function createMCPServer(deps: {
|
|
|
38
40
|
}) {
|
|
39
41
|
const server = new McpServer({
|
|
40
42
|
name: "GreenSecurity",
|
|
41
|
-
version: "0.
|
|
43
|
+
version: "0.19.0",
|
|
42
44
|
});
|
|
43
45
|
|
|
44
46
|
const client = new GreenSecurityCore({
|
|
@@ -72,6 +74,8 @@ export function createMCPServer(deps: {
|
|
|
72
74
|
tool(tool$vendorsListVendorCredentials);
|
|
73
75
|
tool(tool$vendorsExpediteTimeRemaining);
|
|
74
76
|
tool(tool$vendorsListVendorInvoices);
|
|
77
|
+
tool(tool$vendorsGetVendorInvoiceDetails);
|
|
78
|
+
tool(tool$vendorsListVendorFacilityStatuses);
|
|
75
79
|
tool(tool$usersGetCurrentUser);
|
|
76
80
|
tool(tool$usersGetUserById);
|
|
77
81
|
tool(tool$usersLogsUserIntoTheSystem);
|
|
@@ -13,7 +13,7 @@ const args = {
|
|
|
13
13
|
export const tool$organizationsListOrSearchFacilities: ToolDefinition<
|
|
14
14
|
typeof args
|
|
15
15
|
> = {
|
|
16
|
-
name: "
|
|
16
|
+
name: "organizations-list-or-search-facilities",
|
|
17
17
|
description: `List or search facilities
|
|
18
18
|
|
|
19
19
|
List or search facilities.
|
|
@@ -13,7 +13,7 @@ const args = {
|
|
|
13
13
|
export const tool$supportArticlesGetSupportArticle: ToolDefinition<
|
|
14
14
|
typeof args
|
|
15
15
|
> = {
|
|
16
|
-
name: "support-
|
|
16
|
+
name: "support-articles-get-support-article",
|
|
17
17
|
description: `Get support article
|
|
18
18
|
|
|
19
19
|
Retrieve an individual support article.
|
|
@@ -13,7 +13,7 @@ const args = {
|
|
|
13
13
|
export const tool$supportArticlesListOrSearchSupportArticles: ToolDefinition<
|
|
14
14
|
typeof args
|
|
15
15
|
> = {
|
|
16
|
-
name: "support-
|
|
16
|
+
name: "support-articles-list-or-search-support-articles",
|
|
17
17
|
description: `List or search support articles
|
|
18
18
|
|
|
19
19
|
List or search support articles for FAQ.`,
|
|
@@ -6,7 +6,7 @@ import { usersGetCurrentUser } from "../../funcs/usersGetCurrentUser.js";
|
|
|
6
6
|
import { formatResult, ToolDefinition } from "../tools.js";
|
|
7
7
|
|
|
8
8
|
export const tool$usersGetCurrentUser: ToolDefinition = {
|
|
9
|
-
name: "
|
|
9
|
+
name: "users-get-current-user",
|
|
10
10
|
description: `Get current user
|
|
11
11
|
|
|
12
12
|
Returns a user object for the user represented by the authorization token`,
|
|
@@ -11,7 +11,7 @@ const args = {
|
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
export const tool$usersGetUserById: ToolDefinition<typeof args> = {
|
|
14
|
-
name: "
|
|
14
|
+
name: "users-get-user-by-id",
|
|
15
15
|
description: `Get user by id
|
|
16
16
|
|
|
17
17
|
Returns a user object for the user represented by the identifier in the path.`,
|
|
@@ -11,7 +11,7 @@ const args = {
|
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
export const tool$usersLogsUserIntoTheSystem: ToolDefinition<typeof args> = {
|
|
14
|
-
name: "
|
|
14
|
+
name: "users-logs-user-into-the-system",
|
|
15
15
|
description: `Logs user into the system
|
|
16
16
|
|
|
17
17
|
This endpoint allows a user to authenticate themselves and retrieve a permanent token for access.
|
|
@@ -11,7 +11,7 @@ const args = {
|
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
export const tool$usersPassword: ToolDefinition<typeof args> = {
|
|
14
|
-
name: "
|
|
14
|
+
name: "users-password",
|
|
15
15
|
description: `Password reset
|
|
16
16
|
|
|
17
17
|
Resets the a user's password using a password_reset_id that was sent to them via email.
|
|
@@ -11,7 +11,7 @@ const args = {
|
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
export const tool$usersPasswordResetRequest: ToolDefinition<typeof args> = {
|
|
14
|
-
name: "
|
|
14
|
+
name: "users-password-reset-request",
|
|
15
15
|
description: `Password reset request
|
|
16
16
|
|
|
17
17
|
It sends an email with a link for resetting a user's password.`,
|
|
@@ -12,7 +12,7 @@ const args = {
|
|
|
12
12
|
|
|
13
13
|
export const tool$vendorsCreateVendorRegistration: ToolDefinition<typeof args> =
|
|
14
14
|
{
|
|
15
|
-
name: "
|
|
15
|
+
name: "vendors-create-vendor-registration",
|
|
16
16
|
description: `Create vendor registration
|
|
17
17
|
|
|
18
18
|
Create an initial vendor registration. Once successful, the vendor will be able to continue to filling out the rest of their onboarding profile.`,
|
|
@@ -11,7 +11,7 @@ const args = {
|
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
export const tool$vendorsExpediteTimeRemaining: ToolDefinition<typeof args> = {
|
|
14
|
-
name: "
|
|
14
|
+
name: "vendors-expedite-time-remaining",
|
|
15
15
|
description: `Expedite time remaining
|
|
16
16
|
|
|
17
17
|
For vendors who have a paid 24-hour expedite credentials invoice, get the remaining time (in seconds) for which submitted credentials will be expedited.`,
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { vendorsGetVendorInvoiceDetails } from "../../funcs/vendorsGetVendorInvoiceDetails.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.GetVendorInvoiceDetailsRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$vendorsGetVendorInvoiceDetails: ToolDefinition<typeof args> =
|
|
14
|
+
{
|
|
15
|
+
name: "vendors-get-vendor-invoice-details",
|
|
16
|
+
description: `Get vendor invoice details
|
|
17
|
+
|
|
18
|
+
Retrieve an individual vendor invoice detais.
|
|
19
|
+
|
|
20
|
+
Available \`expand\` scopes are:
|
|
21
|
+
|
|
22
|
+
invoice.line_items
|
|
23
|
+
invoice.invoice_transactions`,
|
|
24
|
+
args,
|
|
25
|
+
tool: async (client, args, ctx) => {
|
|
26
|
+
const [result, apiCall] = await vendorsGetVendorInvoiceDetails(
|
|
27
|
+
client,
|
|
28
|
+
args.request,
|
|
29
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
30
|
+
).$inspect();
|
|
31
|
+
|
|
32
|
+
if (!result.ok) {
|
|
33
|
+
return {
|
|
34
|
+
content: [{ type: "text", text: result.error.message }],
|
|
35
|
+
isError: true,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const value = result.value;
|
|
40
|
+
|
|
41
|
+
return formatResult(value, apiCall);
|
|
42
|
+
},
|
|
43
|
+
};
|
|
@@ -11,7 +11,7 @@ const args = {
|
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
export const tool$vendorsListVendorCredentials: ToolDefinition<typeof args> = {
|
|
14
|
-
name: "
|
|
14
|
+
name: "vendors-list-vendor-credentials",
|
|
15
15
|
description: `List Vendor Credentials
|
|
16
16
|
|
|
17
17
|
Lists vendor credentials, required credentials, and company credentials. Utilized in Vendor Dashboard.`,
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { vendorsListVendorFacilityStatuses } from "../../funcs/vendorsListVendorFacilityStatuses.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.ListVendorFacilityStatusesRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$vendorsListVendorFacilityStatuses: ToolDefinition<
|
|
14
|
+
typeof args
|
|
15
|
+
> = {
|
|
16
|
+
name: "vendors-list-vendor-facility-statuses",
|
|
17
|
+
description: `List vendor facility statuses
|
|
18
|
+
|
|
19
|
+
List the facilities for the vendor`,
|
|
20
|
+
args,
|
|
21
|
+
tool: async (client, args, ctx) => {
|
|
22
|
+
const [result, apiCall] = await vendorsListVendorFacilityStatuses(
|
|
23
|
+
client,
|
|
24
|
+
args.request,
|
|
25
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
26
|
+
).$inspect();
|
|
27
|
+
|
|
28
|
+
if (!result.ok) {
|
|
29
|
+
return {
|
|
30
|
+
content: [{ type: "text", text: result.error.message }],
|
|
31
|
+
isError: true,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const value = result.value.result;
|
|
36
|
+
|
|
37
|
+
return formatResult(value, apiCall);
|
|
38
|
+
},
|
|
39
|
+
};
|
|
@@ -11,7 +11,7 @@ const args = {
|
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
export const tool$vendorsListVendorJobTitles: ToolDefinition<typeof args> = {
|
|
14
|
-
name: "
|
|
14
|
+
name: "vendors-list-vendor-job-titles",
|
|
15
15
|
description: `List vendor job titles
|
|
16
16
|
|
|
17
17
|
List valid job titles for Vendors. This can be used during sign up or in a filter.`,
|
package/src/mcp-server/tools.ts
CHANGED
|
@@ -31,6 +31,7 @@ export const Expand = {
|
|
|
31
31
|
SupportArticleNotes: "support_article.notes",
|
|
32
32
|
SupportArticleSupportCategory: "support_article.support_category",
|
|
33
33
|
InvoiceLineItems: "invoice.line_items",
|
|
34
|
+
InvoiceInvoiceTransactions: "invoice.invoice_transactions",
|
|
34
35
|
} as const;
|
|
35
36
|
/**
|
|
36
37
|
* An expansion scope that is valid for the object being requested.
|
|
@@ -14,6 +14,7 @@ export * from "./facilitysummary.js";
|
|
|
14
14
|
export * from "./imageset.js";
|
|
15
15
|
export * from "./invoice.js";
|
|
16
16
|
export * from "./invoiceitem.js";
|
|
17
|
+
export * from "./invoicetransaction.js";
|
|
17
18
|
export * from "./loginemailandpassword.js";
|
|
18
19
|
export * from "./loginrequirementsfromemail.js";
|
|
19
20
|
export * from "./mfarequiredresponse.js";
|
|
@@ -25,6 +26,7 @@ export * from "./supportarticle.js";
|
|
|
25
26
|
export * from "./systemsummary.js";
|
|
26
27
|
export * from "./user.js";
|
|
27
28
|
export * from "./vendorcredentialslim.js";
|
|
29
|
+
export * from "./vendorfacilitystatusview.js";
|
|
28
30
|
export * from "./vendorjobtitle.js";
|
|
29
31
|
export * from "./vendorrequiredcredential.js";
|
|
30
32
|
export * from "./vendortype.js";
|
|
@@ -13,6 +13,12 @@ import {
|
|
|
13
13
|
InvoiceItem$Outbound,
|
|
14
14
|
InvoiceItem$outboundSchema,
|
|
15
15
|
} from "./invoiceitem.js";
|
|
16
|
+
import {
|
|
17
|
+
InvoiceTransaction,
|
|
18
|
+
InvoiceTransaction$inboundSchema,
|
|
19
|
+
InvoiceTransaction$Outbound,
|
|
20
|
+
InvoiceTransaction$outboundSchema,
|
|
21
|
+
} from "./invoicetransaction.js";
|
|
16
22
|
|
|
17
23
|
/**
|
|
18
24
|
* A simplified representation of an Invoice
|
|
@@ -23,7 +29,12 @@ export type Invoice = {
|
|
|
23
29
|
amount?: number | null | undefined;
|
|
24
30
|
status?: string | null | undefined;
|
|
25
31
|
financialStatus?: string | null | undefined;
|
|
26
|
-
|
|
32
|
+
amountNotPaid?: number | null | undefined;
|
|
33
|
+
tax?: number | null | undefined;
|
|
34
|
+
convenienceFee?: number | null | undefined;
|
|
35
|
+
shipping?: number | null | undefined;
|
|
36
|
+
items?: Array<InvoiceItem> | null | undefined;
|
|
37
|
+
transactions?: Array<InvoiceTransaction> | null | undefined;
|
|
27
38
|
};
|
|
28
39
|
|
|
29
40
|
/** @internal */
|
|
@@ -34,11 +45,19 @@ export const Invoice$inboundSchema: z.ZodType<Invoice, z.ZodTypeDef, unknown> =
|
|
|
34
45
|
amount: z.nullable(z.number().int()).optional(),
|
|
35
46
|
status: z.nullable(z.string()).optional(),
|
|
36
47
|
financial_status: z.nullable(z.string()).optional(),
|
|
37
|
-
|
|
48
|
+
amount_not_paid: z.nullable(z.number().int()).optional(),
|
|
49
|
+
tax: z.nullable(z.number().int()).optional(),
|
|
50
|
+
convenience_fee: z.nullable(z.number()).optional(),
|
|
51
|
+
shipping: z.nullable(z.number().int()).optional(),
|
|
52
|
+
items: z.nullable(z.array(InvoiceItem$inboundSchema)).optional(),
|
|
53
|
+
transactions: z.nullable(z.array(InvoiceTransaction$inboundSchema))
|
|
54
|
+
.optional(),
|
|
38
55
|
}).transform((v) => {
|
|
39
56
|
return remap$(v, {
|
|
40
57
|
"invoice_number": "invoiceNumber",
|
|
41
58
|
"financial_status": "financialStatus",
|
|
59
|
+
"amount_not_paid": "amountNotPaid",
|
|
60
|
+
"convenience_fee": "convenienceFee",
|
|
42
61
|
});
|
|
43
62
|
});
|
|
44
63
|
|
|
@@ -49,7 +68,12 @@ export type Invoice$Outbound = {
|
|
|
49
68
|
amount?: number | null | undefined;
|
|
50
69
|
status?: string | null | undefined;
|
|
51
70
|
financial_status?: string | null | undefined;
|
|
52
|
-
|
|
71
|
+
amount_not_paid?: number | null | undefined;
|
|
72
|
+
tax?: number | null | undefined;
|
|
73
|
+
convenience_fee?: number | null | undefined;
|
|
74
|
+
shipping?: number | null | undefined;
|
|
75
|
+
items?: Array<InvoiceItem$Outbound> | null | undefined;
|
|
76
|
+
transactions?: Array<InvoiceTransaction$Outbound> | null | undefined;
|
|
53
77
|
};
|
|
54
78
|
|
|
55
79
|
/** @internal */
|
|
@@ -63,11 +87,19 @@ export const Invoice$outboundSchema: z.ZodType<
|
|
|
63
87
|
amount: z.nullable(z.number().int()).optional(),
|
|
64
88
|
status: z.nullable(z.string()).optional(),
|
|
65
89
|
financialStatus: z.nullable(z.string()).optional(),
|
|
66
|
-
|
|
90
|
+
amountNotPaid: z.nullable(z.number().int()).optional(),
|
|
91
|
+
tax: z.nullable(z.number().int()).optional(),
|
|
92
|
+
convenienceFee: z.nullable(z.number()).optional(),
|
|
93
|
+
shipping: z.nullable(z.number().int()).optional(),
|
|
94
|
+
items: z.nullable(z.array(InvoiceItem$outboundSchema)).optional(),
|
|
95
|
+
transactions: z.nullable(z.array(InvoiceTransaction$outboundSchema))
|
|
96
|
+
.optional(),
|
|
67
97
|
}).transform((v) => {
|
|
68
98
|
return remap$(v, {
|
|
69
99
|
invoiceNumber: "invoice_number",
|
|
70
100
|
financialStatus: "financial_status",
|
|
101
|
+
amountNotPaid: "amount_not_paid",
|
|
102
|
+
convenienceFee: "convenience_fee",
|
|
71
103
|
});
|
|
72
104
|
});
|
|
73
105
|
|