@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.
Files changed (93) hide show
  1. package/README.md +3 -0
  2. package/bin/mcp-server.js +869 -378
  3. package/bin/mcp-server.js.map +10 -7
  4. package/dist/commonjs/__tests__/invoices.test.js +18 -0
  5. package/dist/commonjs/__tests__/invoices.test.js.map +1 -1
  6. package/dist/commonjs/__tests__/zones.test.js +16 -4
  7. package/dist/commonjs/__tests__/zones.test.js.map +1 -1
  8. package/dist/commonjs/funcs/invoicesUpdateInvoice.d.ts +26 -0
  9. package/dist/commonjs/funcs/invoicesUpdateInvoice.d.ts.map +1 -0
  10. package/dist/commonjs/funcs/invoicesUpdateInvoice.js +133 -0
  11. package/dist/commonjs/funcs/invoicesUpdateInvoice.js.map +1 -0
  12. package/dist/commonjs/lib/config.d.ts +2 -2
  13. package/dist/commonjs/lib/config.js +2 -2
  14. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  15. package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
  16. package/dist/commonjs/mcp-server/server.js +3 -1
  17. package/dist/commonjs/mcp-server/server.js.map +1 -1
  18. package/dist/commonjs/mcp-server/tools/invoicesUpdateInvoice.d.ts +8 -0
  19. package/dist/commonjs/mcp-server/tools/invoicesUpdateInvoice.d.ts.map +1 -0
  20. package/dist/commonjs/mcp-server/tools/invoicesUpdateInvoice.js +73 -0
  21. package/dist/commonjs/mcp-server/tools/invoicesUpdateInvoice.js.map +1 -0
  22. package/dist/commonjs/models/operations/index.d.ts +1 -0
  23. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  24. package/dist/commonjs/models/operations/index.js +1 -0
  25. package/dist/commonjs/models/operations/index.js.map +1 -1
  26. package/dist/commonjs/models/operations/updateinvoice.d.ts +441 -0
  27. package/dist/commonjs/models/operations/updateinvoice.d.ts.map +1 -0
  28. package/dist/commonjs/models/operations/updateinvoice.js +622 -0
  29. package/dist/commonjs/models/operations/updateinvoice.js.map +1 -0
  30. package/dist/commonjs/react-query/index.d.ts +1 -0
  31. package/dist/commonjs/react-query/index.d.ts.map +1 -1
  32. package/dist/commonjs/react-query/index.js +1 -0
  33. package/dist/commonjs/react-query/index.js.map +1 -1
  34. package/dist/commonjs/react-query/invoicesUpdateInvoice.d.ts +32 -0
  35. package/dist/commonjs/react-query/invoicesUpdateInvoice.d.ts.map +1 -0
  36. package/dist/commonjs/react-query/invoicesUpdateInvoice.js +56 -0
  37. package/dist/commonjs/react-query/invoicesUpdateInvoice.js.map +1 -0
  38. package/dist/commonjs/sdk/invoices.d.ts +16 -0
  39. package/dist/commonjs/sdk/invoices.d.ts.map +1 -1
  40. package/dist/commonjs/sdk/invoices.js +19 -0
  41. package/dist/commonjs/sdk/invoices.js.map +1 -1
  42. package/dist/esm/__tests__/invoices.test.js +18 -0
  43. package/dist/esm/__tests__/invoices.test.js.map +1 -1
  44. package/dist/esm/__tests__/zones.test.js +16 -4
  45. package/dist/esm/__tests__/zones.test.js.map +1 -1
  46. package/dist/esm/funcs/invoicesUpdateInvoice.d.ts +26 -0
  47. package/dist/esm/funcs/invoicesUpdateInvoice.d.ts.map +1 -0
  48. package/dist/esm/funcs/invoicesUpdateInvoice.js +97 -0
  49. package/dist/esm/funcs/invoicesUpdateInvoice.js.map +1 -0
  50. package/dist/esm/lib/config.d.ts +2 -2
  51. package/dist/esm/lib/config.js +2 -2
  52. package/dist/esm/mcp-server/mcp-server.js +1 -1
  53. package/dist/esm/mcp-server/server.d.ts.map +1 -1
  54. package/dist/esm/mcp-server/server.js +3 -1
  55. package/dist/esm/mcp-server/server.js.map +1 -1
  56. package/dist/esm/mcp-server/tools/invoicesUpdateInvoice.d.ts +8 -0
  57. package/dist/esm/mcp-server/tools/invoicesUpdateInvoice.d.ts.map +1 -0
  58. package/dist/esm/mcp-server/tools/invoicesUpdateInvoice.js +37 -0
  59. package/dist/esm/mcp-server/tools/invoicesUpdateInvoice.js.map +1 -0
  60. package/dist/esm/models/operations/index.d.ts +1 -0
  61. package/dist/esm/models/operations/index.d.ts.map +1 -1
  62. package/dist/esm/models/operations/index.js +1 -0
  63. package/dist/esm/models/operations/index.js.map +1 -1
  64. package/dist/esm/models/operations/updateinvoice.d.ts +441 -0
  65. package/dist/esm/models/operations/updateinvoice.d.ts.map +1 -0
  66. package/dist/esm/models/operations/updateinvoice.js +566 -0
  67. package/dist/esm/models/operations/updateinvoice.js.map +1 -0
  68. package/dist/esm/react-query/index.d.ts +1 -0
  69. package/dist/esm/react-query/index.d.ts.map +1 -1
  70. package/dist/esm/react-query/index.js +1 -0
  71. package/dist/esm/react-query/index.js.map +1 -1
  72. package/dist/esm/react-query/invoicesUpdateInvoice.d.ts +32 -0
  73. package/dist/esm/react-query/invoicesUpdateInvoice.d.ts.map +1 -0
  74. package/dist/esm/react-query/invoicesUpdateInvoice.js +51 -0
  75. package/dist/esm/react-query/invoicesUpdateInvoice.js.map +1 -0
  76. package/dist/esm/sdk/invoices.d.ts +16 -0
  77. package/dist/esm/sdk/invoices.d.ts.map +1 -1
  78. package/dist/esm/sdk/invoices.js +19 -0
  79. package/dist/esm/sdk/invoices.js.map +1 -1
  80. package/jsr.json +1 -1
  81. package/package.json +1 -1
  82. package/src/__tests__/invoices.test.ts +21 -0
  83. package/src/__tests__/zones.test.ts +16 -4
  84. package/src/funcs/invoicesUpdateInvoice.ts +182 -0
  85. package/src/lib/config.ts +2 -2
  86. package/src/mcp-server/mcp-server.ts +1 -1
  87. package/src/mcp-server/server.ts +3 -1
  88. package/src/mcp-server/tools/invoicesUpdateInvoice.ts +46 -0
  89. package/src/models/operations/index.ts +1 -0
  90. package/src/models/operations/updateinvoice.ts +1002 -0
  91. package/src/react-query/index.ts +1 -0
  92. package/src/react-query/invoicesUpdateInvoice.ts +97 -0
  93. package/src/sdk/invoices.ts +27 -0
@@ -0,0 +1,32 @@
1
+ import { MutationKey, UseMutationResult } from "@tanstack/react-query";
2
+ import { GreenSecurityCore } from "../core.js";
3
+ import { RequestOptions } from "../lib/sdks.js";
4
+ import * as operations from "../models/operations/index.js";
5
+ import { MutationHookOptions } from "./_types.js";
6
+ export type InvoicesUpdateInvoiceMutationVariables = {
7
+ request: operations.UpdateInvoiceRequest;
8
+ options?: RequestOptions;
9
+ };
10
+ export type InvoicesUpdateInvoiceMutationData = boolean;
11
+ /**
12
+ * Update invoice
13
+ *
14
+ * @remarks
15
+ * It will replace all the lines with the lines passed as parameter
16
+ * - 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:
17
+ * 1. for the 'vendor credential' and 'expedited credential' payment_handlers this should be a JSON
18
+ * with a key 'vendor_credential_id' and value as integer
19
+ * 2. for the 'credentialing subscription' payment handler this should be a JSON
20
+ * with the following keys and values:
21
+ * - old_vendor_type_id: required, must be nil or integer
22
+ * - new_vendor_type_id: required, must be integer
23
+ * - old_facility_ids: required, must be an array of integers (can be empty)
24
+ * - new_facility_ids: required, must be array of integers
25
+ */
26
+ export declare function useInvoicesUpdateInvoiceMutation(options?: MutationHookOptions<InvoicesUpdateInvoiceMutationData, Error, InvoicesUpdateInvoiceMutationVariables>): UseMutationResult<InvoicesUpdateInvoiceMutationData, Error, InvoicesUpdateInvoiceMutationVariables>;
27
+ export declare function mutationKeyInvoicesUpdateInvoice(): MutationKey;
28
+ export declare function buildInvoicesUpdateInvoiceMutation(client$: GreenSecurityCore, hookOptions?: RequestOptions): {
29
+ mutationKey: MutationKey;
30
+ mutationFn: (variables: InvoicesUpdateInvoiceMutationVariables) => Promise<InvoicesUpdateInvoiceMutationData>;
31
+ };
32
+ //# sourceMappingURL=invoicesUpdateInvoice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invoicesUpdateInvoice.d.ts","sourceRoot":"","sources":["../../../src/react-query/invoicesUpdateInvoice.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,WAAW,EAEX,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAG/C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAG5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,MAAM,sCAAsC,GAAG;IACnD,OAAO,EAAE,UAAU,CAAC,oBAAoB,CAAC;IACzC,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG,OAAO,CAAC;AAExD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gCAAgC,CAC9C,OAAO,CAAC,EAAE,mBAAmB,CAC3B,iCAAiC,EACjC,KAAK,EACL,sCAAsC,CACvC,GACA,iBAAiB,CAClB,iCAAiC,EACjC,KAAK,EACL,sCAAsC,CACvC,CAMA;AAED,wBAAgB,gCAAgC,IAAI,WAAW,CAE9D;AAED,wBAAgB,kCAAkC,CAChD,OAAO,EAAE,iBAAiB,EAC1B,WAAW,CAAC,EAAE,cAAc,GAC3B;IACD,WAAW,EAAE,WAAW,CAAC;IACzB,UAAU,EAAE,CACV,SAAS,EAAE,sCAAsC,KAC9C,OAAO,CAAC,iCAAiC,CAAC,CAAC;CACjD,CA0BA"}
@@ -0,0 +1,51 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ import { useMutation, } from "@tanstack/react-query";
5
+ import { invoicesUpdateInvoice } from "../funcs/invoicesUpdateInvoice.js";
6
+ import { combineSignals } from "../lib/primitives.js";
7
+ import { unwrapAsync } from "../types/fp.js";
8
+ import { useGreenSecurityContext } from "./_context.js";
9
+ /**
10
+ * Update invoice
11
+ *
12
+ * @remarks
13
+ * It will replace all the lines with the lines passed as parameter
14
+ * - 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:
15
+ * 1. for the 'vendor credential' and 'expedited credential' payment_handlers this should be a JSON
16
+ * with a key 'vendor_credential_id' and value as integer
17
+ * 2. for the 'credentialing subscription' payment handler this should be a JSON
18
+ * with the following keys and values:
19
+ * - old_vendor_type_id: required, must be nil or integer
20
+ * - new_vendor_type_id: required, must be integer
21
+ * - old_facility_ids: required, must be an array of integers (can be empty)
22
+ * - new_facility_ids: required, must be array of integers
23
+ */
24
+ export function useInvoicesUpdateInvoiceMutation(options) {
25
+ const client = useGreenSecurityContext();
26
+ return useMutation({
27
+ ...buildInvoicesUpdateInvoiceMutation(client, options),
28
+ ...options,
29
+ });
30
+ }
31
+ export function mutationKeyInvoicesUpdateInvoice() {
32
+ return ["@greensecurity/javascript-sdk", "invoices", "updateInvoice"];
33
+ }
34
+ export function buildInvoicesUpdateInvoiceMutation(client$, hookOptions) {
35
+ return {
36
+ mutationKey: mutationKeyInvoicesUpdateInvoice(),
37
+ mutationFn: function invoicesUpdateInvoiceMutationFn({ request, options, }) {
38
+ const mergedOptions = {
39
+ ...hookOptions,
40
+ ...options,
41
+ fetchOptions: {
42
+ ...hookOptions?.fetchOptions,
43
+ ...options?.fetchOptions,
44
+ signal: combineSignals(hookOptions?.fetchOptions?.signal, options?.fetchOptions?.signal),
45
+ },
46
+ };
47
+ return unwrapAsync(invoicesUpdateInvoice(client$, request, mergedOptions));
48
+ },
49
+ };
50
+ }
51
+ //# sourceMappingURL=invoicesUpdateInvoice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invoicesUpdateInvoice.js","sourceRoot":"","sources":["../../../src/react-query/invoicesUpdateInvoice.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAEL,WAAW,GAEZ,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAUxD;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,gCAAgC,CAC9C,OAIC;IAMD,MAAM,MAAM,GAAG,uBAAuB,EAAE,CAAC;IACzC,OAAO,WAAW,CAAC;QACjB,GAAG,kCAAkC,CAAC,MAAM,EAAE,OAAO,CAAC;QACtD,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,gCAAgC;IAC9C,OAAO,CAAC,+BAA+B,EAAE,UAAU,EAAE,eAAe,CAAC,CAAC;AACxE,CAAC;AAED,MAAM,UAAU,kCAAkC,CAChD,OAA0B,EAC1B,WAA4B;IAO5B,OAAO;QACL,WAAW,EAAE,gCAAgC,EAAE;QAC/C,UAAU,EAAE,SAAS,+BAA+B,CAAC,EACnD,OAAO,EACP,OAAO,GACR;YACC,MAAM,aAAa,GAAG;gBACpB,GAAG,WAAW;gBACd,GAAG,OAAO;gBACV,YAAY,EAAE;oBACZ,GAAG,WAAW,EAAE,YAAY;oBAC5B,GAAG,OAAO,EAAE,YAAY;oBACxB,MAAM,EAAE,cAAc,CACpB,WAAW,EAAE,YAAY,EAAE,MAAM,EACjC,OAAO,EAAE,YAAY,EAAE,MAAM,CAC9B;iBACF;aACF,CAAC;YACF,OAAO,WAAW,CAAC,qBAAqB,CACtC,OAAO,EACP,OAAO,EACP,aAAa,CACd,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1,6 +1,22 @@
1
1
  import { ClientSDK, RequestOptions } from "../lib/sdks.js";
2
2
  import * as operations from "../models/operations/index.js";
3
3
  export declare class Invoices extends ClientSDK {
4
+ /**
5
+ * Update invoice
6
+ *
7
+ * @remarks
8
+ * It will replace all the lines with the lines passed as parameter
9
+ * - 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:
10
+ * 1. for the 'vendor credential' and 'expedited credential' payment_handlers this should be a JSON
11
+ * with a key 'vendor_credential_id' and value as integer
12
+ * 2. for the 'credentialing subscription' payment handler this should be a JSON
13
+ * with the following keys and values:
14
+ * - old_vendor_type_id: required, must be nil or integer
15
+ * - new_vendor_type_id: required, must be integer
16
+ * - old_facility_ids: required, must be an array of integers (can be empty)
17
+ * - new_facility_ids: required, must be array of integers
18
+ */
19
+ updateInvoice(request: operations.UpdateInvoiceRequest, options?: RequestOptions): Promise<boolean>;
4
20
  /**
5
21
  * Make payment for the invoice
6
22
  *
@@ -1 +1 @@
1
- {"version":3,"file":"invoices.d.ts","sourceRoot":"","sources":["../../../src/sdk/invoices.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAG5D,qBAAa,QAAS,SAAQ,SAAS;IACrC;;;;;OAKG;IACG,WAAW,CACf,OAAO,EAAE,UAAU,CAAC,kBAAkB,EACtC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,uBAAuB,CAAC;CAO/C"}
1
+ {"version":3,"file":"invoices.d.ts","sourceRoot":"","sources":["../../../src/sdk/invoices.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAG5D,qBAAa,QAAS,SAAQ,SAAS;IACrC;;;;;;;;;;;;;;OAcG;IACG,aAAa,CACjB,OAAO,EAAE,UAAU,CAAC,oBAAoB,EACxC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,OAAO,CAAC;IAQnB;;;;;OAKG;IACG,WAAW,CACf,OAAO,EAAE,UAAU,CAAC,kBAAkB,EACtC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,uBAAuB,CAAC;CAO/C"}
@@ -2,9 +2,28 @@
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
3
  */
4
4
  import { invoicesMakePayment } from "../funcs/invoicesMakePayment.js";
5
+ import { invoicesUpdateInvoice } from "../funcs/invoicesUpdateInvoice.js";
5
6
  import { ClientSDK } from "../lib/sdks.js";
6
7
  import { unwrapAsync } from "../types/fp.js";
7
8
  export class Invoices extends ClientSDK {
9
+ /**
10
+ * Update invoice
11
+ *
12
+ * @remarks
13
+ * It will replace all the lines with the lines passed as parameter
14
+ * - 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:
15
+ * 1. for the 'vendor credential' and 'expedited credential' payment_handlers this should be a JSON
16
+ * with a key 'vendor_credential_id' and value as integer
17
+ * 2. for the 'credentialing subscription' payment handler this should be a JSON
18
+ * with the following keys and values:
19
+ * - old_vendor_type_id: required, must be nil or integer
20
+ * - new_vendor_type_id: required, must be integer
21
+ * - old_facility_ids: required, must be an array of integers (can be empty)
22
+ * - new_facility_ids: required, must be array of integers
23
+ */
24
+ async updateInvoice(request, options) {
25
+ return unwrapAsync(invoicesUpdateInvoice(this, request, options));
26
+ }
8
27
  /**
9
28
  * Make payment for the invoice
10
29
  *
@@ -1 +1 @@
1
- {"version":3,"file":"invoices.js","sourceRoot":"","sources":["../../../src/sdk/invoices.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,SAAS,EAAkB,MAAM,gBAAgB,CAAC;AAE3D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,OAAO,QAAS,SAAQ,SAAS;IACrC;;;;;OAKG;IACH,KAAK,CAAC,WAAW,CACf,OAAsC,EACtC,OAAwB;QAExB,OAAO,WAAW,CAAC,mBAAmB,CACpC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF"}
1
+ {"version":3,"file":"invoices.js","sourceRoot":"","sources":["../../../src/sdk/invoices.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAkB,MAAM,gBAAgB,CAAC;AAE3D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,OAAO,QAAS,SAAQ,SAAS;IACrC;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,aAAa,CACjB,OAAwC,EACxC,OAAwB;QAExB,OAAO,WAAW,CAAC,qBAAqB,CACtC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,WAAW,CACf,OAAsC,EACtC,OAAwB;QAExB,OAAO,WAAW,CAAC,mBAAmB,CACpC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF"}
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@greensecurity/javascript-sdk",
5
- "version": "0.35.27",
5
+ "version": "0.35.33",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./models/errors": "./src/models/errors/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@greensecurity/javascript-sdk",
3
- "version": "0.35.27",
3
+ "version": "0.35.33",
4
4
  "author": "Green Security LLC",
5
5
  "type": "module",
6
6
  "bin": {
@@ -24,3 +24,24 @@ test("Invoices Make Payment", async () => {
24
24
  expect(result).toBeDefined();
25
25
  expect(result).toEqual({});
26
26
  });
27
+
28
+ test("Invoices Update Invoice", async () => {
29
+ const testHttpClient = createTestHTTPClient("updateInvoice");
30
+
31
+ const greenSecurity = new GreenSecurity({
32
+ serverURL: process.env["TEST_SERVER_URL"] ?? "https://localhost:3000/api",
33
+ httpClient: testHttpClient,
34
+ security: {
35
+ token: process.env["GREEN_SECURITY_TOKEN"] ?? "value",
36
+ },
37
+ });
38
+
39
+ const result = await greenSecurity.invoices.updateInvoice({
40
+ id: 801666,
41
+ requestBody: {
42
+ systemId: 761923,
43
+ },
44
+ });
45
+ expect(result).toBeDefined();
46
+ expect(result).toEqual(false);
47
+ });
@@ -38,11 +38,22 @@ test("Zones List Or Search Security Zones", async () => {
38
38
  {
39
39
  facility: {
40
40
  contacts: null,
41
- vendorGuestPolicy: null,
41
+ vendorGuestPolicy: {
42
+ enabled: false,
43
+ vendorGuestLimitAndOr: "and",
44
+ vendorGuestRequireEmail: false,
45
+ },
42
46
  },
43
47
  },
44
48
  {
45
- facility: {},
49
+ facility: {
50
+ contacts: null,
51
+ vendorGuestPolicy: {
52
+ enabled: false,
53
+ vendorGuestLimitAndOr: "and",
54
+ vendorGuestRequireEmail: false,
55
+ },
56
+ },
46
57
  },
47
58
  ],
48
59
  });
@@ -60,8 +71,9 @@ test("Zones Security Zone Checkin", async () => {
60
71
  });
61
72
 
62
73
  const result = await greenSecurity.zones.securityZoneCheckin({
63
- qrCode: "<value>",
64
- zoneId: 579390,
74
+ zoneId: 400600,
75
+ longitude: "-29.1604",
76
+ latitude: "-54.1426",
65
77
  });
66
78
  expect(result).toBeDefined();
67
79
  expect(result).toEqual({});
@@ -0,0 +1,182 @@
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 { encodeJSON, 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 { APIError } from "../models/errors/apierror.js";
15
+ import {
16
+ ConnectionError,
17
+ InvalidRequestError,
18
+ RequestAbortedError,
19
+ RequestTimeoutError,
20
+ UnexpectedClientError,
21
+ } from "../models/errors/httpclienterrors.js";
22
+ import * as errors from "../models/errors/index.js";
23
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
24
+ import * as operations from "../models/operations/index.js";
25
+ import { APICall, APIPromise } from "../types/async.js";
26
+ import { Result } from "../types/fp.js";
27
+
28
+ /**
29
+ * Update invoice
30
+ *
31
+ * @remarks
32
+ * It will replace all the lines with the lines passed as parameter
33
+ * - 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:
34
+ * 1. for the 'vendor credential' and 'expedited credential' payment_handlers this should be a JSON
35
+ * with a key 'vendor_credential_id' and value as integer
36
+ * 2. for the 'credentialing subscription' payment handler this should be a JSON
37
+ * with the following keys and values:
38
+ * - old_vendor_type_id: required, must be nil or integer
39
+ * - new_vendor_type_id: required, must be integer
40
+ * - old_facility_ids: required, must be an array of integers (can be empty)
41
+ * - new_facility_ids: required, must be array of integers
42
+ */
43
+ export function invoicesUpdateInvoice(
44
+ client: GreenSecurityCore,
45
+ request: operations.UpdateInvoiceRequest,
46
+ options?: RequestOptions,
47
+ ): APIPromise<
48
+ Result<
49
+ boolean,
50
+ | errors.ApiErrorResponse
51
+ | APIError
52
+ | SDKValidationError
53
+ | UnexpectedClientError
54
+ | InvalidRequestError
55
+ | RequestAbortedError
56
+ | RequestTimeoutError
57
+ | ConnectionError
58
+ >
59
+ > {
60
+ return new APIPromise($do(
61
+ client,
62
+ request,
63
+ options,
64
+ ));
65
+ }
66
+
67
+ async function $do(
68
+ client: GreenSecurityCore,
69
+ request: operations.UpdateInvoiceRequest,
70
+ options?: RequestOptions,
71
+ ): Promise<
72
+ [
73
+ Result<
74
+ boolean,
75
+ | errors.ApiErrorResponse
76
+ | APIError
77
+ | SDKValidationError
78
+ | UnexpectedClientError
79
+ | InvalidRequestError
80
+ | RequestAbortedError
81
+ | RequestTimeoutError
82
+ | ConnectionError
83
+ >,
84
+ APICall,
85
+ ]
86
+ > {
87
+ const parsed = safeParse(
88
+ request,
89
+ (value) => operations.UpdateInvoiceRequest$outboundSchema.parse(value),
90
+ "Input validation failed",
91
+ );
92
+ if (!parsed.ok) {
93
+ return [parsed, { status: "invalid" }];
94
+ }
95
+ const payload = parsed.value;
96
+ const body = encodeJSON("body", payload.RequestBody, { explode: true });
97
+
98
+ const pathParams = {
99
+ id: encodeSimple("id", payload.id, {
100
+ explode: false,
101
+ charEncoding: "percent",
102
+ }),
103
+ };
104
+
105
+ const path = pathToFunc("/invoices/{id}")(pathParams);
106
+
107
+ const headers = new Headers(compactMap({
108
+ "Content-Type": "application/json",
109
+ Accept: "application/json",
110
+ }));
111
+
112
+ const securityInput = await extractSecurity(client._options.security);
113
+ const requestSecurity = resolveGlobalSecurity(securityInput);
114
+
115
+ const context = {
116
+ options: client._options,
117
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
118
+ operationID: "updateInvoice",
119
+ oAuth2Scopes: [],
120
+
121
+ resolvedSecurity: requestSecurity,
122
+
123
+ securitySource: client._options.security,
124
+ retryConfig: options?.retries
125
+ || client._options.retryConfig
126
+ || { strategy: "none" },
127
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
128
+ };
129
+
130
+ const requestRes = client._createRequest(context, {
131
+ security: requestSecurity,
132
+ method: "PUT",
133
+ baseURL: options?.serverURL,
134
+ path: path,
135
+ headers: headers,
136
+ body: body,
137
+ userAgent: client._options.userAgent,
138
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
139
+ }, options);
140
+ if (!requestRes.ok) {
141
+ return [requestRes, { status: "invalid" }];
142
+ }
143
+ const req = requestRes.value;
144
+
145
+ const doResult = await client._do(req, {
146
+ context,
147
+ errorCodes: ["400", "401", "403", "404", "4XX", "500", "5XX"],
148
+ retryConfig: context.retryConfig,
149
+ retryCodes: context.retryCodes,
150
+ });
151
+ if (!doResult.ok) {
152
+ return [doResult, { status: "request-error", request: req }];
153
+ }
154
+ const response = doResult.value;
155
+
156
+ const responseFields = {
157
+ HttpMeta: { Response: response, Request: req },
158
+ };
159
+
160
+ const [result] = await M.match<
161
+ boolean,
162
+ | errors.ApiErrorResponse
163
+ | APIError
164
+ | SDKValidationError
165
+ | UnexpectedClientError
166
+ | InvalidRequestError
167
+ | RequestAbortedError
168
+ | RequestTimeoutError
169
+ | ConnectionError
170
+ >(
171
+ M.json(200, z.boolean()),
172
+ M.jsonErr([400, 401, 403, 404], errors.ApiErrorResponse$inboundSchema),
173
+ M.jsonErr(500, errors.ApiErrorResponse$inboundSchema),
174
+ M.fail("4XX"),
175
+ M.fail("5XX"),
176
+ )(response, { extraFields: responseFields });
177
+ if (!result.ok) {
178
+ return [result, { status: "complete", request: req, response }];
179
+ }
180
+
181
+ return [result, { status: "complete", request: req, response }];
182
+ }
package/src/lib/config.ts CHANGED
@@ -76,8 +76,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
76
76
  export const SDK_METADATA = {
77
77
  language: "typescript",
78
78
  openapiDocVersion: "0.0.3",
79
- sdkVersion: "0.35.27",
79
+ sdkVersion: "0.35.33",
80
80
  genVersion: "2.620.2",
81
81
  userAgent:
82
- "speakeasy-sdk/typescript 0.35.27 2.620.2 0.0.3 @greensecurity/javascript-sdk",
82
+ "speakeasy-sdk/typescript 0.35.33 2.620.2 0.0.3 @greensecurity/javascript-sdk",
83
83
  } as const;
@@ -19,7 +19,7 @@ const routes = buildRouteMap({
19
19
  export const app = buildApplication(routes, {
20
20
  name: "mcp",
21
21
  versionInfo: {
22
- currentVersion: "0.35.27",
22
+ currentVersion: "0.35.33",
23
23
  },
24
24
  });
25
25
 
@@ -18,6 +18,7 @@ import { tool$dataRequestsAddDataRequestFile } from "./tools/dataRequestsAddData
18
18
  import { tool$dataRequestsDeleteDataRequestFile } from "./tools/dataRequestsDeleteDataRequestFile.js";
19
19
  import { tool$dataRequestsUpdateDataRequest } from "./tools/dataRequestsUpdateDataRequest.js";
20
20
  import { tool$invoicesMakePayment } from "./tools/invoicesMakePayment.js";
21
+ import { tool$invoicesUpdateInvoice } from "./tools/invoicesUpdateInvoice.js";
21
22
  import { tool$organizationsGetFacility } from "./tools/organizationsGetFacility.js";
22
23
  import { tool$organizationsListOrSearchFacilities } from "./tools/organizationsListOrSearchFacilities.js";
23
24
  import { tool$supportArticlesGetSupportArticle } from "./tools/supportArticlesGetSupportArticle.js";
@@ -83,7 +84,7 @@ export function createMCPServer(deps: {
83
84
  }) {
84
85
  const server = new McpServer({
85
86
  name: "GreenSecurity",
86
- version: "0.35.27",
87
+ version: "0.35.33",
87
88
  });
88
89
 
89
90
  const client = new GreenSecurityCore({
@@ -171,6 +172,7 @@ export function createMCPServer(deps: {
171
172
  tool(tool$dataRequestsAddDataRequestFile);
172
173
  tool(tool$dataRequestsDeleteDataRequestFile);
173
174
  tool(tool$dataRequestsUpdateDataRequest);
175
+ tool(tool$invoicesUpdateInvoice);
174
176
  tool(tool$invoicesMakePayment);
175
177
 
176
178
  return server;
@@ -0,0 +1,46 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { invoicesUpdateInvoice } from "../../funcs/invoicesUpdateInvoice.js";
6
+ import * as operations from "../../models/operations/index.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: operations.UpdateInvoiceRequest$inboundSchema,
11
+ };
12
+
13
+ export const tool$invoicesUpdateInvoice: ToolDefinition<typeof args> = {
14
+ name: "invoices-update-invoice",
15
+ description: `Update invoice
16
+
17
+ It will replace all the lines with 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
+ args,
28
+ tool: async (client, args, ctx) => {
29
+ const [result, apiCall] = await invoicesUpdateInvoice(
30
+ client,
31
+ args.request,
32
+ { fetchOptions: { signal: ctx.signal } },
33
+ ).$inspect();
34
+
35
+ if (!result.ok) {
36
+ return {
37
+ content: [{ type: "text", text: result.error.message }],
38
+ isError: true,
39
+ };
40
+ }
41
+
42
+ const value = result.value;
43
+
44
+ return formatResult(value, apiCall);
45
+ },
46
+ };
@@ -53,6 +53,7 @@ export * from "./securityzonecheckin.js";
53
53
  export * from "./senddownloadcode.js";
54
54
  export * from "./submitvendorcredential.js";
55
55
  export * from "./updatedatarequest.js";
56
+ export * from "./updateinvoice.js";
56
57
  export * from "./updatesthewebhookendpointwiththegivenid.js";
57
58
  export * from "./updatevendorcredentialdata.js";
58
59
  export * from "./updatevendorcredentialfile.js";