@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.
- 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-booking-proposal-request-dto-v2.d.ts +2 -0
- package/esm/models/create-booking-proposal-request-dto-v2.d.ts.map +1 -1
- package/esm/models/create-booking-proposal-request-dto-v2.js +1 -0
- package/esm/models/create-booking-proposal-request-dto-v2.js.map +1 -1
- package/esm/models/create-booking-proposal-request-dto.d.ts +2 -0
- package/esm/models/create-booking-proposal-request-dto.d.ts.map +1 -1
- package/esm/models/create-booking-proposal-request-dto.js +1 -0
- package/esm/models/create-booking-proposal-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/submission-page-style-dto.d.ts +4 -0
- package/esm/models/submission-page-style-dto.d.ts.map +1 -1
- package/esm/models/submission-page-style-dto.js +2 -0
- package/esm/models/submission-page-style-dto.js.map +1 -1
- package/esm/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 +2 -2
- 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-booking-proposal-request-dto-v2.ts +3 -0
- package/src/models/create-booking-proposal-request-dto.ts +3 -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/submission-page-style-dto.ts +6 -0
- package/src/models/tax-rate-request-common-dto.ts +39 -0
- package/src/sdk/accounting.ts +36 -0
|
@@ -8,7 +8,9 @@ export type CreateSalesOrderLineItemRequestDto = {
|
|
|
8
8
|
itemId?: string | undefined;
|
|
9
9
|
description?: string | undefined;
|
|
10
10
|
itemName?: string | undefined;
|
|
11
|
+
lineNumber?: string | undefined;
|
|
11
12
|
optional?: boolean | undefined;
|
|
13
|
+
parentLineNumber?: string | undefined;
|
|
12
14
|
quantity?: number | undefined;
|
|
13
15
|
taxCode?: string | undefined;
|
|
14
16
|
taxRatePercentage?: number | undefined;
|
|
@@ -28,7 +30,9 @@ export type CreateSalesOrderLineItemRequestDto$Outbound = {
|
|
|
28
30
|
itemId?: string | undefined;
|
|
29
31
|
description?: string | undefined;
|
|
30
32
|
itemName?: string | undefined;
|
|
33
|
+
lineNumber?: string | undefined;
|
|
31
34
|
optional?: boolean | undefined;
|
|
35
|
+
parentLineNumber?: string | undefined;
|
|
32
36
|
quantity?: number | undefined;
|
|
33
37
|
taxCode?: string | undefined;
|
|
34
38
|
taxRatePercentage?: number | undefined;
|
|
@@ -51,7 +55,9 @@ export const CreateSalesOrderLineItemRequestDto$outboundSchema: z.ZodMiniType<
|
|
|
51
55
|
itemId: z.optional(z.string()),
|
|
52
56
|
description: z.optional(z.string()),
|
|
53
57
|
itemName: z.optional(z.string()),
|
|
58
|
+
lineNumber: z.optional(z.string()),
|
|
54
59
|
optional: z.optional(z.boolean()),
|
|
60
|
+
parentLineNumber: z.optional(z.string()),
|
|
55
61
|
quantity: z.optional(z.number()),
|
|
56
62
|
taxCode: z.optional(z.string()),
|
|
57
63
|
taxRatePercentage: z.optional(z.number()),
|
package/src/models/index.ts
CHANGED
|
@@ -141,6 +141,7 @@ export * from "./subscription.js";
|
|
|
141
141
|
export * from "./system-registration-dto.js";
|
|
142
142
|
export * from "./task-id-response-dto.js";
|
|
143
143
|
export * from "./tax-rate-input.js";
|
|
144
|
+
export * from "./tax-rate-request-common-dto.js";
|
|
144
145
|
export * from "./tax-rate-request-dto-v2.js";
|
|
145
146
|
export * from "./tax-rate-response-dto.js";
|
|
146
147
|
export * from "./transaction-response-dto.js";
|
|
@@ -238,7 +238,7 @@ export type JournalEntryResponseDto = {
|
|
|
238
238
|
description: string | null;
|
|
239
239
|
documentId: string | null;
|
|
240
240
|
dueDate?: string | null | undefined;
|
|
241
|
-
exchangeRate
|
|
241
|
+
exchangeRate: string | null;
|
|
242
242
|
files: Array<string> | null;
|
|
243
243
|
isProvisional: boolean | null;
|
|
244
244
|
isReversal: boolean | null;
|
|
@@ -250,6 +250,7 @@ export type JournalEntryResponseDto = {
|
|
|
250
250
|
taxAssignmentDate?: string | null | undefined;
|
|
251
251
|
transactionDate: string | null;
|
|
252
252
|
updatedDate: string | null;
|
|
253
|
+
version: string | null;
|
|
253
254
|
};
|
|
254
255
|
|
|
255
256
|
/** @internal */
|
|
@@ -321,7 +322,7 @@ export const JournalEntryResponseDto$inboundSchema: z.ZodMiniType<
|
|
|
321
322
|
description: types.nullable(types.string()),
|
|
322
323
|
documentId: types.nullable(types.string()),
|
|
323
324
|
dueDate: z.optional(z.nullable(types.string())),
|
|
324
|
-
exchangeRate:
|
|
325
|
+
exchangeRate: types.nullable(types.string()),
|
|
325
326
|
files: types.nullable(z.array(types.string())),
|
|
326
327
|
isProvisional: types.nullable(types.boolean()),
|
|
327
328
|
isReversal: types.nullable(types.boolean()),
|
|
@@ -333,6 +334,7 @@ export const JournalEntryResponseDto$inboundSchema: z.ZodMiniType<
|
|
|
333
334
|
taxAssignmentDate: z.optional(z.nullable(types.string())),
|
|
334
335
|
transactionDate: types.nullable(types.string()),
|
|
335
336
|
updatedDate: types.nullable(types.string()),
|
|
337
|
+
version: types.nullable(types.string()),
|
|
336
338
|
});
|
|
337
339
|
|
|
338
340
|
export function journalEntryResponseDtoFromJSON(
|
|
@@ -30,6 +30,7 @@ export type OfferResponseDto = {
|
|
|
30
30
|
contactId: string | null;
|
|
31
31
|
createdDate: string | null;
|
|
32
32
|
currency: string | null;
|
|
33
|
+
expirationDate: string | null;
|
|
33
34
|
lineItems: Array<OfferLineItemResponseDto> | null;
|
|
34
35
|
name: string | null;
|
|
35
36
|
offerDate: string | null;
|
|
@@ -61,6 +62,7 @@ export const OfferResponseDto$inboundSchema: z.ZodMiniType<
|
|
|
61
62
|
contactId: types.nullable(types.string()),
|
|
62
63
|
createdDate: types.nullable(types.string()),
|
|
63
64
|
currency: types.nullable(types.string()),
|
|
65
|
+
expirationDate: types.nullable(types.string()),
|
|
64
66
|
lineItems: types.nullable(z.array(OfferLineItemResponseDto$inboundSchema)),
|
|
65
67
|
name: types.nullable(types.string()),
|
|
66
68
|
offerDate: types.nullable(types.string()),
|
|
@@ -0,0 +1,185 @@
|
|
|
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 DeleteItemGlobals = {
|
|
13
|
+
apiKey?: string | undefined;
|
|
14
|
+
accountKey?: string | undefined;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type DeleteItemRequest = {
|
|
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
|
+
};
|
|
36
|
+
|
|
37
|
+
export type DeleteItemPagination = {
|
|
38
|
+
total: number;
|
|
39
|
+
perPage: number;
|
|
40
|
+
currentPage: number;
|
|
41
|
+
totalPages: number;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export type DeleteItemMeta = {
|
|
45
|
+
warnings?: Array<string> | null | undefined;
|
|
46
|
+
pagination?: DeleteItemPagination | null | undefined;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export type DeleteItemErrors = {};
|
|
50
|
+
|
|
51
|
+
export type DeleteItemRawData = {};
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Item deleted successfully
|
|
55
|
+
*/
|
|
56
|
+
export type DeleteItemResponse = {
|
|
57
|
+
meta?: DeleteItemMeta | null | undefined;
|
|
58
|
+
data: models.ItemResponseDto;
|
|
59
|
+
errors: DeleteItemErrors | null;
|
|
60
|
+
rawData: DeleteItemRawData | null;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/** @internal */
|
|
64
|
+
export type DeleteItemRequest$Outbound = {
|
|
65
|
+
itemId: string;
|
|
66
|
+
environmentName?: string | undefined;
|
|
67
|
+
companyId?: string | undefined;
|
|
68
|
+
apiKey?: string | undefined;
|
|
69
|
+
accountKey?: string | undefined;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
/** @internal */
|
|
73
|
+
export const DeleteItemRequest$outboundSchema: z.ZodMiniType<
|
|
74
|
+
DeleteItemRequest$Outbound,
|
|
75
|
+
DeleteItemRequest
|
|
76
|
+
> = z.object({
|
|
77
|
+
itemId: z.string(),
|
|
78
|
+
environmentName: z.optional(z.string()),
|
|
79
|
+
companyId: z.optional(z.string()),
|
|
80
|
+
apiKey: z.optional(z.string()),
|
|
81
|
+
accountKey: z.optional(z.string()),
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
export function deleteItemRequestToJSON(
|
|
85
|
+
deleteItemRequest: DeleteItemRequest,
|
|
86
|
+
): string {
|
|
87
|
+
return JSON.stringify(
|
|
88
|
+
DeleteItemRequest$outboundSchema.parse(deleteItemRequest),
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** @internal */
|
|
93
|
+
export const DeleteItemPagination$inboundSchema: z.ZodMiniType<
|
|
94
|
+
DeleteItemPagination,
|
|
95
|
+
unknown
|
|
96
|
+
> = z.object({
|
|
97
|
+
total: types.number(),
|
|
98
|
+
perPage: types.number(),
|
|
99
|
+
currentPage: types.number(),
|
|
100
|
+
totalPages: types.number(),
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
export function deleteItemPaginationFromJSON(
|
|
104
|
+
jsonString: string,
|
|
105
|
+
): SafeParseResult<DeleteItemPagination, SDKValidationError> {
|
|
106
|
+
return safeParse(
|
|
107
|
+
jsonString,
|
|
108
|
+
(x) => DeleteItemPagination$inboundSchema.parse(JSON.parse(x)),
|
|
109
|
+
`Failed to parse 'DeleteItemPagination' from JSON`,
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/** @internal */
|
|
114
|
+
export const DeleteItemMeta$inboundSchema: z.ZodMiniType<
|
|
115
|
+
DeleteItemMeta,
|
|
116
|
+
unknown
|
|
117
|
+
> = z.object({
|
|
118
|
+
warnings: z.optional(z.nullable(z.array(types.string()))),
|
|
119
|
+
pagination: z.optional(
|
|
120
|
+
z.nullable(z.lazy(() => DeleteItemPagination$inboundSchema)),
|
|
121
|
+
),
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
export function deleteItemMetaFromJSON(
|
|
125
|
+
jsonString: string,
|
|
126
|
+
): SafeParseResult<DeleteItemMeta, SDKValidationError> {
|
|
127
|
+
return safeParse(
|
|
128
|
+
jsonString,
|
|
129
|
+
(x) => DeleteItemMeta$inboundSchema.parse(JSON.parse(x)),
|
|
130
|
+
`Failed to parse 'DeleteItemMeta' from JSON`,
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/** @internal */
|
|
135
|
+
export const DeleteItemErrors$inboundSchema: z.ZodMiniType<
|
|
136
|
+
DeleteItemErrors,
|
|
137
|
+
unknown
|
|
138
|
+
> = z.object({});
|
|
139
|
+
|
|
140
|
+
export function deleteItemErrorsFromJSON(
|
|
141
|
+
jsonString: string,
|
|
142
|
+
): SafeParseResult<DeleteItemErrors, SDKValidationError> {
|
|
143
|
+
return safeParse(
|
|
144
|
+
jsonString,
|
|
145
|
+
(x) => DeleteItemErrors$inboundSchema.parse(JSON.parse(x)),
|
|
146
|
+
`Failed to parse 'DeleteItemErrors' from JSON`,
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/** @internal */
|
|
151
|
+
export const DeleteItemRawData$inboundSchema: z.ZodMiniType<
|
|
152
|
+
DeleteItemRawData,
|
|
153
|
+
unknown
|
|
154
|
+
> = z.object({});
|
|
155
|
+
|
|
156
|
+
export function deleteItemRawDataFromJSON(
|
|
157
|
+
jsonString: string,
|
|
158
|
+
): SafeParseResult<DeleteItemRawData, SDKValidationError> {
|
|
159
|
+
return safeParse(
|
|
160
|
+
jsonString,
|
|
161
|
+
(x) => DeleteItemRawData$inboundSchema.parse(JSON.parse(x)),
|
|
162
|
+
`Failed to parse 'DeleteItemRawData' from JSON`,
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/** @internal */
|
|
167
|
+
export const DeleteItemResponse$inboundSchema: z.ZodMiniType<
|
|
168
|
+
DeleteItemResponse,
|
|
169
|
+
unknown
|
|
170
|
+
> = z.object({
|
|
171
|
+
meta: z.optional(z.nullable(z.lazy(() => DeleteItemMeta$inboundSchema))),
|
|
172
|
+
data: models.ItemResponseDto$inboundSchema,
|
|
173
|
+
errors: types.nullable(z.lazy(() => DeleteItemErrors$inboundSchema)),
|
|
174
|
+
rawData: types.nullable(z.lazy(() => DeleteItemRawData$inboundSchema)),
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
export function deleteItemResponseFromJSON(
|
|
178
|
+
jsonString: string,
|
|
179
|
+
): SafeParseResult<DeleteItemResponse, SDKValidationError> {
|
|
180
|
+
return safeParse(
|
|
181
|
+
jsonString,
|
|
182
|
+
(x) => DeleteItemResponse$inboundSchema.parse(JSON.parse(x)),
|
|
183
|
+
`Failed to parse 'DeleteItemResponse' from JSON`,
|
|
184
|
+
);
|
|
185
|
+
}
|
|
@@ -28,6 +28,10 @@ export type GetJournalEntryRequest = {
|
|
|
28
28
|
* Journal code used to scope the journal entry lookup on systems that require it
|
|
29
29
|
*/
|
|
30
30
|
journalCode?: string | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Version of the journal entry
|
|
33
|
+
*/
|
|
34
|
+
version?: string | undefined;
|
|
31
35
|
/**
|
|
32
36
|
* When true, returns the unprocessed response from the upstream target system
|
|
33
37
|
*/
|
|
@@ -74,6 +78,7 @@ export type GetJournalEntryRequest$Outbound = {
|
|
|
74
78
|
environmentName?: string | undefined;
|
|
75
79
|
companyId?: string | undefined;
|
|
76
80
|
journalCode?: string | undefined;
|
|
81
|
+
version?: string | undefined;
|
|
77
82
|
rawData?: boolean | undefined;
|
|
78
83
|
apiKey?: string | undefined;
|
|
79
84
|
accountKey?: string | undefined;
|
|
@@ -88,6 +93,7 @@ export const GetJournalEntryRequest$outboundSchema: z.ZodMiniType<
|
|
|
88
93
|
environmentName: z.optional(z.string()),
|
|
89
94
|
companyId: z.optional(z.string()),
|
|
90
95
|
journalCode: z.optional(z.string()),
|
|
96
|
+
version: z.optional(z.string()),
|
|
91
97
|
rawData: z.optional(z.boolean()),
|
|
92
98
|
apiKey: z.optional(z.string()),
|
|
93
99
|
accountKey: z.optional(z.string()),
|
|
@@ -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
|
+
}
|