@unified-api/typescript-sdk 2.34.0 → 2.38.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 +4 -0
- package/docs/sdks/accounting/README.md +164 -0
- package/docs/sdks/report/README.md +171 -0
- package/funcs/accountingGetAccountingReport.d.ts +14 -0
- package/funcs/accountingGetAccountingReport.d.ts.map +1 -0
- package/funcs/accountingGetAccountingReport.js +112 -0
- package/funcs/accountingGetAccountingReport.js.map +1 -0
- package/funcs/accountingListAccountingReports.d.ts +14 -0
- package/funcs/accountingListAccountingReports.d.ts.map +1 -0
- package/funcs/accountingListAccountingReports.js +116 -0
- package/funcs/accountingListAccountingReports.js.map +1 -0
- package/funcs/reportGetAccountingReport.d.ts +14 -0
- package/funcs/reportGetAccountingReport.d.ts.map +1 -0
- package/funcs/reportGetAccountingReport.js +112 -0
- package/funcs/reportGetAccountingReport.js.map +1 -0
- package/funcs/reportListAccountingReports.d.ts +14 -0
- package/funcs/reportListAccountingReports.d.ts.map +1 -0
- package/funcs/reportListAccountingReports.js +116 -0
- package/funcs/reportListAccountingReports.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/package.json +1 -1
- package/sdk/accounting.d.ts +8 -0
- package/sdk/accounting.d.ts.map +1 -1
- package/sdk/accounting.js +14 -0
- package/sdk/accounting.js.map +1 -1
- package/sdk/models/operations/getaccountingreport.d.ts +42 -0
- package/sdk/models/operations/getaccountingreport.d.ts.map +1 -0
- package/sdk/models/operations/getaccountingreport.js +72 -0
- package/sdk/models/operations/getaccountingreport.js.map +1 -0
- package/sdk/models/operations/index.d.ts +2 -0
- package/sdk/models/operations/index.d.ts.map +1 -1
- package/sdk/models/operations/index.js +2 -0
- package/sdk/models/operations/index.js.map +1 -1
- package/sdk/models/operations/listaccountingreports.d.ts +57 -0
- package/sdk/models/operations/listaccountingreports.d.ts.map +1 -0
- package/sdk/models/operations/listaccountingreports.js +87 -0
- package/sdk/models/operations/listaccountingreports.js.map +1 -0
- package/sdk/models/shared/accountingreport.d.ts +97 -0
- package/sdk/models/shared/accountingreport.d.ts.map +1 -0
- package/sdk/models/shared/accountingreport.js +137 -0
- package/sdk/models/shared/accountingreport.js.map +1 -0
- package/sdk/models/shared/hrisemployee.d.ts +6 -0
- package/sdk/models/shared/hrisemployee.d.ts.map +1 -1
- package/sdk/models/shared/hrisemployee.js +12 -0
- package/sdk/models/shared/hrisemployee.js.map +1 -1
- package/sdk/models/shared/index.d.ts +1 -0
- package/sdk/models/shared/index.d.ts.map +1 -1
- package/sdk/models/shared/index.js +1 -0
- package/sdk/models/shared/index.js.map +1 -1
- package/sdk/models/shared/integrationsupport.d.ts +2 -2
- package/sdk/models/shared/integrationsupport.d.ts.map +1 -1
- package/sdk/models/shared/integrationsupport.js +2 -2
- package/sdk/models/shared/integrationsupport.js.map +1 -1
- package/sdk/models/shared/metadatametadata.d.ts +2 -0
- package/sdk/models/shared/metadatametadata.d.ts.map +1 -1
- package/sdk/models/shared/metadatametadata.js +2 -0
- package/sdk/models/shared/metadatametadata.js.map +1 -1
- package/sdk/models/shared/propertyconnectionpermissions.d.ts +6 -0
- package/sdk/models/shared/propertyconnectionpermissions.d.ts.map +1 -1
- package/sdk/models/shared/propertyconnectionpermissions.js +2 -0
- package/sdk/models/shared/propertyconnectionpermissions.js.map +1 -1
- package/sdk/models/shared/webhook.d.ts +5 -2
- package/sdk/models/shared/webhook.d.ts.map +1 -1
- package/sdk/models/shared/webhook.js +3 -2
- package/sdk/models/shared/webhook.js.map +1 -1
- package/sdk/report.d.ts +14 -0
- package/sdk/report.d.ts.map +1 -0
- package/sdk/report.js +26 -0
- package/sdk/report.js.map +1 -0
- package/sdk/sdk.d.ts +3 -0
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +4 -0
- package/sdk/sdk.js.map +1 -1
- package/src/funcs/accountingGetAccountingReport.ts +169 -0
- package/src/funcs/accountingListAccountingReports.ts +171 -0
- package/src/funcs/reportGetAccountingReport.ts +169 -0
- package/src/funcs/reportListAccountingReports.ts +171 -0
- package/src/lib/config.ts +2 -2
- package/src/sdk/accounting.ts +30 -0
- package/src/sdk/models/operations/getaccountingreport.ts +92 -0
- package/src/sdk/models/operations/index.ts +2 -0
- package/src/sdk/models/operations/listaccountingreports.ts +124 -0
- package/src/sdk/models/shared/accountingreport.ts +198 -0
- package/src/sdk/models/shared/hrisemployee.ts +18 -0
- package/src/sdk/models/shared/index.ts +1 -0
- package/src/sdk/models/shared/integrationsupport.ts +4 -4
- package/src/sdk/models/shared/metadatametadata.ts +4 -0
- package/src/sdk/models/shared/propertyconnectionpermissions.ts +2 -0
- package/src/sdk/models/shared/webhook.ts +5 -4
- package/src/sdk/report.ts +40 -0
- package/src/sdk/sdk.ts +6 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { UnifiedToCore } from "../core.js";
|
|
7
|
+
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../sdk/models/errors/httpclienterrors.js";
|
|
21
|
+
import { SDKError } from "../sdk/models/errors/sdkerror.js";
|
|
22
|
+
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
|
|
23
|
+
import * as operations from "../sdk/models/operations/index.js";
|
|
24
|
+
import * as shared from "../sdk/models/shared/index.js";
|
|
25
|
+
import { APICall, APIPromise } from "../sdk/types/async.js";
|
|
26
|
+
import { Result } from "../sdk/types/fp.js";
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* List all reports
|
|
30
|
+
*/
|
|
31
|
+
export function accountingListAccountingReports(
|
|
32
|
+
client: UnifiedToCore,
|
|
33
|
+
request: operations.ListAccountingReportsRequest,
|
|
34
|
+
options?: RequestOptions,
|
|
35
|
+
): APIPromise<
|
|
36
|
+
Result<
|
|
37
|
+
Array<shared.AccountingReport>,
|
|
38
|
+
| SDKError
|
|
39
|
+
| SDKValidationError
|
|
40
|
+
| UnexpectedClientError
|
|
41
|
+
| InvalidRequestError
|
|
42
|
+
| RequestAbortedError
|
|
43
|
+
| RequestTimeoutError
|
|
44
|
+
| ConnectionError
|
|
45
|
+
>
|
|
46
|
+
> {
|
|
47
|
+
return new APIPromise($do(
|
|
48
|
+
client,
|
|
49
|
+
request,
|
|
50
|
+
options,
|
|
51
|
+
));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
async function $do(
|
|
55
|
+
client: UnifiedToCore,
|
|
56
|
+
request: operations.ListAccountingReportsRequest,
|
|
57
|
+
options?: RequestOptions,
|
|
58
|
+
): Promise<
|
|
59
|
+
[
|
|
60
|
+
Result<
|
|
61
|
+
Array<shared.AccountingReport>,
|
|
62
|
+
| SDKError
|
|
63
|
+
| SDKValidationError
|
|
64
|
+
| UnexpectedClientError
|
|
65
|
+
| InvalidRequestError
|
|
66
|
+
| RequestAbortedError
|
|
67
|
+
| RequestTimeoutError
|
|
68
|
+
| ConnectionError
|
|
69
|
+
>,
|
|
70
|
+
APICall,
|
|
71
|
+
]
|
|
72
|
+
> {
|
|
73
|
+
const parsed = safeParse(
|
|
74
|
+
request,
|
|
75
|
+
(value) =>
|
|
76
|
+
operations.ListAccountingReportsRequest$outboundSchema.parse(value),
|
|
77
|
+
"Input validation failed",
|
|
78
|
+
);
|
|
79
|
+
if (!parsed.ok) {
|
|
80
|
+
return [parsed, { status: "invalid" }];
|
|
81
|
+
}
|
|
82
|
+
const payload = parsed.value;
|
|
83
|
+
const body = null;
|
|
84
|
+
|
|
85
|
+
const pathParams = {
|
|
86
|
+
connection_id: encodeSimple("connection_id", payload.connection_id, {
|
|
87
|
+
explode: false,
|
|
88
|
+
charEncoding: "percent",
|
|
89
|
+
}),
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const path = pathToFunc("/accounting/{connection_id}/report")(pathParams);
|
|
93
|
+
|
|
94
|
+
const query = encodeFormQuery({
|
|
95
|
+
"fields": payload.fields,
|
|
96
|
+
"limit": payload.limit,
|
|
97
|
+
"offset": payload.offset,
|
|
98
|
+
"order": payload.order,
|
|
99
|
+
"query": payload.query,
|
|
100
|
+
"sort": payload.sort,
|
|
101
|
+
"type": payload.type,
|
|
102
|
+
"updated_gte": payload.updated_gte,
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
const headers = new Headers(compactMap({
|
|
106
|
+
Accept: "application/json",
|
|
107
|
+
}));
|
|
108
|
+
|
|
109
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
110
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
111
|
+
|
|
112
|
+
const context = {
|
|
113
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
114
|
+
operationID: "listAccountingReports",
|
|
115
|
+
oAuth2Scopes: [],
|
|
116
|
+
|
|
117
|
+
resolvedSecurity: requestSecurity,
|
|
118
|
+
|
|
119
|
+
securitySource: client._options.security,
|
|
120
|
+
retryConfig: options?.retries
|
|
121
|
+
|| client._options.retryConfig
|
|
122
|
+
|| { strategy: "none" },
|
|
123
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const requestRes = client._createRequest(context, {
|
|
127
|
+
security: requestSecurity,
|
|
128
|
+
method: "GET",
|
|
129
|
+
baseURL: options?.serverURL,
|
|
130
|
+
path: path,
|
|
131
|
+
headers: headers,
|
|
132
|
+
query: query,
|
|
133
|
+
body: body,
|
|
134
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
135
|
+
}, options);
|
|
136
|
+
if (!requestRes.ok) {
|
|
137
|
+
return [requestRes, { status: "invalid" }];
|
|
138
|
+
}
|
|
139
|
+
const req = requestRes.value;
|
|
140
|
+
|
|
141
|
+
const doResult = await client._do(req, {
|
|
142
|
+
context,
|
|
143
|
+
errorCodes: ["4XX", "5XX"],
|
|
144
|
+
retryConfig: context.retryConfig,
|
|
145
|
+
retryCodes: context.retryCodes,
|
|
146
|
+
});
|
|
147
|
+
if (!doResult.ok) {
|
|
148
|
+
return [doResult, { status: "request-error", request: req }];
|
|
149
|
+
}
|
|
150
|
+
const response = doResult.value;
|
|
151
|
+
|
|
152
|
+
const [result] = await M.match<
|
|
153
|
+
Array<shared.AccountingReport>,
|
|
154
|
+
| SDKError
|
|
155
|
+
| SDKValidationError
|
|
156
|
+
| UnexpectedClientError
|
|
157
|
+
| InvalidRequestError
|
|
158
|
+
| RequestAbortedError
|
|
159
|
+
| RequestTimeoutError
|
|
160
|
+
| ConnectionError
|
|
161
|
+
>(
|
|
162
|
+
M.json(200, z.array(shared.AccountingReport$inboundSchema)),
|
|
163
|
+
M.fail("4XX"),
|
|
164
|
+
M.fail("5XX"),
|
|
165
|
+
)(response);
|
|
166
|
+
if (!result.ok) {
|
|
167
|
+
return [result, { status: "complete", request: req, response }];
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
return [result, { status: "complete", request: req, response }];
|
|
171
|
+
}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { UnifiedToCore } from "../core.js";
|
|
6
|
+
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import {
|
|
14
|
+
ConnectionError,
|
|
15
|
+
InvalidRequestError,
|
|
16
|
+
RequestAbortedError,
|
|
17
|
+
RequestTimeoutError,
|
|
18
|
+
UnexpectedClientError,
|
|
19
|
+
} from "../sdk/models/errors/httpclienterrors.js";
|
|
20
|
+
import { SDKError } from "../sdk/models/errors/sdkerror.js";
|
|
21
|
+
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
|
|
22
|
+
import * as operations from "../sdk/models/operations/index.js";
|
|
23
|
+
import * as shared from "../sdk/models/shared/index.js";
|
|
24
|
+
import { APICall, APIPromise } from "../sdk/types/async.js";
|
|
25
|
+
import { Result } from "../sdk/types/fp.js";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Retrieve a report
|
|
29
|
+
*/
|
|
30
|
+
export function reportGetAccountingReport(
|
|
31
|
+
client: UnifiedToCore,
|
|
32
|
+
request: operations.GetAccountingReportRequest,
|
|
33
|
+
options?: RequestOptions,
|
|
34
|
+
): APIPromise<
|
|
35
|
+
Result<
|
|
36
|
+
shared.AccountingReport,
|
|
37
|
+
| SDKError
|
|
38
|
+
| SDKValidationError
|
|
39
|
+
| UnexpectedClientError
|
|
40
|
+
| InvalidRequestError
|
|
41
|
+
| RequestAbortedError
|
|
42
|
+
| RequestTimeoutError
|
|
43
|
+
| ConnectionError
|
|
44
|
+
>
|
|
45
|
+
> {
|
|
46
|
+
return new APIPromise($do(
|
|
47
|
+
client,
|
|
48
|
+
request,
|
|
49
|
+
options,
|
|
50
|
+
));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
async function $do(
|
|
54
|
+
client: UnifiedToCore,
|
|
55
|
+
request: operations.GetAccountingReportRequest,
|
|
56
|
+
options?: RequestOptions,
|
|
57
|
+
): Promise<
|
|
58
|
+
[
|
|
59
|
+
Result<
|
|
60
|
+
shared.AccountingReport,
|
|
61
|
+
| SDKError
|
|
62
|
+
| SDKValidationError
|
|
63
|
+
| UnexpectedClientError
|
|
64
|
+
| InvalidRequestError
|
|
65
|
+
| RequestAbortedError
|
|
66
|
+
| RequestTimeoutError
|
|
67
|
+
| ConnectionError
|
|
68
|
+
>,
|
|
69
|
+
APICall,
|
|
70
|
+
]
|
|
71
|
+
> {
|
|
72
|
+
const parsed = safeParse(
|
|
73
|
+
request,
|
|
74
|
+
(value) =>
|
|
75
|
+
operations.GetAccountingReportRequest$outboundSchema.parse(value),
|
|
76
|
+
"Input validation failed",
|
|
77
|
+
);
|
|
78
|
+
if (!parsed.ok) {
|
|
79
|
+
return [parsed, { status: "invalid" }];
|
|
80
|
+
}
|
|
81
|
+
const payload = parsed.value;
|
|
82
|
+
const body = null;
|
|
83
|
+
|
|
84
|
+
const pathParams = {
|
|
85
|
+
connection_id: encodeSimple("connection_id", payload.connection_id, {
|
|
86
|
+
explode: false,
|
|
87
|
+
charEncoding: "percent",
|
|
88
|
+
}),
|
|
89
|
+
id: encodeSimple("id", payload.id, {
|
|
90
|
+
explode: false,
|
|
91
|
+
charEncoding: "percent",
|
|
92
|
+
}),
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const path = pathToFunc("/accounting/{connection_id}/report/{id}")(
|
|
96
|
+
pathParams,
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
const query = encodeFormQuery({
|
|
100
|
+
"fields": payload.fields,
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
const headers = new Headers(compactMap({
|
|
104
|
+
Accept: "application/json",
|
|
105
|
+
}));
|
|
106
|
+
|
|
107
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
108
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
109
|
+
|
|
110
|
+
const context = {
|
|
111
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
112
|
+
operationID: "getAccountingReport",
|
|
113
|
+
oAuth2Scopes: [],
|
|
114
|
+
|
|
115
|
+
resolvedSecurity: requestSecurity,
|
|
116
|
+
|
|
117
|
+
securitySource: client._options.security,
|
|
118
|
+
retryConfig: options?.retries
|
|
119
|
+
|| client._options.retryConfig
|
|
120
|
+
|| { strategy: "none" },
|
|
121
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const requestRes = client._createRequest(context, {
|
|
125
|
+
security: requestSecurity,
|
|
126
|
+
method: "GET",
|
|
127
|
+
baseURL: options?.serverURL,
|
|
128
|
+
path: path,
|
|
129
|
+
headers: headers,
|
|
130
|
+
query: query,
|
|
131
|
+
body: body,
|
|
132
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
133
|
+
}, options);
|
|
134
|
+
if (!requestRes.ok) {
|
|
135
|
+
return [requestRes, { status: "invalid" }];
|
|
136
|
+
}
|
|
137
|
+
const req = requestRes.value;
|
|
138
|
+
|
|
139
|
+
const doResult = await client._do(req, {
|
|
140
|
+
context,
|
|
141
|
+
errorCodes: ["4XX", "5XX"],
|
|
142
|
+
retryConfig: context.retryConfig,
|
|
143
|
+
retryCodes: context.retryCodes,
|
|
144
|
+
});
|
|
145
|
+
if (!doResult.ok) {
|
|
146
|
+
return [doResult, { status: "request-error", request: req }];
|
|
147
|
+
}
|
|
148
|
+
const response = doResult.value;
|
|
149
|
+
|
|
150
|
+
const [result] = await M.match<
|
|
151
|
+
shared.AccountingReport,
|
|
152
|
+
| SDKError
|
|
153
|
+
| SDKValidationError
|
|
154
|
+
| UnexpectedClientError
|
|
155
|
+
| InvalidRequestError
|
|
156
|
+
| RequestAbortedError
|
|
157
|
+
| RequestTimeoutError
|
|
158
|
+
| ConnectionError
|
|
159
|
+
>(
|
|
160
|
+
M.json(200, shared.AccountingReport$inboundSchema),
|
|
161
|
+
M.fail("4XX"),
|
|
162
|
+
M.fail("5XX"),
|
|
163
|
+
)(response);
|
|
164
|
+
if (!result.ok) {
|
|
165
|
+
return [result, { status: "complete", request: req, response }];
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return [result, { status: "complete", request: req, response }];
|
|
169
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { UnifiedToCore } from "../core.js";
|
|
7
|
+
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../sdk/models/errors/httpclienterrors.js";
|
|
21
|
+
import { SDKError } from "../sdk/models/errors/sdkerror.js";
|
|
22
|
+
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
|
|
23
|
+
import * as operations from "../sdk/models/operations/index.js";
|
|
24
|
+
import * as shared from "../sdk/models/shared/index.js";
|
|
25
|
+
import { APICall, APIPromise } from "../sdk/types/async.js";
|
|
26
|
+
import { Result } from "../sdk/types/fp.js";
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* List all reports
|
|
30
|
+
*/
|
|
31
|
+
export function reportListAccountingReports(
|
|
32
|
+
client: UnifiedToCore,
|
|
33
|
+
request: operations.ListAccountingReportsRequest,
|
|
34
|
+
options?: RequestOptions,
|
|
35
|
+
): APIPromise<
|
|
36
|
+
Result<
|
|
37
|
+
Array<shared.AccountingReport>,
|
|
38
|
+
| SDKError
|
|
39
|
+
| SDKValidationError
|
|
40
|
+
| UnexpectedClientError
|
|
41
|
+
| InvalidRequestError
|
|
42
|
+
| RequestAbortedError
|
|
43
|
+
| RequestTimeoutError
|
|
44
|
+
| ConnectionError
|
|
45
|
+
>
|
|
46
|
+
> {
|
|
47
|
+
return new APIPromise($do(
|
|
48
|
+
client,
|
|
49
|
+
request,
|
|
50
|
+
options,
|
|
51
|
+
));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
async function $do(
|
|
55
|
+
client: UnifiedToCore,
|
|
56
|
+
request: operations.ListAccountingReportsRequest,
|
|
57
|
+
options?: RequestOptions,
|
|
58
|
+
): Promise<
|
|
59
|
+
[
|
|
60
|
+
Result<
|
|
61
|
+
Array<shared.AccountingReport>,
|
|
62
|
+
| SDKError
|
|
63
|
+
| SDKValidationError
|
|
64
|
+
| UnexpectedClientError
|
|
65
|
+
| InvalidRequestError
|
|
66
|
+
| RequestAbortedError
|
|
67
|
+
| RequestTimeoutError
|
|
68
|
+
| ConnectionError
|
|
69
|
+
>,
|
|
70
|
+
APICall,
|
|
71
|
+
]
|
|
72
|
+
> {
|
|
73
|
+
const parsed = safeParse(
|
|
74
|
+
request,
|
|
75
|
+
(value) =>
|
|
76
|
+
operations.ListAccountingReportsRequest$outboundSchema.parse(value),
|
|
77
|
+
"Input validation failed",
|
|
78
|
+
);
|
|
79
|
+
if (!parsed.ok) {
|
|
80
|
+
return [parsed, { status: "invalid" }];
|
|
81
|
+
}
|
|
82
|
+
const payload = parsed.value;
|
|
83
|
+
const body = null;
|
|
84
|
+
|
|
85
|
+
const pathParams = {
|
|
86
|
+
connection_id: encodeSimple("connection_id", payload.connection_id, {
|
|
87
|
+
explode: false,
|
|
88
|
+
charEncoding: "percent",
|
|
89
|
+
}),
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const path = pathToFunc("/accounting/{connection_id}/report")(pathParams);
|
|
93
|
+
|
|
94
|
+
const query = encodeFormQuery({
|
|
95
|
+
"fields": payload.fields,
|
|
96
|
+
"limit": payload.limit,
|
|
97
|
+
"offset": payload.offset,
|
|
98
|
+
"order": payload.order,
|
|
99
|
+
"query": payload.query,
|
|
100
|
+
"sort": payload.sort,
|
|
101
|
+
"type": payload.type,
|
|
102
|
+
"updated_gte": payload.updated_gte,
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
const headers = new Headers(compactMap({
|
|
106
|
+
Accept: "application/json",
|
|
107
|
+
}));
|
|
108
|
+
|
|
109
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
110
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
111
|
+
|
|
112
|
+
const context = {
|
|
113
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
114
|
+
operationID: "listAccountingReports",
|
|
115
|
+
oAuth2Scopes: [],
|
|
116
|
+
|
|
117
|
+
resolvedSecurity: requestSecurity,
|
|
118
|
+
|
|
119
|
+
securitySource: client._options.security,
|
|
120
|
+
retryConfig: options?.retries
|
|
121
|
+
|| client._options.retryConfig
|
|
122
|
+
|| { strategy: "none" },
|
|
123
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const requestRes = client._createRequest(context, {
|
|
127
|
+
security: requestSecurity,
|
|
128
|
+
method: "GET",
|
|
129
|
+
baseURL: options?.serverURL,
|
|
130
|
+
path: path,
|
|
131
|
+
headers: headers,
|
|
132
|
+
query: query,
|
|
133
|
+
body: body,
|
|
134
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
135
|
+
}, options);
|
|
136
|
+
if (!requestRes.ok) {
|
|
137
|
+
return [requestRes, { status: "invalid" }];
|
|
138
|
+
}
|
|
139
|
+
const req = requestRes.value;
|
|
140
|
+
|
|
141
|
+
const doResult = await client._do(req, {
|
|
142
|
+
context,
|
|
143
|
+
errorCodes: ["4XX", "5XX"],
|
|
144
|
+
retryConfig: context.retryConfig,
|
|
145
|
+
retryCodes: context.retryCodes,
|
|
146
|
+
});
|
|
147
|
+
if (!doResult.ok) {
|
|
148
|
+
return [doResult, { status: "request-error", request: req }];
|
|
149
|
+
}
|
|
150
|
+
const response = doResult.value;
|
|
151
|
+
|
|
152
|
+
const [result] = await M.match<
|
|
153
|
+
Array<shared.AccountingReport>,
|
|
154
|
+
| SDKError
|
|
155
|
+
| SDKValidationError
|
|
156
|
+
| UnexpectedClientError
|
|
157
|
+
| InvalidRequestError
|
|
158
|
+
| RequestAbortedError
|
|
159
|
+
| RequestTimeoutError
|
|
160
|
+
| ConnectionError
|
|
161
|
+
>(
|
|
162
|
+
M.json(200, z.array(shared.AccountingReport$inboundSchema)),
|
|
163
|
+
M.fail("4XX"),
|
|
164
|
+
M.fail("5XX"),
|
|
165
|
+
)(response);
|
|
166
|
+
if (!result.ok) {
|
|
167
|
+
return [result, { status: "complete", request: req, response }];
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
return [result, { status: "complete", request: req, response }];
|
|
171
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -65,8 +65,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
65
65
|
export const SDK_METADATA = {
|
|
66
66
|
language: "typescript",
|
|
67
67
|
openapiDocVersion: "1.0",
|
|
68
|
-
sdkVersion: "2.
|
|
68
|
+
sdkVersion: "2.38.0",
|
|
69
69
|
genVersion: "2.522.1",
|
|
70
70
|
userAgent:
|
|
71
|
-
"speakeasy-sdk/typescript 2.
|
|
71
|
+
"speakeasy-sdk/typescript 2.38.0 2.522.1 1.0 @unified-api/typescript-sdk",
|
|
72
72
|
} as const;
|
package/src/sdk/accounting.ts
CHANGED
|
@@ -15,6 +15,7 @@ import { accountingGetAccountingInvoice } from "../funcs/accountingGetAccounting
|
|
|
15
15
|
import { accountingGetAccountingJournal } from "../funcs/accountingGetAccountingJournal.js";
|
|
16
16
|
import { accountingGetAccountingOrder } from "../funcs/accountingGetAccountingOrder.js";
|
|
17
17
|
import { accountingGetAccountingOrganization } from "../funcs/accountingGetAccountingOrganization.js";
|
|
18
|
+
import { accountingGetAccountingReport } from "../funcs/accountingGetAccountingReport.js";
|
|
18
19
|
import { accountingGetAccountingTaxrate } from "../funcs/accountingGetAccountingTaxrate.js";
|
|
19
20
|
import { accountingGetAccountingTransaction } from "../funcs/accountingGetAccountingTransaction.js";
|
|
20
21
|
import { accountingListAccountingAccounts } from "../funcs/accountingListAccountingAccounts.js";
|
|
@@ -23,6 +24,7 @@ import { accountingListAccountingInvoices } from "../funcs/accountingListAccount
|
|
|
23
24
|
import { accountingListAccountingJournals } from "../funcs/accountingListAccountingJournals.js";
|
|
24
25
|
import { accountingListAccountingOrders } from "../funcs/accountingListAccountingOrders.js";
|
|
25
26
|
import { accountingListAccountingOrganizations } from "../funcs/accountingListAccountingOrganizations.js";
|
|
27
|
+
import { accountingListAccountingReports } from "../funcs/accountingListAccountingReports.js";
|
|
26
28
|
import { accountingListAccountingTaxrates } from "../funcs/accountingListAccountingTaxrates.js";
|
|
27
29
|
import { accountingListAccountingTransactions } from "../funcs/accountingListAccountingTransactions.js";
|
|
28
30
|
import { accountingPatchAccountingAccount } from "../funcs/accountingPatchAccountingAccount.js";
|
|
@@ -234,6 +236,20 @@ export class Accounting extends ClientSDK {
|
|
|
234
236
|
));
|
|
235
237
|
}
|
|
236
238
|
|
|
239
|
+
/**
|
|
240
|
+
* Retrieve a report
|
|
241
|
+
*/
|
|
242
|
+
async getAccountingReport(
|
|
243
|
+
request: operations.GetAccountingReportRequest,
|
|
244
|
+
options?: RequestOptions,
|
|
245
|
+
): Promise<shared.AccountingReport> {
|
|
246
|
+
return unwrapAsync(accountingGetAccountingReport(
|
|
247
|
+
this,
|
|
248
|
+
request,
|
|
249
|
+
options,
|
|
250
|
+
));
|
|
251
|
+
}
|
|
252
|
+
|
|
237
253
|
/**
|
|
238
254
|
* Retrieve a taxrate
|
|
239
255
|
*/
|
|
@@ -346,6 +362,20 @@ export class Accounting extends ClientSDK {
|
|
|
346
362
|
));
|
|
347
363
|
}
|
|
348
364
|
|
|
365
|
+
/**
|
|
366
|
+
* List all reports
|
|
367
|
+
*/
|
|
368
|
+
async listAccountingReports(
|
|
369
|
+
request: operations.ListAccountingReportsRequest,
|
|
370
|
+
options?: RequestOptions,
|
|
371
|
+
): Promise<Array<shared.AccountingReport>> {
|
|
372
|
+
return unwrapAsync(accountingListAccountingReports(
|
|
373
|
+
this,
|
|
374
|
+
request,
|
|
375
|
+
options,
|
|
376
|
+
));
|
|
377
|
+
}
|
|
378
|
+
|
|
349
379
|
/**
|
|
350
380
|
* List all taxrates
|
|
351
381
|
*/
|
|
@@ -0,0 +1,92 @@
|
|
|
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 { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
export type GetAccountingReportRequest = {
|
|
12
|
+
/**
|
|
13
|
+
* ID of the connection
|
|
14
|
+
*/
|
|
15
|
+
connectionId: string;
|
|
16
|
+
/**
|
|
17
|
+
* Comma-delimited fields to return
|
|
18
|
+
*/
|
|
19
|
+
fields?: Array<string> | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* ID of the Report
|
|
22
|
+
*/
|
|
23
|
+
id: string;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/** @internal */
|
|
27
|
+
export const GetAccountingReportRequest$inboundSchema: z.ZodType<
|
|
28
|
+
GetAccountingReportRequest,
|
|
29
|
+
z.ZodTypeDef,
|
|
30
|
+
unknown
|
|
31
|
+
> = z.object({
|
|
32
|
+
connection_id: z.string(),
|
|
33
|
+
fields: z.array(z.string()).optional(),
|
|
34
|
+
id: z.string(),
|
|
35
|
+
}).transform((v) => {
|
|
36
|
+
return remap$(v, {
|
|
37
|
+
"connection_id": "connectionId",
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
/** @internal */
|
|
42
|
+
export type GetAccountingReportRequest$Outbound = {
|
|
43
|
+
connection_id: string;
|
|
44
|
+
fields?: Array<string> | undefined;
|
|
45
|
+
id: string;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/** @internal */
|
|
49
|
+
export const GetAccountingReportRequest$outboundSchema: z.ZodType<
|
|
50
|
+
GetAccountingReportRequest$Outbound,
|
|
51
|
+
z.ZodTypeDef,
|
|
52
|
+
GetAccountingReportRequest
|
|
53
|
+
> = z.object({
|
|
54
|
+
connectionId: z.string(),
|
|
55
|
+
fields: z.array(z.string()).optional(),
|
|
56
|
+
id: z.string(),
|
|
57
|
+
}).transform((v) => {
|
|
58
|
+
return remap$(v, {
|
|
59
|
+
connectionId: "connection_id",
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* @internal
|
|
65
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
66
|
+
*/
|
|
67
|
+
export namespace GetAccountingReportRequest$ {
|
|
68
|
+
/** @deprecated use `GetAccountingReportRequest$inboundSchema` instead. */
|
|
69
|
+
export const inboundSchema = GetAccountingReportRequest$inboundSchema;
|
|
70
|
+
/** @deprecated use `GetAccountingReportRequest$outboundSchema` instead. */
|
|
71
|
+
export const outboundSchema = GetAccountingReportRequest$outboundSchema;
|
|
72
|
+
/** @deprecated use `GetAccountingReportRequest$Outbound` instead. */
|
|
73
|
+
export type Outbound = GetAccountingReportRequest$Outbound;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function getAccountingReportRequestToJSON(
|
|
77
|
+
getAccountingReportRequest: GetAccountingReportRequest,
|
|
78
|
+
): string {
|
|
79
|
+
return JSON.stringify(
|
|
80
|
+
GetAccountingReportRequest$outboundSchema.parse(getAccountingReportRequest),
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function getAccountingReportRequestFromJSON(
|
|
85
|
+
jsonString: string,
|
|
86
|
+
): SafeParseResult<GetAccountingReportRequest, SDKValidationError> {
|
|
87
|
+
return safeParse(
|
|
88
|
+
jsonString,
|
|
89
|
+
(x) => GetAccountingReportRequest$inboundSchema.parse(JSON.parse(x)),
|
|
90
|
+
`Failed to parse 'GetAccountingReportRequest' from JSON`,
|
|
91
|
+
);
|
|
92
|
+
}
|
|
@@ -72,6 +72,7 @@ export * from "./getaccountinginvoice.js";
|
|
|
72
72
|
export * from "./getaccountingjournal.js";
|
|
73
73
|
export * from "./getaccountingorder.js";
|
|
74
74
|
export * from "./getaccountingorganization.js";
|
|
75
|
+
export * from "./getaccountingreport.js";
|
|
75
76
|
export * from "./getaccountingtaxrate.js";
|
|
76
77
|
export * from "./getaccountingtransaction.js";
|
|
77
78
|
export * from "./getatsactivity.js";
|
|
@@ -145,6 +146,7 @@ export * from "./listaccountinginvoices.js";
|
|
|
145
146
|
export * from "./listaccountingjournals.js";
|
|
146
147
|
export * from "./listaccountingorders.js";
|
|
147
148
|
export * from "./listaccountingorganizations.js";
|
|
149
|
+
export * from "./listaccountingreports.js";
|
|
148
150
|
export * from "./listaccountingtaxrates.js";
|
|
149
151
|
export * from "./listaccountingtransactions.js";
|
|
150
152
|
export * from "./listatsactivities.js";
|