@maesn/typescript-sdk 0.8.23 → 0.8.25
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-vendor-credit.js +1 -1
- package/esm/funcs/accounting-create-vendor-credit.js.map +1 -1
- package/esm/funcs/accounting-delete-journal-entry.d.ts +11 -0
- package/esm/funcs/accounting-delete-journal-entry.d.ts.map +1 -0
- package/esm/funcs/accounting-delete-journal-entry.js +81 -0
- package/esm/funcs/accounting-delete-journal-entry.js.map +1 -0
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/models/operations/create-pass-through-request.d.ts +4 -4
- package/esm/models/operations/create-pass-through-request.d.ts.map +1 -1
- package/esm/models/operations/create-pass-through-request.js +4 -4
- package/esm/models/operations/create-pass-through-request.js.map +1 -1
- package/esm/models/operations/delete-journal-entry.d.ts +80 -0
- package/esm/models/operations/delete-journal-entry.d.ts.map +1 -0
- package/esm/models/operations/delete-journal-entry.js +63 -0
- package/esm/models/operations/delete-journal-entry.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/payment-term-response-dto.d.ts +2 -0
- package/esm/models/payment-term-response-dto.d.ts.map +1 -1
- package/esm/models/payment-term-response-dto.js +2 -0
- package/esm/models/payment-term-response-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/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/accounting-create-vendor-credit.ts +1 -1
- package/src/funcs/accounting-delete-journal-entry.ts +175 -0
- package/src/lib/config.ts +3 -3
- package/src/models/operations/create-pass-through-request.ts +11 -8
- package/src/models/operations/delete-journal-entry.ts +210 -0
- package/src/models/operations/index.ts +1 -0
- package/src/models/payment-term-response-dto.ts +4 -0
- package/src/sdk/accounting.ts +12 -0
|
@@ -0,0 +1,210 @@
|
|
|
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
|
+
|
|
11
|
+
export type DeleteJournalEntryGlobals = {
|
|
12
|
+
apiKey?: string | undefined;
|
|
13
|
+
accountKey?: string | undefined;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export type DeleteJournalEntryRequest = {
|
|
17
|
+
journalEntryId: string;
|
|
18
|
+
/**
|
|
19
|
+
* Environment name (required for multi-environment systems such as Business Central)
|
|
20
|
+
*/
|
|
21
|
+
environmentName?: string | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* ID of the company (required for multi-company target systems)
|
|
24
|
+
*/
|
|
25
|
+
companyId?: string | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* API key
|
|
28
|
+
*/
|
|
29
|
+
apiKey?: string | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Account key
|
|
32
|
+
*/
|
|
33
|
+
accountKey?: string | undefined;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export type DeleteJournalEntryPagination = {
|
|
37
|
+
total: number;
|
|
38
|
+
perPage: number;
|
|
39
|
+
currentPage: number;
|
|
40
|
+
totalPages: number;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export type DeleteJournalEntryMeta = {
|
|
44
|
+
warnings?: Array<string> | null | undefined;
|
|
45
|
+
pagination?: DeleteJournalEntryPagination | null | undefined;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export type DeleteJournalEntryData = {
|
|
49
|
+
id?: string | undefined;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export type DeleteJournalEntryErrors = {};
|
|
53
|
+
|
|
54
|
+
export type DeleteJournalEntryRawData = {};
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Journal entry deleted successfully
|
|
58
|
+
*/
|
|
59
|
+
export type DeleteJournalEntryResponse = {
|
|
60
|
+
meta?: DeleteJournalEntryMeta | null | undefined;
|
|
61
|
+
data: DeleteJournalEntryData;
|
|
62
|
+
errors: DeleteJournalEntryErrors | null;
|
|
63
|
+
rawData: DeleteJournalEntryRawData | null;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
/** @internal */
|
|
67
|
+
export type DeleteJournalEntryRequest$Outbound = {
|
|
68
|
+
journalEntryId: string;
|
|
69
|
+
environmentName?: string | undefined;
|
|
70
|
+
companyId?: string | undefined;
|
|
71
|
+
apiKey?: string | undefined;
|
|
72
|
+
accountKey?: string | undefined;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
/** @internal */
|
|
76
|
+
export const DeleteJournalEntryRequest$outboundSchema: z.ZodMiniType<
|
|
77
|
+
DeleteJournalEntryRequest$Outbound,
|
|
78
|
+
DeleteJournalEntryRequest
|
|
79
|
+
> = z.object({
|
|
80
|
+
journalEntryId: z.string(),
|
|
81
|
+
environmentName: z.optional(z.string()),
|
|
82
|
+
companyId: z.optional(z.string()),
|
|
83
|
+
apiKey: z.optional(z.string()),
|
|
84
|
+
accountKey: z.optional(z.string()),
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
export function deleteJournalEntryRequestToJSON(
|
|
88
|
+
deleteJournalEntryRequest: DeleteJournalEntryRequest,
|
|
89
|
+
): string {
|
|
90
|
+
return JSON.stringify(
|
|
91
|
+
DeleteJournalEntryRequest$outboundSchema.parse(deleteJournalEntryRequest),
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** @internal */
|
|
96
|
+
export const DeleteJournalEntryPagination$inboundSchema: z.ZodMiniType<
|
|
97
|
+
DeleteJournalEntryPagination,
|
|
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 deleteJournalEntryPaginationFromJSON(
|
|
107
|
+
jsonString: string,
|
|
108
|
+
): SafeParseResult<DeleteJournalEntryPagination, SDKValidationError> {
|
|
109
|
+
return safeParse(
|
|
110
|
+
jsonString,
|
|
111
|
+
(x) => DeleteJournalEntryPagination$inboundSchema.parse(JSON.parse(x)),
|
|
112
|
+
`Failed to parse 'DeleteJournalEntryPagination' from JSON`,
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/** @internal */
|
|
117
|
+
export const DeleteJournalEntryMeta$inboundSchema: z.ZodMiniType<
|
|
118
|
+
DeleteJournalEntryMeta,
|
|
119
|
+
unknown
|
|
120
|
+
> = z.object({
|
|
121
|
+
warnings: z.optional(z.nullable(z.array(types.string()))),
|
|
122
|
+
pagination: z.optional(
|
|
123
|
+
z.nullable(z.lazy(() => DeleteJournalEntryPagination$inboundSchema)),
|
|
124
|
+
),
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
export function deleteJournalEntryMetaFromJSON(
|
|
128
|
+
jsonString: string,
|
|
129
|
+
): SafeParseResult<DeleteJournalEntryMeta, SDKValidationError> {
|
|
130
|
+
return safeParse(
|
|
131
|
+
jsonString,
|
|
132
|
+
(x) => DeleteJournalEntryMeta$inboundSchema.parse(JSON.parse(x)),
|
|
133
|
+
`Failed to parse 'DeleteJournalEntryMeta' from JSON`,
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/** @internal */
|
|
138
|
+
export const DeleteJournalEntryData$inboundSchema: z.ZodMiniType<
|
|
139
|
+
DeleteJournalEntryData,
|
|
140
|
+
unknown
|
|
141
|
+
> = z.object({
|
|
142
|
+
id: types.optional(types.string()),
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
export function deleteJournalEntryDataFromJSON(
|
|
146
|
+
jsonString: string,
|
|
147
|
+
): SafeParseResult<DeleteJournalEntryData, SDKValidationError> {
|
|
148
|
+
return safeParse(
|
|
149
|
+
jsonString,
|
|
150
|
+
(x) => DeleteJournalEntryData$inboundSchema.parse(JSON.parse(x)),
|
|
151
|
+
`Failed to parse 'DeleteJournalEntryData' from JSON`,
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/** @internal */
|
|
156
|
+
export const DeleteJournalEntryErrors$inboundSchema: z.ZodMiniType<
|
|
157
|
+
DeleteJournalEntryErrors,
|
|
158
|
+
unknown
|
|
159
|
+
> = z.object({});
|
|
160
|
+
|
|
161
|
+
export function deleteJournalEntryErrorsFromJSON(
|
|
162
|
+
jsonString: string,
|
|
163
|
+
): SafeParseResult<DeleteJournalEntryErrors, SDKValidationError> {
|
|
164
|
+
return safeParse(
|
|
165
|
+
jsonString,
|
|
166
|
+
(x) => DeleteJournalEntryErrors$inboundSchema.parse(JSON.parse(x)),
|
|
167
|
+
`Failed to parse 'DeleteJournalEntryErrors' from JSON`,
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/** @internal */
|
|
172
|
+
export const DeleteJournalEntryRawData$inboundSchema: z.ZodMiniType<
|
|
173
|
+
DeleteJournalEntryRawData,
|
|
174
|
+
unknown
|
|
175
|
+
> = z.object({});
|
|
176
|
+
|
|
177
|
+
export function deleteJournalEntryRawDataFromJSON(
|
|
178
|
+
jsonString: string,
|
|
179
|
+
): SafeParseResult<DeleteJournalEntryRawData, SDKValidationError> {
|
|
180
|
+
return safeParse(
|
|
181
|
+
jsonString,
|
|
182
|
+
(x) => DeleteJournalEntryRawData$inboundSchema.parse(JSON.parse(x)),
|
|
183
|
+
`Failed to parse 'DeleteJournalEntryRawData' from JSON`,
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/** @internal */
|
|
188
|
+
export const DeleteJournalEntryResponse$inboundSchema: z.ZodMiniType<
|
|
189
|
+
DeleteJournalEntryResponse,
|
|
190
|
+
unknown
|
|
191
|
+
> = z.object({
|
|
192
|
+
meta: z.optional(
|
|
193
|
+
z.nullable(z.lazy(() => DeleteJournalEntryMeta$inboundSchema)),
|
|
194
|
+
),
|
|
195
|
+
data: z.lazy(() => DeleteJournalEntryData$inboundSchema),
|
|
196
|
+
errors: types.nullable(z.lazy(() => DeleteJournalEntryErrors$inboundSchema)),
|
|
197
|
+
rawData: types.nullable(
|
|
198
|
+
z.lazy(() => DeleteJournalEntryRawData$inboundSchema),
|
|
199
|
+
),
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
export function deleteJournalEntryResponseFromJSON(
|
|
203
|
+
jsonString: string,
|
|
204
|
+
): SafeParseResult<DeleteJournalEntryResponse, SDKValidationError> {
|
|
205
|
+
return safeParse(
|
|
206
|
+
jsonString,
|
|
207
|
+
(x) => DeleteJournalEntryResponse$inboundSchema.parse(JSON.parse(x)),
|
|
208
|
+
`Failed to parse 'DeleteJournalEntryResponse' from JSON`,
|
|
209
|
+
);
|
|
210
|
+
}
|
|
@@ -44,6 +44,7 @@ export * from "./delete-bill.js";
|
|
|
44
44
|
export * from "./delete-end-user.js";
|
|
45
45
|
export * from "./delete-event-subscriptions.js";
|
|
46
46
|
export * from "./delete-item.js";
|
|
47
|
+
export * from "./delete-journal-entry.js";
|
|
47
48
|
export * from "./delete-payment.js";
|
|
48
49
|
export * from "./delete-registered-system.js";
|
|
49
50
|
export * from "./delete-vendor-credit.js";
|
|
@@ -36,12 +36,14 @@ export type PaymentTermResponseDto = {
|
|
|
36
36
|
description: string | null;
|
|
37
37
|
discountDays: number | null;
|
|
38
38
|
discountDays2: number | null;
|
|
39
|
+
discountDaysCalculation: string | null;
|
|
39
40
|
discountPercentage: number | null;
|
|
40
41
|
discountPercentage2: number | null;
|
|
41
42
|
discountPeriods: Array<DiscountPeriodResponse> | null;
|
|
42
43
|
dueType: PaymentTermResponseDtoDueType | null;
|
|
43
44
|
name: string | null;
|
|
44
45
|
paymentDays: number | null;
|
|
46
|
+
paymentDaysCalculation: string | null;
|
|
45
47
|
paymentMethod: PaymentMethod | null;
|
|
46
48
|
updatedDate: string | null;
|
|
47
49
|
};
|
|
@@ -66,6 +68,7 @@ export const PaymentTermResponseDto$inboundSchema: z.ZodMiniType<
|
|
|
66
68
|
description: types.nullable(types.string()),
|
|
67
69
|
discountDays: types.nullable(types.number()),
|
|
68
70
|
discountDays2: types.nullable(types.number()),
|
|
71
|
+
discountDaysCalculation: types.nullable(types.string()),
|
|
69
72
|
discountPercentage: types.nullable(types.number()),
|
|
70
73
|
discountPercentage2: types.nullable(types.number()),
|
|
71
74
|
discountPeriods: types.nullable(
|
|
@@ -74,6 +77,7 @@ export const PaymentTermResponseDto$inboundSchema: z.ZodMiniType<
|
|
|
74
77
|
dueType: types.nullable(PaymentTermResponseDtoDueType$inboundSchema),
|
|
75
78
|
name: types.nullable(types.string()),
|
|
76
79
|
paymentDays: types.nullable(types.number()),
|
|
80
|
+
paymentDaysCalculation: types.nullable(types.string()),
|
|
77
81
|
paymentMethod: types.nullable(PaymentMethod$inboundSchema),
|
|
78
82
|
updatedDate: types.nullable(types.string()),
|
|
79
83
|
});
|
package/src/sdk/accounting.ts
CHANGED
|
@@ -35,6 +35,7 @@ import { accountingCreateVendorCredit } from "../funcs/accounting-create-vendor-
|
|
|
35
35
|
import { accountingDeleteBill } from "../funcs/accounting-delete-bill.js";
|
|
36
36
|
import { accountingDeleteEventSubscriptions } from "../funcs/accounting-delete-event-subscriptions.js";
|
|
37
37
|
import { accountingDeleteItem } from "../funcs/accounting-delete-item.js";
|
|
38
|
+
import { accountingDeleteJournalEntry } from "../funcs/accounting-delete-journal-entry.js";
|
|
38
39
|
import { accountingDeletePayment } from "../funcs/accounting-delete-payment.js";
|
|
39
40
|
import { accountingDeleteVendorCredit } from "../funcs/accounting-delete-vendor-credit.js";
|
|
40
41
|
import { accountingGetAccount } from "../funcs/accounting-get-account.js";
|
|
@@ -728,6 +729,17 @@ export class Accounting extends ClientSDK {
|
|
|
728
729
|
));
|
|
729
730
|
}
|
|
730
731
|
|
|
732
|
+
async deleteJournalEntry(
|
|
733
|
+
request: operations.DeleteJournalEntryRequest,
|
|
734
|
+
options?: RequestOptions,
|
|
735
|
+
): Promise<operations.DeleteJournalEntryResponse> {
|
|
736
|
+
return unwrapAsync(accountingDeleteJournalEntry(
|
|
737
|
+
this,
|
|
738
|
+
request,
|
|
739
|
+
options,
|
|
740
|
+
));
|
|
741
|
+
}
|
|
742
|
+
|
|
731
743
|
async createJournalEntries(
|
|
732
744
|
request: operations.CreateJournalEntriesRequest,
|
|
733
745
|
options?: RequestOptions,
|