@greensecurity/javascript-sdk 0.37.12 → 0.38.2
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 +858 -436
- package/bin/mcp-server.js.map +18 -10
- package/dist/commonjs/__tests__/organizations.test.js +42 -0
- package/dist/commonjs/__tests__/organizations.test.js.map +1 -1
- package/dist/commonjs/__tests__/vendors.test.js +16 -0
- package/dist/commonjs/__tests__/vendors.test.js.map +1 -1
- package/dist/commonjs/__tests__/zones.test.js +4 -19
- package/dist/commonjs/__tests__/zones.test.js.map +1 -1
- package/dist/commonjs/funcs/organizationsListOrSearchDepartmentContacts.d.ts +26 -0
- package/dist/commonjs/funcs/organizationsListOrSearchDepartmentContacts.d.ts.map +1 -0
- package/dist/commonjs/funcs/organizationsListOrSearchDepartmentContacts.js +168 -0
- package/dist/commonjs/funcs/organizationsListOrSearchDepartmentContacts.js.map +1 -0
- package/dist/commonjs/funcs/vendorsGetVendorInvoiceReceipt.d.ts +18 -0
- package/dist/commonjs/funcs/vendorsGetVendorInvoiceReceipt.d.ts.map +1 -0
- package/dist/commonjs/funcs/vendorsGetVendorInvoiceReceipt.js +125 -0
- package/dist/commonjs/funcs/vendorsGetVendorInvoiceReceipt.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/lib/config.js.map +1 -1
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/mcp-server.js.map +1 -1
- package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/server.js +5 -1
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/organizationsListOrSearchDepartmentContacts.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/organizationsListOrSearchDepartmentContacts.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/organizationsListOrSearchDepartmentContacts.js +69 -0
- package/dist/commonjs/mcp-server/tools/organizationsListOrSearchDepartmentContacts.js.map +1 -0
- package/dist/commonjs/mcp-server/tools/vendorsGetVendorInvoiceReceipt.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/vendorsGetVendorInvoiceReceipt.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/vendorsGetVendorInvoiceReceipt.js +64 -0
- package/dist/commonjs/mcp-server/tools/vendorsGetVendorInvoiceReceipt.js.map +1 -0
- package/dist/commonjs/models/components/contact.d.ts +30 -4
- package/dist/commonjs/models/components/contact.d.ts.map +1 -1
- package/dist/commonjs/models/components/contact.js +35 -5
- package/dist/commonjs/models/components/contact.js.map +1 -1
- package/dist/commonjs/models/components/departmentmembership.d.ts +80 -0
- package/dist/commonjs/models/components/departmentmembership.d.ts.map +1 -0
- package/dist/commonjs/models/components/departmentmembership.js +123 -0
- package/dist/commonjs/models/components/departmentmembership.js.map +1 -0
- package/dist/commonjs/models/components/expand.d.ts +6 -0
- package/dist/commonjs/models/components/expand.d.ts.map +1 -1
- package/dist/commonjs/models/components/expand.js +2 -0
- package/dist/commonjs/models/components/expand.js.map +1 -1
- package/dist/commonjs/models/components/index.d.ts +2 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +2 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/usersummary.d.ts +34 -0
- package/dist/commonjs/models/components/usersummary.d.ts.map +1 -0
- package/dist/commonjs/models/components/usersummary.js +71 -0
- package/dist/commonjs/models/components/usersummary.js.map +1 -0
- package/dist/commonjs/models/operations/getvendorinvoicereceipt.d.ts +32 -0
- package/dist/commonjs/models/operations/getvendorinvoicereceipt.d.ts.map +1 -0
- package/dist/commonjs/models/operations/getvendorinvoicereceipt.js +69 -0
- package/dist/commonjs/models/operations/getvendorinvoicereceipt.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +2 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +2 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/listorsearchdepartmentcontacts.d.ts +121 -0
- package/dist/commonjs/models/operations/listorsearchdepartmentcontacts.d.ts.map +1 -0
- package/dist/commonjs/models/operations/listorsearchdepartmentcontacts.js +155 -0
- package/dist/commonjs/models/operations/listorsearchdepartmentcontacts.js.map +1 -0
- package/dist/commonjs/react-query/index.d.ts +2 -0
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +2 -0
- package/dist/commonjs/react-query/index.js.map +1 -1
- package/dist/commonjs/react-query/organizationsListOrSearchDepartmentContacts.d.ts +103 -0
- package/dist/commonjs/react-query/organizationsListOrSearchDepartmentContacts.d.ts.map +1 -0
- package/dist/commonjs/react-query/organizationsListOrSearchDepartmentContacts.js +184 -0
- package/dist/commonjs/react-query/organizationsListOrSearchDepartmentContacts.js.map +1 -0
- package/dist/commonjs/react-query/vendorsGetVendorInvoiceReceipt.d.ts +30 -0
- package/dist/commonjs/react-query/vendorsGetVendorInvoiceReceipt.d.ts.map +1 -0
- package/dist/commonjs/react-query/vendorsGetVendorInvoiceReceipt.js +96 -0
- package/dist/commonjs/react-query/vendorsGetVendorInvoiceReceipt.js.map +1 -0
- package/dist/commonjs/sdk/organizations.d.ts +14 -0
- package/dist/commonjs/sdk/organizations.d.ts.map +1 -1
- package/dist/commonjs/sdk/organizations.js +15 -0
- package/dist/commonjs/sdk/organizations.js.map +1 -1
- package/dist/commonjs/sdk/vendors.d.ts +7 -0
- package/dist/commonjs/sdk/vendors.d.ts.map +1 -1
- package/dist/commonjs/sdk/vendors.js +10 -0
- package/dist/commonjs/sdk/vendors.js.map +1 -1
- package/dist/esm/__tests__/organizations.test.js +42 -0
- package/dist/esm/__tests__/organizations.test.js.map +1 -1
- package/dist/esm/__tests__/vendors.test.js +16 -0
- package/dist/esm/__tests__/vendors.test.js.map +1 -1
- package/dist/esm/__tests__/zones.test.js +4 -19
- package/dist/esm/__tests__/zones.test.js.map +1 -1
- package/dist/esm/funcs/organizationsListOrSearchDepartmentContacts.d.ts +26 -0
- package/dist/esm/funcs/organizationsListOrSearchDepartmentContacts.d.ts.map +1 -0
- package/dist/esm/funcs/organizationsListOrSearchDepartmentContacts.js +132 -0
- package/dist/esm/funcs/organizationsListOrSearchDepartmentContacts.js.map +1 -0
- package/dist/esm/funcs/vendorsGetVendorInvoiceReceipt.d.ts +18 -0
- package/dist/esm/funcs/vendorsGetVendorInvoiceReceipt.d.ts.map +1 -0
- package/dist/esm/funcs/vendorsGetVendorInvoiceReceipt.js +89 -0
- package/dist/esm/funcs/vendorsGetVendorInvoiceReceipt.js.map +1 -0
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/lib/config.js.map +1 -1
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/mcp-server.js.map +1 -1
- package/dist/esm/mcp-server/server.d.ts.map +1 -1
- package/dist/esm/mcp-server/server.js +5 -1
- package/dist/esm/mcp-server/server.js.map +1 -1
- package/dist/esm/mcp-server/tools/organizationsListOrSearchDepartmentContacts.d.ts +8 -0
- package/dist/esm/mcp-server/tools/organizationsListOrSearchDepartmentContacts.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/organizationsListOrSearchDepartmentContacts.js +33 -0
- package/dist/esm/mcp-server/tools/organizationsListOrSearchDepartmentContacts.js.map +1 -0
- package/dist/esm/mcp-server/tools/vendorsGetVendorInvoiceReceipt.d.ts +8 -0
- package/dist/esm/mcp-server/tools/vendorsGetVendorInvoiceReceipt.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/vendorsGetVendorInvoiceReceipt.js +28 -0
- package/dist/esm/mcp-server/tools/vendorsGetVendorInvoiceReceipt.js.map +1 -0
- package/dist/esm/models/components/contact.d.ts +30 -4
- package/dist/esm/models/components/contact.d.ts.map +1 -1
- package/dist/esm/models/components/contact.js +32 -4
- package/dist/esm/models/components/contact.js.map +1 -1
- package/dist/esm/models/components/departmentmembership.d.ts +80 -0
- package/dist/esm/models/components/departmentmembership.d.ts.map +1 -0
- package/dist/esm/models/components/departmentmembership.js +81 -0
- package/dist/esm/models/components/departmentmembership.js.map +1 -0
- package/dist/esm/models/components/expand.d.ts +6 -0
- package/dist/esm/models/components/expand.d.ts.map +1 -1
- package/dist/esm/models/components/expand.js +2 -0
- package/dist/esm/models/components/expand.js.map +1 -1
- package/dist/esm/models/components/index.d.ts +2 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +2 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/usersummary.d.ts +34 -0
- package/dist/esm/models/components/usersummary.d.ts.map +1 -0
- package/dist/esm/models/components/usersummary.js +33 -0
- package/dist/esm/models/components/usersummary.js.map +1 -0
- package/dist/esm/models/operations/getvendorinvoicereceipt.d.ts +32 -0
- package/dist/esm/models/operations/getvendorinvoicereceipt.d.ts.map +1 -0
- package/dist/esm/models/operations/getvendorinvoicereceipt.js +31 -0
- package/dist/esm/models/operations/getvendorinvoicereceipt.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +2 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +2 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/listorsearchdepartmentcontacts.d.ts +121 -0
- package/dist/esm/models/operations/listorsearchdepartmentcontacts.d.ts.map +1 -0
- package/dist/esm/models/operations/listorsearchdepartmentcontacts.js +113 -0
- package/dist/esm/models/operations/listorsearchdepartmentcontacts.js.map +1 -0
- package/dist/esm/react-query/index.d.ts +2 -0
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +2 -0
- package/dist/esm/react-query/index.js.map +1 -1
- package/dist/esm/react-query/organizationsListOrSearchDepartmentContacts.d.ts +103 -0
- package/dist/esm/react-query/organizationsListOrSearchDepartmentContacts.d.ts.map +1 -0
- package/dist/esm/react-query/organizationsListOrSearchDepartmentContacts.js +171 -0
- package/dist/esm/react-query/organizationsListOrSearchDepartmentContacts.js.map +1 -0
- package/dist/esm/react-query/vendorsGetVendorInvoiceReceipt.d.ts +30 -0
- package/dist/esm/react-query/vendorsGetVendorInvoiceReceipt.d.ts.map +1 -0
- package/dist/esm/react-query/vendorsGetVendorInvoiceReceipt.js +86 -0
- package/dist/esm/react-query/vendorsGetVendorInvoiceReceipt.js.map +1 -0
- package/dist/esm/sdk/organizations.d.ts +14 -0
- package/dist/esm/sdk/organizations.d.ts.map +1 -1
- package/dist/esm/sdk/organizations.js +15 -0
- package/dist/esm/sdk/organizations.js.map +1 -1
- package/dist/esm/sdk/vendors.d.ts +7 -0
- package/dist/esm/sdk/vendors.d.ts.map +1 -1
- package/dist/esm/sdk/vendors.js +10 -0
- package/dist/esm/sdk/vendors.js.map +1 -1
- package/examples/package-lock.json +1 -1
- package/examples/vendorsCreateVendorRegistration.example.ts +2 -0
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/__tests__/organizations.test.ts +45 -0
- package/src/__tests__/vendors.test.ts +21 -0
- package/src/__tests__/zones.test.ts +4 -19
- package/src/funcs/organizationsListOrSearchDepartmentContacts.ts +270 -0
- package/src/funcs/vendorsGetVendorInvoiceReceipt.ts +179 -0
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +5 -1
- package/src/mcp-server/tools/organizationsListOrSearchDepartmentContacts.ts +44 -0
- package/src/mcp-server/tools/vendorsGetVendorInvoiceReceipt.ts +38 -0
- package/src/models/components/contact.ts +74 -8
- package/src/models/components/departmentmembership.ts +201 -0
- package/src/models/components/expand.ts +2 -0
- package/src/models/components/index.ts +2 -0
- package/src/models/components/usersummary.ts +69 -0
- package/src/models/operations/getvendorinvoicereceipt.ts +71 -0
- package/src/models/operations/index.ts +2 -0
- package/src/models/operations/listorsearchdepartmentcontacts.ts +280 -0
- package/src/react-query/index.ts +2 -0
- package/src/react-query/organizationsListOrSearchDepartmentContacts.ts +386 -0
- package/src/react-query/vendorsGetVendorInvoiceReceipt.ts +167 -0
- package/src/sdk/organizations.ts +28 -0
- package/src/sdk/vendors.ts +18 -0
|
@@ -0,0 +1,270 @@
|
|
|
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, encodeSimple, queryJoin } 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 { GreenSecurityError } from "../models/errors/greensecurityerror.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
import {
|
|
29
|
+
createPageIterator,
|
|
30
|
+
haltIterator,
|
|
31
|
+
PageIterator,
|
|
32
|
+
Paginator,
|
|
33
|
+
} from "../types/operations.js";
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* List or search department contacts
|
|
37
|
+
*
|
|
38
|
+
* @remarks
|
|
39
|
+
* List or search department contacts.
|
|
40
|
+
*
|
|
41
|
+
* Available `expand` scopes are:
|
|
42
|
+
*
|
|
43
|
+
* - department_membership.contact
|
|
44
|
+
* - department_membership.department
|
|
45
|
+
*/
|
|
46
|
+
export function organizationsListOrSearchDepartmentContacts(
|
|
47
|
+
client: GreenSecurityCore,
|
|
48
|
+
request: operations.ListOrSearchDepartmentContactsRequest,
|
|
49
|
+
options?: RequestOptions,
|
|
50
|
+
): APIPromise<
|
|
51
|
+
PageIterator<
|
|
52
|
+
Result<
|
|
53
|
+
operations.ListOrSearchDepartmentContactsResponse,
|
|
54
|
+
| errors.ApiErrorResponse
|
|
55
|
+
| GreenSecurityError
|
|
56
|
+
| ResponseValidationError
|
|
57
|
+
| ConnectionError
|
|
58
|
+
| RequestAbortedError
|
|
59
|
+
| RequestTimeoutError
|
|
60
|
+
| InvalidRequestError
|
|
61
|
+
| UnexpectedClientError
|
|
62
|
+
| SDKValidationError
|
|
63
|
+
>,
|
|
64
|
+
{ page: number }
|
|
65
|
+
>
|
|
66
|
+
> {
|
|
67
|
+
return new APIPromise($do(
|
|
68
|
+
client,
|
|
69
|
+
request,
|
|
70
|
+
options,
|
|
71
|
+
));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
async function $do(
|
|
75
|
+
client: GreenSecurityCore,
|
|
76
|
+
request: operations.ListOrSearchDepartmentContactsRequest,
|
|
77
|
+
options?: RequestOptions,
|
|
78
|
+
): Promise<
|
|
79
|
+
[
|
|
80
|
+
PageIterator<
|
|
81
|
+
Result<
|
|
82
|
+
operations.ListOrSearchDepartmentContactsResponse,
|
|
83
|
+
| errors.ApiErrorResponse
|
|
84
|
+
| GreenSecurityError
|
|
85
|
+
| ResponseValidationError
|
|
86
|
+
| ConnectionError
|
|
87
|
+
| RequestAbortedError
|
|
88
|
+
| RequestTimeoutError
|
|
89
|
+
| InvalidRequestError
|
|
90
|
+
| UnexpectedClientError
|
|
91
|
+
| SDKValidationError
|
|
92
|
+
>,
|
|
93
|
+
{ page: number }
|
|
94
|
+
>,
|
|
95
|
+
APICall,
|
|
96
|
+
]
|
|
97
|
+
> {
|
|
98
|
+
const parsed = safeParse(
|
|
99
|
+
request,
|
|
100
|
+
(value) =>
|
|
101
|
+
operations.ListOrSearchDepartmentContactsRequest$outboundSchema.parse(
|
|
102
|
+
value,
|
|
103
|
+
),
|
|
104
|
+
"Input validation failed",
|
|
105
|
+
);
|
|
106
|
+
if (!parsed.ok) {
|
|
107
|
+
return [haltIterator(parsed), { status: "invalid" }];
|
|
108
|
+
}
|
|
109
|
+
const payload = parsed.value;
|
|
110
|
+
const body = null;
|
|
111
|
+
|
|
112
|
+
const pathParams = {
|
|
113
|
+
id: encodeSimple("id", payload.id, {
|
|
114
|
+
explode: false,
|
|
115
|
+
charEncoding: "percent",
|
|
116
|
+
}),
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
const path = pathToFunc("/departments/{id}/contacts")(pathParams);
|
|
120
|
+
|
|
121
|
+
const query = queryJoin(
|
|
122
|
+
encodeFormQuery({
|
|
123
|
+
"expand": payload.expand,
|
|
124
|
+
}, { explode: false }),
|
|
125
|
+
encodeFormQuery({
|
|
126
|
+
"desc": payload.desc,
|
|
127
|
+
"items_per_page": payload.items_per_page,
|
|
128
|
+
"page": payload.page,
|
|
129
|
+
"search": payload.search,
|
|
130
|
+
"sort": payload.sort,
|
|
131
|
+
}),
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
const headers = new Headers(compactMap({
|
|
135
|
+
Accept: "application/json",
|
|
136
|
+
}));
|
|
137
|
+
|
|
138
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
139
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
140
|
+
|
|
141
|
+
const context = {
|
|
142
|
+
options: client._options,
|
|
143
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
144
|
+
operationID: "listOrSearchDepartmentContacts",
|
|
145
|
+
oAuth2Scopes: [],
|
|
146
|
+
|
|
147
|
+
resolvedSecurity: requestSecurity,
|
|
148
|
+
|
|
149
|
+
securitySource: client._options.security,
|
|
150
|
+
retryConfig: options?.retries
|
|
151
|
+
|| client._options.retryConfig
|
|
152
|
+
|| { strategy: "none" },
|
|
153
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
const requestRes = client._createRequest(context, {
|
|
157
|
+
security: requestSecurity,
|
|
158
|
+
method: "GET",
|
|
159
|
+
baseURL: options?.serverURL,
|
|
160
|
+
path: path,
|
|
161
|
+
headers: headers,
|
|
162
|
+
query: query,
|
|
163
|
+
body: body,
|
|
164
|
+
userAgent: client._options.userAgent,
|
|
165
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
166
|
+
}, options);
|
|
167
|
+
if (!requestRes.ok) {
|
|
168
|
+
return [haltIterator(requestRes), { status: "invalid" }];
|
|
169
|
+
}
|
|
170
|
+
const req = requestRes.value;
|
|
171
|
+
|
|
172
|
+
const doResult = await client._do(req, {
|
|
173
|
+
context,
|
|
174
|
+
errorCodes: ["400", "401", "403", "4XX", "500", "5XX"],
|
|
175
|
+
retryConfig: context.retryConfig,
|
|
176
|
+
retryCodes: context.retryCodes,
|
|
177
|
+
});
|
|
178
|
+
if (!doResult.ok) {
|
|
179
|
+
return [haltIterator(doResult), { status: "request-error", request: req }];
|
|
180
|
+
}
|
|
181
|
+
const response = doResult.value;
|
|
182
|
+
|
|
183
|
+
const responseFields = {
|
|
184
|
+
HttpMeta: { Response: response, Request: req },
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
const [result, raw] = await M.match<
|
|
188
|
+
operations.ListOrSearchDepartmentContactsResponse,
|
|
189
|
+
| errors.ApiErrorResponse
|
|
190
|
+
| GreenSecurityError
|
|
191
|
+
| ResponseValidationError
|
|
192
|
+
| ConnectionError
|
|
193
|
+
| RequestAbortedError
|
|
194
|
+
| RequestTimeoutError
|
|
195
|
+
| InvalidRequestError
|
|
196
|
+
| UnexpectedClientError
|
|
197
|
+
| SDKValidationError
|
|
198
|
+
>(
|
|
199
|
+
M.json(
|
|
200
|
+
200,
|
|
201
|
+
operations.ListOrSearchDepartmentContactsResponse$inboundSchema,
|
|
202
|
+
{ key: "Result" },
|
|
203
|
+
),
|
|
204
|
+
M.jsonErr([400, 401, 403], errors.ApiErrorResponse$inboundSchema),
|
|
205
|
+
M.jsonErr(500, errors.ApiErrorResponse$inboundSchema),
|
|
206
|
+
M.fail("4XX"),
|
|
207
|
+
M.fail("5XX"),
|
|
208
|
+
)(response, req, { extraFields: responseFields });
|
|
209
|
+
if (!result.ok) {
|
|
210
|
+
return [haltIterator(result), {
|
|
211
|
+
status: "complete",
|
|
212
|
+
request: req,
|
|
213
|
+
response,
|
|
214
|
+
}];
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
const nextFunc = (
|
|
218
|
+
responseData: unknown,
|
|
219
|
+
): {
|
|
220
|
+
next: Paginator<
|
|
221
|
+
Result<
|
|
222
|
+
operations.ListOrSearchDepartmentContactsResponse,
|
|
223
|
+
| errors.ApiErrorResponse
|
|
224
|
+
| GreenSecurityError
|
|
225
|
+
| ResponseValidationError
|
|
226
|
+
| ConnectionError
|
|
227
|
+
| RequestAbortedError
|
|
228
|
+
| RequestTimeoutError
|
|
229
|
+
| InvalidRequestError
|
|
230
|
+
| UnexpectedClientError
|
|
231
|
+
| SDKValidationError
|
|
232
|
+
>
|
|
233
|
+
>;
|
|
234
|
+
"~next"?: { page: number };
|
|
235
|
+
} => {
|
|
236
|
+
const page = request?.page ?? 1;
|
|
237
|
+
const nextPage = page + 1;
|
|
238
|
+
|
|
239
|
+
if (!responseData) {
|
|
240
|
+
return { next: () => null };
|
|
241
|
+
}
|
|
242
|
+
const results = dlv(responseData, "items");
|
|
243
|
+
if (!Array.isArray(results) || !results.length) {
|
|
244
|
+
return { next: () => null };
|
|
245
|
+
}
|
|
246
|
+
const limit = request?.itemsPerPage ?? 0;
|
|
247
|
+
if (results.length < limit) {
|
|
248
|
+
return { next: () => null };
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
const nextVal = () =>
|
|
252
|
+
organizationsListOrSearchDepartmentContacts(
|
|
253
|
+
client,
|
|
254
|
+
{
|
|
255
|
+
...request,
|
|
256
|
+
page: nextPage,
|
|
257
|
+
},
|
|
258
|
+
options,
|
|
259
|
+
);
|
|
260
|
+
|
|
261
|
+
return { next: nextVal, "~next": { page: nextPage } };
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
const page = { ...result, ...nextFunc(raw) };
|
|
265
|
+
return [{ ...page, ...createPageIterator(page, (v) => !v.ok) }, {
|
|
266
|
+
status: "complete",
|
|
267
|
+
request: req,
|
|
268
|
+
response,
|
|
269
|
+
}];
|
|
270
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { GreenSecurityCore } from "../core.js";
|
|
7
|
+
import { encodeSimple } 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 { GreenSecurityError } from "../models/errors/greensecurityerror.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Get invoice receipt for vendor
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Get invoice receipt for vendor
|
|
34
|
+
*/
|
|
35
|
+
export function vendorsGetVendorInvoiceReceipt(
|
|
36
|
+
client: GreenSecurityCore,
|
|
37
|
+
request: operations.GetVendorInvoiceReceiptRequest,
|
|
38
|
+
options?: RequestOptions,
|
|
39
|
+
): APIPromise<
|
|
40
|
+
Result<
|
|
41
|
+
ReadableStream<Uint8Array>,
|
|
42
|
+
| errors.ApiErrorResponse
|
|
43
|
+
| GreenSecurityError
|
|
44
|
+
| ResponseValidationError
|
|
45
|
+
| ConnectionError
|
|
46
|
+
| RequestAbortedError
|
|
47
|
+
| RequestTimeoutError
|
|
48
|
+
| InvalidRequestError
|
|
49
|
+
| UnexpectedClientError
|
|
50
|
+
| SDKValidationError
|
|
51
|
+
>
|
|
52
|
+
> {
|
|
53
|
+
return new APIPromise($do(
|
|
54
|
+
client,
|
|
55
|
+
request,
|
|
56
|
+
options,
|
|
57
|
+
));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async function $do(
|
|
61
|
+
client: GreenSecurityCore,
|
|
62
|
+
request: operations.GetVendorInvoiceReceiptRequest,
|
|
63
|
+
options?: RequestOptions,
|
|
64
|
+
): Promise<
|
|
65
|
+
[
|
|
66
|
+
Result<
|
|
67
|
+
ReadableStream<Uint8Array>,
|
|
68
|
+
| errors.ApiErrorResponse
|
|
69
|
+
| GreenSecurityError
|
|
70
|
+
| ResponseValidationError
|
|
71
|
+
| ConnectionError
|
|
72
|
+
| RequestAbortedError
|
|
73
|
+
| RequestTimeoutError
|
|
74
|
+
| InvalidRequestError
|
|
75
|
+
| UnexpectedClientError
|
|
76
|
+
| SDKValidationError
|
|
77
|
+
>,
|
|
78
|
+
APICall,
|
|
79
|
+
]
|
|
80
|
+
> {
|
|
81
|
+
const parsed = safeParse(
|
|
82
|
+
request,
|
|
83
|
+
(value) =>
|
|
84
|
+
operations.GetVendorInvoiceReceiptRequest$outboundSchema.parse(value),
|
|
85
|
+
"Input validation failed",
|
|
86
|
+
);
|
|
87
|
+
if (!parsed.ok) {
|
|
88
|
+
return [parsed, { status: "invalid" }];
|
|
89
|
+
}
|
|
90
|
+
const payload = parsed.value;
|
|
91
|
+
const body = null;
|
|
92
|
+
|
|
93
|
+
const pathParams = {
|
|
94
|
+
id: encodeSimple("id", payload.id, {
|
|
95
|
+
explode: false,
|
|
96
|
+
charEncoding: "percent",
|
|
97
|
+
}),
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const path = pathToFunc("/vendors/invoices/{id}/receipt")(pathParams);
|
|
101
|
+
|
|
102
|
+
const headers = new Headers(compactMap({
|
|
103
|
+
Accept: "application/pdf",
|
|
104
|
+
}));
|
|
105
|
+
|
|
106
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
107
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
108
|
+
|
|
109
|
+
const context = {
|
|
110
|
+
options: client._options,
|
|
111
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
112
|
+
operationID: "getVendorInvoiceReceipt",
|
|
113
|
+
oAuth2Scopes: [],
|
|
114
|
+
|
|
115
|
+
resolvedSecurity: requestSecurity,
|
|
116
|
+
|
|
117
|
+
securitySource: client._options.security,
|
|
118
|
+
retryConfig: options?.retries
|
|
119
|
+
|| client._options.retryConfig
|
|
120
|
+
|| { strategy: "none" },
|
|
121
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const requestRes = client._createRequest(context, {
|
|
125
|
+
security: requestSecurity,
|
|
126
|
+
method: "GET",
|
|
127
|
+
baseURL: options?.serverURL,
|
|
128
|
+
path: path,
|
|
129
|
+
headers: headers,
|
|
130
|
+
body: body,
|
|
131
|
+
userAgent: client._options.userAgent,
|
|
132
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
133
|
+
}, options);
|
|
134
|
+
if (!requestRes.ok) {
|
|
135
|
+
return [requestRes, { status: "invalid" }];
|
|
136
|
+
}
|
|
137
|
+
const req = requestRes.value;
|
|
138
|
+
|
|
139
|
+
const doResult = await client._do(req, {
|
|
140
|
+
context,
|
|
141
|
+
errorCodes: ["400", "401", "403", "404", "4XX", "500", "5XX"],
|
|
142
|
+
retryConfig: context.retryConfig,
|
|
143
|
+
retryCodes: context.retryCodes,
|
|
144
|
+
});
|
|
145
|
+
if (!doResult.ok) {
|
|
146
|
+
return [doResult, { status: "request-error", request: req }];
|
|
147
|
+
}
|
|
148
|
+
const response = doResult.value;
|
|
149
|
+
|
|
150
|
+
const responseFields = {
|
|
151
|
+
HttpMeta: { Response: response, Request: req },
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
const [result] = await M.match<
|
|
155
|
+
ReadableStream<Uint8Array>,
|
|
156
|
+
| errors.ApiErrorResponse
|
|
157
|
+
| GreenSecurityError
|
|
158
|
+
| ResponseValidationError
|
|
159
|
+
| ConnectionError
|
|
160
|
+
| RequestAbortedError
|
|
161
|
+
| RequestTimeoutError
|
|
162
|
+
| InvalidRequestError
|
|
163
|
+
| UnexpectedClientError
|
|
164
|
+
| SDKValidationError
|
|
165
|
+
>(
|
|
166
|
+
M.stream(200, z.instanceof(ReadableStream<Uint8Array>), {
|
|
167
|
+
ctype: "application/pdf",
|
|
168
|
+
}),
|
|
169
|
+
M.jsonErr([400, 401, 403, 404], errors.ApiErrorResponse$inboundSchema),
|
|
170
|
+
M.jsonErr(500, errors.ApiErrorResponse$inboundSchema),
|
|
171
|
+
M.fail("4XX"),
|
|
172
|
+
M.fail("5XX"),
|
|
173
|
+
)(response, req, { extraFields: responseFields });
|
|
174
|
+
if (!result.ok) {
|
|
175
|
+
return [result, { status: "complete", request: req, response }];
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
return [result, { status: "complete", request: req, response }];
|
|
179
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -80,8 +80,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
80
80
|
export const SDK_METADATA = {
|
|
81
81
|
language: "typescript",
|
|
82
82
|
openapiDocVersion: "0.0.3",
|
|
83
|
-
sdkVersion: "0.
|
|
84
|
-
genVersion: "2.
|
|
83
|
+
sdkVersion: "0.38.2",
|
|
84
|
+
genVersion: "2.658.3",
|
|
85
85
|
userAgent:
|
|
86
|
-
"speakeasy-sdk/typescript 0.
|
|
86
|
+
"speakeasy-sdk/typescript 0.38.2 2.658.3 0.0.3 @greensecurity/javascript-sdk",
|
|
87
87
|
} as const;
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -21,6 +21,7 @@ import { tool$invoicesCreateInvoice } from "./tools/invoicesCreateInvoice.js";
|
|
|
21
21
|
import { tool$invoicesMakePayment } from "./tools/invoicesMakePayment.js";
|
|
22
22
|
import { tool$invoicesUpdateInvoice } from "./tools/invoicesUpdateInvoice.js";
|
|
23
23
|
import { tool$organizationsGetFacility } from "./tools/organizationsGetFacility.js";
|
|
24
|
+
import { tool$organizationsListOrSearchDepartmentContacts } from "./tools/organizationsListOrSearchDepartmentContacts.js";
|
|
24
25
|
import { tool$organizationsListOrSearchDepartments } from "./tools/organizationsListOrSearchDepartments.js";
|
|
25
26
|
import { tool$organizationsListOrSearchFacilities } from "./tools/organizationsListOrSearchFacilities.js";
|
|
26
27
|
import { tool$supportArticlesGetSupportArticle } from "./tools/supportArticlesGetSupportArticle.js";
|
|
@@ -53,6 +54,7 @@ import { tool$vendorsGetSubscription } from "./tools/vendorsGetSubscription.js";
|
|
|
53
54
|
import { tool$vendorsGetVendorCredentialDetails } from "./tools/vendorsGetVendorCredentialDetails.js";
|
|
54
55
|
import { tool$vendorsGetVendorCredentialFile } from "./tools/vendorsGetVendorCredentialFile.js";
|
|
55
56
|
import { tool$vendorsGetVendorInvoiceDetails } from "./tools/vendorsGetVendorInvoiceDetails.js";
|
|
57
|
+
import { tool$vendorsGetVendorInvoiceReceipt } from "./tools/vendorsGetVendorInvoiceReceipt.js";
|
|
56
58
|
import { tool$vendorsGetVendorLegalName } from "./tools/vendorsGetVendorLegalName.js";
|
|
57
59
|
import { tool$vendorsGetVendorsDetails } from "./tools/vendorsGetVendorsDetails.js";
|
|
58
60
|
import { tool$vendorsListVendorAdditionalFacilityFields } from "./tools/vendorsListVendorAdditionalFacilityFields.js";
|
|
@@ -94,7 +96,7 @@ export function createMCPServer(deps: {
|
|
|
94
96
|
}) {
|
|
95
97
|
const server = new McpServer({
|
|
96
98
|
name: "GreenSecurity",
|
|
97
|
-
version: "0.
|
|
99
|
+
version: "0.38.2",
|
|
98
100
|
});
|
|
99
101
|
|
|
100
102
|
const client = new GreenSecurityCore({
|
|
@@ -149,6 +151,7 @@ export function createMCPServer(deps: {
|
|
|
149
151
|
tool(tool$vendorsGetSubscription);
|
|
150
152
|
tool(tool$vendorsChangeSubscription);
|
|
151
153
|
tool(tool$vendorsListVendorInvoices);
|
|
154
|
+
tool(tool$vendorsGetVendorInvoiceReceipt);
|
|
152
155
|
tool(tool$vendorsGetVendorInvoiceDetails);
|
|
153
156
|
tool(tool$vendorsListVendorFacilityStatuses);
|
|
154
157
|
tool(tool$vendorsListVendorScrubPurchases);
|
|
@@ -177,6 +180,7 @@ export function createMCPServer(deps: {
|
|
|
177
180
|
tool(tool$organizationsListOrSearchFacilities);
|
|
178
181
|
tool(tool$organizationsGetFacility);
|
|
179
182
|
tool(tool$organizationsListOrSearchDepartments);
|
|
183
|
+
tool(tool$organizationsListOrSearchDepartmentContacts);
|
|
180
184
|
tool(tool$supportArticlesListOrSearchSupportArticles);
|
|
181
185
|
tool(tool$supportArticlesGetSupportArticle);
|
|
182
186
|
tool(tool$webhooksListAllWebhookEndpoints);
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { organizationsListOrSearchDepartmentContacts } from "../../funcs/organizationsListOrSearchDepartmentContacts.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.ListOrSearchDepartmentContactsRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$organizationsListOrSearchDepartmentContacts: ToolDefinition<
|
|
14
|
+
typeof args
|
|
15
|
+
> = {
|
|
16
|
+
name: "organizations-list-or-search-department-contacts",
|
|
17
|
+
description: `List or search department contacts
|
|
18
|
+
|
|
19
|
+
List or search department contacts.
|
|
20
|
+
|
|
21
|
+
Available \`expand\` scopes are:
|
|
22
|
+
|
|
23
|
+
- department_membership.contact
|
|
24
|
+
- department_membership.department`,
|
|
25
|
+
args,
|
|
26
|
+
tool: async (client, args, ctx) => {
|
|
27
|
+
const [result, apiCall] = await organizationsListOrSearchDepartmentContacts(
|
|
28
|
+
client,
|
|
29
|
+
args.request,
|
|
30
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
31
|
+
).$inspect();
|
|
32
|
+
|
|
33
|
+
if (!result.ok) {
|
|
34
|
+
return {
|
|
35
|
+
content: [{ type: "text", text: result.error.message }],
|
|
36
|
+
isError: true,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const value = result.value.result;
|
|
41
|
+
|
|
42
|
+
return formatResult(value, apiCall);
|
|
43
|
+
},
|
|
44
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { vendorsGetVendorInvoiceReceipt } from "../../funcs/vendorsGetVendorInvoiceReceipt.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.GetVendorInvoiceReceiptRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$vendorsGetVendorInvoiceReceipt: ToolDefinition<typeof args> =
|
|
14
|
+
{
|
|
15
|
+
name: "vendors-get-vendor-invoice-receipt",
|
|
16
|
+
description: `Get invoice receipt for vendor
|
|
17
|
+
|
|
18
|
+
Get invoice receipt for vendor`,
|
|
19
|
+
args,
|
|
20
|
+
tool: async (client, args, ctx) => {
|
|
21
|
+
const [result, apiCall] = await vendorsGetVendorInvoiceReceipt(
|
|
22
|
+
client,
|
|
23
|
+
args.request,
|
|
24
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
25
|
+
).$inspect();
|
|
26
|
+
|
|
27
|
+
if (!result.ok) {
|
|
28
|
+
return {
|
|
29
|
+
content: [{ type: "text", text: result.error.message }],
|
|
30
|
+
isError: true,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const value = result.value;
|
|
35
|
+
|
|
36
|
+
return formatResult(value, apiCall);
|
|
37
|
+
},
|
|
38
|
+
};
|