@unified-api/typescript-sdk 2.75.3 → 2.76.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.
Files changed (118) hide show
  1. package/README.md +12 -0
  2. package/docs/sdks/accounting/README.md +482 -0
  3. package/docs/sdks/expense/README.md +489 -0
  4. package/examples/package-lock.json +1 -1
  5. package/funcs/accountingCreateAccountingExpense.d.ts +15 -0
  6. package/funcs/accountingCreateAccountingExpense.d.ts.map +1 -0
  7. package/funcs/accountingCreateAccountingExpense.js +122 -0
  8. package/funcs/accountingCreateAccountingExpense.js.map +1 -0
  9. package/funcs/accountingGetAccountingExpense.d.ts +15 -0
  10. package/funcs/accountingGetAccountingExpense.d.ts.map +1 -0
  11. package/funcs/accountingGetAccountingExpense.js +125 -0
  12. package/funcs/accountingGetAccountingExpense.js.map +1 -0
  13. package/funcs/accountingListAccountingExpenses.d.ts +15 -0
  14. package/funcs/accountingListAccountingExpenses.d.ts.map +1 -0
  15. package/funcs/accountingListAccountingExpenses.js +129 -0
  16. package/funcs/accountingListAccountingExpenses.js.map +1 -0
  17. package/funcs/accountingPatchAccountingExpense.d.ts +15 -0
  18. package/funcs/accountingPatchAccountingExpense.d.ts.map +1 -0
  19. package/funcs/accountingPatchAccountingExpense.js +126 -0
  20. package/funcs/accountingPatchAccountingExpense.js.map +1 -0
  21. package/funcs/accountingRemoveAccountingExpense.d.ts +14 -0
  22. package/funcs/accountingRemoveAccountingExpense.d.ts.map +1 -0
  23. package/funcs/accountingRemoveAccountingExpense.js +122 -0
  24. package/funcs/accountingRemoveAccountingExpense.js.map +1 -0
  25. package/funcs/accountingUpdateAccountingExpense.d.ts +15 -0
  26. package/funcs/accountingUpdateAccountingExpense.d.ts.map +1 -0
  27. package/funcs/accountingUpdateAccountingExpense.js +126 -0
  28. package/funcs/accountingUpdateAccountingExpense.js.map +1 -0
  29. package/funcs/messagingListMessagingMessages.js +1 -0
  30. package/funcs/messagingListMessagingMessages.js.map +1 -1
  31. package/jsr.json +1 -1
  32. package/lib/config.d.ts +3 -3
  33. package/lib/config.js +3 -3
  34. package/lib/config.js.map +1 -1
  35. package/package.json +1 -1
  36. package/sdk/accounting.d.ts +24 -0
  37. package/sdk/accounting.d.ts.map +1 -1
  38. package/sdk/accounting.js +42 -0
  39. package/sdk/accounting.js.map +1 -1
  40. package/sdk/expense.d.ts +30 -0
  41. package/sdk/expense.d.ts.map +1 -0
  42. package/sdk/expense.js +54 -0
  43. package/sdk/expense.js.map +1 -0
  44. package/sdk/models/operations/createaccountingexpense.d.ts +45 -0
  45. package/sdk/models/operations/createaccountingexpense.d.ts.map +1 -0
  46. package/sdk/models/operations/createaccountingexpense.js +87 -0
  47. package/sdk/models/operations/createaccountingexpense.js.map +1 -0
  48. package/sdk/models/operations/getaccountingexpense.d.ts +47 -0
  49. package/sdk/models/operations/getaccountingexpense.d.ts.map +1 -0
  50. package/sdk/models/operations/getaccountingexpense.js +84 -0
  51. package/sdk/models/operations/getaccountingexpense.js.map +1 -0
  52. package/sdk/models/operations/index.d.ts +6 -0
  53. package/sdk/models/operations/index.d.ts.map +1 -1
  54. package/sdk/models/operations/index.js +6 -0
  55. package/sdk/models/operations/index.js.map +1 -1
  56. package/sdk/models/operations/listaccountingexpenses.d.ts +65 -0
  57. package/sdk/models/operations/listaccountingexpenses.d.ts.map +1 -0
  58. package/sdk/models/operations/listaccountingexpenses.js +100 -0
  59. package/sdk/models/operations/listaccountingexpenses.js.map +1 -0
  60. package/sdk/models/operations/listmessagingmessages.d.ts +5 -0
  61. package/sdk/models/operations/listmessagingmessages.d.ts.map +1 -1
  62. package/sdk/models/operations/listmessagingmessages.js +4 -0
  63. package/sdk/models/operations/listmessagingmessages.js.map +1 -1
  64. package/sdk/models/operations/patchaccountingexpense.d.ts +50 -0
  65. package/sdk/models/operations/patchaccountingexpense.d.ts.map +1 -0
  66. package/sdk/models/operations/patchaccountingexpense.js +89 -0
  67. package/sdk/models/operations/patchaccountingexpense.js.map +1 -0
  68. package/sdk/models/operations/removeaccountingexpense.d.ts +66 -0
  69. package/sdk/models/operations/removeaccountingexpense.d.ts.map +1 -0
  70. package/sdk/models/operations/removeaccountingexpense.js +115 -0
  71. package/sdk/models/operations/removeaccountingexpense.js.map +1 -0
  72. package/sdk/models/operations/updateaccountingexpense.d.ts +50 -0
  73. package/sdk/models/operations/updateaccountingexpense.d.ts.map +1 -0
  74. package/sdk/models/operations/updateaccountingexpense.js +89 -0
  75. package/sdk/models/operations/updateaccountingexpense.js.map +1 -0
  76. package/sdk/models/shared/accountingexpense.d.ts +60 -0
  77. package/sdk/models/shared/accountingexpense.d.ts.map +1 -0
  78. package/sdk/models/shared/accountingexpense.js +124 -0
  79. package/sdk/models/shared/accountingexpense.js.map +1 -0
  80. package/sdk/models/shared/index.d.ts +1 -0
  81. package/sdk/models/shared/index.d.ts.map +1 -1
  82. package/sdk/models/shared/index.js +1 -0
  83. package/sdk/models/shared/index.js.map +1 -1
  84. package/sdk/models/shared/propertyconnectionpermissions.d.ts +2 -0
  85. package/sdk/models/shared/propertyconnectionpermissions.d.ts.map +1 -1
  86. package/sdk/models/shared/propertyconnectionpermissions.js +2 -0
  87. package/sdk/models/shared/propertyconnectionpermissions.js.map +1 -1
  88. package/sdk/models/shared/webhook.d.ts +1 -0
  89. package/sdk/models/shared/webhook.d.ts.map +1 -1
  90. package/sdk/models/shared/webhook.js +1 -0
  91. package/sdk/models/shared/webhook.js.map +1 -1
  92. package/sdk/sdk.d.ts +3 -0
  93. package/sdk/sdk.d.ts.map +1 -1
  94. package/sdk/sdk.js +4 -0
  95. package/sdk/sdk.js.map +1 -1
  96. package/src/funcs/accountingCreateAccountingExpense.ts +171 -0
  97. package/src/funcs/accountingGetAccountingExpense.ts +176 -0
  98. package/src/funcs/accountingListAccountingExpenses.ts +178 -0
  99. package/src/funcs/accountingPatchAccountingExpense.ts +177 -0
  100. package/src/funcs/accountingRemoveAccountingExpense.ts +181 -0
  101. package/src/funcs/accountingUpdateAccountingExpense.ts +177 -0
  102. package/src/funcs/messagingListMessagingMessages.ts +1 -0
  103. package/src/lib/config.ts +3 -3
  104. package/src/sdk/accounting.ts +90 -0
  105. package/src/sdk/expense.ts +100 -0
  106. package/src/sdk/models/operations/createaccountingexpense.ts +101 -0
  107. package/src/sdk/models/operations/getaccountingexpense.ts +101 -0
  108. package/src/sdk/models/operations/index.ts +6 -0
  109. package/src/sdk/models/operations/listaccountingexpenses.ts +135 -0
  110. package/src/sdk/models/operations/listmessagingmessages.ts +9 -0
  111. package/src/sdk/models/operations/patchaccountingexpense.ts +108 -0
  112. package/src/sdk/models/operations/removeaccountingexpense.ts +155 -0
  113. package/src/sdk/models/operations/updateaccountingexpense.ts +108 -0
  114. package/src/sdk/models/shared/accountingexpense.ts +154 -0
  115. package/src/sdk/models/shared/index.ts +1 -0
  116. package/src/sdk/models/shared/propertyconnectionpermissions.ts +2 -0
  117. package/src/sdk/models/shared/webhook.ts +1 -0
  118. package/src/sdk/sdk.ts +6 -0
@@ -0,0 +1,177 @@
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 an expense
30
+ */
31
+ export function accountingPatchAccountingExpense(
32
+ client: UnifiedToCore,
33
+ request: operations.PatchAccountingExpenseRequest,
34
+ options?: RequestOptions,
35
+ ): APIPromise<
36
+ Result<
37
+ shared.AccountingExpense,
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.PatchAccountingExpenseRequest,
58
+ options?: RequestOptions,
59
+ ): Promise<
60
+ [
61
+ Result<
62
+ shared.AccountingExpense,
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.PatchAccountingExpenseRequest$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.AccountingExpense, { explode: true });
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}/expense/{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
+ "Content-Type": "application/json",
109
+ Accept: "application/json",
110
+ }));
111
+
112
+ const securityInput = await extractSecurity(client._options.security);
113
+ const requestSecurity = resolveGlobalSecurity(securityInput);
114
+
115
+ const context = {
116
+ options: client._options,
117
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
118
+ operationID: "patchAccountingExpense",
119
+ oAuth2Scopes: null,
120
+
121
+ resolvedSecurity: requestSecurity,
122
+
123
+ securitySource: client._options.security,
124
+ retryConfig: options?.retries
125
+ || client._options.retryConfig
126
+ || { strategy: "none" },
127
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
128
+ };
129
+
130
+ const requestRes = client._createRequest(context, {
131
+ security: requestSecurity,
132
+ method: "PATCH",
133
+ baseURL: options?.serverURL,
134
+ path: path,
135
+ headers: headers,
136
+ query: query,
137
+ body: body,
138
+ userAgent: client._options.userAgent,
139
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
140
+ }, options);
141
+ if (!requestRes.ok) {
142
+ return [requestRes, { status: "invalid" }];
143
+ }
144
+ const req = requestRes.value;
145
+
146
+ const doResult = await client._do(req, {
147
+ context,
148
+ errorCodes: ["4XX", "5XX"],
149
+ retryConfig: context.retryConfig,
150
+ retryCodes: context.retryCodes,
151
+ });
152
+ if (!doResult.ok) {
153
+ return [doResult, { status: "request-error", request: req }];
154
+ }
155
+ const response = doResult.value;
156
+
157
+ const [result] = await M.match<
158
+ shared.AccountingExpense,
159
+ | UnifiedToError
160
+ | ResponseValidationError
161
+ | ConnectionError
162
+ | RequestAbortedError
163
+ | RequestTimeoutError
164
+ | InvalidRequestError
165
+ | UnexpectedClientError
166
+ | SDKValidationError
167
+ >(
168
+ M.json(200, shared.AccountingExpense$inboundSchema),
169
+ M.fail("4XX"),
170
+ M.fail("5XX"),
171
+ )(response, req);
172
+ if (!result.ok) {
173
+ return [result, { status: "complete", request: req, response }];
174
+ }
175
+
176
+ return [result, { status: "complete", request: req, response }];
177
+ }
@@ -0,0 +1,181 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { UnifiedToCore } from "../core.js";
6
+ import { 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 { APICall, APIPromise } from "../sdk/types/async.js";
25
+ import { Result } from "../sdk/types/fp.js";
26
+
27
+ /**
28
+ * Remove an expense
29
+ */
30
+ export function accountingRemoveAccountingExpense(
31
+ client: UnifiedToCore,
32
+ request: operations.RemoveAccountingExpenseRequest,
33
+ options?: RequestOptions,
34
+ ): APIPromise<
35
+ Result<
36
+ operations.RemoveAccountingExpenseResponse | undefined,
37
+ | UnifiedToError
38
+ | ResponseValidationError
39
+ | ConnectionError
40
+ | RequestAbortedError
41
+ | RequestTimeoutError
42
+ | InvalidRequestError
43
+ | UnexpectedClientError
44
+ | SDKValidationError
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.RemoveAccountingExpenseRequest,
57
+ options?: RequestOptions,
58
+ ): Promise<
59
+ [
60
+ Result<
61
+ operations.RemoveAccountingExpenseResponse | undefined,
62
+ | UnifiedToError
63
+ | ResponseValidationError
64
+ | ConnectionError
65
+ | RequestAbortedError
66
+ | RequestTimeoutError
67
+ | InvalidRequestError
68
+ | UnexpectedClientError
69
+ | SDKValidationError
70
+ >,
71
+ APICall,
72
+ ]
73
+ > {
74
+ const parsed = safeParse(
75
+ request,
76
+ (value) =>
77
+ operations.RemoveAccountingExpenseRequest$outboundSchema.parse(value),
78
+ "Input validation failed",
79
+ );
80
+ if (!parsed.ok) {
81
+ return [parsed, { status: "invalid" }];
82
+ }
83
+ const payload = parsed.value;
84
+ const body = null;
85
+
86
+ const pathParams = {
87
+ connection_id: encodeSimple("connection_id", payload.connection_id, {
88
+ explode: false,
89
+ charEncoding: "percent",
90
+ }),
91
+ id: encodeSimple("id", payload.id, {
92
+ explode: false,
93
+ charEncoding: "percent",
94
+ }),
95
+ };
96
+
97
+ const path = pathToFunc("/accounting/{connection_id}/expense/{id}")(
98
+ pathParams,
99
+ );
100
+
101
+ const headers = new Headers(compactMap({
102
+ Accept: "*/*",
103
+ }));
104
+
105
+ const securityInput = await extractSecurity(client._options.security);
106
+ const requestSecurity = resolveGlobalSecurity(securityInput);
107
+
108
+ const context = {
109
+ options: client._options,
110
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
111
+ operationID: "removeAccountingExpense",
112
+ oAuth2Scopes: null,
113
+
114
+ resolvedSecurity: requestSecurity,
115
+
116
+ securitySource: client._options.security,
117
+ retryConfig: options?.retries
118
+ || client._options.retryConfig
119
+ || { strategy: "none" },
120
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
121
+ };
122
+
123
+ const requestRes = client._createRequest(context, {
124
+ security: requestSecurity,
125
+ method: "DELETE",
126
+ baseURL: options?.serverURL,
127
+ path: path,
128
+ headers: headers,
129
+ body: body,
130
+ userAgent: client._options.userAgent,
131
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
132
+ }, options);
133
+ if (!requestRes.ok) {
134
+ return [requestRes, { status: "invalid" }];
135
+ }
136
+ const req = requestRes.value;
137
+
138
+ const doResult = await client._do(req, {
139
+ context,
140
+ errorCodes: ["4XX", "5XX"],
141
+ retryConfig: context.retryConfig,
142
+ retryCodes: context.retryCodes,
143
+ });
144
+ if (!doResult.ok) {
145
+ return [doResult, { status: "request-error", request: req }];
146
+ }
147
+ const response = doResult.value;
148
+
149
+ const responseFields = {
150
+ HttpMeta: { Response: response, Request: req },
151
+ };
152
+
153
+ const [result] = await M.match<
154
+ operations.RemoveAccountingExpenseResponse | undefined,
155
+ | UnifiedToError
156
+ | ResponseValidationError
157
+ | ConnectionError
158
+ | RequestAbortedError
159
+ | RequestTimeoutError
160
+ | InvalidRequestError
161
+ | UnexpectedClientError
162
+ | SDKValidationError
163
+ >(
164
+ M.nil(
165
+ 200,
166
+ operations.RemoveAccountingExpenseResponse$inboundSchema.optional(),
167
+ ),
168
+ M.fail("4XX"),
169
+ M.fail("5XX"),
170
+ M.nil(
171
+ "default",
172
+ operations.RemoveAccountingExpenseResponse$inboundSchema.optional(),
173
+ { hdrs: true },
174
+ ),
175
+ )(response, req, { extraFields: responseFields });
176
+ if (!result.ok) {
177
+ return [result, { status: "complete", request: req, response }];
178
+ }
179
+
180
+ return [result, { status: "complete", request: req, response }];
181
+ }
@@ -0,0 +1,177 @@
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 an expense
30
+ */
31
+ export function accountingUpdateAccountingExpense(
32
+ client: UnifiedToCore,
33
+ request: operations.UpdateAccountingExpenseRequest,
34
+ options?: RequestOptions,
35
+ ): APIPromise<
36
+ Result<
37
+ shared.AccountingExpense,
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.UpdateAccountingExpenseRequest,
58
+ options?: RequestOptions,
59
+ ): Promise<
60
+ [
61
+ Result<
62
+ shared.AccountingExpense,
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.UpdateAccountingExpenseRequest$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.AccountingExpense, { explode: true });
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}/expense/{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
+ "Content-Type": "application/json",
109
+ Accept: "application/json",
110
+ }));
111
+
112
+ const securityInput = await extractSecurity(client._options.security);
113
+ const requestSecurity = resolveGlobalSecurity(securityInput);
114
+
115
+ const context = {
116
+ options: client._options,
117
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
118
+ operationID: "updateAccountingExpense",
119
+ oAuth2Scopes: null,
120
+
121
+ resolvedSecurity: requestSecurity,
122
+
123
+ securitySource: client._options.security,
124
+ retryConfig: options?.retries
125
+ || client._options.retryConfig
126
+ || { strategy: "none" },
127
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
128
+ };
129
+
130
+ const requestRes = client._createRequest(context, {
131
+ security: requestSecurity,
132
+ method: "PUT",
133
+ baseURL: options?.serverURL,
134
+ path: path,
135
+ headers: headers,
136
+ query: query,
137
+ body: body,
138
+ userAgent: client._options.userAgent,
139
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
140
+ }, options);
141
+ if (!requestRes.ok) {
142
+ return [requestRes, { status: "invalid" }];
143
+ }
144
+ const req = requestRes.value;
145
+
146
+ const doResult = await client._do(req, {
147
+ context,
148
+ errorCodes: ["4XX", "5XX"],
149
+ retryConfig: context.retryConfig,
150
+ retryCodes: context.retryCodes,
151
+ });
152
+ if (!doResult.ok) {
153
+ return [doResult, { status: "request-error", request: req }];
154
+ }
155
+ const response = doResult.value;
156
+
157
+ const [result] = await M.match<
158
+ shared.AccountingExpense,
159
+ | UnifiedToError
160
+ | ResponseValidationError
161
+ | ConnectionError
162
+ | RequestAbortedError
163
+ | RequestTimeoutError
164
+ | InvalidRequestError
165
+ | UnexpectedClientError
166
+ | SDKValidationError
167
+ >(
168
+ M.json(200, shared.AccountingExpense$inboundSchema),
169
+ M.fail("4XX"),
170
+ M.fail("5XX"),
171
+ )(response, req);
172
+ if (!result.ok) {
173
+ return [result, { status: "complete", request: req, response }];
174
+ }
175
+
176
+ return [result, { status: "complete", request: req, response }];
177
+ }
@@ -108,6 +108,7 @@ async function $do(
108
108
  "sort": payload.sort,
109
109
  "start_gte": payload.start_gte,
110
110
  "updated_gte": payload.updated_gte,
111
+ "user_id": payload.user_id,
111
112
  });
112
113
 
113
114
  const headers = new Headers(compactMap({
package/src/lib/config.ts CHANGED
@@ -73,8 +73,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
73
73
  export const SDK_METADATA = {
74
74
  language: "typescript",
75
75
  openapiDocVersion: "1.0",
76
- sdkVersion: "2.75.3",
77
- genVersion: "2.723.11",
76
+ sdkVersion: "2.76.0",
77
+ genVersion: "2.727.4",
78
78
  userAgent:
79
- "speakeasy-sdk/typescript 2.75.3 2.723.11 1.0 @unified-api/typescript-sdk",
79
+ "speakeasy-sdk/typescript 2.76.0 2.727.4 1.0 @unified-api/typescript-sdk",
80
80
  } as const;