@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.
Files changed (59) hide show
  1. package/README.md +4 -0
  2. package/esm/funcs/accounting-create-payment.js +1 -0
  3. package/esm/funcs/accounting-create-payment.js.map +1 -1
  4. package/esm/funcs/accounting-get-contacts-async.d.ts +11 -0
  5. package/esm/funcs/accounting-get-contacts-async.d.ts.map +1 -0
  6. package/esm/funcs/accounting-get-contacts-async.js +80 -0
  7. package/esm/funcs/accounting-get-contacts-async.js.map +1 -0
  8. package/esm/funcs/accounting-get-projects-async.d.ts +11 -0
  9. package/esm/funcs/accounting-get-projects-async.d.ts.map +1 -0
  10. package/esm/funcs/accounting-get-projects-async.js +80 -0
  11. package/esm/funcs/accounting-get-projects-async.js.map +1 -0
  12. package/esm/lib/config.d.ts +3 -3
  13. package/esm/lib/config.js +3 -3
  14. package/esm/models/bill-response-dto.d.ts +2 -2
  15. package/esm/models/bill-response-dto.d.ts.map +1 -1
  16. package/esm/models/bill-response-dto.js +2 -2
  17. package/esm/models/bill-response-dto.js.map +1 -1
  18. package/esm/models/create-journal-line-item.d.ts +4 -0
  19. package/esm/models/create-journal-line-item.d.ts.map +1 -1
  20. package/esm/models/create-journal-line-item.js +2 -0
  21. package/esm/models/create-journal-line-item.js.map +1 -1
  22. package/esm/models/journal-line-item.d.ts +1 -0
  23. package/esm/models/journal-line-item.d.ts.map +1 -1
  24. package/esm/models/journal-line-item.js +1 -0
  25. package/esm/models/journal-line-item.js.map +1 -1
  26. package/esm/models/operations/create-payment.d.ts +5 -0
  27. package/esm/models/operations/create-payment.d.ts.map +1 -1
  28. package/esm/models/operations/create-payment.js +1 -0
  29. package/esm/models/operations/create-payment.js.map +1 -1
  30. package/esm/models/operations/get-contacts-async.d.ts +63 -0
  31. package/esm/models/operations/get-contacts-async.d.ts.map +1 -0
  32. package/esm/models/operations/get-contacts-async.js +54 -0
  33. package/esm/models/operations/get-contacts-async.js.map +1 -0
  34. package/esm/models/operations/get-projects-async.d.ts +63 -0
  35. package/esm/models/operations/get-projects-async.d.ts.map +1 -0
  36. package/esm/models/operations/get-projects-async.js +54 -0
  37. package/esm/models/operations/get-projects-async.js.map +1 -0
  38. package/esm/models/operations/index.d.ts +2 -0
  39. package/esm/models/operations/index.d.ts.map +1 -1
  40. package/esm/models/operations/index.js +2 -0
  41. package/esm/models/operations/index.js.map +1 -1
  42. package/esm/sdk/accounting.d.ts +2 -0
  43. package/esm/sdk/accounting.d.ts.map +1 -1
  44. package/esm/sdk/accounting.js +8 -0
  45. package/esm/sdk/accounting.js.map +1 -1
  46. package/jsr.json +1 -1
  47. package/package.json +1 -1
  48. package/src/funcs/accounting-create-payment.ts +1 -0
  49. package/src/funcs/accounting-get-contacts-async.ts +174 -0
  50. package/src/funcs/accounting-get-projects-async.ts +174 -0
  51. package/src/lib/config.ts +3 -3
  52. package/src/models/bill-response-dto.ts +4 -4
  53. package/src/models/create-journal-line-item.ts +6 -0
  54. package/src/models/journal-line-item.ts +2 -0
  55. package/src/models/operations/create-payment.ts +6 -0
  56. package/src/models/operations/get-contacts-async.ts +172 -0
  57. package/src/models/operations/get-projects-async.ts +172 -0
  58. package/src/models/operations/index.ts +2 -0
  59. 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 accountingGetContactsAsync(
29
+ client: MaesnCore,
30
+ request?: operations.GetContactsAsyncRequest | undefined,
31
+ options?: RequestOptions,
32
+ ): APIPromise<
33
+ Result<
34
+ operations.GetContactsAsyncResponse,
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.GetContactsAsyncRequest | undefined,
55
+ options?: RequestOptions,
56
+ ): Promise<
57
+ [
58
+ Result<
59
+ operations.GetContactsAsyncResponse,
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.GetContactsAsyncRequest$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/contacts/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: "getContactsAsync",
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.GetContactsAsyncResponse,
156
+ | MaesnError
157
+ | ResponseValidationError
158
+ | ConnectionError
159
+ | RequestAbortedError
160
+ | RequestTimeoutError
161
+ | InvalidRequestError
162
+ | UnexpectedClientError
163
+ | SDKValidationError
164
+ >(
165
+ M.json(202, operations.GetContactsAsyncResponse$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
+ }
@@ -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.5",
55
- genVersion: "2.911.0",
56
- userAgent: "speakeasy-sdk/typescript 0.8.5 2.911.0 1.0 @maesn/typescript-sdk",
54
+ sdkVersion: "0.8.7",
55
+ genVersion: "2.913.3",
56
+ userAgent: "speakeasy-sdk/typescript 0.8.7 2.913.3 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
- paymentDays: number | null;
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
- paymentDays: types.nullable(types.number()),
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()),
@@ -19,6 +19,10 @@ export type CreatePaymentRequest = {
19
19
  * ID of the company (required for multi-company target systems)
20
20
  */
21
21
  companyId?: string | undefined;
22
+ /**
23
+ * Environment name (required for multi-environment systems such as Business Central)
24
+ */
25
+ environmentName?: string | undefined;
22
26
  /**
23
27
  * API key
24
28
  */
@@ -59,6 +63,7 @@ export type CreatePaymentResponse = {
59
63
  /** @internal */
60
64
  export type CreatePaymentRequest$Outbound = {
61
65
  companyId?: string | undefined;
66
+ environmentName?: string | undefined;
62
67
  apiKey?: string | undefined;
63
68
  accountKey?: string | undefined;
64
69
  body: models.CreatePaymentRequestDto$Outbound;
@@ -70,6 +75,7 @@ export const CreatePaymentRequest$outboundSchema: z.ZodMiniType<
70
75
  CreatePaymentRequest
71
76
  > = z.object({
72
77
  companyId: z.optional(z.string()),
78
+ environmentName: z.optional(z.string()),
73
79
  apiKey: z.optional(z.string()),
74
80
  accountKey: z.optional(z.string()),
75
81
  body: models.CreatePaymentRequestDto$outboundSchema,
@@ -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
+ }