@clientcasa/sdk 0.4.0 → 0.5.0
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/README.md +7 -0
- package/esm/funcs/document-versions-get.d.ts +16 -0
- package/esm/funcs/document-versions-get.d.ts.map +1 -0
- package/esm/funcs/document-versions-get.js +107 -0
- package/esm/funcs/document-versions-get.js.map +1 -0
- package/esm/funcs/document-versions-list.d.ts +21 -0
- package/esm/funcs/document-versions-list.d.ts.map +1 -0
- package/esm/funcs/document-versions-list.js +145 -0
- package/esm/funcs/document-versions-list.js.map +1 -0
- package/esm/funcs/invoices-create.d.ts +1 -1
- package/esm/funcs/invoices-create.js +1 -1
- package/esm/funcs/invoices-list.js +2 -0
- package/esm/funcs/invoices-list.js.map +1 -1
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/lib/sdks.d.ts.map +1 -1
- package/esm/lib/sdks.js +37 -12
- package/esm/lib/sdks.js.map +1 -1
- package/esm/models/client-create.d.ts +5 -0
- package/esm/models/client-create.d.ts.map +1 -1
- package/esm/models/client-create.js +3 -0
- package/esm/models/client-create.js.map +1 -1
- package/esm/models/client-tax-settings.d.ts +21 -0
- package/esm/models/client-tax-settings.d.ts.map +1 -0
- package/esm/models/client-tax-settings.js +25 -0
- package/esm/models/client-tax-settings.js.map +1 -0
- package/esm/models/client-update.d.ts +5 -0
- package/esm/models/client-update.d.ts.map +1 -1
- package/esm/models/client-update.js +3 -0
- package/esm/models/client-update.js.map +1 -1
- package/esm/models/client.d.ts +25 -0
- package/esm/models/client.d.ts.map +1 -1
- package/esm/models/client.js +22 -0
- package/esm/models/client.js.map +1 -1
- package/esm/models/document-version-list.d.ts +13 -0
- package/esm/models/document-version-list.d.ts.map +1 -0
- package/esm/models/document-version-list.js +16 -0
- package/esm/models/document-version-list.js.map +1 -0
- package/esm/models/document-version.d.ts +106 -0
- package/esm/models/document-version.d.ts.map +1 -0
- package/esm/models/document-version.js +67 -0
- package/esm/models/document-version.js.map +1 -0
- package/esm/models/index.d.ts +3 -0
- package/esm/models/index.d.ts.map +1 -1
- package/esm/models/index.js +3 -0
- package/esm/models/index.js.map +1 -1
- package/esm/models/invoice.d.ts +8 -1
- package/esm/models/invoice.d.ts.map +1 -1
- package/esm/models/invoice.js +2 -1
- package/esm/models/invoice.js.map +1 -1
- package/esm/models/operations/get-document-version.d.ts +27 -0
- package/esm/models/operations/get-document-version.d.ts.map +1 -0
- package/esm/models/operations/get-document-version.js +20 -0
- package/esm/models/operations/get-document-version.js.map +1 -0
- package/esm/models/operations/index.d.ts +2 -0
- package/esm/models/operations/index.d.ts.map +1 -1
- package/esm/models/operations/index.js +2 -0
- package/esm/models/operations/index.js.map +1 -1
- package/esm/models/operations/list-document-versions.d.ts +61 -0
- package/esm/models/operations/list-document-versions.d.ts.map +1 -0
- package/esm/models/operations/list-document-versions.js +47 -0
- package/esm/models/operations/list-document-versions.js.map +1 -0
- package/esm/models/operations/list-invoices.d.ts +23 -1
- package/esm/models/operations/list-invoices.d.ts.map +1 -1
- package/esm/models/operations/list-invoices.js +11 -1
- package/esm/models/operations/list-invoices.js.map +1 -1
- package/esm/sdk/document-versions.d.ts +20 -0
- package/esm/sdk/document-versions.d.ts.map +1 -0
- package/esm/sdk/document-versions.js +26 -0
- package/esm/sdk/document-versions.js.map +1 -0
- package/esm/sdk/invoices.d.ts +1 -1
- package/esm/sdk/invoices.js +1 -1
- package/esm/sdk/sdk.d.ts +3 -0
- package/esm/sdk/sdk.d.ts.map +1 -1
- package/esm/sdk/sdk.js +5 -0
- package/esm/sdk/sdk.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/document-versions-get.ts +203 -0
- package/src/funcs/document-versions-list.ts +284 -0
- package/src/funcs/invoices-create.ts +1 -1
- package/src/funcs/invoices-list.ts +2 -0
- package/src/lib/config.ts +3 -3
- package/src/lib/sdks.ts +41 -13
- package/src/models/client-create.ts +11 -0
- package/src/models/client-tax-settings.ts +58 -0
- package/src/models/client-update.ts +11 -0
- package/src/models/client.ts +56 -0
- package/src/models/document-version-list.ts +40 -0
- package/src/models/document-version.ts +175 -0
- package/src/models/index.ts +3 -0
- package/src/models/invoice.ts +10 -1
- package/src/models/operations/get-document-version.ts +61 -0
- package/src/models/operations/index.ts +2 -0
- package/src/models/operations/list-document-versions.ts +132 -0
- package/src/models/operations/list-invoices.ts +29 -1
- package/src/sdk/document-versions.ts +50 -0
- package/src/sdk/invoices.ts +1 -1
- package/src/sdk/sdk.ts +6 -0
|
@@ -4,6 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v4-mini";
|
|
6
6
|
import { ClosedEnum } from "../types/enums.js";
|
|
7
|
+
import {
|
|
8
|
+
ClientTaxSettings,
|
|
9
|
+
ClientTaxSettings$Outbound,
|
|
10
|
+
ClientTaxSettings$outboundSchema,
|
|
11
|
+
} from "./client-tax-settings.js";
|
|
7
12
|
|
|
8
13
|
export const ClientUpdateStatus = {
|
|
9
14
|
New: "new",
|
|
@@ -20,6 +25,8 @@ export type ClientUpdate = {
|
|
|
20
25
|
name?: string | undefined;
|
|
21
26
|
status?: ClientUpdateStatus | undefined;
|
|
22
27
|
notes?: string | undefined;
|
|
28
|
+
taxSettings?: ClientTaxSettings | undefined;
|
|
29
|
+
invoiceRemindersEnabled?: boolean | undefined;
|
|
23
30
|
};
|
|
24
31
|
|
|
25
32
|
/** @internal */
|
|
@@ -32,6 +39,8 @@ export type ClientUpdate$Outbound = {
|
|
|
32
39
|
name?: string | undefined;
|
|
33
40
|
status: string;
|
|
34
41
|
notes?: string | undefined;
|
|
42
|
+
taxSettings?: ClientTaxSettings$Outbound | undefined;
|
|
43
|
+
invoiceRemindersEnabled?: boolean | undefined;
|
|
35
44
|
};
|
|
36
45
|
|
|
37
46
|
/** @internal */
|
|
@@ -42,6 +51,8 @@ export const ClientUpdate$outboundSchema: z.ZodMiniType<
|
|
|
42
51
|
name: z.optional(z.string()),
|
|
43
52
|
status: z._default(ClientUpdateStatus$outboundSchema, "active"),
|
|
44
53
|
notes: z.optional(z.string()),
|
|
54
|
+
taxSettings: z.optional(ClientTaxSettings$outboundSchema),
|
|
55
|
+
invoiceRemindersEnabled: z.optional(z.boolean()),
|
|
45
56
|
});
|
|
46
57
|
|
|
47
58
|
export function clientUpdateToJSON(clientUpdate: ClientUpdate): string {
|
package/src/models/client.ts
CHANGED
|
@@ -8,6 +8,10 @@ import * as openEnums from "../types/enums.js";
|
|
|
8
8
|
import { OpenEnum } from "../types/enums.js";
|
|
9
9
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
10
10
|
import * as types from "../types/primitives.js";
|
|
11
|
+
import {
|
|
12
|
+
ClientTaxSettings,
|
|
13
|
+
ClientTaxSettings$inboundSchema,
|
|
14
|
+
} from "./client-tax-settings.js";
|
|
11
15
|
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
12
16
|
|
|
13
17
|
export const ClientStatus = {
|
|
@@ -21,6 +25,20 @@ export const ClientStatus = {
|
|
|
21
25
|
} as const;
|
|
22
26
|
export type ClientStatus = OpenEnum<typeof ClientStatus>;
|
|
23
27
|
|
|
28
|
+
export const RecurringBillingStatus = {
|
|
29
|
+
Active: "active",
|
|
30
|
+
PastDue: "past_due",
|
|
31
|
+
Paused: "paused",
|
|
32
|
+
Suspended: "suspended",
|
|
33
|
+
PendingSetup: "pending_setup",
|
|
34
|
+
} as const;
|
|
35
|
+
export type RecurringBillingStatus = OpenEnum<typeof RecurringBillingStatus>;
|
|
36
|
+
|
|
37
|
+
export type RecurringBilling = {
|
|
38
|
+
status: RecurringBillingStatus;
|
|
39
|
+
nextBillingDate: Date | null;
|
|
40
|
+
};
|
|
41
|
+
|
|
24
42
|
export type Client = {
|
|
25
43
|
/**
|
|
26
44
|
* UUID v4
|
|
@@ -29,6 +47,13 @@ export type Client = {
|
|
|
29
47
|
name: string;
|
|
30
48
|
status: ClientStatus;
|
|
31
49
|
notes: string | null;
|
|
50
|
+
taxSettings: ClientTaxSettings;
|
|
51
|
+
invoiceRemindersEnabled: boolean;
|
|
52
|
+
recurringBilling: RecurringBilling | null;
|
|
53
|
+
/**
|
|
54
|
+
* UUID v4
|
|
55
|
+
*/
|
|
56
|
+
sourceSubmissionId: string | null;
|
|
32
57
|
/**
|
|
33
58
|
* ISO 8601 timestamp (UTC)
|
|
34
59
|
*/
|
|
@@ -43,12 +68,43 @@ export type Client = {
|
|
|
43
68
|
export const ClientStatus$inboundSchema: z.ZodMiniType<ClientStatus, unknown> =
|
|
44
69
|
openEnums.inboundSchema(ClientStatus);
|
|
45
70
|
|
|
71
|
+
/** @internal */
|
|
72
|
+
export const RecurringBillingStatus$inboundSchema: z.ZodMiniType<
|
|
73
|
+
RecurringBillingStatus,
|
|
74
|
+
unknown
|
|
75
|
+
> = openEnums.inboundSchema(RecurringBillingStatus);
|
|
76
|
+
|
|
77
|
+
/** @internal */
|
|
78
|
+
export const RecurringBilling$inboundSchema: z.ZodMiniType<
|
|
79
|
+
RecurringBilling,
|
|
80
|
+
unknown
|
|
81
|
+
> = z.object({
|
|
82
|
+
status: RecurringBillingStatus$inboundSchema,
|
|
83
|
+
nextBillingDate: types.nullable(types.date()),
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
export function recurringBillingFromJSON(
|
|
87
|
+
jsonString: string,
|
|
88
|
+
): SafeParseResult<RecurringBilling, SDKValidationError> {
|
|
89
|
+
return safeParse(
|
|
90
|
+
jsonString,
|
|
91
|
+
(x) => RecurringBilling$inboundSchema.parse(JSON.parse(x)),
|
|
92
|
+
`Failed to parse 'RecurringBilling' from JSON`,
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
46
96
|
/** @internal */
|
|
47
97
|
export const Client$inboundSchema: z.ZodMiniType<Client, unknown> = z.object({
|
|
48
98
|
id: types.string(),
|
|
49
99
|
name: types.string(),
|
|
50
100
|
status: ClientStatus$inboundSchema,
|
|
51
101
|
notes: types.nullable(types.string()),
|
|
102
|
+
taxSettings: ClientTaxSettings$inboundSchema,
|
|
103
|
+
invoiceRemindersEnabled: types.boolean(),
|
|
104
|
+
recurringBilling: types.nullable(
|
|
105
|
+
z.lazy(() => RecurringBilling$inboundSchema),
|
|
106
|
+
),
|
|
107
|
+
sourceSubmissionId: types.nullable(types.string()),
|
|
52
108
|
createdAt: types.date(),
|
|
53
109
|
updatedAt: types.date(),
|
|
54
110
|
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
8
|
+
import {
|
|
9
|
+
DocumentVersion,
|
|
10
|
+
DocumentVersion$inboundSchema,
|
|
11
|
+
} from "./document-version.js";
|
|
12
|
+
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
13
|
+
import {
|
|
14
|
+
PaginationMeta,
|
|
15
|
+
PaginationMeta$inboundSchema,
|
|
16
|
+
} from "./pagination-meta.js";
|
|
17
|
+
|
|
18
|
+
export type DocumentVersionList = {
|
|
19
|
+
data: Array<DocumentVersion>;
|
|
20
|
+
pagination: PaginationMeta;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** @internal */
|
|
24
|
+
export const DocumentVersionList$inboundSchema: z.ZodMiniType<
|
|
25
|
+
DocumentVersionList,
|
|
26
|
+
unknown
|
|
27
|
+
> = z.object({
|
|
28
|
+
data: z.array(DocumentVersion$inboundSchema),
|
|
29
|
+
pagination: PaginationMeta$inboundSchema,
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export function documentVersionListFromJSON(
|
|
33
|
+
jsonString: string,
|
|
34
|
+
): SafeParseResult<DocumentVersionList, SDKValidationError> {
|
|
35
|
+
return safeParse(
|
|
36
|
+
jsonString,
|
|
37
|
+
(x) => DocumentVersionList$inboundSchema.parse(JSON.parse(x)),
|
|
38
|
+
`Failed to parse 'DocumentVersionList' from JSON`,
|
|
39
|
+
);
|
|
40
|
+
}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import * as openEnums from "../types/enums.js";
|
|
8
|
+
import { OpenEnum } from "../types/enums.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
10
|
+
import * as types from "../types/primitives.js";
|
|
11
|
+
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
12
|
+
|
|
13
|
+
export const DocumentType = {
|
|
14
|
+
SmartFile: "smart-file",
|
|
15
|
+
Invoice: "invoice",
|
|
16
|
+
StandaloneContract: "standalone-contract",
|
|
17
|
+
} as const;
|
|
18
|
+
export type DocumentType = OpenEnum<typeof DocumentType>;
|
|
19
|
+
|
|
20
|
+
export type DocumentRef = {
|
|
21
|
+
relationTo: string;
|
|
22
|
+
value: string;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const VersionStatus = {
|
|
26
|
+
Issued: "issued",
|
|
27
|
+
Superseded: "superseded",
|
|
28
|
+
Voided: "voided",
|
|
29
|
+
} as const;
|
|
30
|
+
export type VersionStatus = OpenEnum<typeof VersionStatus>;
|
|
31
|
+
|
|
32
|
+
export const AcceptedBy = {
|
|
33
|
+
Client: "client",
|
|
34
|
+
Operator: "operator",
|
|
35
|
+
Signing: "signing",
|
|
36
|
+
Backfill: "backfill",
|
|
37
|
+
} as const;
|
|
38
|
+
export type AcceptedBy = OpenEnum<typeof AcceptedBy>;
|
|
39
|
+
|
|
40
|
+
export type DocumentVersion = {
|
|
41
|
+
/**
|
|
42
|
+
* UUID v4
|
|
43
|
+
*/
|
|
44
|
+
id: string;
|
|
45
|
+
documentType: DocumentType;
|
|
46
|
+
/**
|
|
47
|
+
* UUID v4
|
|
48
|
+
*/
|
|
49
|
+
documentId: string | null;
|
|
50
|
+
documentRef: DocumentRef | null;
|
|
51
|
+
versionNumber: number;
|
|
52
|
+
subVersionNumber: number;
|
|
53
|
+
versionStatus: VersionStatus;
|
|
54
|
+
contentHash: string;
|
|
55
|
+
currency: string;
|
|
56
|
+
/**
|
|
57
|
+
* ISO 8601 timestamp (UTC)
|
|
58
|
+
*/
|
|
59
|
+
issuedAt: Date | null;
|
|
60
|
+
/**
|
|
61
|
+
* ISO 8601 timestamp (UTC)
|
|
62
|
+
*/
|
|
63
|
+
viewedAt: Date | null;
|
|
64
|
+
/**
|
|
65
|
+
* ISO 8601 timestamp (UTC)
|
|
66
|
+
*/
|
|
67
|
+
acceptedAt: Date | null;
|
|
68
|
+
acceptedBy: AcceptedBy | null;
|
|
69
|
+
/**
|
|
70
|
+
* ISO 8601 timestamp (UTC)
|
|
71
|
+
*/
|
|
72
|
+
supersededAt: Date | null;
|
|
73
|
+
/**
|
|
74
|
+
* UUID v4
|
|
75
|
+
*/
|
|
76
|
+
supersededByVersionId: string | null;
|
|
77
|
+
/**
|
|
78
|
+
* ISO 8601 timestamp (UTC)
|
|
79
|
+
*/
|
|
80
|
+
voidedAt: Date | null;
|
|
81
|
+
/**
|
|
82
|
+
* ISO 8601 timestamp (UTC)
|
|
83
|
+
*/
|
|
84
|
+
quoteConvertedAt: Date | null;
|
|
85
|
+
/**
|
|
86
|
+
* ISO 8601 timestamp (UTC)
|
|
87
|
+
*/
|
|
88
|
+
expiresAt: Date | null;
|
|
89
|
+
/**
|
|
90
|
+
* UUID v4
|
|
91
|
+
*/
|
|
92
|
+
engagementProjectId: string | null;
|
|
93
|
+
/**
|
|
94
|
+
* UUID v4
|
|
95
|
+
*/
|
|
96
|
+
parentVersionId: string | null;
|
|
97
|
+
/**
|
|
98
|
+
* ISO 8601 timestamp (UTC)
|
|
99
|
+
*/
|
|
100
|
+
createdAt: Date;
|
|
101
|
+
/**
|
|
102
|
+
* ISO 8601 timestamp (UTC)
|
|
103
|
+
*/
|
|
104
|
+
updatedAt: Date;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
/** @internal */
|
|
108
|
+
export const DocumentType$inboundSchema: z.ZodMiniType<DocumentType, unknown> =
|
|
109
|
+
openEnums.inboundSchema(DocumentType);
|
|
110
|
+
|
|
111
|
+
/** @internal */
|
|
112
|
+
export const DocumentRef$inboundSchema: z.ZodMiniType<DocumentRef, unknown> = z
|
|
113
|
+
.object({
|
|
114
|
+
relationTo: types.string(),
|
|
115
|
+
value: types.string(),
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
export function documentRefFromJSON(
|
|
119
|
+
jsonString: string,
|
|
120
|
+
): SafeParseResult<DocumentRef, SDKValidationError> {
|
|
121
|
+
return safeParse(
|
|
122
|
+
jsonString,
|
|
123
|
+
(x) => DocumentRef$inboundSchema.parse(JSON.parse(x)),
|
|
124
|
+
`Failed to parse 'DocumentRef' from JSON`,
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/** @internal */
|
|
129
|
+
export const VersionStatus$inboundSchema: z.ZodMiniType<
|
|
130
|
+
VersionStatus,
|
|
131
|
+
unknown
|
|
132
|
+
> = openEnums.inboundSchema(VersionStatus);
|
|
133
|
+
|
|
134
|
+
/** @internal */
|
|
135
|
+
export const AcceptedBy$inboundSchema: z.ZodMiniType<AcceptedBy, unknown> =
|
|
136
|
+
openEnums.inboundSchema(AcceptedBy);
|
|
137
|
+
|
|
138
|
+
/** @internal */
|
|
139
|
+
export const DocumentVersion$inboundSchema: z.ZodMiniType<
|
|
140
|
+
DocumentVersion,
|
|
141
|
+
unknown
|
|
142
|
+
> = z.object({
|
|
143
|
+
id: types.string(),
|
|
144
|
+
documentType: DocumentType$inboundSchema,
|
|
145
|
+
documentId: types.nullable(types.string()),
|
|
146
|
+
documentRef: types.nullable(z.lazy(() => DocumentRef$inboundSchema)),
|
|
147
|
+
versionNumber: types.number(),
|
|
148
|
+
subVersionNumber: types.number(),
|
|
149
|
+
versionStatus: VersionStatus$inboundSchema,
|
|
150
|
+
contentHash: types.string(),
|
|
151
|
+
currency: types.string(),
|
|
152
|
+
issuedAt: types.nullable(types.date()),
|
|
153
|
+
viewedAt: types.nullable(types.date()),
|
|
154
|
+
acceptedAt: types.nullable(types.date()),
|
|
155
|
+
acceptedBy: types.nullable(AcceptedBy$inboundSchema),
|
|
156
|
+
supersededAt: types.nullable(types.date()),
|
|
157
|
+
supersededByVersionId: types.nullable(types.string()),
|
|
158
|
+
voidedAt: types.nullable(types.date()),
|
|
159
|
+
quoteConvertedAt: types.nullable(types.date()),
|
|
160
|
+
expiresAt: types.nullable(types.date()),
|
|
161
|
+
engagementProjectId: types.nullable(types.string()),
|
|
162
|
+
parentVersionId: types.nullable(types.string()),
|
|
163
|
+
createdAt: types.date(),
|
|
164
|
+
updatedAt: types.date(),
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
export function documentVersionFromJSON(
|
|
168
|
+
jsonString: string,
|
|
169
|
+
): SafeParseResult<DocumentVersion, SDKValidationError> {
|
|
170
|
+
return safeParse(
|
|
171
|
+
jsonString,
|
|
172
|
+
(x) => DocumentVersion$inboundSchema.parse(JSON.parse(x)),
|
|
173
|
+
`Failed to parse 'DocumentVersion' from JSON`,
|
|
174
|
+
);
|
|
175
|
+
}
|
package/src/models/index.ts
CHANGED
|
@@ -15,6 +15,7 @@ export * from "./client-create.js";
|
|
|
15
15
|
export * from "./client-document-list.js";
|
|
16
16
|
export * from "./client-document.js";
|
|
17
17
|
export * from "./client-list.js";
|
|
18
|
+
export * from "./client-tax-settings.js";
|
|
18
19
|
export * from "./client-update.js";
|
|
19
20
|
export * from "./client.js";
|
|
20
21
|
export * from "./contact-create.js";
|
|
@@ -25,6 +26,8 @@ export * from "./contract-create.js";
|
|
|
25
26
|
export * from "./contract-list.js";
|
|
26
27
|
export * from "./contract-update.js";
|
|
27
28
|
export * from "./contract.js";
|
|
29
|
+
export * from "./document-version-list.js";
|
|
30
|
+
export * from "./document-version.js";
|
|
28
31
|
export * from "./form-list.js";
|
|
29
32
|
export * from "./form-submission-answer.js";
|
|
30
33
|
export * from "./form-submission-list.js";
|
package/src/models/invoice.ts
CHANGED
|
@@ -19,7 +19,6 @@ export const InvoiceStatus = {
|
|
|
19
19
|
Sent: "sent",
|
|
20
20
|
Partial: "partial",
|
|
21
21
|
Paid: "paid",
|
|
22
|
-
Overdue: "overdue",
|
|
23
22
|
Void: "void",
|
|
24
23
|
} as const;
|
|
25
24
|
export type InvoiceStatus = OpenEnum<typeof InvoiceStatus>;
|
|
@@ -50,6 +49,14 @@ export type Invoice = {
|
|
|
50
49
|
total: number;
|
|
51
50
|
amountPaid: number;
|
|
52
51
|
balanceDue: number;
|
|
52
|
+
/**
|
|
53
|
+
* Derived (read-only): true when the invoice is past its due date with a balance still owing (status is sent or partial). Not a stored status.
|
|
54
|
+
*/
|
|
55
|
+
overdue: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Read-only: the voided invoice this one was issued to correct (void & reissue). Null otherwise. To find the forward link — the corrected invoice that replaced a given one — list with `?supersedesInvoice={id}`.
|
|
58
|
+
*/
|
|
59
|
+
supersedesInvoice: string | null;
|
|
53
60
|
paymentTerms: string | null;
|
|
54
61
|
notes: string | null;
|
|
55
62
|
/**
|
|
@@ -91,6 +98,8 @@ export const Invoice$inboundSchema: z.ZodMiniType<Invoice, unknown> = z.object({
|
|
|
91
98
|
total: types.number(),
|
|
92
99
|
amountPaid: types.number(),
|
|
93
100
|
balanceDue: types.number(),
|
|
101
|
+
overdue: types.boolean(),
|
|
102
|
+
supersedesInvoice: types.nullable(types.string()),
|
|
94
103
|
paymentTerms: types.nullable(types.string()),
|
|
95
104
|
notes: types.nullable(types.string()),
|
|
96
105
|
paidAt: types.nullable(types.date()),
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
|
|
7
|
+
export type GetDocumentVersionSecurity = {
|
|
8
|
+
apiKey?: string | undefined;
|
|
9
|
+
bearer?: string | undefined;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type GetDocumentVersionRequest = {
|
|
13
|
+
/**
|
|
14
|
+
* UUID v4
|
|
15
|
+
*/
|
|
16
|
+
id: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/** @internal */
|
|
20
|
+
export type GetDocumentVersionSecurity$Outbound = {
|
|
21
|
+
apiKey?: string | undefined;
|
|
22
|
+
bearer?: string | undefined;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/** @internal */
|
|
26
|
+
export const GetDocumentVersionSecurity$outboundSchema: z.ZodMiniType<
|
|
27
|
+
GetDocumentVersionSecurity$Outbound,
|
|
28
|
+
GetDocumentVersionSecurity
|
|
29
|
+
> = z.object({
|
|
30
|
+
apiKey: z.optional(z.string()),
|
|
31
|
+
bearer: z.optional(z.string()),
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export function getDocumentVersionSecurityToJSON(
|
|
35
|
+
getDocumentVersionSecurity: GetDocumentVersionSecurity,
|
|
36
|
+
): string {
|
|
37
|
+
return JSON.stringify(
|
|
38
|
+
GetDocumentVersionSecurity$outboundSchema.parse(getDocumentVersionSecurity),
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** @internal */
|
|
43
|
+
export type GetDocumentVersionRequest$Outbound = {
|
|
44
|
+
id: string;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/** @internal */
|
|
48
|
+
export const GetDocumentVersionRequest$outboundSchema: z.ZodMiniType<
|
|
49
|
+
GetDocumentVersionRequest$Outbound,
|
|
50
|
+
GetDocumentVersionRequest
|
|
51
|
+
> = z.object({
|
|
52
|
+
id: z.string(),
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
export function getDocumentVersionRequestToJSON(
|
|
56
|
+
getDocumentVersionRequest: GetDocumentVersionRequest,
|
|
57
|
+
): string {
|
|
58
|
+
return JSON.stringify(
|
|
59
|
+
GetDocumentVersionRequest$outboundSchema.parse(getDocumentVersionRequest),
|
|
60
|
+
);
|
|
61
|
+
}
|
|
@@ -31,6 +31,7 @@ export * from "./get-client-document.js";
|
|
|
31
31
|
export * from "./get-client.js";
|
|
32
32
|
export * from "./get-contact.js";
|
|
33
33
|
export * from "./get-contract.js";
|
|
34
|
+
export * from "./get-document-version.js";
|
|
34
35
|
export * from "./get-form-submission.js";
|
|
35
36
|
export * from "./get-form.js";
|
|
36
37
|
export * from "./get-invoice.js";
|
|
@@ -47,6 +48,7 @@ export * from "./list-client-documents.js";
|
|
|
47
48
|
export * from "./list-clients.js";
|
|
48
49
|
export * from "./list-contacts.js";
|
|
49
50
|
export * from "./list-contracts.js";
|
|
51
|
+
export * from "./list-document-versions.js";
|
|
50
52
|
export * from "./list-form-submissions.js";
|
|
51
53
|
export * from "./list-forms.js";
|
|
52
54
|
export * from "./list-invoices.js";
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
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/sdk-validation-error.js";
|
|
11
|
+
import * as models from "../index.js";
|
|
12
|
+
|
|
13
|
+
export type ListDocumentVersionsSecurity = {
|
|
14
|
+
apiKey?: string | undefined;
|
|
15
|
+
bearer?: string | undefined;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const DocumentType = {
|
|
19
|
+
SmartFile: "smart-file",
|
|
20
|
+
Invoice: "invoice",
|
|
21
|
+
StandaloneContract: "standalone-contract",
|
|
22
|
+
} as const;
|
|
23
|
+
export type DocumentType = ClosedEnum<typeof DocumentType>;
|
|
24
|
+
|
|
25
|
+
export type ListDocumentVersionsRequest = {
|
|
26
|
+
page?: number | undefined;
|
|
27
|
+
pageSize?: number | undefined;
|
|
28
|
+
documentType?: DocumentType | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Filter to a smart-file (client-document) id.
|
|
31
|
+
*/
|
|
32
|
+
documentId?: string | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Filter to an invoice id.
|
|
35
|
+
*/
|
|
36
|
+
invoiceId?: string | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Filter to a standalone-contract id.
|
|
39
|
+
*/
|
|
40
|
+
contractId?: string | undefined;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export type ListDocumentVersionsResponse = {
|
|
44
|
+
result: models.DocumentVersionList;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/** @internal */
|
|
48
|
+
export type ListDocumentVersionsSecurity$Outbound = {
|
|
49
|
+
apiKey?: string | undefined;
|
|
50
|
+
bearer?: string | undefined;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/** @internal */
|
|
54
|
+
export const ListDocumentVersionsSecurity$outboundSchema: z.ZodMiniType<
|
|
55
|
+
ListDocumentVersionsSecurity$Outbound,
|
|
56
|
+
ListDocumentVersionsSecurity
|
|
57
|
+
> = z.object({
|
|
58
|
+
apiKey: z.optional(z.string()),
|
|
59
|
+
bearer: z.optional(z.string()),
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
export function listDocumentVersionsSecurityToJSON(
|
|
63
|
+
listDocumentVersionsSecurity: ListDocumentVersionsSecurity,
|
|
64
|
+
): string {
|
|
65
|
+
return JSON.stringify(
|
|
66
|
+
ListDocumentVersionsSecurity$outboundSchema.parse(
|
|
67
|
+
listDocumentVersionsSecurity,
|
|
68
|
+
),
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** @internal */
|
|
73
|
+
export const DocumentType$outboundSchema: z.ZodMiniEnum<typeof DocumentType> = z
|
|
74
|
+
.enum(DocumentType);
|
|
75
|
+
|
|
76
|
+
/** @internal */
|
|
77
|
+
export type ListDocumentVersionsRequest$Outbound = {
|
|
78
|
+
page: number;
|
|
79
|
+
pageSize: number;
|
|
80
|
+
documentType?: string | undefined;
|
|
81
|
+
documentId?: string | undefined;
|
|
82
|
+
invoiceId?: string | undefined;
|
|
83
|
+
contractId?: string | undefined;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/** @internal */
|
|
87
|
+
export const ListDocumentVersionsRequest$outboundSchema: z.ZodMiniType<
|
|
88
|
+
ListDocumentVersionsRequest$Outbound,
|
|
89
|
+
ListDocumentVersionsRequest
|
|
90
|
+
> = z.object({
|
|
91
|
+
page: z._default(z.int(), 1),
|
|
92
|
+
pageSize: z._default(z.int(), 25),
|
|
93
|
+
documentType: z.optional(DocumentType$outboundSchema),
|
|
94
|
+
documentId: z.optional(z.string()),
|
|
95
|
+
invoiceId: z.optional(z.string()),
|
|
96
|
+
contractId: z.optional(z.string()),
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
export function listDocumentVersionsRequestToJSON(
|
|
100
|
+
listDocumentVersionsRequest: ListDocumentVersionsRequest,
|
|
101
|
+
): string {
|
|
102
|
+
return JSON.stringify(
|
|
103
|
+
ListDocumentVersionsRequest$outboundSchema.parse(
|
|
104
|
+
listDocumentVersionsRequest,
|
|
105
|
+
),
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** @internal */
|
|
110
|
+
export const ListDocumentVersionsResponse$inboundSchema: z.ZodMiniType<
|
|
111
|
+
ListDocumentVersionsResponse,
|
|
112
|
+
unknown
|
|
113
|
+
> = z.pipe(
|
|
114
|
+
z.object({
|
|
115
|
+
Result: models.DocumentVersionList$inboundSchema,
|
|
116
|
+
}),
|
|
117
|
+
z.transform((v) => {
|
|
118
|
+
return remap$(v, {
|
|
119
|
+
"Result": "result",
|
|
120
|
+
});
|
|
121
|
+
}),
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
export function listDocumentVersionsResponseFromJSON(
|
|
125
|
+
jsonString: string,
|
|
126
|
+
): SafeParseResult<ListDocumentVersionsResponse, SDKValidationError> {
|
|
127
|
+
return safeParse(
|
|
128
|
+
jsonString,
|
|
129
|
+
(x) => ListDocumentVersionsResponse$inboundSchema.parse(JSON.parse(x)),
|
|
130
|
+
`Failed to parse 'ListDocumentVersionsResponse' from JSON`,
|
|
131
|
+
);
|
|
132
|
+
}
|
|
@@ -20,11 +20,22 @@ export const ListInvoicesStatus = {
|
|
|
20
20
|
Sent: "sent",
|
|
21
21
|
Partial: "partial",
|
|
22
22
|
Paid: "paid",
|
|
23
|
-
Overdue: "overdue",
|
|
24
23
|
Void: "void",
|
|
25
24
|
} as const;
|
|
26
25
|
export type ListInvoicesStatus = ClosedEnum<typeof ListInvoicesStatus>;
|
|
27
26
|
|
|
27
|
+
/**
|
|
28
|
+
* Filter by the derived overdue condition. `true` → sent/partial invoices past their due date; `false` → everything else. (Replaces the removed `status=overdue` filter.)
|
|
29
|
+
*/
|
|
30
|
+
export const Overdue = {
|
|
31
|
+
True: "true",
|
|
32
|
+
False: "false",
|
|
33
|
+
} as const;
|
|
34
|
+
/**
|
|
35
|
+
* Filter by the derived overdue condition. `true` → sent/partial invoices past their due date; `false` → everything else. (Replaces the removed `status=overdue` filter.)
|
|
36
|
+
*/
|
|
37
|
+
export type Overdue = ClosedEnum<typeof Overdue>;
|
|
38
|
+
|
|
28
39
|
export type ListInvoicesRequest = {
|
|
29
40
|
page?: number | undefined;
|
|
30
41
|
pageSize?: number | undefined;
|
|
@@ -33,6 +44,14 @@ export type ListInvoicesRequest = {
|
|
|
33
44
|
*/
|
|
34
45
|
clientId?: string | undefined;
|
|
35
46
|
status?: ListInvoicesStatus | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* Filter by the derived overdue condition. `true` → sent/partial invoices past their due date; `false` → everything else. (Replaces the removed `status=overdue` filter.)
|
|
49
|
+
*/
|
|
50
|
+
overdue?: Overdue | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* Return the invoice that supersedes (replaces) the given invoice id — the forward void→reissue link.
|
|
53
|
+
*/
|
|
54
|
+
supersedesInvoice?: string | undefined;
|
|
36
55
|
};
|
|
37
56
|
|
|
38
57
|
export type ListInvoicesResponse = {
|
|
@@ -67,12 +86,19 @@ export const ListInvoicesStatus$outboundSchema: z.ZodMiniEnum<
|
|
|
67
86
|
typeof ListInvoicesStatus
|
|
68
87
|
> = z.enum(ListInvoicesStatus);
|
|
69
88
|
|
|
89
|
+
/** @internal */
|
|
90
|
+
export const Overdue$outboundSchema: z.ZodMiniEnum<typeof Overdue> = z.enum(
|
|
91
|
+
Overdue,
|
|
92
|
+
);
|
|
93
|
+
|
|
70
94
|
/** @internal */
|
|
71
95
|
export type ListInvoicesRequest$Outbound = {
|
|
72
96
|
page: number;
|
|
73
97
|
pageSize: number;
|
|
74
98
|
clientId?: string | undefined;
|
|
75
99
|
status?: string | undefined;
|
|
100
|
+
overdue?: string | undefined;
|
|
101
|
+
supersedesInvoice?: string | undefined;
|
|
76
102
|
};
|
|
77
103
|
|
|
78
104
|
/** @internal */
|
|
@@ -84,6 +110,8 @@ export const ListInvoicesRequest$outboundSchema: z.ZodMiniType<
|
|
|
84
110
|
pageSize: z._default(z.int(), 25),
|
|
85
111
|
clientId: z.optional(z.string()),
|
|
86
112
|
status: z.optional(ListInvoicesStatus$outboundSchema),
|
|
113
|
+
overdue: z.optional(Overdue$outboundSchema),
|
|
114
|
+
supersedesInvoice: z.optional(z.string()),
|
|
87
115
|
});
|
|
88
116
|
|
|
89
117
|
export function listInvoicesRequestToJSON(
|