@greensecurity/javascript-sdk 0.19.0 → 0.21.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/REACT_QUERY.md +15 -15
- package/README.md +93 -9
- package/bin/mcp-server.js +1734 -271
- package/bin/mcp-server.js.map +50 -26
- package/funcs/organizationsListOrSearchFacilities.d.ts +2 -1
- package/funcs/organizationsListOrSearchFacilities.d.ts.map +1 -1
- package/funcs/organizationsListOrSearchFacilities.js +3 -2
- package/funcs/organizationsListOrSearchFacilities.js.map +1 -1
- package/funcs/vendorScansVendorScanOut.d.ts +17 -0
- package/funcs/vendorScansVendorScanOut.d.ts.map +1 -0
- package/funcs/vendorScansVendorScanOut.js +120 -0
- package/funcs/vendorScansVendorScanOut.js.map +1 -0
- package/funcs/vendorsGetVendorsDetails.d.ts +32 -0
- package/funcs/vendorsGetVendorsDetails.d.ts.map +1 -0
- package/funcs/vendorsGetVendorsDetails.js +139 -0
- package/funcs/vendorsGetVendorsDetails.js.map +1 -0
- package/funcs/vendorsListVendorCredentials.d.ts +4 -1
- package/funcs/vendorsListVendorCredentials.d.ts.map +1 -1
- package/funcs/vendorsListVendorCredentials.js +46 -6
- package/funcs/vendorsListVendorCredentials.js.map +1 -1
- package/funcs/vendorsListVendorFacilityStatuses.d.ts +1 -1
- package/funcs/vendorsListVendorFacilityStatuses.d.ts.map +1 -1
- package/funcs/vendorsListVendorFacilityStatuses.js +3 -2
- package/funcs/vendorsListVendorFacilityStatuses.js.map +1 -1
- package/funcs/vendorsListVendorJobTitles.d.ts +1 -1
- package/funcs/vendorsListVendorJobTitles.d.ts.map +1 -1
- package/funcs/vendorsListVendorJobTitles.js +21 -6
- package/funcs/vendorsListVendorJobTitles.js.map +1 -1
- package/funcs/vendorsListVendorScrubDetails.d.ts +18 -0
- package/funcs/vendorsListVendorScrubDetails.d.ts.map +1 -0
- package/funcs/vendorsListVendorScrubDetails.js +121 -0
- package/funcs/vendorsListVendorScrubDetails.js.map +1 -0
- package/funcs/vendorsListVendorScrubPurchases.d.ts +20 -0
- package/funcs/vendorsListVendorScrubPurchases.d.ts.map +1 -0
- package/funcs/vendorsListVendorScrubPurchases.js +160 -0
- package/funcs/vendorsListVendorScrubPurchases.js.map +1 -0
- package/funcs/webhooksGetWebhookEndpoint.d.ts +18 -0
- package/funcs/webhooksGetWebhookEndpoint.d.ts.map +1 -0
- package/funcs/webhooksGetWebhookEndpoint.js +121 -0
- package/funcs/webhooksGetWebhookEndpoint.js.map +1 -0
- package/funcs/webhooksListAllWebhookEndpoints.d.ts +17 -0
- package/funcs/webhooksListAllWebhookEndpoints.d.ts.map +1 -0
- package/funcs/webhooksListAllWebhookEndpoints.js +121 -0
- package/funcs/webhooksListAllWebhookEndpoints.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/lib/security.d.ts +4 -3
- package/lib/security.d.ts.map +1 -1
- package/lib/security.js +6 -1
- package/lib/security.js.map +1 -1
- package/mcp-server/extensions.d.ts +2 -0
- package/mcp-server/extensions.d.ts.map +1 -1
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/prompts.d.ts +26 -0
- package/mcp-server/prompts.d.ts.map +1 -0
- package/mcp-server/prompts.js +47 -0
- package/mcp-server/prompts.js.map +1 -0
- package/mcp-server/resources.d.ts.map +1 -1
- package/mcp-server/resources.js +1 -0
- package/mcp-server/resources.js.map +1 -1
- package/mcp-server/server.d.ts.map +1 -1
- package/mcp-server/server.js +16 -4
- package/mcp-server/server.js.map +1 -1
- package/mcp-server/tools/vendorScansVendorScanOut.d.ts +8 -0
- package/mcp-server/tools/vendorScansVendorScanOut.d.ts.map +1 -0
- package/mcp-server/tools/{userPasswordResetRequest.js → vendorScansVendorScanOut.js} +9 -9
- package/mcp-server/tools/{userPasswordResetRequest.js.map → vendorScansVendorScanOut.js.map} +1 -1
- package/mcp-server/tools/vendorsGetVendorsDetails.d.ts +8 -0
- package/mcp-server/tools/vendorsGetVendorsDetails.d.ts.map +1 -0
- package/mcp-server/tools/vendorsGetVendorsDetails.js +78 -0
- package/mcp-server/tools/vendorsGetVendorsDetails.js.map +1 -0
- package/mcp-server/tools/vendorsListVendorCredentials.js +1 -1
- package/mcp-server/tools/vendorsListVendorCredentials.js.map +1 -1
- package/mcp-server/tools/vendorsListVendorScrubDetails.d.ts +8 -0
- package/mcp-server/tools/vendorsListVendorScrubDetails.d.ts.map +1 -0
- package/mcp-server/tools/{userGetUserById.js → vendorsListVendorScrubDetails.js} +9 -9
- package/mcp-server/tools/vendorsListVendorScrubDetails.js.map +1 -0
- package/mcp-server/tools/vendorsListVendorScrubPurchases.d.ts +8 -0
- package/mcp-server/tools/vendorsListVendorScrubPurchases.d.ts.map +1 -0
- package/mcp-server/tools/{userPassword.js → vendorsListVendorScrubPurchases.js} +10 -11
- package/mcp-server/tools/vendorsListVendorScrubPurchases.js.map +1 -0
- package/mcp-server/tools/webhooksGetWebhookEndpoint.d.ts +8 -0
- package/mcp-server/tools/webhooksGetWebhookEndpoint.d.ts.map +1 -0
- package/mcp-server/tools/{vendorsListVendorJobTitles.js → webhooksGetWebhookEndpoint.js} +10 -10
- package/mcp-server/tools/webhooksGetWebhookEndpoint.js.map +1 -0
- package/mcp-server/tools/webhooksListAllWebhookEndpoints.d.ts +8 -0
- package/mcp-server/tools/webhooksListAllWebhookEndpoints.d.ts.map +1 -0
- package/mcp-server/tools/{userMagiclink.js → webhooksListAllWebhookEndpoints.js} +9 -9
- package/mcp-server/tools/webhooksListAllWebhookEndpoints.js.map +1 -0
- package/mcp-server/tools.d.ts.map +1 -1
- package/mcp-server/tools.js +1 -0
- package/mcp-server/tools.js.map +1 -1
- package/models/components/company.d.ts +15 -15
- package/models/components/company.d.ts.map +1 -1
- package/models/components/company.js +19 -18
- package/models/components/company.js.map +1 -1
- package/models/components/contact.d.ts +13 -13
- package/models/components/contact.d.ts.map +1 -1
- package/models/components/contact.js +16 -16
- package/models/components/contact.js.map +1 -1
- package/models/components/department.d.ts +34 -0
- package/models/components/department.d.ts.map +1 -0
- package/models/components/department.js +71 -0
- package/models/components/department.js.map +1 -0
- package/models/components/expand.d.ts +24 -0
- package/models/components/expand.d.ts.map +1 -1
- package/models/components/expand.js +8 -0
- package/models/components/expand.js.map +1 -1
- package/models/components/facility.d.ts +17 -17
- package/models/components/facility.d.ts.map +1 -1
- package/models/components/facility.js +20 -20
- package/models/components/facility.js.map +1 -1
- package/models/components/index.d.ts +7 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +7 -0
- package/models/components/index.js.map +1 -1
- package/models/components/scantype.d.ts +31 -0
- package/models/components/scantype.d.ts.map +1 -0
- package/models/components/scantype.js +62 -0
- package/models/components/scantype.js.map +1 -0
- package/models/components/subscription.d.ts +42 -0
- package/models/components/subscription.d.ts.map +1 -0
- package/models/components/subscription.js +92 -0
- package/models/components/subscription.js.map +1 -0
- package/models/components/user.d.ts +8 -25
- package/models/components/user.d.ts.map +1 -1
- package/models/components/user.js +8 -31
- package/models/components/user.js.map +1 -1
- package/models/components/vendor.d.ts +374 -0
- package/models/components/vendor.d.ts.map +1 -0
- package/models/components/vendor.js +523 -0
- package/models/components/vendor.js.map +1 -0
- package/models/components/vendorscrubdetails.d.ts +42 -0
- package/models/components/vendorscrubdetails.d.ts.map +1 -0
- package/models/components/vendorscrubdetails.js +98 -0
- package/models/components/vendorscrubdetails.js.map +1 -0
- package/models/components/vendorscrubpurchase.d.ts +38 -0
- package/models/components/vendorscrubpurchase.d.ts.map +1 -0
- package/models/components/vendorscrubpurchase.js +84 -0
- package/models/components/vendorscrubpurchase.js.map +1 -0
- package/models/components/webhookendpoint.d.ts +135 -0
- package/models/components/webhookendpoint.d.ts.map +1 -0
- package/models/components/webhookendpoint.js +158 -0
- package/models/components/webhookendpoint.js.map +1 -0
- package/models/operations/getvendorsdetails.d.ts +38 -0
- package/models/operations/getvendorsdetails.d.ts.map +1 -0
- package/models/operations/getvendorsdetails.js +81 -0
- package/models/operations/getvendorsdetails.js.map +1 -0
- package/models/operations/getwebhookendpoint.d.ts +32 -0
- package/models/operations/getwebhookendpoint.d.ts.map +1 -0
- package/models/operations/getwebhookendpoint.js +69 -0
- package/models/operations/getwebhookendpoint.js.map +1 -0
- package/models/operations/index.d.ts +6 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +6 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/listallwebhookendpoints.d.ts +81 -0
- package/models/operations/listallwebhookendpoints.d.ts.map +1 -0
- package/models/operations/listallwebhookendpoints.js +114 -0
- package/models/operations/listallwebhookendpoints.js.map +1 -0
- package/models/operations/listorsearchfacilities.d.ts +2 -2
- package/models/operations/listorsearchfacilities.d.ts.map +1 -1
- package/models/operations/listorsearchfacilities.js +2 -2
- package/models/operations/listorsearchfacilities.js.map +1 -1
- package/models/operations/listvendorcredentials.d.ts +77 -5
- package/models/operations/listvendorcredentials.d.ts.map +1 -1
- package/models/operations/listvendorcredentials.js +78 -3
- package/models/operations/listvendorcredentials.js.map +1 -1
- package/models/operations/listvendorfacilitystatuses.d.ts +5 -0
- package/models/operations/listvendorfacilitystatuses.d.ts.map +1 -1
- package/models/operations/listvendorfacilitystatuses.js +4 -0
- package/models/operations/listvendorfacilitystatuses.js.map +1 -1
- package/models/operations/listvendorjobtitles.d.ts +27 -0
- package/models/operations/listvendorjobtitles.d.ts.map +1 -1
- package/models/operations/listvendorjobtitles.js +38 -1
- package/models/operations/listvendorjobtitles.js.map +1 -1
- package/models/operations/listvendorscrubdetails.d.ts +32 -0
- package/models/operations/listvendorscrubdetails.d.ts.map +1 -0
- package/models/operations/listvendorscrubdetails.js +78 -0
- package/models/operations/listvendorscrubdetails.js.map +1 -0
- package/models/operations/listvendorscrubpurchases.d.ts +111 -0
- package/models/operations/listvendorscrubpurchases.d.ts.map +1 -0
- package/models/operations/listvendorscrubpurchases.js +153 -0
- package/models/operations/listvendorscrubpurchases.js.map +1 -0
- package/models/operations/vendorscanout.d.ts +64 -0
- package/models/operations/vendorscanout.d.ts.map +1 -0
- package/models/operations/vendorscanout.js +100 -0
- package/models/operations/vendorscanout.js.map +1 -0
- package/package.json +1 -1
- package/react-query/index.d.ts +6 -0
- package/react-query/index.d.ts.map +1 -1
- package/react-query/index.js +6 -0
- package/react-query/index.js.map +1 -1
- package/react-query/vendorScansVendorScanOut.d.ts +23 -0
- package/react-query/vendorScansVendorScanOut.d.ts.map +1 -0
- package/react-query/vendorScansVendorScanOut.js +47 -0
- package/react-query/vendorScansVendorScanOut.js.map +1 -0
- package/react-query/vendorsGetVendorsDetails.d.ts +71 -0
- package/react-query/vendorsGetVendorsDetails.d.ts.map +1 -0
- package/react-query/vendorsGetVendorsDetails.js +123 -0
- package/react-query/vendorsGetVendorsDetails.js.map +1 -0
- package/react-query/vendorsListVendorCredentials.d.ts +40 -3
- package/react-query/vendorsListVendorCredentials.d.ts.map +1 -1
- package/react-query/vendorsListVendorCredentials.js +67 -0
- package/react-query/vendorsListVendorCredentials.js.map +1 -1
- package/react-query/vendorsListVendorFacilityStatuses.d.ts +3 -0
- package/react-query/vendorsListVendorFacilityStatuses.d.ts.map +1 -1
- package/react-query/vendorsListVendorFacilityStatuses.js +2 -0
- package/react-query/vendorsListVendorFacilityStatuses.js.map +1 -1
- package/react-query/vendorsListVendorJobTitles.d.ts +7 -7
- package/react-query/vendorsListVendorJobTitles.d.ts.map +1 -1
- package/react-query/vendorsListVendorJobTitles.js +15 -15
- package/react-query/vendorsListVendorJobTitles.js.map +1 -1
- package/react-query/vendorsListVendorScrubDetails.d.ts +31 -0
- package/react-query/vendorsListVendorScrubDetails.d.ts.map +1 -0
- package/react-query/vendorsListVendorScrubDetails.js +96 -0
- package/react-query/vendorsListVendorScrubDetails.js.map +1 -0
- package/react-query/vendorsListVendorScrubPurchases.d.ts +77 -0
- package/react-query/vendorsListVendorScrubPurchases.d.ts.map +1 -0
- package/react-query/vendorsListVendorScrubPurchases.js +160 -0
- package/react-query/vendorsListVendorScrubPurchases.js.map +1 -0
- package/react-query/webhooksGetWebhookEndpoint.d.ts +31 -0
- package/react-query/webhooksGetWebhookEndpoint.d.ts.map +1 -0
- package/react-query/webhooksGetWebhookEndpoint.js +96 -0
- package/react-query/webhooksGetWebhookEndpoint.js.map +1 -0
- package/react-query/webhooksListAllWebhookEndpoints.d.ts +50 -0
- package/react-query/webhooksListAllWebhookEndpoints.d.ts.map +1 -0
- package/react-query/webhooksListAllWebhookEndpoints.js +101 -0
- package/react-query/webhooksListAllWebhookEndpoints.js.map +1 -0
- package/sdk/sdk.d.ts +6 -0
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +8 -0
- package/sdk/sdk.js.map +1 -1
- package/sdk/vendors.d.ts +41 -2
- package/sdk/vendors.d.ts.map +1 -1
- package/sdk/vendors.js +47 -3
- package/sdk/vendors.js.map +1 -1
- package/sdk/vendorscans.d.ts +12 -0
- package/sdk/vendorscans.d.ts.map +1 -0
- package/sdk/vendorscans.js +22 -0
- package/sdk/vendorscans.js.map +1 -0
- package/sdk/webhooks.d.ts +20 -0
- package/sdk/webhooks.d.ts.map +1 -0
- package/sdk/webhooks.js +32 -0
- package/sdk/webhooks.js.map +1 -0
- package/src/__tests__/vendors.test.ts +50 -152
- package/src/__tests__/vendorscans.test.ts +27 -0
- package/src/__tests__/webhooks.test.ts +45 -0
- package/src/funcs/organizationsListOrSearchFacilities.ts +12 -1
- package/src/funcs/vendorScansVendorScanOut.ts +172 -0
- package/src/funcs/vendorsGetVendorsDetails.ts +192 -0
- package/src/funcs/vendorsListVendorCredentials.ts +104 -27
- package/src/funcs/vendorsListVendorFacilityStatuses.ts +7 -1
- package/src/funcs/vendorsListVendorJobTitles.ts +25 -2
- package/src/funcs/vendorsListVendorScrubDetails.ts +172 -0
- package/src/funcs/vendorsListVendorScrubPurchases.ts +249 -0
- package/src/funcs/webhooksGetWebhookEndpoint.ts +173 -0
- package/src/funcs/webhooksListAllWebhookEndpoints.ts +174 -0
- package/src/lib/config.ts +3 -3
- package/src/lib/security.ts +11 -3
- package/src/mcp-server/extensions.ts +4 -0
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/prompts.ts +110 -0
- package/src/mcp-server/resources.ts +1 -0
- package/src/mcp-server/server.ts +16 -4
- package/src/mcp-server/tools/vendorScansVendorScanOut.ts +37 -0
- package/src/mcp-server/tools/vendorsGetVendorsDetails.ts +51 -0
- package/src/mcp-server/tools/vendorsListVendorCredentials.ts +1 -1
- package/src/mcp-server/tools/vendorsListVendorScrubDetails.ts +37 -0
- package/src/mcp-server/tools/vendorsListVendorScrubPurchases.ts +38 -0
- package/src/mcp-server/tools/{vendorsListVendorJobTitles.ts → webhooksGetWebhookEndpoint.ts} +8 -8
- package/src/mcp-server/tools/webhooksListAllWebhookEndpoints.ts +38 -0
- package/src/mcp-server/tools.ts +1 -0
- package/src/models/components/company.ts +27 -24
- package/src/models/components/contact.ts +24 -20
- package/src/models/components/department.ts +69 -0
- package/src/models/components/expand.ts +8 -0
- package/src/models/components/facility.ts +28 -32
- package/src/models/components/index.ts +7 -0
- package/src/models/components/scantype.ts +32 -0
- package/src/models/components/subscription.ts +98 -0
- package/src/models/components/user.ts +19 -53
- package/src/models/components/vendor.ts +925 -0
- package/src/models/components/vendorscrubdetails.ts +108 -0
- package/src/models/components/vendorscrubpurchase.ts +90 -0
- package/src/models/components/webhookendpoint.ts +244 -0
- package/src/models/operations/getvendorsdetails.ts +86 -0
- package/src/models/operations/getwebhookendpoint.ts +69 -0
- package/src/models/operations/index.ts +6 -0
- package/src/models/operations/listallwebhookendpoints.ts +175 -0
- package/src/models/operations/listorsearchfacilities.ts +4 -4
- package/src/models/operations/listvendorcredentials.ts +160 -7
- package/src/models/operations/listvendorfacilitystatuses.ts +9 -0
- package/src/models/operations/listvendorjobtitles.ts +72 -0
- package/src/models/operations/listvendorscrubdetails.ts +80 -0
- package/src/models/operations/listvendorscrubpurchases.ts +252 -0
- package/src/models/operations/vendorscanout.ts +138 -0
- package/src/react-query/index.ts +6 -0
- package/src/react-query/vendorScansVendorScanOut.ts +89 -0
- package/src/react-query/vendorsGetVendorsDetails.ts +201 -0
- package/src/react-query/vendorsListVendorCredentials.ts +169 -1
- package/src/react-query/vendorsListVendorFacilityStatuses.ts +5 -0
- package/src/react-query/vendorsListVendorJobTitles.ts +15 -0
- package/src/react-query/vendorsListVendorScrubDetails.ts +166 -0
- package/src/react-query/vendorsListVendorScrubPurchases.ts +346 -0
- package/src/react-query/webhooksGetWebhookEndpoint.ts +163 -0
- package/src/react-query/webhooksListAllWebhookEndpoints.ts +193 -0
- package/src/sdk/sdk.ts +12 -0
- package/src/sdk/vendors.ts +76 -2
- package/src/sdk/vendorscans.ts +27 -0
- package/src/sdk/webhooks.ts +46 -0
- package/mcp-server/tools/userGetCurrentUser.d.ts +0 -3
- package/mcp-server/tools/userGetCurrentUser.d.ts.map +0 -1
- package/mcp-server/tools/userGetCurrentUser.js +0 -26
- package/mcp-server/tools/userGetCurrentUser.js.map +0 -1
- package/mcp-server/tools/userGetUserById.d.ts +0 -8
- package/mcp-server/tools/userGetUserById.d.ts.map +0 -1
- package/mcp-server/tools/userGetUserById.js.map +0 -1
- package/mcp-server/tools/userLogsUserIntoTheSystem.d.ts +0 -8
- package/mcp-server/tools/userLogsUserIntoTheSystem.d.ts.map +0 -1
- package/mcp-server/tools/userLogsUserIntoTheSystem.js +0 -94
- package/mcp-server/tools/userLogsUserIntoTheSystem.js.map +0 -1
- package/mcp-server/tools/userMagiclink.d.ts +0 -8
- package/mcp-server/tools/userMagiclink.d.ts.map +0 -1
- package/mcp-server/tools/userMagiclink.js.map +0 -1
- package/mcp-server/tools/userPassword.d.ts +0 -8
- package/mcp-server/tools/userPassword.d.ts.map +0 -1
- package/mcp-server/tools/userPassword.js.map +0 -1
- package/mcp-server/tools/userPasswordResetRequest.d.ts +0 -8
- package/mcp-server/tools/userPasswordResetRequest.d.ts.map +0 -1
- package/mcp-server/tools/vendorsListVendorJobTitles.d.ts +0 -8
- package/mcp-server/tools/vendorsListVendorJobTitles.d.ts.map +0 -1
- package/mcp-server/tools/vendorsListVendorJobTitles.js.map +0 -1
- package/src/__tests__/organizations.test.ts +0 -78
- package/src/__tests__/supportarticles.test.ts +0 -64
- package/src/__tests__/user.test.ts +0 -218
- package/vitest.config.ts +0 -8
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
6
|
+
import { RequestHandlerExtra } from "@modelcontextprotocol/sdk/shared/protocol.js";
|
|
7
|
+
import { GetPromptResult } from "@modelcontextprotocol/sdk/types.js";
|
|
8
|
+
import {
|
|
9
|
+
objectOutputType,
|
|
10
|
+
ZodOptional,
|
|
11
|
+
ZodType,
|
|
12
|
+
ZodTypeAny,
|
|
13
|
+
ZodTypeDef,
|
|
14
|
+
} from "zod";
|
|
15
|
+
import { GreenSecurityCore } from "../core.js";
|
|
16
|
+
import { ConsoleLogger } from "./console-logger.js";
|
|
17
|
+
import { MCPScope } from "./scopes.js";
|
|
18
|
+
|
|
19
|
+
// '@modelcontextprotocol/sdk' currently does not export this type
|
|
20
|
+
export type PromptArgsRawShape = {
|
|
21
|
+
[k: string]:
|
|
22
|
+
| ZodType<string, ZodTypeDef, string>
|
|
23
|
+
| ZodOptional<ZodType<string, ZodTypeDef, string>>;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export type PromptDefinition<
|
|
27
|
+
Args extends undefined | PromptArgsRawShape = undefined,
|
|
28
|
+
> = Args extends PromptArgsRawShape ? {
|
|
29
|
+
name: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
scopes?: MCPScope[];
|
|
32
|
+
args: Args;
|
|
33
|
+
prompt: (
|
|
34
|
+
client: GreenSecurityCore,
|
|
35
|
+
args: objectOutputType<Args, ZodTypeAny>,
|
|
36
|
+
extra: RequestHandlerExtra,
|
|
37
|
+
) => GetPromptResult | Promise<GetPromptResult>;
|
|
38
|
+
}
|
|
39
|
+
: {
|
|
40
|
+
name: string;
|
|
41
|
+
description?: string;
|
|
42
|
+
scopes?: MCPScope[];
|
|
43
|
+
args?: undefined;
|
|
44
|
+
prompt: (
|
|
45
|
+
client: GreenSecurityCore,
|
|
46
|
+
extra: RequestHandlerExtra,
|
|
47
|
+
) => GetPromptResult | Promise<GetPromptResult>;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
// Optional function to assist with formatting prompt results
|
|
51
|
+
export async function formatResult(value: string): Promise<GetPromptResult> {
|
|
52
|
+
return {
|
|
53
|
+
messages: [
|
|
54
|
+
{
|
|
55
|
+
role: "user",
|
|
56
|
+
content: {
|
|
57
|
+
type: "text",
|
|
58
|
+
text: value,
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function createRegisterPrompt(
|
|
66
|
+
logger: ConsoleLogger,
|
|
67
|
+
server: McpServer,
|
|
68
|
+
sdk: GreenSecurityCore,
|
|
69
|
+
allowedScopes: Set<MCPScope>,
|
|
70
|
+
): <A extends PromptArgsRawShape | undefined>(
|
|
71
|
+
prompt: PromptDefinition<A>,
|
|
72
|
+
) => void {
|
|
73
|
+
return <A extends PromptArgsRawShape | undefined>(
|
|
74
|
+
prompt: PromptDefinition<A>,
|
|
75
|
+
): void => {
|
|
76
|
+
const scopes = prompt.scopes ?? [];
|
|
77
|
+
if (!scopes.every((s: MCPScope) => allowedScopes.has(s))) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (prompt.args) {
|
|
82
|
+
if (prompt.description) {
|
|
83
|
+
server.prompt(
|
|
84
|
+
prompt.name,
|
|
85
|
+
prompt.description,
|
|
86
|
+
prompt.args,
|
|
87
|
+
async (args, ctx) => prompt.prompt(sdk, args, ctx),
|
|
88
|
+
);
|
|
89
|
+
} else {
|
|
90
|
+
server.prompt(
|
|
91
|
+
prompt.name,
|
|
92
|
+
prompt.args,
|
|
93
|
+
async (args, ctx) => prompt.prompt(sdk, args, ctx),
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
} else {
|
|
97
|
+
if (prompt.description) {
|
|
98
|
+
server.prompt(
|
|
99
|
+
prompt.name,
|
|
100
|
+
prompt.description,
|
|
101
|
+
async (ctx) => prompt.prompt(sdk, ctx),
|
|
102
|
+
);
|
|
103
|
+
} else {
|
|
104
|
+
server.prompt(prompt.name, async (ctx) => prompt.prompt(sdk, ctx));
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
logger.debug("Registered prompt", { name: prompt.name });
|
|
109
|
+
};
|
|
110
|
+
}
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
|
6
6
|
import { GreenSecurityCore } from "../core.js";
|
|
7
7
|
import { SDKOptions } from "../lib/config.js";
|
|
8
8
|
import type { ConsoleLogger } from "./console-logger.js";
|
|
9
|
+
import { createRegisterPrompt } from "./prompts.js";
|
|
9
10
|
import {
|
|
10
11
|
createRegisterResource,
|
|
11
12
|
createRegisterResourceTemplate,
|
|
@@ -22,13 +23,18 @@ import { tool$usersLogsUserIntoTheSystem } from "./tools/usersLogsUserIntoTheSys
|
|
|
22
23
|
import { tool$usersMagiclink } from "./tools/usersMagiclink.js";
|
|
23
24
|
import { tool$usersPassword } from "./tools/usersPassword.js";
|
|
24
25
|
import { tool$usersPasswordResetRequest } from "./tools/usersPasswordResetRequest.js";
|
|
26
|
+
import { tool$vendorScansVendorScanOut } from "./tools/vendorScansVendorScanOut.js";
|
|
25
27
|
import { tool$vendorsCreateVendorRegistration } from "./tools/vendorsCreateVendorRegistration.js";
|
|
26
28
|
import { tool$vendorsExpediteTimeRemaining } from "./tools/vendorsExpediteTimeRemaining.js";
|
|
27
29
|
import { tool$vendorsGetVendorInvoiceDetails } from "./tools/vendorsGetVendorInvoiceDetails.js";
|
|
30
|
+
import { tool$vendorsGetVendorsDetails } from "./tools/vendorsGetVendorsDetails.js";
|
|
28
31
|
import { tool$vendorsListVendorCredentials } from "./tools/vendorsListVendorCredentials.js";
|
|
29
32
|
import { tool$vendorsListVendorFacilityStatuses } from "./tools/vendorsListVendorFacilityStatuses.js";
|
|
30
33
|
import { tool$vendorsListVendorInvoices } from "./tools/vendorsListVendorInvoices.js";
|
|
31
|
-
import { tool$
|
|
34
|
+
import { tool$vendorsListVendorScrubDetails } from "./tools/vendorsListVendorScrubDetails.js";
|
|
35
|
+
import { tool$vendorsListVendorScrubPurchases } from "./tools/vendorsListVendorScrubPurchases.js";
|
|
36
|
+
import { tool$webhooksGetWebhookEndpoint } from "./tools/webhooksGetWebhookEndpoint.js";
|
|
37
|
+
import { tool$webhooksListAllWebhookEndpoints } from "./tools/webhooksListAllWebhookEndpoints.js";
|
|
32
38
|
|
|
33
39
|
export function createMCPServer(deps: {
|
|
34
40
|
logger: ConsoleLogger;
|
|
@@ -40,7 +46,7 @@ export function createMCPServer(deps: {
|
|
|
40
46
|
}) {
|
|
41
47
|
const server = new McpServer({
|
|
42
48
|
name: "GreenSecurity",
|
|
43
|
-
version: "0.
|
|
49
|
+
version: "0.21.1",
|
|
44
50
|
});
|
|
45
51
|
|
|
46
52
|
const client = new GreenSecurityCore({
|
|
@@ -66,16 +72,19 @@ export function createMCPServer(deps: {
|
|
|
66
72
|
client,
|
|
67
73
|
scopes,
|
|
68
74
|
);
|
|
69
|
-
const
|
|
75
|
+
const prompt = createRegisterPrompt(deps.logger, server, client, scopes);
|
|
76
|
+
const register = { tool, resource, resourceTemplate, prompt };
|
|
70
77
|
void register; // suppress unused warnings
|
|
71
78
|
|
|
72
79
|
tool(tool$vendorsCreateVendorRegistration);
|
|
73
|
-
tool(tool$vendorsListVendorJobTitles);
|
|
74
80
|
tool(tool$vendorsListVendorCredentials);
|
|
75
81
|
tool(tool$vendorsExpediteTimeRemaining);
|
|
76
82
|
tool(tool$vendorsListVendorInvoices);
|
|
77
83
|
tool(tool$vendorsGetVendorInvoiceDetails);
|
|
78
84
|
tool(tool$vendorsListVendorFacilityStatuses);
|
|
85
|
+
tool(tool$vendorsListVendorScrubPurchases);
|
|
86
|
+
tool(tool$vendorsListVendorScrubDetails);
|
|
87
|
+
tool(tool$vendorsGetVendorsDetails);
|
|
79
88
|
tool(tool$usersGetCurrentUser);
|
|
80
89
|
tool(tool$usersGetUserById);
|
|
81
90
|
tool(tool$usersLogsUserIntoTheSystem);
|
|
@@ -86,6 +95,9 @@ export function createMCPServer(deps: {
|
|
|
86
95
|
tool(tool$organizationsGetFacility);
|
|
87
96
|
tool(tool$supportArticlesListOrSearchSupportArticles);
|
|
88
97
|
tool(tool$supportArticlesGetSupportArticle);
|
|
98
|
+
tool(tool$webhooksListAllWebhookEndpoints);
|
|
99
|
+
tool(tool$webhooksGetWebhookEndpoint);
|
|
100
|
+
tool(tool$vendorScansVendorScanOut);
|
|
89
101
|
|
|
90
102
|
return server;
|
|
91
103
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { vendorScansVendorScanOut } from "../../funcs/vendorScansVendorScanOut.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.VendorScanOutRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$vendorScansVendorScanOut: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "vendor-scans-vendor-scan-out",
|
|
15
|
+
description: `Vendor scan out
|
|
16
|
+
|
|
17
|
+
It scans out vendor from facility`,
|
|
18
|
+
args,
|
|
19
|
+
tool: async (client, args, ctx) => {
|
|
20
|
+
const [result, apiCall] = await vendorScansVendorScanOut(
|
|
21
|
+
client,
|
|
22
|
+
args.request,
|
|
23
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
24
|
+
).$inspect();
|
|
25
|
+
|
|
26
|
+
if (!result.ok) {
|
|
27
|
+
return {
|
|
28
|
+
content: [{ type: "text", text: result.error.message }],
|
|
29
|
+
isError: true,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const value = result.value;
|
|
34
|
+
|
|
35
|
+
return formatResult(value, apiCall);
|
|
36
|
+
},
|
|
37
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { vendorsGetVendorsDetails } from "../../funcs/vendorsGetVendorsDetails.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.GetVendorsDetailsRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$vendorsGetVendorsDetails: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "vendors-get-vendors-details",
|
|
15
|
+
description: `Get vendors details
|
|
16
|
+
|
|
17
|
+
Retrieve an individual vendor detais.
|
|
18
|
+
|
|
19
|
+
Available \`expand\` scopes are:
|
|
20
|
+
|
|
21
|
+
vendor.user
|
|
22
|
+
vendor.vendor_type
|
|
23
|
+
vendor.image_urls
|
|
24
|
+
vendor.payment_profile
|
|
25
|
+
vendor.primary_facility
|
|
26
|
+
vendor.primary_department
|
|
27
|
+
vendor.company
|
|
28
|
+
vendor.credentialing_subscription
|
|
29
|
+
vendor.scrubs_subscription
|
|
30
|
+
vendor.payment_responsibility
|
|
31
|
+
vendor.background_check_date_expires`,
|
|
32
|
+
args,
|
|
33
|
+
tool: async (client, args, ctx) => {
|
|
34
|
+
const [result, apiCall] = await vendorsGetVendorsDetails(
|
|
35
|
+
client,
|
|
36
|
+
args.request,
|
|
37
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
38
|
+
).$inspect();
|
|
39
|
+
|
|
40
|
+
if (!result.ok) {
|
|
41
|
+
return {
|
|
42
|
+
content: [{ type: "text", text: result.error.message }],
|
|
43
|
+
isError: true,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const value = result.value;
|
|
48
|
+
|
|
49
|
+
return formatResult(value, apiCall);
|
|
50
|
+
},
|
|
51
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { vendorsListVendorScrubDetails } from "../../funcs/vendorsListVendorScrubDetails.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.ListVendorScrubDetailsRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$vendorsListVendorScrubDetails: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "vendors-list-vendor-scrub-details",
|
|
15
|
+
description: `List vendor scrub details
|
|
16
|
+
|
|
17
|
+
List vendor scrub details`,
|
|
18
|
+
args,
|
|
19
|
+
tool: async (client, args, ctx) => {
|
|
20
|
+
const [result, apiCall] = await vendorsListVendorScrubDetails(
|
|
21
|
+
client,
|
|
22
|
+
args.request,
|
|
23
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
24
|
+
).$inspect();
|
|
25
|
+
|
|
26
|
+
if (!result.ok) {
|
|
27
|
+
return {
|
|
28
|
+
content: [{ type: "text", text: result.error.message }],
|
|
29
|
+
isError: true,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const value = result.value;
|
|
34
|
+
|
|
35
|
+
return formatResult(value, apiCall);
|
|
36
|
+
},
|
|
37
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { vendorsListVendorScrubPurchases } from "../../funcs/vendorsListVendorScrubPurchases.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.ListVendorScrubPurchasesRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$vendorsListVendorScrubPurchases: ToolDefinition<typeof args> =
|
|
14
|
+
{
|
|
15
|
+
name: "vendors-list-vendor-scrub-purchases",
|
|
16
|
+
description: `List vendor scrub purchases
|
|
17
|
+
|
|
18
|
+
List vendor scrub purchases`,
|
|
19
|
+
args,
|
|
20
|
+
tool: async (client, args, ctx) => {
|
|
21
|
+
const [result, apiCall] = await vendorsListVendorScrubPurchases(
|
|
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.result;
|
|
35
|
+
|
|
36
|
+
return formatResult(value, apiCall);
|
|
37
|
+
},
|
|
38
|
+
};
|
package/src/mcp-server/tools/{vendorsListVendorJobTitles.ts → webhooksGetWebhookEndpoint.ts}
RENAMED
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { webhooksGetWebhookEndpoint } from "../../funcs/webhooksGetWebhookEndpoint.js";
|
|
6
6
|
import * as operations from "../../models/operations/index.js";
|
|
7
7
|
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
8
|
|
|
9
9
|
const args = {
|
|
10
|
-
request: operations.
|
|
10
|
+
request: operations.GetWebhookEndpointRequest$inboundSchema,
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
export const tool$
|
|
14
|
-
name: "
|
|
15
|
-
description: `
|
|
13
|
+
export const tool$webhooksGetWebhookEndpoint: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "webhooks-get-webhook-endpoint",
|
|
15
|
+
description: `Retrieves the webhook endpoint with the given ID.
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Returns the definition of a webhook endpoint by ID.`,
|
|
18
18
|
args,
|
|
19
19
|
tool: async (client, args, ctx) => {
|
|
20
|
-
const [result, apiCall] = await
|
|
20
|
+
const [result, apiCall] = await webhooksGetWebhookEndpoint(
|
|
21
21
|
client,
|
|
22
22
|
args.request,
|
|
23
23
|
{ fetchOptions: { signal: ctx.signal } },
|
|
@@ -30,7 +30,7 @@ List valid job titles for Vendors. This can be used during sign up or in a filte
|
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
const value = result.value
|
|
33
|
+
const value = result.value;
|
|
34
34
|
|
|
35
35
|
return formatResult(value, apiCall);
|
|
36
36
|
},
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { webhooksListAllWebhookEndpoints } from "../../funcs/webhooksListAllWebhookEndpoints.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.ListAllWebhookEndpointsRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$webhooksListAllWebhookEndpoints: ToolDefinition<typeof args> =
|
|
14
|
+
{
|
|
15
|
+
name: "webhooks-list-all-webhook-endpoints",
|
|
16
|
+
description: `List all webhook endpoints
|
|
17
|
+
|
|
18
|
+
Returns a list of your webhook endpoints.`,
|
|
19
|
+
args,
|
|
20
|
+
tool: async (client, args, ctx) => {
|
|
21
|
+
const [result, apiCall] = await webhooksListAllWebhookEndpoints(
|
|
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
|
+
};
|
package/src/mcp-server/tools.ts
CHANGED
|
@@ -34,6 +34,7 @@ export type ToolDefinition<Args extends undefined | ZodRawShape = undefined> =
|
|
|
34
34
|
) => CallToolResult | Promise<CallToolResult>;
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
+
// Optional function to assist with formatting tool results
|
|
37
38
|
export async function formatResult(
|
|
38
39
|
value: unknown,
|
|
39
40
|
init: { response?: Response | undefined },
|
|
@@ -9,7 +9,7 @@ import { Result as SafeParseResult } from "../../types/fp.js";
|
|
|
9
9
|
import { RFCDate } from "../../types/rfcdate.js";
|
|
10
10
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
11
|
|
|
12
|
-
export type
|
|
12
|
+
export type CompanyLocation = {
|
|
13
13
|
address: string | null;
|
|
14
14
|
phone?: string | null | undefined;
|
|
15
15
|
city?: string | null | undefined;
|
|
@@ -48,15 +48,15 @@ export type Company = {
|
|
|
48
48
|
name: string | null;
|
|
49
49
|
status?: string | null | undefined;
|
|
50
50
|
creditBalance?: string | null | undefined;
|
|
51
|
-
location?:
|
|
51
|
+
location?: CompanyLocation | null | undefined;
|
|
52
52
|
contact?: CompanyContact | undefined;
|
|
53
53
|
tax?: Tax | undefined;
|
|
54
54
|
stats?: Stats | undefined;
|
|
55
55
|
};
|
|
56
56
|
|
|
57
57
|
/** @internal */
|
|
58
|
-
export const
|
|
59
|
-
|
|
58
|
+
export const CompanyLocation$inboundSchema: z.ZodType<
|
|
59
|
+
CompanyLocation,
|
|
60
60
|
z.ZodTypeDef,
|
|
61
61
|
unknown
|
|
62
62
|
> = z.object({
|
|
@@ -69,7 +69,7 @@ export const Location$inboundSchema: z.ZodType<
|
|
|
69
69
|
});
|
|
70
70
|
|
|
71
71
|
/** @internal */
|
|
72
|
-
export type
|
|
72
|
+
export type CompanyLocation$Outbound = {
|
|
73
73
|
address: string | null;
|
|
74
74
|
phone?: string | null | undefined;
|
|
75
75
|
city?: string | null | undefined;
|
|
@@ -79,10 +79,10 @@ export type Location$Outbound = {
|
|
|
79
79
|
};
|
|
80
80
|
|
|
81
81
|
/** @internal */
|
|
82
|
-
export const
|
|
83
|
-
|
|
82
|
+
export const CompanyLocation$outboundSchema: z.ZodType<
|
|
83
|
+
CompanyLocation$Outbound,
|
|
84
84
|
z.ZodTypeDef,
|
|
85
|
-
|
|
85
|
+
CompanyLocation
|
|
86
86
|
> = z.object({
|
|
87
87
|
address: z.nullable(z.string()),
|
|
88
88
|
phone: z.nullable(z.string()).optional(),
|
|
@@ -96,26 +96,28 @@ export const Location$outboundSchema: z.ZodType<
|
|
|
96
96
|
* @internal
|
|
97
97
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
98
98
|
*/
|
|
99
|
-
export namespace
|
|
100
|
-
/** @deprecated use `
|
|
101
|
-
export const inboundSchema =
|
|
102
|
-
/** @deprecated use `
|
|
103
|
-
export const outboundSchema =
|
|
104
|
-
/** @deprecated use `
|
|
105
|
-
export type Outbound =
|
|
99
|
+
export namespace CompanyLocation$ {
|
|
100
|
+
/** @deprecated use `CompanyLocation$inboundSchema` instead. */
|
|
101
|
+
export const inboundSchema = CompanyLocation$inboundSchema;
|
|
102
|
+
/** @deprecated use `CompanyLocation$outboundSchema` instead. */
|
|
103
|
+
export const outboundSchema = CompanyLocation$outboundSchema;
|
|
104
|
+
/** @deprecated use `CompanyLocation$Outbound` instead. */
|
|
105
|
+
export type Outbound = CompanyLocation$Outbound;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
export function
|
|
109
|
-
|
|
108
|
+
export function companyLocationToJSON(
|
|
109
|
+
companyLocation: CompanyLocation,
|
|
110
|
+
): string {
|
|
111
|
+
return JSON.stringify(CompanyLocation$outboundSchema.parse(companyLocation));
|
|
110
112
|
}
|
|
111
113
|
|
|
112
|
-
export function
|
|
114
|
+
export function companyLocationFromJSON(
|
|
113
115
|
jsonString: string,
|
|
114
|
-
): SafeParseResult<
|
|
116
|
+
): SafeParseResult<CompanyLocation, SDKValidationError> {
|
|
115
117
|
return safeParse(
|
|
116
118
|
jsonString,
|
|
117
|
-
(x) =>
|
|
118
|
-
`Failed to parse '
|
|
119
|
+
(x) => CompanyLocation$inboundSchema.parse(JSON.parse(x)),
|
|
120
|
+
`Failed to parse 'CompanyLocation' from JSON`,
|
|
119
121
|
);
|
|
120
122
|
}
|
|
121
123
|
|
|
@@ -333,7 +335,8 @@ export const Company$inboundSchema: z.ZodType<Company, z.ZodTypeDef, unknown> =
|
|
|
333
335
|
name: z.nullable(z.string()),
|
|
334
336
|
status: z.nullable(z.string()).optional(),
|
|
335
337
|
credit_balance: z.nullable(z.string()).optional(),
|
|
336
|
-
location: z.nullable(z.lazy(() =>
|
|
338
|
+
location: z.nullable(z.lazy(() => CompanyLocation$inboundSchema))
|
|
339
|
+
.optional(),
|
|
337
340
|
contact: z.lazy(() => CompanyContact$inboundSchema).optional(),
|
|
338
341
|
tax: z.lazy(() => Tax$inboundSchema).optional(),
|
|
339
342
|
stats: z.lazy(() => Stats$inboundSchema).optional(),
|
|
@@ -349,7 +352,7 @@ export type Company$Outbound = {
|
|
|
349
352
|
name: string | null;
|
|
350
353
|
status?: string | null | undefined;
|
|
351
354
|
credit_balance?: string | null | undefined;
|
|
352
|
-
location?:
|
|
355
|
+
location?: CompanyLocation$Outbound | null | undefined;
|
|
353
356
|
contact?: CompanyContact$Outbound | undefined;
|
|
354
357
|
tax?: Tax$Outbound | undefined;
|
|
355
358
|
stats?: Stats$Outbound | undefined;
|
|
@@ -365,7 +368,7 @@ export const Company$outboundSchema: z.ZodType<
|
|
|
365
368
|
name: z.nullable(z.string()),
|
|
366
369
|
status: z.nullable(z.string()).optional(),
|
|
367
370
|
creditBalance: z.nullable(z.string()).optional(),
|
|
368
|
-
location: z.nullable(z.lazy(() =>
|
|
371
|
+
location: z.nullable(z.lazy(() => CompanyLocation$outboundSchema)).optional(),
|
|
369
372
|
contact: z.lazy(() => CompanyContact$outboundSchema).optional(),
|
|
370
373
|
tax: z.lazy(() => Tax$outboundSchema).optional(),
|
|
371
374
|
stats: z.lazy(() => Stats$outboundSchema).optional(),
|
|
@@ -37,7 +37,7 @@ export const Status = {
|
|
|
37
37
|
} as const;
|
|
38
38
|
export type Status = ClosedEnum<typeof Status>;
|
|
39
39
|
|
|
40
|
-
export type
|
|
40
|
+
export type ContactDepartment = DepartmentSummary | number;
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* This object represents a contact at the system or facility level. Use it to verify vendors, create appointments, or check in visitors.
|
|
@@ -157,46 +157,50 @@ export namespace Status$ {
|
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
/** @internal */
|
|
160
|
-
export const
|
|
161
|
-
|
|
160
|
+
export const ContactDepartment$inboundSchema: z.ZodType<
|
|
161
|
+
ContactDepartment,
|
|
162
162
|
z.ZodTypeDef,
|
|
163
163
|
unknown
|
|
164
164
|
> = z.union([DepartmentSummary$inboundSchema, z.number().int()]);
|
|
165
165
|
|
|
166
166
|
/** @internal */
|
|
167
|
-
export type
|
|
167
|
+
export type ContactDepartment$Outbound = DepartmentSummary$Outbound | number;
|
|
168
168
|
|
|
169
169
|
/** @internal */
|
|
170
|
-
export const
|
|
171
|
-
|
|
170
|
+
export const ContactDepartment$outboundSchema: z.ZodType<
|
|
171
|
+
ContactDepartment$Outbound,
|
|
172
172
|
z.ZodTypeDef,
|
|
173
|
-
|
|
173
|
+
ContactDepartment
|
|
174
174
|
> = z.union([DepartmentSummary$outboundSchema, z.number().int()]);
|
|
175
175
|
|
|
176
176
|
/**
|
|
177
177
|
* @internal
|
|
178
178
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
179
179
|
*/
|
|
180
|
-
export namespace
|
|
181
|
-
/** @deprecated use `
|
|
182
|
-
export const inboundSchema =
|
|
183
|
-
/** @deprecated use `
|
|
184
|
-
export const outboundSchema =
|
|
185
|
-
/** @deprecated use `
|
|
186
|
-
export type Outbound =
|
|
180
|
+
export namespace ContactDepartment$ {
|
|
181
|
+
/** @deprecated use `ContactDepartment$inboundSchema` instead. */
|
|
182
|
+
export const inboundSchema = ContactDepartment$inboundSchema;
|
|
183
|
+
/** @deprecated use `ContactDepartment$outboundSchema` instead. */
|
|
184
|
+
export const outboundSchema = ContactDepartment$outboundSchema;
|
|
185
|
+
/** @deprecated use `ContactDepartment$Outbound` instead. */
|
|
186
|
+
export type Outbound = ContactDepartment$Outbound;
|
|
187
187
|
}
|
|
188
188
|
|
|
189
|
-
export function
|
|
190
|
-
|
|
189
|
+
export function contactDepartmentToJSON(
|
|
190
|
+
contactDepartment: ContactDepartment,
|
|
191
|
+
): string {
|
|
192
|
+
return JSON.stringify(
|
|
193
|
+
ContactDepartment$outboundSchema.parse(contactDepartment),
|
|
194
|
+
);
|
|
191
195
|
}
|
|
192
196
|
|
|
193
|
-
export function
|
|
197
|
+
export function contactDepartmentFromJSON(
|
|
194
198
|
jsonString: string,
|
|
195
|
-
): SafeParseResult<
|
|
199
|
+
): SafeParseResult<ContactDepartment, SDKValidationError> {
|
|
196
200
|
return safeParse(
|
|
197
201
|
jsonString,
|
|
198
|
-
(x) =>
|
|
199
|
-
`Failed to parse '
|
|
202
|
+
(x) => ContactDepartment$inboundSchema.parse(JSON.parse(x)),
|
|
203
|
+
`Failed to parse 'ContactDepartment' from JSON`,
|
|
200
204
|
);
|
|
201
205
|
}
|
|
202
206
|
|