@maesn/typescript-sdk 0.8.3 → 0.8.5

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 (36) hide show
  1. package/README.md +4 -0
  2. package/esm/funcs/accounting-get-credit-note-documents.d.ts +11 -0
  3. package/esm/funcs/accounting-get-credit-note-documents.d.ts.map +1 -0
  4. package/esm/funcs/accounting-get-credit-note-documents.js +91 -0
  5. package/esm/funcs/accounting-get-credit-note-documents.js.map +1 -0
  6. package/esm/funcs/accounting-get-journal-entries-async.d.ts +11 -0
  7. package/esm/funcs/accounting-get-journal-entries-async.d.ts.map +1 -0
  8. package/esm/funcs/accounting-get-journal-entries-async.js +85 -0
  9. package/esm/funcs/accounting-get-journal-entries-async.js.map +1 -0
  10. package/esm/lib/config.d.ts +3 -3
  11. package/esm/lib/config.js +3 -3
  12. package/esm/models/operations/get-credit-note-documents.d.ts +75 -0
  13. package/esm/models/operations/get-credit-note-documents.d.ts.map +1 -0
  14. package/esm/models/operations/get-credit-note-documents.js +57 -0
  15. package/esm/models/operations/get-credit-note-documents.js.map +1 -0
  16. package/esm/models/operations/get-journal-entries-async.d.ts +73 -0
  17. package/esm/models/operations/get-journal-entries-async.d.ts.map +1 -0
  18. package/esm/models/operations/get-journal-entries-async.js +56 -0
  19. package/esm/models/operations/get-journal-entries-async.js.map +1 -0
  20. package/esm/models/operations/index.d.ts +2 -0
  21. package/esm/models/operations/index.d.ts.map +1 -1
  22. package/esm/models/operations/index.js +2 -0
  23. package/esm/models/operations/index.js.map +1 -1
  24. package/esm/sdk/accounting.d.ts +2 -0
  25. package/esm/sdk/accounting.d.ts.map +1 -1
  26. package/esm/sdk/accounting.js +8 -0
  27. package/esm/sdk/accounting.js.map +1 -1
  28. package/jsr.json +1 -1
  29. package/package.json +1 -1
  30. package/src/funcs/accounting-get-credit-note-documents.ts +185 -0
  31. package/src/funcs/accounting-get-journal-entries-async.ts +180 -0
  32. package/src/lib/config.ts +3 -3
  33. package/src/models/operations/get-credit-note-documents.ts +193 -0
  34. package/src/models/operations/get-journal-entries-async.ts +190 -0
  35. package/src/models/operations/index.ts +2 -0
  36. package/src/sdk/accounting.ts +24 -0
@@ -0,0 +1,193 @@
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 GetCreditNoteDocumentsGlobals = {
13
+ apiKey?: string | undefined;
14
+ accountKey?: string | undefined;
15
+ };
16
+
17
+ export type GetCreditNoteDocumentsRequest = {
18
+ creditNoteId: 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 GetCreditNoteDocumentsPagination = {
38
+ total: number;
39
+ perPage: number;
40
+ currentPage: number;
41
+ totalPages: number;
42
+ };
43
+
44
+ export type GetCreditNoteDocumentsMeta = {
45
+ warnings?: Array<string> | null | undefined;
46
+ pagination?: GetCreditNoteDocumentsPagination | null | undefined;
47
+ };
48
+
49
+ export type GetCreditNoteDocumentsErrors = {};
50
+
51
+ export type GetCreditNoteDocumentsRawData = {};
52
+
53
+ /**
54
+ * Documents associated with the specified credit note
55
+ */
56
+ export type GetCreditNoteDocumentsResponse = {
57
+ meta?: GetCreditNoteDocumentsMeta | null | undefined;
58
+ data: Array<models.DocumentResponseDto>;
59
+ errors: GetCreditNoteDocumentsErrors | null;
60
+ rawData: GetCreditNoteDocumentsRawData | null;
61
+ };
62
+
63
+ /** @internal */
64
+ export type GetCreditNoteDocumentsRequest$Outbound = {
65
+ creditNoteId: string;
66
+ environmentName?: string | undefined;
67
+ companyId?: string | undefined;
68
+ apiKey?: string | undefined;
69
+ accountKey?: string | undefined;
70
+ };
71
+
72
+ /** @internal */
73
+ export const GetCreditNoteDocumentsRequest$outboundSchema: z.ZodMiniType<
74
+ GetCreditNoteDocumentsRequest$Outbound,
75
+ GetCreditNoteDocumentsRequest
76
+ > = z.object({
77
+ creditNoteId: 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 getCreditNoteDocumentsRequestToJSON(
85
+ getCreditNoteDocumentsRequest: GetCreditNoteDocumentsRequest,
86
+ ): string {
87
+ return JSON.stringify(
88
+ GetCreditNoteDocumentsRequest$outboundSchema.parse(
89
+ getCreditNoteDocumentsRequest,
90
+ ),
91
+ );
92
+ }
93
+
94
+ /** @internal */
95
+ export const GetCreditNoteDocumentsPagination$inboundSchema: z.ZodMiniType<
96
+ GetCreditNoteDocumentsPagination,
97
+ unknown
98
+ > = z.object({
99
+ total: types.number(),
100
+ perPage: types.number(),
101
+ currentPage: types.number(),
102
+ totalPages: types.number(),
103
+ });
104
+
105
+ export function getCreditNoteDocumentsPaginationFromJSON(
106
+ jsonString: string,
107
+ ): SafeParseResult<GetCreditNoteDocumentsPagination, SDKValidationError> {
108
+ return safeParse(
109
+ jsonString,
110
+ (x) => GetCreditNoteDocumentsPagination$inboundSchema.parse(JSON.parse(x)),
111
+ `Failed to parse 'GetCreditNoteDocumentsPagination' from JSON`,
112
+ );
113
+ }
114
+
115
+ /** @internal */
116
+ export const GetCreditNoteDocumentsMeta$inboundSchema: z.ZodMiniType<
117
+ GetCreditNoteDocumentsMeta,
118
+ unknown
119
+ > = z.object({
120
+ warnings: z.optional(z.nullable(z.array(types.string()))),
121
+ pagination: z.optional(
122
+ z.nullable(z.lazy(() => GetCreditNoteDocumentsPagination$inboundSchema)),
123
+ ),
124
+ });
125
+
126
+ export function getCreditNoteDocumentsMetaFromJSON(
127
+ jsonString: string,
128
+ ): SafeParseResult<GetCreditNoteDocumentsMeta, SDKValidationError> {
129
+ return safeParse(
130
+ jsonString,
131
+ (x) => GetCreditNoteDocumentsMeta$inboundSchema.parse(JSON.parse(x)),
132
+ `Failed to parse 'GetCreditNoteDocumentsMeta' from JSON`,
133
+ );
134
+ }
135
+
136
+ /** @internal */
137
+ export const GetCreditNoteDocumentsErrors$inboundSchema: z.ZodMiniType<
138
+ GetCreditNoteDocumentsErrors,
139
+ unknown
140
+ > = z.object({});
141
+
142
+ export function getCreditNoteDocumentsErrorsFromJSON(
143
+ jsonString: string,
144
+ ): SafeParseResult<GetCreditNoteDocumentsErrors, SDKValidationError> {
145
+ return safeParse(
146
+ jsonString,
147
+ (x) => GetCreditNoteDocumentsErrors$inboundSchema.parse(JSON.parse(x)),
148
+ `Failed to parse 'GetCreditNoteDocumentsErrors' from JSON`,
149
+ );
150
+ }
151
+
152
+ /** @internal */
153
+ export const GetCreditNoteDocumentsRawData$inboundSchema: z.ZodMiniType<
154
+ GetCreditNoteDocumentsRawData,
155
+ unknown
156
+ > = z.object({});
157
+
158
+ export function getCreditNoteDocumentsRawDataFromJSON(
159
+ jsonString: string,
160
+ ): SafeParseResult<GetCreditNoteDocumentsRawData, SDKValidationError> {
161
+ return safeParse(
162
+ jsonString,
163
+ (x) => GetCreditNoteDocumentsRawData$inboundSchema.parse(JSON.parse(x)),
164
+ `Failed to parse 'GetCreditNoteDocumentsRawData' from JSON`,
165
+ );
166
+ }
167
+
168
+ /** @internal */
169
+ export const GetCreditNoteDocumentsResponse$inboundSchema: z.ZodMiniType<
170
+ GetCreditNoteDocumentsResponse,
171
+ unknown
172
+ > = z.object({
173
+ meta: z.optional(
174
+ z.nullable(z.lazy(() => GetCreditNoteDocumentsMeta$inboundSchema)),
175
+ ),
176
+ data: z.array(models.DocumentResponseDto$inboundSchema),
177
+ errors: types.nullable(
178
+ z.lazy(() => GetCreditNoteDocumentsErrors$inboundSchema),
179
+ ),
180
+ rawData: types.nullable(
181
+ z.lazy(() => GetCreditNoteDocumentsRawData$inboundSchema),
182
+ ),
183
+ });
184
+
185
+ export function getCreditNoteDocumentsResponseFromJSON(
186
+ jsonString: string,
187
+ ): SafeParseResult<GetCreditNoteDocumentsResponse, SDKValidationError> {
188
+ return safeParse(
189
+ jsonString,
190
+ (x) => GetCreditNoteDocumentsResponse$inboundSchema.parse(JSON.parse(x)),
191
+ `Failed to parse 'GetCreditNoteDocumentsResponse' from JSON`,
192
+ );
193
+ }
@@ -0,0 +1,190 @@
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 GetJournalEntriesAsyncGlobals = {
13
+ apiKey?: string | undefined;
14
+ accountKey?: string | undefined;
15
+ };
16
+
17
+ export type GetJournalEntriesAsyncRequest = {
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 GetJournalEntriesAsyncPagination = {
37
+ total: number;
38
+ perPage: number;
39
+ currentPage: number;
40
+ totalPages: number;
41
+ };
42
+
43
+ export type GetJournalEntriesAsyncMeta = {
44
+ warnings?: Array<string> | null | undefined;
45
+ pagination?: GetJournalEntriesAsyncPagination | null | undefined;
46
+ };
47
+
48
+ export type GetJournalEntriesAsyncErrors = {};
49
+
50
+ export type GetJournalEntriesAsyncRawData = {};
51
+
52
+ /**
53
+ * Journal entries fetch queued successfully. Processed asynchronously and returns 202 with taskId.
54
+ */
55
+ export type GetJournalEntriesAsyncResponse = {
56
+ meta?: GetJournalEntriesAsyncMeta | null | undefined;
57
+ data: models.TaskIdResponseDto;
58
+ errors: GetJournalEntriesAsyncErrors | null;
59
+ rawData: GetJournalEntriesAsyncRawData | null;
60
+ };
61
+
62
+ /** @internal */
63
+ export type GetJournalEntriesAsyncRequest$Outbound = {
64
+ environmentName?: string | undefined;
65
+ companyId?: string | undefined;
66
+ apiKey?: string | undefined;
67
+ accountKey?: string | undefined;
68
+ };
69
+
70
+ /** @internal */
71
+ export const GetJournalEntriesAsyncRequest$outboundSchema: z.ZodMiniType<
72
+ GetJournalEntriesAsyncRequest$Outbound,
73
+ GetJournalEntriesAsyncRequest
74
+ > = z.object({
75
+ environmentName: z.optional(z.string()),
76
+ companyId: z.optional(z.string()),
77
+ apiKey: z.optional(z.string()),
78
+ accountKey: z.optional(z.string()),
79
+ });
80
+
81
+ export function getJournalEntriesAsyncRequestToJSON(
82
+ getJournalEntriesAsyncRequest: GetJournalEntriesAsyncRequest,
83
+ ): string {
84
+ return JSON.stringify(
85
+ GetJournalEntriesAsyncRequest$outboundSchema.parse(
86
+ getJournalEntriesAsyncRequest,
87
+ ),
88
+ );
89
+ }
90
+
91
+ /** @internal */
92
+ export const GetJournalEntriesAsyncPagination$inboundSchema: z.ZodMiniType<
93
+ GetJournalEntriesAsyncPagination,
94
+ unknown
95
+ > = z.object({
96
+ total: types.number(),
97
+ perPage: types.number(),
98
+ currentPage: types.number(),
99
+ totalPages: types.number(),
100
+ });
101
+
102
+ export function getJournalEntriesAsyncPaginationFromJSON(
103
+ jsonString: string,
104
+ ): SafeParseResult<GetJournalEntriesAsyncPagination, SDKValidationError> {
105
+ return safeParse(
106
+ jsonString,
107
+ (x) => GetJournalEntriesAsyncPagination$inboundSchema.parse(JSON.parse(x)),
108
+ `Failed to parse 'GetJournalEntriesAsyncPagination' from JSON`,
109
+ );
110
+ }
111
+
112
+ /** @internal */
113
+ export const GetJournalEntriesAsyncMeta$inboundSchema: z.ZodMiniType<
114
+ GetJournalEntriesAsyncMeta,
115
+ unknown
116
+ > = z.object({
117
+ warnings: z.optional(z.nullable(z.array(types.string()))),
118
+ pagination: z.optional(
119
+ z.nullable(z.lazy(() => GetJournalEntriesAsyncPagination$inboundSchema)),
120
+ ),
121
+ });
122
+
123
+ export function getJournalEntriesAsyncMetaFromJSON(
124
+ jsonString: string,
125
+ ): SafeParseResult<GetJournalEntriesAsyncMeta, SDKValidationError> {
126
+ return safeParse(
127
+ jsonString,
128
+ (x) => GetJournalEntriesAsyncMeta$inboundSchema.parse(JSON.parse(x)),
129
+ `Failed to parse 'GetJournalEntriesAsyncMeta' from JSON`,
130
+ );
131
+ }
132
+
133
+ /** @internal */
134
+ export const GetJournalEntriesAsyncErrors$inboundSchema: z.ZodMiniType<
135
+ GetJournalEntriesAsyncErrors,
136
+ unknown
137
+ > = z.object({});
138
+
139
+ export function getJournalEntriesAsyncErrorsFromJSON(
140
+ jsonString: string,
141
+ ): SafeParseResult<GetJournalEntriesAsyncErrors, SDKValidationError> {
142
+ return safeParse(
143
+ jsonString,
144
+ (x) => GetJournalEntriesAsyncErrors$inboundSchema.parse(JSON.parse(x)),
145
+ `Failed to parse 'GetJournalEntriesAsyncErrors' from JSON`,
146
+ );
147
+ }
148
+
149
+ /** @internal */
150
+ export const GetJournalEntriesAsyncRawData$inboundSchema: z.ZodMiniType<
151
+ GetJournalEntriesAsyncRawData,
152
+ unknown
153
+ > = z.object({});
154
+
155
+ export function getJournalEntriesAsyncRawDataFromJSON(
156
+ jsonString: string,
157
+ ): SafeParseResult<GetJournalEntriesAsyncRawData, SDKValidationError> {
158
+ return safeParse(
159
+ jsonString,
160
+ (x) => GetJournalEntriesAsyncRawData$inboundSchema.parse(JSON.parse(x)),
161
+ `Failed to parse 'GetJournalEntriesAsyncRawData' from JSON`,
162
+ );
163
+ }
164
+
165
+ /** @internal */
166
+ export const GetJournalEntriesAsyncResponse$inboundSchema: z.ZodMiniType<
167
+ GetJournalEntriesAsyncResponse,
168
+ unknown
169
+ > = z.object({
170
+ meta: z.optional(
171
+ z.nullable(z.lazy(() => GetJournalEntriesAsyncMeta$inboundSchema)),
172
+ ),
173
+ data: models.TaskIdResponseDto$inboundSchema,
174
+ errors: types.nullable(
175
+ z.lazy(() => GetJournalEntriesAsyncErrors$inboundSchema),
176
+ ),
177
+ rawData: types.nullable(
178
+ z.lazy(() => GetJournalEntriesAsyncRawData$inboundSchema),
179
+ ),
180
+ });
181
+
182
+ export function getJournalEntriesAsyncResponseFromJSON(
183
+ jsonString: string,
184
+ ): SafeParseResult<GetJournalEntriesAsyncResponse, SDKValidationError> {
185
+ return safeParse(
186
+ jsonString,
187
+ (x) => GetJournalEntriesAsyncResponse$inboundSchema.parse(JSON.parse(x)),
188
+ `Failed to parse 'GetJournalEntriesAsyncResponse' from JSON`,
189
+ );
190
+ }
@@ -67,6 +67,7 @@ export * from "./get-contact-v2.js";
67
67
  export * from "./get-contact.js";
68
68
  export * from "./get-contacts-v2.js";
69
69
  export * from "./get-contacts.js";
70
+ export * from "./get-credit-note-documents.js";
70
71
  export * from "./get-credit-note.js";
71
72
  export * from "./get-credit-notes.js";
72
73
  export * from "./get-customer.js";
@@ -91,6 +92,7 @@ export * from "./get-invoice.js";
91
92
  export * from "./get-invoices.js";
92
93
  export * from "./get-item.js";
93
94
  export * from "./get-items.js";
95
+ export * from "./get-journal-entries-async.js";
94
96
  export * from "./get-journal-entries.js";
95
97
  export * from "./get-journal-entry-attachment-by-id.js";
96
98
  export * from "./get-journal-entry-attachments.js";
@@ -49,6 +49,7 @@ import { accountingGetBookingProposal } from "../funcs/accounting-get-booking-pr
49
49
  import { accountingGetBookingProposals } from "../funcs/accounting-get-booking-proposals.js";
50
50
  import { accountingGetContact } from "../funcs/accounting-get-contact.js";
51
51
  import { accountingGetContacts } from "../funcs/accounting-get-contacts.js";
52
+ import { accountingGetCreditNoteDocuments } from "../funcs/accounting-get-credit-note-documents.js";
52
53
  import { accountingGetCreditNote } from "../funcs/accounting-get-credit-note.js";
53
54
  import { accountingGetCreditNotes } from "../funcs/accounting-get-credit-notes.js";
54
55
  import { accountingGetCustomer } from "../funcs/accounting-get-customer.js";
@@ -69,6 +70,7 @@ import { accountingGetInvoice } from "../funcs/accounting-get-invoice.js";
69
70
  import { accountingGetInvoices } from "../funcs/accounting-get-invoices.js";
70
71
  import { accountingGetItem } from "../funcs/accounting-get-item.js";
71
72
  import { accountingGetItems } from "../funcs/accounting-get-items.js";
73
+ import { accountingGetJournalEntriesAsync } from "../funcs/accounting-get-journal-entries-async.js";
72
74
  import { accountingGetJournalEntries } from "../funcs/accounting-get-journal-entries.js";
73
75
  import { accountingGetJournalEntryAttachmentById } from "../funcs/accounting-get-journal-entry-attachment-by-id.js";
74
76
  import { accountingGetJournalEntryAttachments } from "../funcs/accounting-get-journal-entry-attachments.js";
@@ -629,6 +631,17 @@ export class Accounting extends ClientSDK {
629
631
  ));
630
632
  }
631
633
 
634
+ async getJournalEntriesAsync(
635
+ request?: operations.GetJournalEntriesAsyncRequest | undefined,
636
+ options?: RequestOptions,
637
+ ): Promise<operations.GetJournalEntriesAsyncResponse> {
638
+ return unwrapAsync(accountingGetJournalEntriesAsync(
639
+ this,
640
+ request,
641
+ options,
642
+ ));
643
+ }
644
+
632
645
  async getJournalEntry(
633
646
  request: operations.GetJournalEntryRequest,
634
647
  options?: RequestOptions,
@@ -1344,6 +1357,17 @@ export class Accounting extends ClientSDK {
1344
1357
  ));
1345
1358
  }
1346
1359
 
1360
+ async getCreditNoteDocuments(
1361
+ request: operations.GetCreditNoteDocumentsRequest,
1362
+ options?: RequestOptions,
1363
+ ): Promise<operations.GetCreditNoteDocumentsResponse> {
1364
+ return unwrapAsync(accountingGetCreditNoteDocuments(
1365
+ this,
1366
+ request,
1367
+ options,
1368
+ ));
1369
+ }
1370
+
1347
1371
  async getFiscalYears(
1348
1372
  request?: operations.GetFiscalYearsRequest | undefined,
1349
1373
  options?: RequestOptions,