@apideck/unify 0.28.2 → 0.28.4
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/examples/README.md +5 -0
- package/examples/accountingTaxRatesList.example.ts +2 -0
- package/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +4 -4
- package/lib/config.js +4 -4
- package/models/components/billlineitem.d.ts +48 -0
- package/models/components/billlineitem.d.ts.map +1 -1
- package/models/components/billlineitem.js +36 -0
- package/models/components/billlineitem.js.map +1 -1
- package/models/components/expenselineitem.d.ts +6 -0
- package/models/components/expenselineitem.d.ts.map +1 -1
- package/models/components/expenselineitem.js +3 -0
- package/models/components/expenselineitem.js.map +1 -1
- package/models/components/expenselineiteminput.d.ts +6 -0
- package/models/components/expenselineiteminput.d.ts.map +1 -1
- package/models/components/expenselineiteminput.js +3 -0
- package/models/components/expenselineiteminput.js.map +1 -1
- package/models/components/index.d.ts +2 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +2 -0
- package/models/components/index.js.map +1 -1
- package/models/components/invoicelineitem.d.ts +20 -0
- package/models/components/invoicelineitem.d.ts.map +1 -1
- package/models/components/invoicelineitem.js +12 -0
- package/models/components/invoicelineitem.js.map +1 -1
- package/models/components/linkedpurchaseorder.d.ts +42 -0
- package/models/components/linkedpurchaseorder.d.ts.map +1 -0
- package/models/components/linkedpurchaseorder.js +74 -0
- package/models/components/linkedpurchaseorder.js.map +1 -0
- package/models/components/purchaseorder.d.ts +57 -0
- package/models/components/purchaseorder.d.ts.map +1 -1
- package/models/components/purchaseorder.js +37 -1
- package/models/components/purchaseorder.js.map +1 -1
- package/models/components/rebilling.d.ts +85 -0
- package/models/components/rebilling.d.ts.map +1 -0
- package/models/components/rebilling.js +101 -0
- package/models/components/rebilling.js.map +1 -0
- package/package.json +1 -1
- package/src/lib/config.ts +4 -4
- package/src/models/components/billlineitem.ts +100 -0
- package/src/models/components/expenselineitem.ts +13 -0
- package/src/models/components/expenselineiteminput.ts +13 -0
- package/src/models/components/index.ts +2 -0
- package/src/models/components/invoicelineitem.ts +32 -0
- package/src/models/components/linkedpurchaseorder.ts +94 -0
- package/src/models/components/purchaseorder.ts +67 -0
- package/src/models/components/rebilling.ts +135 -0
|
@@ -89,6 +89,20 @@ export const PurchaseOrderStatus = {
|
|
|
89
89
|
} as const;
|
|
90
90
|
export type PurchaseOrderStatus = ClosedEnum<typeof PurchaseOrderStatus>;
|
|
91
91
|
|
|
92
|
+
/**
|
|
93
|
+
* Type of amortization
|
|
94
|
+
*/
|
|
95
|
+
export const AmortizationType = {
|
|
96
|
+
Manual: "manual",
|
|
97
|
+
Receipt: "receipt",
|
|
98
|
+
Schedule: "schedule",
|
|
99
|
+
Other: "other",
|
|
100
|
+
} as const;
|
|
101
|
+
/**
|
|
102
|
+
* Type of amortization
|
|
103
|
+
*/
|
|
104
|
+
export type AmortizationType = ClosedEnum<typeof AmortizationType>;
|
|
105
|
+
|
|
92
106
|
export type PurchaseOrder = {
|
|
93
107
|
/**
|
|
94
108
|
* A unique identifier for an object.
|
|
@@ -179,6 +193,10 @@ export type PurchaseOrder = {
|
|
|
179
193
|
* Payment method used for the transaction, such as cash, credit card, bank transfer, or check
|
|
180
194
|
*/
|
|
181
195
|
paymentMethod?: string | null | undefined;
|
|
196
|
+
/**
|
|
197
|
+
* Type of amortization
|
|
198
|
+
*/
|
|
199
|
+
amortizationType?: AmortizationType | null | undefined;
|
|
182
200
|
/**
|
|
183
201
|
* Applicable tax id/code override if tax is not supplied on a line item basis.
|
|
184
202
|
*/
|
|
@@ -191,6 +209,10 @@ export type PurchaseOrder = {
|
|
|
191
209
|
* Message for the supplier. This text appears on the Purchase Order.
|
|
192
210
|
*/
|
|
193
211
|
memo?: string | null | undefined;
|
|
212
|
+
/**
|
|
213
|
+
* Internal notes for the purchase order.
|
|
214
|
+
*/
|
|
215
|
+
notes?: string | null | undefined;
|
|
194
216
|
/**
|
|
195
217
|
* A list of linked tracking categories.
|
|
196
218
|
*/
|
|
@@ -308,6 +330,10 @@ export type PurchaseOrderInput = {
|
|
|
308
330
|
* Payment method used for the transaction, such as cash, credit card, bank transfer, or check
|
|
309
331
|
*/
|
|
310
332
|
paymentMethod?: string | null | undefined;
|
|
333
|
+
/**
|
|
334
|
+
* Type of amortization
|
|
335
|
+
*/
|
|
336
|
+
amortizationType?: AmortizationType | null | undefined;
|
|
311
337
|
/**
|
|
312
338
|
* Applicable tax id/code override if tax is not supplied on a line item basis.
|
|
313
339
|
*/
|
|
@@ -320,6 +346,10 @@ export type PurchaseOrderInput = {
|
|
|
320
346
|
* Message for the supplier. This text appears on the Purchase Order.
|
|
321
347
|
*/
|
|
322
348
|
memo?: string | null | undefined;
|
|
349
|
+
/**
|
|
350
|
+
* Internal notes for the purchase order.
|
|
351
|
+
*/
|
|
352
|
+
notes?: string | null | undefined;
|
|
323
353
|
/**
|
|
324
354
|
* A list of linked tracking categories.
|
|
325
355
|
*/
|
|
@@ -356,6 +386,27 @@ export namespace PurchaseOrderStatus$ {
|
|
|
356
386
|
export const outboundSchema = PurchaseOrderStatus$outboundSchema;
|
|
357
387
|
}
|
|
358
388
|
|
|
389
|
+
/** @internal */
|
|
390
|
+
export const AmortizationType$inboundSchema: z.ZodNativeEnum<
|
|
391
|
+
typeof AmortizationType
|
|
392
|
+
> = z.nativeEnum(AmortizationType);
|
|
393
|
+
|
|
394
|
+
/** @internal */
|
|
395
|
+
export const AmortizationType$outboundSchema: z.ZodNativeEnum<
|
|
396
|
+
typeof AmortizationType
|
|
397
|
+
> = AmortizationType$inboundSchema;
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* @internal
|
|
401
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
402
|
+
*/
|
|
403
|
+
export namespace AmortizationType$ {
|
|
404
|
+
/** @deprecated use `AmortizationType$inboundSchema` instead. */
|
|
405
|
+
export const inboundSchema = AmortizationType$inboundSchema;
|
|
406
|
+
/** @deprecated use `AmortizationType$outboundSchema` instead. */
|
|
407
|
+
export const outboundSchema = AmortizationType$outboundSchema;
|
|
408
|
+
}
|
|
409
|
+
|
|
359
410
|
/** @internal */
|
|
360
411
|
export const PurchaseOrder$inboundSchema: z.ZodType<
|
|
361
412
|
PurchaseOrder,
|
|
@@ -390,9 +441,11 @@ export const PurchaseOrder$inboundSchema: z.ZodType<
|
|
|
390
441
|
accounting_by_row: z.nullable(z.boolean()).optional(),
|
|
391
442
|
due_date: z.nullable(z.string().transform(v => new RFCDate(v))).optional(),
|
|
392
443
|
payment_method: z.nullable(z.string()).optional(),
|
|
444
|
+
amortization_type: z.nullable(AmortizationType$inboundSchema).optional(),
|
|
393
445
|
tax_code: z.nullable(z.string()).optional(),
|
|
394
446
|
channel: z.nullable(z.string()).optional(),
|
|
395
447
|
memo: z.nullable(z.string()).optional(),
|
|
448
|
+
notes: z.nullable(z.string()).optional(),
|
|
396
449
|
tracking_categories: z.nullable(
|
|
397
450
|
z.array(z.nullable(LinkedTrackingCategory$inboundSchema)),
|
|
398
451
|
).optional(),
|
|
@@ -430,6 +483,7 @@ export const PurchaseOrder$inboundSchema: z.ZodType<
|
|
|
430
483
|
"accounting_by_row": "accountingByRow",
|
|
431
484
|
"due_date": "dueDate",
|
|
432
485
|
"payment_method": "paymentMethod",
|
|
486
|
+
"amortization_type": "amortizationType",
|
|
433
487
|
"tax_code": "taxCode",
|
|
434
488
|
"tracking_categories": "trackingCategories",
|
|
435
489
|
"custom_mappings": "customMappings",
|
|
@@ -471,9 +525,11 @@ export type PurchaseOrder$Outbound = {
|
|
|
471
525
|
accounting_by_row?: boolean | null | undefined;
|
|
472
526
|
due_date?: string | null | undefined;
|
|
473
527
|
payment_method?: string | null | undefined;
|
|
528
|
+
amortization_type?: string | null | undefined;
|
|
474
529
|
tax_code?: string | null | undefined;
|
|
475
530
|
channel?: string | null | undefined;
|
|
476
531
|
memo?: string | null | undefined;
|
|
532
|
+
notes?: string | null | undefined;
|
|
477
533
|
tracking_categories?:
|
|
478
534
|
| Array<LinkedTrackingCategory$Outbound | null>
|
|
479
535
|
| null
|
|
@@ -525,9 +581,11 @@ export const PurchaseOrder$outboundSchema: z.ZodType<
|
|
|
525
581
|
dueDate: z.nullable(z.instanceof(RFCDate).transform(v => v.toString()))
|
|
526
582
|
.optional(),
|
|
527
583
|
paymentMethod: z.nullable(z.string()).optional(),
|
|
584
|
+
amortizationType: z.nullable(AmortizationType$outboundSchema).optional(),
|
|
528
585
|
taxCode: z.nullable(z.string()).optional(),
|
|
529
586
|
channel: z.nullable(z.string()).optional(),
|
|
530
587
|
memo: z.nullable(z.string()).optional(),
|
|
588
|
+
notes: z.nullable(z.string()).optional(),
|
|
531
589
|
trackingCategories: z.nullable(
|
|
532
590
|
z.array(z.nullable(LinkedTrackingCategory$outboundSchema)),
|
|
533
591
|
).optional(),
|
|
@@ -561,6 +619,7 @@ export const PurchaseOrder$outboundSchema: z.ZodType<
|
|
|
561
619
|
accountingByRow: "accounting_by_row",
|
|
562
620
|
dueDate: "due_date",
|
|
563
621
|
paymentMethod: "payment_method",
|
|
622
|
+
amortizationType: "amortization_type",
|
|
564
623
|
taxCode: "tax_code",
|
|
565
624
|
trackingCategories: "tracking_categories",
|
|
566
625
|
customMappings: "custom_mappings",
|
|
@@ -633,9 +692,11 @@ export const PurchaseOrderInput$inboundSchema: z.ZodType<
|
|
|
633
692
|
accounting_by_row: z.nullable(z.boolean()).optional(),
|
|
634
693
|
due_date: z.nullable(z.string().transform(v => new RFCDate(v))).optional(),
|
|
635
694
|
payment_method: z.nullable(z.string()).optional(),
|
|
695
|
+
amortization_type: z.nullable(AmortizationType$inboundSchema).optional(),
|
|
636
696
|
tax_code: z.nullable(z.string()).optional(),
|
|
637
697
|
channel: z.nullable(z.string()).optional(),
|
|
638
698
|
memo: z.nullable(z.string()).optional(),
|
|
699
|
+
notes: z.nullable(z.string()).optional(),
|
|
639
700
|
tracking_categories: z.nullable(
|
|
640
701
|
z.array(z.nullable(LinkedTrackingCategory$inboundSchema)),
|
|
641
702
|
).optional(),
|
|
@@ -663,6 +724,7 @@ export const PurchaseOrderInput$inboundSchema: z.ZodType<
|
|
|
663
724
|
"accounting_by_row": "accountingByRow",
|
|
664
725
|
"due_date": "dueDate",
|
|
665
726
|
"payment_method": "paymentMethod",
|
|
727
|
+
"amortization_type": "amortizationType",
|
|
666
728
|
"tax_code": "taxCode",
|
|
667
729
|
"tracking_categories": "trackingCategories",
|
|
668
730
|
"custom_fields": "customFields",
|
|
@@ -697,9 +759,11 @@ export type PurchaseOrderInput$Outbound = {
|
|
|
697
759
|
accounting_by_row?: boolean | null | undefined;
|
|
698
760
|
due_date?: string | null | undefined;
|
|
699
761
|
payment_method?: string | null | undefined;
|
|
762
|
+
amortization_type?: string | null | undefined;
|
|
700
763
|
tax_code?: string | null | undefined;
|
|
701
764
|
channel?: string | null | undefined;
|
|
702
765
|
memo?: string | null | undefined;
|
|
766
|
+
notes?: string | null | undefined;
|
|
703
767
|
tracking_categories?:
|
|
704
768
|
| Array<LinkedTrackingCategory$Outbound | null>
|
|
705
769
|
| null
|
|
@@ -744,9 +808,11 @@ export const PurchaseOrderInput$outboundSchema: z.ZodType<
|
|
|
744
808
|
dueDate: z.nullable(z.instanceof(RFCDate).transform(v => v.toString()))
|
|
745
809
|
.optional(),
|
|
746
810
|
paymentMethod: z.nullable(z.string()).optional(),
|
|
811
|
+
amortizationType: z.nullable(AmortizationType$outboundSchema).optional(),
|
|
747
812
|
taxCode: z.nullable(z.string()).optional(),
|
|
748
813
|
channel: z.nullable(z.string()).optional(),
|
|
749
814
|
memo: z.nullable(z.string()).optional(),
|
|
815
|
+
notes: z.nullable(z.string()).optional(),
|
|
750
816
|
trackingCategories: z.nullable(
|
|
751
817
|
z.array(z.nullable(LinkedTrackingCategory$outboundSchema)),
|
|
752
818
|
).optional(),
|
|
@@ -774,6 +840,7 @@ export const PurchaseOrderInput$outboundSchema: z.ZodType<
|
|
|
774
840
|
accountingByRow: "accounting_by_row",
|
|
775
841
|
dueDate: "due_date",
|
|
776
842
|
paymentMethod: "payment_method",
|
|
843
|
+
amortizationType: "amortization_type",
|
|
777
844
|
taxCode: "tax_code",
|
|
778
845
|
trackingCategories: "tracking_categories",
|
|
779
846
|
customFields: "custom_fields",
|
|
@@ -0,0 +1,135 @@
|
|
|
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 { ClosedEnum } from "../../types/enums.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Status of the rebilling process for this line item.
|
|
14
|
+
*/
|
|
15
|
+
export const RebillStatus = {
|
|
16
|
+
Pending: "pending",
|
|
17
|
+
Billed: "billed",
|
|
18
|
+
Voided: "voided",
|
|
19
|
+
} as const;
|
|
20
|
+
/**
|
|
21
|
+
* Status of the rebilling process for this line item.
|
|
22
|
+
*/
|
|
23
|
+
export type RebillStatus = ClosedEnum<typeof RebillStatus>;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Rebilling metadata for this line item.
|
|
27
|
+
*/
|
|
28
|
+
export type Rebilling = {
|
|
29
|
+
/**
|
|
30
|
+
* Whether this line item is eligible for rebilling.
|
|
31
|
+
*/
|
|
32
|
+
rebillable?: boolean | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Status of the rebilling process for this line item.
|
|
35
|
+
*/
|
|
36
|
+
rebillStatus?: RebillStatus | null | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* The ID of the transaction this line item was rebilled to.
|
|
39
|
+
*/
|
|
40
|
+
linkedTransactionId?: string | null | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* The ID of the line item in the rebilled transaction.
|
|
43
|
+
*/
|
|
44
|
+
linkedTransactionLineId?: string | null | undefined;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/** @internal */
|
|
48
|
+
export const RebillStatus$inboundSchema: z.ZodNativeEnum<typeof RebillStatus> =
|
|
49
|
+
z.nativeEnum(RebillStatus);
|
|
50
|
+
|
|
51
|
+
/** @internal */
|
|
52
|
+
export const RebillStatus$outboundSchema: z.ZodNativeEnum<typeof RebillStatus> =
|
|
53
|
+
RebillStatus$inboundSchema;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @internal
|
|
57
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
58
|
+
*/
|
|
59
|
+
export namespace RebillStatus$ {
|
|
60
|
+
/** @deprecated use `RebillStatus$inboundSchema` instead. */
|
|
61
|
+
export const inboundSchema = RebillStatus$inboundSchema;
|
|
62
|
+
/** @deprecated use `RebillStatus$outboundSchema` instead. */
|
|
63
|
+
export const outboundSchema = RebillStatus$outboundSchema;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** @internal */
|
|
67
|
+
export const Rebilling$inboundSchema: z.ZodType<
|
|
68
|
+
Rebilling,
|
|
69
|
+
z.ZodTypeDef,
|
|
70
|
+
unknown
|
|
71
|
+
> = z.object({
|
|
72
|
+
rebillable: z.boolean().optional(),
|
|
73
|
+
rebill_status: z.nullable(RebillStatus$inboundSchema).optional(),
|
|
74
|
+
linked_transaction_id: z.nullable(z.string()).optional(),
|
|
75
|
+
linked_transaction_line_id: z.nullable(z.string()).optional(),
|
|
76
|
+
}).transform((v) => {
|
|
77
|
+
return remap$(v, {
|
|
78
|
+
"rebill_status": "rebillStatus",
|
|
79
|
+
"linked_transaction_id": "linkedTransactionId",
|
|
80
|
+
"linked_transaction_line_id": "linkedTransactionLineId",
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
/** @internal */
|
|
85
|
+
export type Rebilling$Outbound = {
|
|
86
|
+
rebillable?: boolean | undefined;
|
|
87
|
+
rebill_status?: string | null | undefined;
|
|
88
|
+
linked_transaction_id?: string | null | undefined;
|
|
89
|
+
linked_transaction_line_id?: string | null | undefined;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
/** @internal */
|
|
93
|
+
export const Rebilling$outboundSchema: z.ZodType<
|
|
94
|
+
Rebilling$Outbound,
|
|
95
|
+
z.ZodTypeDef,
|
|
96
|
+
Rebilling
|
|
97
|
+
> = z.object({
|
|
98
|
+
rebillable: z.boolean().optional(),
|
|
99
|
+
rebillStatus: z.nullable(RebillStatus$outboundSchema).optional(),
|
|
100
|
+
linkedTransactionId: z.nullable(z.string()).optional(),
|
|
101
|
+
linkedTransactionLineId: z.nullable(z.string()).optional(),
|
|
102
|
+
}).transform((v) => {
|
|
103
|
+
return remap$(v, {
|
|
104
|
+
rebillStatus: "rebill_status",
|
|
105
|
+
linkedTransactionId: "linked_transaction_id",
|
|
106
|
+
linkedTransactionLineId: "linked_transaction_line_id",
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* @internal
|
|
112
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
113
|
+
*/
|
|
114
|
+
export namespace Rebilling$ {
|
|
115
|
+
/** @deprecated use `Rebilling$inboundSchema` instead. */
|
|
116
|
+
export const inboundSchema = Rebilling$inboundSchema;
|
|
117
|
+
/** @deprecated use `Rebilling$outboundSchema` instead. */
|
|
118
|
+
export const outboundSchema = Rebilling$outboundSchema;
|
|
119
|
+
/** @deprecated use `Rebilling$Outbound` instead. */
|
|
120
|
+
export type Outbound = Rebilling$Outbound;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export function rebillingToJSON(rebilling: Rebilling): string {
|
|
124
|
+
return JSON.stringify(Rebilling$outboundSchema.parse(rebilling));
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export function rebillingFromJSON(
|
|
128
|
+
jsonString: string,
|
|
129
|
+
): SafeParseResult<Rebilling, SDKValidationError> {
|
|
130
|
+
return safeParse(
|
|
131
|
+
jsonString,
|
|
132
|
+
(x) => Rebilling$inboundSchema.parse(JSON.parse(x)),
|
|
133
|
+
`Failed to parse 'Rebilling' from JSON`,
|
|
134
|
+
);
|
|
135
|
+
}
|