syllable-sdk 1.0.8-rc.1 → 1.0.8-rc.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 +135 -59
- package/bin/mcp-server.js.map +13 -12
- package/examples/package-lock.json +1 -1
- 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.js +1 -1
- package/models/components/daotoolresponse.d.ts +80 -0
- package/models/components/daotoolresponse.d.ts.map +1 -0
- package/models/components/daotoolresponse.js +111 -0
- package/models/components/daotoolresponse.js.map +1 -0
- package/models/components/index.d.ts +1 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +1 -0
- package/models/components/index.js.map +1 -1
- package/models/components/promptcreaterequest.d.ts +5 -0
- package/models/components/promptcreaterequest.d.ts.map +1 -1
- package/models/components/promptcreaterequest.js +4 -0
- package/models/components/promptcreaterequest.js.map +1 -1
- package/models/components/promptresponse.d.ts +11 -0
- package/models/components/promptresponse.d.ts.map +1 -1
- package/models/components/promptresponse.js +9 -0
- package/models/components/promptresponse.js.map +1 -1
- package/models/components/promptupdaterequest.d.ts +5 -0
- package/models/components/promptupdaterequest.d.ts.map +1 -1
- package/models/components/promptupdaterequest.js +4 -0
- package/models/components/promptupdaterequest.js.map +1 -1
- package/openapi.json +243 -33
- package/package.json +1 -1
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/models/components/daotoolresponse.ts +171 -0
- package/src/models/components/index.ts +1 -0
- package/src/models/components/promptcreaterequest.ts +9 -0
- package/src/models/components/promptresponse.ts +24 -0
- package/src/models/components/promptupdaterequest.ts +9 -0
- package/.devcontainer/README.md +0 -35
- package/api-reference/sdks/agents/README.md +0 -224
- package/api-reference/sdks/availabletargets/README.md +0 -49
- package/api-reference/sdks/channels/README.md +0 -92
- package/api-reference/sdks/chats/README.md +0 -55
- package/api-reference/sdks/conversations/README.md +0 -91
- package/api-reference/sdks/dashboards/README.md +0 -321
- package/api-reference/sdks/events/README.md +0 -50
- package/api-reference/sdks/greetings/README.md +0 -223
- package/api-reference/sdks/organizations/README.md +0 -48
- package/api-reference/sdks/prompts/README.md +0 -225
- package/api-reference/sdks/sessions/README.md +0 -50
- package/api-reference/sdks/syllable/README.md +0 -22
- package/api-reference/sdks/targets/README.md +0 -194
- package/api-reference/sdks/tools/README.md +0 -92
- package/docs/sdks/agents/README.md +0 -589
- package/docs/sdks/batches/README.md +0 -742
- package/docs/sdks/campaigns/README.md +0 -526
- package/docs/sdks/channels/README.md +0 -401
- package/docs/sdks/conversations/README.md +0 -100
- package/docs/sdks/custommessages/README.md +0 -496
- package/docs/sdks/dashboards/README.md +0 -481
- package/docs/sdks/datasources/README.md +0 -458
- package/docs/sdks/directory/README.md +0 -727
- package/docs/sdks/events/README.md +0 -100
- package/docs/sdks/folders/README.md +0 -675
- package/docs/sdks/fullsummary/README.md +0 -82
- package/docs/sdks/incidents/README.md +0 -501
- package/docs/sdks/insights/README.md +0 -100
- package/docs/sdks/languagegroups/README.md +0 -565
- package/docs/sdks/latency/README.md +0 -82
- package/docs/sdks/numbers/README.md +0 -250
- package/docs/sdks/organizations/README.md +0 -317
- package/docs/sdks/permissions/README.md +0 -78
- package/docs/sdks/prompts/README.md +0 -592
- package/docs/sdks/pronunciations/README.md +0 -360
- package/docs/sdks/roles/README.md +0 -430
- package/docs/sdks/services/README.md +0 -430
- package/docs/sdks/sessiondebug/README.md +0 -236
- package/docs/sdks/sessionlabels/README.md +0 -262
- package/docs/sdks/sessions/README.md +0 -325
- package/docs/sdks/syllablesdktools/README.md +0 -578
- package/docs/sdks/takeouts/README.md +0 -228
- package/docs/sdks/targets/README.md +0 -454
- package/docs/sdks/test/README.md +0 -92
- package/docs/sdks/tools/README.md +0 -518
- package/docs/sdks/transcript/README.md +0 -82
- package/docs/sdks/twilio/README.md +0 -246
- package/docs/sdks/users/README.md +0 -561
- package/docs/sdks/v1/README.md +0 -561
- package/docs/sdks/voicegroups/README.md +0 -551
- package/docs/sdks/workflows/README.md +0 -781
- package/examples/README.md +0 -31
|
@@ -1,317 +0,0 @@
|
|
|
1
|
-
# Organizations
|
|
2
|
-
(*organizations*)
|
|
3
|
-
|
|
4
|
-
## Overview
|
|
5
|
-
|
|
6
|
-
Operations related to organizations.
|
|
7
|
-
|
|
8
|
-
### Available Operations
|
|
9
|
-
|
|
10
|
-
* [organizationsGet](#organizationsget) - Get Current Organization
|
|
11
|
-
* [update](#update) - Update Current Organization
|
|
12
|
-
* [create](#create) - Create Organization
|
|
13
|
-
* [delete](#delete) - Delete Current Organization
|
|
14
|
-
|
|
15
|
-
## organizationsGet
|
|
16
|
-
|
|
17
|
-
Fetch the current organization.
|
|
18
|
-
|
|
19
|
-
### Example Usage
|
|
20
|
-
|
|
21
|
-
<!-- UsageSnippet language="typescript" operationID="organizations_get" method="get" path="/api/v1/organizations/" -->
|
|
22
|
-
```typescript
|
|
23
|
-
import { SyllableSDK } from "syllable-sdk";
|
|
24
|
-
|
|
25
|
-
const syllableSDK = new SyllableSDK({
|
|
26
|
-
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
async function run() {
|
|
30
|
-
const result = await syllableSDK.organizations.organizationsGet();
|
|
31
|
-
|
|
32
|
-
console.log(result);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
run();
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
### Standalone function
|
|
39
|
-
|
|
40
|
-
The standalone function version of this method:
|
|
41
|
-
|
|
42
|
-
```typescript
|
|
43
|
-
import { SyllableSDKCore } from "syllable-sdk/core.js";
|
|
44
|
-
import { organizationsOrganizationsGet } from "syllable-sdk/funcs/organizationsOrganizationsGet.js";
|
|
45
|
-
|
|
46
|
-
// Use `SyllableSDKCore` for best tree-shaking performance.
|
|
47
|
-
// You can create one instance of it to use across an application.
|
|
48
|
-
const syllableSDK = new SyllableSDKCore({
|
|
49
|
-
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
async function run() {
|
|
53
|
-
const res = await organizationsOrganizationsGet(syllableSDK);
|
|
54
|
-
if (res.ok) {
|
|
55
|
-
const { value: result } = res;
|
|
56
|
-
console.log(result);
|
|
57
|
-
} else {
|
|
58
|
-
console.log("organizationsOrganizationsGet failed:", res.error);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
run();
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
### Parameters
|
|
66
|
-
|
|
67
|
-
| Parameter | Type | Required | Description |
|
|
68
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
69
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
70
|
-
| `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. |
|
|
71
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
72
|
-
|
|
73
|
-
### Response
|
|
74
|
-
|
|
75
|
-
**Promise\<[components.OrganizationResponse](../../models/components/organizationresponse.md)\>**
|
|
76
|
-
|
|
77
|
-
### Errors
|
|
78
|
-
|
|
79
|
-
| Error Type | Status Code | Content Type |
|
|
80
|
-
| --------------- | --------------- | --------------- |
|
|
81
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
82
|
-
|
|
83
|
-
## update
|
|
84
|
-
|
|
85
|
-
Update the current organization.
|
|
86
|
-
|
|
87
|
-
### Example Usage
|
|
88
|
-
|
|
89
|
-
<!-- UsageSnippet language="typescript" operationID="organizations_update" method="put" path="/api/v1/organizations/" -->
|
|
90
|
-
```typescript
|
|
91
|
-
import { SyllableSDK } from "syllable-sdk";
|
|
92
|
-
|
|
93
|
-
const syllableSDK = new SyllableSDK({
|
|
94
|
-
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
async function run() {
|
|
98
|
-
const result = await syllableSDK.organizations.update({
|
|
99
|
-
displayName: "My Great Org",
|
|
100
|
-
description: "An organization that does great things with agentic AI",
|
|
101
|
-
domains: "mygreatorg.com,mygreatorg.org",
|
|
102
|
-
samlProviderId: "saml.syllablesso",
|
|
103
|
-
updateComments: "Updated the organization to add a new domain",
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
console.log(result);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
run();
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
### Standalone function
|
|
113
|
-
|
|
114
|
-
The standalone function version of this method:
|
|
115
|
-
|
|
116
|
-
```typescript
|
|
117
|
-
import { SyllableSDKCore } from "syllable-sdk/core.js";
|
|
118
|
-
import { organizationsUpdate } from "syllable-sdk/funcs/organizationsUpdate.js";
|
|
119
|
-
|
|
120
|
-
// Use `SyllableSDKCore` for best tree-shaking performance.
|
|
121
|
-
// You can create one instance of it to use across an application.
|
|
122
|
-
const syllableSDK = new SyllableSDKCore({
|
|
123
|
-
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
async function run() {
|
|
127
|
-
const res = await organizationsUpdate(syllableSDK, {
|
|
128
|
-
displayName: "My Great Org",
|
|
129
|
-
description: "An organization that does great things with agentic AI",
|
|
130
|
-
domains: "mygreatorg.com,mygreatorg.org",
|
|
131
|
-
samlProviderId: "saml.syllablesso",
|
|
132
|
-
updateComments: "Updated the organization to add a new domain",
|
|
133
|
-
});
|
|
134
|
-
if (res.ok) {
|
|
135
|
-
const { value: result } = res;
|
|
136
|
-
console.log(result);
|
|
137
|
-
} else {
|
|
138
|
-
console.log("organizationsUpdate failed:", res.error);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
run();
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
### Parameters
|
|
146
|
-
|
|
147
|
-
| Parameter | Type | Required | Description |
|
|
148
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
149
|
-
| `request` | [components.BodyOrganizationsUpdate](../../models/components/bodyorganizationsupdate.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
150
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
151
|
-
| `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. |
|
|
152
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
153
|
-
|
|
154
|
-
### Response
|
|
155
|
-
|
|
156
|
-
**Promise\<[components.OrganizationResponse](../../models/components/organizationresponse.md)\>**
|
|
157
|
-
|
|
158
|
-
### Errors
|
|
159
|
-
|
|
160
|
-
| Error Type | Status Code | Content Type |
|
|
161
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
162
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
163
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
164
|
-
|
|
165
|
-
## create
|
|
166
|
-
|
|
167
|
-
Create a new organization.
|
|
168
|
-
|
|
169
|
-
### Example Usage
|
|
170
|
-
|
|
171
|
-
<!-- UsageSnippet language="typescript" operationID="organizations_create" method="post" path="/api/v1/organizations/" -->
|
|
172
|
-
```typescript
|
|
173
|
-
import { openAsBlob } from "node:fs";
|
|
174
|
-
import { SyllableSDK } from "syllable-sdk";
|
|
175
|
-
|
|
176
|
-
const syllableSDK = new SyllableSDK({
|
|
177
|
-
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
async function run() {
|
|
181
|
-
const result = await syllableSDK.organizations.create({
|
|
182
|
-
logo: await openAsBlob("example.file"),
|
|
183
|
-
displayName: "My Great Org",
|
|
184
|
-
description: "An organization that does great things with agentic AI",
|
|
185
|
-
domains: "mygreatorg.com,mygreatorg.org",
|
|
186
|
-
samlProviderId: "saml.syllablesso",
|
|
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 { openAsBlob } from "node:fs";
|
|
201
|
-
import { SyllableSDKCore } from "syllable-sdk/core.js";
|
|
202
|
-
import { organizationsCreate } from "syllable-sdk/funcs/organizationsCreate.js";
|
|
203
|
-
|
|
204
|
-
// Use `SyllableSDKCore` for best tree-shaking performance.
|
|
205
|
-
// You can create one instance of it to use across an application.
|
|
206
|
-
const syllableSDK = new SyllableSDKCore({
|
|
207
|
-
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
|
|
208
|
-
});
|
|
209
|
-
|
|
210
|
-
async function run() {
|
|
211
|
-
const res = await organizationsCreate(syllableSDK, {
|
|
212
|
-
logo: await openAsBlob("example.file"),
|
|
213
|
-
displayName: "My Great Org",
|
|
214
|
-
description: "An organization that does great things with agentic AI",
|
|
215
|
-
domains: "mygreatorg.com,mygreatorg.org",
|
|
216
|
-
samlProviderId: "saml.syllablesso",
|
|
217
|
-
});
|
|
218
|
-
if (res.ok) {
|
|
219
|
-
const { value: result } = res;
|
|
220
|
-
console.log(result);
|
|
221
|
-
} else {
|
|
222
|
-
console.log("organizationsCreate failed:", res.error);
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
run();
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
### Parameters
|
|
230
|
-
|
|
231
|
-
| Parameter | Type | Required | Description |
|
|
232
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
233
|
-
| `request` | [components.BodyOrganizationsCreate](../../models/components/bodyorganizationscreate.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
234
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
235
|
-
| `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. |
|
|
236
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
237
|
-
|
|
238
|
-
### Response
|
|
239
|
-
|
|
240
|
-
**Promise\<[components.OrganizationResponse](../../models/components/organizationresponse.md)\>**
|
|
241
|
-
|
|
242
|
-
### Errors
|
|
243
|
-
|
|
244
|
-
| Error Type | Status Code | Content Type |
|
|
245
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
246
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
247
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
248
|
-
|
|
249
|
-
## delete
|
|
250
|
-
|
|
251
|
-
Delete the current organization and all its users.
|
|
252
|
-
|
|
253
|
-
### Example Usage
|
|
254
|
-
|
|
255
|
-
<!-- UsageSnippet language="typescript" operationID="organizations_delete" method="delete" path="/api/v1/organizations/" -->
|
|
256
|
-
```typescript
|
|
257
|
-
import { SyllableSDK } from "syllable-sdk";
|
|
258
|
-
|
|
259
|
-
const syllableSDK = new SyllableSDK({
|
|
260
|
-
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
|
|
261
|
-
});
|
|
262
|
-
|
|
263
|
-
async function run() {
|
|
264
|
-
const result = await syllableSDK.organizations.delete();
|
|
265
|
-
|
|
266
|
-
console.log(result);
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
run();
|
|
270
|
-
```
|
|
271
|
-
|
|
272
|
-
### Standalone function
|
|
273
|
-
|
|
274
|
-
The standalone function version of this method:
|
|
275
|
-
|
|
276
|
-
```typescript
|
|
277
|
-
import { SyllableSDKCore } from "syllable-sdk/core.js";
|
|
278
|
-
import { organizationsDelete } from "syllable-sdk/funcs/organizationsDelete.js";
|
|
279
|
-
|
|
280
|
-
// Use `SyllableSDKCore` for best tree-shaking performance.
|
|
281
|
-
// You can create one instance of it to use across an application.
|
|
282
|
-
const syllableSDK = new SyllableSDKCore({
|
|
283
|
-
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
|
|
284
|
-
});
|
|
285
|
-
|
|
286
|
-
async function run() {
|
|
287
|
-
const res = await organizationsDelete(syllableSDK);
|
|
288
|
-
if (res.ok) {
|
|
289
|
-
const { value: result } = res;
|
|
290
|
-
console.log(result);
|
|
291
|
-
} else {
|
|
292
|
-
console.log("organizationsDelete failed:", res.error);
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
run();
|
|
297
|
-
```
|
|
298
|
-
|
|
299
|
-
### Parameters
|
|
300
|
-
|
|
301
|
-
| Parameter | Type | Required | Description |
|
|
302
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
303
|
-
| `request` | [components.BodyOrganizationsDelete](../../models/components/bodyorganizationsdelete.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
304
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
305
|
-
| `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. |
|
|
306
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
307
|
-
|
|
308
|
-
### Response
|
|
309
|
-
|
|
310
|
-
**Promise\<[any](../../models/.md)\>**
|
|
311
|
-
|
|
312
|
-
### Errors
|
|
313
|
-
|
|
314
|
-
| Error Type | Status Code | Content Type |
|
|
315
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
316
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
317
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
# Permissions
|
|
2
|
-
(*permissions*)
|
|
3
|
-
|
|
4
|
-
## Overview
|
|
5
|
-
|
|
6
|
-
Operations related to permissions. A permission is a specific capability or access level granted to a user within the Syllable system. Permissions are used to control access to various features and functionalities.
|
|
7
|
-
|
|
8
|
-
### Available Operations
|
|
9
|
-
|
|
10
|
-
* [list](#list) - List Permissions
|
|
11
|
-
|
|
12
|
-
## list
|
|
13
|
-
|
|
14
|
-
Get all available permissions in the system.
|
|
15
|
-
|
|
16
|
-
### Example Usage
|
|
17
|
-
|
|
18
|
-
<!-- UsageSnippet language="typescript" operationID="permissions_list" method="get" path="/api/v1/permissions/" -->
|
|
19
|
-
```typescript
|
|
20
|
-
import { SyllableSDK } from "syllable-sdk";
|
|
21
|
-
|
|
22
|
-
const syllableSDK = new SyllableSDK({
|
|
23
|
-
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
async function run() {
|
|
27
|
-
const result = await syllableSDK.permissions.list();
|
|
28
|
-
|
|
29
|
-
console.log(result);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
run();
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
### Standalone function
|
|
36
|
-
|
|
37
|
-
The standalone function version of this method:
|
|
38
|
-
|
|
39
|
-
```typescript
|
|
40
|
-
import { SyllableSDKCore } from "syllable-sdk/core.js";
|
|
41
|
-
import { permissionsList } from "syllable-sdk/funcs/permissionsList.js";
|
|
42
|
-
|
|
43
|
-
// Use `SyllableSDKCore` for best tree-shaking performance.
|
|
44
|
-
// You can create one instance of it to use across an application.
|
|
45
|
-
const syllableSDK = new SyllableSDKCore({
|
|
46
|
-
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
async function run() {
|
|
50
|
-
const res = await permissionsList(syllableSDK);
|
|
51
|
-
if (res.ok) {
|
|
52
|
-
const { value: result } = res;
|
|
53
|
-
console.log(result);
|
|
54
|
-
} else {
|
|
55
|
-
console.log("permissionsList failed:", res.error);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
run();
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
### Parameters
|
|
63
|
-
|
|
64
|
-
| Parameter | Type | Required | Description |
|
|
65
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
66
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
67
|
-
| `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. |
|
|
68
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
69
|
-
|
|
70
|
-
### Response
|
|
71
|
-
|
|
72
|
-
**Promise\<[components.PermissionGroupResponse[]](../../models/.md)\>**
|
|
73
|
-
|
|
74
|
-
### Errors
|
|
75
|
-
|
|
76
|
-
| Error Type | Status Code | Content Type |
|
|
77
|
-
| --------------- | --------------- | --------------- |
|
|
78
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|