@greensecurity/javascript-sdk 0.48.0-beta.6 → 0.48.0-beta.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.
- package/dist/commonjs/__tests__/vendors.test.js +1 -1
- package/dist/commonjs/__tests__/webhooks.test.js +6 -5
- package/dist/commonjs/__tests__/webhooks.test.js.map +1 -1
- package/dist/commonjs/__tests__/zones.test.js +16 -10
- package/dist/commonjs/__tests__/zones.test.js.map +1 -1
- package/dist/commonjs/funcs/invoicesConvertQuote.d.ts +4 -1
- package/dist/commonjs/funcs/invoicesConvertQuote.d.ts.map +1 -1
- package/dist/commonjs/funcs/invoicesConvertQuote.js +6 -2
- package/dist/commonjs/funcs/invoicesConvertQuote.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/models/components/invoice.d.ts +5 -0
- package/dist/commonjs/models/components/invoice.d.ts.map +1 -1
- package/dist/commonjs/models/components/invoice.js +4 -0
- package/dist/commonjs/models/components/invoice.js.map +1 -1
- package/dist/commonjs/models/operations/convertquote.d.ts +21 -0
- package/dist/commonjs/models/operations/convertquote.d.ts.map +1 -1
- package/dist/commonjs/models/operations/convertquote.js +18 -1
- package/dist/commonjs/models/operations/convertquote.js.map +1 -1
- package/dist/commonjs/models/operations/createinvoice.d.ts +25 -0
- package/dist/commonjs/models/operations/createinvoice.d.ts.map +1 -1
- package/dist/commonjs/models/operations/createinvoice.js +10 -0
- package/dist/commonjs/models/operations/createinvoice.js.map +1 -1
- package/dist/commonjs/react-query/invoicesConvertQuote.d.ts +4 -1
- package/dist/commonjs/react-query/invoicesConvertQuote.d.ts.map +1 -1
- package/dist/commonjs/react-query/invoicesConvertQuote.js +4 -1
- package/dist/commonjs/react-query/invoicesConvertQuote.js.map +1 -1
- package/dist/commonjs/sdk/invoices.d.ts +4 -1
- package/dist/commonjs/sdk/invoices.d.ts.map +1 -1
- package/dist/commonjs/sdk/invoices.js +4 -1
- package/dist/commonjs/sdk/invoices.js.map +1 -1
- package/dist/esm/__tests__/vendors.test.js +1 -1
- package/dist/esm/__tests__/webhooks.test.js +6 -5
- package/dist/esm/__tests__/webhooks.test.js.map +1 -1
- package/dist/esm/__tests__/zones.test.js +16 -10
- package/dist/esm/__tests__/zones.test.js.map +1 -1
- package/dist/esm/funcs/invoicesConvertQuote.d.ts +4 -1
- package/dist/esm/funcs/invoicesConvertQuote.d.ts.map +1 -1
- package/dist/esm/funcs/invoicesConvertQuote.js +7 -3
- package/dist/esm/funcs/invoicesConvertQuote.js.map +1 -1
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/models/components/invoice.d.ts +5 -0
- package/dist/esm/models/components/invoice.d.ts.map +1 -1
- package/dist/esm/models/components/invoice.js +4 -0
- package/dist/esm/models/components/invoice.js.map +1 -1
- package/dist/esm/models/operations/convertquote.d.ts +21 -0
- package/dist/esm/models/operations/convertquote.d.ts.map +1 -1
- package/dist/esm/models/operations/convertquote.js +16 -0
- package/dist/esm/models/operations/convertquote.js.map +1 -1
- package/dist/esm/models/operations/createinvoice.d.ts +25 -0
- package/dist/esm/models/operations/createinvoice.d.ts.map +1 -1
- package/dist/esm/models/operations/createinvoice.js +10 -0
- package/dist/esm/models/operations/createinvoice.js.map +1 -1
- package/dist/esm/react-query/invoicesConvertQuote.d.ts +4 -1
- package/dist/esm/react-query/invoicesConvertQuote.d.ts.map +1 -1
- package/dist/esm/react-query/invoicesConvertQuote.js +4 -1
- package/dist/esm/react-query/invoicesConvertQuote.js.map +1 -1
- package/dist/esm/sdk/invoices.d.ts +4 -1
- package/dist/esm/sdk/invoices.d.ts.map +1 -1
- package/dist/esm/sdk/invoices.js +4 -1
- package/dist/esm/sdk/invoices.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/__tests__/vendors.test.ts +1 -1
- package/src/__tests__/webhooks.test.ts +6 -5
- package/src/__tests__/zones.test.ts +16 -10
- package/src/funcs/invoicesConvertQuote.ts +7 -3
- package/src/lib/config.ts +2 -2
- package/src/models/components/invoice.ts +9 -0
- package/src/models/operations/convertquote.ts +46 -0
- package/src/models/operations/createinvoice.ts +35 -0
- package/src/react-query/invoicesConvertQuote.ts +4 -1
- package/src/sdk/invoices.ts +4 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { GreenSecurityCore } from "../core.js";
|
|
6
|
-
import { encodeSimple } from "../lib/encodings.js";
|
|
6
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
7
7
|
import { matchStatusCode } from "../lib/http.js";
|
|
8
8
|
import * as M from "../lib/matchers.js";
|
|
9
9
|
import { compactMap } from "../lib/primitives.js";
|
|
@@ -43,7 +43,10 @@ import { Result } from "../types/fp.js";
|
|
|
43
43
|
* invoices; a caller allowed to create the invoice but not to update the
|
|
44
44
|
* linked `VendorCredential` responds `401`.
|
|
45
45
|
*
|
|
46
|
-
*
|
|
46
|
+
* Optionally takes `send_to_company_manager`, for a quote linked to a
|
|
47
|
+
* `VendorCredential`: send `true` when the vendor is sending the
|
|
48
|
+
* converted invoice to their company managers to pay instead of paying
|
|
49
|
+
* it themselves. It follows the same rules as on `POST /invoices`.
|
|
47
50
|
*
|
|
48
51
|
* **Permissions.** Requires a valid token. This endpoint is not gated on a named permission—the caller's role and their relationship to the record decide what it returns.
|
|
49
52
|
*
|
|
@@ -104,7 +107,7 @@ async function $do(
|
|
|
104
107
|
return [parsed, { status: "invalid" }];
|
|
105
108
|
}
|
|
106
109
|
const payload = parsed.value;
|
|
107
|
-
const body =
|
|
110
|
+
const body = encodeJSON("body", payload.RequestBody, { explode: true });
|
|
108
111
|
|
|
109
112
|
const pathParams = {
|
|
110
113
|
id: encodeSimple("id", payload.id, {
|
|
@@ -115,6 +118,7 @@ async function $do(
|
|
|
115
118
|
const path = pathToFunc("/invoices/{id}/convert")(pathParams);
|
|
116
119
|
|
|
117
120
|
const headers = new Headers(compactMap({
|
|
121
|
+
"Content-Type": "application/json",
|
|
118
122
|
Accept: "application/json",
|
|
119
123
|
}));
|
|
120
124
|
|
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.47.0",
|
|
83
|
-
sdkVersion: "0.48.0-beta.
|
|
83
|
+
sdkVersion: "0.48.0-beta.7",
|
|
84
84
|
genVersion: "2.950.2",
|
|
85
85
|
userAgent:
|
|
86
|
-
"speakeasy-sdk/typescript 0.48.0-beta.
|
|
86
|
+
"speakeasy-sdk/typescript 0.48.0-beta.7 2.950.2 0.47.0 @greensecurity/javascript-sdk",
|
|
87
87
|
} as const;
|
|
@@ -141,6 +141,10 @@ export type Invoice = {
|
|
|
141
141
|
* When the invoice was created.
|
|
142
142
|
*/
|
|
143
143
|
dateCreated?: string | null | undefined;
|
|
144
|
+
/**
|
|
145
|
+
* When the vendor sent this invoice to their company managers to pay instead of paying it themselves (`send_to_company_manager` on `POST /invoices` or `POST /invoices/{id}/convert`). `null` if it was never sent, or if the vendor took it back or settled it themselves. It is kept on an invoice the managers paid, and on one that was later voided.
|
|
146
|
+
*/
|
|
147
|
+
dateSentToCompanyManager?: string | null | undefined;
|
|
144
148
|
/**
|
|
145
149
|
* The date the invoice payment is due. `null` if no due date is set.
|
|
146
150
|
*/
|
|
@@ -393,6 +397,7 @@ export const Invoice$inboundSchema: z.ZodType<Invoice, z.ZodTypeDef, unknown> =
|
|
|
393
397
|
date_processed: z.nullable(types.string()).optional(),
|
|
394
398
|
date_paid: z.nullable(types.string()).optional(),
|
|
395
399
|
date_created: z.nullable(types.string()).optional(),
|
|
400
|
+
date_sent_to_company_manager: z.nullable(types.string()).optional(),
|
|
396
401
|
date_due: z.nullable(types.string()).optional(),
|
|
397
402
|
amount: z.nullable(types.number()).optional(),
|
|
398
403
|
status: z.nullable(types.string()).optional(),
|
|
@@ -421,6 +426,7 @@ export const Invoice$inboundSchema: z.ZodType<Invoice, z.ZodTypeDef, unknown> =
|
|
|
421
426
|
"date_processed": "dateProcessed",
|
|
422
427
|
"date_paid": "datePaid",
|
|
423
428
|
"date_created": "dateCreated",
|
|
429
|
+
"date_sent_to_company_manager": "dateSentToCompanyManager",
|
|
424
430
|
"date_due": "dateDue",
|
|
425
431
|
"financial_status": "financialStatus",
|
|
426
432
|
"amount_not_paid": "amountNotPaid",
|
|
@@ -439,6 +445,7 @@ export type Invoice$Outbound = {
|
|
|
439
445
|
date_processed?: string | null | undefined;
|
|
440
446
|
date_paid?: string | null | undefined;
|
|
441
447
|
date_created?: string | null | undefined;
|
|
448
|
+
date_sent_to_company_manager?: string | null | undefined;
|
|
442
449
|
date_due?: string | null | undefined;
|
|
443
450
|
amount?: number | null | undefined;
|
|
444
451
|
status?: string | null | undefined;
|
|
@@ -471,6 +478,7 @@ export const Invoice$outboundSchema: z.ZodType<
|
|
|
471
478
|
dateProcessed: z.nullable(z.string()).optional(),
|
|
472
479
|
datePaid: z.nullable(z.string()).optional(),
|
|
473
480
|
dateCreated: z.nullable(z.string()).optional(),
|
|
481
|
+
dateSentToCompanyManager: z.nullable(z.string()).optional(),
|
|
474
482
|
dateDue: z.nullable(z.string()).optional(),
|
|
475
483
|
amount: z.nullable(z.number().int()).optional(),
|
|
476
484
|
status: z.nullable(z.string()).optional(),
|
|
@@ -498,6 +506,7 @@ export const Invoice$outboundSchema: z.ZodType<
|
|
|
498
506
|
dateProcessed: "date_processed",
|
|
499
507
|
datePaid: "date_paid",
|
|
500
508
|
dateCreated: "date_created",
|
|
509
|
+
dateSentToCompanyManager: "date_sent_to_company_manager",
|
|
501
510
|
dateDue: "date_due",
|
|
502
511
|
financialStatus: "financial_status",
|
|
503
512
|
amountNotPaid: "amount_not_paid",
|
|
@@ -9,11 +9,25 @@ import { Result as SafeParseResult } from "../../types/fp.js";
|
|
|
9
9
|
import * as types from "../../types/primitives.js";
|
|
10
10
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Whether the vendor is sending the converted invoice to their company managers.
|
|
14
|
+
*/
|
|
15
|
+
export type ConvertQuoteRequestBody = {
|
|
16
|
+
/**
|
|
17
|
+
* Set to `true` when the vendor is sending the converted invoice to their company managers to pay instead of paying it themselves, and `false` to take it back. Recorded on the invoice as `date_sent_to_company_manager`; the managers are asked to pay once the credential is submitted. Omit the field to leave the invoice as it is. Ignored when no `VendorCredential` is linked to the quote, for an invoice with nothing left to pay, and when the caller is not the vendor. A vendor whose company has no active company manager who sends `true` is refused with `400` and the quote is not converted.
|
|
18
|
+
*/
|
|
19
|
+
sendToCompanyManager?: boolean | undefined;
|
|
20
|
+
};
|
|
21
|
+
|
|
12
22
|
export type ConvertQuoteRequest = {
|
|
13
23
|
/**
|
|
14
24
|
* The identifier of the object.
|
|
15
25
|
*/
|
|
16
26
|
id: number;
|
|
27
|
+
/**
|
|
28
|
+
* Whether the vendor is sending the converted invoice to their company managers.
|
|
29
|
+
*/
|
|
30
|
+
requestBody?: ConvertQuoteRequestBody | undefined;
|
|
17
31
|
};
|
|
18
32
|
|
|
19
33
|
/**
|
|
@@ -43,9 +57,36 @@ export type ConvertQuoteConvertQuoteOk = {
|
|
|
43
57
|
total?: number | null | undefined;
|
|
44
58
|
};
|
|
45
59
|
|
|
60
|
+
/** @internal */
|
|
61
|
+
export type ConvertQuoteRequestBody$Outbound = {
|
|
62
|
+
send_to_company_manager?: boolean | undefined;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
/** @internal */
|
|
66
|
+
export const ConvertQuoteRequestBody$outboundSchema: z.ZodType<
|
|
67
|
+
ConvertQuoteRequestBody$Outbound,
|
|
68
|
+
z.ZodTypeDef,
|
|
69
|
+
ConvertQuoteRequestBody
|
|
70
|
+
> = z.object({
|
|
71
|
+
sendToCompanyManager: z.boolean().optional(),
|
|
72
|
+
}).transform((v) => {
|
|
73
|
+
return remap$(v, {
|
|
74
|
+
sendToCompanyManager: "send_to_company_manager",
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
export function convertQuoteRequestBodyToJSON(
|
|
79
|
+
convertQuoteRequestBody: ConvertQuoteRequestBody,
|
|
80
|
+
): string {
|
|
81
|
+
return JSON.stringify(
|
|
82
|
+
ConvertQuoteRequestBody$outboundSchema.parse(convertQuoteRequestBody),
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
46
86
|
/** @internal */
|
|
47
87
|
export type ConvertQuoteRequest$Outbound = {
|
|
48
88
|
id: number;
|
|
89
|
+
RequestBody?: ConvertQuoteRequestBody$Outbound | undefined;
|
|
49
90
|
};
|
|
50
91
|
|
|
51
92
|
/** @internal */
|
|
@@ -55,6 +96,11 @@ export const ConvertQuoteRequest$outboundSchema: z.ZodType<
|
|
|
55
96
|
ConvertQuoteRequest
|
|
56
97
|
> = z.object({
|
|
57
98
|
id: z.number().int(),
|
|
99
|
+
requestBody: z.lazy(() => ConvertQuoteRequestBody$outboundSchema).optional(),
|
|
100
|
+
}).transform((v) => {
|
|
101
|
+
return remap$(v, {
|
|
102
|
+
requestBody: "RequestBody",
|
|
103
|
+
});
|
|
58
104
|
});
|
|
59
105
|
|
|
60
106
|
export function convertQuoteRequestToJSON(
|
|
@@ -62,6 +62,10 @@ export type Five = {
|
|
|
62
62
|
* Set to `true` when the payer intends to settle this order from their credit balance before their payment method is charged. This affects only how the convenience fee is calculated: the fee pays for card processing, so it is assessed on the amount the card is left to cover once credits have been applied, and an order a balance covers in full carries none. No credits are debited here, and the balance is read from the payer's own ledger rather than taken from this request. Settle the credits with `POST /invoices/{id}/payment` and `use_credits: true`.
|
|
63
63
|
*/
|
|
64
64
|
useCredits?: boolean | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* For a `vendor_credential_id` invoice, set to `true` when the vendor is sending the invoice to their company managers to pay instead of paying it themselves. The server records it on the invoice as `date_sent_to_company_manager`, and asks the managers to pay once the credential is submitted. Send it without `credential_pricing_ids` to send an invoice the credential already has. Set to `false` to take the invoice back. Omit the field to leave the invoice as it is. Ignored for a quote, for an invoice with nothing left to pay, and when the caller is not the vendor. A vendor whose company has no active company manager who sends `true` is refused with `400` before anything is created.
|
|
67
|
+
*/
|
|
68
|
+
sendToCompanyManager?: boolean | undefined;
|
|
65
69
|
};
|
|
66
70
|
|
|
67
71
|
export const CreateInvoiceRequestBodyInvoicesPaymentHandler = {
|
|
@@ -113,6 +117,10 @@ export type Four = {
|
|
|
113
117
|
* Set to `true` when the payer intends to settle this order from their credit balance before their payment method is charged. This affects only how the convenience fee is calculated: the fee pays for card processing, so it is assessed on the amount the card is left to cover once credits have been applied, and an order a balance covers in full carries none. No credits are debited here, and the balance is read from the payer's own ledger rather than taken from this request. Settle the credits with `POST /invoices/{id}/payment` and `use_credits: true`.
|
|
114
118
|
*/
|
|
115
119
|
useCredits?: boolean | undefined;
|
|
120
|
+
/**
|
|
121
|
+
* For a `vendor_credential_id` invoice, set to `true` when the vendor is sending the invoice to their company managers to pay instead of paying it themselves. The server records it on the invoice as `date_sent_to_company_manager`, and asks the managers to pay once the credential is submitted. Send it without `credential_pricing_ids` to send an invoice the credential already has. Set to `false` to take the invoice back. Omit the field to leave the invoice as it is. Ignored for a quote, for an invoice with nothing left to pay, and when the caller is not the vendor. A vendor whose company has no active company manager who sends `true` is refused with `400` before anything is created.
|
|
122
|
+
*/
|
|
123
|
+
sendToCompanyManager?: boolean | undefined;
|
|
116
124
|
};
|
|
117
125
|
|
|
118
126
|
export const CreateInvoiceRequestBodyPaymentHandler = {
|
|
@@ -164,6 +172,10 @@ export type Three = {
|
|
|
164
172
|
* Set to `true` when the payer intends to settle this order from their credit balance before their payment method is charged. This affects only how the convenience fee is calculated: the fee pays for card processing, so it is assessed on the amount the card is left to cover once credits have been applied, and an order a balance covers in full carries none. No credits are debited here, and the balance is read from the payer's own ledger rather than taken from this request. Settle the credits with `POST /invoices/{id}/payment` and `use_credits: true`.
|
|
165
173
|
*/
|
|
166
174
|
useCredits?: boolean | undefined;
|
|
175
|
+
/**
|
|
176
|
+
* For a `vendor_credential_id` invoice, set to `true` when the vendor is sending the invoice to their company managers to pay instead of paying it themselves. The server records it on the invoice as `date_sent_to_company_manager`, and asks the managers to pay once the credential is submitted. Send it without `credential_pricing_ids` to send an invoice the credential already has. Set to `false` to take the invoice back. Omit the field to leave the invoice as it is. Ignored for a quote, for an invoice with nothing left to pay, and when the caller is not the vendor. A vendor whose company has no active company manager who sends `true` is refused with `400` before anything is created.
|
|
177
|
+
*/
|
|
178
|
+
sendToCompanyManager?: boolean | undefined;
|
|
167
179
|
};
|
|
168
180
|
|
|
169
181
|
export const RequestBodyPaymentHandler = {
|
|
@@ -213,6 +225,10 @@ export type CreateInvoiceRequestBody2 = {
|
|
|
213
225
|
* Set to `true` when the payer intends to settle this order from their credit balance before their payment method is charged. This affects only how the convenience fee is calculated: the fee pays for card processing, so it is assessed on the amount the card is left to cover once credits have been applied, and an order a balance covers in full carries none. No credits are debited here, and the balance is read from the payer's own ledger rather than taken from this request. Settle the credits with `POST /invoices/{id}/payment` and `use_credits: true`.
|
|
214
226
|
*/
|
|
215
227
|
useCredits?: boolean | undefined;
|
|
228
|
+
/**
|
|
229
|
+
* For a `vendor_credential_id` invoice, set to `true` when the vendor is sending the invoice to their company managers to pay instead of paying it themselves. The server records it on the invoice as `date_sent_to_company_manager`, and asks the managers to pay once the credential is submitted. Send it without `credential_pricing_ids` to send an invoice the credential already has. Set to `false` to take the invoice back. Omit the field to leave the invoice as it is. Ignored for a quote, for an invoice with nothing left to pay, and when the caller is not the vendor. A vendor whose company has no active company manager who sends `true` is refused with `400` before anything is created.
|
|
230
|
+
*/
|
|
231
|
+
sendToCompanyManager?: boolean | undefined;
|
|
216
232
|
};
|
|
217
233
|
|
|
218
234
|
export const PaymentHandler = {
|
|
@@ -260,6 +276,10 @@ export type RequestBody1 = {
|
|
|
260
276
|
* Set to `true` when the payer intends to settle this order from their credit balance before their payment method is charged. This affects only how the convenience fee is calculated: the fee pays for card processing, so it is assessed on the amount the card is left to cover once credits have been applied, and an order a balance covers in full carries none. No credits are debited here, and the balance is read from the payer's own ledger rather than taken from this request. Settle the credits with `POST /invoices/{id}/payment` and `use_credits: true`.
|
|
261
277
|
*/
|
|
262
278
|
useCredits?: boolean | undefined;
|
|
279
|
+
/**
|
|
280
|
+
* For a `vendor_credential_id` invoice, set to `true` when the vendor is sending the invoice to their company managers to pay instead of paying it themselves. The server records it on the invoice as `date_sent_to_company_manager`, and asks the managers to pay once the credential is submitted. Send it without `credential_pricing_ids` to send an invoice the credential already has. Set to `false` to take the invoice back. Omit the field to leave the invoice as it is. Ignored for a quote, for an invoice with nothing left to pay, and when the caller is not the vendor. A vendor whose company has no active company manager who sends `true` is refused with `400` before anything is created.
|
|
281
|
+
*/
|
|
282
|
+
sendToCompanyManager?: boolean | undefined;
|
|
263
283
|
};
|
|
264
284
|
|
|
265
285
|
/**
|
|
@@ -357,6 +377,7 @@ export type Five$Outbound = {
|
|
|
357
377
|
invoice_type?: string | undefined;
|
|
358
378
|
promo?: string | undefined;
|
|
359
379
|
use_credits: boolean;
|
|
380
|
+
send_to_company_manager?: boolean | undefined;
|
|
360
381
|
};
|
|
361
382
|
|
|
362
383
|
/** @internal */
|
|
@@ -372,12 +393,14 @@ export const Five$outboundSchema: z.ZodType<Five$Outbound, z.ZodTypeDef, Five> =
|
|
|
372
393
|
.optional(),
|
|
373
394
|
promo: z.string().optional(),
|
|
374
395
|
useCredits: z.boolean().default(false),
|
|
396
|
+
sendToCompanyManager: z.boolean().optional(),
|
|
375
397
|
}).transform((v) => {
|
|
376
398
|
return remap$(v, {
|
|
377
399
|
vendorCredentialId: "vendor_credential_id",
|
|
378
400
|
credentialPricingIds: "credential_pricing_ids",
|
|
379
401
|
invoiceType: "invoice_type",
|
|
380
402
|
useCredits: "use_credits",
|
|
403
|
+
sendToCompanyManager: "send_to_company_manager",
|
|
381
404
|
});
|
|
382
405
|
});
|
|
383
406
|
|
|
@@ -456,6 +479,7 @@ export type Four$Outbound = {
|
|
|
456
479
|
invoice_type?: string | undefined;
|
|
457
480
|
promo?: string | undefined;
|
|
458
481
|
use_credits: boolean;
|
|
482
|
+
send_to_company_manager?: boolean | undefined;
|
|
459
483
|
};
|
|
460
484
|
|
|
461
485
|
/** @internal */
|
|
@@ -470,12 +494,14 @@ export const Four$outboundSchema: z.ZodType<Four$Outbound, z.ZodTypeDef, Four> =
|
|
|
470
494
|
.optional(),
|
|
471
495
|
promo: z.string().optional(),
|
|
472
496
|
useCredits: z.boolean().default(false),
|
|
497
|
+
sendToCompanyManager: z.boolean().optional(),
|
|
473
498
|
}).transform((v) => {
|
|
474
499
|
return remap$(v, {
|
|
475
500
|
systemId: "system_id",
|
|
476
501
|
credentialPricingIds: "credential_pricing_ids",
|
|
477
502
|
invoiceType: "invoice_type",
|
|
478
503
|
useCredits: "use_credits",
|
|
504
|
+
sendToCompanyManager: "send_to_company_manager",
|
|
479
505
|
});
|
|
480
506
|
});
|
|
481
507
|
|
|
@@ -556,6 +582,7 @@ export type Three$Outbound = {
|
|
|
556
582
|
invoice_type?: string | undefined;
|
|
557
583
|
promo?: string | undefined;
|
|
558
584
|
use_credits: boolean;
|
|
585
|
+
send_to_company_manager?: boolean | undefined;
|
|
559
586
|
};
|
|
560
587
|
|
|
561
588
|
/** @internal */
|
|
@@ -571,12 +598,14 @@ export const Three$outboundSchema: z.ZodType<
|
|
|
571
598
|
invoiceType: CreateInvoiceRequestBodyInvoiceType$outboundSchema.optional(),
|
|
572
599
|
promo: z.string().optional(),
|
|
573
600
|
useCredits: z.boolean().default(false),
|
|
601
|
+
sendToCompanyManager: z.boolean().optional(),
|
|
574
602
|
}).transform((v) => {
|
|
575
603
|
return remap$(v, {
|
|
576
604
|
facilityId: "facility_id",
|
|
577
605
|
credentialPricingIds: "credential_pricing_ids",
|
|
578
606
|
invoiceType: "invoice_type",
|
|
579
607
|
useCredits: "use_credits",
|
|
608
|
+
sendToCompanyManager: "send_to_company_manager",
|
|
580
609
|
});
|
|
581
610
|
});
|
|
582
611
|
|
|
@@ -652,6 +681,7 @@ export type CreateInvoiceRequestBody2$Outbound = {
|
|
|
652
681
|
invoice_type?: string | undefined;
|
|
653
682
|
promo?: string | undefined;
|
|
654
683
|
use_credits: boolean;
|
|
684
|
+
send_to_company_manager?: boolean | undefined;
|
|
655
685
|
};
|
|
656
686
|
|
|
657
687
|
/** @internal */
|
|
@@ -666,12 +696,14 @@ export const CreateInvoiceRequestBody2$outboundSchema: z.ZodType<
|
|
|
666
696
|
invoiceType: RequestBodyInvoiceType$outboundSchema.optional(),
|
|
667
697
|
promo: z.string().optional(),
|
|
668
698
|
useCredits: z.boolean().default(false),
|
|
699
|
+
sendToCompanyManager: z.boolean().optional(),
|
|
669
700
|
}).transform((v) => {
|
|
670
701
|
return remap$(v, {
|
|
671
702
|
companyId: "company_id",
|
|
672
703
|
credentialPricingIds: "credential_pricing_ids",
|
|
673
704
|
invoiceType: "invoice_type",
|
|
674
705
|
useCredits: "use_credits",
|
|
706
|
+
sendToCompanyManager: "send_to_company_manager",
|
|
675
707
|
});
|
|
676
708
|
});
|
|
677
709
|
|
|
@@ -746,6 +778,7 @@ export type RequestBody1$Outbound = {
|
|
|
746
778
|
invoice_type?: string | undefined;
|
|
747
779
|
promo?: string | undefined;
|
|
748
780
|
use_credits: boolean;
|
|
781
|
+
send_to_company_manager?: boolean | undefined;
|
|
749
782
|
};
|
|
750
783
|
|
|
751
784
|
/** @internal */
|
|
@@ -760,12 +793,14 @@ export const RequestBody1$outboundSchema: z.ZodType<
|
|
|
760
793
|
invoiceType: InvoiceType$outboundSchema.optional(),
|
|
761
794
|
promo: z.string().optional(),
|
|
762
795
|
useCredits: z.boolean().default(false),
|
|
796
|
+
sendToCompanyManager: z.boolean().optional(),
|
|
763
797
|
}).transform((v) => {
|
|
764
798
|
return remap$(v, {
|
|
765
799
|
vendorId: "vendor_id",
|
|
766
800
|
credentialPricingIds: "credential_pricing_ids",
|
|
767
801
|
invoiceType: "invoice_type",
|
|
768
802
|
useCredits: "use_credits",
|
|
803
|
+
sendToCompanyManager: "send_to_company_manager",
|
|
769
804
|
});
|
|
770
805
|
});
|
|
771
806
|
|
|
@@ -63,7 +63,10 @@ export type InvoicesConvertQuoteMutationError =
|
|
|
63
63
|
* invoices; a caller allowed to create the invoice but not to update the
|
|
64
64
|
* linked `VendorCredential` responds `401`.
|
|
65
65
|
*
|
|
66
|
-
*
|
|
66
|
+
* Optionally takes `send_to_company_manager`, for a quote linked to a
|
|
67
|
+
* `VendorCredential`: send `true` when the vendor is sending the
|
|
68
|
+
* converted invoice to their company managers to pay instead of paying
|
|
69
|
+
* it themselves. It follows the same rules as on `POST /invoices`.
|
|
67
70
|
*
|
|
68
71
|
* **Permissions.** Requires a valid token. This endpoint is not gated on a named permission—the caller's role and their relationship to the record decide what it returns.
|
|
69
72
|
*/
|
package/src/sdk/invoices.ts
CHANGED
|
@@ -185,7 +185,10 @@ export class Invoices extends ClientSDK {
|
|
|
185
185
|
* invoices; a caller allowed to create the invoice but not to update the
|
|
186
186
|
* linked `VendorCredential` responds `401`.
|
|
187
187
|
*
|
|
188
|
-
*
|
|
188
|
+
* Optionally takes `send_to_company_manager`, for a quote linked to a
|
|
189
|
+
* `VendorCredential`: send `true` when the vendor is sending the
|
|
190
|
+
* converted invoice to their company managers to pay instead of paying
|
|
191
|
+
* it themselves. It follows the same rules as on `POST /invoices`.
|
|
189
192
|
*
|
|
190
193
|
* **Permissions.** Requires a valid token. This endpoint is not gated on a named permission—the caller's role and their relationship to the record decide what it returns.
|
|
191
194
|
*/
|