@orq-ai/node 3.11.1 → 3.11.3
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/bin/mcp-server.js +103 -103
- package/bin/mcp-server.js.map +26 -26
- package/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.js +1 -1
- package/models/operations/createcontact.js +2 -2
- package/models/operations/createdataset.js +2 -2
- package/models/operations/createdatasetitem.js +2 -2
- package/models/operations/createdatasource.js +2 -2
- package/models/operations/createeval.js +16 -16
- package/models/operations/fileget.js +2 -2
- package/models/operations/filelist.js +2 -2
- package/models/operations/fileupload.js +2 -2
- package/models/operations/getevals.js +28 -28
- package/models/operations/listcontacts.js +2 -2
- package/models/operations/listdatasetdatapoints.js +2 -2
- package/models/operations/listdatasets.js +2 -2
- package/models/operations/listdatasources.js +2 -2
- package/models/operations/retrievecontact.js +2 -2
- package/models/operations/retrievedatapoint.js +2 -2
- package/models/operations/retrievedataset.js +2 -2
- package/models/operations/retrievedatasource.js +2 -2
- package/models/operations/updatecontact.js +2 -2
- package/models/operations/updatedatapoint.js +2 -2
- package/models/operations/updatedataset.js +2 -2
- package/models/operations/updatedatasource.js +2 -2
- package/models/operations/updateeval.js +16 -16
- package/package.json +1 -1
- package/packages/orq-rc/README.md +99 -86
- package/packages/orq-rc/docs/sdks/budgets/README.md +401 -0
- package/packages/orq-rc/examples/package-lock.json +1 -1
- package/packages/orq-rc/jsr.json +1 -1
- package/packages/orq-rc/package-lock.json +2 -2
- package/packages/orq-rc/package.json +1 -1
- package/packages/orq-rc/src/funcs/budgetsCreate.ts +160 -0
- package/packages/orq-rc/src/funcs/budgetsDelete.ts +167 -0
- package/packages/orq-rc/src/funcs/budgetsGet.ts +166 -0
- package/packages/orq-rc/src/funcs/budgetsList.ts +170 -0
- package/packages/orq-rc/src/funcs/budgetsUpdate.ts +167 -0
- package/packages/orq-rc/src/lib/config.ts +3 -3
- package/packages/orq-rc/src/mcp-server/mcp-server.ts +1 -1
- package/packages/orq-rc/src/mcp-server/server.ts +11 -1
- package/packages/orq-rc/src/mcp-server/tools/budgetsCreate.ts +37 -0
- package/packages/orq-rc/src/mcp-server/tools/budgetsDelete.ts +35 -0
- package/packages/orq-rc/src/mcp-server/tools/budgetsGet.ts +37 -0
- package/packages/orq-rc/src/mcp-server/tools/budgetsList.ts +37 -0
- package/packages/orq-rc/src/mcp-server/tools/budgetsUpdate.ts +37 -0
- package/packages/orq-rc/src/models/operations/createbudget.ts +534 -0
- package/packages/orq-rc/src/models/operations/createcontact.ts +2 -2
- package/packages/orq-rc/src/models/operations/createdataset.ts +2 -2
- package/packages/orq-rc/src/models/operations/createdatasetitem.ts +2 -2
- package/packages/orq-rc/src/models/operations/createdatasource.ts +2 -2
- package/packages/orq-rc/src/models/operations/createeval.ts +16 -16
- package/packages/orq-rc/src/models/operations/deletebudget.ts +66 -0
- package/packages/orq-rc/src/models/operations/fileget.ts +2 -2
- package/packages/orq-rc/src/models/operations/filelist.ts +2 -2
- package/packages/orq-rc/src/models/operations/fileupload.ts +2 -2
- package/packages/orq-rc/src/models/operations/getbudget.ts +437 -0
- package/packages/orq-rc/src/models/operations/getevals.ts +28 -28
- package/packages/orq-rc/src/models/operations/index.ts +5 -0
- package/packages/orq-rc/src/models/operations/listbudgets.ts +617 -0
- package/packages/orq-rc/src/models/operations/listcontacts.ts +2 -2
- package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +2 -2
- package/packages/orq-rc/src/models/operations/listdatasets.ts +2 -2
- package/packages/orq-rc/src/models/operations/listdatasources.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrievecontact.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrievedataset.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrievedatasource.ts +2 -2
- package/packages/orq-rc/src/models/operations/updatebudget.ts +628 -0
- package/packages/orq-rc/src/models/operations/updatecontact.ts +2 -2
- package/packages/orq-rc/src/models/operations/updatedatapoint.ts +2 -2
- package/packages/orq-rc/src/models/operations/updatedataset.ts +2 -2
- package/packages/orq-rc/src/models/operations/updatedatasource.ts +2 -2
- package/packages/orq-rc/src/models/operations/updateeval.ts +16 -16
- package/packages/orq-rc/src/sdk/budgets.ts +99 -0
- package/packages/orq-rc/src/sdk/sdk.ts +6 -0
- package/src/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/models/operations/createcontact.ts +2 -2
- package/src/models/operations/createdataset.ts +2 -2
- package/src/models/operations/createdatasetitem.ts +2 -2
- package/src/models/operations/createdatasource.ts +2 -2
- package/src/models/operations/createeval.ts +16 -16
- package/src/models/operations/fileget.ts +2 -2
- package/src/models/operations/filelist.ts +2 -2
- package/src/models/operations/fileupload.ts +2 -2
- package/src/models/operations/getevals.ts +28 -28
- package/src/models/operations/listcontacts.ts +2 -2
- package/src/models/operations/listdatasetdatapoints.ts +2 -2
- package/src/models/operations/listdatasets.ts +2 -2
- package/src/models/operations/listdatasources.ts +2 -2
- package/src/models/operations/retrievecontact.ts +2 -2
- package/src/models/operations/retrievedatapoint.ts +2 -2
- package/src/models/operations/retrievedataset.ts +2 -2
- package/src/models/operations/retrievedatasource.ts +2 -2
- package/src/models/operations/updatecontact.ts +2 -2
- package/src/models/operations/updatedatapoint.ts +2 -2
- package/src/models/operations/updatedataset.ts +2 -2
- package/src/models/operations/updatedatasource.ts +2 -2
- package/src/models/operations/updateeval.ts +16 -16
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
# Budgets
|
|
2
|
+
(*budgets*)
|
|
3
|
+
|
|
4
|
+
## Overview
|
|
5
|
+
|
|
6
|
+
### Available Operations
|
|
7
|
+
|
|
8
|
+
* [list](#list) - List contact budget configurations
|
|
9
|
+
* [create](#create) - Create contact budget configuration
|
|
10
|
+
* [get](#get) - Get contact budget configuration
|
|
11
|
+
* [update](#update) - Update contact budget configuration
|
|
12
|
+
* [delete](#delete) - Delete contact budget configuration
|
|
13
|
+
|
|
14
|
+
## list
|
|
15
|
+
|
|
16
|
+
Retrieves a paginated list of budget configurations in your workspace. Use pagination parameters to navigate through large budget lists efficiently.
|
|
17
|
+
|
|
18
|
+
### Example Usage
|
|
19
|
+
|
|
20
|
+
<!-- UsageSnippet language="typescript" operationID="ListBudgets" method="get" path="/v2/budgets" -->
|
|
21
|
+
```typescript
|
|
22
|
+
import { Orq } from "@orq-ai/node";
|
|
23
|
+
|
|
24
|
+
const orq = new Orq({
|
|
25
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
async function run() {
|
|
29
|
+
const result = await orq.budgets.list({
|
|
30
|
+
type: "contact",
|
|
31
|
+
entityId: "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
|
|
32
|
+
isActive: true,
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
console.log(result);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
run();
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Standalone function
|
|
42
|
+
|
|
43
|
+
The standalone function version of this method:
|
|
44
|
+
|
|
45
|
+
```typescript
|
|
46
|
+
import { OrqCore } from "@orq-ai/node/core.js";
|
|
47
|
+
import { budgetsList } from "@orq-ai/node/funcs/budgetsList.js";
|
|
48
|
+
|
|
49
|
+
// Use `OrqCore` for best tree-shaking performance.
|
|
50
|
+
// You can create one instance of it to use across an application.
|
|
51
|
+
const orq = new OrqCore({
|
|
52
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
async function run() {
|
|
56
|
+
const res = await budgetsList(orq, {
|
|
57
|
+
type: "contact",
|
|
58
|
+
entityId: "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
|
|
59
|
+
isActive: true,
|
|
60
|
+
});
|
|
61
|
+
if (res.ok) {
|
|
62
|
+
const { value: result } = res;
|
|
63
|
+
console.log(result);
|
|
64
|
+
} else {
|
|
65
|
+
console.log("budgetsList failed:", res.error);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
run();
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Parameters
|
|
73
|
+
|
|
74
|
+
| Parameter | Type | Required | Description |
|
|
75
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
76
|
+
| `request` | [operations.ListBudgetsRequest](../../models/operations/listbudgetsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
77
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
78
|
+
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
79
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
80
|
+
|
|
81
|
+
### Response
|
|
82
|
+
|
|
83
|
+
**Promise\<[operations.ListBudgetsResponseBody](../../models/operations/listbudgetsresponsebody.md)\>**
|
|
84
|
+
|
|
85
|
+
### Errors
|
|
86
|
+
|
|
87
|
+
| Error Type | Status Code | Content Type |
|
|
88
|
+
| --------------- | --------------- | --------------- |
|
|
89
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
90
|
+
|
|
91
|
+
## create
|
|
92
|
+
|
|
93
|
+
Create a new budget configuration for a contact. API Key and Workspace budget creation will be available in future releases.
|
|
94
|
+
|
|
95
|
+
### Example Usage
|
|
96
|
+
|
|
97
|
+
<!-- UsageSnippet language="typescript" operationID="CreateBudget" method="post" path="/v2/budgets" -->
|
|
98
|
+
```typescript
|
|
99
|
+
import { Orq } from "@orq-ai/node";
|
|
100
|
+
|
|
101
|
+
const orq = new Orq({
|
|
102
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
async function run() {
|
|
106
|
+
const result = await orq.budgets.create({
|
|
107
|
+
type: "contact",
|
|
108
|
+
entityId: "user_123",
|
|
109
|
+
period: "monthly",
|
|
110
|
+
amount: 250,
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
console.log(result);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
run();
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Standalone function
|
|
120
|
+
|
|
121
|
+
The standalone function version of this method:
|
|
122
|
+
|
|
123
|
+
```typescript
|
|
124
|
+
import { OrqCore } from "@orq-ai/node/core.js";
|
|
125
|
+
import { budgetsCreate } from "@orq-ai/node/funcs/budgetsCreate.js";
|
|
126
|
+
|
|
127
|
+
// Use `OrqCore` for best tree-shaking performance.
|
|
128
|
+
// You can create one instance of it to use across an application.
|
|
129
|
+
const orq = new OrqCore({
|
|
130
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
async function run() {
|
|
134
|
+
const res = await budgetsCreate(orq, {
|
|
135
|
+
type: "contact",
|
|
136
|
+
entityId: "user_123",
|
|
137
|
+
period: "monthly",
|
|
138
|
+
amount: 250,
|
|
139
|
+
});
|
|
140
|
+
if (res.ok) {
|
|
141
|
+
const { value: result } = res;
|
|
142
|
+
console.log(result);
|
|
143
|
+
} else {
|
|
144
|
+
console.log("budgetsCreate failed:", res.error);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
run();
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Parameters
|
|
152
|
+
|
|
153
|
+
| Parameter | Type | Required | Description |
|
|
154
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
155
|
+
| `request` | [operations.CreateBudgetRequestBody](../../models/operations/createbudgetrequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
156
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
157
|
+
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
158
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
159
|
+
|
|
160
|
+
### Response
|
|
161
|
+
|
|
162
|
+
**Promise\<[operations.CreateBudgetResponseBody](../../models/operations/createbudgetresponsebody.md)\>**
|
|
163
|
+
|
|
164
|
+
### Errors
|
|
165
|
+
|
|
166
|
+
| Error Type | Status Code | Content Type |
|
|
167
|
+
| --------------- | --------------- | --------------- |
|
|
168
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
169
|
+
|
|
170
|
+
## get
|
|
171
|
+
|
|
172
|
+
Get contact budget configuration by ID
|
|
173
|
+
|
|
174
|
+
### Example Usage
|
|
175
|
+
|
|
176
|
+
<!-- UsageSnippet language="typescript" operationID="GetBudget" method="get" path="/v2/budgets/{id}" -->
|
|
177
|
+
```typescript
|
|
178
|
+
import { Orq } from "@orq-ai/node";
|
|
179
|
+
|
|
180
|
+
const orq = new Orq({
|
|
181
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
async function run() {
|
|
185
|
+
const result = await orq.budgets.get({
|
|
186
|
+
id: "01K1J1AX8PGR63QRP7423NY008",
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
console.log(result);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
run();
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### Standalone function
|
|
196
|
+
|
|
197
|
+
The standalone function version of this method:
|
|
198
|
+
|
|
199
|
+
```typescript
|
|
200
|
+
import { OrqCore } from "@orq-ai/node/core.js";
|
|
201
|
+
import { budgetsGet } from "@orq-ai/node/funcs/budgetsGet.js";
|
|
202
|
+
|
|
203
|
+
// Use `OrqCore` for best tree-shaking performance.
|
|
204
|
+
// You can create one instance of it to use across an application.
|
|
205
|
+
const orq = new OrqCore({
|
|
206
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
async function run() {
|
|
210
|
+
const res = await budgetsGet(orq, {
|
|
211
|
+
id: "01K1J1AX8PGR63QRP7423NY008",
|
|
212
|
+
});
|
|
213
|
+
if (res.ok) {
|
|
214
|
+
const { value: result } = res;
|
|
215
|
+
console.log(result);
|
|
216
|
+
} else {
|
|
217
|
+
console.log("budgetsGet failed:", res.error);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
run();
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Parameters
|
|
225
|
+
|
|
226
|
+
| Parameter | Type | Required | Description |
|
|
227
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
228
|
+
| `request` | [operations.GetBudgetRequest](../../models/operations/getbudgetrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
229
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
230
|
+
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
231
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
232
|
+
|
|
233
|
+
### Response
|
|
234
|
+
|
|
235
|
+
**Promise\<[operations.GetBudgetResponseBody](../../models/operations/getbudgetresponsebody.md)\>**
|
|
236
|
+
|
|
237
|
+
### Errors
|
|
238
|
+
|
|
239
|
+
| Error Type | Status Code | Content Type |
|
|
240
|
+
| --------------- | --------------- | --------------- |
|
|
241
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
242
|
+
|
|
243
|
+
## update
|
|
244
|
+
|
|
245
|
+
Update contact budget configuration by ID
|
|
246
|
+
|
|
247
|
+
### Example Usage
|
|
248
|
+
|
|
249
|
+
<!-- UsageSnippet language="typescript" operationID="UpdateBudget" method="patch" path="/v2/budgets/{id}" -->
|
|
250
|
+
```typescript
|
|
251
|
+
import { Orq } from "@orq-ai/node";
|
|
252
|
+
|
|
253
|
+
const orq = new Orq({
|
|
254
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
async function run() {
|
|
258
|
+
const result = await orq.budgets.update({
|
|
259
|
+
id: "01K1J1AX8PGR63QRP7423NY008",
|
|
260
|
+
requestBody: {
|
|
261
|
+
budget: {
|
|
262
|
+
period: "monthly",
|
|
263
|
+
amount: 300,
|
|
264
|
+
},
|
|
265
|
+
isActive: true,
|
|
266
|
+
},
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
console.log(result);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
run();
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### Standalone function
|
|
276
|
+
|
|
277
|
+
The standalone function version of this method:
|
|
278
|
+
|
|
279
|
+
```typescript
|
|
280
|
+
import { OrqCore } from "@orq-ai/node/core.js";
|
|
281
|
+
import { budgetsUpdate } from "@orq-ai/node/funcs/budgetsUpdate.js";
|
|
282
|
+
|
|
283
|
+
// Use `OrqCore` for best tree-shaking performance.
|
|
284
|
+
// You can create one instance of it to use across an application.
|
|
285
|
+
const orq = new OrqCore({
|
|
286
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
async function run() {
|
|
290
|
+
const res = await budgetsUpdate(orq, {
|
|
291
|
+
id: "01K1J1AX8PGR63QRP7423NY008",
|
|
292
|
+
requestBody: {
|
|
293
|
+
budget: {
|
|
294
|
+
period: "monthly",
|
|
295
|
+
amount: 300,
|
|
296
|
+
},
|
|
297
|
+
isActive: true,
|
|
298
|
+
},
|
|
299
|
+
});
|
|
300
|
+
if (res.ok) {
|
|
301
|
+
const { value: result } = res;
|
|
302
|
+
console.log(result);
|
|
303
|
+
} else {
|
|
304
|
+
console.log("budgetsUpdate failed:", res.error);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
run();
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
### Parameters
|
|
312
|
+
|
|
313
|
+
| Parameter | Type | Required | Description |
|
|
314
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
315
|
+
| `request` | [operations.UpdateBudgetRequest](../../models/operations/updatebudgetrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
316
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
317
|
+
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
318
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
319
|
+
|
|
320
|
+
### Response
|
|
321
|
+
|
|
322
|
+
**Promise\<[operations.UpdateBudgetResponseBody](../../models/operations/updatebudgetresponsebody.md)\>**
|
|
323
|
+
|
|
324
|
+
### Errors
|
|
325
|
+
|
|
326
|
+
| Error Type | Status Code | Content Type |
|
|
327
|
+
| --------------- | --------------- | --------------- |
|
|
328
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
329
|
+
|
|
330
|
+
## delete
|
|
331
|
+
|
|
332
|
+
Delete contact budget configuration by ID
|
|
333
|
+
|
|
334
|
+
### Example Usage
|
|
335
|
+
|
|
336
|
+
<!-- UsageSnippet language="typescript" operationID="DeleteBudget" method="delete" path="/v2/budgets/{id}" -->
|
|
337
|
+
```typescript
|
|
338
|
+
import { Orq } from "@orq-ai/node";
|
|
339
|
+
|
|
340
|
+
const orq = new Orq({
|
|
341
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
342
|
+
});
|
|
343
|
+
|
|
344
|
+
async function run() {
|
|
345
|
+
await orq.budgets.delete({
|
|
346
|
+
id: "01K1J1AX8PGR63QRP7423NY008",
|
|
347
|
+
});
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
run();
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
### Standalone function
|
|
356
|
+
|
|
357
|
+
The standalone function version of this method:
|
|
358
|
+
|
|
359
|
+
```typescript
|
|
360
|
+
import { OrqCore } from "@orq-ai/node/core.js";
|
|
361
|
+
import { budgetsDelete } from "@orq-ai/node/funcs/budgetsDelete.js";
|
|
362
|
+
|
|
363
|
+
// Use `OrqCore` for best tree-shaking performance.
|
|
364
|
+
// You can create one instance of it to use across an application.
|
|
365
|
+
const orq = new OrqCore({
|
|
366
|
+
apiKey: process.env["ORQ_API_KEY"] ?? "",
|
|
367
|
+
});
|
|
368
|
+
|
|
369
|
+
async function run() {
|
|
370
|
+
const res = await budgetsDelete(orq, {
|
|
371
|
+
id: "01K1J1AX8PGR63QRP7423NY008",
|
|
372
|
+
});
|
|
373
|
+
if (res.ok) {
|
|
374
|
+
const { value: result } = res;
|
|
375
|
+
|
|
376
|
+
} else {
|
|
377
|
+
console.log("budgetsDelete failed:", res.error);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
run();
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
### Parameters
|
|
385
|
+
|
|
386
|
+
| Parameter | Type | Required | Description |
|
|
387
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
388
|
+
| `request` | [operations.DeleteBudgetRequest](../../models/operations/deletebudgetrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
389
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
390
|
+
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
391
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
392
|
+
|
|
393
|
+
### Response
|
|
394
|
+
|
|
395
|
+
**Promise\<void\>**
|
|
396
|
+
|
|
397
|
+
### Errors
|
|
398
|
+
|
|
399
|
+
| Error Type | Status Code | Content Type |
|
|
400
|
+
| --------------- | --------------- | --------------- |
|
|
401
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
package/packages/orq-rc/jsr.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orq-ai/node",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.12.0-rc.2",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@orq-ai/node",
|
|
9
|
-
"version": "3.
|
|
9
|
+
"version": "3.12.0-rc.2",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"zod": "^3.20.0"
|
|
12
12
|
},
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { OrqCore } from "../core.js";
|
|
6
|
+
import { encodeJSON } 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 "../models/errors/httpclienterrors.js";
|
|
20
|
+
import { OrqError } from "../models/errors/orqerror.js";
|
|
21
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
22
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
23
|
+
import * as operations from "../models/operations/index.js";
|
|
24
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
25
|
+
import { Result } from "../types/fp.js";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Create contact budget configuration
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* Create a new budget configuration for a contact. API Key and Workspace budget creation will be available in future releases.
|
|
32
|
+
*/
|
|
33
|
+
export function budgetsCreate(
|
|
34
|
+
client: OrqCore,
|
|
35
|
+
request: operations.CreateBudgetRequestBody,
|
|
36
|
+
options?: RequestOptions,
|
|
37
|
+
): APIPromise<
|
|
38
|
+
Result<
|
|
39
|
+
operations.CreateBudgetResponseBody,
|
|
40
|
+
| OrqError
|
|
41
|
+
| ResponseValidationError
|
|
42
|
+
| ConnectionError
|
|
43
|
+
| RequestAbortedError
|
|
44
|
+
| RequestTimeoutError
|
|
45
|
+
| InvalidRequestError
|
|
46
|
+
| UnexpectedClientError
|
|
47
|
+
| SDKValidationError
|
|
48
|
+
>
|
|
49
|
+
> {
|
|
50
|
+
return new APIPromise($do(
|
|
51
|
+
client,
|
|
52
|
+
request,
|
|
53
|
+
options,
|
|
54
|
+
));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async function $do(
|
|
58
|
+
client: OrqCore,
|
|
59
|
+
request: operations.CreateBudgetRequestBody,
|
|
60
|
+
options?: RequestOptions,
|
|
61
|
+
): Promise<
|
|
62
|
+
[
|
|
63
|
+
Result<
|
|
64
|
+
operations.CreateBudgetResponseBody,
|
|
65
|
+
| OrqError
|
|
66
|
+
| ResponseValidationError
|
|
67
|
+
| ConnectionError
|
|
68
|
+
| RequestAbortedError
|
|
69
|
+
| RequestTimeoutError
|
|
70
|
+
| InvalidRequestError
|
|
71
|
+
| UnexpectedClientError
|
|
72
|
+
| SDKValidationError
|
|
73
|
+
>,
|
|
74
|
+
APICall,
|
|
75
|
+
]
|
|
76
|
+
> {
|
|
77
|
+
const parsed = safeParse(
|
|
78
|
+
request,
|
|
79
|
+
(value) => operations.CreateBudgetRequestBody$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 = encodeJSON("body", payload, { explode: true });
|
|
87
|
+
|
|
88
|
+
const path = pathToFunc("/v2/budgets")();
|
|
89
|
+
|
|
90
|
+
const headers = new Headers(compactMap({
|
|
91
|
+
"Content-Type": "application/json",
|
|
92
|
+
Accept: "application/json",
|
|
93
|
+
}));
|
|
94
|
+
|
|
95
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
96
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
97
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
98
|
+
|
|
99
|
+
const context = {
|
|
100
|
+
options: client._options,
|
|
101
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
102
|
+
operationID: "CreateBudget",
|
|
103
|
+
oAuth2Scopes: [],
|
|
104
|
+
|
|
105
|
+
resolvedSecurity: requestSecurity,
|
|
106
|
+
|
|
107
|
+
securitySource: client._options.apiKey,
|
|
108
|
+
retryConfig: options?.retries
|
|
109
|
+
|| client._options.retryConfig
|
|
110
|
+
|| { strategy: "none" },
|
|
111
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
const requestRes = client._createRequest(context, {
|
|
115
|
+
security: requestSecurity,
|
|
116
|
+
method: "POST",
|
|
117
|
+
baseURL: options?.serverURL,
|
|
118
|
+
path: path,
|
|
119
|
+
headers: headers,
|
|
120
|
+
body: body,
|
|
121
|
+
userAgent: client._options.userAgent,
|
|
122
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
123
|
+
}, options);
|
|
124
|
+
if (!requestRes.ok) {
|
|
125
|
+
return [requestRes, { status: "invalid" }];
|
|
126
|
+
}
|
|
127
|
+
const req = requestRes.value;
|
|
128
|
+
|
|
129
|
+
const doResult = await client._do(req, {
|
|
130
|
+
context,
|
|
131
|
+
errorCodes: ["400", "409", "4XX", "5XX"],
|
|
132
|
+
retryConfig: context.retryConfig,
|
|
133
|
+
retryCodes: context.retryCodes,
|
|
134
|
+
});
|
|
135
|
+
if (!doResult.ok) {
|
|
136
|
+
return [doResult, { status: "request-error", request: req }];
|
|
137
|
+
}
|
|
138
|
+
const response = doResult.value;
|
|
139
|
+
|
|
140
|
+
const [result] = await M.match<
|
|
141
|
+
operations.CreateBudgetResponseBody,
|
|
142
|
+
| OrqError
|
|
143
|
+
| ResponseValidationError
|
|
144
|
+
| ConnectionError
|
|
145
|
+
| RequestAbortedError
|
|
146
|
+
| RequestTimeoutError
|
|
147
|
+
| InvalidRequestError
|
|
148
|
+
| UnexpectedClientError
|
|
149
|
+
| SDKValidationError
|
|
150
|
+
>(
|
|
151
|
+
M.json(200, operations.CreateBudgetResponseBody$inboundSchema),
|
|
152
|
+
M.fail([400, 409, "4XX"]),
|
|
153
|
+
M.fail("5XX"),
|
|
154
|
+
)(response, req);
|
|
155
|
+
if (!result.ok) {
|
|
156
|
+
return [result, { status: "complete", request: req, response }];
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
return [result, { status: "complete", request: req, response }];
|
|
160
|
+
}
|