@greensecurity/javascript-sdk 0.35.27 → 0.35.33
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 +3 -0
- package/bin/mcp-server.js +869 -378
- package/bin/mcp-server.js.map +10 -7
- package/dist/commonjs/__tests__/invoices.test.js +18 -0
- package/dist/commonjs/__tests__/invoices.test.js.map +1 -1
- package/dist/commonjs/__tests__/zones.test.js +16 -4
- package/dist/commonjs/__tests__/zones.test.js.map +1 -1
- package/dist/commonjs/funcs/invoicesUpdateInvoice.d.ts +26 -0
- package/dist/commonjs/funcs/invoicesUpdateInvoice.d.ts.map +1 -0
- package/dist/commonjs/funcs/invoicesUpdateInvoice.js +133 -0
- package/dist/commonjs/funcs/invoicesUpdateInvoice.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- 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 +3 -1
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/invoicesUpdateInvoice.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/invoicesUpdateInvoice.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/invoicesUpdateInvoice.js +73 -0
- package/dist/commonjs/mcp-server/tools/invoicesUpdateInvoice.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +1 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +1 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/updateinvoice.d.ts +441 -0
- package/dist/commonjs/models/operations/updateinvoice.d.ts.map +1 -0
- package/dist/commonjs/models/operations/updateinvoice.js +622 -0
- package/dist/commonjs/models/operations/updateinvoice.js.map +1 -0
- package/dist/commonjs/react-query/index.d.ts +1 -0
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +1 -0
- package/dist/commonjs/react-query/index.js.map +1 -1
- package/dist/commonjs/react-query/invoicesUpdateInvoice.d.ts +32 -0
- package/dist/commonjs/react-query/invoicesUpdateInvoice.d.ts.map +1 -0
- package/dist/commonjs/react-query/invoicesUpdateInvoice.js +56 -0
- package/dist/commonjs/react-query/invoicesUpdateInvoice.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/esm/__tests__/invoices.test.js +18 -0
- package/dist/esm/__tests__/invoices.test.js.map +1 -1
- package/dist/esm/__tests__/zones.test.js +16 -4
- package/dist/esm/__tests__/zones.test.js.map +1 -1
- package/dist/esm/funcs/invoicesUpdateInvoice.d.ts +26 -0
- package/dist/esm/funcs/invoicesUpdateInvoice.d.ts.map +1 -0
- package/dist/esm/funcs/invoicesUpdateInvoice.js +97 -0
- package/dist/esm/funcs/invoicesUpdateInvoice.js.map +1 -0
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- 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 +3 -1
- package/dist/esm/mcp-server/server.js.map +1 -1
- package/dist/esm/mcp-server/tools/invoicesUpdateInvoice.d.ts +8 -0
- package/dist/esm/mcp-server/tools/invoicesUpdateInvoice.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/invoicesUpdateInvoice.js +37 -0
- package/dist/esm/mcp-server/tools/invoicesUpdateInvoice.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +1 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +1 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/updateinvoice.d.ts +441 -0
- package/dist/esm/models/operations/updateinvoice.d.ts.map +1 -0
- package/dist/esm/models/operations/updateinvoice.js +566 -0
- package/dist/esm/models/operations/updateinvoice.js.map +1 -0
- package/dist/esm/react-query/index.d.ts +1 -0
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +1 -0
- package/dist/esm/react-query/index.js.map +1 -1
- package/dist/esm/react-query/invoicesUpdateInvoice.d.ts +32 -0
- package/dist/esm/react-query/invoicesUpdateInvoice.d.ts.map +1 -0
- package/dist/esm/react-query/invoicesUpdateInvoice.js +51 -0
- package/dist/esm/react-query/invoicesUpdateInvoice.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/jsr.json +1 -1
- package/package.json +1 -1
- package/src/__tests__/invoices.test.ts +21 -0
- package/src/__tests__/zones.test.ts +16 -4
- package/src/funcs/invoicesUpdateInvoice.ts +182 -0
- package/src/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +3 -1
- package/src/mcp-server/tools/invoicesUpdateInvoice.ts +46 -0
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/updateinvoice.ts +1002 -0
- package/src/react-query/index.ts +1 -0
- package/src/react-query/invoicesUpdateInvoice.ts +97 -0
- package/src/sdk/invoices.ts +27 -0
package/src/react-query/index.ts
CHANGED
|
@@ -10,6 +10,7 @@ export * from "./dataRequestsAddDataRequestFile.js";
|
|
|
10
10
|
export * from "./dataRequestsDeleteDataRequestFile.js";
|
|
11
11
|
export * from "./dataRequestsUpdateDataRequest.js";
|
|
12
12
|
export * from "./invoicesMakePayment.js";
|
|
13
|
+
export * from "./invoicesUpdateInvoice.js";
|
|
13
14
|
export * from "./organizationsGetFacility.js";
|
|
14
15
|
export * from "./organizationsListOrSearchFacilities.js";
|
|
15
16
|
export * from "./supportArticlesGetSupportArticle.js";
|
|
@@ -0,0 +1,97 @@
|
|
|
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 { invoicesUpdateInvoice } from "../funcs/invoicesUpdateInvoice.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 InvoicesUpdateInvoiceMutationVariables = {
|
|
20
|
+
request: operations.UpdateInvoiceRequest;
|
|
21
|
+
options?: RequestOptions;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type InvoicesUpdateInvoiceMutationData = boolean;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Update invoice
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* It will replace all the lines with the lines passed as parameter
|
|
31
|
+
* - 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:
|
|
32
|
+
* 1. for the 'vendor credential' and 'expedited credential' payment_handlers this should be a JSON
|
|
33
|
+
* with a key 'vendor_credential_id' and value as integer
|
|
34
|
+
* 2. for the 'credentialing subscription' payment handler this should be a JSON
|
|
35
|
+
* with the following keys and values:
|
|
36
|
+
* - old_vendor_type_id: required, must be nil or integer
|
|
37
|
+
* - new_vendor_type_id: required, must be integer
|
|
38
|
+
* - old_facility_ids: required, must be an array of integers (can be empty)
|
|
39
|
+
* - new_facility_ids: required, must be array of integers
|
|
40
|
+
*/
|
|
41
|
+
export function useInvoicesUpdateInvoiceMutation(
|
|
42
|
+
options?: MutationHookOptions<
|
|
43
|
+
InvoicesUpdateInvoiceMutationData,
|
|
44
|
+
Error,
|
|
45
|
+
InvoicesUpdateInvoiceMutationVariables
|
|
46
|
+
>,
|
|
47
|
+
): UseMutationResult<
|
|
48
|
+
InvoicesUpdateInvoiceMutationData,
|
|
49
|
+
Error,
|
|
50
|
+
InvoicesUpdateInvoiceMutationVariables
|
|
51
|
+
> {
|
|
52
|
+
const client = useGreenSecurityContext();
|
|
53
|
+
return useMutation({
|
|
54
|
+
...buildInvoicesUpdateInvoiceMutation(client, options),
|
|
55
|
+
...options,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function mutationKeyInvoicesUpdateInvoice(): MutationKey {
|
|
60
|
+
return ["@greensecurity/javascript-sdk", "invoices", "updateInvoice"];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function buildInvoicesUpdateInvoiceMutation(
|
|
64
|
+
client$: GreenSecurityCore,
|
|
65
|
+
hookOptions?: RequestOptions,
|
|
66
|
+
): {
|
|
67
|
+
mutationKey: MutationKey;
|
|
68
|
+
mutationFn: (
|
|
69
|
+
variables: InvoicesUpdateInvoiceMutationVariables,
|
|
70
|
+
) => Promise<InvoicesUpdateInvoiceMutationData>;
|
|
71
|
+
} {
|
|
72
|
+
return {
|
|
73
|
+
mutationKey: mutationKeyInvoicesUpdateInvoice(),
|
|
74
|
+
mutationFn: function invoicesUpdateInvoiceMutationFn({
|
|
75
|
+
request,
|
|
76
|
+
options,
|
|
77
|
+
}): Promise<InvoicesUpdateInvoiceMutationData> {
|
|
78
|
+
const mergedOptions = {
|
|
79
|
+
...hookOptions,
|
|
80
|
+
...options,
|
|
81
|
+
fetchOptions: {
|
|
82
|
+
...hookOptions?.fetchOptions,
|
|
83
|
+
...options?.fetchOptions,
|
|
84
|
+
signal: combineSignals(
|
|
85
|
+
hookOptions?.fetchOptions?.signal,
|
|
86
|
+
options?.fetchOptions?.signal,
|
|
87
|
+
),
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
return unwrapAsync(invoicesUpdateInvoice(
|
|
91
|
+
client$,
|
|
92
|
+
request,
|
|
93
|
+
mergedOptions,
|
|
94
|
+
));
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
}
|
package/src/sdk/invoices.ts
CHANGED
|
@@ -3,11 +3,38 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { invoicesMakePayment } from "../funcs/invoicesMakePayment.js";
|
|
6
|
+
import { invoicesUpdateInvoice } from "../funcs/invoicesUpdateInvoice.js";
|
|
6
7
|
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
7
8
|
import * as operations from "../models/operations/index.js";
|
|
8
9
|
import { unwrapAsync } from "../types/fp.js";
|
|
9
10
|
|
|
10
11
|
export class Invoices extends ClientSDK {
|
|
12
|
+
/**
|
|
13
|
+
* Update invoice
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* It will replace all the lines with the lines passed as parameter
|
|
17
|
+
* - 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:
|
|
18
|
+
* 1. for the 'vendor credential' and 'expedited credential' payment_handlers this should be a JSON
|
|
19
|
+
* with a key 'vendor_credential_id' and value as integer
|
|
20
|
+
* 2. for the 'credentialing subscription' payment handler this should be a JSON
|
|
21
|
+
* with the following keys and values:
|
|
22
|
+
* - old_vendor_type_id: required, must be nil or integer
|
|
23
|
+
* - new_vendor_type_id: required, must be integer
|
|
24
|
+
* - old_facility_ids: required, must be an array of integers (can be empty)
|
|
25
|
+
* - new_facility_ids: required, must be array of integers
|
|
26
|
+
*/
|
|
27
|
+
async updateInvoice(
|
|
28
|
+
request: operations.UpdateInvoiceRequest,
|
|
29
|
+
options?: RequestOptions,
|
|
30
|
+
): Promise<boolean> {
|
|
31
|
+
return unwrapAsync(invoicesUpdateInvoice(
|
|
32
|
+
this,
|
|
33
|
+
request,
|
|
34
|
+
options,
|
|
35
|
+
));
|
|
36
|
+
}
|
|
37
|
+
|
|
11
38
|
/**
|
|
12
39
|
* Make payment for the invoice
|
|
13
40
|
*
|