ci: regenerated with OpenAPI Doc latest, Speakeasy CLI 1.390.1

This commit is contained in:
speakeasybot
2024-09-04 00:25:14 +00:00
parent 9d5aa012d5
commit 25ff2271e3
26 changed files with 216 additions and 100 deletions

View File

@@ -3,10 +3,10 @@ id: 599a9576-4665-431e-be1e-44cc13ef28aa
management:
docChecksum: dd4d04e62622de8f631720b5be68964d
docVersion: latest
speakeasyVersion: 1.385.0
generationVersion: 2.407.2
releaseVersion: 0.7.2
configChecksum: ed711ed185d766c457022634eb07a389
speakeasyVersion: 1.390.1
generationVersion: 2.409.0
releaseVersion: 0.8.0
configChecksum: ce348b09a6bede0bd69fc04a63e32148
repoURL: https://github.com/LukeHagar/discoursejs.git
repoSubDirectory: .
installationURL: https://github.com/LukeHagar/discoursejs
@@ -16,7 +16,7 @@ features:
additionalDependencies: 0.1.0
additionalProperties: 0.1.1
constsAndDefaults: 0.1.11
core: 3.14.2
core: 3.16.0
defaultEnabledRetries: 0.1.0
deprecations: 2.81.1
envVarSecurityUsage: 0.1.1
@@ -27,6 +27,7 @@ features:
responseFormat: 0.2.3
retries: 2.83.0
sdkHooks: 0.1.0
uploadStreams: 0.1.0
generatedFiles:
- src/funcs/backupsCreateBackup.ts
- src/funcs/backupsDownloadBackup.ts
@@ -156,6 +157,7 @@ generatedFiles:
- src/lib/config.ts
- src/lib/dlv.ts
- src/lib/encodings.ts
- src/lib/files.ts
- src/lib/http.ts
- src/lib/is-plain-object.ts
- src/lib/logger.ts
@@ -177,6 +179,7 @@ generatedFiles:
- src/sdk/types/index.ts
- src/sdk/types/operations.ts
- src/sdk/types/rfcdate.ts
- src/sdk/types/streams.ts
- tsconfig.json
- src/sdk/models/operations/createbackup.ts
- src/sdk/models/operations/downloadbackup.ts

View File

@@ -249,3 +249,13 @@ Based on:
- [typescript v0.7.2] .
### Releases
- [NPM v0.7.2] https://www.npmjs.com/package/@lukehagar/discoursejs/v/0.7.2 - .
## 2024-09-04 00:23:41
### Changes
Based on:
- OpenAPI Doc latest
- Speakeasy CLI 1.390.1 (2.409.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v0.8.0] .
### Releases
- [NPM v0.8.0] https://www.npmjs.com/package/@lukehagar/discoursejs/v/0.8.0 - .

View File

@@ -5,9 +5,7 @@
```typescript
import { CreateUploadRequestBody } from "@lukehagar/discoursejs/sdk/models/operations";
let value: CreateUploadRequestBody = {
type: "custom_emoji",
};
// No examples available for this model
```
## Fields

View File

@@ -8,19 +8,19 @@ file uploaded
import { CreateUploadResponseBody } from "@lukehagar/discoursejs/sdk/models/operations";
let value: CreateUploadResponseBody = {
extension: "mp4v",
filesize: 311486,
height: 416692,
extension: "jpg",
filesize: 567846,
height: 172195,
humanFilesize: "<value>",
id: 888616,
id: 621169,
originalFilename: "<value>",
retainHours: "<value>",
shortPath: "<value>",
shortUrl: "<value>",
thumbnailHeight: 810839,
thumbnailWidth: 697274,
url: "http://juvenile-cougar.biz",
width: 59383,
thumbnailHeight: 85076,
thumbnailWidth: 498180,
url: "http://tragic-tuba.name",
width: 763165,
};
```

View File

@@ -5,15 +5,12 @@
```typescript
import { FileT } from "@lukehagar/discoursejs/sdk/models/operations";
let value: FileT = {
content: new TextEncoder().encode("0x79ac3d1a9D"),
fileName: "your_file_here",
};
// No examples available for this model
```
## Fields
| Field | Type | Required | Description |
| ------------------ | ------------------ | ------------------ | ------------------ |
| `content` | *Uint8Array* | :heavy_check_mark: | N/A |
| `fileName` | *string* | :heavy_check_mark: | N/A |
| Field | Type | Required | Description |
| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- |
| `content` | *ReadableStream<Uint8Array>* | :heavy_check_mark: | N/A |
| `fileName` | *string* | :heavy_check_mark: | N/A |

View File

@@ -8,7 +8,7 @@ import { GeneratePresignedPutRequestBody } from "@lukehagar/discoursejs/sdk/mode
let value: GeneratePresignedPutRequestBody = {
fileName: "IMG_2021.jpeg",
fileSize: 4096,
type: "composer",
type: "profile_background",
};
```

View File

@@ -5,7 +5,7 @@
```typescript
import { Type } from "@lukehagar/discoursejs/sdk/models/operations";
let value: Type = "composer";
let value: Type = "profile_background";
```
## Values

View File

@@ -516,7 +516,7 @@ import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.admin.refreshGravatar("<value>");
const result = await sdk.admin.refreshGravatar("Frances39");
// Handle the result
console.log(result)
@@ -538,7 +538,7 @@ import { adminRefreshGravatar } from "@lukehagar/discoursejs/funcs/adminRefreshG
const sdk = new SDKCore();
async function run() {
const res = await adminRefreshGravatar(sdk, "<value>");
const res = await adminRefreshGravatar(sdk, "Jody_Pfannerstill");
if (!res.ok) {
throw res.error;

View File

@@ -91,7 +91,7 @@ import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
await sdk.backups.downloadBackup("<value>", "<value>");
await sdk.backups.downloadBackup("your_file_here", "<value>");
}
@@ -112,7 +112,7 @@ import { backupsDownloadBackup } from "@lukehagar/discoursejs/funcs/backupsDownl
const sdk = new SDKCore();
async function run() {
const res = await backupsDownloadBackup(sdk, "<value>", "<value>");
const res = await backupsDownloadBackup(sdk, "your_file_here", "<value>");
if (!res.ok) {
throw res.error;
@@ -227,7 +227,7 @@ import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
await sdk.backups.sendDownloadBackupEmail("<value>");
await sdk.backups.sendDownloadBackupEmail("your_file_here");
}
@@ -248,7 +248,7 @@ import { backupsSendDownloadBackupEmail } from "@lukehagar/discoursejs/funcs/bac
const sdk = new SDKCore();
async function run() {
const res = await backupsSendDownloadBackupEmail(sdk, "<value>");
const res = await backupsSendDownloadBackupEmail(sdk, "your_file_here");
if (!res.ok) {
throw res.error;

View File

@@ -227,7 +227,7 @@ import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.badges.listUserBadges("<value>");
const result = await sdk.badges.listUserBadges("Faustino28");
// Handle the result
console.log(result)
@@ -249,7 +249,7 @@ import { badgesListUserBadges } from "@lukehagar/discoursejs/funcs/badgesListUse
const sdk = new SDKCore();
async function run() {
const res = await badgesListUserBadges(sdk, "<value>");
const res = await badgesListUserBadges(sdk, "Eloisa_Davis");
if (!res.ok) {
throw res.error;

View File

@@ -101,7 +101,7 @@ import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.invites.inviteToTopic("<value>", "<value>", "<value>");
const result = await sdk.invites.inviteToTopic("<value>", "<value>", "<id>");
// Handle the result
console.log(result)
@@ -123,7 +123,7 @@ import { invitesInviteToTopic } from "@lukehagar/discoursejs/funcs/invitesInvite
const sdk = new SDKCore();
async function run() {
const res = await invitesInviteToTopic(sdk, "<value>", "<value>", "<value>");
const res = await invitesInviteToTopic(sdk, "<value>", "<value>", "<id>");
if (!res.ok) {
throw res.error;

View File

@@ -180,7 +180,7 @@ import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.posts.getPost("<value>");
const result = await sdk.posts.getPost("<id>");
// Handle the result
console.log(result)
@@ -202,7 +202,7 @@ import { postsGetPost } from "@lukehagar/discoursejs/funcs/postsGetPost.js";
const sdk = new SDKCore();
async function run() {
const res = await postsGetPost(sdk, "<value>");
const res = await postsGetPost(sdk, "<id>");
if (!res.ok) {
throw res.error;
@@ -320,7 +320,7 @@ import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.posts.lockPost("<value>", "<value>", "<value>");
const result = await sdk.posts.lockPost("<value>", "<value>", "<id>");
// Handle the result
console.log(result)
@@ -342,7 +342,7 @@ import { postsLockPost } from "@lukehagar/discoursejs/funcs/postsLockPost.js";
const sdk = new SDKCore();
async function run() {
const res = await postsLockPost(sdk, "<value>", "<value>", "<value>");
const res = await postsLockPost(sdk, "<value>", "<value>", "<id>");
if (!res.ok) {
throw res.error;
@@ -463,7 +463,7 @@ import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.posts.postReplies("<value>");
const result = await sdk.posts.postReplies("<id>");
// Handle the result
console.log(result)
@@ -485,7 +485,7 @@ import { postsPostReplies } from "@lukehagar/discoursejs/funcs/postsPostReplies.
const sdk = new SDKCore();
async function run() {
const res = await postsPostReplies(sdk, "<value>");
const res = await postsPostReplies(sdk, "<id>");
if (!res.ok) {
throw res.error;
@@ -532,7 +532,7 @@ import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.posts.updatePost("<value>");
const result = await sdk.posts.updatePost("<id>");
// Handle the result
console.log(result)
@@ -554,7 +554,7 @@ import { postsUpdatePost } from "@lukehagar/discoursejs/funcs/postsUpdatePost.js
const sdk = new SDKCore();
async function run() {
const res = await postsUpdatePost(sdk, "<value>");
const res = await postsUpdatePost(sdk, "<id>");
if (!res.ok) {
throw res.error;

View File

@@ -98,7 +98,7 @@ import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.privateMessages.getUserSentPrivateMessages("<value>");
const result = await sdk.privateMessages.getUserSentPrivateMessages("Nathanial38");
// Handle the result
console.log(result)
@@ -120,7 +120,7 @@ import { privateMessagesGetUserSentPrivateMessages } from "@lukehagar/discoursej
const sdk = new SDKCore();
async function run() {
const res = await privateMessagesGetUserSentPrivateMessages(sdk, "<value>");
const res = await privateMessagesGetUserSentPrivateMessages(sdk, "Ebba.Grant22");
if (!res.ok) {
throw res.error;
@@ -167,7 +167,7 @@ import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.privateMessages.listUserPrivateMessages("<value>");
const result = await sdk.privateMessages.listUserPrivateMessages("Liliana_West71");
// Handle the result
console.log(result)
@@ -189,7 +189,7 @@ import { privateMessagesListUserPrivateMessages } from "@lukehagar/discoursejs/f
const sdk = new SDKCore();
async function run() {
const res = await privateMessagesListUserPrivateMessages(sdk, "<value>");
const res = await privateMessagesListUserPrivateMessages(sdk, "Bonnie55");
if (!res.ok) {
throw res.error;

View File

@@ -162,7 +162,7 @@ import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.tags.getTagGroup("<value>");
const result = await sdk.tags.getTagGroup("<id>");
// Handle the result
console.log(result)
@@ -184,7 +184,7 @@ import { tagsGetTagGroup } from "@lukehagar/discoursejs/funcs/tagsGetTagGroup.js
const sdk = new SDKCore();
async function run() {
const res = await tagsGetTagGroup(sdk, "<value>");
const res = await tagsGetTagGroup(sdk, "<id>");
if (!res.ok) {
throw res.error;
@@ -367,7 +367,7 @@ import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.tags.updateTagGroup("<value>");
const result = await sdk.tags.updateTagGroup("<id>");
// Handle the result
console.log(result)
@@ -389,7 +389,7 @@ import { tagsUpdateTagGroup } from "@lukehagar/discoursejs/funcs/tagsUpdateTagGr
const sdk = new SDKCore();
async function run() {
const res = await tagsUpdateTagGroup(sdk, "<value>");
const res = await tagsUpdateTagGroup(sdk, "<id>");
if (!res.ok) {
throw res.error;

View File

@@ -31,7 +31,7 @@ import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
await sdk.topics.bookmarkTopic("<value>", "<value>", "<value>");
await sdk.topics.bookmarkTopic("<value>", "<value>", "<id>");
}
@@ -52,7 +52,7 @@ import { topicsBookmarkTopic } from "@lukehagar/discoursejs/funcs/topicsBookmark
const sdk = new SDKCore();
async function run() {
const res = await topicsBookmarkTopic(sdk, "<value>", "<value>", "<value>");
const res = await topicsBookmarkTopic(sdk, "<value>", "<value>", "<id>");
if (!res.ok) {
throw res.error;
@@ -177,7 +177,7 @@ import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.topics.createTopicTimer("<value>", "<value>", "<value>", {
const result = await sdk.topics.createTopicTimer("<value>", "<value>", "<id>", {
time: "",
});
@@ -201,7 +201,7 @@ import { topicsCreateTopicTimer } from "@lukehagar/discoursejs/funcs/topicsCreat
const sdk = new SDKCore();
async function run() {
const res = await topicsCreateTopicTimer(sdk, "<value>", "<value>", "<value>", {
const res = await topicsCreateTopicTimer(sdk, "<value>", "<value>", "<id>", {
time: "",
});
@@ -253,7 +253,7 @@ import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.topics.getTopic("<value>", "<value>", "<value>");
const result = await sdk.topics.getTopic("<value>", "<value>", "<id>");
// Handle the result
console.log(result)
@@ -275,7 +275,7 @@ import { topicsGetTopic } from "@lukehagar/discoursejs/funcs/topicsGetTopic.js";
const sdk = new SDKCore();
async function run() {
const res = await topicsGetTopic(sdk, "<value>", "<value>", "<value>");
const res = await topicsGetTopic(sdk, "<value>", "<value>", "<id>");
if (!res.ok) {
throw res.error;
@@ -391,7 +391,7 @@ import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.topics.inviteToTopic("<value>", "<value>", "<value>");
const result = await sdk.topics.inviteToTopic("<value>", "<value>", "<id>");
// Handle the result
console.log(result)
@@ -413,7 +413,7 @@ import { topicsInviteToTopic } from "@lukehagar/discoursejs/funcs/topicsInviteTo
const sdk = new SDKCore();
async function run() {
const res = await topicsInviteToTopic(sdk, "<value>", "<value>", "<value>");
const res = await topicsInviteToTopic(sdk, "<value>", "<value>", "<id>");
if (!res.ok) {
throw res.error;
@@ -606,7 +606,7 @@ import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
await sdk.topics.removeTopic("<value>", "<value>", "<value>");
await sdk.topics.removeTopic("<value>", "<value>", "<id>");
}
@@ -627,7 +627,7 @@ import { topicsRemoveTopic } from "@lukehagar/discoursejs/funcs/topicsRemoveTopi
const sdk = new SDKCore();
async function run() {
const res = await topicsRemoveTopic(sdk, "<value>", "<value>", "<value>");
const res = await topicsRemoveTopic(sdk, "<value>", "<value>", "<id>");
if (!res.ok) {
throw res.error;
@@ -675,7 +675,7 @@ import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.topics.setNotificationLevel("<value>", "<value>", "<value>");
const result = await sdk.topics.setNotificationLevel("<value>", "<value>", "<id>");
// Handle the result
console.log(result)
@@ -697,7 +697,7 @@ import { topicsSetNotificationLevel } from "@lukehagar/discoursejs/funcs/topicsS
const sdk = new SDKCore();
async function run() {
const res = await topicsSetNotificationLevel(sdk, "<value>", "<value>", "<value>");
const res = await topicsSetNotificationLevel(sdk, "<value>", "<value>", "<id>");
if (!res.ok) {
throw res.error;
@@ -747,7 +747,7 @@ import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.topics.updateTopic("<value>", "<value>", "<value>");
const result = await sdk.topics.updateTopic("<value>", "<value>", "<id>");
// Handle the result
console.log(result)
@@ -769,7 +769,7 @@ import { topicsUpdateTopic } from "@lukehagar/discoursejs/funcs/topicsUpdateTopi
const sdk = new SDKCore();
async function run() {
const res = await topicsUpdateTopic(sdk, "<value>", "<value>", "<value>");
const res = await topicsUpdateTopic(sdk, "<value>", "<value>", "<id>");
if (!res.ok) {
throw res.error;
@@ -819,7 +819,7 @@ import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.topics.updateTopicStatus("<value>", "<value>", "<value>", {
const result = await sdk.topics.updateTopicStatus("<value>", "<value>", "<id>", {
enabled: "false",
status: "pinned_globally",
until: "2030-12-31",
@@ -845,7 +845,7 @@ import { topicsUpdateTopicStatus } from "@lukehagar/discoursejs/funcs/topicsUpda
const sdk = new SDKCore();
async function run() {
const res = await topicsUpdateTopicStatus(sdk, "<value>", "<value>", "<value>", {
const res = await topicsUpdateTopicStatus(sdk, "<value>", "<value>", "<id>", {
enabled: "true",
status: "visible",
until: "2030-12-31",
@@ -899,7 +899,7 @@ import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.topics.updateTopicTimestamp("<value>", "<value>", "<value>", {
const result = await sdk.topics.updateTopicTimestamp("<value>", "<value>", "<id>", {
timestamp: "1594291380",
});
@@ -923,7 +923,7 @@ import { topicsUpdateTopicTimestamp } from "@lukehagar/discoursejs/funcs/topicsU
const sdk = new SDKCore();
async function run() {
const res = await topicsUpdateTopicTimestamp(sdk, "<value>", "<value>", "<value>", {
const res = await topicsUpdateTopicTimestamp(sdk, "<value>", "<value>", "<id>", {
timestamp: "1594291380",
});

View File

@@ -600,7 +600,7 @@ import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.users.getUser("<value>", "<value>", "<value>");
const result = await sdk.users.getUser("<value>", "<value>", "Ned56");
// Handle the result
console.log(result)
@@ -622,7 +622,7 @@ import { usersGetUser } from "@lukehagar/discoursejs/funcs/usersGetUser.js";
const sdk = new SDKCore();
async function run() {
const res = await usersGetUser(sdk, "<value>", "<value>", "<value>");
const res = await usersGetUser(sdk, "<value>", "<value>", "Herta61");
if (!res.ok) {
throw res.error;
@@ -671,7 +671,7 @@ import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.users.getUserEmails("<value>");
const result = await sdk.users.getUserEmails("Winifred_OConner64");
// Handle the result
console.log(result)
@@ -693,7 +693,7 @@ import { usersGetUserEmails } from "@lukehagar/discoursejs/funcs/usersGetUserEma
const sdk = new SDKCore();
async function run() {
const res = await usersGetUserEmails(sdk, "<value>");
const res = await usersGetUserEmails(sdk, "Blair_Luettgen46");
if (!res.ok) {
throw res.error;
@@ -883,7 +883,7 @@ import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.users.listUserActions("<value>", 620550, "<value>");
const result = await sdk.users.listUserActions("<value>", 620550, "Deondre75");
// Handle the result
console.log(result)
@@ -905,7 +905,7 @@ import { usersListUserActions } from "@lukehagar/discoursejs/funcs/usersListUser
const sdk = new SDKCore();
async function run() {
const res = await usersListUserActions(sdk, "<value>", 257087, "<value>");
const res = await usersListUserActions(sdk, "<value>", 13410, "Augustus_Wuckert48");
if (!res.ok) {
throw res.error;
@@ -954,7 +954,7 @@ import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.users.listUserBadges("<value>");
const result = await sdk.users.listUserBadges("Faustino28");
// Handle the result
console.log(result)
@@ -976,7 +976,7 @@ import { usersListUserBadges } from "@lukehagar/discoursejs/funcs/usersListUserB
const sdk = new SDKCore();
async function run() {
const res = await usersListUserBadges(sdk, "<value>");
const res = await usersListUserBadges(sdk, "Eloisa_Davis");
if (!res.ok) {
throw res.error;
@@ -1164,7 +1164,7 @@ import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.users.refreshGravatar("<value>");
const result = await sdk.users.refreshGravatar("Frances39");
// Handle the result
console.log(result)
@@ -1186,7 +1186,7 @@ import { usersRefreshGravatar } from "@lukehagar/discoursejs/funcs/usersRefreshG
const sdk = new SDKCore();
async function run() {
const res = await usersRefreshGravatar(sdk, "<value>");
const res = await usersRefreshGravatar(sdk, "Jody_Pfannerstill");
if (!res.ok) {
throw res.error;
@@ -1456,7 +1456,7 @@ import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.users.updateAvatar("<value>");
const result = await sdk.users.updateAvatar("Kadin32");
// Handle the result
console.log(result)
@@ -1478,7 +1478,7 @@ import { usersUpdateAvatar } from "@lukehagar/discoursejs/funcs/usersUpdateAvata
const sdk = new SDKCore();
async function run() {
const res = await usersUpdateAvatar(sdk, "<value>");
const res = await usersUpdateAvatar(sdk, "Zion66");
if (!res.ok) {
throw res.error;
@@ -1526,7 +1526,7 @@ import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
await sdk.users.updateEmail("<value>");
await sdk.users.updateEmail("Hobart_Lakin34");
}
@@ -1547,7 +1547,7 @@ import { usersUpdateEmail } from "@lukehagar/discoursejs/funcs/usersUpdateEmail.
const sdk = new SDKCore();
async function run() {
const res = await usersUpdateEmail(sdk, "<value>");
const res = await usersUpdateEmail(sdk, "Madalyn90");
if (!res.ok) {
throw res.error;
@@ -1594,7 +1594,7 @@ import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.users.updateUser("<value>", "<value>", "<value>");
const result = await sdk.users.updateUser("<value>", "<value>", "Dandre.Jast32");
// Handle the result
console.log(result)
@@ -1616,7 +1616,7 @@ import { usersUpdateUser } from "@lukehagar/discoursejs/funcs/usersUpdateUser.js
const sdk = new SDKCore();
async function run() {
const res = await usersUpdateUser(sdk, "<value>", "<value>", "<value>");
const res = await usersUpdateUser(sdk, "<value>", "<value>", "Cora.Gislason");
if (!res.ok) {
throw res.error;
@@ -1666,7 +1666,7 @@ import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
await sdk.users.updateUsername("<value>");
await sdk.users.updateUsername("Avis_Tremblay74");
}
@@ -1687,7 +1687,7 @@ import { usersUpdateUsername } from "@lukehagar/discoursejs/funcs/usersUpdateUse
const sdk = new SDKCore();
async function run() {
const res = await usersUpdateUsername(sdk, "<value>");
const res = await usersUpdateUsername(sdk, "Taurean_Flatley");
if (!res.ok) {
throw res.error;

View File

@@ -11,7 +11,7 @@ generation:
auth:
oAuth2ClientCredentialsEnabled: false
typescript:
version: 0.7.2
version: 0.8.0
additionalDependencies:
dependencies: {}
devDependencies: {}

View File

@@ -2,7 +2,7 @@
{
"name": "@lukehagar/discoursejs",
"version": "0.7.2",
"version": "0.8.0",
"exports": {
".": "./src/index.ts",
"./sdk/models/errors": "./src/sdk/models/errors/index.ts",

View File

@@ -1,6 +1,6 @@
{
"name": "@lukehagar/discoursejs",
"version": "0.7.2",
"version": "0.8.0",
"author": "LukeHagar",
"main": "./index.js",
"sideEffects": false,
@@ -18,6 +18,7 @@
"zod": ">= 3"
},
"devDependencies": {
"@types/node": "^18.19.3",
"@typescript-eslint/eslint-plugin": "^7.7.1",
"@typescript-eslint/parser": "^7.7.1",
"eslint": "^8.57.0",

View File

@@ -3,6 +3,7 @@
*/
import { SDKCore } from "../core.js";
import { readableStreamToArrayBuffer } from "../lib/files.js";
import * as m$ from "../lib/matchers.js";
import * as schemas$ from "../lib/schemas.js";
import { RequestOptions } from "../lib/sdks.js";
@@ -19,6 +20,7 @@ import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
import { isBlobLike } from "../sdk/types/blobs.js";
import { Result } from "../sdk/types/fp.js";
import { isReadableStream } from "../sdk/types/streams.js";
/**
* Creates an upload
@@ -56,6 +58,10 @@ export async function uploadsCreateUpload(
if (payload$?.file !== undefined) {
if (isBlobLike(payload$?.file)) {
body$.append("file", payload$?.file);
} else if (isReadableStream(payload$?.file.content)) {
const buffer = await readableStreamToArrayBuffer(payload$?.file.content);
const blob = new Blob([buffer], { type: "application/octet-stream" });
body$.append("file", blob);
} else {
body$.append(
"file",

View File

@@ -4,3 +4,4 @@
export * from "./sdk/sdk.js";
export * from "./lib/config.js";
export * as files from "./lib/files.js";

View File

@@ -60,7 +60,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
export const SDK_METADATA = {
language: "typescript",
openapiDocVersion: "latest",
sdkVersion: "0.7.2",
genVersion: "2.407.2",
userAgent: "speakeasy-sdk/typescript 0.7.2 2.407.2 latest @lukehagar/discoursejs",
sdkVersion: "0.8.0",
genVersion: "2.409.0",
userAgent: "speakeasy-sdk/typescript 0.8.0 2.409.0 latest @lukehagar/discoursejs",
} as const;

58
src/lib/files.ts Normal file
View File

@@ -0,0 +1,58 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import { Readable } from "stream";
import { createReadStream } from "fs";
import { readFile } from "fs/promises";
export function toStream(filePath: string): ReadableStream<Uint8Array> {
return Readable.toWeb(
createReadStream(filePath),
) as ReadableStream<Uint8Array>;
}
export async function toByteArray(filePath: string): Promise<Buffer> {
return readFile(filePath);
}
export async function toString(filePath: string): Promise<string> {
return readFile(filePath, "utf8");
}
/**
* Consumes a stream and returns a concatenated array buffer. Useful in
* situations where we need to read the whole file because it forms part of a
* larger payload containing other fields, and we can't modify the underlying
* request structure.
*/
export async function readableStreamToArrayBuffer(
readable: ReadableStream<Uint8Array>,
): Promise<ArrayBuffer> {
const reader = readable.getReader();
const chunks: Uint8Array[] = [];
let totalLength = 0;
let done = false;
while (!done) {
const { value, done: doneReading } = await reader.read();
if (doneReading) {
done = true;
} else {
chunks.push(value);
totalLength += value.length;
}
}
const concatenatedChunks = new Uint8Array(totalLength);
let offset = 0;
for (const chunk of chunks) {
concatenatedChunks.set(chunk, offset);
offset += chunk.length;
}
return concatenatedChunks.buffer;
}

View File

@@ -181,6 +181,18 @@ export class ClientSDK {
}
}
if (conf.body instanceof ReadableStream) {
if (!fetchOptions) {
fetchOptions = {
// @ts-expect-error see https://github.com/node-fetch/node-fetch/issues/1769
duplex: "half",
};
} else {
// @ts-expect-error see https://github.com/node-fetch/node-fetch/issues/1769
fetchOptions.duplex = "half";
}
}
let input;
try {
input = this.hooks$.beforeCreateRequest(context, {

View File

@@ -2,14 +2,13 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as b64$ from "../../../lib/base64.js";
import { remap as remap$ } from "../../../lib/primitives.js";
import { blobLikeSchema } from "../../types/blobs.js";
import { ClosedEnum } from "../../types/enums.js";
import * as z from "zod";
export type FileT = {
content: Uint8Array | string;
content: ReadableStream<Uint8Array> | Blob | ArrayBuffer | Buffer;
fileName: string;
};
@@ -57,19 +56,29 @@ export type CreateUploadResponseBody = {
/** @internal */
export const FileT$inboundSchema: z.ZodType<FileT, z.ZodTypeDef, unknown> = z.object({
content: b64$.zodInbound,
content: z.union([
z.instanceof(ReadableStream<Uint8Array>),
z.instanceof(Blob),
z.instanceof(ArrayBuffer),
z.instanceof(Buffer),
]),
fileName: z.string(),
});
/** @internal */
export type FileT$Outbound = {
content: Uint8Array;
content: ReadableStream<Uint8Array> | Blob | ArrayBuffer | Buffer;
fileName: string;
};
/** @internal */
export const FileT$outboundSchema: z.ZodType<FileT$Outbound, z.ZodTypeDef, FileT> = z.object({
content: b64$.zodOutbound,
content: z.union([
z.instanceof(ReadableStream<Uint8Array>),
z.instanceof(Blob),
z.instanceof(ArrayBuffer),
z.instanceof(Buffer),
]),
fileName: z.string(),
});

21
src/sdk/types/streams.ts Normal file
View File

@@ -0,0 +1,21 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
export function isReadableStream<T = Uint8Array>(
val: unknown,
): val is ReadableStream<T> {
if (typeof val !== "object" || val === null) {
return false;
}
// Check for the presence of methods specific to ReadableStream
const stream = val as ReadableStream<Uint8Array>;
// ReadableStream has methods like getReader, cancel, and tee
return (
typeof stream.getReader === "function" &&
typeof stream.cancel === "function" &&
typeof stream.tee === "function"
);
}