@unified-api/typescript-sdk 2.73.10 → 2.73.12
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 +12 -0
- package/bin/mcp-server.js +4421 -3450
- package/bin/mcp-server.js.map +32 -13
- package/docs/sdks/account/README.md +6 -0
- package/docs/sdks/accounting/README.md +558 -0
- package/docs/sdks/activity/README.md +6 -0
- package/docs/sdks/apicall/README.md +2 -0
- package/docs/sdks/application/README.md +6 -0
- package/docs/sdks/applicationstatus/README.md +1 -0
- package/docs/sdks/ats/README.md +49 -0
- package/docs/sdks/auth/README.md +2 -0
- package/docs/sdks/balancesheet/README.md +2 -0
- package/docs/sdks/bill/README.md +6 -0
- package/docs/sdks/branch/README.md +6 -0
- package/docs/sdks/busy/README.md +1 -0
- package/docs/sdks/calendar/README.md +21 -0
- package/docs/sdks/call/README.md +1 -0
- package/docs/sdks/candidate/README.md +6 -0
- package/docs/sdks/category/README.md +489 -0
- package/docs/sdks/channel/README.md +2 -0
- package/docs/sdks/class/README.md +6 -0
- package/docs/sdks/collection/README.md +6 -0
- package/docs/sdks/comment/README.md +18 -0
- package/docs/sdks/commerce/README.md +30 -0
- package/docs/sdks/commit/README.md +6 -0
- package/docs/sdks/company/README.md +19 -0
- package/docs/sdks/connection/README.md +6 -0
- package/docs/sdks/contact/README.md +18 -0
- package/docs/sdks/course/README.md +6 -0
- package/docs/sdks/creditmemo/README.md +6 -0
- package/docs/sdks/crm/README.md +36 -0
- package/docs/sdks/customer/README.md +6 -0
- package/docs/sdks/deal/README.md +6 -0
- package/docs/sdks/device/README.md +6 -0
- package/docs/sdks/document/README.md +6 -0
- package/docs/sdks/employee/README.md +6 -0
- package/docs/sdks/enrich/README.md +2 -0
- package/docs/sdks/event/README.md +12 -0
- package/docs/sdks/file/README.md +6 -0
- package/docs/sdks/genai/README.md +2 -0
- package/docs/sdks/group/README.md +12 -0
- package/docs/sdks/hris/README.md +40 -0
- package/docs/sdks/instructor/README.md +6 -0
- package/docs/sdks/integration/README.md +3 -0
- package/docs/sdks/interview/README.md +6 -0
- package/docs/sdks/inventory/README.md +6 -0
- package/docs/sdks/invoice/README.md +6 -0
- package/docs/sdks/issue/README.md +1 -0
- package/docs/sdks/item/README.md +6 -0
- package/docs/sdks/job/README.md +6 -0
- package/docs/sdks/journal/README.md +6 -0
- package/docs/sdks/kms/README.md +18 -0
- package/docs/sdks/lead/README.md +6 -0
- package/docs/sdks/link/README.md +12 -0
- package/docs/sdks/list/README.md +6 -0
- package/docs/sdks/lms/README.md +24 -0
- package/docs/sdks/location/README.md +12 -0
- package/docs/sdks/login/README.md +1 -0
- package/docs/sdks/martech/README.md +12 -0
- package/docs/sdks/member/README.md +6 -0
- package/docs/sdks/message/README.md +6 -0
- package/docs/sdks/messaging/README.md +8 -0
- package/docs/sdks/metadata/README.md +6 -0
- package/docs/sdks/model/README.md +1 -0
- package/docs/sdks/note/README.md +6 -0
- package/docs/sdks/order/README.md +6 -0
- package/docs/sdks/organization/README.md +8 -0
- package/docs/sdks/page/README.md +6 -0
- package/docs/sdks/passthrough/README.md +8 -0
- package/docs/sdks/payment/README.md +22 -0
- package/docs/sdks/payout/README.md +2 -0
- package/docs/sdks/payslip/README.md +2 -0
- package/docs/sdks/person/README.md +1 -0
- package/docs/sdks/pipeline/README.md +6 -0
- package/docs/sdks/profitloss/README.md +2 -0
- package/docs/sdks/project/README.md +6 -0
- package/docs/sdks/prompt/README.md +1 -0
- package/docs/sdks/pullrequest/README.md +6 -0
- package/docs/sdks/purchaseorder/README.md +6 -0
- package/docs/sdks/recording/README.md +8 -0
- package/docs/sdks/refund/README.md +2 -0
- package/docs/sdks/repo/README.md +30 -0
- package/docs/sdks/report/README.md +2 -0
- package/docs/sdks/repository/README.md +6 -0
- package/docs/sdks/review/README.md +6 -0
- package/docs/sdks/salesorder/README.md +6 -0
- package/docs/sdks/scim/README.md +12 -0
- package/docs/sdks/scorecard/README.md +6 -0
- package/docs/sdks/space/README.md +6 -0
- package/docs/sdks/storage/README.md +6 -0
- package/docs/sdks/student/README.md +6 -0
- package/docs/sdks/subscription/README.md +6 -0
- package/docs/sdks/task/README.md +18 -0
- package/docs/sdks/taxrate/README.md +6 -0
- package/docs/sdks/ticket/README.md +6 -0
- package/docs/sdks/ticketing/README.md +18 -0
- package/docs/sdks/timeoff/README.md +2 -0
- package/docs/sdks/timeshift/README.md +6 -0
- package/docs/sdks/transaction/README.md +6 -0
- package/docs/sdks/trialbalance/README.md +2 -0
- package/docs/sdks/uc/README.md +19 -0
- package/docs/sdks/unified/README.md +20 -0
- package/docs/sdks/user/README.md +6 -0
- package/docs/sdks/webhook/README.md +8 -0
- package/examples/README.md +5 -0
- package/examples/accountingCreateAccountingAccount.example.ts +2 -0
- package/examples/package-lock.json +6 -5
- package/funcs/accountingCreateAccountingCategory.d.ts +15 -0
- package/funcs/accountingCreateAccountingCategory.d.ts.map +1 -0
- package/funcs/accountingCreateAccountingCategory.js +114 -0
- package/funcs/accountingCreateAccountingCategory.js.map +1 -0
- package/funcs/accountingGetAccountingCategory.d.ts +15 -0
- package/funcs/accountingGetAccountingCategory.d.ts.map +1 -0
- package/funcs/accountingGetAccountingCategory.js +115 -0
- package/funcs/accountingGetAccountingCategory.js.map +1 -0
- package/funcs/accountingListAccountingCategories.d.ts +15 -0
- package/funcs/accountingListAccountingCategories.d.ts.map +1 -0
- package/funcs/accountingListAccountingCategories.js +119 -0
- package/funcs/accountingListAccountingCategories.js.map +1 -0
- package/funcs/accountingPatchAccountingCategory.d.ts +15 -0
- package/funcs/accountingPatchAccountingCategory.d.ts.map +1 -0
- package/funcs/accountingPatchAccountingCategory.js +118 -0
- package/funcs/accountingPatchAccountingCategory.js.map +1 -0
- package/funcs/accountingRemoveAccountingCategory.d.ts +14 -0
- package/funcs/accountingRemoveAccountingCategory.d.ts.map +1 -0
- package/funcs/accountingRemoveAccountingCategory.js +112 -0
- package/funcs/accountingRemoveAccountingCategory.js.map +1 -0
- package/funcs/accountingUpdateAccountingCategory.d.ts +15 -0
- package/funcs/accountingUpdateAccountingCategory.d.ts.map +1 -0
- package/funcs/accountingUpdateAccountingCategory.js +118 -0
- package/funcs/accountingUpdateAccountingCategory.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.d.ts.map +1 -1
- package/mcp-server/server.js +13 -1
- package/mcp-server/server.js.map +1 -1
- package/mcp-server/tools/accountingCreateAccountingCategory.d.ts +8 -0
- package/mcp-server/tools/accountingCreateAccountingCategory.d.ts.map +1 -0
- package/mcp-server/tools/accountingCreateAccountingCategory.js +52 -0
- package/mcp-server/tools/accountingCreateAccountingCategory.js.map +1 -0
- package/mcp-server/tools/accountingGetAccountingCategory.d.ts +8 -0
- package/mcp-server/tools/accountingGetAccountingCategory.d.ts.map +1 -0
- package/mcp-server/tools/accountingGetAccountingCategory.js +52 -0
- package/mcp-server/tools/accountingGetAccountingCategory.js.map +1 -0
- package/mcp-server/tools/accountingListAccountingCategories.d.ts +8 -0
- package/mcp-server/tools/accountingListAccountingCategories.d.ts.map +1 -0
- package/mcp-server/tools/accountingListAccountingCategories.js +52 -0
- package/mcp-server/tools/accountingListAccountingCategories.js.map +1 -0
- package/mcp-server/tools/accountingPatchAccountingCategory.d.ts +8 -0
- package/mcp-server/tools/accountingPatchAccountingCategory.d.ts.map +1 -0
- package/mcp-server/tools/accountingPatchAccountingCategory.js +52 -0
- package/mcp-server/tools/accountingPatchAccountingCategory.js.map +1 -0
- package/mcp-server/tools/accountingRemoveAccountingCategory.d.ts +8 -0
- package/mcp-server/tools/accountingRemoveAccountingCategory.d.ts.map +1 -0
- package/mcp-server/tools/accountingRemoveAccountingCategory.js +51 -0
- package/mcp-server/tools/accountingRemoveAccountingCategory.js.map +1 -0
- package/mcp-server/tools/accountingUpdateAccountingCategory.d.ts +8 -0
- package/mcp-server/tools/accountingUpdateAccountingCategory.d.ts.map +1 -0
- package/mcp-server/tools/accountingUpdateAccountingCategory.js +52 -0
- package/mcp-server/tools/accountingUpdateAccountingCategory.js.map +1 -0
- package/package.json +4 -6
- package/sdk/accounting.d.ts +24 -0
- package/sdk/accounting.d.ts.map +1 -1
- package/sdk/accounting.js +42 -0
- package/sdk/accounting.js.map +1 -1
- package/sdk/category.d.ts +30 -0
- package/sdk/category.d.ts.map +1 -0
- package/sdk/category.js +54 -0
- package/sdk/category.js.map +1 -0
- package/sdk/models/operations/createaccountingcategory.d.ts +45 -0
- package/sdk/models/operations/createaccountingcategory.d.ts.map +1 -0
- package/sdk/models/operations/createaccountingcategory.js +77 -0
- package/sdk/models/operations/createaccountingcategory.js.map +1 -0
- package/sdk/models/operations/getaccountingcategory.d.ts +47 -0
- package/sdk/models/operations/getaccountingcategory.d.ts.map +1 -0
- package/sdk/models/operations/getaccountingcategory.js +74 -0
- package/sdk/models/operations/getaccountingcategory.js.map +1 -0
- package/sdk/models/operations/index.d.ts +6 -0
- package/sdk/models/operations/index.d.ts.map +1 -1
- package/sdk/models/operations/index.js +6 -0
- package/sdk/models/operations/index.js.map +1 -1
- package/sdk/models/operations/listaccountingcategories.d.ts +65 -0
- package/sdk/models/operations/listaccountingcategories.d.ts.map +1 -0
- package/sdk/models/operations/listaccountingcategories.js +90 -0
- package/sdk/models/operations/listaccountingcategories.js.map +1 -0
- package/sdk/models/operations/patchaccountingcategory.d.ts +50 -0
- package/sdk/models/operations/patchaccountingcategory.d.ts.map +1 -0
- package/sdk/models/operations/patchaccountingcategory.js +79 -0
- package/sdk/models/operations/patchaccountingcategory.js.map +1 -0
- package/sdk/models/operations/removeaccountingcategory.d.ts +66 -0
- package/sdk/models/operations/removeaccountingcategory.d.ts.map +1 -0
- package/sdk/models/operations/removeaccountingcategory.js +105 -0
- package/sdk/models/operations/removeaccountingcategory.js.map +1 -0
- package/sdk/models/operations/updateaccountingcategory.d.ts +50 -0
- package/sdk/models/operations/updateaccountingcategory.d.ts.map +1 -0
- package/sdk/models/operations/updateaccountingcategory.js +79 -0
- package/sdk/models/operations/updateaccountingcategory.js.map +1 -0
- package/sdk/models/shared/accountingcategory.d.ts +47 -0
- package/sdk/models/shared/accountingcategory.d.ts.map +1 -0
- package/sdk/models/shared/accountingcategory.js +90 -0
- package/sdk/models/shared/accountingcategory.js.map +1 -0
- package/sdk/models/shared/accountinglineitem.d.ts +2 -0
- package/sdk/models/shared/accountinglineitem.d.ts.map +1 -1
- package/sdk/models/shared/accountinglineitem.js +4 -0
- package/sdk/models/shared/accountinglineitem.js.map +1 -1
- package/sdk/models/shared/accountingprofitloss.d.ts +3 -3
- 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/propertyaccountingreportprofitandloss.d.ts +3 -3
- package/sdk/models/shared/propertyconnectionpermissions.d.ts +2 -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 +1 -0
- package/sdk/models/shared/webhook.d.ts.map +1 -1
- package/sdk/models/shared/webhook.js +1 -0
- package/sdk/models/shared/webhook.js.map +1 -1
- 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/accountingCreateAccountingCategory.ts +173 -0
- package/src/funcs/accountingGetAccountingCategory.ts +176 -0
- package/src/funcs/accountingListAccountingCategories.ts +178 -0
- package/src/funcs/accountingPatchAccountingCategory.ts +179 -0
- package/src/funcs/accountingRemoveAccountingCategory.ts +181 -0
- package/src/funcs/accountingUpdateAccountingCategory.ts +179 -0
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +13 -1
- package/src/mcp-server/tools/accountingCreateAccountingCategory.ts +37 -0
- package/src/mcp-server/tools/accountingGetAccountingCategory.ts +36 -0
- package/src/mcp-server/tools/accountingListAccountingCategories.ts +37 -0
- package/src/mcp-server/tools/accountingPatchAccountingCategory.ts +37 -0
- package/src/mcp-server/tools/accountingRemoveAccountingCategory.ts +35 -0
- package/src/mcp-server/tools/accountingUpdateAccountingCategory.ts +37 -0
- package/src/sdk/accounting.ts +90 -0
- package/src/sdk/category.ts +100 -0
- package/src/sdk/models/operations/createaccountingcategory.ts +101 -0
- package/src/sdk/models/operations/getaccountingcategory.ts +101 -0
- package/src/sdk/models/operations/index.ts +6 -0
- package/src/sdk/models/operations/listaccountingcategories.ts +135 -0
- package/src/sdk/models/operations/patchaccountingcategory.ts +108 -0
- package/src/sdk/models/operations/removeaccountingcategory.ts +155 -0
- package/src/sdk/models/operations/updateaccountingcategory.ts +108 -0
- package/src/sdk/models/shared/accountingcategory.ts +111 -0
- package/src/sdk/models/shared/accountinglineitem.ts +6 -0
- package/src/sdk/models/shared/accountingprofitloss.ts +3 -3
- package/src/sdk/models/shared/index.ts +1 -0
- package/src/sdk/models/shared/propertyaccountingreportprofitandloss.ts +3 -3
- package/src/sdk/models/shared/propertyconnectionpermissions.ts +2 -0
- package/src/sdk/models/shared/webhook.ts +1 -0
- package/src/sdk/sdk.ts +6 -0
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { UnifiedToCore } from "../core.js";
|
|
6
|
+
import { encodeFormQuery, encodeJSON, 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 { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js";
|
|
21
|
+
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
|
|
22
|
+
import { UnifiedToError } from "../sdk/models/errors/unifiedtoerror.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
|
+
* Create a category
|
|
30
|
+
*/
|
|
31
|
+
export function accountingCreateAccountingCategory(
|
|
32
|
+
client: UnifiedToCore,
|
|
33
|
+
request: operations.CreateAccountingCategoryRequest,
|
|
34
|
+
options?: RequestOptions,
|
|
35
|
+
): APIPromise<
|
|
36
|
+
Result<
|
|
37
|
+
shared.AccountingCategory,
|
|
38
|
+
| UnifiedToError
|
|
39
|
+
| ResponseValidationError
|
|
40
|
+
| ConnectionError
|
|
41
|
+
| RequestAbortedError
|
|
42
|
+
| RequestTimeoutError
|
|
43
|
+
| InvalidRequestError
|
|
44
|
+
| UnexpectedClientError
|
|
45
|
+
| SDKValidationError
|
|
46
|
+
>
|
|
47
|
+
> {
|
|
48
|
+
return new APIPromise($do(
|
|
49
|
+
client,
|
|
50
|
+
request,
|
|
51
|
+
options,
|
|
52
|
+
));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async function $do(
|
|
56
|
+
client: UnifiedToCore,
|
|
57
|
+
request: operations.CreateAccountingCategoryRequest,
|
|
58
|
+
options?: RequestOptions,
|
|
59
|
+
): Promise<
|
|
60
|
+
[
|
|
61
|
+
Result<
|
|
62
|
+
shared.AccountingCategory,
|
|
63
|
+
| UnifiedToError
|
|
64
|
+
| ResponseValidationError
|
|
65
|
+
| ConnectionError
|
|
66
|
+
| RequestAbortedError
|
|
67
|
+
| RequestTimeoutError
|
|
68
|
+
| InvalidRequestError
|
|
69
|
+
| UnexpectedClientError
|
|
70
|
+
| SDKValidationError
|
|
71
|
+
>,
|
|
72
|
+
APICall,
|
|
73
|
+
]
|
|
74
|
+
> {
|
|
75
|
+
const parsed = safeParse(
|
|
76
|
+
request,
|
|
77
|
+
(value) =>
|
|
78
|
+
operations.CreateAccountingCategoryRequest$outboundSchema.parse(value),
|
|
79
|
+
"Input validation failed",
|
|
80
|
+
);
|
|
81
|
+
if (!parsed.ok) {
|
|
82
|
+
return [parsed, { status: "invalid" }];
|
|
83
|
+
}
|
|
84
|
+
const payload = parsed.value;
|
|
85
|
+
const body = encodeJSON("body", payload.AccountingCategory, {
|
|
86
|
+
explode: true,
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
const pathParams = {
|
|
90
|
+
connection_id: encodeSimple("connection_id", payload.connection_id, {
|
|
91
|
+
explode: false,
|
|
92
|
+
charEncoding: "percent",
|
|
93
|
+
}),
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const path = pathToFunc("/accounting/{connection_id}/category")(pathParams);
|
|
97
|
+
|
|
98
|
+
const query = encodeFormQuery({
|
|
99
|
+
"fields": payload.fields,
|
|
100
|
+
"raw": payload.raw,
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
const headers = new Headers(compactMap({
|
|
104
|
+
"Content-Type": "application/json",
|
|
105
|
+
Accept: "application/json",
|
|
106
|
+
}));
|
|
107
|
+
|
|
108
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
109
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
110
|
+
|
|
111
|
+
const context = {
|
|
112
|
+
options: client._options,
|
|
113
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
114
|
+
operationID: "createAccountingCategory",
|
|
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: "POST",
|
|
129
|
+
baseURL: options?.serverURL,
|
|
130
|
+
path: path,
|
|
131
|
+
headers: headers,
|
|
132
|
+
query: query,
|
|
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
|
+
errorCodes: ["4XX", "5XX"],
|
|
145
|
+
retryConfig: context.retryConfig,
|
|
146
|
+
retryCodes: context.retryCodes,
|
|
147
|
+
});
|
|
148
|
+
if (!doResult.ok) {
|
|
149
|
+
return [doResult, { status: "request-error", request: req }];
|
|
150
|
+
}
|
|
151
|
+
const response = doResult.value;
|
|
152
|
+
|
|
153
|
+
const [result] = await M.match<
|
|
154
|
+
shared.AccountingCategory,
|
|
155
|
+
| UnifiedToError
|
|
156
|
+
| ResponseValidationError
|
|
157
|
+
| ConnectionError
|
|
158
|
+
| RequestAbortedError
|
|
159
|
+
| RequestTimeoutError
|
|
160
|
+
| InvalidRequestError
|
|
161
|
+
| UnexpectedClientError
|
|
162
|
+
| SDKValidationError
|
|
163
|
+
>(
|
|
164
|
+
M.json(200, shared.AccountingCategory$inboundSchema),
|
|
165
|
+
M.fail("4XX"),
|
|
166
|
+
M.fail("5XX"),
|
|
167
|
+
)(response, req);
|
|
168
|
+
if (!result.ok) {
|
|
169
|
+
return [result, { status: "complete", request: req, response }];
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
return [result, { status: "complete", request: req, response }];
|
|
173
|
+
}
|
|
@@ -0,0 +1,176 @@
|
|
|
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 { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js";
|
|
21
|
+
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
|
|
22
|
+
import { UnifiedToError } from "../sdk/models/errors/unifiedtoerror.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
|
+
* Retrieve a category
|
|
30
|
+
*/
|
|
31
|
+
export function accountingGetAccountingCategory(
|
|
32
|
+
client: UnifiedToCore,
|
|
33
|
+
request: operations.GetAccountingCategoryRequest,
|
|
34
|
+
options?: RequestOptions,
|
|
35
|
+
): APIPromise<
|
|
36
|
+
Result<
|
|
37
|
+
shared.AccountingCategory,
|
|
38
|
+
| UnifiedToError
|
|
39
|
+
| ResponseValidationError
|
|
40
|
+
| ConnectionError
|
|
41
|
+
| RequestAbortedError
|
|
42
|
+
| RequestTimeoutError
|
|
43
|
+
| InvalidRequestError
|
|
44
|
+
| UnexpectedClientError
|
|
45
|
+
| SDKValidationError
|
|
46
|
+
>
|
|
47
|
+
> {
|
|
48
|
+
return new APIPromise($do(
|
|
49
|
+
client,
|
|
50
|
+
request,
|
|
51
|
+
options,
|
|
52
|
+
));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async function $do(
|
|
56
|
+
client: UnifiedToCore,
|
|
57
|
+
request: operations.GetAccountingCategoryRequest,
|
|
58
|
+
options?: RequestOptions,
|
|
59
|
+
): Promise<
|
|
60
|
+
[
|
|
61
|
+
Result<
|
|
62
|
+
shared.AccountingCategory,
|
|
63
|
+
| UnifiedToError
|
|
64
|
+
| ResponseValidationError
|
|
65
|
+
| ConnectionError
|
|
66
|
+
| RequestAbortedError
|
|
67
|
+
| RequestTimeoutError
|
|
68
|
+
| InvalidRequestError
|
|
69
|
+
| UnexpectedClientError
|
|
70
|
+
| SDKValidationError
|
|
71
|
+
>,
|
|
72
|
+
APICall,
|
|
73
|
+
]
|
|
74
|
+
> {
|
|
75
|
+
const parsed = safeParse(
|
|
76
|
+
request,
|
|
77
|
+
(value) =>
|
|
78
|
+
operations.GetAccountingCategoryRequest$outboundSchema.parse(value),
|
|
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 pathParams = {
|
|
88
|
+
connection_id: encodeSimple("connection_id", payload.connection_id, {
|
|
89
|
+
explode: false,
|
|
90
|
+
charEncoding: "percent",
|
|
91
|
+
}),
|
|
92
|
+
id: encodeSimple("id", payload.id, {
|
|
93
|
+
explode: false,
|
|
94
|
+
charEncoding: "percent",
|
|
95
|
+
}),
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
const path = pathToFunc("/accounting/{connection_id}/category/{id}")(
|
|
99
|
+
pathParams,
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
const query = encodeFormQuery({
|
|
103
|
+
"fields": payload.fields,
|
|
104
|
+
"raw": payload.raw,
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
const headers = new Headers(compactMap({
|
|
108
|
+
Accept: "application/json",
|
|
109
|
+
}));
|
|
110
|
+
|
|
111
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
112
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
113
|
+
|
|
114
|
+
const context = {
|
|
115
|
+
options: client._options,
|
|
116
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
117
|
+
operationID: "getAccountingCategory",
|
|
118
|
+
oAuth2Scopes: [],
|
|
119
|
+
|
|
120
|
+
resolvedSecurity: requestSecurity,
|
|
121
|
+
|
|
122
|
+
securitySource: client._options.security,
|
|
123
|
+
retryConfig: options?.retries
|
|
124
|
+
|| client._options.retryConfig
|
|
125
|
+
|| { strategy: "none" },
|
|
126
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
const requestRes = client._createRequest(context, {
|
|
130
|
+
security: requestSecurity,
|
|
131
|
+
method: "GET",
|
|
132
|
+
baseURL: options?.serverURL,
|
|
133
|
+
path: path,
|
|
134
|
+
headers: headers,
|
|
135
|
+
query: query,
|
|
136
|
+
body: body,
|
|
137
|
+
userAgent: client._options.userAgent,
|
|
138
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
139
|
+
}, options);
|
|
140
|
+
if (!requestRes.ok) {
|
|
141
|
+
return [requestRes, { status: "invalid" }];
|
|
142
|
+
}
|
|
143
|
+
const req = requestRes.value;
|
|
144
|
+
|
|
145
|
+
const doResult = await client._do(req, {
|
|
146
|
+
context,
|
|
147
|
+
errorCodes: ["4XX", "5XX"],
|
|
148
|
+
retryConfig: context.retryConfig,
|
|
149
|
+
retryCodes: context.retryCodes,
|
|
150
|
+
});
|
|
151
|
+
if (!doResult.ok) {
|
|
152
|
+
return [doResult, { status: "request-error", request: req }];
|
|
153
|
+
}
|
|
154
|
+
const response = doResult.value;
|
|
155
|
+
|
|
156
|
+
const [result] = await M.match<
|
|
157
|
+
shared.AccountingCategory,
|
|
158
|
+
| UnifiedToError
|
|
159
|
+
| ResponseValidationError
|
|
160
|
+
| ConnectionError
|
|
161
|
+
| RequestAbortedError
|
|
162
|
+
| RequestTimeoutError
|
|
163
|
+
| InvalidRequestError
|
|
164
|
+
| UnexpectedClientError
|
|
165
|
+
| SDKValidationError
|
|
166
|
+
>(
|
|
167
|
+
M.json(200, shared.AccountingCategory$inboundSchema),
|
|
168
|
+
M.fail("4XX"),
|
|
169
|
+
M.fail("5XX"),
|
|
170
|
+
)(response, req);
|
|
171
|
+
if (!result.ok) {
|
|
172
|
+
return [result, { status: "complete", request: req, response }];
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return [result, { status: "complete", request: req, response }];
|
|
176
|
+
}
|
|
@@ -0,0 +1,178 @@
|
|
|
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 { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js";
|
|
22
|
+
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
|
|
23
|
+
import { UnifiedToError } from "../sdk/models/errors/unifiedtoerror.js";
|
|
24
|
+
import * as operations from "../sdk/models/operations/index.js";
|
|
25
|
+
import * as shared from "../sdk/models/shared/index.js";
|
|
26
|
+
import { APICall, APIPromise } from "../sdk/types/async.js";
|
|
27
|
+
import { Result } from "../sdk/types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* List all categories
|
|
31
|
+
*/
|
|
32
|
+
export function accountingListAccountingCategories(
|
|
33
|
+
client: UnifiedToCore,
|
|
34
|
+
request: operations.ListAccountingCategoriesRequest,
|
|
35
|
+
options?: RequestOptions,
|
|
36
|
+
): APIPromise<
|
|
37
|
+
Result<
|
|
38
|
+
Array<shared.AccountingCategory>,
|
|
39
|
+
| UnifiedToError
|
|
40
|
+
| ResponseValidationError
|
|
41
|
+
| ConnectionError
|
|
42
|
+
| RequestAbortedError
|
|
43
|
+
| RequestTimeoutError
|
|
44
|
+
| InvalidRequestError
|
|
45
|
+
| UnexpectedClientError
|
|
46
|
+
| SDKValidationError
|
|
47
|
+
>
|
|
48
|
+
> {
|
|
49
|
+
return new APIPromise($do(
|
|
50
|
+
client,
|
|
51
|
+
request,
|
|
52
|
+
options,
|
|
53
|
+
));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async function $do(
|
|
57
|
+
client: UnifiedToCore,
|
|
58
|
+
request: operations.ListAccountingCategoriesRequest,
|
|
59
|
+
options?: RequestOptions,
|
|
60
|
+
): Promise<
|
|
61
|
+
[
|
|
62
|
+
Result<
|
|
63
|
+
Array<shared.AccountingCategory>,
|
|
64
|
+
| UnifiedToError
|
|
65
|
+
| ResponseValidationError
|
|
66
|
+
| ConnectionError
|
|
67
|
+
| RequestAbortedError
|
|
68
|
+
| RequestTimeoutError
|
|
69
|
+
| InvalidRequestError
|
|
70
|
+
| UnexpectedClientError
|
|
71
|
+
| SDKValidationError
|
|
72
|
+
>,
|
|
73
|
+
APICall,
|
|
74
|
+
]
|
|
75
|
+
> {
|
|
76
|
+
const parsed = safeParse(
|
|
77
|
+
request,
|
|
78
|
+
(value) =>
|
|
79
|
+
operations.ListAccountingCategoriesRequest$outboundSchema.parse(value),
|
|
80
|
+
"Input validation failed",
|
|
81
|
+
);
|
|
82
|
+
if (!parsed.ok) {
|
|
83
|
+
return [parsed, { status: "invalid" }];
|
|
84
|
+
}
|
|
85
|
+
const payload = parsed.value;
|
|
86
|
+
const body = null;
|
|
87
|
+
|
|
88
|
+
const pathParams = {
|
|
89
|
+
connection_id: encodeSimple("connection_id", payload.connection_id, {
|
|
90
|
+
explode: false,
|
|
91
|
+
charEncoding: "percent",
|
|
92
|
+
}),
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const path = pathToFunc("/accounting/{connection_id}/category")(pathParams);
|
|
96
|
+
|
|
97
|
+
const query = encodeFormQuery({
|
|
98
|
+
"fields": payload.fields,
|
|
99
|
+
"limit": payload.limit,
|
|
100
|
+
"offset": payload.offset,
|
|
101
|
+
"order": payload.order,
|
|
102
|
+
"parent_id": payload.parent_id,
|
|
103
|
+
"query": payload.query,
|
|
104
|
+
"raw": payload.raw,
|
|
105
|
+
"sort": payload.sort,
|
|
106
|
+
"updated_gte": payload.updated_gte,
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
const headers = new Headers(compactMap({
|
|
110
|
+
Accept: "application/json",
|
|
111
|
+
}));
|
|
112
|
+
|
|
113
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
114
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
115
|
+
|
|
116
|
+
const context = {
|
|
117
|
+
options: client._options,
|
|
118
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
119
|
+
operationID: "listAccountingCategories",
|
|
120
|
+
oAuth2Scopes: [],
|
|
121
|
+
|
|
122
|
+
resolvedSecurity: requestSecurity,
|
|
123
|
+
|
|
124
|
+
securitySource: client._options.security,
|
|
125
|
+
retryConfig: options?.retries
|
|
126
|
+
|| client._options.retryConfig
|
|
127
|
+
|| { strategy: "none" },
|
|
128
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
const requestRes = client._createRequest(context, {
|
|
132
|
+
security: requestSecurity,
|
|
133
|
+
method: "GET",
|
|
134
|
+
baseURL: options?.serverURL,
|
|
135
|
+
path: path,
|
|
136
|
+
headers: headers,
|
|
137
|
+
query: query,
|
|
138
|
+
body: body,
|
|
139
|
+
userAgent: client._options.userAgent,
|
|
140
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
141
|
+
}, options);
|
|
142
|
+
if (!requestRes.ok) {
|
|
143
|
+
return [requestRes, { status: "invalid" }];
|
|
144
|
+
}
|
|
145
|
+
const req = requestRes.value;
|
|
146
|
+
|
|
147
|
+
const doResult = await client._do(req, {
|
|
148
|
+
context,
|
|
149
|
+
errorCodes: ["4XX", "5XX"],
|
|
150
|
+
retryConfig: context.retryConfig,
|
|
151
|
+
retryCodes: context.retryCodes,
|
|
152
|
+
});
|
|
153
|
+
if (!doResult.ok) {
|
|
154
|
+
return [doResult, { status: "request-error", request: req }];
|
|
155
|
+
}
|
|
156
|
+
const response = doResult.value;
|
|
157
|
+
|
|
158
|
+
const [result] = await M.match<
|
|
159
|
+
Array<shared.AccountingCategory>,
|
|
160
|
+
| UnifiedToError
|
|
161
|
+
| ResponseValidationError
|
|
162
|
+
| ConnectionError
|
|
163
|
+
| RequestAbortedError
|
|
164
|
+
| RequestTimeoutError
|
|
165
|
+
| InvalidRequestError
|
|
166
|
+
| UnexpectedClientError
|
|
167
|
+
| SDKValidationError
|
|
168
|
+
>(
|
|
169
|
+
M.json(200, z.array(shared.AccountingCategory$inboundSchema)),
|
|
170
|
+
M.fail("4XX"),
|
|
171
|
+
M.fail("5XX"),
|
|
172
|
+
)(response, req);
|
|
173
|
+
if (!result.ok) {
|
|
174
|
+
return [result, { status: "complete", request: req, response }];
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
return [result, { status: "complete", request: req, response }];
|
|
178
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { UnifiedToCore } from "../core.js";
|
|
6
|
+
import { encodeFormQuery, encodeJSON, 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 { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js";
|
|
21
|
+
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
|
|
22
|
+
import { UnifiedToError } from "../sdk/models/errors/unifiedtoerror.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
|
+
* Update a category
|
|
30
|
+
*/
|
|
31
|
+
export function accountingPatchAccountingCategory(
|
|
32
|
+
client: UnifiedToCore,
|
|
33
|
+
request: operations.PatchAccountingCategoryRequest,
|
|
34
|
+
options?: RequestOptions,
|
|
35
|
+
): APIPromise<
|
|
36
|
+
Result<
|
|
37
|
+
shared.AccountingCategory,
|
|
38
|
+
| UnifiedToError
|
|
39
|
+
| ResponseValidationError
|
|
40
|
+
| ConnectionError
|
|
41
|
+
| RequestAbortedError
|
|
42
|
+
| RequestTimeoutError
|
|
43
|
+
| InvalidRequestError
|
|
44
|
+
| UnexpectedClientError
|
|
45
|
+
| SDKValidationError
|
|
46
|
+
>
|
|
47
|
+
> {
|
|
48
|
+
return new APIPromise($do(
|
|
49
|
+
client,
|
|
50
|
+
request,
|
|
51
|
+
options,
|
|
52
|
+
));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async function $do(
|
|
56
|
+
client: UnifiedToCore,
|
|
57
|
+
request: operations.PatchAccountingCategoryRequest,
|
|
58
|
+
options?: RequestOptions,
|
|
59
|
+
): Promise<
|
|
60
|
+
[
|
|
61
|
+
Result<
|
|
62
|
+
shared.AccountingCategory,
|
|
63
|
+
| UnifiedToError
|
|
64
|
+
| ResponseValidationError
|
|
65
|
+
| ConnectionError
|
|
66
|
+
| RequestAbortedError
|
|
67
|
+
| RequestTimeoutError
|
|
68
|
+
| InvalidRequestError
|
|
69
|
+
| UnexpectedClientError
|
|
70
|
+
| SDKValidationError
|
|
71
|
+
>,
|
|
72
|
+
APICall,
|
|
73
|
+
]
|
|
74
|
+
> {
|
|
75
|
+
const parsed = safeParse(
|
|
76
|
+
request,
|
|
77
|
+
(value) =>
|
|
78
|
+
operations.PatchAccountingCategoryRequest$outboundSchema.parse(value),
|
|
79
|
+
"Input validation failed",
|
|
80
|
+
);
|
|
81
|
+
if (!parsed.ok) {
|
|
82
|
+
return [parsed, { status: "invalid" }];
|
|
83
|
+
}
|
|
84
|
+
const payload = parsed.value;
|
|
85
|
+
const body = encodeJSON("body", payload.AccountingCategory, {
|
|
86
|
+
explode: true,
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
const pathParams = {
|
|
90
|
+
connection_id: encodeSimple("connection_id", payload.connection_id, {
|
|
91
|
+
explode: false,
|
|
92
|
+
charEncoding: "percent",
|
|
93
|
+
}),
|
|
94
|
+
id: encodeSimple("id", payload.id, {
|
|
95
|
+
explode: false,
|
|
96
|
+
charEncoding: "percent",
|
|
97
|
+
}),
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const path = pathToFunc("/accounting/{connection_id}/category/{id}")(
|
|
101
|
+
pathParams,
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
const query = encodeFormQuery({
|
|
105
|
+
"fields": payload.fields,
|
|
106
|
+
"raw": payload.raw,
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
const headers = new Headers(compactMap({
|
|
110
|
+
"Content-Type": "application/json",
|
|
111
|
+
Accept: "application/json",
|
|
112
|
+
}));
|
|
113
|
+
|
|
114
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
115
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
116
|
+
|
|
117
|
+
const context = {
|
|
118
|
+
options: client._options,
|
|
119
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
120
|
+
operationID: "patchAccountingCategory",
|
|
121
|
+
oAuth2Scopes: [],
|
|
122
|
+
|
|
123
|
+
resolvedSecurity: requestSecurity,
|
|
124
|
+
|
|
125
|
+
securitySource: client._options.security,
|
|
126
|
+
retryConfig: options?.retries
|
|
127
|
+
|| client._options.retryConfig
|
|
128
|
+
|| { strategy: "none" },
|
|
129
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
const requestRes = client._createRequest(context, {
|
|
133
|
+
security: requestSecurity,
|
|
134
|
+
method: "PATCH",
|
|
135
|
+
baseURL: options?.serverURL,
|
|
136
|
+
path: path,
|
|
137
|
+
headers: headers,
|
|
138
|
+
query: query,
|
|
139
|
+
body: body,
|
|
140
|
+
userAgent: client._options.userAgent,
|
|
141
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
142
|
+
}, options);
|
|
143
|
+
if (!requestRes.ok) {
|
|
144
|
+
return [requestRes, { status: "invalid" }];
|
|
145
|
+
}
|
|
146
|
+
const req = requestRes.value;
|
|
147
|
+
|
|
148
|
+
const doResult = await client._do(req, {
|
|
149
|
+
context,
|
|
150
|
+
errorCodes: ["4XX", "5XX"],
|
|
151
|
+
retryConfig: context.retryConfig,
|
|
152
|
+
retryCodes: context.retryCodes,
|
|
153
|
+
});
|
|
154
|
+
if (!doResult.ok) {
|
|
155
|
+
return [doResult, { status: "request-error", request: req }];
|
|
156
|
+
}
|
|
157
|
+
const response = doResult.value;
|
|
158
|
+
|
|
159
|
+
const [result] = await M.match<
|
|
160
|
+
shared.AccountingCategory,
|
|
161
|
+
| UnifiedToError
|
|
162
|
+
| ResponseValidationError
|
|
163
|
+
| ConnectionError
|
|
164
|
+
| RequestAbortedError
|
|
165
|
+
| RequestTimeoutError
|
|
166
|
+
| InvalidRequestError
|
|
167
|
+
| UnexpectedClientError
|
|
168
|
+
| SDKValidationError
|
|
169
|
+
>(
|
|
170
|
+
M.json(200, shared.AccountingCategory$inboundSchema),
|
|
171
|
+
M.fail("4XX"),
|
|
172
|
+
M.fail("5XX"),
|
|
173
|
+
)(response, req);
|
|
174
|
+
if (!result.ok) {
|
|
175
|
+
return [result, { status: "complete", request: req, response }];
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
return [result, { status: "complete", request: req, response }];
|
|
179
|
+
}
|