@apideck/unify 0.28.1 → 0.28.3
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 +23 -0
- package/models/components/billlineitem.d.ts.map +1 -1
- package/models/components/billlineitem.js +11 -0
- package/models/components/billlineitem.js.map +1 -1
- package/models/components/expense.d.ts +10 -0
- package/models/components/expense.d.ts.map +1 -1
- package/models/components/expense.js +8 -0
- package/models/components/expense.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 +1 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +1 -0
- package/models/components/index.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 +46 -0
- package/src/models/components/expense.ts +18 -0
- package/src/models/components/expenselineitem.ts +13 -0
- package/src/models/components/expenselineiteminput.ts +13 -0
- package/src/models/components/index.ts +1 -0
- package/src/models/components/rebilling.ts +135 -0
|
@@ -19,6 +19,12 @@ import {
|
|
|
19
19
|
LinkedTrackingCategory$Outbound,
|
|
20
20
|
LinkedTrackingCategory$outboundSchema,
|
|
21
21
|
} from "./linkedtrackingcategory.js";
|
|
22
|
+
import {
|
|
23
|
+
Rebilling,
|
|
24
|
+
Rebilling$inboundSchema,
|
|
25
|
+
Rebilling$Outbound,
|
|
26
|
+
Rebilling$outboundSchema,
|
|
27
|
+
} from "./rebilling.js";
|
|
22
28
|
|
|
23
29
|
export type ExpenseLineItemInput = {
|
|
24
30
|
/**
|
|
@@ -62,6 +68,10 @@ export type ExpenseLineItemInput = {
|
|
|
62
68
|
* Line number of the resource
|
|
63
69
|
*/
|
|
64
70
|
lineNumber?: number | null | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* Rebilling metadata for this line item.
|
|
73
|
+
*/
|
|
74
|
+
rebilling?: Rebilling | null | undefined;
|
|
65
75
|
};
|
|
66
76
|
|
|
67
77
|
/** @internal */
|
|
@@ -83,6 +93,7 @@ export const ExpenseLineItemInput$inboundSchema: z.ZodType<
|
|
|
83
93
|
total_amount: z.nullable(z.number()),
|
|
84
94
|
billable: z.boolean().optional(),
|
|
85
95
|
line_number: z.nullable(z.number().int()).optional(),
|
|
96
|
+
rebilling: z.nullable(Rebilling$inboundSchema).optional(),
|
|
86
97
|
}).transform((v) => {
|
|
87
98
|
return remap$(v, {
|
|
88
99
|
"tracking_categories": "trackingCategories",
|
|
@@ -113,6 +124,7 @@ export type ExpenseLineItemInput$Outbound = {
|
|
|
113
124
|
total_amount: number | null;
|
|
114
125
|
billable?: boolean | undefined;
|
|
115
126
|
line_number?: number | null | undefined;
|
|
127
|
+
rebilling?: Rebilling$Outbound | null | undefined;
|
|
116
128
|
};
|
|
117
129
|
|
|
118
130
|
/** @internal */
|
|
@@ -134,6 +146,7 @@ export const ExpenseLineItemInput$outboundSchema: z.ZodType<
|
|
|
134
146
|
totalAmount: z.nullable(z.number()),
|
|
135
147
|
billable: z.boolean().optional(),
|
|
136
148
|
lineNumber: z.nullable(z.number().int()).optional(),
|
|
149
|
+
rebilling: z.nullable(Rebilling$outboundSchema).optional(),
|
|
137
150
|
}).transform((v) => {
|
|
138
151
|
return remap$(v, {
|
|
139
152
|
trackingCategories: "tracking_categories",
|
|
@@ -449,6 +449,7 @@ export * from "./profitandlosstype.js";
|
|
|
449
449
|
export * from "./purchaseorder.js";
|
|
450
450
|
export * from "./purchaseordersfilter.js";
|
|
451
451
|
export * from "./purchaseorderssort.js";
|
|
452
|
+
export * from "./rebilling.js";
|
|
452
453
|
export * from "./requestcountallocation.js";
|
|
453
454
|
export * from "./resourcestatus.js";
|
|
454
455
|
export * from "./schedule.js";
|
|
@@ -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
|
+
}
|