@greensecurity/javascript-sdk 0.35.3 → 0.35.7

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 (170) hide show
  1. package/README.md +9 -0
  2. package/bin/mcp-server.js +784 -371
  3. package/bin/mcp-server.js.map +14 -8
  4. package/dist/commonjs/__tests__/invoices.test.d.ts +2 -0
  5. package/dist/commonjs/__tests__/invoices.test.d.ts.map +1 -0
  6. package/dist/commonjs/__tests__/invoices.test.js +25 -0
  7. package/dist/commonjs/__tests__/invoices.test.js.map +1 -0
  8. package/dist/commonjs/__tests__/vendors.test.js +17 -0
  9. package/dist/commonjs/__tests__/vendors.test.js.map +1 -1
  10. package/dist/commonjs/__tests__/webhooks.test.js +1 -1
  11. package/dist/commonjs/__tests__/webhooks.test.js.map +1 -1
  12. package/dist/commonjs/__tests__/zones.test.js +33 -7
  13. package/dist/commonjs/__tests__/zones.test.js.map +1 -1
  14. package/dist/commonjs/funcs/invoicesMakePayment.d.ts +17 -0
  15. package/dist/commonjs/funcs/invoicesMakePayment.d.ts.map +1 -0
  16. package/dist/commonjs/funcs/invoicesMakePayment.js +123 -0
  17. package/dist/commonjs/funcs/invoicesMakePayment.js.map +1 -0
  18. package/dist/commonjs/funcs/vendorsUpdateVendorCredentialData.d.ts +17 -0
  19. package/dist/commonjs/funcs/vendorsUpdateVendorCredentialData.d.ts.map +1 -0
  20. package/dist/commonjs/funcs/vendorsUpdateVendorCredentialData.js +128 -0
  21. package/dist/commonjs/funcs/vendorsUpdateVendorCredentialData.js.map +1 -0
  22. package/dist/commonjs/lib/config.d.ts +2 -2
  23. package/dist/commonjs/lib/config.js +2 -2
  24. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  25. package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
  26. package/dist/commonjs/mcp-server/server.js +5 -1
  27. package/dist/commonjs/mcp-server/server.js.map +1 -1
  28. package/dist/commonjs/mcp-server/tools/invoicesMakePayment.d.ts +8 -0
  29. package/dist/commonjs/mcp-server/tools/invoicesMakePayment.d.ts.map +1 -0
  30. package/dist/commonjs/mcp-server/tools/invoicesMakePayment.js +64 -0
  31. package/dist/commonjs/mcp-server/tools/invoicesMakePayment.js.map +1 -0
  32. package/dist/commonjs/mcp-server/tools/vendorsUpdateVendorCredentialData.d.ts +8 -0
  33. package/dist/commonjs/mcp-server/tools/vendorsUpdateVendorCredentialData.d.ts.map +1 -0
  34. package/dist/commonjs/mcp-server/tools/vendorsUpdateVendorCredentialData.js +64 -0
  35. package/dist/commonjs/mcp-server/tools/vendorsUpdateVendorCredentialData.js.map +1 -0
  36. package/dist/commonjs/models/components/credential.d.ts +4 -0
  37. package/dist/commonjs/models/components/credential.d.ts.map +1 -1
  38. package/dist/commonjs/models/components/credential.js +8 -0
  39. package/dist/commonjs/models/components/credential.js.map +1 -1
  40. package/dist/commonjs/models/operations/index.d.ts +2 -0
  41. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  42. package/dist/commonjs/models/operations/index.js +2 -0
  43. package/dist/commonjs/models/operations/index.js.map +1 -1
  44. package/dist/commonjs/models/operations/makepayment.d.ts +91 -0
  45. package/dist/commonjs/models/operations/makepayment.d.ts.map +1 -0
  46. package/dist/commonjs/models/operations/makepayment.js +146 -0
  47. package/dist/commonjs/models/operations/makepayment.js.map +1 -0
  48. package/dist/commonjs/models/operations/updatevendorcredentialdata.d.ts +186 -0
  49. package/dist/commonjs/models/operations/updatevendorcredentialdata.d.ts.map +1 -0
  50. package/dist/commonjs/models/operations/updatevendorcredentialdata.js +217 -0
  51. package/dist/commonjs/models/operations/updatevendorcredentialdata.js.map +1 -0
  52. package/dist/commonjs/react-query/index.d.ts +2 -0
  53. package/dist/commonjs/react-query/index.d.ts.map +1 -1
  54. package/dist/commonjs/react-query/index.js +2 -0
  55. package/dist/commonjs/react-query/index.js.map +1 -1
  56. package/dist/commonjs/react-query/invoicesMakePayment.d.ts +23 -0
  57. package/dist/commonjs/react-query/invoicesMakePayment.d.ts.map +1 -0
  58. package/dist/commonjs/react-query/invoicesMakePayment.js +47 -0
  59. package/dist/commonjs/react-query/invoicesMakePayment.js.map +1 -0
  60. package/dist/commonjs/react-query/vendorsUpdateVendorCredentialData.d.ts +23 -0
  61. package/dist/commonjs/react-query/vendorsUpdateVendorCredentialData.d.ts.map +1 -0
  62. package/dist/commonjs/react-query/vendorsUpdateVendorCredentialData.js +51 -0
  63. package/dist/commonjs/react-query/vendorsUpdateVendorCredentialData.js.map +1 -0
  64. package/dist/commonjs/sdk/invoices.d.ts +12 -0
  65. package/dist/commonjs/sdk/invoices.d.ts.map +1 -0
  66. package/dist/commonjs/sdk/invoices.js +22 -0
  67. package/dist/commonjs/sdk/invoices.js.map +1 -0
  68. package/dist/commonjs/sdk/sdk.d.ts +3 -0
  69. package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
  70. package/dist/commonjs/sdk/sdk.js +4 -0
  71. package/dist/commonjs/sdk/sdk.js.map +1 -1
  72. package/dist/commonjs/sdk/vendors.d.ts +7 -0
  73. package/dist/commonjs/sdk/vendors.d.ts.map +1 -1
  74. package/dist/commonjs/sdk/vendors.js +10 -0
  75. package/dist/commonjs/sdk/vendors.js.map +1 -1
  76. package/dist/esm/__tests__/invoices.test.d.ts +2 -0
  77. package/dist/esm/__tests__/invoices.test.d.ts.map +1 -0
  78. package/dist/esm/__tests__/invoices.test.js +23 -0
  79. package/dist/esm/__tests__/invoices.test.js.map +1 -0
  80. package/dist/esm/__tests__/vendors.test.js +17 -0
  81. package/dist/esm/__tests__/vendors.test.js.map +1 -1
  82. package/dist/esm/__tests__/webhooks.test.js +1 -1
  83. package/dist/esm/__tests__/webhooks.test.js.map +1 -1
  84. package/dist/esm/__tests__/zones.test.js +33 -7
  85. package/dist/esm/__tests__/zones.test.js.map +1 -1
  86. package/dist/esm/funcs/invoicesMakePayment.d.ts +17 -0
  87. package/dist/esm/funcs/invoicesMakePayment.d.ts.map +1 -0
  88. package/dist/esm/funcs/invoicesMakePayment.js +87 -0
  89. package/dist/esm/funcs/invoicesMakePayment.js.map +1 -0
  90. package/dist/esm/funcs/vendorsUpdateVendorCredentialData.d.ts +17 -0
  91. package/dist/esm/funcs/vendorsUpdateVendorCredentialData.d.ts.map +1 -0
  92. package/dist/esm/funcs/vendorsUpdateVendorCredentialData.js +92 -0
  93. package/dist/esm/funcs/vendorsUpdateVendorCredentialData.js.map +1 -0
  94. package/dist/esm/lib/config.d.ts +2 -2
  95. package/dist/esm/lib/config.js +2 -2
  96. package/dist/esm/mcp-server/mcp-server.js +1 -1
  97. package/dist/esm/mcp-server/server.d.ts.map +1 -1
  98. package/dist/esm/mcp-server/server.js +5 -1
  99. package/dist/esm/mcp-server/server.js.map +1 -1
  100. package/dist/esm/mcp-server/tools/invoicesMakePayment.d.ts +8 -0
  101. package/dist/esm/mcp-server/tools/invoicesMakePayment.d.ts.map +1 -0
  102. package/dist/esm/mcp-server/tools/invoicesMakePayment.js +28 -0
  103. package/dist/esm/mcp-server/tools/invoicesMakePayment.js.map +1 -0
  104. package/dist/esm/mcp-server/tools/vendorsUpdateVendorCredentialData.d.ts +8 -0
  105. package/dist/esm/mcp-server/tools/vendorsUpdateVendorCredentialData.d.ts.map +1 -0
  106. package/dist/esm/mcp-server/tools/vendorsUpdateVendorCredentialData.js +28 -0
  107. package/dist/esm/mcp-server/tools/vendorsUpdateVendorCredentialData.js.map +1 -0
  108. package/dist/esm/models/components/credential.d.ts +4 -0
  109. package/dist/esm/models/components/credential.d.ts.map +1 -1
  110. package/dist/esm/models/components/credential.js +8 -0
  111. package/dist/esm/models/components/credential.js.map +1 -1
  112. package/dist/esm/models/operations/index.d.ts +2 -0
  113. package/dist/esm/models/operations/index.d.ts.map +1 -1
  114. package/dist/esm/models/operations/index.js +2 -0
  115. package/dist/esm/models/operations/index.js.map +1 -1
  116. package/dist/esm/models/operations/makepayment.d.ts +91 -0
  117. package/dist/esm/models/operations/makepayment.d.ts.map +1 -0
  118. package/dist/esm/models/operations/makepayment.js +104 -0
  119. package/dist/esm/models/operations/makepayment.js.map +1 -0
  120. package/dist/esm/models/operations/updatevendorcredentialdata.d.ts +186 -0
  121. package/dist/esm/models/operations/updatevendorcredentialdata.d.ts.map +1 -0
  122. package/dist/esm/models/operations/updatevendorcredentialdata.js +177 -0
  123. package/dist/esm/models/operations/updatevendorcredentialdata.js.map +1 -0
  124. package/dist/esm/react-query/index.d.ts +2 -0
  125. package/dist/esm/react-query/index.d.ts.map +1 -1
  126. package/dist/esm/react-query/index.js +2 -0
  127. package/dist/esm/react-query/index.js.map +1 -1
  128. package/dist/esm/react-query/invoicesMakePayment.d.ts +23 -0
  129. package/dist/esm/react-query/invoicesMakePayment.d.ts.map +1 -0
  130. package/dist/esm/react-query/invoicesMakePayment.js +42 -0
  131. package/dist/esm/react-query/invoicesMakePayment.js.map +1 -0
  132. package/dist/esm/react-query/vendorsUpdateVendorCredentialData.d.ts +23 -0
  133. package/dist/esm/react-query/vendorsUpdateVendorCredentialData.d.ts.map +1 -0
  134. package/dist/esm/react-query/vendorsUpdateVendorCredentialData.js +46 -0
  135. package/dist/esm/react-query/vendorsUpdateVendorCredentialData.js.map +1 -0
  136. package/dist/esm/sdk/invoices.d.ts +12 -0
  137. package/dist/esm/sdk/invoices.d.ts.map +1 -0
  138. package/dist/esm/sdk/invoices.js +18 -0
  139. package/dist/esm/sdk/invoices.js.map +1 -0
  140. package/dist/esm/sdk/sdk.d.ts +3 -0
  141. package/dist/esm/sdk/sdk.d.ts.map +1 -1
  142. package/dist/esm/sdk/sdk.js +4 -0
  143. package/dist/esm/sdk/sdk.js.map +1 -1
  144. package/dist/esm/sdk/vendors.d.ts +7 -0
  145. package/dist/esm/sdk/vendors.d.ts.map +1 -1
  146. package/dist/esm/sdk/vendors.js +10 -0
  147. package/dist/esm/sdk/vendors.js.map +1 -1
  148. package/jsr.json +1 -1
  149. package/package.json +1 -1
  150. package/src/__tests__/invoices.test.ts +26 -0
  151. package/src/__tests__/vendors.test.ts +20 -0
  152. package/src/__tests__/webhooks.test.ts +1 -1
  153. package/src/__tests__/zones.test.ts +33 -7
  154. package/src/funcs/invoicesMakePayment.ts +172 -0
  155. package/src/funcs/vendorsUpdateVendorCredentialData.ts +180 -0
  156. package/src/lib/config.ts +2 -2
  157. package/src/mcp-server/mcp-server.ts +1 -1
  158. package/src/mcp-server/server.ts +5 -1
  159. package/src/mcp-server/tools/invoicesMakePayment.ts +37 -0
  160. package/src/mcp-server/tools/vendorsUpdateVendorCredentialData.ts +39 -0
  161. package/src/models/components/credential.ts +12 -0
  162. package/src/models/operations/index.ts +2 -0
  163. package/src/models/operations/makepayment.ts +217 -0
  164. package/src/models/operations/updatevendorcredentialdata.ts +305 -0
  165. package/src/react-query/index.ts +2 -0
  166. package/src/react-query/invoicesMakePayment.ts +89 -0
  167. package/src/react-query/vendorsUpdateVendorCredentialData.ts +92 -0
  168. package/src/sdk/invoices.ts +27 -0
  169. package/src/sdk/sdk.ts +6 -0
  170. package/src/sdk/vendors.ts +18 -0
@@ -0,0 +1,180 @@
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 vendor credential data
30
+ *
31
+ * @remarks
32
+ * Update vendor credential data
33
+ */
34
+ export function vendorsUpdateVendorCredentialData(
35
+ client: GreenSecurityCore,
36
+ request: operations.UpdateVendorCredentialDataRequest,
37
+ options?: RequestOptions,
38
+ ): APIPromise<
39
+ Result<
40
+ boolean,
41
+ | errors.ApiErrorResponse
42
+ | APIError
43
+ | SDKValidationError
44
+ | UnexpectedClientError
45
+ | InvalidRequestError
46
+ | RequestAbortedError
47
+ | RequestTimeoutError
48
+ | ConnectionError
49
+ >
50
+ > {
51
+ return new APIPromise($do(
52
+ client,
53
+ request,
54
+ options,
55
+ ));
56
+ }
57
+
58
+ async function $do(
59
+ client: GreenSecurityCore,
60
+ request: operations.UpdateVendorCredentialDataRequest,
61
+ options?: RequestOptions,
62
+ ): Promise<
63
+ [
64
+ Result<
65
+ boolean,
66
+ | errors.ApiErrorResponse
67
+ | APIError
68
+ | SDKValidationError
69
+ | UnexpectedClientError
70
+ | InvalidRequestError
71
+ | RequestAbortedError
72
+ | RequestTimeoutError
73
+ | ConnectionError
74
+ >,
75
+ APICall,
76
+ ]
77
+ > {
78
+ const parsed = safeParse(
79
+ request,
80
+ (value) =>
81
+ operations.UpdateVendorCredentialDataRequest$outboundSchema.parse(value),
82
+ "Input validation failed",
83
+ );
84
+ if (!parsed.ok) {
85
+ return [parsed, { status: "invalid" }];
86
+ }
87
+ const payload = parsed.value;
88
+ const body = encodeJSON("body", payload.RequestBody, { explode: true });
89
+
90
+ const pathParams = {
91
+ id: encodeSimple("id", payload.id, {
92
+ explode: false,
93
+ charEncoding: "percent",
94
+ }),
95
+ vendor_id_or_me: encodeSimple("vendor_id_or_me", payload.vendor_id_or_me, {
96
+ explode: false,
97
+ charEncoding: "percent",
98
+ }),
99
+ };
100
+
101
+ const path = pathToFunc("/vendors/{vendor_id_or_me}/credentials/{id}")(
102
+ pathParams,
103
+ );
104
+
105
+ const headers = new Headers(compactMap({
106
+ "Content-Type": "application/json",
107
+ Accept: "application/json",
108
+ }));
109
+
110
+ const securityInput = await extractSecurity(client._options.security);
111
+ const requestSecurity = resolveGlobalSecurity(securityInput);
112
+
113
+ const context = {
114
+ options: client._options,
115
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
116
+ operationID: "updateVendorCredentialData",
117
+ oAuth2Scopes: [],
118
+
119
+ resolvedSecurity: requestSecurity,
120
+
121
+ securitySource: client._options.security,
122
+ retryConfig: options?.retries
123
+ || client._options.retryConfig
124
+ || { strategy: "none" },
125
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
126
+ };
127
+
128
+ const requestRes = client._createRequest(context, {
129
+ security: requestSecurity,
130
+ method: "PUT",
131
+ baseURL: options?.serverURL,
132
+ path: path,
133
+ headers: headers,
134
+ body: body,
135
+ userAgent: client._options.userAgent,
136
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
137
+ }, options);
138
+ if (!requestRes.ok) {
139
+ return [requestRes, { status: "invalid" }];
140
+ }
141
+ const req = requestRes.value;
142
+
143
+ const doResult = await client._do(req, {
144
+ context,
145
+ errorCodes: ["400", "401", "403", "404", "4XX", "500", "5XX"],
146
+ retryConfig: context.retryConfig,
147
+ retryCodes: context.retryCodes,
148
+ });
149
+ if (!doResult.ok) {
150
+ return [doResult, { status: "request-error", request: req }];
151
+ }
152
+ const response = doResult.value;
153
+
154
+ const responseFields = {
155
+ HttpMeta: { Response: response, Request: req },
156
+ };
157
+
158
+ const [result] = await M.match<
159
+ boolean,
160
+ | errors.ApiErrorResponse
161
+ | APIError
162
+ | SDKValidationError
163
+ | UnexpectedClientError
164
+ | InvalidRequestError
165
+ | RequestAbortedError
166
+ | RequestTimeoutError
167
+ | ConnectionError
168
+ >(
169
+ M.json(200, z.boolean()),
170
+ M.jsonErr([400, 401, 403, 404], errors.ApiErrorResponse$inboundSchema),
171
+ M.jsonErr(500, errors.ApiErrorResponse$inboundSchema),
172
+ M.fail("4XX"),
173
+ M.fail("5XX"),
174
+ )(response, { extraFields: responseFields });
175
+ if (!result.ok) {
176
+ return [result, { status: "complete", request: req, response }];
177
+ }
178
+
179
+ return [result, { status: "complete", request: req, response }];
180
+ }
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.3",
79
+ sdkVersion: "0.35.7",
80
80
  genVersion: "2.620.2",
81
81
  userAgent:
82
- "speakeasy-sdk/typescript 0.35.3 2.620.2 0.0.3 @greensecurity/javascript-sdk",
82
+ "speakeasy-sdk/typescript 0.35.7 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.3",
22
+ currentVersion: "0.35.7",
23
23
  },
24
24
  });
25
25
 
@@ -17,6 +17,7 @@ import { tool$companiesListOrSearchCompanies } from "./tools/companiesListOrSear
17
17
  import { tool$dataRequestsAddDataRequestFile } from "./tools/dataRequestsAddDataRequestFile.js";
18
18
  import { tool$dataRequestsDeleteDataRequestFile } from "./tools/dataRequestsDeleteDataRequestFile.js";
19
19
  import { tool$dataRequestsUpdateDataRequest } from "./tools/dataRequestsUpdateDataRequest.js";
20
+ import { tool$invoicesMakePayment } from "./tools/invoicesMakePayment.js";
20
21
  import { tool$organizationsGetFacility } from "./tools/organizationsGetFacility.js";
21
22
  import { tool$organizationsListOrSearchFacilities } from "./tools/organizationsListOrSearchFacilities.js";
22
23
  import { tool$supportArticlesGetSupportArticle } from "./tools/supportArticlesGetSupportArticle.js";
@@ -61,6 +62,7 @@ import { tool$vendorsListVendorScrubPurchases } from "./tools/vendorsListVendorS
61
62
  import { tool$vendorsPurchaseScrubCredits } from "./tools/vendorsPurchaseScrubCredits.js";
62
63
  import { tool$vendorsSendDownloadCode } from "./tools/vendorsSendDownloadCode.js";
63
64
  import { tool$vendorsSubmitVendorCredential } from "./tools/vendorsSubmitVendorCredential.js";
65
+ import { tool$vendorsUpdateVendorCredentialData } from "./tools/vendorsUpdateVendorCredentialData.js";
64
66
  import { tool$vendorsUpdateVendorCredentialFile } from "./tools/vendorsUpdateVendorCredentialFile.js";
65
67
  import { tool$vendorsUpdateVendorDetails } from "./tools/vendorsUpdateVendorDetails.js";
66
68
  import { tool$vendorsUpdateVendorManagedByCompany } from "./tools/vendorsUpdateVendorManagedByCompany.js";
@@ -81,7 +83,7 @@ export function createMCPServer(deps: {
81
83
  }) {
82
84
  const server = new McpServer({
83
85
  name: "GreenSecurity",
84
- version: "0.35.3",
86
+ version: "0.35.7",
85
87
  });
86
88
 
87
89
  const client = new GreenSecurityCore({
@@ -115,6 +117,7 @@ export function createMCPServer(deps: {
115
117
  tool(tool$vendorsListVendorJobTitles);
116
118
  tool(tool$vendorsListVendorCredentials);
117
119
  tool(tool$vendorsGetVendorCredentialDetails);
120
+ tool(tool$vendorsUpdateVendorCredentialData);
118
121
  tool(tool$vendorsGetVendorCredentialFile);
119
122
  tool(tool$vendorsUpdateVendorCredentialFile);
120
123
  tool(tool$vendorsDeleteVendorCredentialFile);
@@ -168,6 +171,7 @@ export function createMCPServer(deps: {
168
171
  tool(tool$dataRequestsAddDataRequestFile);
169
172
  tool(tool$dataRequestsDeleteDataRequestFile);
170
173
  tool(tool$dataRequestsUpdateDataRequest);
174
+ tool(tool$invoicesMakePayment);
171
175
 
172
176
  return server;
173
177
  }
@@ -0,0 +1,37 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { invoicesMakePayment } from "../../funcs/invoicesMakePayment.js";
6
+ import * as operations from "../../models/operations/index.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: operations.MakePaymentRequest$inboundSchema,
11
+ };
12
+
13
+ export const tool$invoicesMakePayment: ToolDefinition<typeof args> = {
14
+ name: "invoices-make-payment",
15
+ description: `Make payment for the invoice
16
+
17
+ Make payment for the invoice`,
18
+ args,
19
+ tool: async (client, args, ctx) => {
20
+ const [result, apiCall] = await invoicesMakePayment(
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,39 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { vendorsUpdateVendorCredentialData } from "../../funcs/vendorsUpdateVendorCredentialData.js";
6
+ import * as operations from "../../models/operations/index.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: operations.UpdateVendorCredentialDataRequest$inboundSchema,
11
+ };
12
+
13
+ export const tool$vendorsUpdateVendorCredentialData: ToolDefinition<
14
+ typeof args
15
+ > = {
16
+ name: "vendors-update-vendor-credential-data",
17
+ description: `Update vendor credential data
18
+
19
+ Update vendor credential data`,
20
+ args,
21
+ tool: async (client, args, ctx) => {
22
+ const [result, apiCall] = await vendorsUpdateVendorCredentialData(
23
+ client,
24
+ args.request,
25
+ { fetchOptions: { signal: ctx.signal } },
26
+ ).$inspect();
27
+
28
+ if (!result.ok) {
29
+ return {
30
+ content: [{ type: "text", text: result.error.message }],
31
+ isError: true,
32
+ };
33
+ }
34
+
35
+ const value = result.value;
36
+
37
+ return formatResult(value, apiCall);
38
+ },
39
+ };
@@ -56,6 +56,8 @@ export type Credential = {
56
56
  uiSchema?: string | null | undefined;
57
57
  behavior?: string | null | undefined;
58
58
  requireElectronicSignature?: boolean | undefined;
59
+ acceptText?: string | null | undefined;
60
+ acceptSubmittingText?: string | null | undefined;
59
61
  declineSubmittingText?: string | null | undefined;
60
62
  declineDescription?: string | null | undefined;
61
63
  requireDeclineFile?: boolean | undefined;
@@ -143,6 +145,8 @@ export const Credential$inboundSchema: z.ZodType<
143
145
  ui_schema: z.nullable(z.string()).optional(),
144
146
  behavior: z.nullable(z.string()).optional(),
145
147
  require_electronic_signature: z.boolean().optional(),
148
+ accept_text: z.nullable(z.string()).optional(),
149
+ accept_submitting_text: z.nullable(z.string()).optional(),
146
150
  decline_submitting_text: z.nullable(z.string()).optional(),
147
151
  decline_description: z.nullable(z.string()).optional(),
148
152
  require_decline_file: z.boolean().optional(),
@@ -160,6 +164,8 @@ export const Credential$inboundSchema: z.ZodType<
160
164
  "js_schema": "jsSchema",
161
165
  "ui_schema": "uiSchema",
162
166
  "require_electronic_signature": "requireElectronicSignature",
167
+ "accept_text": "acceptText",
168
+ "accept_submitting_text": "acceptSubmittingText",
163
169
  "decline_submitting_text": "declineSubmittingText",
164
170
  "decline_description": "declineDescription",
165
171
  "require_decline_file": "requireDeclineFile",
@@ -183,6 +189,8 @@ export type Credential$Outbound = {
183
189
  ui_schema?: string | null | undefined;
184
190
  behavior?: string | null | undefined;
185
191
  require_electronic_signature?: boolean | undefined;
192
+ accept_text?: string | null | undefined;
193
+ accept_submitting_text?: string | null | undefined;
186
194
  decline_submitting_text?: string | null | undefined;
187
195
  decline_description?: string | null | undefined;
188
196
  require_decline_file?: boolean | undefined;
@@ -209,6 +217,8 @@ export const Credential$outboundSchema: z.ZodType<
209
217
  uiSchema: z.nullable(z.string()).optional(),
210
218
  behavior: z.nullable(z.string()).optional(),
211
219
  requireElectronicSignature: z.boolean().optional(),
220
+ acceptText: z.nullable(z.string()).optional(),
221
+ acceptSubmittingText: z.nullable(z.string()).optional(),
212
222
  declineSubmittingText: z.nullable(z.string()).optional(),
213
223
  declineDescription: z.nullable(z.string()).optional(),
214
224
  requireDeclineFile: z.boolean().optional(),
@@ -226,6 +236,8 @@ export const Credential$outboundSchema: z.ZodType<
226
236
  jsSchema: "js_schema",
227
237
  uiSchema: "ui_schema",
228
238
  requireElectronicSignature: "require_electronic_signature",
239
+ acceptText: "accept_text",
240
+ acceptSubmittingText: "accept_submitting_text",
229
241
  declineSubmittingText: "decline_submitting_text",
230
242
  declineDescription: "decline_description",
231
243
  requireDeclineFile: "require_decline_file",
@@ -44,6 +44,7 @@ export * from "./listvendorscrubdetails.js";
44
44
  export * from "./listvendorscrubpackages.js";
45
45
  export * from "./listvendorscrubpurchases.js";
46
46
  export * from "./magiclink.js";
47
+ export * from "./makepayment.js";
47
48
  export * from "./password.js";
48
49
  export * from "./passwordresetrequest.js";
49
50
  export * from "./postauthenticate.js";
@@ -53,6 +54,7 @@ export * from "./senddownloadcode.js";
53
54
  export * from "./submitvendorcredential.js";
54
55
  export * from "./updatedatarequest.js";
55
56
  export * from "./updatesthewebhookendpointwiththegivenid.js";
57
+ export * from "./updatevendorcredentialdata.js";
56
58
  export * from "./updatevendorcredentialfile.js";
57
59
  export * from "./updatevendordetails.js";
58
60
  export * from "./updatevendormanagedbycompany.js";
@@ -0,0 +1,217 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ export type MakePaymentRequestBody = {
12
+ amount?: number | undefined;
13
+ useCredits?: boolean | undefined;
14
+ };
15
+
16
+ export type MakePaymentRequest = {
17
+ /**
18
+ * The identifier of the object
19
+ */
20
+ id: number;
21
+ requestBody: MakePaymentRequestBody;
22
+ };
23
+
24
+ /**
25
+ * The request was successful, and the server has returned the requested resource in the response body.
26
+ */
27
+ export type MakePaymentResponseBody = {
28
+ success?: boolean | undefined;
29
+ error?: string | undefined;
30
+ };
31
+
32
+ /** @internal */
33
+ export const MakePaymentRequestBody$inboundSchema: z.ZodType<
34
+ MakePaymentRequestBody,
35
+ z.ZodTypeDef,
36
+ unknown
37
+ > = z.object({
38
+ amount: z.number().optional(),
39
+ use_credits: z.boolean().optional(),
40
+ }).transform((v) => {
41
+ return remap$(v, {
42
+ "use_credits": "useCredits",
43
+ });
44
+ });
45
+
46
+ /** @internal */
47
+ export type MakePaymentRequestBody$Outbound = {
48
+ amount?: number | undefined;
49
+ use_credits?: boolean | undefined;
50
+ };
51
+
52
+ /** @internal */
53
+ export const MakePaymentRequestBody$outboundSchema: z.ZodType<
54
+ MakePaymentRequestBody$Outbound,
55
+ z.ZodTypeDef,
56
+ MakePaymentRequestBody
57
+ > = z.object({
58
+ amount: z.number().optional(),
59
+ useCredits: z.boolean().optional(),
60
+ }).transform((v) => {
61
+ return remap$(v, {
62
+ useCredits: "use_credits",
63
+ });
64
+ });
65
+
66
+ /**
67
+ * @internal
68
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
69
+ */
70
+ export namespace MakePaymentRequestBody$ {
71
+ /** @deprecated use `MakePaymentRequestBody$inboundSchema` instead. */
72
+ export const inboundSchema = MakePaymentRequestBody$inboundSchema;
73
+ /** @deprecated use `MakePaymentRequestBody$outboundSchema` instead. */
74
+ export const outboundSchema = MakePaymentRequestBody$outboundSchema;
75
+ /** @deprecated use `MakePaymentRequestBody$Outbound` instead. */
76
+ export type Outbound = MakePaymentRequestBody$Outbound;
77
+ }
78
+
79
+ export function makePaymentRequestBodyToJSON(
80
+ makePaymentRequestBody: MakePaymentRequestBody,
81
+ ): string {
82
+ return JSON.stringify(
83
+ MakePaymentRequestBody$outboundSchema.parse(makePaymentRequestBody),
84
+ );
85
+ }
86
+
87
+ export function makePaymentRequestBodyFromJSON(
88
+ jsonString: string,
89
+ ): SafeParseResult<MakePaymentRequestBody, SDKValidationError> {
90
+ return safeParse(
91
+ jsonString,
92
+ (x) => MakePaymentRequestBody$inboundSchema.parse(JSON.parse(x)),
93
+ `Failed to parse 'MakePaymentRequestBody' from JSON`,
94
+ );
95
+ }
96
+
97
+ /** @internal */
98
+ export const MakePaymentRequest$inboundSchema: z.ZodType<
99
+ MakePaymentRequest,
100
+ z.ZodTypeDef,
101
+ unknown
102
+ > = z.object({
103
+ id: z.number().int(),
104
+ RequestBody: z.lazy(() => MakePaymentRequestBody$inboundSchema),
105
+ }).transform((v) => {
106
+ return remap$(v, {
107
+ "RequestBody": "requestBody",
108
+ });
109
+ });
110
+
111
+ /** @internal */
112
+ export type MakePaymentRequest$Outbound = {
113
+ id: number;
114
+ RequestBody: MakePaymentRequestBody$Outbound;
115
+ };
116
+
117
+ /** @internal */
118
+ export const MakePaymentRequest$outboundSchema: z.ZodType<
119
+ MakePaymentRequest$Outbound,
120
+ z.ZodTypeDef,
121
+ MakePaymentRequest
122
+ > = z.object({
123
+ id: z.number().int(),
124
+ requestBody: z.lazy(() => MakePaymentRequestBody$outboundSchema),
125
+ }).transform((v) => {
126
+ return remap$(v, {
127
+ requestBody: "RequestBody",
128
+ });
129
+ });
130
+
131
+ /**
132
+ * @internal
133
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
134
+ */
135
+ export namespace MakePaymentRequest$ {
136
+ /** @deprecated use `MakePaymentRequest$inboundSchema` instead. */
137
+ export const inboundSchema = MakePaymentRequest$inboundSchema;
138
+ /** @deprecated use `MakePaymentRequest$outboundSchema` instead. */
139
+ export const outboundSchema = MakePaymentRequest$outboundSchema;
140
+ /** @deprecated use `MakePaymentRequest$Outbound` instead. */
141
+ export type Outbound = MakePaymentRequest$Outbound;
142
+ }
143
+
144
+ export function makePaymentRequestToJSON(
145
+ makePaymentRequest: MakePaymentRequest,
146
+ ): string {
147
+ return JSON.stringify(
148
+ MakePaymentRequest$outboundSchema.parse(makePaymentRequest),
149
+ );
150
+ }
151
+
152
+ export function makePaymentRequestFromJSON(
153
+ jsonString: string,
154
+ ): SafeParseResult<MakePaymentRequest, SDKValidationError> {
155
+ return safeParse(
156
+ jsonString,
157
+ (x) => MakePaymentRequest$inboundSchema.parse(JSON.parse(x)),
158
+ `Failed to parse 'MakePaymentRequest' from JSON`,
159
+ );
160
+ }
161
+
162
+ /** @internal */
163
+ export const MakePaymentResponseBody$inboundSchema: z.ZodType<
164
+ MakePaymentResponseBody,
165
+ z.ZodTypeDef,
166
+ unknown
167
+ > = z.object({
168
+ success: z.boolean().optional(),
169
+ error: z.string().optional(),
170
+ });
171
+
172
+ /** @internal */
173
+ export type MakePaymentResponseBody$Outbound = {
174
+ success?: boolean | undefined;
175
+ error?: string | undefined;
176
+ };
177
+
178
+ /** @internal */
179
+ export const MakePaymentResponseBody$outboundSchema: z.ZodType<
180
+ MakePaymentResponseBody$Outbound,
181
+ z.ZodTypeDef,
182
+ MakePaymentResponseBody
183
+ > = z.object({
184
+ success: z.boolean().optional(),
185
+ error: z.string().optional(),
186
+ });
187
+
188
+ /**
189
+ * @internal
190
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
191
+ */
192
+ export namespace MakePaymentResponseBody$ {
193
+ /** @deprecated use `MakePaymentResponseBody$inboundSchema` instead. */
194
+ export const inboundSchema = MakePaymentResponseBody$inboundSchema;
195
+ /** @deprecated use `MakePaymentResponseBody$outboundSchema` instead. */
196
+ export const outboundSchema = MakePaymentResponseBody$outboundSchema;
197
+ /** @deprecated use `MakePaymentResponseBody$Outbound` instead. */
198
+ export type Outbound = MakePaymentResponseBody$Outbound;
199
+ }
200
+
201
+ export function makePaymentResponseBodyToJSON(
202
+ makePaymentResponseBody: MakePaymentResponseBody,
203
+ ): string {
204
+ return JSON.stringify(
205
+ MakePaymentResponseBody$outboundSchema.parse(makePaymentResponseBody),
206
+ );
207
+ }
208
+
209
+ export function makePaymentResponseBodyFromJSON(
210
+ jsonString: string,
211
+ ): SafeParseResult<MakePaymentResponseBody, SDKValidationError> {
212
+ return safeParse(
213
+ jsonString,
214
+ (x) => MakePaymentResponseBody$inboundSchema.parse(JSON.parse(x)),
215
+ `Failed to parse 'MakePaymentResponseBody' from JSON`,
216
+ );
217
+ }