@maesn/typescript-sdk 0.8.12 → 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.
- package/README.md +6 -0
- package/esm/funcs/accounting-delete-item.d.ts +11 -0
- package/esm/funcs/accounting-delete-item.d.ts.map +1 -0
- package/esm/funcs/accounting-delete-item.js +81 -0
- package/esm/funcs/accounting-delete-item.js.map +1 -0
- package/esm/funcs/accounting-get-journal-entry.js +1 -0
- package/esm/funcs/accounting-get-journal-entry.js.map +1 -1
- package/esm/funcs/accounting-update-item.d.ts +11 -0
- package/esm/funcs/accounting-update-item.d.ts.map +1 -0
- package/esm/funcs/accounting-update-item.js +82 -0
- package/esm/funcs/accounting-update-item.js.map +1 -0
- package/esm/funcs/accounting-update-journal-entry.d.ts +11 -0
- package/esm/funcs/accounting-update-journal-entry.d.ts.map +1 -0
- package/esm/funcs/accounting-update-journal-entry.js +109 -0
- package/esm/funcs/accounting-update-journal-entry.js.map +1 -0
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/lib/encodings.d.ts +10 -9
- package/esm/lib/encodings.d.ts.map +1 -1
- package/esm/lib/encodings.js +29 -13
- package/esm/lib/encodings.js.map +1 -1
- package/esm/models/account-response-dto.d.ts +10 -0
- package/esm/models/account-response-dto.d.ts.map +1 -1
- package/esm/models/account-response-dto.js +11 -0
- package/esm/models/account-response-dto.js.map +1 -1
- package/esm/models/create-account-request-dto.d.ts +3 -0
- package/esm/models/create-account-request-dto.d.ts.map +1 -1
- package/esm/models/create-account-request-dto.js +2 -0
- package/esm/models/create-account-request-dto.js.map +1 -1
- package/esm/models/create-journal-entry-request-dto.d.ts +2 -0
- package/esm/models/create-journal-entry-request-dto.d.ts.map +1 -1
- package/esm/models/create-journal-entry-request-dto.js +1 -0
- package/esm/models/create-journal-entry-request-dto.js.map +1 -1
- package/esm/models/create-offer-line-item-request-dto.d.ts +1 -0
- package/esm/models/create-offer-line-item-request-dto.d.ts.map +1 -1
- package/esm/models/create-offer-line-item-request-dto.js +1 -0
- package/esm/models/create-offer-line-item-request-dto.js.map +1 -1
- package/esm/models/create-offer-request-dto.d.ts +2 -0
- package/esm/models/create-offer-request-dto.d.ts.map +1 -1
- package/esm/models/create-offer-request-dto.js +1 -0
- package/esm/models/create-offer-request-dto.js.map +1 -1
- package/esm/models/create-sales-order-line-item-request-dto.d.ts +4 -0
- package/esm/models/create-sales-order-line-item-request-dto.d.ts.map +1 -1
- package/esm/models/create-sales-order-line-item-request-dto.js +2 -0
- package/esm/models/create-sales-order-line-item-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/journal-entry-response-dto.d.ts +2 -1
- package/esm/models/journal-entry-response-dto.d.ts.map +1 -1
- package/esm/models/journal-entry-response-dto.js +2 -1
- package/esm/models/journal-entry-response-dto.js.map +1 -1
- package/esm/models/offer-line-item-response-dto.d.ts +1 -0
- package/esm/models/offer-line-item-response-dto.d.ts.map +1 -1
- package/esm/models/offer-line-item-response-dto.js +1 -0
- package/esm/models/offer-line-item-response-dto.js.map +1 -1
- package/esm/models/offer-response-dto.d.ts +1 -0
- package/esm/models/offer-response-dto.d.ts.map +1 -1
- package/esm/models/offer-response-dto.js +1 -0
- package/esm/models/offer-response-dto.js.map +1 -1
- package/esm/models/operations/delete-item.d.ts +75 -0
- package/esm/models/operations/delete-item.d.ts.map +1 -0
- package/esm/models/operations/delete-item.js +57 -0
- package/esm/models/operations/delete-item.js.map +1 -0
- package/esm/models/operations/get-journal-entry.d.ts +5 -0
- package/esm/models/operations/get-journal-entry.d.ts.map +1 -1
- package/esm/models/operations/get-journal-entry.js +1 -0
- package/esm/models/operations/get-journal-entry.js.map +1 -1
- package/esm/models/operations/index.d.ts +3 -0
- package/esm/models/operations/index.d.ts.map +1 -1
- package/esm/models/operations/index.js +3 -0
- package/esm/models/operations/index.js.map +1 -1
- package/esm/models/operations/update-item.d.ts +77 -0
- package/esm/models/operations/update-item.d.ts.map +1 -0
- package/esm/models/operations/update-item.js +58 -0
- package/esm/models/operations/update-item.js.map +1 -0
- package/esm/models/operations/update-journal-entry.d.ts +96 -0
- package/esm/models/operations/update-journal-entry.d.ts.map +1 -0
- package/esm/models/operations/update-journal-entry.js +83 -0
- package/esm/models/operations/update-journal-entry.js.map +1 -0
- package/esm/models/tax-rate-request-common-dto.d.ts +18 -0
- package/esm/models/tax-rate-request-common-dto.d.ts.map +1 -0
- package/esm/models/tax-rate-request-common-dto.js +15 -0
- package/esm/models/tax-rate-request-common-dto.js.map +1 -0
- package/esm/sdk/accounting.d.ts +3 -0
- package/esm/sdk/accounting.d.ts.map +1 -1
- package/esm/sdk/accounting.js +12 -0
- package/esm/sdk/accounting.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/accounting-delete-item.ts +172 -0
- package/src/funcs/accounting-get-journal-entry.ts +1 -0
- package/src/funcs/accounting-update-item.ts +173 -0
- package/src/funcs/accounting-update-journal-entry.ts +226 -0
- package/src/lib/config.ts +3 -3
- package/src/lib/encodings.ts +58 -23
- package/src/models/account-response-dto.ts +32 -0
- package/src/models/create-account-request-dto.ts +8 -0
- package/src/models/create-journal-entry-request-dto.ts +3 -0
- package/src/models/create-offer-line-item-request-dto.ts +1 -0
- package/src/models/create-offer-request-dto.ts +3 -0
- package/src/models/create-sales-order-line-item-request-dto.ts +6 -0
- package/src/models/index.ts +1 -0
- package/src/models/journal-entry-response-dto.ts +4 -2
- package/src/models/offer-line-item-response-dto.ts +1 -0
- package/src/models/offer-response-dto.ts +2 -0
- package/src/models/operations/delete-item.ts +185 -0
- package/src/models/operations/get-journal-entry.ts +6 -0
- package/src/models/operations/index.ts +3 -0
- package/src/models/operations/update-item.ts +188 -0
- package/src/models/operations/update-journal-entry.ts +261 -0
- package/src/models/tax-rate-request-common-dto.ts +39 -0
- package/src/sdk/accounting.ts +36 -0
|
@@ -42,6 +42,7 @@ export * from "./create-webhook.js";
|
|
|
42
42
|
export * from "./delete-bill.js";
|
|
43
43
|
export * from "./delete-end-user.js";
|
|
44
44
|
export * from "./delete-event-subscriptions.js";
|
|
45
|
+
export * from "./delete-item.js";
|
|
45
46
|
export * from "./delete-payment.js";
|
|
46
47
|
export * from "./delete-registered-system.js";
|
|
47
48
|
export * from "./delete-vendor-credit.js";
|
|
@@ -157,6 +158,8 @@ export * from "./system-registration.js";
|
|
|
157
158
|
export * from "./update-bill-line-item.js";
|
|
158
159
|
export * from "./update-bill.js";
|
|
159
160
|
export * from "./update-customer.js";
|
|
161
|
+
export * from "./update-item.js";
|
|
162
|
+
export * from "./update-journal-entry.js";
|
|
160
163
|
export * from "./update-submission-page-style.js";
|
|
161
164
|
export * from "./update-supplier.js";
|
|
162
165
|
export * from "./update-vendor-credit.js";
|
|
@@ -0,0 +1,188 @@
|
|
|
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 * as types from "../../types/primitives.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdk-validation-error.js";
|
|
10
|
+
import * as models from "../index.js";
|
|
11
|
+
|
|
12
|
+
export type UpdateItemGlobals = {
|
|
13
|
+
apiKey?: string | undefined;
|
|
14
|
+
accountKey?: string | undefined;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type UpdateItemRequest = {
|
|
18
|
+
itemId: string;
|
|
19
|
+
/**
|
|
20
|
+
* Environment name (required for multi-environment systems such as Business Central)
|
|
21
|
+
*/
|
|
22
|
+
environmentName?: string | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* ID of the company (required for multi-company target systems)
|
|
25
|
+
*/
|
|
26
|
+
companyId?: string | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* API key
|
|
29
|
+
*/
|
|
30
|
+
apiKey?: string | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Account key
|
|
33
|
+
*/
|
|
34
|
+
accountKey?: string | undefined;
|
|
35
|
+
body: models.CreateItemRequestDto;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export type UpdateItemPagination = {
|
|
39
|
+
total: number;
|
|
40
|
+
perPage: number;
|
|
41
|
+
currentPage: number;
|
|
42
|
+
totalPages: number;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export type UpdateItemMeta = {
|
|
46
|
+
warnings?: Array<string> | null | undefined;
|
|
47
|
+
pagination?: UpdateItemPagination | null | undefined;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export type UpdateItemErrors = {};
|
|
51
|
+
|
|
52
|
+
export type UpdateItemRawData = {};
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Item updated successfully
|
|
56
|
+
*/
|
|
57
|
+
export type UpdateItemResponse = {
|
|
58
|
+
meta?: UpdateItemMeta | null | undefined;
|
|
59
|
+
data: models.ItemResponseDto;
|
|
60
|
+
errors: UpdateItemErrors | null;
|
|
61
|
+
rawData: UpdateItemRawData | null;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
/** @internal */
|
|
65
|
+
export type UpdateItemRequest$Outbound = {
|
|
66
|
+
itemId: string;
|
|
67
|
+
environmentName?: string | undefined;
|
|
68
|
+
companyId?: string | undefined;
|
|
69
|
+
apiKey?: string | undefined;
|
|
70
|
+
accountKey?: string | undefined;
|
|
71
|
+
body: models.CreateItemRequestDto$Outbound;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/** @internal */
|
|
75
|
+
export const UpdateItemRequest$outboundSchema: z.ZodMiniType<
|
|
76
|
+
UpdateItemRequest$Outbound,
|
|
77
|
+
UpdateItemRequest
|
|
78
|
+
> = z.object({
|
|
79
|
+
itemId: z.string(),
|
|
80
|
+
environmentName: z.optional(z.string()),
|
|
81
|
+
companyId: z.optional(z.string()),
|
|
82
|
+
apiKey: z.optional(z.string()),
|
|
83
|
+
accountKey: z.optional(z.string()),
|
|
84
|
+
body: models.CreateItemRequestDto$outboundSchema,
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
export function updateItemRequestToJSON(
|
|
88
|
+
updateItemRequest: UpdateItemRequest,
|
|
89
|
+
): string {
|
|
90
|
+
return JSON.stringify(
|
|
91
|
+
UpdateItemRequest$outboundSchema.parse(updateItemRequest),
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** @internal */
|
|
96
|
+
export const UpdateItemPagination$inboundSchema: z.ZodMiniType<
|
|
97
|
+
UpdateItemPagination,
|
|
98
|
+
unknown
|
|
99
|
+
> = z.object({
|
|
100
|
+
total: types.number(),
|
|
101
|
+
perPage: types.number(),
|
|
102
|
+
currentPage: types.number(),
|
|
103
|
+
totalPages: types.number(),
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
export function updateItemPaginationFromJSON(
|
|
107
|
+
jsonString: string,
|
|
108
|
+
): SafeParseResult<UpdateItemPagination, SDKValidationError> {
|
|
109
|
+
return safeParse(
|
|
110
|
+
jsonString,
|
|
111
|
+
(x) => UpdateItemPagination$inboundSchema.parse(JSON.parse(x)),
|
|
112
|
+
`Failed to parse 'UpdateItemPagination' from JSON`,
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/** @internal */
|
|
117
|
+
export const UpdateItemMeta$inboundSchema: z.ZodMiniType<
|
|
118
|
+
UpdateItemMeta,
|
|
119
|
+
unknown
|
|
120
|
+
> = z.object({
|
|
121
|
+
warnings: z.optional(z.nullable(z.array(types.string()))),
|
|
122
|
+
pagination: z.optional(
|
|
123
|
+
z.nullable(z.lazy(() => UpdateItemPagination$inboundSchema)),
|
|
124
|
+
),
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
export function updateItemMetaFromJSON(
|
|
128
|
+
jsonString: string,
|
|
129
|
+
): SafeParseResult<UpdateItemMeta, SDKValidationError> {
|
|
130
|
+
return safeParse(
|
|
131
|
+
jsonString,
|
|
132
|
+
(x) => UpdateItemMeta$inboundSchema.parse(JSON.parse(x)),
|
|
133
|
+
`Failed to parse 'UpdateItemMeta' from JSON`,
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/** @internal */
|
|
138
|
+
export const UpdateItemErrors$inboundSchema: z.ZodMiniType<
|
|
139
|
+
UpdateItemErrors,
|
|
140
|
+
unknown
|
|
141
|
+
> = z.object({});
|
|
142
|
+
|
|
143
|
+
export function updateItemErrorsFromJSON(
|
|
144
|
+
jsonString: string,
|
|
145
|
+
): SafeParseResult<UpdateItemErrors, SDKValidationError> {
|
|
146
|
+
return safeParse(
|
|
147
|
+
jsonString,
|
|
148
|
+
(x) => UpdateItemErrors$inboundSchema.parse(JSON.parse(x)),
|
|
149
|
+
`Failed to parse 'UpdateItemErrors' from JSON`,
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/** @internal */
|
|
154
|
+
export const UpdateItemRawData$inboundSchema: z.ZodMiniType<
|
|
155
|
+
UpdateItemRawData,
|
|
156
|
+
unknown
|
|
157
|
+
> = z.object({});
|
|
158
|
+
|
|
159
|
+
export function updateItemRawDataFromJSON(
|
|
160
|
+
jsonString: string,
|
|
161
|
+
): SafeParseResult<UpdateItemRawData, SDKValidationError> {
|
|
162
|
+
return safeParse(
|
|
163
|
+
jsonString,
|
|
164
|
+
(x) => UpdateItemRawData$inboundSchema.parse(JSON.parse(x)),
|
|
165
|
+
`Failed to parse 'UpdateItemRawData' from JSON`,
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/** @internal */
|
|
170
|
+
export const UpdateItemResponse$inboundSchema: z.ZodMiniType<
|
|
171
|
+
UpdateItemResponse,
|
|
172
|
+
unknown
|
|
173
|
+
> = z.object({
|
|
174
|
+
meta: z.optional(z.nullable(z.lazy(() => UpdateItemMeta$inboundSchema))),
|
|
175
|
+
data: models.ItemResponseDto$inboundSchema,
|
|
176
|
+
errors: types.nullable(z.lazy(() => UpdateItemErrors$inboundSchema)),
|
|
177
|
+
rawData: types.nullable(z.lazy(() => UpdateItemRawData$inboundSchema)),
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
export function updateItemResponseFromJSON(
|
|
181
|
+
jsonString: string,
|
|
182
|
+
): SafeParseResult<UpdateItemResponse, SDKValidationError> {
|
|
183
|
+
return safeParse(
|
|
184
|
+
jsonString,
|
|
185
|
+
(x) => UpdateItemResponse$inboundSchema.parse(JSON.parse(x)),
|
|
186
|
+
`Failed to parse 'UpdateItemResponse' from JSON`,
|
|
187
|
+
);
|
|
188
|
+
}
|
|
@@ -0,0 +1,261 @@
|
|
|
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 UpdateJournalEntryGlobals = {
|
|
14
|
+
apiKey?: string | undefined;
|
|
15
|
+
accountKey?: string | undefined;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type UpdateJournalEntryFile = {
|
|
19
|
+
fileName: string;
|
|
20
|
+
content: ReadableStream<Uint8Array> | Blob | ArrayBuffer | Uint8Array;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export type UpdateJournalEntryRequestBody = {
|
|
24
|
+
files?: Array<UpdateJournalEntryFile> | undefined;
|
|
25
|
+
journalEntry?: models.CreateJournalEntryRequestDto | undefined;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export type UpdateJournalEntryRequest = {
|
|
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: UpdateJournalEntryRequestBody;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export type UpdateJournalEntryPagination = {
|
|
46
|
+
total: number;
|
|
47
|
+
perPage: number;
|
|
48
|
+
currentPage: number;
|
|
49
|
+
totalPages: number;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export type UpdateJournalEntryMeta = {
|
|
53
|
+
warnings?: Array<string> | null | undefined;
|
|
54
|
+
pagination?: UpdateJournalEntryPagination | null | undefined;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export type UpdateJournalEntryErrors = {};
|
|
58
|
+
|
|
59
|
+
export type UpdateJournalEntryRawData = {};
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Journal entry updated successfully
|
|
63
|
+
*/
|
|
64
|
+
export type UpdateJournalEntryResponse = {
|
|
65
|
+
meta?: UpdateJournalEntryMeta | null | undefined;
|
|
66
|
+
data: models.JournalEntryResponseDto;
|
|
67
|
+
errors: UpdateJournalEntryErrors | null;
|
|
68
|
+
rawData: UpdateJournalEntryRawData | null;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/** @internal */
|
|
72
|
+
export type UpdateJournalEntryFile$Outbound = {
|
|
73
|
+
fileName: string;
|
|
74
|
+
content: ReadableStream<Uint8Array> | Blob | ArrayBuffer | Uint8Array;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
/** @internal */
|
|
78
|
+
export const UpdateJournalEntryFile$outboundSchema: z.ZodMiniType<
|
|
79
|
+
UpdateJournalEntryFile$Outbound,
|
|
80
|
+
UpdateJournalEntryFile
|
|
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 updateJournalEntryFileToJSON(
|
|
92
|
+
updateJournalEntryFile: UpdateJournalEntryFile,
|
|
93
|
+
): string {
|
|
94
|
+
return JSON.stringify(
|
|
95
|
+
UpdateJournalEntryFile$outboundSchema.parse(updateJournalEntryFile),
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** @internal */
|
|
100
|
+
export type UpdateJournalEntryRequestBody$Outbound = {
|
|
101
|
+
files?: Array<UpdateJournalEntryFile$Outbound> | undefined;
|
|
102
|
+
journal_entry?: models.CreateJournalEntryRequestDto$Outbound | undefined;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
/** @internal */
|
|
106
|
+
export const UpdateJournalEntryRequestBody$outboundSchema: z.ZodMiniType<
|
|
107
|
+
UpdateJournalEntryRequestBody$Outbound,
|
|
108
|
+
UpdateJournalEntryRequestBody
|
|
109
|
+
> = z.pipe(
|
|
110
|
+
z.object({
|
|
111
|
+
files: z.optional(
|
|
112
|
+
z.array(z.lazy(() => UpdateJournalEntryFile$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 updateJournalEntryRequestBodyToJSON(
|
|
126
|
+
updateJournalEntryRequestBody: UpdateJournalEntryRequestBody,
|
|
127
|
+
): string {
|
|
128
|
+
return JSON.stringify(
|
|
129
|
+
UpdateJournalEntryRequestBody$outboundSchema.parse(
|
|
130
|
+
updateJournalEntryRequestBody,
|
|
131
|
+
),
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/** @internal */
|
|
136
|
+
export type UpdateJournalEntryRequest$Outbound = {
|
|
137
|
+
journalEntryId: string;
|
|
138
|
+
companyId?: string | undefined;
|
|
139
|
+
apiKey?: string | undefined;
|
|
140
|
+
accountKey?: string | undefined;
|
|
141
|
+
body: UpdateJournalEntryRequestBody$Outbound;
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
/** @internal */
|
|
145
|
+
export const UpdateJournalEntryRequest$outboundSchema: z.ZodMiniType<
|
|
146
|
+
UpdateJournalEntryRequest$Outbound,
|
|
147
|
+
UpdateJournalEntryRequest
|
|
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(() => UpdateJournalEntryRequestBody$outboundSchema),
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
export function updateJournalEntryRequestToJSON(
|
|
157
|
+
updateJournalEntryRequest: UpdateJournalEntryRequest,
|
|
158
|
+
): string {
|
|
159
|
+
return JSON.stringify(
|
|
160
|
+
UpdateJournalEntryRequest$outboundSchema.parse(updateJournalEntryRequest),
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/** @internal */
|
|
165
|
+
export const UpdateJournalEntryPagination$inboundSchema: z.ZodMiniType<
|
|
166
|
+
UpdateJournalEntryPagination,
|
|
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 updateJournalEntryPaginationFromJSON(
|
|
176
|
+
jsonString: string,
|
|
177
|
+
): SafeParseResult<UpdateJournalEntryPagination, SDKValidationError> {
|
|
178
|
+
return safeParse(
|
|
179
|
+
jsonString,
|
|
180
|
+
(x) => UpdateJournalEntryPagination$inboundSchema.parse(JSON.parse(x)),
|
|
181
|
+
`Failed to parse 'UpdateJournalEntryPagination' from JSON`,
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/** @internal */
|
|
186
|
+
export const UpdateJournalEntryMeta$inboundSchema: z.ZodMiniType<
|
|
187
|
+
UpdateJournalEntryMeta,
|
|
188
|
+
unknown
|
|
189
|
+
> = z.object({
|
|
190
|
+
warnings: z.optional(z.nullable(z.array(types.string()))),
|
|
191
|
+
pagination: z.optional(
|
|
192
|
+
z.nullable(z.lazy(() => UpdateJournalEntryPagination$inboundSchema)),
|
|
193
|
+
),
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
export function updateJournalEntryMetaFromJSON(
|
|
197
|
+
jsonString: string,
|
|
198
|
+
): SafeParseResult<UpdateJournalEntryMeta, SDKValidationError> {
|
|
199
|
+
return safeParse(
|
|
200
|
+
jsonString,
|
|
201
|
+
(x) => UpdateJournalEntryMeta$inboundSchema.parse(JSON.parse(x)),
|
|
202
|
+
`Failed to parse 'UpdateJournalEntryMeta' from JSON`,
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/** @internal */
|
|
207
|
+
export const UpdateJournalEntryErrors$inboundSchema: z.ZodMiniType<
|
|
208
|
+
UpdateJournalEntryErrors,
|
|
209
|
+
unknown
|
|
210
|
+
> = z.object({});
|
|
211
|
+
|
|
212
|
+
export function updateJournalEntryErrorsFromJSON(
|
|
213
|
+
jsonString: string,
|
|
214
|
+
): SafeParseResult<UpdateJournalEntryErrors, SDKValidationError> {
|
|
215
|
+
return safeParse(
|
|
216
|
+
jsonString,
|
|
217
|
+
(x) => UpdateJournalEntryErrors$inboundSchema.parse(JSON.parse(x)),
|
|
218
|
+
`Failed to parse 'UpdateJournalEntryErrors' from JSON`,
|
|
219
|
+
);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/** @internal */
|
|
223
|
+
export const UpdateJournalEntryRawData$inboundSchema: z.ZodMiniType<
|
|
224
|
+
UpdateJournalEntryRawData,
|
|
225
|
+
unknown
|
|
226
|
+
> = z.object({});
|
|
227
|
+
|
|
228
|
+
export function updateJournalEntryRawDataFromJSON(
|
|
229
|
+
jsonString: string,
|
|
230
|
+
): SafeParseResult<UpdateJournalEntryRawData, SDKValidationError> {
|
|
231
|
+
return safeParse(
|
|
232
|
+
jsonString,
|
|
233
|
+
(x) => UpdateJournalEntryRawData$inboundSchema.parse(JSON.parse(x)),
|
|
234
|
+
`Failed to parse 'UpdateJournalEntryRawData' from JSON`,
|
|
235
|
+
);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/** @internal */
|
|
239
|
+
export const UpdateJournalEntryResponse$inboundSchema: z.ZodMiniType<
|
|
240
|
+
UpdateJournalEntryResponse,
|
|
241
|
+
unknown
|
|
242
|
+
> = z.object({
|
|
243
|
+
meta: z.optional(
|
|
244
|
+
z.nullable(z.lazy(() => UpdateJournalEntryMeta$inboundSchema)),
|
|
245
|
+
),
|
|
246
|
+
data: models.JournalEntryResponseDto$inboundSchema,
|
|
247
|
+
errors: types.nullable(z.lazy(() => UpdateJournalEntryErrors$inboundSchema)),
|
|
248
|
+
rawData: types.nullable(
|
|
249
|
+
z.lazy(() => UpdateJournalEntryRawData$inboundSchema),
|
|
250
|
+
),
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
export function updateJournalEntryResponseFromJSON(
|
|
254
|
+
jsonString: string,
|
|
255
|
+
): SafeParseResult<UpdateJournalEntryResponse, SDKValidationError> {
|
|
256
|
+
return safeParse(
|
|
257
|
+
jsonString,
|
|
258
|
+
(x) => UpdateJournalEntryResponse$inboundSchema.parse(JSON.parse(x)),
|
|
259
|
+
`Failed to parse 'UpdateJournalEntryResponse' from JSON`,
|
|
260
|
+
);
|
|
261
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
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 TaxRateRequestCommonDto = {
|
|
8
|
+
id?: string | undefined;
|
|
9
|
+
code?: string | undefined;
|
|
10
|
+
name?: string | undefined;
|
|
11
|
+
percentage?: number | undefined;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/** @internal */
|
|
15
|
+
export type TaxRateRequestCommonDto$Outbound = {
|
|
16
|
+
id?: string | undefined;
|
|
17
|
+
code?: string | undefined;
|
|
18
|
+
name?: string | undefined;
|
|
19
|
+
percentage?: number | undefined;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/** @internal */
|
|
23
|
+
export const TaxRateRequestCommonDto$outboundSchema: z.ZodMiniType<
|
|
24
|
+
TaxRateRequestCommonDto$Outbound,
|
|
25
|
+
TaxRateRequestCommonDto
|
|
26
|
+
> = z.object({
|
|
27
|
+
id: z.optional(z.string()),
|
|
28
|
+
code: z.optional(z.string()),
|
|
29
|
+
name: z.optional(z.string()),
|
|
30
|
+
percentage: z.optional(z.number()),
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export function taxRateRequestCommonDtoToJSON(
|
|
34
|
+
taxRateRequestCommonDto: TaxRateRequestCommonDto,
|
|
35
|
+
): string {
|
|
36
|
+
return JSON.stringify(
|
|
37
|
+
TaxRateRequestCommonDto$outboundSchema.parse(taxRateRequestCommonDto),
|
|
38
|
+
);
|
|
39
|
+
}
|
package/src/sdk/accounting.ts
CHANGED
|
@@ -33,6 +33,7 @@ import { accountingCreateTransaction } from "../funcs/accounting-create-transact
|
|
|
33
33
|
import { accountingCreateVendorCredit } from "../funcs/accounting-create-vendor-credit.js";
|
|
34
34
|
import { accountingDeleteBill } from "../funcs/accounting-delete-bill.js";
|
|
35
35
|
import { accountingDeleteEventSubscriptions } from "../funcs/accounting-delete-event-subscriptions.js";
|
|
36
|
+
import { accountingDeleteItem } from "../funcs/accounting-delete-item.js";
|
|
36
37
|
import { accountingDeletePayment } from "../funcs/accounting-delete-payment.js";
|
|
37
38
|
import { accountingDeleteVendorCredit } from "../funcs/accounting-delete-vendor-credit.js";
|
|
38
39
|
import { accountingGetAccount } from "../funcs/accounting-get-account.js";
|
|
@@ -120,6 +121,8 @@ import { accountingPutContact } from "../funcs/accounting-put-contact.js";
|
|
|
120
121
|
import { accountingUpdateBillLineItem } from "../funcs/accounting-update-bill-line-item.js";
|
|
121
122
|
import { accountingUpdateBill } from "../funcs/accounting-update-bill.js";
|
|
122
123
|
import { accountingUpdateCustomer } from "../funcs/accounting-update-customer.js";
|
|
124
|
+
import { accountingUpdateItem } from "../funcs/accounting-update-item.js";
|
|
125
|
+
import { accountingUpdateJournalEntry } from "../funcs/accounting-update-journal-entry.js";
|
|
123
126
|
import { accountingUpdateSupplier } from "../funcs/accounting-update-supplier.js";
|
|
124
127
|
import { accountingUpdateVendorCredit } from "../funcs/accounting-update-vendor-credit.js";
|
|
125
128
|
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
@@ -579,6 +582,28 @@ export class Accounting extends ClientSDK {
|
|
|
579
582
|
));
|
|
580
583
|
}
|
|
581
584
|
|
|
585
|
+
async updateItem(
|
|
586
|
+
request: operations.UpdateItemRequest,
|
|
587
|
+
options?: RequestOptions,
|
|
588
|
+
): Promise<operations.UpdateItemResponse> {
|
|
589
|
+
return unwrapAsync(accountingUpdateItem(
|
|
590
|
+
this,
|
|
591
|
+
request,
|
|
592
|
+
options,
|
|
593
|
+
));
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
async deleteItem(
|
|
597
|
+
request: operations.DeleteItemRequest,
|
|
598
|
+
options?: RequestOptions,
|
|
599
|
+
): Promise<operations.DeleteItemResponse> {
|
|
600
|
+
return unwrapAsync(accountingDeleteItem(
|
|
601
|
+
this,
|
|
602
|
+
request,
|
|
603
|
+
options,
|
|
604
|
+
));
|
|
605
|
+
}
|
|
606
|
+
|
|
582
607
|
async getLineItems(
|
|
583
608
|
request: operations.GetLineItemsRequest,
|
|
584
609
|
options?: RequestOptions,
|
|
@@ -678,6 +703,17 @@ export class Accounting extends ClientSDK {
|
|
|
678
703
|
));
|
|
679
704
|
}
|
|
680
705
|
|
|
706
|
+
async updateJournalEntry(
|
|
707
|
+
request: operations.UpdateJournalEntryRequest,
|
|
708
|
+
options?: RequestOptions,
|
|
709
|
+
): Promise<operations.UpdateJournalEntryResponse> {
|
|
710
|
+
return unwrapAsync(accountingUpdateJournalEntry(
|
|
711
|
+
this,
|
|
712
|
+
request,
|
|
713
|
+
options,
|
|
714
|
+
));
|
|
715
|
+
}
|
|
716
|
+
|
|
681
717
|
async createJournalEntries(
|
|
682
718
|
request: operations.CreateJournalEntriesRequest,
|
|
683
719
|
options?: RequestOptions,
|