@maesn/typescript-sdk 0.8.5 → 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.
- package/README.md +4 -0
- 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/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-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/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,174 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { MaesnCore } from "../core.js";
|
|
7
|
+
import { encodeSimple } from "../lib/encodings.js";
|
|
8
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
9
|
+
import * as M from "../lib/matchers.js";
|
|
10
|
+
import { compactMap } from "../lib/primitives.js";
|
|
11
|
+
import { safeParse } from "../lib/schemas.js";
|
|
12
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/http-client-errors.js";
|
|
21
|
+
import { MaesnError } from "../models/errors/maesn-error.js";
|
|
22
|
+
import { ResponseValidationError } from "../models/errors/response-validation-error.js";
|
|
23
|
+
import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
|
|
24
|
+
import * as operations from "../models/operations/index.js";
|
|
25
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
26
|
+
import { Result } from "../types/fp.js";
|
|
27
|
+
|
|
28
|
+
export function accountingGetProjectsAsync(
|
|
29
|
+
client: MaesnCore,
|
|
30
|
+
request?: operations.GetProjectsAsyncRequest | undefined,
|
|
31
|
+
options?: RequestOptions,
|
|
32
|
+
): APIPromise<
|
|
33
|
+
Result<
|
|
34
|
+
operations.GetProjectsAsyncResponse,
|
|
35
|
+
| MaesnError
|
|
36
|
+
| ResponseValidationError
|
|
37
|
+
| ConnectionError
|
|
38
|
+
| RequestAbortedError
|
|
39
|
+
| RequestTimeoutError
|
|
40
|
+
| InvalidRequestError
|
|
41
|
+
| UnexpectedClientError
|
|
42
|
+
| SDKValidationError
|
|
43
|
+
>
|
|
44
|
+
> {
|
|
45
|
+
return new APIPromise($do(
|
|
46
|
+
client,
|
|
47
|
+
request,
|
|
48
|
+
options,
|
|
49
|
+
));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
async function $do(
|
|
53
|
+
client: MaesnCore,
|
|
54
|
+
request?: operations.GetProjectsAsyncRequest | undefined,
|
|
55
|
+
options?: RequestOptions,
|
|
56
|
+
): Promise<
|
|
57
|
+
[
|
|
58
|
+
Result<
|
|
59
|
+
operations.GetProjectsAsyncResponse,
|
|
60
|
+
| MaesnError
|
|
61
|
+
| ResponseValidationError
|
|
62
|
+
| ConnectionError
|
|
63
|
+
| RequestAbortedError
|
|
64
|
+
| RequestTimeoutError
|
|
65
|
+
| InvalidRequestError
|
|
66
|
+
| UnexpectedClientError
|
|
67
|
+
| SDKValidationError
|
|
68
|
+
>,
|
|
69
|
+
APICall,
|
|
70
|
+
]
|
|
71
|
+
> {
|
|
72
|
+
const parsed = safeParse(
|
|
73
|
+
request,
|
|
74
|
+
(value) =>
|
|
75
|
+
z.parse(
|
|
76
|
+
z.optional(operations.GetProjectsAsyncRequest$outboundSchema),
|
|
77
|
+
value,
|
|
78
|
+
),
|
|
79
|
+
"Input validation failed",
|
|
80
|
+
);
|
|
81
|
+
if (!parsed.ok) {
|
|
82
|
+
return [parsed, { status: "invalid" }];
|
|
83
|
+
}
|
|
84
|
+
const payload = parsed.value;
|
|
85
|
+
const body = null;
|
|
86
|
+
|
|
87
|
+
const path = pathToFunc("/accounting/projects/async")();
|
|
88
|
+
|
|
89
|
+
const headers = new Headers(compactMap({
|
|
90
|
+
Accept: "application/json",
|
|
91
|
+
"X-ACCOUNT-KEY": encodeSimple(
|
|
92
|
+
"X-ACCOUNT-KEY",
|
|
93
|
+
payload?.accountKey ?? client._options.accountKey,
|
|
94
|
+
{ explode: false, charEncoding: "none" },
|
|
95
|
+
),
|
|
96
|
+
"X-API-KEY": encodeSimple(
|
|
97
|
+
"X-API-KEY",
|
|
98
|
+
payload?.apiKey ?? client._options.apiKey,
|
|
99
|
+
{ explode: false, charEncoding: "none" },
|
|
100
|
+
),
|
|
101
|
+
}));
|
|
102
|
+
|
|
103
|
+
const context = {
|
|
104
|
+
options: client._options,
|
|
105
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
106
|
+
operationID: "getProjectsAsync",
|
|
107
|
+
oAuth2Scopes: null,
|
|
108
|
+
|
|
109
|
+
resolvedSecurity: null,
|
|
110
|
+
|
|
111
|
+
securitySource: null,
|
|
112
|
+
retryConfig: options?.retries
|
|
113
|
+
|| client._options.retryConfig
|
|
114
|
+
|| {
|
|
115
|
+
strategy: "backoff",
|
|
116
|
+
backoff: {
|
|
117
|
+
initialInterval: 500,
|
|
118
|
+
maxInterval: 60000,
|
|
119
|
+
exponent: 1.5,
|
|
120
|
+
maxElapsedTime: 3600000,
|
|
121
|
+
},
|
|
122
|
+
retryConnectionErrors: true,
|
|
123
|
+
}
|
|
124
|
+
|| { strategy: "none" },
|
|
125
|
+
retryCodes: options?.retryCodes || ["5XX"],
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
const requestRes = client._createRequest(context, {
|
|
129
|
+
method: "GET",
|
|
130
|
+
baseURL: options?.serverURL,
|
|
131
|
+
path: path,
|
|
132
|
+
headers: headers,
|
|
133
|
+
body: body,
|
|
134
|
+
userAgent: client._options.userAgent,
|
|
135
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
136
|
+
}, options);
|
|
137
|
+
if (!requestRes.ok) {
|
|
138
|
+
return [requestRes, { status: "invalid" }];
|
|
139
|
+
}
|
|
140
|
+
const req = requestRes.value;
|
|
141
|
+
|
|
142
|
+
const doResult = await client._do(req, {
|
|
143
|
+
context,
|
|
144
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
145
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
146
|
+
retryConfig: context.retryConfig,
|
|
147
|
+
retryCodes: context.retryCodes,
|
|
148
|
+
});
|
|
149
|
+
if (!doResult.ok) {
|
|
150
|
+
return [doResult, { status: "request-error", request: req }];
|
|
151
|
+
}
|
|
152
|
+
const response = doResult.value;
|
|
153
|
+
|
|
154
|
+
const [result] = await M.match<
|
|
155
|
+
operations.GetProjectsAsyncResponse,
|
|
156
|
+
| MaesnError
|
|
157
|
+
| ResponseValidationError
|
|
158
|
+
| ConnectionError
|
|
159
|
+
| RequestAbortedError
|
|
160
|
+
| RequestTimeoutError
|
|
161
|
+
| InvalidRequestError
|
|
162
|
+
| UnexpectedClientError
|
|
163
|
+
| SDKValidationError
|
|
164
|
+
>(
|
|
165
|
+
M.json(202, operations.GetProjectsAsyncResponse$inboundSchema),
|
|
166
|
+
M.fail("4XX"),
|
|
167
|
+
M.fail("5XX"),
|
|
168
|
+
)(response, req);
|
|
169
|
+
if (!result.ok) {
|
|
170
|
+
return [result, { status: "complete", request: req, response }];
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
return [result, { status: "complete", request: req, response }];
|
|
174
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -51,7 +51,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
51
51
|
export const SDK_METADATA = {
|
|
52
52
|
language: "typescript",
|
|
53
53
|
openapiDocVersion: "1.0",
|
|
54
|
-
sdkVersion: "0.8.
|
|
55
|
-
genVersion: "2.
|
|
56
|
-
userAgent: "speakeasy-sdk/typescript 0.8.
|
|
54
|
+
sdkVersion: "0.8.6",
|
|
55
|
+
genVersion: "2.912.1",
|
|
56
|
+
userAgent: "speakeasy-sdk/typescript 0.8.6 2.912.1 1.0 @maesn/typescript-sdk",
|
|
57
57
|
} as const;
|
|
@@ -91,10 +91,10 @@ export type BillResponseDto = {
|
|
|
91
91
|
name: string | null;
|
|
92
92
|
oneLineAddress: string | null;
|
|
93
93
|
paidDate: string | null;
|
|
94
|
+
paymentDays: number | null;
|
|
94
95
|
paymentReference: string | null;
|
|
95
|
-
paymentTermCode: string | null;
|
|
96
96
|
paymentStatus: BillResponseDtoPaymentStatus | null;
|
|
97
|
-
|
|
97
|
+
paymentTermCode: string | null;
|
|
98
98
|
reference: string | null;
|
|
99
99
|
shippingDate: string | null;
|
|
100
100
|
shippingType: BillResponseDtoShippingType | null;
|
|
@@ -150,10 +150,10 @@ export const BillResponseDto$inboundSchema: z.ZodMiniType<
|
|
|
150
150
|
name: types.nullable(types.string()),
|
|
151
151
|
oneLineAddress: types.nullable(types.string()),
|
|
152
152
|
paidDate: types.nullable(types.string()),
|
|
153
|
+
paymentDays: types.nullable(types.number()),
|
|
153
154
|
paymentReference: types.nullable(types.string()),
|
|
154
|
-
paymentTermCode: types.nullable(types.string()),
|
|
155
155
|
paymentStatus: types.nullable(BillResponseDtoPaymentStatus$inboundSchema),
|
|
156
|
-
|
|
156
|
+
paymentTermCode: types.nullable(types.string()),
|
|
157
157
|
reference: types.nullable(types.string()),
|
|
158
158
|
shippingDate: types.nullable(types.string()),
|
|
159
159
|
shippingType: types.nullable(BillResponseDtoShippingType$inboundSchema),
|
|
@@ -186,6 +186,7 @@ export type CreateJournalLineItemDebitCreditIndicator = ClosedEnum<
|
|
|
186
186
|
>;
|
|
187
187
|
|
|
188
188
|
export type CreateJournalLineItem = {
|
|
189
|
+
id?: string | undefined;
|
|
189
190
|
accountCode?: string | undefined;
|
|
190
191
|
accountId?: string | undefined;
|
|
191
192
|
accountNumber?: string | undefined;
|
|
@@ -195,6 +196,7 @@ export type CreateJournalLineItem = {
|
|
|
195
196
|
description?: string | undefined;
|
|
196
197
|
dimensions?: Array<DimensionInput> | undefined;
|
|
197
198
|
discountAmount?: number | undefined;
|
|
199
|
+
documentId?: string | undefined;
|
|
198
200
|
documentNumber?: string | undefined;
|
|
199
201
|
exchangeRate?: string | undefined;
|
|
200
202
|
supplierId?: string | undefined;
|
|
@@ -218,6 +220,7 @@ export const CreateJournalLineItemDebitCreditIndicator$outboundSchema:
|
|
|
218
220
|
|
|
219
221
|
/** @internal */
|
|
220
222
|
export type CreateJournalLineItem$Outbound = {
|
|
223
|
+
id?: string | undefined;
|
|
221
224
|
accountCode?: string | undefined;
|
|
222
225
|
accountId?: string | undefined;
|
|
223
226
|
accountNumber?: string | undefined;
|
|
@@ -227,6 +230,7 @@ export type CreateJournalLineItem$Outbound = {
|
|
|
227
230
|
description?: string | undefined;
|
|
228
231
|
dimensions?: Array<DimensionInput$Outbound> | undefined;
|
|
229
232
|
discountAmount?: number | undefined;
|
|
233
|
+
documentId?: string | undefined;
|
|
230
234
|
documentNumber?: string | undefined;
|
|
231
235
|
exchangeRate?: string | undefined;
|
|
232
236
|
supplierId?: string | undefined;
|
|
@@ -242,6 +246,7 @@ export const CreateJournalLineItem$outboundSchema: z.ZodMiniType<
|
|
|
242
246
|
CreateJournalLineItem$Outbound,
|
|
243
247
|
CreateJournalLineItem
|
|
244
248
|
> = z.object({
|
|
249
|
+
id: z.optional(z.string()),
|
|
245
250
|
accountCode: z.optional(z.string()),
|
|
246
251
|
accountId: z.optional(z.string()),
|
|
247
252
|
accountNumber: z.optional(z.string()),
|
|
@@ -253,6 +258,7 @@ export const CreateJournalLineItem$outboundSchema: z.ZodMiniType<
|
|
|
253
258
|
description: z.optional(z.string()),
|
|
254
259
|
dimensions: z.optional(z.array(DimensionInput$outboundSchema)),
|
|
255
260
|
discountAmount: z.optional(z.number()),
|
|
261
|
+
documentId: z.optional(z.string()),
|
|
256
262
|
documentNumber: z.optional(z.string()),
|
|
257
263
|
exchangeRate: z.optional(z.string()),
|
|
258
264
|
supplierId: z.optional(z.string()),
|
|
@@ -199,6 +199,7 @@ export type JournalLineItem = {
|
|
|
199
199
|
description: string | null;
|
|
200
200
|
dimensions: Array<Dimension> | null;
|
|
201
201
|
discountAmount?: number | null | undefined;
|
|
202
|
+
documentId: string | null;
|
|
202
203
|
documentNumber: string | null;
|
|
203
204
|
exchangeRate: number | null;
|
|
204
205
|
supplierId: string | null;
|
|
@@ -259,6 +260,7 @@ export const JournalLineItem$inboundSchema: z.ZodMiniType<
|
|
|
259
260
|
description: types.nullable(types.string()),
|
|
260
261
|
dimensions: types.nullable(z.array(Dimension$inboundSchema)),
|
|
261
262
|
discountAmount: z.optional(z.nullable(types.number())),
|
|
263
|
+
documentId: types.nullable(types.string()),
|
|
262
264
|
documentNumber: types.nullable(types.string()),
|
|
263
265
|
exchangeRate: types.nullable(types.number()),
|
|
264
266
|
supplierId: types.nullable(types.string()),
|
|
@@ -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 GetContactsAsyncGlobals = {
|
|
13
|
+
apiKey?: string | undefined;
|
|
14
|
+
accountKey?: string | undefined;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type GetContactsAsyncRequest = {
|
|
18
|
+
/**
|
|
19
|
+
* API key
|
|
20
|
+
*/
|
|
21
|
+
apiKey?: string | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Account key
|
|
24
|
+
*/
|
|
25
|
+
accountKey?: string | undefined;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export type GetContactsAsyncPagination = {
|
|
29
|
+
total: number;
|
|
30
|
+
perPage: number;
|
|
31
|
+
currentPage: number;
|
|
32
|
+
totalPages: number;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export type GetContactsAsyncMeta = {
|
|
36
|
+
warnings?: Array<string> | null | undefined;
|
|
37
|
+
pagination?: GetContactsAsyncPagination | null | undefined;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export type GetContactsAsyncErrors = {};
|
|
41
|
+
|
|
42
|
+
export type GetContactsAsyncRawData = {};
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Contacts fetch queued successfully. Processed asynchronously and returns 202 with taskId.
|
|
46
|
+
*/
|
|
47
|
+
export type GetContactsAsyncResponse = {
|
|
48
|
+
meta?: GetContactsAsyncMeta | null | undefined;
|
|
49
|
+
data: models.TaskIdResponseDto;
|
|
50
|
+
errors: GetContactsAsyncErrors | null;
|
|
51
|
+
rawData: GetContactsAsyncRawData | null;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/** @internal */
|
|
55
|
+
export type GetContactsAsyncRequest$Outbound = {
|
|
56
|
+
apiKey?: string | undefined;
|
|
57
|
+
accountKey?: string | undefined;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/** @internal */
|
|
61
|
+
export const GetContactsAsyncRequest$outboundSchema: z.ZodMiniType<
|
|
62
|
+
GetContactsAsyncRequest$Outbound,
|
|
63
|
+
GetContactsAsyncRequest
|
|
64
|
+
> = z.object({
|
|
65
|
+
apiKey: z.optional(z.string()),
|
|
66
|
+
accountKey: z.optional(z.string()),
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
export function getContactsAsyncRequestToJSON(
|
|
70
|
+
getContactsAsyncRequest: GetContactsAsyncRequest,
|
|
71
|
+
): string {
|
|
72
|
+
return JSON.stringify(
|
|
73
|
+
GetContactsAsyncRequest$outboundSchema.parse(getContactsAsyncRequest),
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** @internal */
|
|
78
|
+
export const GetContactsAsyncPagination$inboundSchema: z.ZodMiniType<
|
|
79
|
+
GetContactsAsyncPagination,
|
|
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 getContactsAsyncPaginationFromJSON(
|
|
89
|
+
jsonString: string,
|
|
90
|
+
): SafeParseResult<GetContactsAsyncPagination, SDKValidationError> {
|
|
91
|
+
return safeParse(
|
|
92
|
+
jsonString,
|
|
93
|
+
(x) => GetContactsAsyncPagination$inboundSchema.parse(JSON.parse(x)),
|
|
94
|
+
`Failed to parse 'GetContactsAsyncPagination' from JSON`,
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** @internal */
|
|
99
|
+
export const GetContactsAsyncMeta$inboundSchema: z.ZodMiniType<
|
|
100
|
+
GetContactsAsyncMeta,
|
|
101
|
+
unknown
|
|
102
|
+
> = z.object({
|
|
103
|
+
warnings: z.optional(z.nullable(z.array(types.string()))),
|
|
104
|
+
pagination: z.optional(
|
|
105
|
+
z.nullable(z.lazy(() => GetContactsAsyncPagination$inboundSchema)),
|
|
106
|
+
),
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
export function getContactsAsyncMetaFromJSON(
|
|
110
|
+
jsonString: string,
|
|
111
|
+
): SafeParseResult<GetContactsAsyncMeta, SDKValidationError> {
|
|
112
|
+
return safeParse(
|
|
113
|
+
jsonString,
|
|
114
|
+
(x) => GetContactsAsyncMeta$inboundSchema.parse(JSON.parse(x)),
|
|
115
|
+
`Failed to parse 'GetContactsAsyncMeta' from JSON`,
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/** @internal */
|
|
120
|
+
export const GetContactsAsyncErrors$inboundSchema: z.ZodMiniType<
|
|
121
|
+
GetContactsAsyncErrors,
|
|
122
|
+
unknown
|
|
123
|
+
> = z.object({});
|
|
124
|
+
|
|
125
|
+
export function getContactsAsyncErrorsFromJSON(
|
|
126
|
+
jsonString: string,
|
|
127
|
+
): SafeParseResult<GetContactsAsyncErrors, SDKValidationError> {
|
|
128
|
+
return safeParse(
|
|
129
|
+
jsonString,
|
|
130
|
+
(x) => GetContactsAsyncErrors$inboundSchema.parse(JSON.parse(x)),
|
|
131
|
+
`Failed to parse 'GetContactsAsyncErrors' from JSON`,
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/** @internal */
|
|
136
|
+
export const GetContactsAsyncRawData$inboundSchema: z.ZodMiniType<
|
|
137
|
+
GetContactsAsyncRawData,
|
|
138
|
+
unknown
|
|
139
|
+
> = z.object({});
|
|
140
|
+
|
|
141
|
+
export function getContactsAsyncRawDataFromJSON(
|
|
142
|
+
jsonString: string,
|
|
143
|
+
): SafeParseResult<GetContactsAsyncRawData, SDKValidationError> {
|
|
144
|
+
return safeParse(
|
|
145
|
+
jsonString,
|
|
146
|
+
(x) => GetContactsAsyncRawData$inboundSchema.parse(JSON.parse(x)),
|
|
147
|
+
`Failed to parse 'GetContactsAsyncRawData' from JSON`,
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/** @internal */
|
|
152
|
+
export const GetContactsAsyncResponse$inboundSchema: z.ZodMiniType<
|
|
153
|
+
GetContactsAsyncResponse,
|
|
154
|
+
unknown
|
|
155
|
+
> = z.object({
|
|
156
|
+
meta: z.optional(
|
|
157
|
+
z.nullable(z.lazy(() => GetContactsAsyncMeta$inboundSchema)),
|
|
158
|
+
),
|
|
159
|
+
data: models.TaskIdResponseDto$inboundSchema,
|
|
160
|
+
errors: types.nullable(z.lazy(() => GetContactsAsyncErrors$inboundSchema)),
|
|
161
|
+
rawData: types.nullable(z.lazy(() => GetContactsAsyncRawData$inboundSchema)),
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
export function getContactsAsyncResponseFromJSON(
|
|
165
|
+
jsonString: string,
|
|
166
|
+
): SafeParseResult<GetContactsAsyncResponse, SDKValidationError> {
|
|
167
|
+
return safeParse(
|
|
168
|
+
jsonString,
|
|
169
|
+
(x) => GetContactsAsyncResponse$inboundSchema.parse(JSON.parse(x)),
|
|
170
|
+
`Failed to parse 'GetContactsAsyncResponse' from JSON`,
|
|
171
|
+
);
|
|
172
|
+
}
|
|
@@ -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,
|