@maesn/typescript-sdk 0.8.21 → 0.8.23
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 +2 -0
- package/esm/funcs/accounting-create-booking-proposal-attachment.d.ts +11 -0
- package/esm/funcs/accounting-create-booking-proposal-attachment.d.ts.map +1 -0
- package/esm/funcs/accounting-create-booking-proposal-attachment.js +103 -0
- package/esm/funcs/accounting-create-booking-proposal-attachment.js.map +1 -0
- package/esm/funcs/auth-system-login-url.js +1 -0
- package/esm/funcs/auth-system-login-url.js.map +1 -1
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/models/create-auth-webhook-request-dto.d.ts +2 -0
- package/esm/models/create-auth-webhook-request-dto.d.ts.map +1 -1
- package/esm/models/create-auth-webhook-request-dto.js +1 -0
- package/esm/models/create-auth-webhook-request-dto.js.map +1 -1
- package/esm/models/index.d.ts +1 -0
- package/esm/models/index.d.ts.map +1 -1
- package/esm/models/index.js +1 -0
- package/esm/models/index.js.map +1 -1
- package/esm/models/operations/create-booking-proposal-attachment.d.ts +109 -0
- package/esm/models/operations/create-booking-proposal-attachment.d.ts.map +1 -0
- package/esm/models/operations/create-booking-proposal-attachment.js +90 -0
- package/esm/models/operations/create-booking-proposal-attachment.js.map +1 -0
- package/esm/models/operations/index.d.ts +1 -0
- package/esm/models/operations/index.d.ts.map +1 -1
- package/esm/models/operations/index.js +1 -0
- package/esm/models/operations/index.js.map +1 -1
- package/esm/models/operations/system-login-url.d.ts +5 -0
- package/esm/models/operations/system-login-url.d.ts.map +1 -1
- package/esm/models/operations/system-login-url.js +1 -0
- package/esm/models/operations/system-login-url.js.map +1 -1
- package/esm/models/submission-page-localization-dto.d.ts +20 -0
- package/esm/models/submission-page-localization-dto.d.ts.map +1 -0
- package/esm/models/submission-page-localization-dto.js +16 -0
- package/esm/models/submission-page-localization-dto.js.map +1 -0
- package/esm/models/submission-page-style-dto.d.ts +3 -0
- package/esm/models/submission-page-style-dto.d.ts.map +1 -1
- package/esm/models/submission-page-style-dto.js +2 -0
- package/esm/models/submission-page-style-dto.js.map +1 -1
- package/esm/sdk/accounting.d.ts +1 -0
- package/esm/sdk/accounting.d.ts.map +1 -1
- package/esm/sdk/accounting.js +4 -0
- package/esm/sdk/accounting.js.map +1 -1
- package/esm/types/smart-union.d.ts.map +1 -1
- package/esm/types/smart-union.js +13 -8
- package/esm/types/smart-union.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/accounting-create-booking-proposal-attachment.ts +227 -0
- package/src/funcs/auth-system-login-url.ts +1 -0
- package/src/lib/config.ts +3 -3
- package/src/models/create-auth-webhook-request-dto.ts +3 -0
- package/src/models/index.ts +1 -0
- package/src/models/operations/create-booking-proposal-attachment.ts +297 -0
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/system-login-url.ts +6 -0
- package/src/models/submission-page-localization-dto.ts +44 -0
- package/src/models/submission-page-style-dto.ts +10 -0
- package/src/sdk/accounting.ts +12 -0
- package/src/types/smart-union.ts +17 -8
package/src/sdk/accounting.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { accountingCreateBankAccount } from "../funcs/accounting-create-bank-acc
|
|
|
7
7
|
import { accountingCreateBillLineItem } from "../funcs/accounting-create-bill-line-item.js";
|
|
8
8
|
import { accountingCreateBill } from "../funcs/accounting-create-bill.js";
|
|
9
9
|
import { accountingCreateBookingProposalAsync } from "../funcs/accounting-create-booking-proposal-async.js";
|
|
10
|
+
import { accountingCreateBookingProposalAttachment } from "../funcs/accounting-create-booking-proposal-attachment.js";
|
|
10
11
|
import { accountingCreateBookingProposal } from "../funcs/accounting-create-booking-proposal.js";
|
|
11
12
|
import { accountingCreateContact } from "../funcs/accounting-create-contact.js";
|
|
12
13
|
import { accountingCreateContactsV1 } from "../funcs/accounting-create-contacts-v1.js";
|
|
@@ -1189,6 +1190,17 @@ export class Accounting extends ClientSDK {
|
|
|
1189
1190
|
));
|
|
1190
1191
|
}
|
|
1191
1192
|
|
|
1193
|
+
async createBookingProposalAttachment(
|
|
1194
|
+
request: operations.CreateBookingProposalAttachmentRequest,
|
|
1195
|
+
options?: RequestOptions,
|
|
1196
|
+
): Promise<operations.CreateBookingProposalAttachmentResponse> {
|
|
1197
|
+
return unwrapAsync(accountingCreateBookingProposalAttachment(
|
|
1198
|
+
this,
|
|
1199
|
+
request,
|
|
1200
|
+
options,
|
|
1201
|
+
));
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1192
1204
|
async getBookingProposal(
|
|
1193
1205
|
request: operations.GetBookingProposalRequest,
|
|
1194
1206
|
options?: RequestOptions,
|
package/src/types/smart-union.ts
CHANGED
|
@@ -31,28 +31,33 @@ export function smartUnion<
|
|
|
31
31
|
z.unknown(),
|
|
32
32
|
z.transform((input, ctx) => {
|
|
33
33
|
const candidates: Candidate[] = [];
|
|
34
|
-
const errors: z.core.$
|
|
34
|
+
const errors: z.core.$ZodRawIssue[][] = [];
|
|
35
35
|
|
|
36
36
|
const parentUnrecognizedCtr = startCountingUnrecognized();
|
|
37
37
|
const parentZeroDefaultCtr = startCountingDefaultToZeroValue();
|
|
38
38
|
|
|
39
39
|
// Filter out invalid options
|
|
40
|
-
for (const
|
|
40
|
+
for (const option of options) {
|
|
41
41
|
const unrecognizedCtr = startCountingUnrecognized();
|
|
42
42
|
const zeroDefaultCtr = startCountingDefaultToZeroValue();
|
|
43
|
-
const result = option.
|
|
43
|
+
const result = option._zod.run({ value: input, issues: [] }, {
|
|
44
|
+
async: false,
|
|
45
|
+
});
|
|
46
|
+
if (result instanceof Promise) {
|
|
47
|
+
throw new z.core.$ZodAsyncError();
|
|
48
|
+
}
|
|
44
49
|
const inexactCount = unrecognizedCtr.end();
|
|
45
50
|
const zeroDefaultCount = zeroDefaultCtr.end();
|
|
46
|
-
if (result.
|
|
51
|
+
if (result.issues.length === 0) {
|
|
47
52
|
candidates.push({
|
|
48
|
-
data: result.
|
|
53
|
+
data: result.value,
|
|
49
54
|
inexactCount,
|
|
50
55
|
zeroDefaultCount,
|
|
51
56
|
fieldCount: -1, // We'll count this later if needed
|
|
52
57
|
});
|
|
53
58
|
continue;
|
|
54
59
|
}
|
|
55
|
-
errors
|
|
60
|
+
errors.push(result.issues);
|
|
56
61
|
}
|
|
57
62
|
|
|
58
63
|
// No valid options
|
|
@@ -62,9 +67,13 @@ export function smartUnion<
|
|
|
62
67
|
ctx.issues.push({
|
|
63
68
|
input: input,
|
|
64
69
|
code: "invalid_union",
|
|
65
|
-
errors: errors
|
|
70
|
+
errors: errors.map(issues =>
|
|
71
|
+
issues.map(issue =>
|
|
72
|
+
z.core.util.finalizeIssue(issue, {}, z.core.config())
|
|
73
|
+
)
|
|
74
|
+
),
|
|
66
75
|
});
|
|
67
|
-
return
|
|
76
|
+
return undefined;
|
|
68
77
|
}
|
|
69
78
|
|
|
70
79
|
let best = candidates[0]!;
|