@maesn/typescript-sdk 0.8.5 → 0.8.7
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-create-payment.js +1 -0
- package/esm/funcs/accounting-create-payment.js.map +1 -1
- package/esm/funcs/accounting-get-contacts-async.d.ts +11 -0
- package/esm/funcs/accounting-get-contacts-async.d.ts.map +1 -0
- package/esm/funcs/accounting-get-contacts-async.js +80 -0
- package/esm/funcs/accounting-get-contacts-async.js.map +1 -0
- package/esm/funcs/accounting-get-projects-async.d.ts +11 -0
- package/esm/funcs/accounting-get-projects-async.d.ts.map +1 -0
- package/esm/funcs/accounting-get-projects-async.js +80 -0
- package/esm/funcs/accounting-get-projects-async.js.map +1 -0
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/models/bill-response-dto.d.ts +2 -2
- package/esm/models/bill-response-dto.d.ts.map +1 -1
- package/esm/models/bill-response-dto.js +2 -2
- package/esm/models/bill-response-dto.js.map +1 -1
- package/esm/models/create-journal-line-item.d.ts +4 -0
- package/esm/models/create-journal-line-item.d.ts.map +1 -1
- package/esm/models/create-journal-line-item.js +2 -0
- package/esm/models/create-journal-line-item.js.map +1 -1
- package/esm/models/journal-line-item.d.ts +1 -0
- package/esm/models/journal-line-item.d.ts.map +1 -1
- package/esm/models/journal-line-item.js +1 -0
- package/esm/models/journal-line-item.js.map +1 -1
- package/esm/models/operations/create-payment.d.ts +5 -0
- package/esm/models/operations/create-payment.d.ts.map +1 -1
- package/esm/models/operations/create-payment.js +1 -0
- package/esm/models/operations/create-payment.js.map +1 -1
- package/esm/models/operations/get-contacts-async.d.ts +63 -0
- package/esm/models/operations/get-contacts-async.d.ts.map +1 -0
- package/esm/models/operations/get-contacts-async.js +54 -0
- package/esm/models/operations/get-contacts-async.js.map +1 -0
- package/esm/models/operations/get-projects-async.d.ts +63 -0
- package/esm/models/operations/get-projects-async.d.ts.map +1 -0
- package/esm/models/operations/get-projects-async.js +54 -0
- package/esm/models/operations/get-projects-async.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/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-create-payment.ts +1 -0
- package/src/funcs/accounting-get-contacts-async.ts +174 -0
- package/src/funcs/accounting-get-projects-async.ts +174 -0
- package/src/lib/config.ts +3 -3
- package/src/models/bill-response-dto.ts +4 -4
- package/src/models/create-journal-line-item.ts +6 -0
- package/src/models/journal-line-item.ts +2 -0
- package/src/models/operations/create-payment.ts +6 -0
- package/src/models/operations/get-contacts-async.ts +172 -0
- package/src/models/operations/get-projects-async.ts +172 -0
- package/src/models/operations/index.ts +2 -0
- package/src/sdk/accounting.ts +24 -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,6 +65,7 @@ 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";
|
|
70
71
|
export * from "./get-credit-note-documents.js";
|
|
@@ -112,6 +113,7 @@ export * from "./get-payment.js";
|
|
|
112
113
|
export * from "./get-payments.js";
|
|
113
114
|
export * from "./get-profile.js";
|
|
114
115
|
export * from "./get-project.js";
|
|
116
|
+
export * from "./get-projects-async.js";
|
|
115
117
|
export * from "./get-projects.js";
|
|
116
118
|
export * from "./get-purchase-order-line-item.js";
|
|
117
119
|
export * from "./get-purchase-order-line-items.js";
|
package/src/sdk/accounting.ts
CHANGED
|
@@ -48,6 +48,7 @@ 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";
|
|
52
53
|
import { accountingGetCreditNoteDocuments } from "../funcs/accounting-get-credit-note-documents.js";
|
|
53
54
|
import { accountingGetCreditNote } from "../funcs/accounting-get-credit-note.js";
|
|
@@ -90,6 +91,7 @@ import { accountingGetPayment } from "../funcs/accounting-get-payment.js";
|
|
|
90
91
|
import { accountingGetPayments } from "../funcs/accounting-get-payments.js";
|
|
91
92
|
import { accountingGetProfile } from "../funcs/accounting-get-profile.js";
|
|
92
93
|
import { accountingGetProject } from "../funcs/accounting-get-project.js";
|
|
94
|
+
import { accountingGetProjectsAsync } from "../funcs/accounting-get-projects-async.js";
|
|
93
95
|
import { accountingGetProjects } from "../funcs/accounting-get-projects.js";
|
|
94
96
|
import { accountingGetPurchaseOrderLineItem } from "../funcs/accounting-get-purchase-order-line-item.js";
|
|
95
97
|
import { accountingGetPurchaseOrderLineItems } from "../funcs/accounting-get-purchase-order-line-items.js";
|
|
@@ -323,6 +325,17 @@ export class Accounting extends ClientSDK {
|
|
|
323
325
|
));
|
|
324
326
|
}
|
|
325
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
|
+
|
|
326
339
|
async getContacts(
|
|
327
340
|
request?: operations.GetContactsRequest | undefined,
|
|
328
341
|
options?: RequestOptions,
|
|
@@ -818,6 +831,17 @@ export class Accounting extends ClientSDK {
|
|
|
818
831
|
));
|
|
819
832
|
}
|
|
820
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
|
+
|
|
821
845
|
async getProject(
|
|
822
846
|
request: operations.GetProjectRequest,
|
|
823
847
|
options?: RequestOptions,
|