@maesn/typescript-sdk 0.8.17 → 0.8.19
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-get-dimensions.js +0 -2
- package/esm/funcs/accounting-get-dimensions.js.map +1 -1
- package/esm/funcs/accounting-patch-journal-entry.d.ts +11 -0
- package/esm/funcs/accounting-patch-journal-entry.d.ts.map +1 -0
- package/esm/funcs/accounting-patch-journal-entry.js +109 -0
- package/esm/funcs/accounting-patch-journal-entry.js.map +1 -0
- package/esm/funcs/accounting-post-file-async.js +3 -0
- package/esm/funcs/accounting-post-file-async.js.map +1 -1
- package/esm/funcs/accounting-post-file.js +3 -0
- package/esm/funcs/accounting-post-file.js.map +1 -1
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/lib/config.js.map +1 -1
- package/esm/models/create-contact-by-batch-meta-data-dto.d.ts +1 -0
- package/esm/models/create-contact-by-batch-meta-data-dto.d.ts.map +1 -1
- package/esm/models/create-contact-by-batch-meta-data-dto.js +1 -0
- package/esm/models/create-contact-by-batch-meta-data-dto.js.map +1 -1
- package/esm/models/create-journal-entries-by-batch-meta-data-dto.d.ts +1 -0
- package/esm/models/create-journal-entries-by-batch-meta-data-dto.d.ts.map +1 -1
- package/esm/models/create-journal-entries-by-batch-meta-data-dto.js +1 -0
- package/esm/models/create-journal-entries-by-batch-meta-data-dto.js.map +1 -1
- package/esm/models/fiscal-year-response-dto.d.ts +2 -1
- package/esm/models/fiscal-year-response-dto.d.ts.map +1 -1
- package/esm/models/fiscal-year-response-dto.js +2 -1
- package/esm/models/fiscal-year-response-dto.js.map +1 -1
- package/esm/models/index.d.ts +0 -1
- package/esm/models/index.d.ts.map +1 -1
- package/esm/models/index.js +0 -1
- package/esm/models/index.js.map +1 -1
- package/esm/models/operations/get-dimensions.d.ts +2 -17
- package/esm/models/operations/get-dimensions.d.ts.map +1 -1
- package/esm/models/operations/get-dimensions.js +1 -12
- package/esm/models/operations/get-dimensions.js.map +1 -1
- 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/patch-journal-entry.d.ts +96 -0
- package/esm/models/operations/patch-journal-entry.d.ts.map +1 -0
- package/esm/models/operations/patch-journal-entry.js +83 -0
- package/esm/models/operations/patch-journal-entry.js.map +1 -0
- package/esm/models/operations/post-file-async.d.ts +2 -0
- package/esm/models/operations/post-file-async.d.ts.map +1 -1
- package/esm/models/operations/post-file-async.js +1 -0
- package/esm/models/operations/post-file-async.js.map +1 -1
- package/esm/models/operations/post-file.d.ts +2 -0
- package/esm/models/operations/post-file.d.ts.map +1 -1
- package/esm/models/operations/post-file.js +1 -0
- package/esm/models/operations/post-file.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/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/accounting-get-dimensions.ts +0 -2
- package/src/funcs/accounting-patch-journal-entry.ts +226 -0
- package/src/funcs/accounting-post-file-async.ts +3 -0
- package/src/funcs/accounting-post-file.ts +3 -0
- package/src/lib/config.ts +3 -3
- package/src/models/create-contact-by-batch-meta-data-dto.ts +1 -0
- package/src/models/create-journal-entries-by-batch-meta-data-dto.ts +1 -0
- package/src/models/fiscal-year-response-dto.ts +2 -1
- package/src/models/index.ts +0 -1
- package/src/models/operations/get-dimensions.ts +3 -24
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/patch-journal-entry.ts +259 -0
- package/src/models/operations/post-file-async.ts +3 -0
- package/src/models/operations/post-file.ts +3 -0
- package/src/sdk/accounting.ts +12 -0
- package/esm/models/dimension-response-dto.d.ts +0 -15
- package/esm/models/dimension-response-dto.d.ts.map +0 -1
- package/esm/models/dimension-response-dto.js +0 -19
- package/esm/models/dimension-response-dto.js.map +0 -1
- package/src/models/dimension-response-dto.ts +0 -41
package/package.json
CHANGED
|
@@ -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 accountingPatchJournalEntry(
|
|
42
|
+
client: MaesnCore,
|
|
43
|
+
request: operations.PatchJournalEntryRequest,
|
|
44
|
+
options?: RequestOptions,
|
|
45
|
+
): APIPromise<
|
|
46
|
+
Result<
|
|
47
|
+
operations.PatchJournalEntryResponse,
|
|
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.PatchJournalEntryRequest,
|
|
68
|
+
options?: RequestOptions,
|
|
69
|
+
): Promise<
|
|
70
|
+
[
|
|
71
|
+
Result<
|
|
72
|
+
operations.PatchJournalEntryResponse,
|
|
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.PatchJournalEntryRequest$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: "patchJournalEntry",
|
|
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: "PATCH",
|
|
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.PatchJournalEntryResponse,
|
|
208
|
+
| MaesnError
|
|
209
|
+
| ResponseValidationError
|
|
210
|
+
| ConnectionError
|
|
211
|
+
| RequestAbortedError
|
|
212
|
+
| RequestTimeoutError
|
|
213
|
+
| InvalidRequestError
|
|
214
|
+
| UnexpectedClientError
|
|
215
|
+
| SDKValidationError
|
|
216
|
+
>(
|
|
217
|
+
M.json(200, operations.PatchJournalEntryResponse$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
|
+
}
|
|
@@ -130,6 +130,9 @@ async function $do(
|
|
|
130
130
|
);
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
|
+
if (payload.body.folderName !== undefined) {
|
|
134
|
+
appendForm(body, "folderName", payload.body.folderName);
|
|
135
|
+
}
|
|
133
136
|
if (payload.body.integrationSource !== undefined) {
|
|
134
137
|
appendForm(body, "integrationSource", payload.body.integrationSource);
|
|
135
138
|
}
|
|
@@ -133,6 +133,9 @@ async function $do(
|
|
|
133
133
|
);
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
|
+
if (payload.body.folderName !== undefined) {
|
|
137
|
+
appendForm(body, "folderName", payload.body.folderName);
|
|
138
|
+
}
|
|
136
139
|
if (payload.body.integrationSource !== undefined) {
|
|
137
140
|
appendForm(body, "integrationSource", payload.body.integrationSource);
|
|
138
141
|
}
|
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.
|
|
55
|
-
genVersion: "2.
|
|
54
|
+
sdkVersion: "0.8.19",
|
|
55
|
+
genVersion: "2.937.18",
|
|
56
56
|
userAgent:
|
|
57
|
-
"speakeasy-sdk/typescript 0.8.
|
|
57
|
+
"speakeasy-sdk/typescript 0.8.19 2.937.18 1.0 @maesn/typescript-sdk",
|
|
58
58
|
} as const;
|
|
@@ -19,9 +19,10 @@ export type AvailableLedger = ClosedEnum<typeof AvailableLedger>;
|
|
|
19
19
|
export const FiscalYearResponseDtoChartOfAccount = {
|
|
20
20
|
Skr03: "SKR03",
|
|
21
21
|
Skr04: "SKR04",
|
|
22
|
+
Skr07: "SKR07",
|
|
23
|
+
Skr42: "SKR42",
|
|
22
24
|
Skr51: "SKR51",
|
|
23
25
|
Skr14: "SKR14",
|
|
24
|
-
Skr42: "SKR42",
|
|
25
26
|
} as const;
|
|
26
27
|
export type FiscalYearResponseDtoChartOfAccount = ClosedEnum<
|
|
27
28
|
typeof FiscalYearResponseDtoChartOfAccount
|
package/src/models/index.ts
CHANGED
|
@@ -85,7 +85,6 @@ export * from "./dimension-input.js";
|
|
|
85
85
|
export * from "./dimension-meta-response-dto.js";
|
|
86
86
|
export * from "./dimension-request-common-dto-v2.js";
|
|
87
87
|
export * from "./dimension-response-common-dto-v2.js";
|
|
88
|
-
export * from "./dimension-response-dto.js";
|
|
89
88
|
export * from "./dimension.js";
|
|
90
89
|
export * from "./discount-period-request.js";
|
|
91
90
|
export * from "./discount-period-response.js";
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v4-mini";
|
|
6
6
|
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
-
import { ClosedEnum } from "../../types/enums.js";
|
|
8
7
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
8
|
import * as types from "../../types/primitives.js";
|
|
10
9
|
import { SDKValidationError } from "../errors/sdk-validation-error.js";
|
|
@@ -15,18 +14,7 @@ export type GetDimensionsGlobals = {
|
|
|
15
14
|
accountKey?: string | undefined;
|
|
16
15
|
};
|
|
17
16
|
|
|
18
|
-
export const GetDimensionsLimit = {
|
|
19
|
-
Five: 5,
|
|
20
|
-
Ten: 10,
|
|
21
|
-
Twenty: 20,
|
|
22
|
-
Fifty: 50,
|
|
23
|
-
OneHundred: 100,
|
|
24
|
-
} as const;
|
|
25
|
-
export type GetDimensionsLimit = ClosedEnum<typeof GetDimensionsLimit>;
|
|
26
|
-
|
|
27
17
|
export type GetDimensionsRequest = {
|
|
28
|
-
page?: number | undefined;
|
|
29
|
-
limit?: GetDimensionsLimit | undefined;
|
|
30
18
|
/**
|
|
31
19
|
* ISO 8601 timestamp; only records modified after this date are returned
|
|
32
20
|
*/
|
|
@@ -70,24 +58,17 @@ export type GetDimensionsErrors = {};
|
|
|
70
58
|
export type GetDimensionsRawData = {};
|
|
71
59
|
|
|
72
60
|
/**
|
|
73
|
-
* List of
|
|
61
|
+
* List of dimension categories for the authenticated end user's connected target system
|
|
74
62
|
*/
|
|
75
63
|
export type GetDimensionsResponse = {
|
|
76
64
|
meta?: GetDimensionsMeta | null | undefined;
|
|
77
|
-
data: Array<models.
|
|
65
|
+
data: Array<models.DimensionMetaResponseDto>;
|
|
78
66
|
errors: GetDimensionsErrors | null;
|
|
79
67
|
rawData: GetDimensionsRawData | null;
|
|
80
68
|
};
|
|
81
69
|
|
|
82
|
-
/** @internal */
|
|
83
|
-
export const GetDimensionsLimit$outboundSchema: z.ZodMiniEnum<
|
|
84
|
-
typeof GetDimensionsLimit
|
|
85
|
-
> = z.enum(GetDimensionsLimit);
|
|
86
|
-
|
|
87
70
|
/** @internal */
|
|
88
71
|
export type GetDimensionsRequest$Outbound = {
|
|
89
|
-
page?: number | undefined;
|
|
90
|
-
limit?: number | undefined;
|
|
91
72
|
lastModifiedAt?: string | undefined;
|
|
92
73
|
environmentName?: string | undefined;
|
|
93
74
|
companyId?: string | undefined;
|
|
@@ -101,8 +82,6 @@ export const GetDimensionsRequest$outboundSchema: z.ZodMiniType<
|
|
|
101
82
|
GetDimensionsRequest$Outbound,
|
|
102
83
|
GetDimensionsRequest
|
|
103
84
|
> = z.object({
|
|
104
|
-
page: z.optional(z.number()),
|
|
105
|
-
limit: z.optional(GetDimensionsLimit$outboundSchema),
|
|
106
85
|
lastModifiedAt: z.optional(z.string()),
|
|
107
86
|
environmentName: z.optional(z.string()),
|
|
108
87
|
companyId: z.optional(z.string()),
|
|
@@ -199,7 +178,7 @@ export const GetDimensionsResponse$inboundSchema: z.ZodMiniType<
|
|
|
199
178
|
unknown
|
|
200
179
|
> = z.object({
|
|
201
180
|
meta: z.optional(z.nullable(z.lazy(() => GetDimensionsMeta$inboundSchema))),
|
|
202
|
-
data: z.array(models.
|
|
181
|
+
data: z.array(models.DimensionMetaResponseDto$inboundSchema),
|
|
203
182
|
errors: types.nullable(z.lazy(() => GetDimensionsErrors$inboundSchema)),
|
|
204
183
|
rawData: types.nullable(z.lazy(() => GetDimensionsRawData$inboundSchema)),
|
|
205
184
|
});
|
|
@@ -146,6 +146,7 @@ export * from "./patch-contact.js";
|
|
|
146
146
|
export * from "./patch-customers.js";
|
|
147
147
|
export * from "./patch-invoice.js";
|
|
148
148
|
export * from "./patch-item.js";
|
|
149
|
+
export * from "./patch-journal-entry.js";
|
|
149
150
|
export * from "./patch-line-item.js";
|
|
150
151
|
export * from "./patch-supplier.js";
|
|
151
152
|
export * from "./post-file-async.js";
|
|
@@ -0,0 +1,259 @@
|
|
|
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 { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import * as types from "../../types/primitives.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdk-validation-error.js";
|
|
11
|
+
import * as models from "../index.js";
|
|
12
|
+
|
|
13
|
+
export type PatchJournalEntryGlobals = {
|
|
14
|
+
apiKey?: string | undefined;
|
|
15
|
+
accountKey?: string | undefined;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type PatchJournalEntryFile = {
|
|
19
|
+
fileName: string;
|
|
20
|
+
content: ReadableStream<Uint8Array> | Blob | ArrayBuffer | Uint8Array;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export type PatchJournalEntryRequestBody = {
|
|
24
|
+
files?: Array<PatchJournalEntryFile> | undefined;
|
|
25
|
+
journalEntry?: models.CreateJournalEntryRequestDto | undefined;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export type PatchJournalEntryRequest = {
|
|
29
|
+
journalEntryId: string;
|
|
30
|
+
/**
|
|
31
|
+
* ID of the company (required for multi-company target systems)
|
|
32
|
+
*/
|
|
33
|
+
companyId?: string | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* API key
|
|
36
|
+
*/
|
|
37
|
+
apiKey?: string | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Account key
|
|
40
|
+
*/
|
|
41
|
+
accountKey?: string | undefined;
|
|
42
|
+
body: PatchJournalEntryRequestBody;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export type PatchJournalEntryPagination = {
|
|
46
|
+
total: number;
|
|
47
|
+
perPage: number;
|
|
48
|
+
currentPage: number;
|
|
49
|
+
totalPages: number;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export type PatchJournalEntryMeta = {
|
|
53
|
+
warnings?: Array<string> | null | undefined;
|
|
54
|
+
pagination?: PatchJournalEntryPagination | null | undefined;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export type PatchJournalEntryErrors = {};
|
|
58
|
+
|
|
59
|
+
export type PatchJournalEntryRawData = {};
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Journal entry updated successfully
|
|
63
|
+
*/
|
|
64
|
+
export type PatchJournalEntryResponse = {
|
|
65
|
+
meta?: PatchJournalEntryMeta | null | undefined;
|
|
66
|
+
data: models.JournalEntryResponseDto;
|
|
67
|
+
errors: PatchJournalEntryErrors | null;
|
|
68
|
+
rawData: PatchJournalEntryRawData | null;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/** @internal */
|
|
72
|
+
export type PatchJournalEntryFile$Outbound = {
|
|
73
|
+
fileName: string;
|
|
74
|
+
content: ReadableStream<Uint8Array> | Blob | ArrayBuffer | Uint8Array;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
/** @internal */
|
|
78
|
+
export const PatchJournalEntryFile$outboundSchema: z.ZodMiniType<
|
|
79
|
+
PatchJournalEntryFile$Outbound,
|
|
80
|
+
PatchJournalEntryFile
|
|
81
|
+
> = z.object({
|
|
82
|
+
fileName: z.string(),
|
|
83
|
+
content: z.union([
|
|
84
|
+
z.custom<ReadableStream<Uint8Array>>(x => x instanceof ReadableStream),
|
|
85
|
+
z.custom<Blob>(x => x instanceof Blob),
|
|
86
|
+
z.custom<ArrayBuffer>(x => x instanceof ArrayBuffer),
|
|
87
|
+
z.custom<Uint8Array>(x => x instanceof Uint8Array),
|
|
88
|
+
]),
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
export function patchJournalEntryFileToJSON(
|
|
92
|
+
patchJournalEntryFile: PatchJournalEntryFile,
|
|
93
|
+
): string {
|
|
94
|
+
return JSON.stringify(
|
|
95
|
+
PatchJournalEntryFile$outboundSchema.parse(patchJournalEntryFile),
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** @internal */
|
|
100
|
+
export type PatchJournalEntryRequestBody$Outbound = {
|
|
101
|
+
files?: Array<PatchJournalEntryFile$Outbound> | undefined;
|
|
102
|
+
journal_entry?: models.CreateJournalEntryRequestDto$Outbound | undefined;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
/** @internal */
|
|
106
|
+
export const PatchJournalEntryRequestBody$outboundSchema: z.ZodMiniType<
|
|
107
|
+
PatchJournalEntryRequestBody$Outbound,
|
|
108
|
+
PatchJournalEntryRequestBody
|
|
109
|
+
> = z.pipe(
|
|
110
|
+
z.object({
|
|
111
|
+
files: z.optional(
|
|
112
|
+
z.array(z.lazy(() => PatchJournalEntryFile$outboundSchema)),
|
|
113
|
+
),
|
|
114
|
+
journalEntry: z.optional(
|
|
115
|
+
models.CreateJournalEntryRequestDto$outboundSchema,
|
|
116
|
+
),
|
|
117
|
+
}),
|
|
118
|
+
z.transform((v) => {
|
|
119
|
+
return remap$(v, {
|
|
120
|
+
journalEntry: "journal_entry",
|
|
121
|
+
});
|
|
122
|
+
}),
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
export function patchJournalEntryRequestBodyToJSON(
|
|
126
|
+
patchJournalEntryRequestBody: PatchJournalEntryRequestBody,
|
|
127
|
+
): string {
|
|
128
|
+
return JSON.stringify(
|
|
129
|
+
PatchJournalEntryRequestBody$outboundSchema.parse(
|
|
130
|
+
patchJournalEntryRequestBody,
|
|
131
|
+
),
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/** @internal */
|
|
136
|
+
export type PatchJournalEntryRequest$Outbound = {
|
|
137
|
+
journalEntryId: string;
|
|
138
|
+
companyId?: string | undefined;
|
|
139
|
+
apiKey?: string | undefined;
|
|
140
|
+
accountKey?: string | undefined;
|
|
141
|
+
body: PatchJournalEntryRequestBody$Outbound;
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
/** @internal */
|
|
145
|
+
export const PatchJournalEntryRequest$outboundSchema: z.ZodMiniType<
|
|
146
|
+
PatchJournalEntryRequest$Outbound,
|
|
147
|
+
PatchJournalEntryRequest
|
|
148
|
+
> = z.object({
|
|
149
|
+
journalEntryId: z.string(),
|
|
150
|
+
companyId: z.optional(z.string()),
|
|
151
|
+
apiKey: z.optional(z.string()),
|
|
152
|
+
accountKey: z.optional(z.string()),
|
|
153
|
+
body: z.lazy(() => PatchJournalEntryRequestBody$outboundSchema),
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
export function patchJournalEntryRequestToJSON(
|
|
157
|
+
patchJournalEntryRequest: PatchJournalEntryRequest,
|
|
158
|
+
): string {
|
|
159
|
+
return JSON.stringify(
|
|
160
|
+
PatchJournalEntryRequest$outboundSchema.parse(patchJournalEntryRequest),
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/** @internal */
|
|
165
|
+
export const PatchJournalEntryPagination$inboundSchema: z.ZodMiniType<
|
|
166
|
+
PatchJournalEntryPagination,
|
|
167
|
+
unknown
|
|
168
|
+
> = z.object({
|
|
169
|
+
total: types.number(),
|
|
170
|
+
perPage: types.number(),
|
|
171
|
+
currentPage: types.number(),
|
|
172
|
+
totalPages: types.number(),
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
export function patchJournalEntryPaginationFromJSON(
|
|
176
|
+
jsonString: string,
|
|
177
|
+
): SafeParseResult<PatchJournalEntryPagination, SDKValidationError> {
|
|
178
|
+
return safeParse(
|
|
179
|
+
jsonString,
|
|
180
|
+
(x) => PatchJournalEntryPagination$inboundSchema.parse(JSON.parse(x)),
|
|
181
|
+
`Failed to parse 'PatchJournalEntryPagination' from JSON`,
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/** @internal */
|
|
186
|
+
export const PatchJournalEntryMeta$inboundSchema: z.ZodMiniType<
|
|
187
|
+
PatchJournalEntryMeta,
|
|
188
|
+
unknown
|
|
189
|
+
> = z.object({
|
|
190
|
+
warnings: z.optional(z.nullable(z.array(types.string()))),
|
|
191
|
+
pagination: z.optional(
|
|
192
|
+
z.nullable(z.lazy(() => PatchJournalEntryPagination$inboundSchema)),
|
|
193
|
+
),
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
export function patchJournalEntryMetaFromJSON(
|
|
197
|
+
jsonString: string,
|
|
198
|
+
): SafeParseResult<PatchJournalEntryMeta, SDKValidationError> {
|
|
199
|
+
return safeParse(
|
|
200
|
+
jsonString,
|
|
201
|
+
(x) => PatchJournalEntryMeta$inboundSchema.parse(JSON.parse(x)),
|
|
202
|
+
`Failed to parse 'PatchJournalEntryMeta' from JSON`,
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/** @internal */
|
|
207
|
+
export const PatchJournalEntryErrors$inboundSchema: z.ZodMiniType<
|
|
208
|
+
PatchJournalEntryErrors,
|
|
209
|
+
unknown
|
|
210
|
+
> = z.object({});
|
|
211
|
+
|
|
212
|
+
export function patchJournalEntryErrorsFromJSON(
|
|
213
|
+
jsonString: string,
|
|
214
|
+
): SafeParseResult<PatchJournalEntryErrors, SDKValidationError> {
|
|
215
|
+
return safeParse(
|
|
216
|
+
jsonString,
|
|
217
|
+
(x) => PatchJournalEntryErrors$inboundSchema.parse(JSON.parse(x)),
|
|
218
|
+
`Failed to parse 'PatchJournalEntryErrors' from JSON`,
|
|
219
|
+
);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/** @internal */
|
|
223
|
+
export const PatchJournalEntryRawData$inboundSchema: z.ZodMiniType<
|
|
224
|
+
PatchJournalEntryRawData,
|
|
225
|
+
unknown
|
|
226
|
+
> = z.object({});
|
|
227
|
+
|
|
228
|
+
export function patchJournalEntryRawDataFromJSON(
|
|
229
|
+
jsonString: string,
|
|
230
|
+
): SafeParseResult<PatchJournalEntryRawData, SDKValidationError> {
|
|
231
|
+
return safeParse(
|
|
232
|
+
jsonString,
|
|
233
|
+
(x) => PatchJournalEntryRawData$inboundSchema.parse(JSON.parse(x)),
|
|
234
|
+
`Failed to parse 'PatchJournalEntryRawData' from JSON`,
|
|
235
|
+
);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/** @internal */
|
|
239
|
+
export const PatchJournalEntryResponse$inboundSchema: z.ZodMiniType<
|
|
240
|
+
PatchJournalEntryResponse,
|
|
241
|
+
unknown
|
|
242
|
+
> = z.object({
|
|
243
|
+
meta: z.optional(
|
|
244
|
+
z.nullable(z.lazy(() => PatchJournalEntryMeta$inboundSchema)),
|
|
245
|
+
),
|
|
246
|
+
data: models.JournalEntryResponseDto$inboundSchema,
|
|
247
|
+
errors: types.nullable(z.lazy(() => PatchJournalEntryErrors$inboundSchema)),
|
|
248
|
+
rawData: types.nullable(z.lazy(() => PatchJournalEntryRawData$inboundSchema)),
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
export function patchJournalEntryResponseFromJSON(
|
|
252
|
+
jsonString: string,
|
|
253
|
+
): SafeParseResult<PatchJournalEntryResponse, SDKValidationError> {
|
|
254
|
+
return safeParse(
|
|
255
|
+
jsonString,
|
|
256
|
+
(x) => PatchJournalEntryResponse$inboundSchema.parse(JSON.parse(x)),
|
|
257
|
+
`Failed to parse 'PatchJournalEntryResponse' from JSON`,
|
|
258
|
+
);
|
|
259
|
+
}
|
|
@@ -27,6 +27,7 @@ export type PostFileAsyncRequestBody = {
|
|
|
27
27
|
documentType?: string | undefined;
|
|
28
28
|
integrationSource?: string | undefined;
|
|
29
29
|
note?: string | undefined;
|
|
30
|
+
folderName?: string | undefined;
|
|
30
31
|
};
|
|
31
32
|
|
|
32
33
|
export type PostFileAsyncRequest = {
|
|
@@ -107,6 +108,7 @@ export type PostFileAsyncRequestBody$Outbound = {
|
|
|
107
108
|
documentType?: string | undefined;
|
|
108
109
|
integrationSource?: string | undefined;
|
|
109
110
|
note?: string | undefined;
|
|
111
|
+
folderName?: string | undefined;
|
|
110
112
|
};
|
|
111
113
|
|
|
112
114
|
/** @internal */
|
|
@@ -122,6 +124,7 @@ export const PostFileAsyncRequestBody$outboundSchema: z.ZodMiniType<
|
|
|
122
124
|
documentType: z.optional(z.string()),
|
|
123
125
|
integrationSource: z.optional(z.string()),
|
|
124
126
|
note: z.optional(z.string()),
|
|
127
|
+
folderName: z.optional(z.string()),
|
|
125
128
|
});
|
|
126
129
|
|
|
127
130
|
export function postFileAsyncRequestBodyToJSON(
|