@apideck/unify 0.11.6 → 0.12.0
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 +27 -15
- package/docs/sdks/agedcreditors/README.md +113 -0
- package/docs/sdks/ageddebtors/README.md +113 -0
- package/funcs/accountingAgedCreditorsGet.d.ts +16 -0
- package/funcs/accountingAgedCreditorsGet.d.ts.map +1 -0
- package/funcs/accountingAgedCreditorsGet.js +121 -0
- package/funcs/accountingAgedCreditorsGet.js.map +1 -0
- package/funcs/accountingAgedDebtorsGet.d.ts +16 -0
- package/funcs/accountingAgedDebtorsGet.d.ts.map +1 -0
- package/funcs/accountingAgedDebtorsGet.js +121 -0
- package/funcs/accountingAgedDebtorsGet.js.map +1 -0
- package/lib/config.d.ts +4 -4
- package/lib/config.js +4 -4
- package/models/components/agedcreditors.d.ts +51 -0
- package/models/components/agedcreditors.d.ts.map +1 -0
- package/models/components/agedcreditors.js +86 -0
- package/models/components/agedcreditors.js.map +1 -0
- package/models/components/ageddebtors.d.ts +51 -0
- package/models/components/ageddebtors.d.ts.map +1 -0
- package/models/components/ageddebtors.js +86 -0
- package/models/components/ageddebtors.js.map +1 -0
- package/models/components/agedreportfilter.d.ts +47 -0
- package/models/components/agedreportfilter.d.ts.map +1 -0
- package/models/components/agedreportfilter.js +80 -0
- package/models/components/agedreportfilter.js.map +1 -0
- package/models/components/balancebyperiod.d.ts +46 -0
- package/models/components/balancebyperiod.d.ts.map +1 -0
- package/models/components/balancebyperiod.js +84 -0
- package/models/components/balancebyperiod.js.map +1 -0
- package/models/components/balancebytransaction.d.ts +99 -0
- package/models/components/balancebytransaction.d.ts.map +1 -0
- package/models/components/balancebytransaction.js +115 -0
- package/models/components/balancebytransaction.js.map +1 -0
- package/models/components/getagedcreditorsresponse.d.ts +58 -0
- package/models/components/getagedcreditorsresponse.d.ts.map +1 -0
- package/models/components/getagedcreditorsresponse.js +79 -0
- package/models/components/getagedcreditorsresponse.js.map +1 -0
- package/models/components/getageddebtorsresponse.d.ts +58 -0
- package/models/components/getageddebtorsresponse.d.ts.map +1 -0
- package/models/components/getageddebtorsresponse.js +79 -0
- package/models/components/getageddebtorsresponse.js.map +1 -0
- package/models/components/index.d.ts +9 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +9 -0
- package/models/components/index.js.map +1 -1
- package/models/components/outstandingbalance.d.ts +40 -0
- package/models/components/outstandingbalance.d.ts.map +1 -0
- package/models/components/outstandingbalance.js +77 -0
- package/models/components/outstandingbalance.js.map +1 -0
- package/models/components/outstandingbalancebycurrency.d.ts +36 -0
- package/models/components/outstandingbalancebycurrency.d.ts.map +1 -0
- package/models/components/outstandingbalancebycurrency.js +72 -0
- package/models/components/outstandingbalancebycurrency.js.map +1 -0
- package/models/operations/accountingagedcreditorsone.d.ts +125 -0
- package/models/operations/accountingagedcreditorsone.d.ts.map +1 -0
- package/models/operations/accountingagedcreditorsone.js +153 -0
- package/models/operations/accountingagedcreditorsone.js.map +1 -0
- package/models/operations/accountingageddebtorsone.d.ts +125 -0
- package/models/operations/accountingageddebtorsone.d.ts.map +1 -0
- package/models/operations/accountingageddebtorsone.js +153 -0
- package/models/operations/accountingageddebtorsone.js.map +1 -0
- package/models/operations/index.d.ts +2 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +2 -0
- package/models/operations/index.js.map +1 -1
- package/package.json +1 -1
- package/sdk/accounting.d.ts +6 -0
- package/sdk/accounting.d.ts.map +1 -1
- package/sdk/accounting.js +10 -0
- package/sdk/accounting.js.map +1 -1
- package/sdk/agedcreditors.d.ts +12 -0
- package/sdk/agedcreditors.d.ts.map +1 -0
- package/sdk/agedcreditors.js +22 -0
- package/sdk/agedcreditors.js.map +1 -0
- package/sdk/ageddebtors.d.ts +12 -0
- package/sdk/ageddebtors.d.ts.map +1 -0
- package/sdk/ageddebtors.js +22 -0
- package/sdk/ageddebtors.js.map +1 -0
- package/src/funcs/accountingAgedCreditorsGet.ts +192 -0
- package/src/funcs/accountingAgedDebtorsGet.ts +192 -0
- package/src/lib/config.ts +4 -4
- package/src/models/components/agedcreditors.ts +116 -0
- package/src/models/components/ageddebtors.ts +116 -0
- package/src/models/components/agedreportfilter.ts +105 -0
- package/src/models/components/balancebyperiod.ts +109 -0
- package/src/models/components/balancebytransaction.ts +162 -0
- package/src/models/components/getagedcreditorsresponse.ts +119 -0
- package/src/models/components/getageddebtorsresponse.ts +119 -0
- package/src/models/components/index.ts +9 -0
- package/src/models/components/outstandingbalance.ts +107 -0
- package/src/models/components/outstandingbalancebycurrency.ts +95 -0
- package/src/models/operations/accountingagedcreditorsone.ts +277 -0
- package/src/models/operations/accountingageddebtorsone.ts +273 -0
- package/src/models/operations/index.ts +2 -0
- package/src/sdk/accounting.ts +12 -0
- package/src/sdk/agedcreditors.ts +27 -0
- package/src/sdk/ageddebtors.ts +27 -0
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { ApideckCore } from "../core.js";
|
|
6
|
+
import {
|
|
7
|
+
encodeDeepObjectQuery,
|
|
8
|
+
encodeFormQuery,
|
|
9
|
+
encodeSimple,
|
|
10
|
+
queryJoin,
|
|
11
|
+
} from "../lib/encodings.js";
|
|
12
|
+
import * as M from "../lib/matchers.js";
|
|
13
|
+
import { safeParse } from "../lib/schemas.js";
|
|
14
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
15
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
16
|
+
import { pathToFunc } from "../lib/url.js";
|
|
17
|
+
import { APIError } from "../models/errors/apierror.js";
|
|
18
|
+
import {
|
|
19
|
+
ConnectionError,
|
|
20
|
+
InvalidRequestError,
|
|
21
|
+
RequestAbortedError,
|
|
22
|
+
RequestTimeoutError,
|
|
23
|
+
UnexpectedClientError,
|
|
24
|
+
} from "../models/errors/httpclienterrors.js";
|
|
25
|
+
import * as errors from "../models/errors/index.js";
|
|
26
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
27
|
+
import * as operations from "../models/operations/index.js";
|
|
28
|
+
import { Result } from "../types/fp.js";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Get Aged Creditors
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* Get Aged Creditors
|
|
35
|
+
*/
|
|
36
|
+
export async function accountingAgedCreditorsGet(
|
|
37
|
+
client: ApideckCore,
|
|
38
|
+
request: operations.AccountingAgedCreditorsOneRequest,
|
|
39
|
+
options?: RequestOptions,
|
|
40
|
+
): Promise<
|
|
41
|
+
Result<
|
|
42
|
+
operations.AccountingAgedCreditorsOneResponse,
|
|
43
|
+
| errors.BadRequestResponse
|
|
44
|
+
| errors.UnauthorizedResponse
|
|
45
|
+
| errors.PaymentRequiredResponse
|
|
46
|
+
| errors.NotFoundResponse
|
|
47
|
+
| errors.UnprocessableResponse
|
|
48
|
+
| APIError
|
|
49
|
+
| SDKValidationError
|
|
50
|
+
| UnexpectedClientError
|
|
51
|
+
| InvalidRequestError
|
|
52
|
+
| RequestAbortedError
|
|
53
|
+
| RequestTimeoutError
|
|
54
|
+
| ConnectionError
|
|
55
|
+
>
|
|
56
|
+
> {
|
|
57
|
+
const parsed = safeParse(
|
|
58
|
+
request,
|
|
59
|
+
(value) =>
|
|
60
|
+
operations.AccountingAgedCreditorsOneRequest$outboundSchema.parse(value),
|
|
61
|
+
"Input validation failed",
|
|
62
|
+
);
|
|
63
|
+
if (!parsed.ok) {
|
|
64
|
+
return parsed;
|
|
65
|
+
}
|
|
66
|
+
const payload = parsed.value;
|
|
67
|
+
const body = null;
|
|
68
|
+
|
|
69
|
+
const path = pathToFunc("/accounting/aged-creditors")();
|
|
70
|
+
|
|
71
|
+
const query = queryJoin(
|
|
72
|
+
encodeDeepObjectQuery({
|
|
73
|
+
"filter": payload.filter,
|
|
74
|
+
"pass_through": payload.pass_through,
|
|
75
|
+
}),
|
|
76
|
+
encodeFormQuery({
|
|
77
|
+
"fields": payload.fields,
|
|
78
|
+
"raw": payload.raw,
|
|
79
|
+
}),
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
const headers = new Headers({
|
|
83
|
+
Accept: "application/json",
|
|
84
|
+
"x-apideck-service-id": encodeSimple(
|
|
85
|
+
"x-apideck-service-id",
|
|
86
|
+
payload.serviceId,
|
|
87
|
+
{ explode: false, charEncoding: "none" },
|
|
88
|
+
),
|
|
89
|
+
"x-apideck-app-id": encodeSimple(
|
|
90
|
+
"x-apideck-app-id",
|
|
91
|
+
client._options.appId,
|
|
92
|
+
{ explode: false, charEncoding: "none" },
|
|
93
|
+
),
|
|
94
|
+
"x-apideck-consumer-id": encodeSimple(
|
|
95
|
+
"x-apideck-consumer-id",
|
|
96
|
+
client._options.consumerId,
|
|
97
|
+
{ explode: false, charEncoding: "none" },
|
|
98
|
+
),
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
102
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
103
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
104
|
+
|
|
105
|
+
const context = {
|
|
106
|
+
operationID: "accounting.agedCreditorsOne",
|
|
107
|
+
oAuth2Scopes: [],
|
|
108
|
+
|
|
109
|
+
resolvedSecurity: requestSecurity,
|
|
110
|
+
|
|
111
|
+
securitySource: client._options.apiKey,
|
|
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
|
+
security: requestSecurity,
|
|
130
|
+
method: "GET",
|
|
131
|
+
path: path,
|
|
132
|
+
headers: headers,
|
|
133
|
+
query: query,
|
|
134
|
+
body: body,
|
|
135
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
136
|
+
}, options);
|
|
137
|
+
if (!requestRes.ok) {
|
|
138
|
+
return requestRes;
|
|
139
|
+
}
|
|
140
|
+
const req = requestRes.value;
|
|
141
|
+
|
|
142
|
+
const doResult = await client._do(req, {
|
|
143
|
+
context,
|
|
144
|
+
errorCodes: ["400", "401", "402", "404", "422", "4XX", "5XX"],
|
|
145
|
+
retryConfig: context.retryConfig,
|
|
146
|
+
retryCodes: context.retryCodes,
|
|
147
|
+
});
|
|
148
|
+
if (!doResult.ok) {
|
|
149
|
+
return doResult;
|
|
150
|
+
}
|
|
151
|
+
const response = doResult.value;
|
|
152
|
+
|
|
153
|
+
const responseFields = {
|
|
154
|
+
HttpMeta: { Response: response, Request: req },
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
const [result] = await M.match<
|
|
158
|
+
operations.AccountingAgedCreditorsOneResponse,
|
|
159
|
+
| errors.BadRequestResponse
|
|
160
|
+
| errors.UnauthorizedResponse
|
|
161
|
+
| errors.PaymentRequiredResponse
|
|
162
|
+
| errors.NotFoundResponse
|
|
163
|
+
| errors.UnprocessableResponse
|
|
164
|
+
| APIError
|
|
165
|
+
| SDKValidationError
|
|
166
|
+
| UnexpectedClientError
|
|
167
|
+
| InvalidRequestError
|
|
168
|
+
| RequestAbortedError
|
|
169
|
+
| RequestTimeoutError
|
|
170
|
+
| ConnectionError
|
|
171
|
+
>(
|
|
172
|
+
M.json(200, operations.AccountingAgedCreditorsOneResponse$inboundSchema, {
|
|
173
|
+
key: "GetAgedCreditorsResponse",
|
|
174
|
+
}),
|
|
175
|
+
M.jsonErr(400, errors.BadRequestResponse$inboundSchema),
|
|
176
|
+
M.jsonErr(401, errors.UnauthorizedResponse$inboundSchema),
|
|
177
|
+
M.jsonErr(402, errors.PaymentRequiredResponse$inboundSchema),
|
|
178
|
+
M.jsonErr(404, errors.NotFoundResponse$inboundSchema),
|
|
179
|
+
M.jsonErr(422, errors.UnprocessableResponse$inboundSchema),
|
|
180
|
+
M.fail(["4XX", "5XX"]),
|
|
181
|
+
M.json(
|
|
182
|
+
"default",
|
|
183
|
+
operations.AccountingAgedCreditorsOneResponse$inboundSchema,
|
|
184
|
+
{ key: "UnexpectedErrorResponse" },
|
|
185
|
+
),
|
|
186
|
+
)(response, req, { extraFields: responseFields });
|
|
187
|
+
if (!result.ok) {
|
|
188
|
+
return result;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
return result;
|
|
192
|
+
}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { ApideckCore } from "../core.js";
|
|
6
|
+
import {
|
|
7
|
+
encodeDeepObjectQuery,
|
|
8
|
+
encodeFormQuery,
|
|
9
|
+
encodeSimple,
|
|
10
|
+
queryJoin,
|
|
11
|
+
} from "../lib/encodings.js";
|
|
12
|
+
import * as M from "../lib/matchers.js";
|
|
13
|
+
import { safeParse } from "../lib/schemas.js";
|
|
14
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
15
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
16
|
+
import { pathToFunc } from "../lib/url.js";
|
|
17
|
+
import { APIError } from "../models/errors/apierror.js";
|
|
18
|
+
import {
|
|
19
|
+
ConnectionError,
|
|
20
|
+
InvalidRequestError,
|
|
21
|
+
RequestAbortedError,
|
|
22
|
+
RequestTimeoutError,
|
|
23
|
+
UnexpectedClientError,
|
|
24
|
+
} from "../models/errors/httpclienterrors.js";
|
|
25
|
+
import * as errors from "../models/errors/index.js";
|
|
26
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
27
|
+
import * as operations from "../models/operations/index.js";
|
|
28
|
+
import { Result } from "../types/fp.js";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Get Aged Debtors
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* Get Aged Debtors
|
|
35
|
+
*/
|
|
36
|
+
export async function accountingAgedDebtorsGet(
|
|
37
|
+
client: ApideckCore,
|
|
38
|
+
request: operations.AccountingAgedDebtorsOneRequest,
|
|
39
|
+
options?: RequestOptions,
|
|
40
|
+
): Promise<
|
|
41
|
+
Result<
|
|
42
|
+
operations.AccountingAgedDebtorsOneResponse,
|
|
43
|
+
| errors.BadRequestResponse
|
|
44
|
+
| errors.UnauthorizedResponse
|
|
45
|
+
| errors.PaymentRequiredResponse
|
|
46
|
+
| errors.NotFoundResponse
|
|
47
|
+
| errors.UnprocessableResponse
|
|
48
|
+
| APIError
|
|
49
|
+
| SDKValidationError
|
|
50
|
+
| UnexpectedClientError
|
|
51
|
+
| InvalidRequestError
|
|
52
|
+
| RequestAbortedError
|
|
53
|
+
| RequestTimeoutError
|
|
54
|
+
| ConnectionError
|
|
55
|
+
>
|
|
56
|
+
> {
|
|
57
|
+
const parsed = safeParse(
|
|
58
|
+
request,
|
|
59
|
+
(value) =>
|
|
60
|
+
operations.AccountingAgedDebtorsOneRequest$outboundSchema.parse(value),
|
|
61
|
+
"Input validation failed",
|
|
62
|
+
);
|
|
63
|
+
if (!parsed.ok) {
|
|
64
|
+
return parsed;
|
|
65
|
+
}
|
|
66
|
+
const payload = parsed.value;
|
|
67
|
+
const body = null;
|
|
68
|
+
|
|
69
|
+
const path = pathToFunc("/accounting/aged-debtors")();
|
|
70
|
+
|
|
71
|
+
const query = queryJoin(
|
|
72
|
+
encodeDeepObjectQuery({
|
|
73
|
+
"filter": payload.filter,
|
|
74
|
+
"pass_through": payload.pass_through,
|
|
75
|
+
}),
|
|
76
|
+
encodeFormQuery({
|
|
77
|
+
"fields": payload.fields,
|
|
78
|
+
"raw": payload.raw,
|
|
79
|
+
}),
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
const headers = new Headers({
|
|
83
|
+
Accept: "application/json",
|
|
84
|
+
"x-apideck-service-id": encodeSimple(
|
|
85
|
+
"x-apideck-service-id",
|
|
86
|
+
payload.serviceId,
|
|
87
|
+
{ explode: false, charEncoding: "none" },
|
|
88
|
+
),
|
|
89
|
+
"x-apideck-app-id": encodeSimple(
|
|
90
|
+
"x-apideck-app-id",
|
|
91
|
+
client._options.appId,
|
|
92
|
+
{ explode: false, charEncoding: "none" },
|
|
93
|
+
),
|
|
94
|
+
"x-apideck-consumer-id": encodeSimple(
|
|
95
|
+
"x-apideck-consumer-id",
|
|
96
|
+
client._options.consumerId,
|
|
97
|
+
{ explode: false, charEncoding: "none" },
|
|
98
|
+
),
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
102
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
103
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
104
|
+
|
|
105
|
+
const context = {
|
|
106
|
+
operationID: "accounting.agedDebtorsOne",
|
|
107
|
+
oAuth2Scopes: [],
|
|
108
|
+
|
|
109
|
+
resolvedSecurity: requestSecurity,
|
|
110
|
+
|
|
111
|
+
securitySource: client._options.apiKey,
|
|
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
|
+
security: requestSecurity,
|
|
130
|
+
method: "GET",
|
|
131
|
+
path: path,
|
|
132
|
+
headers: headers,
|
|
133
|
+
query: query,
|
|
134
|
+
body: body,
|
|
135
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
136
|
+
}, options);
|
|
137
|
+
if (!requestRes.ok) {
|
|
138
|
+
return requestRes;
|
|
139
|
+
}
|
|
140
|
+
const req = requestRes.value;
|
|
141
|
+
|
|
142
|
+
const doResult = await client._do(req, {
|
|
143
|
+
context,
|
|
144
|
+
errorCodes: ["400", "401", "402", "404", "422", "4XX", "5XX"],
|
|
145
|
+
retryConfig: context.retryConfig,
|
|
146
|
+
retryCodes: context.retryCodes,
|
|
147
|
+
});
|
|
148
|
+
if (!doResult.ok) {
|
|
149
|
+
return doResult;
|
|
150
|
+
}
|
|
151
|
+
const response = doResult.value;
|
|
152
|
+
|
|
153
|
+
const responseFields = {
|
|
154
|
+
HttpMeta: { Response: response, Request: req },
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
const [result] = await M.match<
|
|
158
|
+
operations.AccountingAgedDebtorsOneResponse,
|
|
159
|
+
| errors.BadRequestResponse
|
|
160
|
+
| errors.UnauthorizedResponse
|
|
161
|
+
| errors.PaymentRequiredResponse
|
|
162
|
+
| errors.NotFoundResponse
|
|
163
|
+
| errors.UnprocessableResponse
|
|
164
|
+
| APIError
|
|
165
|
+
| SDKValidationError
|
|
166
|
+
| UnexpectedClientError
|
|
167
|
+
| InvalidRequestError
|
|
168
|
+
| RequestAbortedError
|
|
169
|
+
| RequestTimeoutError
|
|
170
|
+
| ConnectionError
|
|
171
|
+
>(
|
|
172
|
+
M.json(200, operations.AccountingAgedDebtorsOneResponse$inboundSchema, {
|
|
173
|
+
key: "GetAgedDebtorsResponse",
|
|
174
|
+
}),
|
|
175
|
+
M.jsonErr(400, errors.BadRequestResponse$inboundSchema),
|
|
176
|
+
M.jsonErr(401, errors.UnauthorizedResponse$inboundSchema),
|
|
177
|
+
M.jsonErr(402, errors.PaymentRequiredResponse$inboundSchema),
|
|
178
|
+
M.jsonErr(404, errors.NotFoundResponse$inboundSchema),
|
|
179
|
+
M.jsonErr(422, errors.UnprocessableResponse$inboundSchema),
|
|
180
|
+
M.fail(["4XX", "5XX"]),
|
|
181
|
+
M.json(
|
|
182
|
+
"default",
|
|
183
|
+
operations.AccountingAgedDebtorsOneResponse$inboundSchema,
|
|
184
|
+
{ key: "UnexpectedErrorResponse" },
|
|
185
|
+
),
|
|
186
|
+
)(response, req, { extraFields: responseFields });
|
|
187
|
+
if (!result.ok) {
|
|
188
|
+
return result;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
return result;
|
|
192
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -63,8 +63,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
63
63
|
|
|
64
64
|
export const SDK_METADATA = {
|
|
65
65
|
language: "typescript",
|
|
66
|
-
openapiDocVersion: "10.
|
|
67
|
-
sdkVersion: "0.
|
|
68
|
-
genVersion: "2.477.
|
|
69
|
-
userAgent: "speakeasy-sdk/typescript 0.
|
|
66
|
+
openapiDocVersion: "10.9.0",
|
|
67
|
+
sdkVersion: "0.12.0",
|
|
68
|
+
genVersion: "2.477.4",
|
|
69
|
+
userAgent: "speakeasy-sdk/typescript 0.12.0 2.477.4 10.9.0 @apideck/unify",
|
|
70
70
|
} as const;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { RFCDate } from "../../types/rfcdate.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
import {
|
|
12
|
+
OutstandingBalance,
|
|
13
|
+
OutstandingBalance$inboundSchema,
|
|
14
|
+
OutstandingBalance$Outbound,
|
|
15
|
+
OutstandingBalance$outboundSchema,
|
|
16
|
+
} from "./outstandingbalance.js";
|
|
17
|
+
|
|
18
|
+
export type AgedCreditors = {
|
|
19
|
+
/**
|
|
20
|
+
* The exact date and time the report was generated.
|
|
21
|
+
*/
|
|
22
|
+
reportGeneratedAt?: Date | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* The cutoff date for transactions included in the report.
|
|
25
|
+
*/
|
|
26
|
+
reportAsOfDate?: RFCDate | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Number of aging periods shown in the report.
|
|
29
|
+
*/
|
|
30
|
+
periodCount?: number | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Length of each aging period in days.
|
|
33
|
+
*/
|
|
34
|
+
periodLength?: number | undefined;
|
|
35
|
+
outstandingBalances?: Array<OutstandingBalance> | undefined;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/** @internal */
|
|
39
|
+
export const AgedCreditors$inboundSchema: z.ZodType<
|
|
40
|
+
AgedCreditors,
|
|
41
|
+
z.ZodTypeDef,
|
|
42
|
+
unknown
|
|
43
|
+
> = z.object({
|
|
44
|
+
report_generated_at: z.string().datetime({ offset: true }).transform(v =>
|
|
45
|
+
new Date(v)
|
|
46
|
+
).optional(),
|
|
47
|
+
report_as_of_date: z.string().transform(v => new RFCDate(v)).optional(),
|
|
48
|
+
period_count: z.number().int().default(4),
|
|
49
|
+
period_length: z.number().int().default(30),
|
|
50
|
+
outstanding_balances: z.array(OutstandingBalance$inboundSchema).optional(),
|
|
51
|
+
}).transform((v) => {
|
|
52
|
+
return remap$(v, {
|
|
53
|
+
"report_generated_at": "reportGeneratedAt",
|
|
54
|
+
"report_as_of_date": "reportAsOfDate",
|
|
55
|
+
"period_count": "periodCount",
|
|
56
|
+
"period_length": "periodLength",
|
|
57
|
+
"outstanding_balances": "outstandingBalances",
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
/** @internal */
|
|
62
|
+
export type AgedCreditors$Outbound = {
|
|
63
|
+
report_generated_at?: string | undefined;
|
|
64
|
+
report_as_of_date?: string | undefined;
|
|
65
|
+
period_count: number;
|
|
66
|
+
period_length: number;
|
|
67
|
+
outstanding_balances?: Array<OutstandingBalance$Outbound> | undefined;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/** @internal */
|
|
71
|
+
export const AgedCreditors$outboundSchema: z.ZodType<
|
|
72
|
+
AgedCreditors$Outbound,
|
|
73
|
+
z.ZodTypeDef,
|
|
74
|
+
AgedCreditors
|
|
75
|
+
> = z.object({
|
|
76
|
+
reportGeneratedAt: z.date().transform(v => v.toISOString()).optional(),
|
|
77
|
+
reportAsOfDate: z.instanceof(RFCDate).transform(v => v.toString()).optional(),
|
|
78
|
+
periodCount: z.number().int().default(4),
|
|
79
|
+
periodLength: z.number().int().default(30),
|
|
80
|
+
outstandingBalances: z.array(OutstandingBalance$outboundSchema).optional(),
|
|
81
|
+
}).transform((v) => {
|
|
82
|
+
return remap$(v, {
|
|
83
|
+
reportGeneratedAt: "report_generated_at",
|
|
84
|
+
reportAsOfDate: "report_as_of_date",
|
|
85
|
+
periodCount: "period_count",
|
|
86
|
+
periodLength: "period_length",
|
|
87
|
+
outstandingBalances: "outstanding_balances",
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* @internal
|
|
93
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
94
|
+
*/
|
|
95
|
+
export namespace AgedCreditors$ {
|
|
96
|
+
/** @deprecated use `AgedCreditors$inboundSchema` instead. */
|
|
97
|
+
export const inboundSchema = AgedCreditors$inboundSchema;
|
|
98
|
+
/** @deprecated use `AgedCreditors$outboundSchema` instead. */
|
|
99
|
+
export const outboundSchema = AgedCreditors$outboundSchema;
|
|
100
|
+
/** @deprecated use `AgedCreditors$Outbound` instead. */
|
|
101
|
+
export type Outbound = AgedCreditors$Outbound;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function agedCreditorsToJSON(agedCreditors: AgedCreditors): string {
|
|
105
|
+
return JSON.stringify(AgedCreditors$outboundSchema.parse(agedCreditors));
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export function agedCreditorsFromJSON(
|
|
109
|
+
jsonString: string,
|
|
110
|
+
): SafeParseResult<AgedCreditors, SDKValidationError> {
|
|
111
|
+
return safeParse(
|
|
112
|
+
jsonString,
|
|
113
|
+
(x) => AgedCreditors$inboundSchema.parse(JSON.parse(x)),
|
|
114
|
+
`Failed to parse 'AgedCreditors' from JSON`,
|
|
115
|
+
);
|
|
116
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { RFCDate } from "../../types/rfcdate.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
import {
|
|
12
|
+
OutstandingBalance,
|
|
13
|
+
OutstandingBalance$inboundSchema,
|
|
14
|
+
OutstandingBalance$Outbound,
|
|
15
|
+
OutstandingBalance$outboundSchema,
|
|
16
|
+
} from "./outstandingbalance.js";
|
|
17
|
+
|
|
18
|
+
export type AgedDebtors = {
|
|
19
|
+
/**
|
|
20
|
+
* The exact date and time the report was generated.
|
|
21
|
+
*/
|
|
22
|
+
reportGeneratedAt?: Date | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* The cutoff date for transactions included in the report.
|
|
25
|
+
*/
|
|
26
|
+
reportAsOfDate?: RFCDate | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Number of aging periods shown in the report.
|
|
29
|
+
*/
|
|
30
|
+
periodCount?: number | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Length of each aging period in days.
|
|
33
|
+
*/
|
|
34
|
+
periodLength?: number | undefined;
|
|
35
|
+
outstandingBalances?: Array<OutstandingBalance> | undefined;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/** @internal */
|
|
39
|
+
export const AgedDebtors$inboundSchema: z.ZodType<
|
|
40
|
+
AgedDebtors,
|
|
41
|
+
z.ZodTypeDef,
|
|
42
|
+
unknown
|
|
43
|
+
> = z.object({
|
|
44
|
+
report_generated_at: z.string().datetime({ offset: true }).transform(v =>
|
|
45
|
+
new Date(v)
|
|
46
|
+
).optional(),
|
|
47
|
+
report_as_of_date: z.string().transform(v => new RFCDate(v)).optional(),
|
|
48
|
+
period_count: z.number().int().default(4),
|
|
49
|
+
period_length: z.number().int().default(30),
|
|
50
|
+
outstanding_balances: z.array(OutstandingBalance$inboundSchema).optional(),
|
|
51
|
+
}).transform((v) => {
|
|
52
|
+
return remap$(v, {
|
|
53
|
+
"report_generated_at": "reportGeneratedAt",
|
|
54
|
+
"report_as_of_date": "reportAsOfDate",
|
|
55
|
+
"period_count": "periodCount",
|
|
56
|
+
"period_length": "periodLength",
|
|
57
|
+
"outstanding_balances": "outstandingBalances",
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
/** @internal */
|
|
62
|
+
export type AgedDebtors$Outbound = {
|
|
63
|
+
report_generated_at?: string | undefined;
|
|
64
|
+
report_as_of_date?: string | undefined;
|
|
65
|
+
period_count: number;
|
|
66
|
+
period_length: number;
|
|
67
|
+
outstanding_balances?: Array<OutstandingBalance$Outbound> | undefined;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/** @internal */
|
|
71
|
+
export const AgedDebtors$outboundSchema: z.ZodType<
|
|
72
|
+
AgedDebtors$Outbound,
|
|
73
|
+
z.ZodTypeDef,
|
|
74
|
+
AgedDebtors
|
|
75
|
+
> = z.object({
|
|
76
|
+
reportGeneratedAt: z.date().transform(v => v.toISOString()).optional(),
|
|
77
|
+
reportAsOfDate: z.instanceof(RFCDate).transform(v => v.toString()).optional(),
|
|
78
|
+
periodCount: z.number().int().default(4),
|
|
79
|
+
periodLength: z.number().int().default(30),
|
|
80
|
+
outstandingBalances: z.array(OutstandingBalance$outboundSchema).optional(),
|
|
81
|
+
}).transform((v) => {
|
|
82
|
+
return remap$(v, {
|
|
83
|
+
reportGeneratedAt: "report_generated_at",
|
|
84
|
+
reportAsOfDate: "report_as_of_date",
|
|
85
|
+
periodCount: "period_count",
|
|
86
|
+
periodLength: "period_length",
|
|
87
|
+
outstandingBalances: "outstanding_balances",
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* @internal
|
|
93
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
94
|
+
*/
|
|
95
|
+
export namespace AgedDebtors$ {
|
|
96
|
+
/** @deprecated use `AgedDebtors$inboundSchema` instead. */
|
|
97
|
+
export const inboundSchema = AgedDebtors$inboundSchema;
|
|
98
|
+
/** @deprecated use `AgedDebtors$outboundSchema` instead. */
|
|
99
|
+
export const outboundSchema = AgedDebtors$outboundSchema;
|
|
100
|
+
/** @deprecated use `AgedDebtors$Outbound` instead. */
|
|
101
|
+
export type Outbound = AgedDebtors$Outbound;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function agedDebtorsToJSON(agedDebtors: AgedDebtors): string {
|
|
105
|
+
return JSON.stringify(AgedDebtors$outboundSchema.parse(agedDebtors));
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export function agedDebtorsFromJSON(
|
|
109
|
+
jsonString: string,
|
|
110
|
+
): SafeParseResult<AgedDebtors, SDKValidationError> {
|
|
111
|
+
return safeParse(
|
|
112
|
+
jsonString,
|
|
113
|
+
(x) => AgedDebtors$inboundSchema.parse(JSON.parse(x)),
|
|
114
|
+
`Failed to parse 'AgedDebtors' from JSON`,
|
|
115
|
+
);
|
|
116
|
+
}
|