@maesn/typescript-sdk 0.8.4 → 0.8.6

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 (61) hide show
  1. package/README.md +6 -0
  2. package/esm/funcs/accounting-get-contacts-async.d.ts +11 -0
  3. package/esm/funcs/accounting-get-contacts-async.d.ts.map +1 -0
  4. package/esm/funcs/accounting-get-contacts-async.js +80 -0
  5. package/esm/funcs/accounting-get-contacts-async.js.map +1 -0
  6. package/esm/funcs/accounting-get-credit-note-documents.d.ts +11 -0
  7. package/esm/funcs/accounting-get-credit-note-documents.d.ts.map +1 -0
  8. package/esm/funcs/accounting-get-credit-note-documents.js +91 -0
  9. package/esm/funcs/accounting-get-credit-note-documents.js.map +1 -0
  10. package/esm/funcs/accounting-get-projects-async.d.ts +11 -0
  11. package/esm/funcs/accounting-get-projects-async.d.ts.map +1 -0
  12. package/esm/funcs/accounting-get-projects-async.js +80 -0
  13. package/esm/funcs/accounting-get-projects-async.js.map +1 -0
  14. package/esm/lib/config.d.ts +3 -3
  15. package/esm/lib/config.js +3 -3
  16. package/esm/models/bill-response-dto.d.ts +2 -2
  17. package/esm/models/bill-response-dto.d.ts.map +1 -1
  18. package/esm/models/bill-response-dto.js +2 -2
  19. package/esm/models/bill-response-dto.js.map +1 -1
  20. package/esm/models/create-journal-line-item.d.ts +4 -0
  21. package/esm/models/create-journal-line-item.d.ts.map +1 -1
  22. package/esm/models/create-journal-line-item.js +2 -0
  23. package/esm/models/create-journal-line-item.js.map +1 -1
  24. package/esm/models/journal-line-item.d.ts +1 -0
  25. package/esm/models/journal-line-item.d.ts.map +1 -1
  26. package/esm/models/journal-line-item.js +1 -0
  27. package/esm/models/journal-line-item.js.map +1 -1
  28. package/esm/models/operations/get-contacts-async.d.ts +63 -0
  29. package/esm/models/operations/get-contacts-async.d.ts.map +1 -0
  30. package/esm/models/operations/get-contacts-async.js +54 -0
  31. package/esm/models/operations/get-contacts-async.js.map +1 -0
  32. package/esm/models/operations/get-credit-note-documents.d.ts +75 -0
  33. package/esm/models/operations/get-credit-note-documents.d.ts.map +1 -0
  34. package/esm/models/operations/get-credit-note-documents.js +57 -0
  35. package/esm/models/operations/get-credit-note-documents.js.map +1 -0
  36. package/esm/models/operations/get-projects-async.d.ts +63 -0
  37. package/esm/models/operations/get-projects-async.d.ts.map +1 -0
  38. package/esm/models/operations/get-projects-async.js +54 -0
  39. package/esm/models/operations/get-projects-async.js.map +1 -0
  40. package/esm/models/operations/index.d.ts +3 -0
  41. package/esm/models/operations/index.d.ts.map +1 -1
  42. package/esm/models/operations/index.js +3 -0
  43. package/esm/models/operations/index.js.map +1 -1
  44. package/esm/sdk/accounting.d.ts +3 -0
  45. package/esm/sdk/accounting.d.ts.map +1 -1
  46. package/esm/sdk/accounting.js +12 -0
  47. package/esm/sdk/accounting.js.map +1 -1
  48. package/jsr.json +1 -1
  49. package/package.json +1 -1
  50. package/src/funcs/accounting-get-contacts-async.ts +174 -0
  51. package/src/funcs/accounting-get-credit-note-documents.ts +185 -0
  52. package/src/funcs/accounting-get-projects-async.ts +174 -0
  53. package/src/lib/config.ts +3 -3
  54. package/src/models/bill-response-dto.ts +4 -4
  55. package/src/models/create-journal-line-item.ts +6 -0
  56. package/src/models/journal-line-item.ts +2 -0
  57. package/src/models/operations/get-contacts-async.ts +172 -0
  58. package/src/models/operations/get-credit-note-documents.ts +193 -0
  59. package/src/models/operations/get-projects-async.ts +172 -0
  60. package/src/models/operations/index.ts +3 -0
  61. package/src/sdk/accounting.ts +36 -0
@@ -0,0 +1,172 @@
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 GetProjectsAsyncGlobals = {
13
+ apiKey?: string | undefined;
14
+ accountKey?: string | undefined;
15
+ };
16
+
17
+ export type GetProjectsAsyncRequest = {
18
+ /**
19
+ * API key
20
+ */
21
+ apiKey?: string | undefined;
22
+ /**
23
+ * Account key
24
+ */
25
+ accountKey?: string | undefined;
26
+ };
27
+
28
+ export type GetProjectsAsyncPagination = {
29
+ total: number;
30
+ perPage: number;
31
+ currentPage: number;
32
+ totalPages: number;
33
+ };
34
+
35
+ export type GetProjectsAsyncMeta = {
36
+ warnings?: Array<string> | null | undefined;
37
+ pagination?: GetProjectsAsyncPagination | null | undefined;
38
+ };
39
+
40
+ export type GetProjectsAsyncErrors = {};
41
+
42
+ export type GetProjectsAsyncRawData = {};
43
+
44
+ /**
45
+ * Projects fetch queued successfully. Processed asynchronously and returns 202 with taskId.
46
+ */
47
+ export type GetProjectsAsyncResponse = {
48
+ meta?: GetProjectsAsyncMeta | null | undefined;
49
+ data: models.TaskIdResponseDto;
50
+ errors: GetProjectsAsyncErrors | null;
51
+ rawData: GetProjectsAsyncRawData | null;
52
+ };
53
+
54
+ /** @internal */
55
+ export type GetProjectsAsyncRequest$Outbound = {
56
+ apiKey?: string | undefined;
57
+ accountKey?: string | undefined;
58
+ };
59
+
60
+ /** @internal */
61
+ export const GetProjectsAsyncRequest$outboundSchema: z.ZodMiniType<
62
+ GetProjectsAsyncRequest$Outbound,
63
+ GetProjectsAsyncRequest
64
+ > = z.object({
65
+ apiKey: z.optional(z.string()),
66
+ accountKey: z.optional(z.string()),
67
+ });
68
+
69
+ export function getProjectsAsyncRequestToJSON(
70
+ getProjectsAsyncRequest: GetProjectsAsyncRequest,
71
+ ): string {
72
+ return JSON.stringify(
73
+ GetProjectsAsyncRequest$outboundSchema.parse(getProjectsAsyncRequest),
74
+ );
75
+ }
76
+
77
+ /** @internal */
78
+ export const GetProjectsAsyncPagination$inboundSchema: z.ZodMiniType<
79
+ GetProjectsAsyncPagination,
80
+ unknown
81
+ > = z.object({
82
+ total: types.number(),
83
+ perPage: types.number(),
84
+ currentPage: types.number(),
85
+ totalPages: types.number(),
86
+ });
87
+
88
+ export function getProjectsAsyncPaginationFromJSON(
89
+ jsonString: string,
90
+ ): SafeParseResult<GetProjectsAsyncPagination, SDKValidationError> {
91
+ return safeParse(
92
+ jsonString,
93
+ (x) => GetProjectsAsyncPagination$inboundSchema.parse(JSON.parse(x)),
94
+ `Failed to parse 'GetProjectsAsyncPagination' from JSON`,
95
+ );
96
+ }
97
+
98
+ /** @internal */
99
+ export const GetProjectsAsyncMeta$inboundSchema: z.ZodMiniType<
100
+ GetProjectsAsyncMeta,
101
+ unknown
102
+ > = z.object({
103
+ warnings: z.optional(z.nullable(z.array(types.string()))),
104
+ pagination: z.optional(
105
+ z.nullable(z.lazy(() => GetProjectsAsyncPagination$inboundSchema)),
106
+ ),
107
+ });
108
+
109
+ export function getProjectsAsyncMetaFromJSON(
110
+ jsonString: string,
111
+ ): SafeParseResult<GetProjectsAsyncMeta, SDKValidationError> {
112
+ return safeParse(
113
+ jsonString,
114
+ (x) => GetProjectsAsyncMeta$inboundSchema.parse(JSON.parse(x)),
115
+ `Failed to parse 'GetProjectsAsyncMeta' from JSON`,
116
+ );
117
+ }
118
+
119
+ /** @internal */
120
+ export const GetProjectsAsyncErrors$inboundSchema: z.ZodMiniType<
121
+ GetProjectsAsyncErrors,
122
+ unknown
123
+ > = z.object({});
124
+
125
+ export function getProjectsAsyncErrorsFromJSON(
126
+ jsonString: string,
127
+ ): SafeParseResult<GetProjectsAsyncErrors, SDKValidationError> {
128
+ return safeParse(
129
+ jsonString,
130
+ (x) => GetProjectsAsyncErrors$inboundSchema.parse(JSON.parse(x)),
131
+ `Failed to parse 'GetProjectsAsyncErrors' from JSON`,
132
+ );
133
+ }
134
+
135
+ /** @internal */
136
+ export const GetProjectsAsyncRawData$inboundSchema: z.ZodMiniType<
137
+ GetProjectsAsyncRawData,
138
+ unknown
139
+ > = z.object({});
140
+
141
+ export function getProjectsAsyncRawDataFromJSON(
142
+ jsonString: string,
143
+ ): SafeParseResult<GetProjectsAsyncRawData, SDKValidationError> {
144
+ return safeParse(
145
+ jsonString,
146
+ (x) => GetProjectsAsyncRawData$inboundSchema.parse(JSON.parse(x)),
147
+ `Failed to parse 'GetProjectsAsyncRawData' from JSON`,
148
+ );
149
+ }
150
+
151
+ /** @internal */
152
+ export const GetProjectsAsyncResponse$inboundSchema: z.ZodMiniType<
153
+ GetProjectsAsyncResponse,
154
+ unknown
155
+ > = z.object({
156
+ meta: z.optional(
157
+ z.nullable(z.lazy(() => GetProjectsAsyncMeta$inboundSchema)),
158
+ ),
159
+ data: models.TaskIdResponseDto$inboundSchema,
160
+ errors: types.nullable(z.lazy(() => GetProjectsAsyncErrors$inboundSchema)),
161
+ rawData: types.nullable(z.lazy(() => GetProjectsAsyncRawData$inboundSchema)),
162
+ });
163
+
164
+ export function getProjectsAsyncResponseFromJSON(
165
+ jsonString: string,
166
+ ): SafeParseResult<GetProjectsAsyncResponse, SDKValidationError> {
167
+ return safeParse(
168
+ jsonString,
169
+ (x) => GetProjectsAsyncResponse$inboundSchema.parse(JSON.parse(x)),
170
+ `Failed to parse 'GetProjectsAsyncResponse' from JSON`,
171
+ );
172
+ }
@@ -65,8 +65,10 @@ export * from "./get-code.js";
65
65
  export * from "./get-companies.js";
66
66
  export * from "./get-contact-v2.js";
67
67
  export * from "./get-contact.js";
68
+ export * from "./get-contacts-async.js";
68
69
  export * from "./get-contacts-v2.js";
69
70
  export * from "./get-contacts.js";
71
+ export * from "./get-credit-note-documents.js";
70
72
  export * from "./get-credit-note.js";
71
73
  export * from "./get-credit-notes.js";
72
74
  export * from "./get-customer.js";
@@ -111,6 +113,7 @@ export * from "./get-payment.js";
111
113
  export * from "./get-payments.js";
112
114
  export * from "./get-profile.js";
113
115
  export * from "./get-project.js";
116
+ export * from "./get-projects-async.js";
114
117
  export * from "./get-projects.js";
115
118
  export * from "./get-purchase-order-line-item.js";
116
119
  export * from "./get-purchase-order-line-items.js";
@@ -48,7 +48,9 @@ import { accountingGetBookingProposalDocument } from "../funcs/accounting-get-bo
48
48
  import { accountingGetBookingProposal } from "../funcs/accounting-get-booking-proposal.js";
49
49
  import { accountingGetBookingProposals } from "../funcs/accounting-get-booking-proposals.js";
50
50
  import { accountingGetContact } from "../funcs/accounting-get-contact.js";
51
+ import { accountingGetContactsAsync } from "../funcs/accounting-get-contacts-async.js";
51
52
  import { accountingGetContacts } from "../funcs/accounting-get-contacts.js";
53
+ import { accountingGetCreditNoteDocuments } from "../funcs/accounting-get-credit-note-documents.js";
52
54
  import { accountingGetCreditNote } from "../funcs/accounting-get-credit-note.js";
53
55
  import { accountingGetCreditNotes } from "../funcs/accounting-get-credit-notes.js";
54
56
  import { accountingGetCustomer } from "../funcs/accounting-get-customer.js";
@@ -89,6 +91,7 @@ import { accountingGetPayment } from "../funcs/accounting-get-payment.js";
89
91
  import { accountingGetPayments } from "../funcs/accounting-get-payments.js";
90
92
  import { accountingGetProfile } from "../funcs/accounting-get-profile.js";
91
93
  import { accountingGetProject } from "../funcs/accounting-get-project.js";
94
+ import { accountingGetProjectsAsync } from "../funcs/accounting-get-projects-async.js";
92
95
  import { accountingGetProjects } from "../funcs/accounting-get-projects.js";
93
96
  import { accountingGetPurchaseOrderLineItem } from "../funcs/accounting-get-purchase-order-line-item.js";
94
97
  import { accountingGetPurchaseOrderLineItems } from "../funcs/accounting-get-purchase-order-line-items.js";
@@ -322,6 +325,17 @@ export class Accounting extends ClientSDK {
322
325
  ));
323
326
  }
324
327
 
328
+ async getContactsAsync(
329
+ request?: operations.GetContactsAsyncRequest | undefined,
330
+ options?: RequestOptions,
331
+ ): Promise<operations.GetContactsAsyncResponse> {
332
+ return unwrapAsync(accountingGetContactsAsync(
333
+ this,
334
+ request,
335
+ options,
336
+ ));
337
+ }
338
+
325
339
  async getContacts(
326
340
  request?: operations.GetContactsRequest | undefined,
327
341
  options?: RequestOptions,
@@ -817,6 +831,17 @@ export class Accounting extends ClientSDK {
817
831
  ));
818
832
  }
819
833
 
834
+ async getProjectsAsync(
835
+ request?: operations.GetProjectsAsyncRequest | undefined,
836
+ options?: RequestOptions,
837
+ ): Promise<operations.GetProjectsAsyncResponse> {
838
+ return unwrapAsync(accountingGetProjectsAsync(
839
+ this,
840
+ request,
841
+ options,
842
+ ));
843
+ }
844
+
820
845
  async getProject(
821
846
  request: operations.GetProjectRequest,
822
847
  options?: RequestOptions,
@@ -1356,6 +1381,17 @@ export class Accounting extends ClientSDK {
1356
1381
  ));
1357
1382
  }
1358
1383
 
1384
+ async getCreditNoteDocuments(
1385
+ request: operations.GetCreditNoteDocumentsRequest,
1386
+ options?: RequestOptions,
1387
+ ): Promise<operations.GetCreditNoteDocumentsResponse> {
1388
+ return unwrapAsync(accountingGetCreditNoteDocuments(
1389
+ this,
1390
+ request,
1391
+ options,
1392
+ ));
1393
+ }
1394
+
1359
1395
  async getFiscalYears(
1360
1396
  request?: operations.GetFiscalYearsRequest | undefined,
1361
1397
  options?: RequestOptions,