@maesn/typescript-sdk 0.8.11 → 0.8.15

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.
Files changed (129) hide show
  1. package/README.md +6 -0
  2. package/esm/funcs/accounting-delete-item.d.ts +11 -0
  3. package/esm/funcs/accounting-delete-item.d.ts.map +1 -0
  4. package/esm/funcs/accounting-delete-item.js +81 -0
  5. package/esm/funcs/accounting-delete-item.js.map +1 -0
  6. package/esm/funcs/accounting-get-journal-entry.js +1 -0
  7. package/esm/funcs/accounting-get-journal-entry.js.map +1 -1
  8. package/esm/funcs/accounting-update-item.d.ts +11 -0
  9. package/esm/funcs/accounting-update-item.d.ts.map +1 -0
  10. package/esm/funcs/accounting-update-item.js +82 -0
  11. package/esm/funcs/accounting-update-item.js.map +1 -0
  12. package/esm/funcs/accounting-update-journal-entry.d.ts +11 -0
  13. package/esm/funcs/accounting-update-journal-entry.d.ts.map +1 -0
  14. package/esm/funcs/accounting-update-journal-entry.js +109 -0
  15. package/esm/funcs/accounting-update-journal-entry.js.map +1 -0
  16. package/esm/lib/config.d.ts +3 -3
  17. package/esm/lib/config.js +3 -3
  18. package/esm/lib/encodings.d.ts +10 -9
  19. package/esm/lib/encodings.d.ts.map +1 -1
  20. package/esm/lib/encodings.js +29 -13
  21. package/esm/lib/encodings.js.map +1 -1
  22. package/esm/models/account-response-dto.d.ts +10 -0
  23. package/esm/models/account-response-dto.d.ts.map +1 -1
  24. package/esm/models/account-response-dto.js +11 -0
  25. package/esm/models/account-response-dto.js.map +1 -1
  26. package/esm/models/create-account-request-dto.d.ts +3 -0
  27. package/esm/models/create-account-request-dto.d.ts.map +1 -1
  28. package/esm/models/create-account-request-dto.js +2 -0
  29. package/esm/models/create-account-request-dto.js.map +1 -1
  30. package/esm/models/create-booking-proposal-request-dto-v2.d.ts +2 -0
  31. package/esm/models/create-booking-proposal-request-dto-v2.d.ts.map +1 -1
  32. package/esm/models/create-booking-proposal-request-dto-v2.js +1 -0
  33. package/esm/models/create-booking-proposal-request-dto-v2.js.map +1 -1
  34. package/esm/models/create-booking-proposal-request-dto.d.ts +2 -0
  35. package/esm/models/create-booking-proposal-request-dto.d.ts.map +1 -1
  36. package/esm/models/create-booking-proposal-request-dto.js +1 -0
  37. package/esm/models/create-booking-proposal-request-dto.js.map +1 -1
  38. package/esm/models/create-journal-entry-request-dto.d.ts +2 -0
  39. package/esm/models/create-journal-entry-request-dto.d.ts.map +1 -1
  40. package/esm/models/create-journal-entry-request-dto.js +1 -0
  41. package/esm/models/create-journal-entry-request-dto.js.map +1 -1
  42. package/esm/models/create-offer-line-item-request-dto.d.ts +1 -0
  43. package/esm/models/create-offer-line-item-request-dto.d.ts.map +1 -1
  44. package/esm/models/create-offer-line-item-request-dto.js +1 -0
  45. package/esm/models/create-offer-line-item-request-dto.js.map +1 -1
  46. package/esm/models/create-offer-request-dto.d.ts +2 -0
  47. package/esm/models/create-offer-request-dto.d.ts.map +1 -1
  48. package/esm/models/create-offer-request-dto.js +1 -0
  49. package/esm/models/create-offer-request-dto.js.map +1 -1
  50. package/esm/models/create-sales-order-line-item-request-dto.d.ts +4 -0
  51. package/esm/models/create-sales-order-line-item-request-dto.d.ts.map +1 -1
  52. package/esm/models/create-sales-order-line-item-request-dto.js +2 -0
  53. package/esm/models/create-sales-order-line-item-request-dto.js.map +1 -1
  54. package/esm/models/index.d.ts +1 -0
  55. package/esm/models/index.d.ts.map +1 -1
  56. package/esm/models/index.js +1 -0
  57. package/esm/models/index.js.map +1 -1
  58. package/esm/models/journal-entry-response-dto.d.ts +2 -1
  59. package/esm/models/journal-entry-response-dto.d.ts.map +1 -1
  60. package/esm/models/journal-entry-response-dto.js +2 -1
  61. package/esm/models/journal-entry-response-dto.js.map +1 -1
  62. package/esm/models/offer-line-item-response-dto.d.ts +1 -0
  63. package/esm/models/offer-line-item-response-dto.d.ts.map +1 -1
  64. package/esm/models/offer-line-item-response-dto.js +1 -0
  65. package/esm/models/offer-line-item-response-dto.js.map +1 -1
  66. package/esm/models/offer-response-dto.d.ts +1 -0
  67. package/esm/models/offer-response-dto.d.ts.map +1 -1
  68. package/esm/models/offer-response-dto.js +1 -0
  69. package/esm/models/offer-response-dto.js.map +1 -1
  70. package/esm/models/operations/delete-item.d.ts +75 -0
  71. package/esm/models/operations/delete-item.d.ts.map +1 -0
  72. package/esm/models/operations/delete-item.js +57 -0
  73. package/esm/models/operations/delete-item.js.map +1 -0
  74. package/esm/models/operations/get-journal-entry.d.ts +5 -0
  75. package/esm/models/operations/get-journal-entry.d.ts.map +1 -1
  76. package/esm/models/operations/get-journal-entry.js +1 -0
  77. package/esm/models/operations/get-journal-entry.js.map +1 -1
  78. package/esm/models/operations/index.d.ts +3 -0
  79. package/esm/models/operations/index.d.ts.map +1 -1
  80. package/esm/models/operations/index.js +3 -0
  81. package/esm/models/operations/index.js.map +1 -1
  82. package/esm/models/operations/update-item.d.ts +77 -0
  83. package/esm/models/operations/update-item.d.ts.map +1 -0
  84. package/esm/models/operations/update-item.js +58 -0
  85. package/esm/models/operations/update-item.js.map +1 -0
  86. package/esm/models/operations/update-journal-entry.d.ts +96 -0
  87. package/esm/models/operations/update-journal-entry.d.ts.map +1 -0
  88. package/esm/models/operations/update-journal-entry.js +83 -0
  89. package/esm/models/operations/update-journal-entry.js.map +1 -0
  90. package/esm/models/submission-page-style-dto.d.ts +4 -0
  91. package/esm/models/submission-page-style-dto.d.ts.map +1 -1
  92. package/esm/models/submission-page-style-dto.js +2 -0
  93. package/esm/models/submission-page-style-dto.js.map +1 -1
  94. package/esm/models/tax-rate-request-common-dto.d.ts +18 -0
  95. package/esm/models/tax-rate-request-common-dto.d.ts.map +1 -0
  96. package/esm/models/tax-rate-request-common-dto.js +15 -0
  97. package/esm/models/tax-rate-request-common-dto.js.map +1 -0
  98. package/esm/sdk/accounting.d.ts +3 -0
  99. package/esm/sdk/accounting.d.ts.map +1 -1
  100. package/esm/sdk/accounting.js +12 -0
  101. package/esm/sdk/accounting.js.map +1 -1
  102. package/jsr.json +1 -1
  103. package/package.json +2 -2
  104. package/src/funcs/accounting-delete-item.ts +172 -0
  105. package/src/funcs/accounting-get-journal-entry.ts +1 -0
  106. package/src/funcs/accounting-update-item.ts +173 -0
  107. package/src/funcs/accounting-update-journal-entry.ts +226 -0
  108. package/src/lib/config.ts +3 -3
  109. package/src/lib/encodings.ts +58 -23
  110. package/src/models/account-response-dto.ts +32 -0
  111. package/src/models/create-account-request-dto.ts +8 -0
  112. package/src/models/create-booking-proposal-request-dto-v2.ts +3 -0
  113. package/src/models/create-booking-proposal-request-dto.ts +3 -0
  114. package/src/models/create-journal-entry-request-dto.ts +3 -0
  115. package/src/models/create-offer-line-item-request-dto.ts +1 -0
  116. package/src/models/create-offer-request-dto.ts +3 -0
  117. package/src/models/create-sales-order-line-item-request-dto.ts +6 -0
  118. package/src/models/index.ts +1 -0
  119. package/src/models/journal-entry-response-dto.ts +4 -2
  120. package/src/models/offer-line-item-response-dto.ts +1 -0
  121. package/src/models/offer-response-dto.ts +2 -0
  122. package/src/models/operations/delete-item.ts +185 -0
  123. package/src/models/operations/get-journal-entry.ts +6 -0
  124. package/src/models/operations/index.ts +3 -0
  125. package/src/models/operations/update-item.ts +188 -0
  126. package/src/models/operations/update-journal-entry.ts +261 -0
  127. package/src/models/submission-page-style-dto.ts +6 -0
  128. package/src/models/tax-rate-request-common-dto.ts +39 -0
  129. package/src/sdk/accounting.ts +36 -0
@@ -0,0 +1,226 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import { MaesnCore } from "../core.js";
7
+ import {
8
+ appendForm,
9
+ encodeFormQuery,
10
+ encodeJSON,
11
+ encodeSimple,
12
+ normalizeBlob,
13
+ } from "../lib/encodings.js";
14
+ import {
15
+ bytesToBlob,
16
+ getContentTypeFromFileName,
17
+ readableStreamToArrayBuffer,
18
+ } from "../lib/files.js";
19
+ import { matchStatusCode } from "../lib/http.js";
20
+ import * as M from "../lib/matchers.js";
21
+ import { compactMap } from "../lib/primitives.js";
22
+ import { safeParse } from "../lib/schemas.js";
23
+ import { RequestOptions } from "../lib/sdks.js";
24
+ import { pathToFunc } from "../lib/url.js";
25
+ import {
26
+ ConnectionError,
27
+ InvalidRequestError,
28
+ RequestAbortedError,
29
+ RequestTimeoutError,
30
+ UnexpectedClientError,
31
+ } from "../models/errors/http-client-errors.js";
32
+ import { MaesnError } from "../models/errors/maesn-error.js";
33
+ import { ResponseValidationError } from "../models/errors/response-validation-error.js";
34
+ import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
35
+ import * as operations from "../models/operations/index.js";
36
+ import { APICall, APIPromise } from "../types/async.js";
37
+ import { isBlobLike } from "../types/blobs.js";
38
+ import { Result } from "../types/fp.js";
39
+ import { isReadableStream } from "../types/streams.js";
40
+
41
+ export function accountingUpdateJournalEntry(
42
+ client: MaesnCore,
43
+ request: operations.UpdateJournalEntryRequest,
44
+ options?: RequestOptions,
45
+ ): APIPromise<
46
+ Result<
47
+ operations.UpdateJournalEntryResponse,
48
+ | MaesnError
49
+ | ResponseValidationError
50
+ | ConnectionError
51
+ | RequestAbortedError
52
+ | RequestTimeoutError
53
+ | InvalidRequestError
54
+ | UnexpectedClientError
55
+ | SDKValidationError
56
+ >
57
+ > {
58
+ return new APIPromise($do(
59
+ client,
60
+ request,
61
+ options,
62
+ ));
63
+ }
64
+
65
+ async function $do(
66
+ client: MaesnCore,
67
+ request: operations.UpdateJournalEntryRequest,
68
+ options?: RequestOptions,
69
+ ): Promise<
70
+ [
71
+ Result<
72
+ operations.UpdateJournalEntryResponse,
73
+ | MaesnError
74
+ | ResponseValidationError
75
+ | ConnectionError
76
+ | RequestAbortedError
77
+ | RequestTimeoutError
78
+ | InvalidRequestError
79
+ | UnexpectedClientError
80
+ | SDKValidationError
81
+ >,
82
+ APICall,
83
+ ]
84
+ > {
85
+ const parsed = safeParse(
86
+ request,
87
+ (value) =>
88
+ z.parse(operations.UpdateJournalEntryRequest$outboundSchema, value),
89
+ "Input validation failed",
90
+ );
91
+ if (!parsed.ok) {
92
+ return [parsed, { status: "invalid" }];
93
+ }
94
+ const payload = parsed.value;
95
+ const body = new FormData();
96
+
97
+ if (payload.body.files !== undefined) {
98
+ for (const fileItem of payload.body.files ?? []) {
99
+ if (isBlobLike(fileItem)) {
100
+ const file = fileItem;
101
+ const blob = await normalizeBlob(file);
102
+ const name = "name" in file ? (file.name as string) : undefined;
103
+ appendForm(body, "files", blob, name);
104
+ } else if (isReadableStream(fileItem.content)) {
105
+ const buffer = await readableStreamToArrayBuffer(fileItem.content);
106
+ const contentType = getContentTypeFromFileName(fileItem.fileName)
107
+ || "application/octet-stream";
108
+ appendForm(
109
+ body,
110
+ "files",
111
+ bytesToBlob(buffer, contentType),
112
+ fileItem.fileName,
113
+ );
114
+ } else {
115
+ const contentType = getContentTypeFromFileName(fileItem.fileName)
116
+ || "application/octet-stream";
117
+ appendForm(
118
+ body,
119
+ "files",
120
+ bytesToBlob(fileItem.content, contentType),
121
+ fileItem.fileName,
122
+ );
123
+ }
124
+ }
125
+ }
126
+ if (payload.body.journal_entry !== undefined) {
127
+ appendForm(
128
+ body,
129
+ "journal_entry",
130
+ encodeJSON("journal_entry", payload.body.journal_entry, {
131
+ explode: true,
132
+ }),
133
+ );
134
+ }
135
+
136
+ const pathParams = {
137
+ journalEntryId: encodeSimple("journalEntryId", payload.journalEntryId, {
138
+ explode: false,
139
+ charEncoding: "percent",
140
+ }),
141
+ };
142
+ const path = pathToFunc("/accounting/journalEntries/{journalEntryId}")(
143
+ pathParams,
144
+ );
145
+
146
+ const query = encodeFormQuery({
147
+ "companyId": payload.companyId,
148
+ });
149
+
150
+ const headers = new Headers(compactMap({
151
+ Accept: "application/json",
152
+ "X-ACCOUNT-KEY": encodeSimple(
153
+ "X-ACCOUNT-KEY",
154
+ payload.accountKey ?? client._options.accountKey,
155
+ { explode: false, charEncoding: "none" },
156
+ ),
157
+ "X-API-KEY": encodeSimple(
158
+ "X-API-KEY",
159
+ payload.apiKey ?? client._options.apiKey,
160
+ { explode: false, charEncoding: "none" },
161
+ ),
162
+ }));
163
+
164
+ const context = {
165
+ options: client._options,
166
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
167
+ operationID: "updateJournalEntry",
168
+ oAuth2Scopes: null,
169
+
170
+ resolvedSecurity: null,
171
+
172
+ securitySource: null,
173
+ retryConfig: options?.retries
174
+ || client._options.retryConfig
175
+ || { strategy: "none" },
176
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
177
+ };
178
+
179
+ const requestRes = client._createRequest(context, {
180
+ method: "PUT",
181
+ baseURL: options?.serverURL,
182
+ path: path,
183
+ headers: headers,
184
+ query: query,
185
+ body: body,
186
+ userAgent: client._options.userAgent,
187
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
188
+ }, options);
189
+ if (!requestRes.ok) {
190
+ return [requestRes, { status: "invalid" }];
191
+ }
192
+ const req = requestRes.value;
193
+
194
+ const doResult = await client._do(req, {
195
+ context,
196
+ isErrorStatusCode: (statusCode: number) =>
197
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
198
+ retryConfig: context.retryConfig,
199
+ retryCodes: context.retryCodes,
200
+ });
201
+ if (!doResult.ok) {
202
+ return [doResult, { status: "request-error", request: req }];
203
+ }
204
+ const response = doResult.value;
205
+
206
+ const [result] = await M.match<
207
+ operations.UpdateJournalEntryResponse,
208
+ | MaesnError
209
+ | ResponseValidationError
210
+ | ConnectionError
211
+ | RequestAbortedError
212
+ | RequestTimeoutError
213
+ | InvalidRequestError
214
+ | UnexpectedClientError
215
+ | SDKValidationError
216
+ >(
217
+ M.json(200, operations.UpdateJournalEntryResponse$inboundSchema),
218
+ M.fail("4XX"),
219
+ M.fail("5XX"),
220
+ )(response, req);
221
+ if (!result.ok) {
222
+ return [result, { status: "complete", request: req, response }];
223
+ }
224
+
225
+ return [result, { status: "complete", request: req, response }];
226
+ }
package/src/lib/config.ts CHANGED
@@ -51,8 +51,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
51
51
  export const SDK_METADATA = {
52
52
  language: "typescript",
53
53
  openapiDocVersion: "1.0",
54
- sdkVersion: "0.8.11",
55
- genVersion: "2.924.0",
54
+ sdkVersion: "0.8.15",
55
+ genVersion: "2.933.0",
56
56
  userAgent:
57
- "speakeasy-sdk/typescript 0.8.11 2.924.0 1.0 @maesn/typescript-sdk",
57
+ "speakeasy-sdk/typescript 0.8.15 2.933.0 1.0 @maesn/typescript-sdk",
58
58
  } as const;
@@ -12,10 +12,41 @@ export class EncodingError extends Error {
12
12
  }
13
13
  }
14
14
 
15
+ export type CharEncoding = "percent" | "percentExceptReserved" | "none";
16
+
17
+ const reservedEscapes = /%(2[346bcf]|3[abdf]|40|5[bd])/gi;
18
+
19
+ function encodeKeyChars(
20
+ v: string,
21
+ charEncoding: CharEncoding | undefined,
22
+ ): string {
23
+ return encodeChars(
24
+ v,
25
+ charEncoding === "percentExceptReserved" ? "percent" : charEncoding,
26
+ );
27
+ }
28
+
29
+ function encodeChars(
30
+ v: string,
31
+ charEncoding: CharEncoding | undefined,
32
+ ): string {
33
+ switch (charEncoding) {
34
+ case "percent":
35
+ return encodeURIComponent(v);
36
+ case "percentExceptReserved":
37
+ return encodeURIComponent(v).replace(
38
+ reservedEscapes,
39
+ (m) => decodeURIComponent(m),
40
+ );
41
+ default:
42
+ return v;
43
+ }
44
+ }
45
+
15
46
  export function encodeMatrix(
16
47
  key: string,
17
48
  value: unknown,
18
- options?: { explode?: boolean; charEncoding?: "percent" | "none" },
49
+ options?: { explode?: boolean; charEncoding?: CharEncoding },
19
50
  ): string | undefined {
20
51
  let out = "";
21
52
  const pairs: [string, unknown][] = options?.explode
@@ -27,7 +58,7 @@ export function encodeMatrix(
27
58
  }
28
59
 
29
60
  const encodeString = (v: string) => {
30
- return options?.charEncoding === "percent" ? encodeURIComponent(v) : v;
61
+ return encodeChars(v, options?.charEncoding);
31
62
  };
32
63
  const encodeValue = (v: unknown) => encodeString(serializeValue(v));
33
64
 
@@ -52,7 +83,7 @@ export function encodeMatrix(
52
83
  return;
53
84
  }
54
85
 
55
- const keyPrefix = encodeString(pk);
86
+ const keyPrefix = encodeKeyChars(pk, options?.charEncoding);
56
87
  tmp = `${keyPrefix}=${encValue}`;
57
88
  // trim trailing '=' if value was empty
58
89
  if (tmp === `${keyPrefix}=`) {
@@ -73,7 +104,7 @@ export function encodeMatrix(
73
104
  export function encodeLabel(
74
105
  key: string,
75
106
  value: unknown,
76
- options?: { explode?: boolean; charEncoding?: "percent" | "none" },
107
+ options?: { explode?: boolean; charEncoding?: CharEncoding },
77
108
  ): string | undefined {
78
109
  let out = "";
79
110
  const pairs: [string, unknown][] = options?.explode
@@ -85,7 +116,7 @@ export function encodeLabel(
85
116
  }
86
117
 
87
118
  const encodeString = (v: string) => {
88
- return options?.charEncoding === "percent" ? encodeURIComponent(v) : v;
119
+ return encodeChars(v, options?.charEncoding);
89
120
  };
90
121
  const encodeValue = (v: unknown) => encodeString(serializeValue(v));
91
122
 
@@ -103,7 +134,7 @@ export function encodeLabel(
103
134
  encValue = mapped?.join("").slice(1);
104
135
  } else {
105
136
  const k = options?.explode && isPlainObject(value)
106
- ? `${encodeString(pk)}=`
137
+ ? `${encodeKeyChars(pk, options?.charEncoding)}=`
107
138
  : "";
108
139
  encValue = `${k}${encodeValue(pv)}`;
109
140
  }
@@ -117,14 +148,14 @@ export function encodeLabel(
117
148
  type FormEncoder = (
118
149
  key: string,
119
150
  value: unknown,
120
- options?: { explode?: boolean; charEncoding?: "percent" | "none" },
151
+ options?: { explode?: boolean; charEncoding?: CharEncoding },
121
152
  ) => string | undefined;
122
153
 
123
154
  function formEncoder(sep: string): FormEncoder {
124
155
  return (
125
156
  key: string,
126
157
  value: unknown,
127
- options?: { explode?: boolean; charEncoding?: "percent" | "none" },
158
+ options?: { explode?: boolean; charEncoding?: CharEncoding },
128
159
  ) => {
129
160
  let out = "";
130
161
  const pairs: [string, unknown][] = options?.explode
@@ -136,7 +167,7 @@ function formEncoder(sep: string): FormEncoder {
136
167
  }
137
168
 
138
169
  const encodeString = (v: string) => {
139
- return options?.charEncoding === "percent" ? encodeURIComponent(v) : v;
170
+ return encodeChars(v, options?.charEncoding);
140
171
  };
141
172
 
142
173
  const encodeValue = (v: unknown) => encodeString(serializeValue(v));
@@ -163,7 +194,7 @@ function formEncoder(sep: string): FormEncoder {
163
194
  return;
164
195
  }
165
196
 
166
- tmp = `${encodeString(pk)}=${encValue}`;
197
+ tmp = `${encodeKeyChars(pk, options?.charEncoding)}=${encValue}`;
167
198
 
168
199
  // If we end up with the nothing then skip forward
169
200
  if (!tmp || tmp === "=") {
@@ -184,7 +215,7 @@ export const encodePipeDelimited = formEncoder("|");
184
215
  export function encodeBodyForm(
185
216
  key: string,
186
217
  value: unknown,
187
- options?: { explode?: boolean; charEncoding?: "percent" | "none" },
218
+ options?: { explode?: boolean; charEncoding?: CharEncoding },
188
219
  ): string {
189
220
  let out = "";
190
221
  const pairs: [string, unknown][] = options?.explode
@@ -192,7 +223,7 @@ export function encodeBodyForm(
192
223
  : [[key, value]];
193
224
 
194
225
  const encodeString = (v: string) => {
195
- return options?.charEncoding === "percent" ? encodeURIComponent(v) : v;
226
+ return encodeChars(v, options?.charEncoding);
196
227
  };
197
228
 
198
229
  const encodeValue = (v: unknown) => encodeString(serializeValue(v));
@@ -211,7 +242,7 @@ export function encodeBodyForm(
211
242
  encValue = `${encodeValue(pv)}`;
212
243
  }
213
244
 
214
- tmp = `${encodeString(pk)}=${encValue}`;
245
+ tmp = `${encodeKeyChars(pk, options?.charEncoding)}=${encValue}`;
215
246
 
216
247
  // If we end up with the nothing then skip forward
217
248
  if (!tmp || tmp === "=") {
@@ -227,7 +258,7 @@ export function encodeBodyForm(
227
258
  export function encodeDeepObject(
228
259
  key: string,
229
260
  value: unknown,
230
- options?: { charEncoding?: "percent" | "none" },
261
+ options?: { charEncoding?: CharEncoding },
231
262
  ): string | undefined {
232
263
  if (value == null) {
233
264
  return;
@@ -245,7 +276,7 @@ export function encodeDeepObject(
245
276
  export function encodeDeepObjectObject(
246
277
  key: string,
247
278
  value: unknown,
248
- options?: { charEncoding?: "percent" | "none" },
279
+ options?: { charEncoding?: CharEncoding },
249
280
  ): string | undefined {
250
281
  if (value == null) {
251
282
  return;
@@ -254,7 +285,7 @@ export function encodeDeepObjectObject(
254
285
  let out = "";
255
286
 
256
287
  const encodeString = (v: string) => {
257
- return options?.charEncoding === "percent" ? encodeURIComponent(v) : v;
288
+ return encodeChars(v, options?.charEncoding);
258
289
  };
259
290
 
260
291
  if (!isPlainObject(value)) {
@@ -278,7 +309,9 @@ export function encodeDeepObjectObject(
278
309
 
279
310
  const pairs: unknown[] = Array.isArray(cv) ? cv : [cv];
280
311
  const encoded = mapDefined(pairs, (v) => {
281
- return `${encodeString(pk)}=${encodeString(serializeValue(v))}`;
312
+ return `${encodeKeyChars(pk, options?.charEncoding)}=${
313
+ encodeString(serializeValue(v))
314
+ }`;
282
315
  })?.join("&");
283
316
 
284
317
  out += encoded == null ? "" : `&${encoded}`;
@@ -290,25 +323,27 @@ export function encodeDeepObjectObject(
290
323
  export function encodeJSON(
291
324
  key: string,
292
325
  value: unknown,
293
- options?: { explode?: boolean; charEncoding?: "percent" | "none" },
326
+ options?: { explode?: boolean; charEncoding?: CharEncoding },
294
327
  ): string | undefined {
295
328
  if (typeof value === "undefined") {
296
329
  return;
297
330
  }
298
331
 
299
332
  const encodeString = (v: string) => {
300
- return options?.charEncoding === "percent" ? encodeURIComponent(v) : v;
333
+ return encodeChars(v, options?.charEncoding);
301
334
  };
302
335
 
303
336
  const encVal = encodeString(JSON.stringify(value, jsonReplacer));
304
337
 
305
- return options?.explode ? encVal : `${encodeString(key)}=${encVal}`;
338
+ return options?.explode
339
+ ? encVal
340
+ : `${encodeKeyChars(key, options?.charEncoding)}=${encVal}`;
306
341
  }
307
342
 
308
343
  export const encodeSimple = (
309
344
  key: string,
310
345
  value: unknown,
311
- options?: { explode?: boolean; charEncoding?: "percent" | "none" },
346
+ options?: { explode?: boolean; charEncoding?: CharEncoding },
312
347
  ): string | undefined => {
313
348
  let out = "";
314
349
  const pairs: [string, unknown][] = options?.explode
@@ -320,7 +355,7 @@ export const encodeSimple = (
320
355
  }
321
356
 
322
357
  const encodeString = (v: string) => {
323
- return options?.charEncoding === "percent" ? encodeURIComponent(v) : v;
358
+ return encodeChars(v, options?.charEncoding);
324
359
  };
325
360
  const encodeValue = (v: unknown) => encodeString(serializeValue(v));
326
361
 
@@ -426,7 +461,7 @@ export function queryJoin(...args: (string | undefined)[]): string {
426
461
 
427
462
  type QueryEncoderOptions = {
428
463
  explode?: boolean;
429
- charEncoding?: "percent" | "none";
464
+ charEncoding?: CharEncoding;
430
465
  allowEmptyValue?: string[];
431
466
  };
432
467
 
@@ -198,6 +198,13 @@ export type AccountResponseDtoStatus = ClosedEnum<
198
198
  typeof AccountResponseDtoStatus
199
199
  >;
200
200
 
201
+ export type AccountResponseDtoTaxRate = {
202
+ id: string | null;
203
+ code: string | null;
204
+ name: string | null;
205
+ percentage: number | null;
206
+ };
207
+
201
208
  export type AccountResponseDto = {
202
209
  id: string | null;
203
210
  balance: number | null;
@@ -211,6 +218,7 @@ export type AccountResponseDto = {
211
218
  number: string | null;
212
219
  parentAccountId: string | null;
213
220
  status: AccountResponseDtoStatus | null;
221
+ taxRate: AccountResponseDtoTaxRate | null;
214
222
  type: string | null;
215
223
  updatedDate: string | null;
216
224
  };
@@ -236,6 +244,27 @@ export const AccountResponseDtoStatus$inboundSchema: z.ZodMiniEnum<
236
244
  typeof AccountResponseDtoStatus
237
245
  > = z.enum(AccountResponseDtoStatus);
238
246
 
247
+ /** @internal */
248
+ export const AccountResponseDtoTaxRate$inboundSchema: z.ZodMiniType<
249
+ AccountResponseDtoTaxRate,
250
+ unknown
251
+ > = z.object({
252
+ id: types.nullable(types.string()),
253
+ code: types.nullable(types.string()),
254
+ name: types.nullable(types.string()),
255
+ percentage: types.nullable(types.number()),
256
+ });
257
+
258
+ export function accountResponseDtoTaxRateFromJSON(
259
+ jsonString: string,
260
+ ): SafeParseResult<AccountResponseDtoTaxRate, SDKValidationError> {
261
+ return safeParse(
262
+ jsonString,
263
+ (x) => AccountResponseDtoTaxRate$inboundSchema.parse(JSON.parse(x)),
264
+ `Failed to parse 'AccountResponseDtoTaxRate' from JSON`,
265
+ );
266
+ }
267
+
239
268
  /** @internal */
240
269
  export const AccountResponseDto$inboundSchema: z.ZodMiniType<
241
270
  AccountResponseDto,
@@ -255,6 +284,9 @@ export const AccountResponseDto$inboundSchema: z.ZodMiniType<
255
284
  number: types.nullable(types.string()),
256
285
  parentAccountId: types.nullable(types.string()),
257
286
  status: types.nullable(AccountResponseDtoStatus$inboundSchema),
287
+ taxRate: types.nullable(
288
+ z.lazy(() => AccountResponseDtoTaxRate$inboundSchema),
289
+ ),
258
290
  type: types.nullable(types.string()),
259
291
  updatedDate: types.nullable(types.string()),
260
292
  });
@@ -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
+ TaxRateRequestCommonDto,
9
+ TaxRateRequestCommonDto$Outbound,
10
+ TaxRateRequestCommonDto$outboundSchema,
11
+ } from "./tax-rate-request-common-dto.js";
7
12
 
8
13
  export const CreateAccountRequestDtoClass = {
9
14
  Asset: "ASSET",
@@ -266,6 +271,7 @@ export type CreateAccountRequestDto = {
266
271
  number?: string | undefined;
267
272
  parentAccountId?: string | undefined;
268
273
  status?: CreateAccountRequestDtoStatus | undefined;
274
+ taxRate?: TaxRateRequestCommonDto | undefined;
269
275
  type?: CreateAccountRequestDtoType | undefined;
270
276
  };
271
277
 
@@ -300,6 +306,7 @@ export type CreateAccountRequestDto$Outbound = {
300
306
  number?: string | undefined;
301
307
  parentAccountId?: string | undefined;
302
308
  status?: string | undefined;
309
+ taxRate?: TaxRateRequestCommonDto$Outbound | undefined;
303
310
  type?: string | undefined;
304
311
  };
305
312
 
@@ -317,6 +324,7 @@ export const CreateAccountRequestDto$outboundSchema: z.ZodMiniType<
317
324
  number: z.optional(z.string()),
318
325
  parentAccountId: z.optional(z.string()),
319
326
  status: z.optional(CreateAccountRequestDtoStatus$outboundSchema),
327
+ taxRate: z.optional(TaxRateRequestCommonDto$outboundSchema),
320
328
  type: z.optional(CreateAccountRequestDtoType$outboundSchema),
321
329
  });
322
330
 
@@ -63,6 +63,7 @@ export type CreateBookingProposalRequestDtoV2 = {
63
63
  paymentTermId?: string | undefined;
64
64
  status?: CreateBookingProposalRequestDtoV2Status | undefined;
65
65
  totalGrossAmount?: number | undefined;
66
+ useCollectiveContact?: boolean | undefined;
66
67
  vatId?: string | undefined;
67
68
  };
68
69
 
@@ -96,6 +97,7 @@ export type CreateBookingProposalRequestDtoV2$Outbound = {
96
97
  paymentTermId?: string | undefined;
97
98
  status?: string | undefined;
98
99
  totalGrossAmount?: number | undefined;
100
+ useCollectiveContact?: boolean | undefined;
99
101
  vatId?: string | undefined;
100
102
  };
101
103
 
@@ -130,6 +132,7 @@ export const CreateBookingProposalRequestDtoV2$outboundSchema: z.ZodMiniType<
130
132
  paymentTermId: z.optional(z.string()),
131
133
  status: z.optional(CreateBookingProposalRequestDtoV2Status$outboundSchema),
132
134
  totalGrossAmount: z.optional(z.number()),
135
+ useCollectiveContact: z.optional(z.boolean()),
133
136
  vatId: z.optional(z.string()),
134
137
  });
135
138
 
@@ -43,6 +43,7 @@ export type CreateBookingProposalRequestDto = {
43
43
  paymentTermsId?: string | undefined;
44
44
  status?: string | undefined;
45
45
  totalGrossAmount?: number | undefined;
46
+ useCollectiveContact?: boolean | undefined;
46
47
  vatId?: string | undefined;
47
48
  };
48
49
 
@@ -76,6 +77,7 @@ export type CreateBookingProposalRequestDto$Outbound = {
76
77
  paymentTermsId?: string | undefined;
77
78
  status?: string | undefined;
78
79
  totalGrossAmount?: number | undefined;
80
+ useCollectiveContact?: boolean | undefined;
79
81
  vatId?: string | undefined;
80
82
  };
81
83
 
@@ -112,6 +114,7 @@ export const CreateBookingProposalRequestDto$outboundSchema: z.ZodMiniType<
112
114
  paymentTermsId: z.optional(z.string()),
113
115
  status: z.optional(z.string()),
114
116
  totalGrossAmount: z.optional(z.number()),
117
+ useCollectiveContact: z.optional(z.boolean()),
115
118
  vatId: z.optional(z.string()),
116
119
  });
117
120
 
@@ -229,6 +229,7 @@ export type CreateJournalEntryRequestDto = {
229
229
  recordType?: CreateJournalEntryRequestDtoRecordType | undefined;
230
230
  taxAssignmentDate?: string | undefined;
231
231
  transactionDate?: string | undefined;
232
+ version?: string | undefined;
232
233
  };
233
234
 
234
235
  /** @internal */
@@ -275,6 +276,7 @@ export type CreateJournalEntryRequestDto$Outbound = {
275
276
  recordType?: string | undefined;
276
277
  taxAssignmentDate?: string | undefined;
277
278
  transactionDate?: string | undefined;
279
+ version?: string | undefined;
278
280
  };
279
281
 
280
282
  /** @internal */
@@ -306,6 +308,7 @@ export const CreateJournalEntryRequestDto$outboundSchema: z.ZodMiniType<
306
308
  recordType: z.optional(CreateJournalEntryRequestDtoRecordType$outboundSchema),
307
309
  taxAssignmentDate: z.optional(z.string()),
308
310
  transactionDate: z.optional(z.string()),
311
+ version: z.optional(z.string()),
309
312
  });
310
313
 
311
314
  export function createJournalEntryRequestDtoToJSON(
@@ -13,6 +13,7 @@ export const CreateOfferLineItemRequestDtoType = {
13
13
  Value: "VALUE",
14
14
  FixedAsset: "FIXED_ASSET",
15
15
  Charge: "CHARGE",
16
+ Service: "SERVICE",
16
17
  } as const;
17
18
  export type CreateOfferLineItemRequestDtoType = ClosedEnum<
18
19
  typeof CreateOfferLineItemRequestDtoType
@@ -31,6 +31,7 @@ export type CreateOfferRequestDto = {
31
31
  addresses: Array<AddressOffer>;
32
32
  contactId?: string | undefined;
33
33
  currency: string;
34
+ expirationDate?: string | undefined;
34
35
  lineItems?: Array<CreateOfferLineItemRequestDto> | undefined;
35
36
  name?: string | undefined;
36
37
  offerDate: string;
@@ -56,6 +57,7 @@ export type CreateOfferRequestDto$Outbound = {
56
57
  addresses: Array<AddressOffer$Outbound>;
57
58
  contactId?: string | undefined;
58
59
  currency: string;
60
+ expirationDate?: string | undefined;
59
61
  lineItems?: Array<CreateOfferLineItemRequestDto$Outbound> | undefined;
60
62
  name?: string | undefined;
61
63
  offerDate: string;
@@ -79,6 +81,7 @@ export const CreateOfferRequestDto$outboundSchema: z.ZodMiniType<
79
81
  addresses: z.array(AddressOffer$outboundSchema),
80
82
  contactId: z.optional(z.string()),
81
83
  currency: z.string(),
84
+ expirationDate: z.optional(z.string()),
82
85
  lineItems: z.optional(z.array(CreateOfferLineItemRequestDto$outboundSchema)),
83
86
  name: z.optional(z.string()),
84
87
  offerDate: z.string(),