@greensecurity/javascript-sdk 0.45.0-beta.7 → 0.45.0-beta.9

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 (86) hide show
  1. package/README.md +4 -1
  2. package/dist/commonjs/__tests__/invoices.test.js +18 -0
  3. package/dist/commonjs/__tests__/invoices.test.js.map +1 -1
  4. package/dist/commonjs/__tests__/vendors.test.js +1 -1
  5. package/dist/commonjs/__tests__/vendors.test.js.map +1 -1
  6. package/dist/commonjs/__tests__/zones.test.js +30 -2
  7. package/dist/commonjs/__tests__/zones.test.js.map +1 -1
  8. package/dist/commonjs/funcs/invoicesConvertQuote.d.ts +33 -0
  9. package/dist/commonjs/funcs/invoicesConvertQuote.d.ts.map +1 -0
  10. package/dist/commonjs/funcs/invoicesConvertQuote.js +138 -0
  11. package/dist/commonjs/funcs/invoicesConvertQuote.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/models/operations/convertquote.d.ts +46 -0
  15. package/dist/commonjs/models/operations/convertquote.d.ts.map +1 -0
  16. package/dist/commonjs/models/operations/convertquote.js +69 -0
  17. package/dist/commonjs/models/operations/convertquote.js.map +1 -0
  18. package/dist/commonjs/models/operations/createinvoice.d.ts +85 -0
  19. package/dist/commonjs/models/operations/createinvoice.d.ts.map +1 -1
  20. package/dist/commonjs/models/operations/createinvoice.js +56 -1
  21. package/dist/commonjs/models/operations/createinvoice.js.map +1 -1
  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/react-query/index.d.ts +1 -0
  27. package/dist/commonjs/react-query/index.d.ts.map +1 -1
  28. package/dist/commonjs/react-query/index.js +1 -0
  29. package/dist/commonjs/react-query/index.js.map +1 -1
  30. package/dist/commonjs/react-query/invoicesConvertQuote.d.ts +42 -0
  31. package/dist/commonjs/react-query/invoicesConvertQuote.d.ts.map +1 -0
  32. package/dist/commonjs/react-query/invoicesConvertQuote.js +60 -0
  33. package/dist/commonjs/react-query/invoicesConvertQuote.js.map +1 -0
  34. package/dist/commonjs/sdk/invoices.d.ts +20 -0
  35. package/dist/commonjs/sdk/invoices.d.ts.map +1 -1
  36. package/dist/commonjs/sdk/invoices.js +23 -0
  37. package/dist/commonjs/sdk/invoices.js.map +1 -1
  38. package/dist/esm/__tests__/invoices.test.js +18 -0
  39. package/dist/esm/__tests__/invoices.test.js.map +1 -1
  40. package/dist/esm/__tests__/vendors.test.js +1 -1
  41. package/dist/esm/__tests__/vendors.test.js.map +1 -1
  42. package/dist/esm/__tests__/zones.test.js +30 -2
  43. package/dist/esm/__tests__/zones.test.js.map +1 -1
  44. package/dist/esm/funcs/invoicesConvertQuote.d.ts +33 -0
  45. package/dist/esm/funcs/invoicesConvertQuote.d.ts.map +1 -0
  46. package/dist/esm/funcs/invoicesConvertQuote.js +102 -0
  47. package/dist/esm/funcs/invoicesConvertQuote.js.map +1 -0
  48. package/dist/esm/lib/config.d.ts +2 -2
  49. package/dist/esm/lib/config.js +2 -2
  50. package/dist/esm/models/operations/convertquote.d.ts +46 -0
  51. package/dist/esm/models/operations/convertquote.d.ts.map +1 -0
  52. package/dist/esm/models/operations/convertquote.js +31 -0
  53. package/dist/esm/models/operations/convertquote.js.map +1 -0
  54. package/dist/esm/models/operations/createinvoice.d.ts +85 -0
  55. package/dist/esm/models/operations/createinvoice.d.ts.map +1 -1
  56. package/dist/esm/models/operations/createinvoice.js +55 -0
  57. package/dist/esm/models/operations/createinvoice.js.map +1 -1
  58. package/dist/esm/models/operations/index.d.ts +1 -0
  59. package/dist/esm/models/operations/index.d.ts.map +1 -1
  60. package/dist/esm/models/operations/index.js +1 -0
  61. package/dist/esm/models/operations/index.js.map +1 -1
  62. package/dist/esm/react-query/index.d.ts +1 -0
  63. package/dist/esm/react-query/index.d.ts.map +1 -1
  64. package/dist/esm/react-query/index.js +1 -0
  65. package/dist/esm/react-query/index.js.map +1 -1
  66. package/dist/esm/react-query/invoicesConvertQuote.d.ts +42 -0
  67. package/dist/esm/react-query/invoicesConvertQuote.d.ts.map +1 -0
  68. package/dist/esm/react-query/invoicesConvertQuote.js +55 -0
  69. package/dist/esm/react-query/invoicesConvertQuote.js.map +1 -0
  70. package/dist/esm/sdk/invoices.d.ts +20 -0
  71. package/dist/esm/sdk/invoices.d.ts.map +1 -1
  72. package/dist/esm/sdk/invoices.js +23 -0
  73. package/dist/esm/sdk/invoices.js.map +1 -1
  74. package/jsr.json +1 -1
  75. package/package.json +1 -1
  76. package/src/__tests__/invoices.test.ts +21 -0
  77. package/src/__tests__/vendors.test.ts +1 -1
  78. package/src/__tests__/zones.test.ts +30 -2
  79. package/src/funcs/invoicesConvertQuote.ts +190 -0
  80. package/src/lib/config.ts +2 -2
  81. package/src/models/operations/convertquote.ts +94 -0
  82. package/src/models/operations/createinvoice.ts +124 -0
  83. package/src/models/operations/index.ts +1 -0
  84. package/src/react-query/index.ts +1 -0
  85. package/src/react-query/invoicesConvertQuote.ts +124 -0
  86. package/src/sdk/invoices.ts +31 -0
@@ -0,0 +1,190 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { GreenSecurityCore } from "../core.js";
6
+ import { encodeSimple } from "../lib/encodings.js";
7
+ import { matchStatusCode } from "../lib/http.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 { GreenSecurityError } from "../models/errors/greensecurityerror.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
24
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
25
+ import * as operations from "../models/operations/index.js";
26
+ import { APICall, APIPromise } from "../types/async.js";
27
+ import { Result } from "../types/fp.js";
28
+
29
+ /**
30
+ * Convert a quote into an invoice
31
+ *
32
+ * @remarks
33
+ * Converts a quote into the real invoice its caller will be charged for, and
34
+ * returns the new invoice with its calculated totals. Any `VendorCredential`
35
+ * linked to the quote is re-pointed at the new invoice.
36
+ *
37
+ * The operation is idempotent: converting a quote that has already been
38
+ * processed returns the invoice previously created from it rather than
39
+ * creating a second one, so a retried request is safe.
40
+ *
41
+ * The referenced invoice must actually be a quote — a non-quote invoice id
42
+ * responds `400`. Requires a caller whose access scope permits creating
43
+ * invoices; a caller allowed to create the invoice but not to update the
44
+ * linked `VendorCredential` responds `401`.
45
+ *
46
+ * Takes no request body.
47
+ *
48
+ * If set, this operation will use {@link Security.bearerJwt} from the global security.
49
+ */
50
+ export function invoicesConvertQuote(
51
+ client: GreenSecurityCore,
52
+ request: operations.ConvertQuoteRequest,
53
+ options?: RequestOptions,
54
+ ): APIPromise<
55
+ Result<
56
+ operations.ConvertQuoteConvertQuoteOk,
57
+ | errors.ApiErrorResponse
58
+ | GreenSecurityError
59
+ | ResponseValidationError
60
+ | ConnectionError
61
+ | RequestAbortedError
62
+ | RequestTimeoutError
63
+ | InvalidRequestError
64
+ | UnexpectedClientError
65
+ | SDKValidationError
66
+ >
67
+ > {
68
+ return new APIPromise($do(
69
+ client,
70
+ request,
71
+ options,
72
+ ));
73
+ }
74
+
75
+ async function $do(
76
+ client: GreenSecurityCore,
77
+ request: operations.ConvertQuoteRequest,
78
+ options?: RequestOptions,
79
+ ): Promise<
80
+ [
81
+ Result<
82
+ operations.ConvertQuoteConvertQuoteOk,
83
+ | errors.ApiErrorResponse
84
+ | GreenSecurityError
85
+ | ResponseValidationError
86
+ | ConnectionError
87
+ | RequestAbortedError
88
+ | RequestTimeoutError
89
+ | InvalidRequestError
90
+ | UnexpectedClientError
91
+ | SDKValidationError
92
+ >,
93
+ APICall,
94
+ ]
95
+ > {
96
+ const parsed = safeParse(
97
+ request,
98
+ (value) => operations.ConvertQuoteRequest$outboundSchema.parse(value),
99
+ "Input validation failed",
100
+ );
101
+ if (!parsed.ok) {
102
+ return [parsed, { status: "invalid" }];
103
+ }
104
+ const payload = parsed.value;
105
+ const body = null;
106
+
107
+ const pathParams = {
108
+ id: encodeSimple("id", payload.id, {
109
+ explode: false,
110
+ charEncoding: "percent",
111
+ }),
112
+ };
113
+ const path = pathToFunc("/invoices/{id}/convert")(pathParams);
114
+
115
+ const headers = new Headers(compactMap({
116
+ Accept: "application/json",
117
+ }));
118
+
119
+ const securityInput = await extractSecurity(client._options.security);
120
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1]);
121
+
122
+ const context = {
123
+ options: client._options,
124
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
125
+ operationID: "convertQuote",
126
+ oAuth2Scopes: null,
127
+
128
+ resolvedSecurity: requestSecurity,
129
+
130
+ securitySource: client._options.security,
131
+ retryConfig: options?.retries
132
+ || client._options.retryConfig
133
+ || { strategy: "none" },
134
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
135
+ };
136
+
137
+ const requestRes = client._createRequest(context, {
138
+ security: requestSecurity,
139
+ method: "POST",
140
+ baseURL: options?.serverURL,
141
+ path: path,
142
+ headers: headers,
143
+ body: body,
144
+ userAgent: client._options.userAgent,
145
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
146
+ }, options);
147
+ if (!requestRes.ok) {
148
+ return [requestRes, { status: "invalid" }];
149
+ }
150
+ const req = requestRes.value;
151
+
152
+ const doResult = await client._do(req, {
153
+ context,
154
+ isErrorStatusCode: (statusCode: number) =>
155
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
156
+ retryConfig: context.retryConfig,
157
+ retryCodes: context.retryCodes,
158
+ });
159
+ if (!doResult.ok) {
160
+ return [doResult, { status: "request-error", request: req }];
161
+ }
162
+ const response = doResult.value;
163
+
164
+ const responseFields = {
165
+ HttpMeta: { Response: response, Request: req },
166
+ };
167
+
168
+ const [result] = await M.match<
169
+ operations.ConvertQuoteConvertQuoteOk,
170
+ | errors.ApiErrorResponse
171
+ | GreenSecurityError
172
+ | ResponseValidationError
173
+ | ConnectionError
174
+ | RequestAbortedError
175
+ | RequestTimeoutError
176
+ | InvalidRequestError
177
+ | UnexpectedClientError
178
+ | SDKValidationError
179
+ >(
180
+ M.json(200, operations.ConvertQuoteConvertQuoteOk$inboundSchema),
181
+ M.jsonErr([400, 401, 403, 404], errors.ApiErrorResponse$inboundSchema),
182
+ M.fail("4XX"),
183
+ M.fail([500, "5XX"]),
184
+ )(response, req, { extraFields: responseFields });
185
+ if (!result.ok) {
186
+ return [result, { status: "complete", request: req, response }];
187
+ }
188
+
189
+ return [result, { status: "complete", request: req, response }];
190
+ }
package/src/lib/config.ts CHANGED
@@ -80,8 +80,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
80
80
  export const SDK_METADATA = {
81
81
  language: "typescript",
82
82
  openapiDocVersion: "0.44.0",
83
- sdkVersion: "0.45.0-beta.7",
83
+ sdkVersion: "0.45.0-beta.9",
84
84
  genVersion: "2.933.0",
85
85
  userAgent:
86
- "speakeasy-sdk/typescript 0.45.0-beta.7 2.933.0 0.44.0 @greensecurity/javascript-sdk",
86
+ "speakeasy-sdk/typescript 0.45.0-beta.9 2.933.0 0.44.0 @greensecurity/javascript-sdk",
87
87
  } as const;
@@ -0,0 +1,94 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
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 * as types from "../../types/primitives.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ export type ConvertQuoteRequest = {
13
+ /**
14
+ * The identifier of the object
15
+ */
16
+ id: number;
17
+ };
18
+
19
+ /**
20
+ * The quote was converted, and the server has returned the resulting invoice.
21
+ */
22
+ export type ConvertQuoteConvertQuoteOk = {
23
+ /**
24
+ * Identifier of the invoice the quote was converted into.
25
+ */
26
+ id: number;
27
+ success: boolean;
28
+ /**
29
+ * Tax calculated on the new invoice.
30
+ */
31
+ tax?: number | null | undefined;
32
+ /**
33
+ * Shipping calculated on the new invoice.
34
+ */
35
+ shipping?: number | null | undefined;
36
+ /**
37
+ * Convenience fee calculated on the new invoice.
38
+ */
39
+ convenienceFee?: number | null | undefined;
40
+ /**
41
+ * Total amount due on the new invoice, including tax, shipping and the convenience fee.
42
+ */
43
+ total?: number | null | undefined;
44
+ };
45
+
46
+ /** @internal */
47
+ export type ConvertQuoteRequest$Outbound = {
48
+ id: number;
49
+ };
50
+
51
+ /** @internal */
52
+ export const ConvertQuoteRequest$outboundSchema: z.ZodType<
53
+ ConvertQuoteRequest$Outbound,
54
+ z.ZodTypeDef,
55
+ ConvertQuoteRequest
56
+ > = z.object({
57
+ id: z.number().int(),
58
+ });
59
+
60
+ export function convertQuoteRequestToJSON(
61
+ convertQuoteRequest: ConvertQuoteRequest,
62
+ ): string {
63
+ return JSON.stringify(
64
+ ConvertQuoteRequest$outboundSchema.parse(convertQuoteRequest),
65
+ );
66
+ }
67
+
68
+ /** @internal */
69
+ export const ConvertQuoteConvertQuoteOk$inboundSchema: z.ZodType<
70
+ ConvertQuoteConvertQuoteOk,
71
+ z.ZodTypeDef,
72
+ unknown
73
+ > = z.object({
74
+ id: types.number(),
75
+ success: types.boolean(),
76
+ tax: z.nullable(types.number()).optional(),
77
+ shipping: z.nullable(types.number()).optional(),
78
+ convenience_fee: z.nullable(types.number()).optional(),
79
+ total: z.nullable(types.number()).optional(),
80
+ }).transform((v) => {
81
+ return remap$(v, {
82
+ "convenience_fee": "convenienceFee",
83
+ });
84
+ });
85
+
86
+ export function convertQuoteConvertQuoteOkFromJSON(
87
+ jsonString: string,
88
+ ): SafeParseResult<ConvertQuoteConvertQuoteOk, SDKValidationError> {
89
+ return safeParse(
90
+ jsonString,
91
+ (x) => ConvertQuoteConvertQuoteOk$inboundSchema.parse(JSON.parse(x)),
92
+ `Failed to parse 'ConvertQuoteConvertQuoteOk' from JSON`,
93
+ );
94
+ }
@@ -33,10 +33,27 @@ export type CreateInvoiceRequestBodyInvoicesRequestLines = {
33
33
  paymentHandlerData?: string | undefined;
34
34
  };
35
35
 
36
+ /**
37
+ * Set to `quote` to create a non-chargeable quote, used to preview an invoice's calculated totals before committing to it. Convert the quote into the real invoice with `POST /invoices/{id}/convert`. Omit this field to create a chargeable invoice directly.
38
+ */
39
+ export const CreateInvoiceRequestBodyInvoicesRequestInvoiceType = {
40
+ Quote: "quote",
41
+ } as const;
42
+ /**
43
+ * Set to `quote` to create a non-chargeable quote, used to preview an invoice's calculated totals before committing to it. Convert the quote into the real invoice with `POST /invoices/{id}/convert`. Omit this field to create a chargeable invoice directly.
44
+ */
45
+ export type CreateInvoiceRequestBodyInvoicesRequestInvoiceType = ClosedEnum<
46
+ typeof CreateInvoiceRequestBodyInvoicesRequestInvoiceType
47
+ >;
48
+
36
49
  export type Five = {
37
50
  vendorCredentialId: number;
38
51
  lines?: Array<CreateInvoiceRequestBodyInvoicesRequestLines> | undefined;
39
52
  credentialPricingIds?: Array<number> | null | undefined;
53
+ /**
54
+ * Set to `quote` to create a non-chargeable quote, used to preview an invoice's calculated totals before committing to it. Convert the quote into the real invoice with `POST /invoices/{id}/convert`. Omit this field to create a chargeable invoice directly.
55
+ */
56
+ invoiceType?: CreateInvoiceRequestBodyInvoicesRequestInvoiceType | undefined;
40
57
  };
41
58
 
42
59
  export const CreateInvoiceRequestBodyInvoicesPaymentHandler = {
@@ -59,10 +76,27 @@ export type CreateInvoiceRequestBodyInvoicesLines = {
59
76
  paymentHandlerData?: string | undefined;
60
77
  };
61
78
 
79
+ /**
80
+ * Set to `quote` to create a non-chargeable quote, used to preview an invoice's calculated totals before committing to it. Convert the quote into the real invoice with `POST /invoices/{id}/convert`. Omit this field to create a chargeable invoice directly.
81
+ */
82
+ export const CreateInvoiceRequestBodyInvoicesInvoiceType = {
83
+ Quote: "quote",
84
+ } as const;
85
+ /**
86
+ * Set to `quote` to create a non-chargeable quote, used to preview an invoice's calculated totals before committing to it. Convert the quote into the real invoice with `POST /invoices/{id}/convert`. Omit this field to create a chargeable invoice directly.
87
+ */
88
+ export type CreateInvoiceRequestBodyInvoicesInvoiceType = ClosedEnum<
89
+ typeof CreateInvoiceRequestBodyInvoicesInvoiceType
90
+ >;
91
+
62
92
  export type Four = {
63
93
  systemId: number;
64
94
  lines?: Array<CreateInvoiceRequestBodyInvoicesLines> | undefined;
65
95
  credentialPricingIds?: Array<number> | null | undefined;
96
+ /**
97
+ * Set to `quote` to create a non-chargeable quote, used to preview an invoice's calculated totals before committing to it. Convert the quote into the real invoice with `POST /invoices/{id}/convert`. Omit this field to create a chargeable invoice directly.
98
+ */
99
+ invoiceType?: CreateInvoiceRequestBodyInvoicesInvoiceType | undefined;
66
100
  };
67
101
 
68
102
  export const CreateInvoiceRequestBodyPaymentHandler = {
@@ -85,10 +119,27 @@ export type CreateInvoiceRequestBodyLines = {
85
119
  paymentHandlerData?: string | undefined;
86
120
  };
87
121
 
122
+ /**
123
+ * Set to `quote` to create a non-chargeable quote, used to preview an invoice's calculated totals before committing to it. Convert the quote into the real invoice with `POST /invoices/{id}/convert`. Omit this field to create a chargeable invoice directly.
124
+ */
125
+ export const CreateInvoiceRequestBodyInvoiceType = {
126
+ Quote: "quote",
127
+ } as const;
128
+ /**
129
+ * Set to `quote` to create a non-chargeable quote, used to preview an invoice's calculated totals before committing to it. Convert the quote into the real invoice with `POST /invoices/{id}/convert`. Omit this field to create a chargeable invoice directly.
130
+ */
131
+ export type CreateInvoiceRequestBodyInvoiceType = ClosedEnum<
132
+ typeof CreateInvoiceRequestBodyInvoiceType
133
+ >;
134
+
88
135
  export type Three = {
89
136
  facilityId: number;
90
137
  lines?: Array<CreateInvoiceRequestBodyLines> | undefined;
91
138
  credentialPricingIds?: Array<number> | null | undefined;
139
+ /**
140
+ * Set to `quote` to create a non-chargeable quote, used to preview an invoice's calculated totals before committing to it. Convert the quote into the real invoice with `POST /invoices/{id}/convert`. Omit this field to create a chargeable invoice directly.
141
+ */
142
+ invoiceType?: CreateInvoiceRequestBodyInvoiceType | undefined;
92
143
  };
93
144
 
94
145
  export const RequestBodyPaymentHandler = {
@@ -111,10 +162,25 @@ export type RequestBodyLines = {
111
162
  paymentHandlerData?: string | undefined;
112
163
  };
113
164
 
165
+ /**
166
+ * Set to `quote` to create a non-chargeable quote, used to preview an invoice's calculated totals before committing to it. Convert the quote into the real invoice with `POST /invoices/{id}/convert`. Omit this field to create a chargeable invoice directly.
167
+ */
168
+ export const RequestBodyInvoiceType = {
169
+ Quote: "quote",
170
+ } as const;
171
+ /**
172
+ * Set to `quote` to create a non-chargeable quote, used to preview an invoice's calculated totals before committing to it. Convert the quote into the real invoice with `POST /invoices/{id}/convert`. Omit this field to create a chargeable invoice directly.
173
+ */
174
+ export type RequestBodyInvoiceType = ClosedEnum<typeof RequestBodyInvoiceType>;
175
+
114
176
  export type CreateInvoiceRequestBody2 = {
115
177
  companyId: number;
116
178
  lines?: Array<RequestBodyLines> | undefined;
117
179
  credentialPricingIds?: Array<number> | null | undefined;
180
+ /**
181
+ * Set to `quote` to create a non-chargeable quote, used to preview an invoice's calculated totals before committing to it. Convert the quote into the real invoice with `POST /invoices/{id}/convert`. Omit this field to create a chargeable invoice directly.
182
+ */
183
+ invoiceType?: RequestBodyInvoiceType | undefined;
118
184
  };
119
185
 
120
186
  export const PaymentHandler = {
@@ -135,10 +201,25 @@ export type Lines = {
135
201
  paymentHandlerData?: string | undefined;
136
202
  };
137
203
 
204
+ /**
205
+ * Set to `quote` to create a non-chargeable quote, used to preview an invoice's calculated totals before committing to it. Convert the quote into the real invoice with `POST /invoices/{id}/convert`. Omit this field to create a chargeable invoice directly.
206
+ */
207
+ export const InvoiceType = {
208
+ Quote: "quote",
209
+ } as const;
210
+ /**
211
+ * Set to `quote` to create a non-chargeable quote, used to preview an invoice's calculated totals before committing to it. Convert the quote into the real invoice with `POST /invoices/{id}/convert`. Omit this field to create a chargeable invoice directly.
212
+ */
213
+ export type InvoiceType = ClosedEnum<typeof InvoiceType>;
214
+
138
215
  export type RequestBody1 = {
139
216
  vendorId: number;
140
217
  lines?: Array<Lines> | undefined;
141
218
  credentialPricingIds?: Array<number> | null | undefined;
219
+ /**
220
+ * Set to `quote` to create a non-chargeable quote, used to preview an invoice's calculated totals before committing to it. Convert the quote into the real invoice with `POST /invoices/{id}/convert`. Omit this field to create a chargeable invoice directly.
221
+ */
222
+ invoiceType?: InvoiceType | undefined;
142
223
  };
143
224
 
144
225
  export type CreateInvoiceRequestBody =
@@ -218,6 +299,11 @@ export function createInvoiceRequestBodyInvoicesRequestLinesToJSON(
218
299
  );
219
300
  }
220
301
 
302
+ /** @internal */
303
+ export const CreateInvoiceRequestBodyInvoicesRequestInvoiceType$outboundSchema:
304
+ z.ZodNativeEnum<typeof CreateInvoiceRequestBodyInvoicesRequestInvoiceType> = z
305
+ .nativeEnum(CreateInvoiceRequestBodyInvoicesRequestInvoiceType);
306
+
221
307
  /** @internal */
222
308
  export type Five$Outbound = {
223
309
  vendor_credential_id: number;
@@ -225,6 +311,7 @@ export type Five$Outbound = {
225
311
  | Array<CreateInvoiceRequestBodyInvoicesRequestLines$Outbound>
226
312
  | undefined;
227
313
  credential_pricing_ids?: Array<number> | null | undefined;
314
+ invoice_type?: string | undefined;
228
315
  };
229
316
 
230
317
  /** @internal */
@@ -235,10 +322,14 @@ export const Five$outboundSchema: z.ZodType<Five$Outbound, z.ZodTypeDef, Five> =
235
322
  z.lazy(() => CreateInvoiceRequestBodyInvoicesRequestLines$outboundSchema),
236
323
  ).optional(),
237
324
  credentialPricingIds: z.nullable(z.array(z.number().int())).optional(),
325
+ invoiceType:
326
+ CreateInvoiceRequestBodyInvoicesRequestInvoiceType$outboundSchema
327
+ .optional(),
238
328
  }).transform((v) => {
239
329
  return remap$(v, {
240
330
  vendorCredentialId: "vendor_credential_id",
241
331
  credentialPricingIds: "credential_pricing_ids",
332
+ invoiceType: "invoice_type",
242
333
  });
243
334
  });
244
335
 
@@ -304,11 +395,17 @@ export function createInvoiceRequestBodyInvoicesLinesToJSON(
304
395
  );
305
396
  }
306
397
 
398
+ /** @internal */
399
+ export const CreateInvoiceRequestBodyInvoicesInvoiceType$outboundSchema:
400
+ z.ZodNativeEnum<typeof CreateInvoiceRequestBodyInvoicesInvoiceType> = z
401
+ .nativeEnum(CreateInvoiceRequestBodyInvoicesInvoiceType);
402
+
307
403
  /** @internal */
308
404
  export type Four$Outbound = {
309
405
  system_id: number;
310
406
  lines?: Array<CreateInvoiceRequestBodyInvoicesLines$Outbound> | undefined;
311
407
  credential_pricing_ids?: Array<number> | null | undefined;
408
+ invoice_type?: string | undefined;
312
409
  };
313
410
 
314
411
  /** @internal */
@@ -319,10 +416,13 @@ export const Four$outboundSchema: z.ZodType<Four$Outbound, z.ZodTypeDef, Four> =
319
416
  z.lazy(() => CreateInvoiceRequestBodyInvoicesLines$outboundSchema),
320
417
  ).optional(),
321
418
  credentialPricingIds: z.nullable(z.array(z.number().int())).optional(),
419
+ invoiceType: CreateInvoiceRequestBodyInvoicesInvoiceType$outboundSchema
420
+ .optional(),
322
421
  }).transform((v) => {
323
422
  return remap$(v, {
324
423
  systemId: "system_id",
325
424
  credentialPricingIds: "credential_pricing_ids",
425
+ invoiceType: "invoice_type",
326
426
  });
327
427
  });
328
428
 
@@ -389,11 +489,18 @@ export function createInvoiceRequestBodyLinesToJSON(
389
489
  );
390
490
  }
391
491
 
492
+ /** @internal */
493
+ export const CreateInvoiceRequestBodyInvoiceType$outboundSchema:
494
+ z.ZodNativeEnum<typeof CreateInvoiceRequestBodyInvoiceType> = z.nativeEnum(
495
+ CreateInvoiceRequestBodyInvoiceType,
496
+ );
497
+
392
498
  /** @internal */
393
499
  export type Three$Outbound = {
394
500
  facility_id: number;
395
501
  lines?: Array<CreateInvoiceRequestBodyLines$Outbound> | undefined;
396
502
  credential_pricing_ids?: Array<number> | null | undefined;
503
+ invoice_type?: string | undefined;
397
504
  };
398
505
 
399
506
  /** @internal */
@@ -406,10 +513,12 @@ export const Three$outboundSchema: z.ZodType<
406
513
  lines: z.array(z.lazy(() => CreateInvoiceRequestBodyLines$outboundSchema))
407
514
  .optional(),
408
515
  credentialPricingIds: z.nullable(z.array(z.number().int())).optional(),
516
+ invoiceType: CreateInvoiceRequestBodyInvoiceType$outboundSchema.optional(),
409
517
  }).transform((v) => {
410
518
  return remap$(v, {
411
519
  facilityId: "facility_id",
412
520
  credentialPricingIds: "credential_pricing_ids",
521
+ invoiceType: "invoice_type",
413
522
  });
414
523
  });
415
524
 
@@ -472,11 +581,17 @@ export function requestBodyLinesToJSON(
472
581
  );
473
582
  }
474
583
 
584
+ /** @internal */
585
+ export const RequestBodyInvoiceType$outboundSchema: z.ZodNativeEnum<
586
+ typeof RequestBodyInvoiceType
587
+ > = z.nativeEnum(RequestBodyInvoiceType);
588
+
475
589
  /** @internal */
476
590
  export type CreateInvoiceRequestBody2$Outbound = {
477
591
  company_id: number;
478
592
  lines?: Array<RequestBodyLines$Outbound> | undefined;
479
593
  credential_pricing_ids?: Array<number> | null | undefined;
594
+ invoice_type?: string | undefined;
480
595
  };
481
596
 
482
597
  /** @internal */
@@ -488,10 +603,12 @@ export const CreateInvoiceRequestBody2$outboundSchema: z.ZodType<
488
603
  companyId: z.number().int(),
489
604
  lines: z.array(z.lazy(() => RequestBodyLines$outboundSchema)).optional(),
490
605
  credentialPricingIds: z.nullable(z.array(z.number().int())).optional(),
606
+ invoiceType: RequestBodyInvoiceType$outboundSchema.optional(),
491
607
  }).transform((v) => {
492
608
  return remap$(v, {
493
609
  companyId: "company_id",
494
610
  credentialPricingIds: "credential_pricing_ids",
611
+ invoiceType: "invoice_type",
495
612
  });
496
613
  });
497
614
 
@@ -554,11 +671,16 @@ export function linesToJSON(lines: Lines): string {
554
671
  return JSON.stringify(Lines$outboundSchema.parse(lines));
555
672
  }
556
673
 
674
+ /** @internal */
675
+ export const InvoiceType$outboundSchema: z.ZodNativeEnum<typeof InvoiceType> = z
676
+ .nativeEnum(InvoiceType);
677
+
557
678
  /** @internal */
558
679
  export type RequestBody1$Outbound = {
559
680
  vendor_id: number;
560
681
  lines?: Array<Lines$Outbound> | undefined;
561
682
  credential_pricing_ids?: Array<number> | null | undefined;
683
+ invoice_type?: string | undefined;
562
684
  };
563
685
 
564
686
  /** @internal */
@@ -570,10 +692,12 @@ export const RequestBody1$outboundSchema: z.ZodType<
570
692
  vendorId: z.number().int(),
571
693
  lines: z.array(z.lazy(() => Lines$outboundSchema)).optional(),
572
694
  credentialPricingIds: z.nullable(z.array(z.number().int())).optional(),
695
+ invoiceType: InvoiceType$outboundSchema.optional(),
573
696
  }).transform((v) => {
574
697
  return remap$(v, {
575
698
  vendorId: "vendor_id",
576
699
  credentialPricingIds: "credential_pricing_ids",
700
+ invoiceType: "invoice_type",
577
701
  });
578
702
  });
579
703
 
@@ -15,6 +15,7 @@ export * from "./cancelhandoff.js";
15
15
  export * from "./changepassword.js";
16
16
  export * from "./changesubscription.js";
17
17
  export * from "./checkdownloadcode.js";
18
+ export * from "./convertquote.js";
18
19
  export * from "./createcompanytargetfacility.js";
19
20
  export * from "./createevent.js";
20
21
  export * from "./createinvoice.js";
@@ -33,6 +33,7 @@ export * from "./fhirConfigsDeleteFhirConfigById.js";
33
33
  export * from "./fhirConfigsGetFhirConfig.js";
34
34
  export * from "./fhirConfigsListOfFhirConfigurations.js";
35
35
  export * from "./fhirConfigsUpdateFhirConfigById.js";
36
+ export * from "./invoicesConvertQuote.js";
36
37
  export * from "./invoicesCreateInvoice.js";
37
38
  export * from "./invoicesDownloadInvoicesExport.js";
38
39
  export * from "./invoicesGetInvoice.js";