syllable-sdk 0.1.0-alpha.186 → 0.1.0-alpha.190

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 (65) hide show
  1. package/README.md +11 -0
  2. package/docs/sdks/batches/README.md +4 -4
  3. package/docs/sdks/organizations/README.md +325 -0
  4. package/docs/sdks/workflows/README.md +8 -8
  5. package/funcs/organizationsCreate.d.ts +16 -0
  6. package/funcs/organizationsCreate.d.ts.map +1 -0
  7. package/funcs/organizationsCreate.js +120 -0
  8. package/funcs/organizationsCreate.js.map +1 -0
  9. package/funcs/organizationsDelete.d.ts +16 -0
  10. package/funcs/organizationsDelete.d.ts.map +1 -0
  11. package/funcs/organizationsDelete.js +105 -0
  12. package/funcs/organizationsDelete.js.map +1 -0
  13. package/funcs/organizationsOrganizationsGet.d.ts +15 -0
  14. package/funcs/organizationsOrganizationsGet.d.ts.map +1 -0
  15. package/funcs/organizationsOrganizationsGet.js +88 -0
  16. package/funcs/organizationsOrganizationsGet.js.map +1 -0
  17. package/funcs/organizationsUpdate.d.ts +16 -0
  18. package/funcs/organizationsUpdate.d.ts.map +1 -0
  19. package/funcs/organizationsUpdate.js +125 -0
  20. package/funcs/organizationsUpdate.js.map +1 -0
  21. package/jsr.json +1 -1
  22. package/lib/config.d.ts +2 -2
  23. package/lib/config.js +2 -2
  24. package/models/components/bodyorganizationscreate.d.ts +74 -0
  25. package/models/components/bodyorganizationscreate.d.ts.map +1 -0
  26. package/models/components/bodyorganizationscreate.js +114 -0
  27. package/models/components/bodyorganizationscreate.js.map +1 -0
  28. package/models/components/bodyorganizationsdelete.d.ts +32 -0
  29. package/models/components/bodyorganizationsdelete.d.ts.map +1 -0
  30. package/models/components/bodyorganizationsdelete.js +68 -0
  31. package/models/components/bodyorganizationsdelete.js.map +1 -0
  32. package/models/components/bodyorganizationsupdate.d.ts +79 -0
  33. package/models/components/bodyorganizationsupdate.d.ts.map +1 -0
  34. package/models/components/bodyorganizationsupdate.js +119 -0
  35. package/models/components/bodyorganizationsupdate.js.map +1 -0
  36. package/models/components/index.d.ts +4 -0
  37. package/models/components/index.d.ts.map +1 -1
  38. package/models/components/index.js +4 -0
  39. package/models/components/index.js.map +1 -1
  40. package/models/components/organizationresponse.d.ts +64 -0
  41. package/models/components/organizationresponse.d.ts.map +1 -0
  42. package/models/components/organizationresponse.js +90 -0
  43. package/models/components/organizationresponse.js.map +1 -0
  44. package/openapi.json +427 -33
  45. package/package.json +1 -1
  46. package/sdk/organizations.d.ts +33 -0
  47. package/sdk/organizations.d.ts.map +1 -0
  48. package/sdk/organizations.js +52 -0
  49. package/sdk/organizations.js.map +1 -0
  50. package/sdk/sdk.d.ts +3 -0
  51. package/sdk/sdk.d.ts.map +1 -1
  52. package/sdk/sdk.js +4 -0
  53. package/sdk/sdk.js.map +1 -1
  54. package/src/funcs/organizationsCreate.ts +157 -0
  55. package/src/funcs/organizationsDelete.ts +140 -0
  56. package/src/funcs/organizationsOrganizationsGet.ts +111 -0
  57. package/src/funcs/organizationsUpdate.ts +162 -0
  58. package/src/lib/config.ts +2 -2
  59. package/src/models/components/bodyorganizationscreate.ts +176 -0
  60. package/src/models/components/bodyorganizationsdelete.ts +78 -0
  61. package/src/models/components/bodyorganizationsupdate.ts +171 -0
  62. package/src/models/components/index.ts +4 -0
  63. package/src/models/components/organizationresponse.ts +134 -0
  64. package/src/sdk/organizations.ts +79 -0
  65. package/src/sdk/sdk.ts +6 -0
package/README.md CHANGED
@@ -261,6 +261,13 @@ run();
261
261
  * [delete](docs/sdks/languagegroups/README.md#delete) - Delete Language Group
262
262
  * [languageGroupsCreateVoiceSample](docs/sdks/languagegroups/README.md#languagegroupscreatevoicesample) - Create Voice Sample
263
263
 
264
+ ### [organizations](docs/sdks/organizations/README.md)
265
+
266
+ * [organizationsGet](docs/sdks/organizations/README.md#organizationsget) - Get Current Organization
267
+ * [update](docs/sdks/organizations/README.md#update) - Update Current Organization
268
+ * [create](docs/sdks/organizations/README.md#create) - Create Organization
269
+ * [delete](docs/sdks/organizations/README.md#delete) - Delete Current Organization
270
+
264
271
  ### [outbound](docs/sdks/outbound/README.md)
265
272
 
266
273
 
@@ -466,6 +473,10 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
466
473
  - [`languageGroupsLanguageGroupsCreateVoiceSample`](docs/sdks/languagegroups/README.md#languagegroupscreatevoicesample) - Create Voice Sample
467
474
  - [`languageGroupsList`](docs/sdks/languagegroups/README.md#list) - List Language Groups
468
475
  - [`languageGroupsUpdate`](docs/sdks/languagegroups/README.md#update) - Update Language Group
476
+ - [`organizationsCreate`](docs/sdks/organizations/README.md#create) - Create Organization
477
+ - [`organizationsDelete`](docs/sdks/organizations/README.md#delete) - Delete Current Organization
478
+ - [`organizationsOrganizationsGet`](docs/sdks/organizations/README.md#organizationsget) - Get Current Organization
479
+ - [`organizationsUpdate`](docs/sdks/organizations/README.md#update) - Update Current Organization
469
480
  - [`outboundBatchesAdd`](docs/sdks/batches/README.md#add) - Create Outbound Communication Request
470
481
  - [`outboundBatchesCreate`](docs/sdks/batches/README.md#create) - Create Outbound Communication Batch
471
482
  - [`outboundBatchesDelete`](docs/sdks/batches/README.md#delete) - Delete Outbound Communication Batch
@@ -125,9 +125,9 @@ const syllableSDK = new SyllableSDK({
125
125
 
126
126
  async function run() {
127
127
  const result = await syllableSDK.outbound.batches.create({
128
- batchId: "20250617.9",
128
+ batchId: "20250624.9",
129
129
  campaignId: 1,
130
- expiresOn: new Date("2025-06-18T00:00:00Z"),
130
+ expiresOn: new Date("2025-06-25T00:00:00Z"),
131
131
  paused: true,
132
132
  });
133
133
 
@@ -154,9 +154,9 @@ const syllableSDK = new SyllableSDKCore({
154
154
 
155
155
  async function run() {
156
156
  const res = await outboundBatchesCreate(syllableSDK, {
157
- batchId: "20250617.9",
157
+ batchId: "20250624.9",
158
158
  campaignId: 1,
159
- expiresOn: new Date("2025-06-18T00:00:00Z"),
159
+ expiresOn: new Date("2025-06-25T00:00:00Z"),
160
160
  paused: true,
161
161
  });
162
162
 
@@ -0,0 +1,325 @@
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
+ ```typescript
22
+ import { SyllableSDK } from "syllable-sdk";
23
+
24
+ const syllableSDK = new SyllableSDK({
25
+ apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
26
+ });
27
+
28
+ async function run() {
29
+ const result = await syllableSDK.organizations.organizationsGet();
30
+
31
+ // Handle the result
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
+
55
+ if (!res.ok) {
56
+ throw res.error;
57
+ }
58
+
59
+ const { value: result } = res;
60
+
61
+ // Handle the result
62
+ console.log(result);
63
+ }
64
+
65
+ run();
66
+ ```
67
+
68
+ ### Parameters
69
+
70
+ | Parameter | Type | Required | Description |
71
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
72
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
73
+ | `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. |
74
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
75
+
76
+ ### Response
77
+
78
+ **Promise\<[components.OrganizationResponse](../../models/components/organizationresponse.md)\>**
79
+
80
+ ### Errors
81
+
82
+ | Error Type | Status Code | Content Type |
83
+ | --------------- | --------------- | --------------- |
84
+ | errors.SDKError | 4XX, 5XX | \*/\* |
85
+
86
+ ## update
87
+
88
+ Update the current organization.
89
+
90
+ ### Example Usage
91
+
92
+ ```typescript
93
+ import { SyllableSDK } from "syllable-sdk";
94
+
95
+ const syllableSDK = new SyllableSDK({
96
+ apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
97
+ });
98
+
99
+ async function run() {
100
+ const result = await syllableSDK.organizations.update({
101
+ displayName: "My Great Org",
102
+ domains: "mygreatorg.com,mygreatorg.org",
103
+ description: "An organization that does great things with agentic AI",
104
+ updateComments: "Updated the organization to add a new domain",
105
+ });
106
+
107
+ // Handle the result
108
+ console.log(result);
109
+ }
110
+
111
+ run();
112
+ ```
113
+
114
+ ### Standalone function
115
+
116
+ The standalone function version of this method:
117
+
118
+ ```typescript
119
+ import { SyllableSDKCore } from "syllable-sdk/core.js";
120
+ import { organizationsUpdate } from "syllable-sdk/funcs/organizationsUpdate.js";
121
+
122
+ // Use `SyllableSDKCore` for best tree-shaking performance.
123
+ // You can create one instance of it to use across an application.
124
+ const syllableSDK = new SyllableSDKCore({
125
+ apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
126
+ });
127
+
128
+ async function run() {
129
+ const res = await organizationsUpdate(syllableSDK, {
130
+ displayName: "My Great Org",
131
+ domains: "mygreatorg.com,mygreatorg.org",
132
+ description: "An organization that does great things with agentic AI",
133
+ updateComments: "Updated the organization to add a new domain",
134
+ });
135
+
136
+ if (!res.ok) {
137
+ throw res.error;
138
+ }
139
+
140
+ const { value: result } = res;
141
+
142
+ // Handle the result
143
+ console.log(result);
144
+ }
145
+
146
+ run();
147
+ ```
148
+
149
+ ### Parameters
150
+
151
+ | Parameter | Type | Required | Description |
152
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
153
+ | `request` | [components.BodyOrganizationsUpdate](../../models/components/bodyorganizationsupdate.md) | :heavy_check_mark: | The request object to use for the request. |
154
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
155
+ | `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. |
156
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
157
+
158
+ ### Response
159
+
160
+ **Promise\<[components.OrganizationResponse](../../models/components/organizationresponse.md)\>**
161
+
162
+ ### Errors
163
+
164
+ | Error Type | Status Code | Content Type |
165
+ | -------------------------- | -------------------------- | -------------------------- |
166
+ | errors.HTTPValidationError | 422 | application/json |
167
+ | errors.SDKError | 4XX, 5XX | \*/\* |
168
+
169
+ ## create
170
+
171
+ Create a new organization.
172
+
173
+ ### Example Usage
174
+
175
+ ```typescript
176
+ import { openAsBlob } from "node:fs";
177
+ import { SyllableSDK } from "syllable-sdk";
178
+
179
+ const syllableSDK = new SyllableSDK({
180
+ apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
181
+ });
182
+
183
+ async function run() {
184
+ const result = await syllableSDK.organizations.create({
185
+ displayName: "My Great Org",
186
+ domains: "mygreatorg.com,mygreatorg.org",
187
+ logo: await openAsBlob("example.file"),
188
+ description: "An organization that does great things with agentic AI",
189
+ });
190
+
191
+ // Handle the result
192
+ console.log(result);
193
+ }
194
+
195
+ run();
196
+ ```
197
+
198
+ ### Standalone function
199
+
200
+ The standalone function version of this method:
201
+
202
+ ```typescript
203
+ import { openAsBlob } from "node:fs";
204
+ import { SyllableSDKCore } from "syllable-sdk/core.js";
205
+ import { organizationsCreate } from "syllable-sdk/funcs/organizationsCreate.js";
206
+
207
+ // Use `SyllableSDKCore` for best tree-shaking performance.
208
+ // You can create one instance of it to use across an application.
209
+ const syllableSDK = new SyllableSDKCore({
210
+ apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
211
+ });
212
+
213
+ async function run() {
214
+ const res = await organizationsCreate(syllableSDK, {
215
+ displayName: "My Great Org",
216
+ domains: "mygreatorg.com,mygreatorg.org",
217
+ logo: await openAsBlob("example.file"),
218
+ description: "An organization that does great things with agentic AI",
219
+ });
220
+
221
+ if (!res.ok) {
222
+ throw res.error;
223
+ }
224
+
225
+ const { value: result } = res;
226
+
227
+ // Handle the result
228
+ console.log(result);
229
+ }
230
+
231
+ run();
232
+ ```
233
+
234
+ ### Parameters
235
+
236
+ | Parameter | Type | Required | Description |
237
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
238
+ | `request` | [components.BodyOrganizationsCreate](../../models/components/bodyorganizationscreate.md) | :heavy_check_mark: | The request object to use for the request. |
239
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
240
+ | `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. |
241
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
242
+
243
+ ### Response
244
+
245
+ **Promise\<[components.OrganizationResponse](../../models/components/organizationresponse.md)\>**
246
+
247
+ ### Errors
248
+
249
+ | Error Type | Status Code | Content Type |
250
+ | -------------------------- | -------------------------- | -------------------------- |
251
+ | errors.HTTPValidationError | 422 | application/json |
252
+ | errors.SDKError | 4XX, 5XX | \*/\* |
253
+
254
+ ## delete
255
+
256
+ Delete the current organization and all its users.
257
+
258
+ ### Example Usage
259
+
260
+ ```typescript
261
+ import { SyllableSDK } from "syllable-sdk";
262
+
263
+ const syllableSDK = new SyllableSDK({
264
+ apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
265
+ });
266
+
267
+ async function run() {
268
+ const result = await syllableSDK.organizations.delete();
269
+
270
+ // Handle the result
271
+ console.log(result);
272
+ }
273
+
274
+ run();
275
+ ```
276
+
277
+ ### Standalone function
278
+
279
+ The standalone function version of this method:
280
+
281
+ ```typescript
282
+ import { SyllableSDKCore } from "syllable-sdk/core.js";
283
+ import { organizationsDelete } from "syllable-sdk/funcs/organizationsDelete.js";
284
+
285
+ // Use `SyllableSDKCore` for best tree-shaking performance.
286
+ // You can create one instance of it to use across an application.
287
+ const syllableSDK = new SyllableSDKCore({
288
+ apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
289
+ });
290
+
291
+ async function run() {
292
+ const res = await organizationsDelete(syllableSDK);
293
+
294
+ if (!res.ok) {
295
+ throw res.error;
296
+ }
297
+
298
+ const { value: result } = res;
299
+
300
+ // Handle the result
301
+ console.log(result);
302
+ }
303
+
304
+ run();
305
+ ```
306
+
307
+ ### Parameters
308
+
309
+ | Parameter | Type | Required | Description |
310
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
311
+ | `request` | [components.BodyOrganizationsDelete](../../models/components/bodyorganizationsdelete.md) | :heavy_check_mark: | The request object to use for the request. |
312
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
313
+ | `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. |
314
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
315
+
316
+ ### Response
317
+
318
+ **Promise\<[any](../../models/.md)\>**
319
+
320
+ ### Errors
321
+
322
+ | Error Type | Status Code | Content Type |
323
+ | -------------------------- | -------------------------- | -------------------------- |
324
+ | errors.HTTPValidationError | 422 | application/json |
325
+ | errors.SDKError | 4XX, 5XX | \*/\* |
@@ -131,8 +131,8 @@ async function run() {
131
131
  1,
132
132
  ],
133
133
  conditions: {},
134
- startDatetime: new Date("2025-06-16T00:00:00Z"),
135
- endDatetime: new Date("2025-06-17T00:00:00Z"),
134
+ startDatetime: new Date("2025-06-23T00:00:00Z"),
135
+ endDatetime: new Date("2025-06-24T00:00:00Z"),
136
136
  });
137
137
 
138
138
  // Handle the result
@@ -165,8 +165,8 @@ async function run() {
165
165
  1,
166
166
  ],
167
167
  conditions: {},
168
- startDatetime: new Date("2025-06-16T00:00:00Z"),
169
- endDatetime: new Date("2025-06-17T00:00:00Z"),
168
+ startDatetime: new Date("2025-06-23T00:00:00Z"),
169
+ endDatetime: new Date("2025-06-24T00:00:00Z"),
170
170
  });
171
171
 
172
172
  if (!res.ok) {
@@ -303,8 +303,8 @@ async function run() {
303
303
  1,
304
304
  ],
305
305
  conditions: {},
306
- startDatetime: new Date("2025-06-16T00:00:00Z"),
307
- endDatetime: new Date("2025-06-17T00:00:00Z"),
306
+ startDatetime: new Date("2025-06-23T00:00:00Z"),
307
+ endDatetime: new Date("2025-06-24T00:00:00Z"),
308
308
  },
309
309
  });
310
310
 
@@ -340,8 +340,8 @@ async function run() {
340
340
  1,
341
341
  ],
342
342
  conditions: {},
343
- startDatetime: new Date("2025-06-16T00:00:00Z"),
344
- endDatetime: new Date("2025-06-17T00:00:00Z"),
343
+ startDatetime: new Date("2025-06-23T00:00:00Z"),
344
+ endDatetime: new Date("2025-06-24T00:00:00Z"),
345
345
  },
346
346
  });
347
347
 
@@ -0,0 +1,16 @@
1
+ import { SyllableSDKCore } from "../core.js";
2
+ import { RequestOptions } from "../lib/sdks.js";
3
+ import * as components from "../models/components/index.js";
4
+ import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
5
+ import * as errors from "../models/errors/index.js";
6
+ import { SDKError } from "../models/errors/sdkerror.js";
7
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
8
+ import { Result } from "../types/fp.js";
9
+ /**
10
+ * Create Organization
11
+ *
12
+ * @remarks
13
+ * Create a new organization.
14
+ */
15
+ export declare function organizationsCreate(client: SyllableSDKCore, request: components.BodyOrganizationsCreate, options?: RequestOptions): Promise<Result<components.OrganizationResponse, errors.HTTPValidationError | SDKError | SDKValidationError | UnexpectedClientError | InvalidRequestError | RequestAbortedError | RequestTimeoutError | ConnectionError>>;
16
+ //# sourceMappingURL=organizationsCreate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"organizationsCreate.d.ts","sourceRoot":"","sources":["../src/funcs/organizationsCreate.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAM7C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAE5E,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAGxC;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,eAAe,EACvB,OAAO,EAAE,UAAU,CAAC,uBAAuB,EAC3C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CACR,MAAM,CACJ,UAAU,CAAC,oBAAoB,EAC7B,MAAM,CAAC,mBAAmB,GAC1B,QAAQ,GACR,kBAAkB,GAClB,qBAAqB,GACrB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,eAAe,CAClB,CACF,CA0GA"}
@@ -0,0 +1,120 @@
1
+ "use strict";
2
+ /*
3
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.organizationsCreate = organizationsCreate;
30
+ const encodings_js_1 = require("../lib/encodings.js");
31
+ const files_js_1 = require("../lib/files.js");
32
+ const M = __importStar(require("../lib/matchers.js"));
33
+ const primitives_js_1 = require("../lib/primitives.js");
34
+ const schemas_js_1 = require("../lib/schemas.js");
35
+ const security_js_1 = require("../lib/security.js");
36
+ const url_js_1 = require("../lib/url.js");
37
+ const components = __importStar(require("../models/components/index.js"));
38
+ const errors = __importStar(require("../models/errors/index.js"));
39
+ const blobs_js_1 = require("../types/blobs.js");
40
+ const streams_js_1 = require("../types/streams.js");
41
+ /**
42
+ * Create Organization
43
+ *
44
+ * @remarks
45
+ * Create a new organization.
46
+ */
47
+ async function organizationsCreate(client, request, options) {
48
+ const parsed = (0, schemas_js_1.safeParse)(request, (value) => components.BodyOrganizationsCreate$outboundSchema.parse(value), "Input validation failed");
49
+ if (!parsed.ok) {
50
+ return parsed;
51
+ }
52
+ const payload = parsed.value;
53
+ const body = new FormData();
54
+ (0, encodings_js_1.appendForm)(body, "display_name", payload.display_name);
55
+ (0, encodings_js_1.appendForm)(body, "domains", payload.domains);
56
+ if ((0, blobs_js_1.isBlobLike)(payload.logo)) {
57
+ (0, encodings_js_1.appendForm)(body, "logo", payload.logo);
58
+ }
59
+ else if ((0, streams_js_1.isReadableStream)(payload.logo.content)) {
60
+ const buffer = await (0, files_js_1.readableStreamToArrayBuffer)(payload.logo.content);
61
+ const blob = new Blob([buffer], { type: "application/octet-stream" });
62
+ (0, encodings_js_1.appendForm)(body, "logo", blob);
63
+ }
64
+ else {
65
+ (0, encodings_js_1.appendForm)(body, "logo", new Blob([payload.logo.content], { type: "application/octet-stream" }), payload.logo.fileName);
66
+ }
67
+ if (payload.description !== undefined) {
68
+ (0, encodings_js_1.appendForm)(body, "description", payload.description);
69
+ }
70
+ const path = (0, url_js_1.pathToFunc)("/api/v1/organizations/")();
71
+ const headers = new Headers((0, primitives_js_1.compactMap)({
72
+ Accept: "application/json",
73
+ }));
74
+ const secConfig = await (0, security_js_1.extractSecurity)(client._options.apiKeyHeader);
75
+ const securityInput = secConfig == null ? {} : { apiKeyHeader: secConfig };
76
+ const requestSecurity = (0, security_js_1.resolveGlobalSecurity)(securityInput);
77
+ const context = {
78
+ baseURL: options?.serverURL ?? "",
79
+ operationID: "organizations_create",
80
+ oAuth2Scopes: [],
81
+ resolvedSecurity: requestSecurity,
82
+ securitySource: client._options.apiKeyHeader,
83
+ retryConfig: options?.retries
84
+ || client._options.retryConfig
85
+ || { strategy: "none" },
86
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
87
+ };
88
+ const requestRes = client._createRequest(context, {
89
+ security: requestSecurity,
90
+ method: "POST",
91
+ baseURL: options?.serverURL,
92
+ path: path,
93
+ headers: headers,
94
+ body: body,
95
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
96
+ }, options);
97
+ if (!requestRes.ok) {
98
+ return requestRes;
99
+ }
100
+ const req = requestRes.value;
101
+ const doResult = await client._do(req, {
102
+ context,
103
+ errorCodes: ["422", "4XX", "5XX"],
104
+ retryConfig: context.retryConfig,
105
+ retryCodes: context.retryCodes,
106
+ });
107
+ if (!doResult.ok) {
108
+ return doResult;
109
+ }
110
+ const response = doResult.value;
111
+ const responseFields = {
112
+ HttpMeta: { Response: response, Request: req },
113
+ };
114
+ const [result] = await M.match(M.json(200, components.OrganizationResponse$inboundSchema), M.jsonErr(422, errors.HTTPValidationError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, { extraFields: responseFields });
115
+ if (!result.ok) {
116
+ return result;
117
+ }
118
+ return result;
119
+ }
120
+ //# sourceMappingURL=organizationsCre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,CAAC,CAAC,KAAK,CAW5B,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC,kCAAkC,CAAC,EAC1D,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,iCAAiC,CAAC,EACxD,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EACb,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CACd,CAAC,QAAQ,EAAE,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC,CAAC;IAC7C,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { SyllableSDKCore } from "../core.js";
2
+ import { RequestOptions } from "../lib/sdks.js";
3
+ import * as components from "../models/components/index.js";
4
+ import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
5
+ import * as errors from "../models/errors/index.js";
6
+ import { SDKError } from "../models/errors/sdkerror.js";
7
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
8
+ import { Result } from "../types/fp.js";
9
+ /**
10
+ * Delete Current Organization
11
+ *
12
+ * @remarks
13
+ * Delete the current organization and all its users.
14
+ */
15
+ export declare function organizationsDelete(client: SyllableSDKCore, request?: components.BodyOrganizationsDelete | undefined, options?: RequestOptions): Promise<Result<any, errors.HTTPValidationError | SDKError | SDKValidationError | UnexpectedClientError | InvalidRequestError | RequestAbortedError | RequestTimeoutError | ConnectionError>>;
16
+ //# sourceMappingURL=organizationsDelete.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"organizationsDelete.d.ts","sourceRoot":"","sources":["../src/funcs/organizationsDelete.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAK7C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,eAAe,EACvB,OAAO,CAAC,EAAE,UAAU,CAAC,uBAAuB,GAAG,SAAS,EACxD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CACR,MAAM,CACJ,GAAG,EACD,MAAM,CAAC,mBAAmB,GAC1B,QAAQ,GACR,kBAAkB,GAClB,qBAAqB,GACrB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,eAAe,CAClB,CACF,CA2FA"}