@greensecurity/javascript-sdk 0.35.33 → 0.35.45
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 +9 -0
- package/bin/mcp-server.js +1870 -1146
- package/bin/mcp-server.js.map +29 -20
- package/dist/commonjs/__tests__/invoices.test.js +15 -0
- package/dist/commonjs/__tests__/invoices.test.js.map +1 -1
- package/dist/commonjs/__tests__/vendors.test.js +15 -0
- package/dist/commonjs/__tests__/vendors.test.js.map +1 -1
- package/dist/commonjs/__tests__/webhooks.test.js +1 -1
- package/dist/commonjs/__tests__/webhooks.test.js.map +1 -1
- package/dist/commonjs/__tests__/zones.test.js +21 -19
- package/dist/commonjs/__tests__/zones.test.js.map +1 -1
- package/dist/commonjs/admin-funcs/adminGetInvoice.d.ts +13 -0
- package/dist/commonjs/admin-funcs/adminGetInvoice.d.ts.map +1 -0
- package/dist/commonjs/admin-funcs/adminGetInvoice.js +17 -0
- package/dist/commonjs/admin-funcs/adminGetInvoice.js.map +1 -0
- package/dist/commonjs/admin-funcs/doAdmin.d.ts +2 -2
- package/dist/commonjs/admin-funcs/doAdmin.d.ts.map +1 -1
- package/dist/commonjs/admin-funcs/doAdmin.js +18 -19
- package/dist/commonjs/admin-funcs/doAdmin.js.map +1 -1
- package/dist/commonjs/admin-funcs/facilitiesGetInvoice.d.ts +2 -3
- package/dist/commonjs/admin-funcs/facilitiesGetInvoice.d.ts.map +1 -1
- package/dist/commonjs/admin-funcs/facilitiesGetInvoice.js +4 -2
- package/dist/commonjs/admin-funcs/facilitiesGetInvoice.js.map +1 -1
- package/dist/commonjs/admin-funcs/initializeCore.d.ts +5 -0
- package/dist/commonjs/admin-funcs/initializeCore.d.ts.map +1 -0
- package/dist/commonjs/admin-funcs/initializeCore.js +23 -0
- package/dist/commonjs/admin-funcs/initializeCore.js.map +1 -0
- package/dist/commonjs/funcs/invoicesCreateInvoice.d.ts +26 -0
- package/dist/commonjs/funcs/invoicesCreateInvoice.d.ts.map +1 -0
- package/dist/commonjs/funcs/invoicesCreateInvoice.js +126 -0
- package/dist/commonjs/funcs/invoicesCreateInvoice.js.map +1 -0
- package/dist/commonjs/funcs/vendorsAcceptVendorCredential.d.ts +17 -0
- package/dist/commonjs/funcs/vendorsAcceptVendorCredential.d.ts.map +1 -0
- package/dist/commonjs/funcs/vendorsAcceptVendorCredential.js +120 -0
- package/dist/commonjs/funcs/vendorsAcceptVendorCredential.js.map +1 -0
- package/dist/commonjs/funcs/zonesGetSecurityZone.d.ts +18 -0
- package/dist/commonjs/funcs/zonesGetSecurityZone.d.ts.map +1 -0
- package/dist/commonjs/funcs/zonesGetSecurityZone.js +123 -0
- package/dist/commonjs/funcs/zonesGetSecurityZone.js.map +1 -0
- package/dist/commonjs/index.extras.d.ts +4 -0
- package/dist/commonjs/index.extras.d.ts.map +1 -1
- package/dist/commonjs/index.extras.js +6 -1
- package/dist/commonjs/index.extras.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/lib/encodings.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/server.js +7 -1
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/invoicesCreateInvoice.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/invoicesCreateInvoice.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/invoicesCreateInvoice.js +73 -0
- package/dist/commonjs/mcp-server/tools/invoicesCreateInvoice.js.map +1 -0
- package/dist/commonjs/mcp-server/tools/vendorsAcceptVendorCredential.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/vendorsAcceptVendorCredential.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/vendorsAcceptVendorCredential.js +64 -0
- package/dist/commonjs/mcp-server/tools/vendorsAcceptVendorCredential.js.map +1 -0
- package/dist/commonjs/mcp-server/tools/zonesGetSecurityZone.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/zonesGetSecurityZone.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/zonesGetSecurityZone.js +64 -0
- package/dist/commonjs/mcp-server/tools/zonesGetSecurityZone.js.map +1 -0
- package/dist/commonjs/models/operations/acceptvendorcredential.d.ts +32 -0
- package/dist/commonjs/models/operations/acceptvendorcredential.d.ts.map +1 -0
- package/dist/commonjs/models/operations/acceptvendorcredential.js +78 -0
- package/dist/commonjs/models/operations/acceptvendorcredential.js.map +1 -0
- package/dist/commonjs/models/operations/createinvoice.d.ts +441 -0
- package/dist/commonjs/models/operations/createinvoice.d.ts.map +1 -0
- package/dist/commonjs/models/operations/createinvoice.js +604 -0
- package/dist/commonjs/models/operations/createinvoice.js.map +1 -0
- package/dist/commonjs/models/operations/getsecurityzone.d.ts +32 -0
- package/dist/commonjs/models/operations/getsecurityzone.d.ts.map +1 -0
- package/dist/commonjs/models/operations/getsecurityzone.js +69 -0
- package/dist/commonjs/models/operations/getsecurityzone.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +3 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +3 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/updateinvoice.d.ts +148 -148
- package/dist/commonjs/models/operations/updateinvoice.d.ts.map +1 -1
- package/dist/commonjs/models/operations/updateinvoice.js +196 -195
- package/dist/commonjs/models/operations/updateinvoice.js.map +1 -1
- package/dist/commonjs/react-query/index.d.ts +3 -0
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +3 -0
- package/dist/commonjs/react-query/index.js.map +1 -1
- package/dist/commonjs/react-query/invoicesCreateInvoice.d.ts +32 -0
- package/dist/commonjs/react-query/invoicesCreateInvoice.d.ts.map +1 -0
- package/dist/commonjs/react-query/invoicesCreateInvoice.js +56 -0
- package/dist/commonjs/react-query/invoicesCreateInvoice.js.map +1 -0
- package/dist/commonjs/react-query/vendorsAcceptVendorCredential.d.ts +23 -0
- package/dist/commonjs/react-query/vendorsAcceptVendorCredential.d.ts.map +1 -0
- package/dist/commonjs/react-query/vendorsAcceptVendorCredential.js +47 -0
- package/dist/commonjs/react-query/vendorsAcceptVendorCredential.js.map +1 -0
- package/dist/commonjs/react-query/zonesGetSecurityZone.d.ts +31 -0
- package/dist/commonjs/react-query/zonesGetSecurityZone.d.ts.map +1 -0
- package/dist/commonjs/react-query/zonesGetSecurityZone.js +87 -0
- package/dist/commonjs/react-query/zonesGetSecurityZone.js.map +1 -0
- package/dist/commonjs/sdk/invoices.d.ts +16 -0
- package/dist/commonjs/sdk/invoices.d.ts.map +1 -1
- package/dist/commonjs/sdk/invoices.js +19 -0
- package/dist/commonjs/sdk/invoices.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/commonjs/sdk/zones.d.ts +8 -0
- package/dist/commonjs/sdk/zones.d.ts.map +1 -1
- package/dist/commonjs/sdk/zones.js +10 -0
- package/dist/commonjs/sdk/zones.js.map +1 -1
- package/dist/esm/__tests__/invoices.test.js +15 -0
- package/dist/esm/__tests__/invoices.test.js.map +1 -1
- package/dist/esm/__tests__/vendors.test.js +15 -0
- package/dist/esm/__tests__/vendors.test.js.map +1 -1
- package/dist/esm/__tests__/webhooks.test.js +1 -1
- package/dist/esm/__tests__/webhooks.test.js.map +1 -1
- package/dist/esm/__tests__/zones.test.js +21 -19
- package/dist/esm/__tests__/zones.test.js.map +1 -1
- package/dist/esm/admin-funcs/adminGetInvoice.d.ts +13 -0
- package/dist/esm/admin-funcs/adminGetInvoice.d.ts.map +1 -0
- package/dist/esm/admin-funcs/adminGetInvoice.js +14 -0
- package/dist/esm/admin-funcs/adminGetInvoice.js.map +1 -0
- package/dist/esm/admin-funcs/doAdmin.d.ts +2 -2
- package/dist/esm/admin-funcs/doAdmin.d.ts.map +1 -1
- package/dist/esm/admin-funcs/doAdmin.js +17 -19
- package/dist/esm/admin-funcs/doAdmin.js.map +1 -1
- package/dist/esm/admin-funcs/facilitiesGetInvoice.d.ts +2 -3
- package/dist/esm/admin-funcs/facilitiesGetInvoice.d.ts.map +1 -1
- package/dist/esm/admin-funcs/facilitiesGetInvoice.js +4 -2
- package/dist/esm/admin-funcs/facilitiesGetInvoice.js.map +1 -1
- package/dist/esm/admin-funcs/initializeCore.d.ts +5 -0
- package/dist/esm/admin-funcs/initializeCore.d.ts.map +1 -0
- package/dist/esm/admin-funcs/initializeCore.js +17 -0
- package/dist/esm/admin-funcs/initializeCore.js.map +1 -0
- package/dist/esm/funcs/invoicesCreateInvoice.d.ts +26 -0
- package/dist/esm/funcs/invoicesCreateInvoice.d.ts.map +1 -0
- package/dist/esm/funcs/invoicesCreateInvoice.js +90 -0
- package/dist/esm/funcs/invoicesCreateInvoice.js.map +1 -0
- package/dist/esm/funcs/vendorsAcceptVendorCredential.d.ts +17 -0
- package/dist/esm/funcs/vendorsAcceptVendorCredential.d.ts.map +1 -0
- package/dist/esm/funcs/vendorsAcceptVendorCredential.js +84 -0
- package/dist/esm/funcs/vendorsAcceptVendorCredential.js.map +1 -0
- package/dist/esm/funcs/zonesGetSecurityZone.d.ts +18 -0
- package/dist/esm/funcs/zonesGetSecurityZone.d.ts.map +1 -0
- package/dist/esm/funcs/zonesGetSecurityZone.js +87 -0
- package/dist/esm/funcs/zonesGetSecurityZone.js.map +1 -0
- package/dist/esm/index.extras.d.ts +4 -0
- package/dist/esm/index.extras.d.ts.map +1 -1
- package/dist/esm/index.extras.js +6 -1
- package/dist/esm/index.extras.js.map +1 -1
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/lib/encodings.d.ts.map +1 -1
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.d.ts.map +1 -1
- package/dist/esm/mcp-server/server.js +7 -1
- package/dist/esm/mcp-server/server.js.map +1 -1
- package/dist/esm/mcp-server/tools/invoicesCreateInvoice.d.ts +8 -0
- package/dist/esm/mcp-server/tools/invoicesCreateInvoice.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/invoicesCreateInvoice.js +37 -0
- package/dist/esm/mcp-server/tools/invoicesCreateInvoice.js.map +1 -0
- package/dist/esm/mcp-server/tools/vendorsAcceptVendorCredential.d.ts +8 -0
- package/dist/esm/mcp-server/tools/vendorsAcceptVendorCredential.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/vendorsAcceptVendorCredential.js +28 -0
- package/dist/esm/mcp-server/tools/vendorsAcceptVendorCredential.js.map +1 -0
- package/dist/esm/mcp-server/tools/zonesGetSecurityZone.d.ts +8 -0
- package/dist/esm/mcp-server/tools/zonesGetSecurityZone.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/zonesGetSecurityZone.js +28 -0
- package/dist/esm/mcp-server/tools/zonesGetSecurityZone.js.map +1 -0
- package/dist/esm/models/operations/acceptvendorcredential.d.ts +32 -0
- package/dist/esm/models/operations/acceptvendorcredential.d.ts.map +1 -0
- package/dist/esm/models/operations/acceptvendorcredential.js +40 -0
- package/dist/esm/models/operations/acceptvendorcredential.js.map +1 -0
- package/dist/esm/models/operations/createinvoice.d.ts +441 -0
- package/dist/esm/models/operations/createinvoice.d.ts.map +1 -0
- package/dist/esm/models/operations/createinvoice.js +548 -0
- package/dist/esm/models/operations/createinvoice.js.map +1 -0
- package/dist/esm/models/operations/getsecurityzone.d.ts +32 -0
- package/dist/esm/models/operations/getsecurityzone.d.ts.map +1 -0
- package/dist/esm/models/operations/getsecurityzone.js +31 -0
- package/dist/esm/models/operations/getsecurityzone.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +3 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +3 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/updateinvoice.d.ts +148 -148
- package/dist/esm/models/operations/updateinvoice.d.ts.map +1 -1
- package/dist/esm/models/operations/updateinvoice.js +183 -182
- package/dist/esm/models/operations/updateinvoice.js.map +1 -1
- package/dist/esm/react-query/index.d.ts +3 -0
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +3 -0
- package/dist/esm/react-query/index.js.map +1 -1
- package/dist/esm/react-query/invoicesCreateInvoice.d.ts +32 -0
- package/dist/esm/react-query/invoicesCreateInvoice.d.ts.map +1 -0
- package/dist/esm/react-query/invoicesCreateInvoice.js +51 -0
- package/dist/esm/react-query/invoicesCreateInvoice.js.map +1 -0
- package/dist/esm/react-query/vendorsAcceptVendorCredential.d.ts +23 -0
- package/dist/esm/react-query/vendorsAcceptVendorCredential.d.ts.map +1 -0
- package/dist/esm/react-query/vendorsAcceptVendorCredential.js +42 -0
- package/dist/esm/react-query/vendorsAcceptVendorCredential.js.map +1 -0
- package/dist/esm/react-query/zonesGetSecurityZone.d.ts +31 -0
- package/dist/esm/react-query/zonesGetSecurityZone.d.ts.map +1 -0
- package/dist/esm/react-query/zonesGetSecurityZone.js +77 -0
- package/dist/esm/react-query/zonesGetSecurityZone.js.map +1 -0
- package/dist/esm/sdk/invoices.d.ts +16 -0
- package/dist/esm/sdk/invoices.d.ts.map +1 -1
- package/dist/esm/sdk/invoices.js +19 -0
- package/dist/esm/sdk/invoices.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/dist/esm/sdk/zones.d.ts +8 -0
- package/dist/esm/sdk/zones.d.ts.map +1 -1
- package/dist/esm/sdk/zones.js +10 -0
- package/dist/esm/sdk/zones.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/__tests__/invoices.test.ts +18 -0
- package/src/__tests__/vendors.test.ts +18 -0
- package/src/__tests__/webhooks.test.ts +1 -1
- package/src/__tests__/zones.test.ts +24 -19
- package/src/admin-funcs/adminGetInvoice.ts +22 -0
- package/src/admin-funcs/doAdmin.ts +18 -24
- package/src/admin-funcs/facilitiesGetInvoice.ts +7 -11
- package/src/admin-funcs/initializeCore.ts +20 -0
- package/src/funcs/invoicesCreateInvoice.ts +174 -0
- package/src/funcs/vendorsAcceptVendorCredential.ts +176 -0
- package/src/funcs/zonesGetSecurityZone.ts +172 -0
- package/src/index.extras.ts +7 -2
- package/src/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +7 -1
- package/src/mcp-server/tools/invoicesCreateInvoice.ts +46 -0
- package/src/mcp-server/tools/vendorsAcceptVendorCredential.ts +37 -0
- package/src/mcp-server/tools/zonesGetSecurityZone.ts +37 -0
- package/src/models/operations/acceptvendorcredential.ts +80 -0
- package/src/models/operations/createinvoice.ts +980 -0
- package/src/models/operations/getsecurityzone.ts +69 -0
- package/src/models/operations/index.ts +3 -0
- package/src/models/operations/updateinvoice.ts +491 -403
- package/src/react-query/index.ts +3 -0
- package/src/react-query/invoicesCreateInvoice.ts +98 -0
- package/src/react-query/vendorsAcceptVendorCredential.ts +88 -0
- package/src/react-query/zonesGetSecurityZone.ts +154 -0
- package/src/sdk/invoices.ts +27 -0
- package/src/sdk/vendors.ts +18 -0
- package/src/sdk/zones.ts +19 -0
package/src/react-query/index.ts
CHANGED
|
@@ -9,6 +9,7 @@ export * from "./companiesListOrSearchCompanies.js";
|
|
|
9
9
|
export * from "./dataRequestsAddDataRequestFile.js";
|
|
10
10
|
export * from "./dataRequestsDeleteDataRequestFile.js";
|
|
11
11
|
export * from "./dataRequestsUpdateDataRequest.js";
|
|
12
|
+
export * from "./invoicesCreateInvoice.js";
|
|
12
13
|
export * from "./invoicesMakePayment.js";
|
|
13
14
|
export * from "./invoicesUpdateInvoice.js";
|
|
14
15
|
export * from "./organizationsGetFacility.js";
|
|
@@ -22,6 +23,7 @@ export * from "./usersMagiclink.js";
|
|
|
22
23
|
export * from "./usersPassword.js";
|
|
23
24
|
export * from "./usersPasswordResetRequest.js";
|
|
24
25
|
export * from "./usersPostAuthenticate.js";
|
|
26
|
+
export * from "./vendorsAcceptVendorCredential.js";
|
|
25
27
|
export * from "./vendorsAddVendorCredentialFile.js";
|
|
26
28
|
export * from "./vendorsAddVendorManagedByCompany.js";
|
|
27
29
|
export * from "./vendorScansVendorScanOut.js";
|
|
@@ -63,5 +65,6 @@ export * from "./vendorsUpdateVendorScrubDetails.js";
|
|
|
63
65
|
export * from "./webhooksGetWebhookEndpoint.js";
|
|
64
66
|
export * from "./webhooksListAllWebhookEndpoints.js";
|
|
65
67
|
export * from "./webhooksUpdatesTheWebhookEndpointWithTheGivenId.js";
|
|
68
|
+
export * from "./zonesGetSecurityZone.js";
|
|
66
69
|
export * from "./zonesListOrSearchSecurityZones.js";
|
|
67
70
|
export * from "./zonesSecurityZoneCheckin.js";
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
MutationKey,
|
|
7
|
+
useMutation,
|
|
8
|
+
UseMutationResult,
|
|
9
|
+
} from "@tanstack/react-query";
|
|
10
|
+
import { GreenSecurityCore } from "../core.js";
|
|
11
|
+
import { invoicesCreateInvoice } from "../funcs/invoicesCreateInvoice.js";
|
|
12
|
+
import { combineSignals } from "../lib/primitives.js";
|
|
13
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
14
|
+
import * as operations from "../models/operations/index.js";
|
|
15
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
16
|
+
import { useGreenSecurityContext } from "./_context.js";
|
|
17
|
+
import { MutationHookOptions } from "./_types.js";
|
|
18
|
+
|
|
19
|
+
export type InvoicesCreateInvoiceMutationVariables = {
|
|
20
|
+
request: operations.CreateInvoiceRequestBody;
|
|
21
|
+
options?: RequestOptions;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type InvoicesCreateInvoiceMutationData =
|
|
25
|
+
operations.CreateInvoiceResponseBody;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Create invoice
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* It will create an invoice based on the lines passed as parameter.
|
|
32
|
+
* - Exactly one of vendor_id, company_id, facility_id, or system_id must be provided. - variant_id is required for the line - payment_handler_data must be set in the following format:
|
|
33
|
+
* 1. for the 'vendor credential' and 'expedited credential' payment_handlers this should be a JSON
|
|
34
|
+
* with a key 'vendor_credential_id' and value as integer
|
|
35
|
+
* 2. for the 'credentialing subscription' payment handler this should be a JSON
|
|
36
|
+
* with the following keys and values:
|
|
37
|
+
* - old_vendor_type_id: required, must be nil or integer
|
|
38
|
+
* - new_vendor_type_id: required, must be integer
|
|
39
|
+
* - old_facility_ids: required, must be an array of integers (can be empty)
|
|
40
|
+
* - new_facility_ids: required, must be array of integers
|
|
41
|
+
*/
|
|
42
|
+
export function useInvoicesCreateInvoiceMutation(
|
|
43
|
+
options?: MutationHookOptions<
|
|
44
|
+
InvoicesCreateInvoiceMutationData,
|
|
45
|
+
Error,
|
|
46
|
+
InvoicesCreateInvoiceMutationVariables
|
|
47
|
+
>,
|
|
48
|
+
): UseMutationResult<
|
|
49
|
+
InvoicesCreateInvoiceMutationData,
|
|
50
|
+
Error,
|
|
51
|
+
InvoicesCreateInvoiceMutationVariables
|
|
52
|
+
> {
|
|
53
|
+
const client = useGreenSecurityContext();
|
|
54
|
+
return useMutation({
|
|
55
|
+
...buildInvoicesCreateInvoiceMutation(client, options),
|
|
56
|
+
...options,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function mutationKeyInvoicesCreateInvoice(): MutationKey {
|
|
61
|
+
return ["@greensecurity/javascript-sdk", "invoices", "createInvoice"];
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function buildInvoicesCreateInvoiceMutation(
|
|
65
|
+
client$: GreenSecurityCore,
|
|
66
|
+
hookOptions?: RequestOptions,
|
|
67
|
+
): {
|
|
68
|
+
mutationKey: MutationKey;
|
|
69
|
+
mutationFn: (
|
|
70
|
+
variables: InvoicesCreateInvoiceMutationVariables,
|
|
71
|
+
) => Promise<InvoicesCreateInvoiceMutationData>;
|
|
72
|
+
} {
|
|
73
|
+
return {
|
|
74
|
+
mutationKey: mutationKeyInvoicesCreateInvoice(),
|
|
75
|
+
mutationFn: function invoicesCreateInvoiceMutationFn({
|
|
76
|
+
request,
|
|
77
|
+
options,
|
|
78
|
+
}): Promise<InvoicesCreateInvoiceMutationData> {
|
|
79
|
+
const mergedOptions = {
|
|
80
|
+
...hookOptions,
|
|
81
|
+
...options,
|
|
82
|
+
fetchOptions: {
|
|
83
|
+
...hookOptions?.fetchOptions,
|
|
84
|
+
...options?.fetchOptions,
|
|
85
|
+
signal: combineSignals(
|
|
86
|
+
hookOptions?.fetchOptions?.signal,
|
|
87
|
+
options?.fetchOptions?.signal,
|
|
88
|
+
),
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
return unwrapAsync(invoicesCreateInvoice(
|
|
92
|
+
client$,
|
|
93
|
+
request,
|
|
94
|
+
mergedOptions,
|
|
95
|
+
));
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
MutationKey,
|
|
7
|
+
useMutation,
|
|
8
|
+
UseMutationResult,
|
|
9
|
+
} from "@tanstack/react-query";
|
|
10
|
+
import { GreenSecurityCore } from "../core.js";
|
|
11
|
+
import { vendorsAcceptVendorCredential } from "../funcs/vendorsAcceptVendorCredential.js";
|
|
12
|
+
import { combineSignals } from "../lib/primitives.js";
|
|
13
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
14
|
+
import * as operations from "../models/operations/index.js";
|
|
15
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
16
|
+
import { useGreenSecurityContext } from "./_context.js";
|
|
17
|
+
import { MutationHookOptions } from "./_types.js";
|
|
18
|
+
|
|
19
|
+
export type VendorsAcceptVendorCredentialMutationVariables = {
|
|
20
|
+
request: operations.AcceptVendorCredentialRequest;
|
|
21
|
+
options?: RequestOptions;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type VendorsAcceptVendorCredentialMutationData = boolean;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Accept vendor credential
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* It will accept vendor credential
|
|
31
|
+
*/
|
|
32
|
+
export function useVendorsAcceptVendorCredentialMutation(
|
|
33
|
+
options?: MutationHookOptions<
|
|
34
|
+
VendorsAcceptVendorCredentialMutationData,
|
|
35
|
+
Error,
|
|
36
|
+
VendorsAcceptVendorCredentialMutationVariables
|
|
37
|
+
>,
|
|
38
|
+
): UseMutationResult<
|
|
39
|
+
VendorsAcceptVendorCredentialMutationData,
|
|
40
|
+
Error,
|
|
41
|
+
VendorsAcceptVendorCredentialMutationVariables
|
|
42
|
+
> {
|
|
43
|
+
const client = useGreenSecurityContext();
|
|
44
|
+
return useMutation({
|
|
45
|
+
...buildVendorsAcceptVendorCredentialMutation(client, options),
|
|
46
|
+
...options,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function mutationKeyVendorsAcceptVendorCredential(): MutationKey {
|
|
51
|
+
return ["@greensecurity/javascript-sdk", "vendors", "acceptVendorCredential"];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function buildVendorsAcceptVendorCredentialMutation(
|
|
55
|
+
client$: GreenSecurityCore,
|
|
56
|
+
hookOptions?: RequestOptions,
|
|
57
|
+
): {
|
|
58
|
+
mutationKey: MutationKey;
|
|
59
|
+
mutationFn: (
|
|
60
|
+
variables: VendorsAcceptVendorCredentialMutationVariables,
|
|
61
|
+
) => Promise<VendorsAcceptVendorCredentialMutationData>;
|
|
62
|
+
} {
|
|
63
|
+
return {
|
|
64
|
+
mutationKey: mutationKeyVendorsAcceptVendorCredential(),
|
|
65
|
+
mutationFn: function vendorsAcceptVendorCredentialMutationFn({
|
|
66
|
+
request,
|
|
67
|
+
options,
|
|
68
|
+
}): Promise<VendorsAcceptVendorCredentialMutationData> {
|
|
69
|
+
const mergedOptions = {
|
|
70
|
+
...hookOptions,
|
|
71
|
+
...options,
|
|
72
|
+
fetchOptions: {
|
|
73
|
+
...hookOptions?.fetchOptions,
|
|
74
|
+
...options?.fetchOptions,
|
|
75
|
+
signal: combineSignals(
|
|
76
|
+
hookOptions?.fetchOptions?.signal,
|
|
77
|
+
options?.fetchOptions?.signal,
|
|
78
|
+
),
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
return unwrapAsync(vendorsAcceptVendorCredential(
|
|
82
|
+
client$,
|
|
83
|
+
request,
|
|
84
|
+
mergedOptions,
|
|
85
|
+
));
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
InvalidateQueryFilters,
|
|
7
|
+
QueryClient,
|
|
8
|
+
QueryFunctionContext,
|
|
9
|
+
QueryKey,
|
|
10
|
+
useQuery,
|
|
11
|
+
UseQueryResult,
|
|
12
|
+
useSuspenseQuery,
|
|
13
|
+
UseSuspenseQueryResult,
|
|
14
|
+
} from "@tanstack/react-query";
|
|
15
|
+
import { GreenSecurityCore } from "../core.js";
|
|
16
|
+
import { zonesGetSecurityZone } from "../funcs/zonesGetSecurityZone.js";
|
|
17
|
+
import { combineSignals } from "../lib/primitives.js";
|
|
18
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
19
|
+
import * as components from "../models/components/index.js";
|
|
20
|
+
import * as operations from "../models/operations/index.js";
|
|
21
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
22
|
+
import { useGreenSecurityContext } from "./_context.js";
|
|
23
|
+
import {
|
|
24
|
+
QueryHookOptions,
|
|
25
|
+
SuspenseQueryHookOptions,
|
|
26
|
+
TupleToPrefixes,
|
|
27
|
+
} from "./_types.js";
|
|
28
|
+
|
|
29
|
+
export type ZonesGetSecurityZoneQueryData = components.Zone;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Get security zone details
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* Get security zone details
|
|
36
|
+
*/
|
|
37
|
+
export function useZonesGetSecurityZone(
|
|
38
|
+
request: operations.GetSecurityZoneRequest,
|
|
39
|
+
options?: QueryHookOptions<ZonesGetSecurityZoneQueryData>,
|
|
40
|
+
): UseQueryResult<ZonesGetSecurityZoneQueryData, Error> {
|
|
41
|
+
const client = useGreenSecurityContext();
|
|
42
|
+
return useQuery({
|
|
43
|
+
...buildZonesGetSecurityZoneQuery(
|
|
44
|
+
client,
|
|
45
|
+
request,
|
|
46
|
+
options,
|
|
47
|
+
),
|
|
48
|
+
...options,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Get security zone details
|
|
54
|
+
*
|
|
55
|
+
* @remarks
|
|
56
|
+
* Get security zone details
|
|
57
|
+
*/
|
|
58
|
+
export function useZonesGetSecurityZoneSuspense(
|
|
59
|
+
request: operations.GetSecurityZoneRequest,
|
|
60
|
+
options?: SuspenseQueryHookOptions<ZonesGetSecurityZoneQueryData>,
|
|
61
|
+
): UseSuspenseQueryResult<ZonesGetSecurityZoneQueryData, Error> {
|
|
62
|
+
const client = useGreenSecurityContext();
|
|
63
|
+
return useSuspenseQuery({
|
|
64
|
+
...buildZonesGetSecurityZoneQuery(
|
|
65
|
+
client,
|
|
66
|
+
request,
|
|
67
|
+
options,
|
|
68
|
+
),
|
|
69
|
+
...options,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function prefetchZonesGetSecurityZone(
|
|
74
|
+
queryClient: QueryClient,
|
|
75
|
+
client$: GreenSecurityCore,
|
|
76
|
+
request: operations.GetSecurityZoneRequest,
|
|
77
|
+
): Promise<void> {
|
|
78
|
+
return queryClient.prefetchQuery({
|
|
79
|
+
...buildZonesGetSecurityZoneQuery(
|
|
80
|
+
client$,
|
|
81
|
+
request,
|
|
82
|
+
),
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function setZonesGetSecurityZoneData(
|
|
87
|
+
client: QueryClient,
|
|
88
|
+
queryKeyBase: [id: number],
|
|
89
|
+
data: ZonesGetSecurityZoneQueryData,
|
|
90
|
+
): ZonesGetSecurityZoneQueryData | undefined {
|
|
91
|
+
const key = queryKeyZonesGetSecurityZone(...queryKeyBase);
|
|
92
|
+
|
|
93
|
+
return client.setQueryData<ZonesGetSecurityZoneQueryData>(key, data);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function invalidateZonesGetSecurityZone(
|
|
97
|
+
client: QueryClient,
|
|
98
|
+
queryKeyBase: TupleToPrefixes<[id: number]>,
|
|
99
|
+
filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
|
|
100
|
+
): Promise<void> {
|
|
101
|
+
return client.invalidateQueries({
|
|
102
|
+
...filters,
|
|
103
|
+
queryKey: [
|
|
104
|
+
"@greensecurity/javascript-sdk",
|
|
105
|
+
"zones",
|
|
106
|
+
"getSecurityZone",
|
|
107
|
+
...queryKeyBase,
|
|
108
|
+
],
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function invalidateAllZonesGetSecurityZone(
|
|
113
|
+
client: QueryClient,
|
|
114
|
+
filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
|
|
115
|
+
): Promise<void> {
|
|
116
|
+
return client.invalidateQueries({
|
|
117
|
+
...filters,
|
|
118
|
+
queryKey: ["@greensecurity/javascript-sdk", "zones", "getSecurityZone"],
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export function buildZonesGetSecurityZoneQuery(
|
|
123
|
+
client$: GreenSecurityCore,
|
|
124
|
+
request: operations.GetSecurityZoneRequest,
|
|
125
|
+
options?: RequestOptions,
|
|
126
|
+
): {
|
|
127
|
+
queryKey: QueryKey;
|
|
128
|
+
queryFn: (
|
|
129
|
+
context: QueryFunctionContext,
|
|
130
|
+
) => Promise<ZonesGetSecurityZoneQueryData>;
|
|
131
|
+
} {
|
|
132
|
+
return {
|
|
133
|
+
queryKey: queryKeyZonesGetSecurityZone(request.id),
|
|
134
|
+
queryFn: async function zonesGetSecurityZoneQueryFn(
|
|
135
|
+
ctx,
|
|
136
|
+
): Promise<ZonesGetSecurityZoneQueryData> {
|
|
137
|
+
const sig = combineSignals(ctx.signal, options?.fetchOptions?.signal);
|
|
138
|
+
const mergedOptions = {
|
|
139
|
+
...options,
|
|
140
|
+
fetchOptions: { ...options?.fetchOptions, signal: sig },
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
return unwrapAsync(zonesGetSecurityZone(
|
|
144
|
+
client$,
|
|
145
|
+
request,
|
|
146
|
+
mergedOptions,
|
|
147
|
+
));
|
|
148
|
+
},
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export function queryKeyZonesGetSecurityZone(id: number): QueryKey {
|
|
153
|
+
return ["@greensecurity/javascript-sdk", "zones", "getSecurityZone", id];
|
|
154
|
+
}
|
package/src/sdk/invoices.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
import { invoicesCreateInvoice } from "../funcs/invoicesCreateInvoice.js";
|
|
5
6
|
import { invoicesMakePayment } from "../funcs/invoicesMakePayment.js";
|
|
6
7
|
import { invoicesUpdateInvoice } from "../funcs/invoicesUpdateInvoice.js";
|
|
7
8
|
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
@@ -9,6 +10,32 @@ import * as operations from "../models/operations/index.js";
|
|
|
9
10
|
import { unwrapAsync } from "../types/fp.js";
|
|
10
11
|
|
|
11
12
|
export class Invoices extends ClientSDK {
|
|
13
|
+
/**
|
|
14
|
+
* Create invoice
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
* It will create an invoice based on the lines passed as parameter.
|
|
18
|
+
* - Exactly one of vendor_id, company_id, facility_id, or system_id must be provided. - variant_id is required for the line - payment_handler_data must be set in the following format:
|
|
19
|
+
* 1. for the 'vendor credential' and 'expedited credential' payment_handlers this should be a JSON
|
|
20
|
+
* with a key 'vendor_credential_id' and value as integer
|
|
21
|
+
* 2. for the 'credentialing subscription' payment handler this should be a JSON
|
|
22
|
+
* with the following keys and values:
|
|
23
|
+
* - old_vendor_type_id: required, must be nil or integer
|
|
24
|
+
* - new_vendor_type_id: required, must be integer
|
|
25
|
+
* - old_facility_ids: required, must be an array of integers (can be empty)
|
|
26
|
+
* - new_facility_ids: required, must be array of integers
|
|
27
|
+
*/
|
|
28
|
+
async createInvoice(
|
|
29
|
+
request: operations.CreateInvoiceRequestBody,
|
|
30
|
+
options?: RequestOptions,
|
|
31
|
+
): Promise<operations.CreateInvoiceResponseBody> {
|
|
32
|
+
return unwrapAsync(invoicesCreateInvoice(
|
|
33
|
+
this,
|
|
34
|
+
request,
|
|
35
|
+
options,
|
|
36
|
+
));
|
|
37
|
+
}
|
|
38
|
+
|
|
12
39
|
/**
|
|
13
40
|
* Update invoice
|
|
14
41
|
*
|
package/src/sdk/vendors.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
import { vendorsAcceptVendorCredential } from "../funcs/vendorsAcceptVendorCredential.js";
|
|
5
6
|
import { vendorsAddVendorCredentialFile } from "../funcs/vendorsAddVendorCredentialFile.js";
|
|
6
7
|
import { vendorsAddVendorManagedByCompany } from "../funcs/vendorsAddVendorManagedByCompany.js";
|
|
7
8
|
import { vendorsCheckDownloadCode } from "../funcs/vendorsCheckDownloadCode.js";
|
|
@@ -243,6 +244,23 @@ export class Vendors extends ClientSDK {
|
|
|
243
244
|
));
|
|
244
245
|
}
|
|
245
246
|
|
|
247
|
+
/**
|
|
248
|
+
* Accept vendor credential
|
|
249
|
+
*
|
|
250
|
+
* @remarks
|
|
251
|
+
* It will accept vendor credential
|
|
252
|
+
*/
|
|
253
|
+
async acceptVendorCredential(
|
|
254
|
+
request: operations.AcceptVendorCredentialRequest,
|
|
255
|
+
options?: RequestOptions,
|
|
256
|
+
): Promise<boolean> {
|
|
257
|
+
return unwrapAsync(vendorsAcceptVendorCredential(
|
|
258
|
+
this,
|
|
259
|
+
request,
|
|
260
|
+
options,
|
|
261
|
+
));
|
|
262
|
+
}
|
|
263
|
+
|
|
246
264
|
/**
|
|
247
265
|
* Check download code for vendor credential
|
|
248
266
|
*
|
package/src/sdk/zones.ts
CHANGED
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
import { zonesGetSecurityZone } from "../funcs/zonesGetSecurityZone.js";
|
|
5
6
|
import { zonesListOrSearchSecurityZones } from "../funcs/zonesListOrSearchSecurityZones.js";
|
|
6
7
|
import { zonesSecurityZoneCheckin } from "../funcs/zonesSecurityZoneCheckin.js";
|
|
7
8
|
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
9
|
+
import * as components from "../models/components/index.js";
|
|
8
10
|
import * as operations from "../models/operations/index.js";
|
|
9
11
|
import { unwrapAsync } from "../types/fp.js";
|
|
10
12
|
import { PageIterator, unwrapResultIterator } from "../types/operations.js";
|
|
@@ -29,6 +31,23 @@ export class Zones extends ClientSDK {
|
|
|
29
31
|
));
|
|
30
32
|
}
|
|
31
33
|
|
|
34
|
+
/**
|
|
35
|
+
* Get security zone details
|
|
36
|
+
*
|
|
37
|
+
* @remarks
|
|
38
|
+
* Get security zone details
|
|
39
|
+
*/
|
|
40
|
+
async getSecurityZone(
|
|
41
|
+
request: operations.GetSecurityZoneRequest,
|
|
42
|
+
options?: RequestOptions,
|
|
43
|
+
): Promise<components.Zone> {
|
|
44
|
+
return unwrapAsync(zonesGetSecurityZone(
|
|
45
|
+
this,
|
|
46
|
+
request,
|
|
47
|
+
options,
|
|
48
|
+
));
|
|
49
|
+
}
|
|
50
|
+
|
|
32
51
|
/**
|
|
33
52
|
* Security zone checkin request
|
|
34
53
|
*
|