@maesn/typescript-sdk 0.8.25 → 0.8.26
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 +4 -0
- package/esm/funcs/accounting-get-currencies.d.ts +11 -0
- package/esm/funcs/accounting-get-currencies.d.ts.map +1 -0
- package/esm/funcs/accounting-get-currencies.js +89 -0
- package/esm/funcs/accounting-get-currencies.js.map +1 -0
- package/esm/funcs/accounting-get-reason-codes.d.ts +11 -0
- package/esm/funcs/accounting-get-reason-codes.d.ts.map +1 -0
- package/esm/funcs/accounting-get-reason-codes.js +89 -0
- package/esm/funcs/accounting-get-reason-codes.js.map +1 -0
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/credit-note-response-dto.d.ts +1 -0
- package/esm/models/credit-note-response-dto.d.ts.map +1 -1
- package/esm/models/credit-note-response-dto.js +1 -0
- package/esm/models/credit-note-response-dto.js.map +1 -1
- package/esm/models/currency-response-dto.d.ts +15 -0
- package/esm/models/currency-response-dto.d.ts.map +1 -0
- package/esm/models/currency-response-dto.js +19 -0
- package/esm/models/currency-response-dto.js.map +1 -0
- package/esm/models/index.d.ts +2 -0
- package/esm/models/index.d.ts.map +1 -1
- package/esm/models/index.js +2 -0
- package/esm/models/index.js.map +1 -1
- package/esm/models/operations/get-currencies.d.ts +98 -0
- package/esm/models/operations/get-currencies.d.ts.map +1 -0
- package/esm/models/operations/get-currencies.js +69 -0
- package/esm/models/operations/get-currencies.js.map +1 -0
- package/esm/models/operations/get-reason-codes.d.ts +98 -0
- package/esm/models/operations/get-reason-codes.d.ts.map +1 -0
- package/esm/models/operations/get-reason-codes.js +69 -0
- package/esm/models/operations/get-reason-codes.js.map +1 -0
- package/esm/models/operations/index.d.ts +2 -0
- package/esm/models/operations/index.d.ts.map +1 -1
- package/esm/models/operations/index.js +2 -0
- package/esm/models/operations/index.js.map +1 -1
- package/esm/models/reason-code-response-dto.d.ts +12 -0
- package/esm/models/reason-code-response-dto.d.ts.map +1 -0
- package/esm/models/reason-code-response-dto.js +16 -0
- package/esm/models/reason-code-response-dto.js.map +1 -0
- package/esm/sdk/accounting.d.ts +2 -0
- package/esm/sdk/accounting.d.ts.map +1 -1
- package/esm/sdk/accounting.js +8 -0
- package/esm/sdk/accounting.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/accounting-get-currencies.ts +184 -0
- package/src/funcs/accounting-get-reason-codes.ts +184 -0
- package/src/lib/config.ts +2 -2
- package/src/models/credit-note-response-dto.ts +2 -0
- package/src/models/currency-response-dto.ts +41 -0
- package/src/models/index.ts +2 -0
- package/src/models/operations/get-currencies.ts +215 -0
- package/src/models/operations/get-reason-codes.ts +215 -0
- package/src/models/operations/index.ts +2 -0
- package/src/models/reason-code-response-dto.ts +35 -0
- package/src/sdk/accounting.ts +24 -0
|
@@ -0,0 +1,215 @@
|
|
|
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 { ClosedEnum } from "../../types/enums.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 GetReasonCodesGlobals = {
|
|
14
|
+
apiKey?: string | undefined;
|
|
15
|
+
accountKey?: string | undefined;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const GetReasonCodesLimit = {
|
|
19
|
+
Five: 5,
|
|
20
|
+
Ten: 10,
|
|
21
|
+
Twenty: 20,
|
|
22
|
+
Fifty: 50,
|
|
23
|
+
OneHundred: 100,
|
|
24
|
+
} as const;
|
|
25
|
+
export type GetReasonCodesLimit = ClosedEnum<typeof GetReasonCodesLimit>;
|
|
26
|
+
|
|
27
|
+
export type GetReasonCodesRequest = {
|
|
28
|
+
page?: number | undefined;
|
|
29
|
+
limit?: GetReasonCodesLimit | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* ISO 8601 timestamp; only records modified after this date are returned
|
|
32
|
+
*/
|
|
33
|
+
lastModifiedAt?: string | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Environment name (required for multi-environment systems such as Business Central)
|
|
36
|
+
*/
|
|
37
|
+
environmentName?: string | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* ID of the company (required for multi-company target systems)
|
|
40
|
+
*/
|
|
41
|
+
companyId?: string | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* When true, returns the unprocessed response from the upstream target system
|
|
44
|
+
*/
|
|
45
|
+
rawData?: boolean | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* API key
|
|
48
|
+
*/
|
|
49
|
+
apiKey?: string | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Account key
|
|
52
|
+
*/
|
|
53
|
+
accountKey?: string | undefined;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export type GetReasonCodesPagination = {
|
|
57
|
+
total: number;
|
|
58
|
+
perPage: number;
|
|
59
|
+
currentPage: number;
|
|
60
|
+
totalPages: number;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export type GetReasonCodesMeta = {
|
|
64
|
+
warnings?: Array<string> | null | undefined;
|
|
65
|
+
pagination?: GetReasonCodesPagination | null | undefined;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export type GetReasonCodesErrors = {};
|
|
69
|
+
|
|
70
|
+
export type GetReasonCodesRawData = {};
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* List of reason codes for the authenticated end user's connected target system
|
|
74
|
+
*/
|
|
75
|
+
export type GetReasonCodesResponse = {
|
|
76
|
+
meta?: GetReasonCodesMeta | null | undefined;
|
|
77
|
+
data: Array<models.ReasonCodeResponseDto>;
|
|
78
|
+
errors: GetReasonCodesErrors | null;
|
|
79
|
+
rawData: GetReasonCodesRawData | null;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
/** @internal */
|
|
83
|
+
export const GetReasonCodesLimit$outboundSchema: z.ZodMiniEnum<
|
|
84
|
+
typeof GetReasonCodesLimit
|
|
85
|
+
> = z.enum(GetReasonCodesLimit);
|
|
86
|
+
|
|
87
|
+
/** @internal */
|
|
88
|
+
export type GetReasonCodesRequest$Outbound = {
|
|
89
|
+
page?: number | undefined;
|
|
90
|
+
limit?: number | undefined;
|
|
91
|
+
lastModifiedAt?: string | undefined;
|
|
92
|
+
environmentName?: string | undefined;
|
|
93
|
+
companyId?: string | undefined;
|
|
94
|
+
rawData?: boolean | undefined;
|
|
95
|
+
apiKey?: string | undefined;
|
|
96
|
+
accountKey?: string | undefined;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
/** @internal */
|
|
100
|
+
export const GetReasonCodesRequest$outboundSchema: z.ZodMiniType<
|
|
101
|
+
GetReasonCodesRequest$Outbound,
|
|
102
|
+
GetReasonCodesRequest
|
|
103
|
+
> = z.object({
|
|
104
|
+
page: z.optional(z.number()),
|
|
105
|
+
limit: z.optional(GetReasonCodesLimit$outboundSchema),
|
|
106
|
+
lastModifiedAt: z.optional(z.string()),
|
|
107
|
+
environmentName: z.optional(z.string()),
|
|
108
|
+
companyId: z.optional(z.string()),
|
|
109
|
+
rawData: z.optional(z.boolean()),
|
|
110
|
+
apiKey: z.optional(z.string()),
|
|
111
|
+
accountKey: z.optional(z.string()),
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
export function getReasonCodesRequestToJSON(
|
|
115
|
+
getReasonCodesRequest: GetReasonCodesRequest,
|
|
116
|
+
): string {
|
|
117
|
+
return JSON.stringify(
|
|
118
|
+
GetReasonCodesRequest$outboundSchema.parse(getReasonCodesRequest),
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/** @internal */
|
|
123
|
+
export const GetReasonCodesPagination$inboundSchema: z.ZodMiniType<
|
|
124
|
+
GetReasonCodesPagination,
|
|
125
|
+
unknown
|
|
126
|
+
> = z.object({
|
|
127
|
+
total: types.number(),
|
|
128
|
+
perPage: types.number(),
|
|
129
|
+
currentPage: types.number(),
|
|
130
|
+
totalPages: types.number(),
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
export function getReasonCodesPaginationFromJSON(
|
|
134
|
+
jsonString: string,
|
|
135
|
+
): SafeParseResult<GetReasonCodesPagination, SDKValidationError> {
|
|
136
|
+
return safeParse(
|
|
137
|
+
jsonString,
|
|
138
|
+
(x) => GetReasonCodesPagination$inboundSchema.parse(JSON.parse(x)),
|
|
139
|
+
`Failed to parse 'GetReasonCodesPagination' from JSON`,
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/** @internal */
|
|
144
|
+
export const GetReasonCodesMeta$inboundSchema: z.ZodMiniType<
|
|
145
|
+
GetReasonCodesMeta,
|
|
146
|
+
unknown
|
|
147
|
+
> = z.object({
|
|
148
|
+
warnings: z.optional(z.nullable(z.array(types.string()))),
|
|
149
|
+
pagination: z.optional(
|
|
150
|
+
z.nullable(z.lazy(() => GetReasonCodesPagination$inboundSchema)),
|
|
151
|
+
),
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
export function getReasonCodesMetaFromJSON(
|
|
155
|
+
jsonString: string,
|
|
156
|
+
): SafeParseResult<GetReasonCodesMeta, SDKValidationError> {
|
|
157
|
+
return safeParse(
|
|
158
|
+
jsonString,
|
|
159
|
+
(x) => GetReasonCodesMeta$inboundSchema.parse(JSON.parse(x)),
|
|
160
|
+
`Failed to parse 'GetReasonCodesMeta' from JSON`,
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/** @internal */
|
|
165
|
+
export const GetReasonCodesErrors$inboundSchema: z.ZodMiniType<
|
|
166
|
+
GetReasonCodesErrors,
|
|
167
|
+
unknown
|
|
168
|
+
> = z.object({});
|
|
169
|
+
|
|
170
|
+
export function getReasonCodesErrorsFromJSON(
|
|
171
|
+
jsonString: string,
|
|
172
|
+
): SafeParseResult<GetReasonCodesErrors, SDKValidationError> {
|
|
173
|
+
return safeParse(
|
|
174
|
+
jsonString,
|
|
175
|
+
(x) => GetReasonCodesErrors$inboundSchema.parse(JSON.parse(x)),
|
|
176
|
+
`Failed to parse 'GetReasonCodesErrors' from JSON`,
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/** @internal */
|
|
181
|
+
export const GetReasonCodesRawData$inboundSchema: z.ZodMiniType<
|
|
182
|
+
GetReasonCodesRawData,
|
|
183
|
+
unknown
|
|
184
|
+
> = z.object({});
|
|
185
|
+
|
|
186
|
+
export function getReasonCodesRawDataFromJSON(
|
|
187
|
+
jsonString: string,
|
|
188
|
+
): SafeParseResult<GetReasonCodesRawData, SDKValidationError> {
|
|
189
|
+
return safeParse(
|
|
190
|
+
jsonString,
|
|
191
|
+
(x) => GetReasonCodesRawData$inboundSchema.parse(JSON.parse(x)),
|
|
192
|
+
`Failed to parse 'GetReasonCodesRawData' from JSON`,
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/** @internal */
|
|
197
|
+
export const GetReasonCodesResponse$inboundSchema: z.ZodMiniType<
|
|
198
|
+
GetReasonCodesResponse,
|
|
199
|
+
unknown
|
|
200
|
+
> = z.object({
|
|
201
|
+
meta: z.optional(z.nullable(z.lazy(() => GetReasonCodesMeta$inboundSchema))),
|
|
202
|
+
data: z.array(models.ReasonCodeResponseDto$inboundSchema),
|
|
203
|
+
errors: types.nullable(z.lazy(() => GetReasonCodesErrors$inboundSchema)),
|
|
204
|
+
rawData: types.nullable(z.lazy(() => GetReasonCodesRawData$inboundSchema)),
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
export function getReasonCodesResponseFromJSON(
|
|
208
|
+
jsonString: string,
|
|
209
|
+
): SafeParseResult<GetReasonCodesResponse, SDKValidationError> {
|
|
210
|
+
return safeParse(
|
|
211
|
+
jsonString,
|
|
212
|
+
(x) => GetReasonCodesResponse$inboundSchema.parse(JSON.parse(x)),
|
|
213
|
+
`Failed to parse 'GetReasonCodesResponse' from JSON`,
|
|
214
|
+
);
|
|
215
|
+
}
|
|
@@ -74,6 +74,7 @@ export * from "./get-contacts.js";
|
|
|
74
74
|
export * from "./get-credit-note-documents.js";
|
|
75
75
|
export * from "./get-credit-note.js";
|
|
76
76
|
export * from "./get-credit-notes.js";
|
|
77
|
+
export * from "./get-currencies.js";
|
|
77
78
|
export * from "./get-customer.js";
|
|
78
79
|
export * from "./get-customers.js";
|
|
79
80
|
export * from "./get-dimensions-by-dimension-v2.js";
|
|
@@ -124,6 +125,7 @@ export * from "./get-purchase-order-line-item.js";
|
|
|
124
125
|
export * from "./get-purchase-order-line-items.js";
|
|
125
126
|
export * from "./get-purchase-order.js";
|
|
126
127
|
export * from "./get-purchase-orders.js";
|
|
128
|
+
export * from "./get-reason-codes.js";
|
|
127
129
|
export * from "./get-registered-systems-masked.js";
|
|
128
130
|
export * from "./get-registered-systems.js";
|
|
129
131
|
export * from "./get-sales-order-lines.js";
|
|
@@ -0,0 +1,35 @@
|
|
|
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 ReasonCodeResponseDto = {
|
|
12
|
+
id: string | null;
|
|
13
|
+
code: string | null;
|
|
14
|
+
description: string | null;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/** @internal */
|
|
18
|
+
export const ReasonCodeResponseDto$inboundSchema: z.ZodMiniType<
|
|
19
|
+
ReasonCodeResponseDto,
|
|
20
|
+
unknown
|
|
21
|
+
> = z.object({
|
|
22
|
+
id: types.nullable(types.string()),
|
|
23
|
+
code: types.nullable(types.string()),
|
|
24
|
+
description: types.nullable(types.string()),
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export function reasonCodeResponseDtoFromJSON(
|
|
28
|
+
jsonString: string,
|
|
29
|
+
): SafeParseResult<ReasonCodeResponseDto, SDKValidationError> {
|
|
30
|
+
return safeParse(
|
|
31
|
+
jsonString,
|
|
32
|
+
(x) => ReasonCodeResponseDto$inboundSchema.parse(JSON.parse(x)),
|
|
33
|
+
`Failed to parse 'ReasonCodeResponseDto' from JSON`,
|
|
34
|
+
);
|
|
35
|
+
}
|
package/src/sdk/accounting.ts
CHANGED
|
@@ -56,6 +56,7 @@ import { accountingGetContacts } from "../funcs/accounting-get-contacts.js";
|
|
|
56
56
|
import { accountingGetCreditNoteDocuments } from "../funcs/accounting-get-credit-note-documents.js";
|
|
57
57
|
import { accountingGetCreditNote } from "../funcs/accounting-get-credit-note.js";
|
|
58
58
|
import { accountingGetCreditNotes } from "../funcs/accounting-get-credit-notes.js";
|
|
59
|
+
import { accountingGetCurrencies } from "../funcs/accounting-get-currencies.js";
|
|
59
60
|
import { accountingGetCustomer } from "../funcs/accounting-get-customer.js";
|
|
60
61
|
import { accountingGetCustomers } from "../funcs/accounting-get-customers.js";
|
|
61
62
|
import { accountingGetDimensionsByDimension } from "../funcs/accounting-get-dimensions-by-dimension.js";
|
|
@@ -102,6 +103,7 @@ import { accountingGetPurchaseOrderLineItem } from "../funcs/accounting-get-purc
|
|
|
102
103
|
import { accountingGetPurchaseOrderLineItems } from "../funcs/accounting-get-purchase-order-line-items.js";
|
|
103
104
|
import { accountingGetPurchaseOrder } from "../funcs/accounting-get-purchase-order.js";
|
|
104
105
|
import { accountingGetPurchaseOrders } from "../funcs/accounting-get-purchase-orders.js";
|
|
106
|
+
import { accountingGetReasonCodes } from "../funcs/accounting-get-reason-codes.js";
|
|
105
107
|
import { accountingGetSalesOrderLines } from "../funcs/accounting-get-sales-order-lines.js";
|
|
106
108
|
import { accountingGetSalesOrder } from "../funcs/accounting-get-sales-order.js";
|
|
107
109
|
import { accountingGetSalesOrders } from "../funcs/accounting-get-sales-orders.js";
|
|
@@ -1531,4 +1533,26 @@ export class Accounting extends ClientSDK {
|
|
|
1531
1533
|
options,
|
|
1532
1534
|
));
|
|
1533
1535
|
}
|
|
1536
|
+
|
|
1537
|
+
async getCurrencies(
|
|
1538
|
+
request?: operations.GetCurrenciesRequest | undefined,
|
|
1539
|
+
options?: RequestOptions,
|
|
1540
|
+
): Promise<operations.GetCurrenciesResponse> {
|
|
1541
|
+
return unwrapAsync(accountingGetCurrencies(
|
|
1542
|
+
this,
|
|
1543
|
+
request,
|
|
1544
|
+
options,
|
|
1545
|
+
));
|
|
1546
|
+
}
|
|
1547
|
+
|
|
1548
|
+
async getReasonCodes(
|
|
1549
|
+
request?: operations.GetReasonCodesRequest | undefined,
|
|
1550
|
+
options?: RequestOptions,
|
|
1551
|
+
): Promise<operations.GetReasonCodesResponse> {
|
|
1552
|
+
return unwrapAsync(accountingGetReasonCodes(
|
|
1553
|
+
this,
|
|
1554
|
+
request,
|
|
1555
|
+
options,
|
|
1556
|
+
));
|
|
1557
|
+
}
|
|
1534
1558
|
}
|