@maesn/typescript-sdk 0.8.19 → 0.8.21

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.
Files changed (42) hide show
  1. package/README.md +2 -0
  2. package/esm/funcs/accounting-get-open-items-async.d.ts +11 -0
  3. package/esm/funcs/accounting-get-open-items-async.d.ts.map +1 -0
  4. package/esm/funcs/accounting-get-open-items-async.js +89 -0
  5. package/esm/funcs/accounting-get-open-items-async.js.map +1 -0
  6. package/esm/lib/config.d.ts +3 -3
  7. package/esm/lib/config.js +3 -3
  8. package/esm/lib/config.js.map +1 -1
  9. package/esm/models/create-journal-entry-request-dto.d.ts +2 -0
  10. package/esm/models/create-journal-entry-request-dto.d.ts.map +1 -1
  11. package/esm/models/create-journal-entry-request-dto.js +1 -0
  12. package/esm/models/create-journal-entry-request-dto.js.map +1 -1
  13. package/esm/models/journal-entry-response-dto.d.ts +1 -0
  14. package/esm/models/journal-entry-response-dto.d.ts.map +1 -1
  15. package/esm/models/journal-entry-response-dto.js +1 -0
  16. package/esm/models/journal-entry-response-dto.js.map +1 -1
  17. package/esm/models/operations/get-open-items-async.d.ts +98 -0
  18. package/esm/models/operations/get-open-items-async.d.ts.map +1 -0
  19. package/esm/models/operations/get-open-items-async.js +69 -0
  20. package/esm/models/operations/get-open-items-async.js.map +1 -0
  21. package/esm/models/operations/index.d.ts +1 -0
  22. package/esm/models/operations/index.d.ts.map +1 -1
  23. package/esm/models/operations/index.js +1 -0
  24. package/esm/models/operations/index.js.map +1 -1
  25. package/esm/models/task-id-response-dto.d.ts +1 -0
  26. package/esm/models/task-id-response-dto.d.ts.map +1 -1
  27. package/esm/models/task-id-response-dto.js +1 -0
  28. package/esm/models/task-id-response-dto.js.map +1 -1
  29. package/esm/sdk/accounting.d.ts +1 -0
  30. package/esm/sdk/accounting.d.ts.map +1 -1
  31. package/esm/sdk/accounting.js +4 -0
  32. package/esm/sdk/accounting.js.map +1 -1
  33. package/jsr.json +1 -1
  34. package/package.json +1 -1
  35. package/src/funcs/accounting-get-open-items-async.ts +184 -0
  36. package/src/lib/config.ts +3 -3
  37. package/src/models/create-journal-entry-request-dto.ts +3 -0
  38. package/src/models/journal-entry-response-dto.ts +2 -0
  39. package/src/models/operations/get-open-items-async.ts +217 -0
  40. package/src/models/operations/index.ts +1 -0
  41. package/src/models/task-id-response-dto.ts +2 -0
  42. package/src/sdk/accounting.ts +12 -0
@@ -0,0 +1,217 @@
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 GetOpenItemsAsyncGlobals = {
14
+ apiKey?: string | undefined;
15
+ accountKey?: string | undefined;
16
+ };
17
+
18
+ export const GetOpenItemsAsyncLimit = {
19
+ Five: 5,
20
+ Ten: 10,
21
+ Twenty: 20,
22
+ Fifty: 50,
23
+ OneHundred: 100,
24
+ } as const;
25
+ export type GetOpenItemsAsyncLimit = ClosedEnum<typeof GetOpenItemsAsyncLimit>;
26
+
27
+ export type GetOpenItemsAsyncRequest = {
28
+ page?: number | undefined;
29
+ limit?: GetOpenItemsAsyncLimit | undefined;
30
+ /**
31
+ * Environment name (required for multi-environment systems such as Business Central)
32
+ */
33
+ environmentName?: string | undefined;
34
+ /**
35
+ * ID of the company (required for multi-company target systems)
36
+ */
37
+ companyId?: string | undefined;
38
+ /**
39
+ * When true, returns the unprocessed response from the upstream target system
40
+ */
41
+ rawData?: boolean | undefined;
42
+ /**
43
+ * ISO 8601 start date of the fiscal year used for balance calculation
44
+ */
45
+ fiscalYearStartDate?: string | undefined;
46
+ /**
47
+ * API key
48
+ */
49
+ apiKey?: string | undefined;
50
+ /**
51
+ * Account key
52
+ */
53
+ accountKey?: string | undefined;
54
+ };
55
+
56
+ export type GetOpenItemsAsyncPagination = {
57
+ total: number;
58
+ perPage: number;
59
+ currentPage: number;
60
+ totalPages: number;
61
+ };
62
+
63
+ export type GetOpenItemsAsyncMeta = {
64
+ warnings?: Array<string> | null | undefined;
65
+ pagination?: GetOpenItemsAsyncPagination | null | undefined;
66
+ };
67
+
68
+ export type GetOpenItemsAsyncErrors = {};
69
+
70
+ export type GetOpenItemsAsyncRawData = {};
71
+
72
+ /**
73
+ * Open items fetch queued successfully. Processed asynchronously and returns 202 with taskId.
74
+ */
75
+ export type GetOpenItemsAsyncResponse = {
76
+ meta?: GetOpenItemsAsyncMeta | null | undefined;
77
+ data: models.TaskIdResponseDto;
78
+ errors: GetOpenItemsAsyncErrors | null;
79
+ rawData: GetOpenItemsAsyncRawData | null;
80
+ };
81
+
82
+ /** @internal */
83
+ export const GetOpenItemsAsyncLimit$outboundSchema: z.ZodMiniEnum<
84
+ typeof GetOpenItemsAsyncLimit
85
+ > = z.enum(GetOpenItemsAsyncLimit);
86
+
87
+ /** @internal */
88
+ export type GetOpenItemsAsyncRequest$Outbound = {
89
+ page?: number | undefined;
90
+ limit?: number | undefined;
91
+ environmentName?: string | undefined;
92
+ companyId?: string | undefined;
93
+ rawData?: boolean | undefined;
94
+ fiscalYearStartDate?: string | undefined;
95
+ apiKey?: string | undefined;
96
+ accountKey?: string | undefined;
97
+ };
98
+
99
+ /** @internal */
100
+ export const GetOpenItemsAsyncRequest$outboundSchema: z.ZodMiniType<
101
+ GetOpenItemsAsyncRequest$Outbound,
102
+ GetOpenItemsAsyncRequest
103
+ > = z.object({
104
+ page: z.optional(z.number()),
105
+ limit: z.optional(GetOpenItemsAsyncLimit$outboundSchema),
106
+ environmentName: z.optional(z.string()),
107
+ companyId: z.optional(z.string()),
108
+ rawData: z.optional(z.boolean()),
109
+ fiscalYearStartDate: z.optional(z.string()),
110
+ apiKey: z.optional(z.string()),
111
+ accountKey: z.optional(z.string()),
112
+ });
113
+
114
+ export function getOpenItemsAsyncRequestToJSON(
115
+ getOpenItemsAsyncRequest: GetOpenItemsAsyncRequest,
116
+ ): string {
117
+ return JSON.stringify(
118
+ GetOpenItemsAsyncRequest$outboundSchema.parse(getOpenItemsAsyncRequest),
119
+ );
120
+ }
121
+
122
+ /** @internal */
123
+ export const GetOpenItemsAsyncPagination$inboundSchema: z.ZodMiniType<
124
+ GetOpenItemsAsyncPagination,
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 getOpenItemsAsyncPaginationFromJSON(
134
+ jsonString: string,
135
+ ): SafeParseResult<GetOpenItemsAsyncPagination, SDKValidationError> {
136
+ return safeParse(
137
+ jsonString,
138
+ (x) => GetOpenItemsAsyncPagination$inboundSchema.parse(JSON.parse(x)),
139
+ `Failed to parse 'GetOpenItemsAsyncPagination' from JSON`,
140
+ );
141
+ }
142
+
143
+ /** @internal */
144
+ export const GetOpenItemsAsyncMeta$inboundSchema: z.ZodMiniType<
145
+ GetOpenItemsAsyncMeta,
146
+ unknown
147
+ > = z.object({
148
+ warnings: z.optional(z.nullable(z.array(types.string()))),
149
+ pagination: z.optional(
150
+ z.nullable(z.lazy(() => GetOpenItemsAsyncPagination$inboundSchema)),
151
+ ),
152
+ });
153
+
154
+ export function getOpenItemsAsyncMetaFromJSON(
155
+ jsonString: string,
156
+ ): SafeParseResult<GetOpenItemsAsyncMeta, SDKValidationError> {
157
+ return safeParse(
158
+ jsonString,
159
+ (x) => GetOpenItemsAsyncMeta$inboundSchema.parse(JSON.parse(x)),
160
+ `Failed to parse 'GetOpenItemsAsyncMeta' from JSON`,
161
+ );
162
+ }
163
+
164
+ /** @internal */
165
+ export const GetOpenItemsAsyncErrors$inboundSchema: z.ZodMiniType<
166
+ GetOpenItemsAsyncErrors,
167
+ unknown
168
+ > = z.object({});
169
+
170
+ export function getOpenItemsAsyncErrorsFromJSON(
171
+ jsonString: string,
172
+ ): SafeParseResult<GetOpenItemsAsyncErrors, SDKValidationError> {
173
+ return safeParse(
174
+ jsonString,
175
+ (x) => GetOpenItemsAsyncErrors$inboundSchema.parse(JSON.parse(x)),
176
+ `Failed to parse 'GetOpenItemsAsyncErrors' from JSON`,
177
+ );
178
+ }
179
+
180
+ /** @internal */
181
+ export const GetOpenItemsAsyncRawData$inboundSchema: z.ZodMiniType<
182
+ GetOpenItemsAsyncRawData,
183
+ unknown
184
+ > = z.object({});
185
+
186
+ export function getOpenItemsAsyncRawDataFromJSON(
187
+ jsonString: string,
188
+ ): SafeParseResult<GetOpenItemsAsyncRawData, SDKValidationError> {
189
+ return safeParse(
190
+ jsonString,
191
+ (x) => GetOpenItemsAsyncRawData$inboundSchema.parse(JSON.parse(x)),
192
+ `Failed to parse 'GetOpenItemsAsyncRawData' from JSON`,
193
+ );
194
+ }
195
+
196
+ /** @internal */
197
+ export const GetOpenItemsAsyncResponse$inboundSchema: z.ZodMiniType<
198
+ GetOpenItemsAsyncResponse,
199
+ unknown
200
+ > = z.object({
201
+ meta: z.optional(
202
+ z.nullable(z.lazy(() => GetOpenItemsAsyncMeta$inboundSchema)),
203
+ ),
204
+ data: models.TaskIdResponseDto$inboundSchema,
205
+ errors: types.nullable(z.lazy(() => GetOpenItemsAsyncErrors$inboundSchema)),
206
+ rawData: types.nullable(z.lazy(() => GetOpenItemsAsyncRawData$inboundSchema)),
207
+ });
208
+
209
+ export function getOpenItemsAsyncResponseFromJSON(
210
+ jsonString: string,
211
+ ): SafeParseResult<GetOpenItemsAsyncResponse, SDKValidationError> {
212
+ return safeParse(
213
+ jsonString,
214
+ (x) => GetOpenItemsAsyncResponse$inboundSchema.parse(JSON.parse(x)),
215
+ `Failed to parse 'GetOpenItemsAsyncResponse' from JSON`,
216
+ );
217
+ }
@@ -108,6 +108,7 @@ export * from "./get-offer-line-item.js";
108
108
  export * from "./get-offer-line-items.js";
109
109
  export * from "./get-offer.js";
110
110
  export * from "./get-offers.js";
111
+ export * from "./get-open-items-async.js";
111
112
  export * from "./get-open-items.js";
112
113
  export * from "./get-payment-term.js";
113
114
  export * from "./get-payment-terms.js";
@@ -10,6 +10,7 @@ import { SDKValidationError } from "./errors/sdk-validation-error.js";
10
10
 
11
11
  export type TaskIdResponseDto = {
12
12
  taskId: string | null;
13
+ objectId: string | null;
13
14
  };
14
15
 
15
16
  /** @internal */
@@ -18,6 +19,7 @@ export const TaskIdResponseDto$inboundSchema: z.ZodMiniType<
18
19
  unknown
19
20
  > = z.object({
20
21
  taskId: types.nullable(types.string()),
22
+ objectId: types.nullable(types.string()),
21
23
  });
22
24
 
23
25
  export function taskIdResponseDtoFromJSON(
@@ -86,6 +86,7 @@ import { accountingGetOfferLineItem } from "../funcs/accounting-get-offer-line-i
86
86
  import { accountingGetOfferLineItems } from "../funcs/accounting-get-offer-line-items.js";
87
87
  import { accountingGetOffer } from "../funcs/accounting-get-offer.js";
88
88
  import { accountingGetOffers } from "../funcs/accounting-get-offers.js";
89
+ import { accountingGetOpenItemsAsync } from "../funcs/accounting-get-open-items-async.js";
89
90
  import { accountingGetOpenItems } from "../funcs/accounting-get-open-items.js";
90
91
  import { accountingGetPaymentTerm } from "../funcs/accounting-get-payment-term.js";
91
92
  import { accountingGetPaymentTerms } from "../funcs/accounting-get-payment-terms.js";
@@ -1397,6 +1398,17 @@ export class Accounting extends ClientSDK {
1397
1398
  ));
1398
1399
  }
1399
1400
 
1401
+ async getOpenItemsAsync(
1402
+ request?: operations.GetOpenItemsAsyncRequest | undefined,
1403
+ options?: RequestOptions,
1404
+ ): Promise<operations.GetOpenItemsAsyncResponse> {
1405
+ return unwrapAsync(accountingGetOpenItemsAsync(
1406
+ this,
1407
+ request,
1408
+ options,
1409
+ ));
1410
+ }
1411
+
1400
1412
  async getTrialBalance(
1401
1413
  request?: operations.GetTrialBalanceRequest | undefined,
1402
1414
  options?: RequestOptions,